Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2370915rdb; Mon, 20 Nov 2023 09:07:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFiwg42HvOIW1jPmi1Ebe800GaPXgzCsgN6BOxSd7dtZEX89LObupNWQdv/8LFt4pVmGdVi X-Received: by 2002:a05:6870:e0cc:b0:1ea:2e2c:e9e7 with SMTP id a12-20020a056870e0cc00b001ea2e2ce9e7mr10569523oab.59.1700500026506; Mon, 20 Nov 2023 09:07:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700500026; cv=none; d=google.com; s=arc-20160816; b=n6hpY6t52UWJPXbVUjC3iI1AR9fTYz6BOBT7/F//jSNB54XNHKSrqhZrSzA53u/U6k kHs/DAMgCAV+SCL5sCSzFGlbahNQIoGRf/Rum/WJwo1yDTVQIq3fES8NB5FlygqNmI5t jXhc3r/Yuq2Wg8Kys76MkN+utwV6zavb0byu6Hcge36TtWVP+bKn5kO5sy95cgLC13KT Yd7h1AucOHCm4U5qQ6OZQ0Y6lOaRtRPBnmW4fSgqf6yGvO3pPDsDW3OI5SkOt3j3xNP+ yw6x3P9Lki2YZq36OY7b74vGXFFeNLNb8FGjrDux8r4gXmvgEyg4BnEQFak+RDaKviKS Sc6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=0N+JeDCct2n4pgXnrJDil9hLa2D4hq87laHaGCbNG30=; fh=djCqQyCPITk/fGPikTLjejqXUdBjmgm6+WoI1E5KrDk=; b=g70z5CdHI7Khqep/bVQoxySSmNDf1eD/+HUSqNefXRkS2a7e+pp/TDpyzvEu8FtSQw yd+1/l4Qf0SwdOEIC/lUNzdgmqw7FHcu0KHIyevxZ7YJsqn8i9GVojHHTdhRHxIiyuuU pEMArD45itkhQiZxiUfxbYJ4KUYdvVeNa2ivMnd8iJnSeBibecqrmIHRkab1CJqJcnpk /WkeekKJ26VBQrVUTMhPOdY0qGabFp8yWjNL7JVp9gjAk4/a0TI48wfrS+XeMg55eMZe LPtkFdJGKxeXsfoBedmdCj6WBluxyum1t3HebHfzTUm1lrJ4zPe2O1FGWeGIvb8v4MuD lGrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=elgohwiw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id lm26-20020a0568703d9a00b001efaf29ba93si3058292oab.181.2023.11.20.09.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 09:07:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=elgohwiw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 65F0480AD9B0; Mon, 20 Nov 2023 09:07:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231859AbjKTRGa (ORCPT + 99 others); Mon, 20 Nov 2023 12:06:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231586AbjKTRGR (ORCPT ); Mon, 20 Nov 2023 12:06:17 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A760AD8; Mon, 20 Nov 2023 09:06:12 -0800 (PST) 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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_Clement?= , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.12.3 X-GND-Sasl: theo.lebrun@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 09:07:00 -0800 (PST) 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 --- 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) -- 2.42.0