From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418AbdBNM2u (ORCPT ); Tue, 14 Feb 2017 07:28:50 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:65437 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752330AbdBNM2I (ORCPT ); Tue, 14 Feb 2017 07:28:08 -0500 Subject: Re: [PATCH v13 06/12] usb: xhci: use bus->sysdev for DMA configuration To: Arnd Bergmann References: <1486776443-2280-1-git-send-email-peter.chen@nxp.com> <1486776443-2280-7-git-send-email-peter.chen@nxp.com> CC: Peter Chen , gregkh , , Ulf Hansson , Mark Brown , , Rob Herring , Shawn Guo , , , Mark Rutland , Heiko Stuebner , , , , Vivek Gautam , Sriram Dash , , , , Krzysztof Kozlowski , , , , , , , , Alexander Sverdlin , Mathias Nyman , Linux ARM , , , Baolin Wang , , Linux Kernel Mailing List , , From: Roger Quadros Message-ID: Date: Tue, 14 Feb 2017 14:26:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/02/17 13:44, Arnd Bergmann wrote: > On Tue, Feb 14, 2017 at 11:36 AM, Roger Quadros wrote: >> On 11/02/17 03:27, Peter Chen wrote: >>> From: Arnd Bergmann >>> >>> For xhci-hcd platform device, all the DMA parameters are not >>> configured properly, notably dma ops for dwc3 devices. So, set >>> the dma for xhci from sysdev. sysdev is pointing to device that >>> is known to the system firmware or hardware. >>> >>> Cc: Baolin Wang >>> Cc: Vivek Gautam >>> Cc: Alexander Sverdlin >>> Cc: Mathias Nyman >>> >>> Signed-off-by: Arnd Bergmann >>> Signed-off-by: Sriram Dash >>> --- >>> Hi, Baolin, Vivek and Alexander, >>> I removed your tested-by tag due to add one change that adding sysdev >>> for shared hcd too, if your test shows this change works for you or >>> has no effect for you, please consider adding tested-by tag again, >>> thanks. > >>> @@ -222,20 +241,20 @@ static int xhci_plat_probe(struct platform_device *pdev) >>> >>> xhci->clk = clk; >>> xhci->main_hcd = hcd; >>> - xhci->shared_hcd = usb_create_shared_hcd(driver, &pdev->dev, >>> + xhci->shared_hcd = __usb_create_hcd(driver, sysdev, &pdev->dev, >>> dev_name(&pdev->dev), hcd); >>> if (!xhci->shared_hcd) { >>> ret = -ENOMEM; >>> goto disable_clk; >>> } >>> >>> - if (device_property_read_bool(&pdev->dev, "usb3-lpm-capable")) >>> + if (device_property_read_bool(sysdev, "usb3-lpm-capable")) >> >> Why are we using sysdev to read DT property? We should be using the >> XHCI device (&pdev->dev) here, no? > > If I remember correctly, this is one of the cases where pdev does not > have a device node attached to it because it was created by the driver > of the parent device on the fly in case of dwc3. When you have a pure xhci > device in DT, the two pointers are the same. >>From drivers/usb/dwc3/host.c > if (dwc->usb3_lpm_capable) { > props[0].name = "usb3-lpm-capable"; > ret = platform_device_add_properties(xhci, props); > if (ret) { > dev_err(dwc->dev, "failed to add properties to xHCI\n"); > goto err1; > } > } So it is setting the usb3-lpm-capable property into the xhci platform device and we should be reading the property from there. -- cheers, -roger