Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp366267ybt; Wed, 17 Jun 2020 03:04:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNp1Vohw/Z7Xrb0d/gyJgM1tmxSlthZKvtFuAZ4kIAe2SbYvt5XNA4X4CaUH619jqw3PlN X-Received: by 2002:a17:906:2507:: with SMTP id i7mr6539526ejb.419.1592388297258; Wed, 17 Jun 2020 03:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592388297; cv=none; d=google.com; s=arc-20160816; b=c8zgFKEnmSPSjwJQBkHSw1hx1RWi+GbEU+C8MJBdCOVBNNmfJKKuiBv8dsPb/F/a3l Iv/OiqpNh7W24F7phbJkfLTTs6JH775iLF9UQB9sprmgyzf6xYYO46uFcWJQDiZiOLGa v7MVjhYePcZPSsnhRxnPP8CBzSuB7yT6READI/EEikYSOTapYf+GobRsZBElleQuOGrP 5pLnBX4pOnhwcicQ+aArcLiiWo4J+a0yht54CG/AWir0u10O9rhRsY0FwBRZduNZOgl0 4JVZNO2qvZn74Zh5hxIdt0H58d/UOVVMSHcxOpGZg6Y76QNwJUzYGGH63QBrbhtAQhlo t+MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=plwemODl+LhpuxRclIfs/x04gqbQUy1TaoPmZlJ8EIE=; b=CbxqQGO6zC8vZyYkZwXs82uaHM8qzgVnHz8eC5Wzr4ymD04EI89U3gBOgr4pyGnZWt 28kXvgDzeiTJlo7DxP1BZ+dF7zyGCzrPZBkLie2IZ8aphJD8SruEiDLDOI3IFJeAotz/ UihDUd6N4p5VhcI5XjQ7SmGXMeXXVQ9uy0e1P4wZGgUK226qW/PbmbaLhFi3ogdOnaSz 0/thmBCTSSxe+DFM06BZohLKpVQIjwsjp02Bw+Pd9sByfE+V2h4OKnOt/yR4QamrbeeU ouYk0FHEC6stOnWd+76qqHaaU4qwJmmqFnTe60TChK4O1vGvgOWtiFWBfZElHJeniuVz dFGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id be4si12552515edb.610.2020.06.17.03.04.33; Wed, 17 Jun 2020 03:04:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbgFQKCp convert rfc822-to-8bit (ORCPT + 99 others); Wed, 17 Jun 2020 06:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbgFQKCo (ORCPT ); Wed, 17 Jun 2020 06:02:44 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA2B7C061573 for ; Wed, 17 Jun 2020 03:02:43 -0700 (PDT) Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlUty-0004vi-20; Wed, 17 Jun 2020 12:02:38 +0200 Received: from pza by lupine with local (Exim 4.92) (envelope-from ) id 1jlUtw-0004iI-Cc; Wed, 17 Jun 2020 12:02:36 +0200 Message-ID: <70fc0b8dd6d1a6b39fb5d334ff86265cd84d8979.camel@pengutronix.de> Subject: Re: [PATCH v3 5/9] usb: xhci-pci: Add support for reset controllers From: Philipp Zabel To: Nicolas Saenz Julienne , f.fainelli@gmail.com, gregkh@linuxfoundation.org, wahrenst@gmx.net, linux-kernel@vger.kernel.org, Mathias Nyman Cc: linux-usb@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, tim.gover@raspberrypi.org, linux-pci@vger.kernel.org, helgaas@kernel.org, andy.shevchenko@gmail.com, mathias.nyman@linux.intel.com, lorenzo.pieralisi@arm.com Date: Wed, 17 Jun 2020 12:02:36 +0200 In-Reply-To: <20200612171334.26385-6-nsaenzjulienne@suse.de> References: <20200612171334.26385-1-nsaenzjulienne@suse.de> <20200612171334.26385-6-nsaenzjulienne@suse.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-06-12 at 19:13 +0200, Nicolas Saenz Julienne wrote: > Some atypical users of xhci-pci might need to manually reset their xHCI > controller before starting the HCD setup. Check if a reset controller > device is available to the PCI bus and trigger a reset. > > Signed-off-by: Nicolas Saenz Julienne > > --- > > Changes since v2: > - Also reset on resume > > Changes since v1: > - Use proper reset API > - Make code simpler > > drivers/usb/host/xhci-pci.c | 10 ++++++++++ > drivers/usb/host/xhci.h | 2 ++ > 2 files changed, 12 insertions(+) > > diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c > index ef513c2fb843..e76b9283faa3 100644 > --- a/drivers/usb/host/xhci-pci.c > +++ b/drivers/usb/host/xhci-pci.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > > #include "xhci.h" > #include "xhci-trace.h" > @@ -339,6 +340,7 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) > struct xhci_hcd *xhci; > struct usb_hcd *hcd; > struct xhci_driver_data *driver_data; > + struct reset_control *reset; > > driver_data = (struct xhci_driver_data *)id->driver_data; > if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) { > @@ -347,6 +349,11 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) > return retval; > } > > + reset = devm_reset_control_get_optional_exclusive(&dev->bus->dev, NULL); > + if (IS_ERR(reset)) > + return PTR_ERR(reset); > + reset_control_reset(reset); Reviewed-by: Philipp Zabel regards Philipp