From patchwork Fri Feb 23 16:05:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 205487 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp687993dyb; Fri, 23 Feb 2024 08:17:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWtAE9nM5cEsRa/vjMZGTXrZZ/fu0hfOETTu7JPWEolc4vOc/uXCzJVRgKBwjEA8XbBzOrzN9v5wSfyAXvlkVv+UkdJDQ== X-Google-Smtp-Source: AGHT+IHzatw0dmExUDxiUjSxoHrj69xYtqkil5hDxf0ZmclVA0COKDwU+n9c53JrijitXS1DbM+E X-Received: by 2002:a17:906:5959:b0:a3f:92a9:43b4 with SMTP id g25-20020a170906595900b00a3f92a943b4mr166384ejr.70.1708705036570; Fri, 23 Feb 2024 08:17:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708705036; cv=pass; d=google.com; s=arc-20160816; b=YIoAY8hN6Y3hOvA6h65lpL2JXGF8UT3TrVyAORknJ2Sb/09y2F49IRh4oyPzaDVSY6 CIPc7zahbVzQDMvdaKpFLp7qf8BECHZx93sdl4rWSBxJqtfoca6Isf2YH2wrFChTfdRL M1zoKIUKuEMtroYlxk/ZbdsWSNYMbtw4/Bxn1xDIuwBGuBJLt0OF0OFDVcCXxUI3wNRj J/nIgUQ8HFqtX5IsAIqui2QsE9NNcs9ePcVXxa1ghO/bk8K5mBq/PnrQg47oGfeD+qVE K6CJQ47o0/8QRrIRFPGHIZ2F4+pQ2ri8czNtz/+obs7r8WPv1mtD85df5PO3zmsNu8La /+Hg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=niMPY3vxyYJLUrRJjUWlI9ZbKbPa7LOQCtP7P5fEvVA=; fh=ETrV/TJQ0D54aecHJ7+ZWHft2hV1Bw4fCfbLWnN7i4U=; b=RLpQ4Zx6WFdgvJna+cyEfcOYkibu2jjtSmFdHmPy726w3QoCnbN3dH1VJ6IGmPPkq5 wME7yPYqLwFF0Hcz+jKODwUjYC74Qt/KoC567GSayhCfQbUgvVu9hHI9Y7vl9kJ/ZaLs i3yeER5l/It1FXSgGv6OeYy7ci0ZYrQjGR4I8h01ivkP+YihQDBgb5KNnEJqLeHrbcv6 /2EP+JtkMNrheWAZuh6dBK4bPQHje6Eu0OOuD1tuFlGZaMwgpO9s5pjaunfyPH4CPkyg Rlvt+NCG/LADMo0A6O1Uu5+Uh59aKJ2HvKQsNW9zszNDYyN/+blIPMxWc9aIlCQx+yoX Ld1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CbYTeVT1; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-78670-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78670-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w18-20020a1709064a1200b00a400cd999cfsi413979eju.516.2024.02.23.08.17.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 08:17:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78670-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CbYTeVT1; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-78670-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78670-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EA2AC1F27874 for ; Fri, 23 Feb 2024 16:07:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC8E582D66; Fri, 23 Feb 2024 16:05:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="CbYTeVT1" Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99A678528C; Fri, 23 Feb 2024 16:05:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708704339; cv=none; b=ZObeik9mcIHBjRo8UMzlrOJpHoZYQdgnCwrrHYCfJ/Fy7cIp8bq8cm8a1Y4xfxOBL32YJq4gXmwzMGmqjZ1lCezJTGYqVZRWZRHqOCE/m9vHafeiUNuYmPPdDwVbzCENb2GirSlDIqI5QVPI6sfiBXaCjNEkAIWqSY/C8IuhRWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708704339; c=relaxed/simple; bh=bFDA1LotbYhuGH+XHfjRA2gzFAO3dmkWnhvDgj5Uwl0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UmQTP0xaRpZF5wtSDCCDkIe85yO0mLAmyC/SlZKE0daAgI9J6+F1ELSyDYqPRPcKGbRIQ84dwXBdcq8I9vbfHckjePTq0mEqI3y0GFBPdH/cRFBAdmNDXUHcwKa2jI53mqu7Brwk7IW1nurtwDR/2pzfdm8Ez4JBL7pa/6JbkoQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=CbYTeVT1; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 542621C0009; Fri, 23 Feb 2024 16:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708704336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=niMPY3vxyYJLUrRJjUWlI9ZbKbPa7LOQCtP7P5fEvVA=; b=CbYTeVT1n4jzdpnFH9hgwWoam5OME+Lgp6+zcANJCgji931QgArC204kIdPKTiWfmTMYOq QMf/i9pOg4wRb5xEx3KOlcRaTUjd5ikZvEz1ohjrfky6plUOkYG0FNNN/T9R/BbDCedvqW o4EBWRNCNqcCaeASWWpfi/b9m3yUESL/GE04dD83N40PUyL9Z2pkRNo8R4Q4sKb+Nj/h1v zFIZyPDbBdOpaQx8Zs8ciIn9o+dE1fZnHxhhBQspkwUEMaiCZ9k/8kLxMfIpBOE9s5G+rL CiF4MHfz2XyLyUKrQ7F+d0Kd097nOjAk/Voqs6YXrN58oXTCjA4YKituAIx2tQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 23 Feb 2024 17:05:30 +0100 Subject: [PATCH v3 6/8] usb: cdns3: add quirk to platform data for reset-on-resume Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240223-j7200-usb-suspend-v3-6-b41c9893a130@bootlin.com> References: <20240223-j7200-usb-suspend-v3-0-b41c9893a130@bootlin.com> In-Reply-To: <20240223-j7200-usb-suspend-v3-0-b41c9893a130@bootlin.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Roger Quadros , Peter Chen , Pawel Laszczak , Nishanth Menon , Vignesh Raghavendra , Tero Kristo Cc: Thomas Petazzoni , =?utf-8?q?Gr=C3=A9gory_?= =?utf-8?q?Clement?= , Kevin Hilman , Alan Stern , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.13.0 X-GND-Sasl: theo.lebrun@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791707092278862080 X-GMAIL-MSGID: 1791707092278862080 The cdns3 host role does not care about reset-on-resume. xHCI however reconfigures itself in silence rather than printing a warning about a resume error. Related warning example: [ 16.017462] xhci-hcd xhci-hcd.1.auto: xHC error in resume, USBSTS 0x401, Reinit Allow passing a CDNS3_RESET_ON_RESUME quirk flag from cdns3 pdata down to xHCI pdata. The goal is to allow signaling about reset-on-resume behavior from platform wrapper drivers. When used, remote wakeup is not expected to work. Acked-by: Peter Chen Signed-off-by: Théo Lebrun --- drivers/usb/cdns3/core.h | 1 + drivers/usb/cdns3/host.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h index 81a9c9d6be08..7487067ba23f 100644 --- a/drivers/usb/cdns3/core.h +++ b/drivers/usb/cdns3/core.h @@ -44,6 +44,7 @@ struct cdns3_platform_data { bool suspend, bool wakeup); unsigned long quirks; #define CDNS3_DEFAULT_PM_RUNTIME_ALLOW BIT(0) +#define CDNS3_RESET_ON_RESUME BIT(1) }; /** diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c index 6164fc4c96a4..28c4d1deb231 100644 --- a/drivers/usb/cdns3/host.c +++ b/drivers/usb/cdns3/host.c @@ -91,6 +91,9 @@ static int __cdns_host_init(struct cdns *cdns) if (cdns->pdata && (cdns->pdata->quirks & CDNS3_DEFAULT_PM_RUNTIME_ALLOW)) cdns->xhci_plat_data->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW; + if (cdns->pdata && (cdns->pdata->quirks & CDNS3_RESET_ON_RESUME)) + cdns->xhci_plat_data->quirks |= XHCI_RESET_ON_RESUME; + ret = platform_device_add_data(xhci, cdns->xhci_plat_data, sizeof(struct xhci_plat_priv)); if (ret)