From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbdAPGnq (ORCPT ); Mon, 16 Jan 2017 01:43:46 -0500 Received: from regular1.263xmail.com ([211.150.99.132]:39914 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbdAPGn0 (ORCPT ); Mon, 16 Jan 2017 01:43:26 -0500 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-RL-SENDER: wulf@rock-chips.com X-FST-TO: stern@rowland.harvard.edu X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: wulf@rock-chips.com X-UNIQUE-TAG: <64cb93ab483ea8939d4f92337c07af92> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH] usb: host: xhci: plat: check hcc_params after add hcd To: Roger Quadros , William Wu , gregkh@linuxfoundation.org References: <1484277533-30273-1-git-send-email-william.wu@rock-chips.com> Cc: heiko@sntech.de, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-rockchip@lists.infradead.org, frank.wang@rock-chips.com, huangtao@rock-chips.com, dianders@google.com, groeck@google.com, stern@rowland.harvard.edu From: wlf Message-ID: Date: Mon, 16 Jan 2017 14:43:14 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Roger, 在 2017年01月13日 19:02, Roger Quadros 写道: > Hi, > > On 13/01/17 05:18, William Wu wrote: >> From: William wu >> >> The commit 4ac53087d6d4 ("usb: xhci: plat: Create both >> HCDs before adding them") move add hcd to the end of >> probe, this cause hcc_params uninitiated, because xHCI >> driver sets hcc_params in xhci_gen_setup() called from >> usb_add_hcd(). >> >> This patch checks the Maximum Primary Stream Array Size >> in the hcc_params register after add hcd. >> >> Signed-off-by: William wu >> --- >> drivers/usb/host/xhci-plat.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c >> index ddfab30..52ce697 100644 >> --- a/drivers/usb/host/xhci-plat.c >> +++ b/drivers/usb/host/xhci-plat.c >> @@ -232,9 +232,6 @@ static int xhci_plat_probe(struct platform_device *pdev) >> if (device_property_read_bool(&pdev->dev, "usb3-lpm-capable")) >> xhci->quirks |= XHCI_LPM_SUPPORT; >> >> - if (HCC_MAX_PSA(xhci->hcc_params) >= 4) >> - xhci->shared_hcd->can_do_streams = 1; >> - >> hcd->usb_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "usb-phy", 0); >> if (IS_ERR(hcd->usb_phy)) { >> ret = PTR_ERR(hcd->usb_phy); >> @@ -255,6 +252,9 @@ static int xhci_plat_probe(struct platform_device *pdev) >> if (ret) >> goto dealloc_usb2_hcd; >> >> + if (HCC_MAX_PSA(xhci->hcc_params) >= 4) >> + xhci->shared_hcd->can_do_streams = 1; >> + > xhci->hcc_params is initialized after the first usb_add_hcd(). > Should this bit come before the usb_add_hcd(xhci->shared_hcd,..)? Yes, good idea!I will move it behind the first usb_add_hcd(). > > You will also need to copy to v4.2+ . Thanks. OK, thank you for reminding me! > >> return 0; >> >> >> > cheers, > -roger > > >