From patchwork Mon Nov 20 17:06:05 2023 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: 13461612 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61CC9C2BB3F for ; Mon, 20 Nov 2023 17:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2XWldCH14qCh71hccwlpzgMo1VPig1mga/PyEFafmU0=; b=KZAsrQ7Ssr3Pr0 siF2pMRrt6mZ8Ham43YRXz0ZNXKcqi7eh1VhNRvygmS+QWi5bRpYOYVISklrdlYj1eAEXtNMvuj2j R00Nz2XhxmA1G8X+Ku882mz+RdeuUDNR3t7Snbozs4Ymy8fDm2LtRVxaoYrVyFLMt0/yV+fLrajAH kL3c3FonjQ4McC2eaJHncLQ58QOo4VxnWYGjEbA5oHixjfT7ImbZIs/gyWL/XFyiSvoDXVI5Mi3Qu xpH+dR1BKkogfCWlpJXyhRtf2KfsP3v3aFW3iUHjeAwUuVMjlqphAby9utTj2Czc8CDJVVzLr9L3J ivvshmkaPr0Sjsj4bxBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r57jC-00DaS0-1p; Mon, 20 Nov 2023 17:06:30 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r57iw-00DaAO-0T for linux-arm-kernel@lists.infradead.org; Mon, 20 Nov 2023 17:06:17 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id A5666E000F; Mon, 20 Nov 2023 17:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700499971; 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=0N+JeDCct2n4pgXnrJDil9hLa2D4hq87laHaGCbNG30=; b=elgohwiwWAZjxzqdb9A7uBO0ZwHANO1eYP4fdo/kWWYKEUkfmfWsVYsvVXRm1okOGrovnI z5ol2gOy7Bb5WApNszNoJLqthfBDIiDrPdxSUlipiqJqaJRQVPrYOTlP96oi5VYddLJc8E II3HhYNB1jq39Gnv6Qxh1Y8RP0ftX28Bdvfwbj8R2Jd2aN+aMLldFHwwXB5mzpIY08Kzj5 5U0jSMEsTHfEfCDvbrD+qY3TjtzCOVMRW/VcBo/6SY8XjGxHFWFteOlkrIpOlerf0CJzLF btqfyQGYF/sH44FpSXLniiTdnVcENmVeaV8jSwnnH7A1sdmtGmr64cqHHAUYXg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Mon, 20 Nov 2023 18:06:05 +0100 Subject: [PATCH v2 5/7] usb: cdns3: add quirk to platform data for reset-on-resume MIME-Version: 1.0 Message-Id: <20231120-j7200-usb-suspend-v2-5-038c7e4a3df4@bootlin.com> References: <20231120-j7200-usb-suspend-v2-0-038c7e4a3df4@bootlin.com> In-Reply-To: <20231120-j7200-usb-suspend-v2-0-038c7e4a3df4@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: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "Thomas Petazzoni thomas.petazzoni"@bootlin.com, =?utf-8?q?Gr=C3=A9gory_Cl?= =?utf-8?q?ement?= , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.12.3 X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231120_090614_401067_A0E7046A X-CRM114-Status: GOOD ( 11.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. Signed-off-by: Théo Lebrun Acked-by: Peter Chen --- 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)