Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp939324rbd; Fri, 23 Feb 2024 08:07:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUerdzfOyo/cz8Ys6gWXWAxU/g8PpZ0sK0nw+TztRxt7sw42dUxUZOXuEOa1zCOhcy0e0KLcCToQoscLUj1WfVWAoA4FdrdWbY8wkKhag== X-Google-Smtp-Source: AGHT+IGw2Fu4ISpvgH1miLNH0KnYAVNBX0fifIHV6ptMdDcETq6PDU8g1kwe5wSO6fGXvsnK0Vw1 X-Received: by 2002:a62:6307:0:b0:6e1:338d:e01c with SMTP id x7-20020a626307000000b006e1338de01cmr202349pfb.1.1708704462748; Fri, 23 Feb 2024 08:07:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708704462; cv=pass; d=google.com; s=arc-20160816; b=fToGwqzzkpZbbviuLmoE3abmZDadQUZva+MbsYoEM8z5A4XiAqIyDB4Zzzruhmq+Gp sDZEmKpxrPsfmcnKduH7Qrvca+ZOY+jZPpDOswD+5HHOANBk6RWdHQrsVn7wZvPej3LK 0LbISuNRE8ydF3Q9zvj2Gtqf8lDThpMFvNfV1n2zpKtg9ujJWsGLm51kO3tZniDzC5dL Okw1YyEaEGNjB/49Ke6lEAGj5O8QNRUZfQk3hhwOeoiR1rfTcr1gVI4atT6YwpDQGAX9 DvYVm2tbALPMJ51MshBimVrPi/hk48Gc8T/Wf8/CV35Mgin9Hoo0DEc3VliWHYyTZmsC sGGQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78670-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id cm17-20020a056a00339100b006e48943995dsi6129737pfb.279.2024.02.23.08.07.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 08:07:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78670-linux.lists.archive=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 1DD59288C6B for ; Fri, 23 Feb 2024 16:07:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E31912838C; Fri, 23 Feb 2024 16:05:40 +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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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_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 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) -- 2.43.2