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: 13569404 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 B52FEC54E41 for ; Fri, 23 Feb 2024 16:07:42 +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=B9QVlmPZO/e4cTnbWJEjfUhx52Yqk6Xg1TL5MegJhiM=; b=H/6pn9h/IFgukw m+yKlwcy82mmVuJ0Ykm5RqVqQp1ukgZVEY6qTwbE0rCwg1PUFIVrUl0+AYF5NrBfMEWuvVXX5my5E BuKdF3M233ESqWEYJGaSUMqnxpx2GrhnhlfqiO/QCERwRxismRGmn/NfeztRjRjMAaf3qgLFITkMU zI4GnakfVqYISrtTj/3sBeoLnzbbfxoa6cDOH1u4ZZzkUmiXAcag2FMC+Gafz8Yds3o9C+UfUjEIN xwWz6Y5xPHoQ65ixJvQ25/xsajvOnoexV0Fvc4bMruhRjGWw+yvExGKDUfzrJbv7IFjac6xxZ0O9P x2EAu4vib/rDBHCjruWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdY58-0000000A8nk-005f; Fri, 23 Feb 2024 16:07:26 +0000 Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdY3N-0000000A7xM-1nbR for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2024 16:05:40 +0000 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240223_080537_730333_7A977F37 X-CRM114-Status: GOOD ( 10.94 ) 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. 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)