Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp464555imj; Thu, 7 Feb 2019 07:03:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ5nP0dtRzJQYfX3gAMmYhlZGRldrU1dcZNKRV4Uk14NhV++Ol8Wh2jzxiXUpMZ0FU+w1YE X-Received: by 2002:a62:3141:: with SMTP id x62mr16462789pfx.12.1549551792375; Thu, 07 Feb 2019 07:03:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549551792; cv=none; d=google.com; s=arc-20160816; b=RgeXIQXrTxzr3/tERRBLteTsU9aPmaT0Ru7yS9J99d9EbXpizZDjozVgWgaze30iC3 uj4gJHysY1oxrhml+Y0QMsEIKcz5nynyErEQY2IAroxYTOBDQB2RaQD+ZvTwCVAtx96Z IVw4nsjaILpOempwSIEhLWAIjGBVjBVC6CwURa2//YeuBxuZTdSS0roSoOYrM+4qnJhk d3gcvkAJ33yzjoBLyy+6psEM0fBPlNelhPzML8Lftv+RhuWEd5tcnGU/k4d4wUPOe0WE K0jJUBnOm5FRAMZkGe1b/Sma+opaXF7ucTQAYvRDHUwzwnUgpf+x8WNQcDWgZp2zyCDE j+hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=fTHmMBVFfixuB1Xl1FDq11la4+xUjaP6VOMJeB1cnKE=; b=Ggj837ulkvTyZ4GIjoSTBDDo+9JVaXsjrWkJpopfG+0Yc+yyXU1Tq3PFaY9nOCsmao LOP33jiKsRMHH6ukareh1keWxMv+y1zhtbuMiG+Ozkz8o3dBN7SifVj7b4lVysiKOZ4F 0gowzOiFLU4+ckEOj5n1/zp0/zkjguI0kzN1lszHZOdOOQCEqERLxtpFHcedWZscC6E9 7WskPG2anZQNSZs6wzgCExqi8XU983SVNJPYzV9dN40yCTYQv2fJi9/5Ze2+fSdmMA8b MYDunlkPQN3pCO3alNeEo62VpiAI3NmeVU4VI9c1h21zUD5PStVdi4b6WZnj635FGSr0 g7ng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h91si9265952pld.411.2019.02.07.07.02.51; Thu, 07 Feb 2019 07:03:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbfBGPCe (ORCPT + 99 others); Thu, 7 Feb 2019 10:02:34 -0500 Received: from mga03.intel.com ([134.134.136.65]:17898 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbfBGPCe (ORCPT ); Thu, 7 Feb 2019 10:02:34 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2019 07:02:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,344,1544515200"; d="scan'208";a="317104420" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.164]) ([10.237.72.164]) by fmsmga006.fm.intel.com with ESMTP; 07 Feb 2019 07:02:30 -0800 Subject: Re: [PATCH 2/2] drivers: xhci: Add quirk to reset xHCI port PHY To: Srinath Mannam , Greg Kroah-Hartman , Mathias Nyman , Rob Herring , Mark Rutland Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <1549347534-11320-1-git-send-email-srinath.mannam@broadcom.com> <1549347534-11320-3-git-send-email-srinath.mannam@broadcom.com> From: Mathias Nyman Message-ID: <6392f206-9db2-5506-9e5d-cdf2b784d32e@linux.intel.com> Date: Thu, 7 Feb 2019 17:06:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1549347534-11320-3-git-send-email-srinath.mannam@broadcom.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05.02.2019 08:18, Srinath Mannam wrote: > Add a quirk to reset xHCI port PHY on port disconnect event. > Stingray USB HS PHY has an issue, that USB High Speed device detected > at Full Speed after the same port has connected to Full speed device. > This problem can be resolved with that port PHY reset on disconnect. > > Signed-off-by: Srinath Mannam > Reviewed-by: Ray Jui > --- > drivers/usb/core/hcd.c | 6 ++++++ > drivers/usb/core/phy.c | 21 +++++++++++++++++++++ > drivers/usb/core/phy.h | 1 + > drivers/usb/host/xhci-plat.c | 3 +++ > drivers/usb/host/xhci-ring.c | 9 ++++++--- > drivers/usb/host/xhci.h | 1 + > include/linux/usb/hcd.h | 1 + > 7 files changed, 39 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c > index 015b126..e2b87a6 100644 > --- a/drivers/usb/core/hcd.c > +++ b/drivers/usb/core/hcd.c > @@ -2663,6 +2663,12 @@ int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1) > return hcd->driver->find_raw_port_number(hcd, port1); > } > > +int usb_hcd_phy_port_reset(struct usb_hcd *hcd, int port) > +{ > + return usb_phy_roothub_port_reset(hcd->phy_roothub, port); > +} > +EXPORT_SYMBOL_GPL(usb_hcd_phy_port_reset); > + > static int usb_hcd_request_irqs(struct usb_hcd *hcd, > unsigned int irqnum, unsigned long irqflags) > { > diff --git a/drivers/usb/core/phy.c b/drivers/usb/core/phy.c > index 38b2c77..c64767d 100644 > --- a/drivers/usb/core/phy.c > +++ b/drivers/usb/core/phy.c > @@ -162,6 +162,27 @@ void usb_phy_roothub_power_off(struct usb_phy_roothub *phy_roothub) > } > EXPORT_SYMBOL_GPL(usb_phy_roothub_power_off); > > +int usb_phy_roothub_port_reset(struct usb_phy_roothub *phy_roothub, int port) > +{ > + struct usb_phy_roothub *roothub_entry; > + struct list_head *head; > + int i = 0; > + > + if (!phy_roothub) > + return -EINVAL; > + > + head = &phy_roothub->list; > + > + list_for_each_entry(roothub_entry, head, list) { > + if (i == port) > + return phy_reset(roothub_entry->phy); > + i++; > + } I'm not that familiar with SoC's that have several PHYs per controller, but this looks odd. For the above code to work wouldn't it require that each port has their own PHY, and the PHYs are added to the list of usb_phy_roothub is in the same order as usb ports? Or is there something I don't understand here? -Mathias