Re: [PATCH] usb: dwc3: OCTEON: add support for device tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/08/2016 02:54 AM, Felipe Balbi wrote:
[...]
> 
> octeon is going to be freed when ->remove() gets executed. You really
> don't need to do these. In fact, setting usbctl to NULL will break
> iounmap(). It seems to be me you don't need a remove at all.
> 
Hello Felipe.

I trimmed the recipients down to just the USB list. Our original code
had a start/setup hacked into the 'dwc3/core.c' file as shown below.
This function was responsible for setting up the USB clocks so that
the registers could be accessed. Obviously, this could not go upstream.
I attempted to put all of the USB clock initialization into the probe()
function in our 'dwc3-octeon.c' file. However, that approach does not
work. The dwc3_probe() function is called before dwc3_octeon_probe()
and the registers are not yet accessible. The dwc3 core code hangs
when attempting to call dwc3_cache_hwparams() for this reason. So,
instead I moved all the code out and into our platform code:

   device_initcall(dwc3_octeon_device_init);

This works just fine, but it would have been nice to put all that
code into the 'dwc3-octeon.c' probe() function. When looking at the
other glue code files, they appear to be reading and writing dwc3
registers just fine including clock registers on their platforms.
Just want to make sure our approach is correct/sane. Thanks.

Steve


@@ -839,6 +854,11 @@ static int dwc3_probe(struct platform_device *pdev)
        void __iomem            *regs;
        void                    *mem;

+#if defined(CONFIG_USB_XHCI_OCTEON) || defined(CONFIG_USB_XHCI_OCTEON_MODULE)
+       ret = xhci_octeon_start(pdev);
+       if (ret)
+               return ret;
+#endif
        mem = devm_kzalloc(dev, sizeof(*dwc) + DWC3_ALIGN_MASK, GFP_KERNEL);
        if (!mem)
                return -ENOMEM;
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux