From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Al Cooper <alcooperx@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Alan Stern <stern@rowland.harvard.edu>,
Arnd Bergmann <arnd@arndb.de>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
bcm-kernel-feedback-list@broadcom.com,
"David S. Miller" <davem@davemloft.net>,
devicetree@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Johan Hovold <johan@kernel.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
linux-usb@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
Mathias Nyman <mathias.nyman@intel.com>,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Rob Herring <robh+dt@kernel.org>, Rob Herring <robh@kernel.org>
Subject: Re: [PATCH 3/4] usb: ehci: Add new EHCI driver for Broadcom STB SoC's
Date: Fri, 13 Mar 2020 17:08:50 +0200 [thread overview]
Message-ID: <20200313150850.GV1922688@smile.fi.intel.com> (raw)
In-Reply-To: <20200313141545.31943-4-alcooperx@gmail.com>
On Fri, Mar 13, 2020 at 10:15:44AM -0400, Al Cooper wrote:
> Add a new EHCI driver for Broadcom STB SoC's. A new EHCI driver
> was created instead of adding support to the existing ehci platform
> driver because of the code required to workaround bugs in the EHCI
> controller.
I'm not sure this is the best approach, but I leave it to maintainers.
By the way, can you list what exactly the difference to the (generic)
ehci driver?
...
> +#include <linux/acpi.h>
> +#include <linux/clk.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/err.h>
> +#include <linux/kernel.h>
> +#include <linux/io.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/platform_device.h>
...
> +/* ehci_brcm_wait_for_sof
> + * Wait for start of next microframe, then wait extra delay microseconds
> + */
Style is inconsistent even inside this file.
> +static inline void ehci_brcm_wait_for_sof(struct ehci_hcd *ehci, u32 delay)
> +{
> + int frame_idx = ehci_readl(ehci, &ehci->regs->frame_index);
This is not needed if you use do {} while approach.
> +
> + while (frame_idx == ehci_readl(ehci, &ehci->regs->frame_index))
> + ;
Busy loop without even power management taking into consideration?
Infinite loop?
> + udelay(delay);
> +}
...
> +static const struct ehci_driver_overrides brcm_overrides __initconst = {
> +
> + .reset = ehci_brcm_reset,
Indentation issue.
> + .extra_priv_size = sizeof(struct brcm_priv),
> +};
...
> +static int ehci_brcm_probe(struct platform_device *pdev)
> +{
> + irq = platform_get_irq(pdev, 0);
> + if (irq < 0) {
> + dev_err(&pdev->dev, "no irq provided");
Duplicate with core message.
> + return irq;
> + }
> + /* initialize hcd */
> + hcd = usb_create_hcd(&ehci_brcm_hc_driver,
> + &pdev->dev, dev_name(&pdev->dev));
At least this one will look much better (and fit one line) when you introduce
struct device *dev = &pdev->dev;
in the definition block above.
> + if (!hcd)
> + return -ENOMEM;
> + return err;
> +}
...
> +static struct platform_driver ehci_brcm_driver = {
> + .probe = ehci_brcm_probe,
> + .remove = ehci_brcm_remove,
> + .shutdown = usb_hcd_platform_shutdown,
> + .driver = {
> + .owner = THIS_MODULE,
Do we need this?
> + .name = "ehci-brcm",
> + .pm = &ehci_brcm_pm_ops,
> + .of_match_table = brcm_ehci_of_match,
> + }
> +};
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2020-03-13 15:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-13 14:15 [PATCH 0/4] Add XHCI, EHCI and OHCI support for Broadcom STB SoS's Al Cooper
2020-03-13 14:15 ` [PATCH 1/4] dt-bindings: Add Broadcom STB USB support Al Cooper
2020-03-13 22:02 ` Rob Herring
2020-03-27 20:25 ` Al Cooper
2020-03-13 14:15 ` [PATCH 2/4] usb: xhci: xhci-plat: Add support for Broadcom STB SoC's Al Cooper
2020-03-13 14:58 ` Andy Shevchenko
2020-03-13 14:15 ` [PATCH 3/4] usb: ehci: Add new EHCI driver " Al Cooper
2020-03-13 15:08 ` Andy Shevchenko [this message]
2020-03-27 20:27 ` Al Cooper
2020-03-17 18:48 ` Greg Kroah-Hartman
2020-03-27 20:28 ` Al Cooper
2020-03-13 14:15 ` [PATCH 4/4] usb: host: Add ability to build new Broadcom STB USB drivers Al Cooper
2020-03-13 15:10 ` Andy Shevchenko
2020-03-13 16:18 ` [PATCH 0/4] Add XHCI, EHCI and OHCI support for Broadcom STB SoS's Andy Shevchenko
2020-03-27 20:22 ` Al Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200313150850.GV1922688@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=alcooperx@gmail.com \
--cc=arnd@arndb.de \
--cc=b.zolnierkie@samsung.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=johan@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathias.nyman@intel.com \
--cc=mchehab+huawei@kernel.org \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).