All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Al Cooper <alcooperx@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	<bcm-kernel-feedback-list@broadcom.com>,
	<devicetree@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	<linux-usb@vger.kernel.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	Rob Herring <robh+dt@kernel.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH v8 4/5] usb: ehci: Add new EHCI driver for Broadcom STB SoC's
Date: Fri, 8 May 2020 20:47:52 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.2005082035460.2445-100000@netrider.rowland.org> (raw)
In-Reply-To: <20200508211929.39020-5-alcooperx@gmail.com>

On Fri, 8 May 2020, Al Cooper wrote:

A few minor typos in the patch description:

> 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
-----------------------------------------^

"workaround" is a noun; the verb form is "work around".

> controller. The primary workround is for a bug where the Core
-----------------------------^

Missing "a".

> violates the SOF interval between the first two SOFs transmitted after
> resume. This only happens if the resume occurs near the end of a
> microframe. The fix is to intercept the echi-hcd request to complete
-------------------------------------------^

ehci, not echi.

> RESUME and align it to the start of the next microframe.
> 
> Signed-off-by: Al Cooper <alcooperx@gmail.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---

Basically this new driver is fine.  However...

> +static inline void ehci_brcm_wait_for_sof(struct ehci_hcd *ehci, u32 delay)
> +{
> +	u32 frame_idx = ehci_readl(ehci, &ehci->regs->frame_index);
> +	u32 val;
> +	int res;
> +
> +	/* Wait for next microframe (every 125 usecs) */
> +	res = readl_relaxed_poll_timeout(&ehci->regs->frame_index, val,
> +					 val != frame_idx, 1, 130);
> +	if (res)
> +		dev_err(ehci_to_hcd(ehci)->self.controller,
> +			"Error waiting for SOF\n");

If this patch is going to be redone anyway, you might as well change
dev_err() to ehci_err() -- that's what it's for.  I should have noticed
this earlier, sorry.

> +static int ehci_brcm_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct resource *res_mem;
> +	struct brcm_priv *priv;
> +	struct usb_hcd *hcd;
> +	int irq;
> +	int err;
> +
> +	err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
> +	if (err)
> +		return err;
> +
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq <= 0)
> +		return irq;

I don't want to get involved in the question of whether or not 0 is a 
valid IRQ number.  The consensus has gone back and forth over the 
years, and it just doesn't seem important.

However, as Sergei points out, if 0 is going to be regarded as an 
invalid value then we shouldn't return 0 from the probe function here.

I'll leave the decision on how to handle this matter up to Greg.  :-)

Alan Stern



  parent reply	other threads:[~2020-05-09  0:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 21:19 [PATCH v8 0/5] Add XHCI, EHCI and OHCI support for Broadcom STB SoS's Al Cooper
2020-05-08 21:19 ` [PATCH v8 1/5] usb: xhci: Change the XHCI link order in the Makefile Al Cooper
2020-05-08 22:50   ` Florian Fainelli
2020-05-11 11:08   ` Yoshihiro Shimoda
2020-05-08 21:19 ` [PATCH v8 2/5] dt-bindings: Add Broadcom STB USB support Al Cooper
2020-05-08 22:51   ` Florian Fainelli
2020-05-08 21:19 ` [PATCH v8 3/5] usb: xhci: xhci-plat: Add support for Broadcom STB SoC's Al Cooper
2020-05-08 22:51   ` Florian Fainelli
2020-05-08 21:19 ` [PATCH v8 4/5] usb: ehci: Add new EHCI driver " Al Cooper
2020-05-08 22:52   ` Florian Fainelli
2020-05-09  0:47   ` Alan Stern [this message]
2020-05-09 12:04     ` Andy Shevchenko
2020-05-08 21:19 ` [PATCH v8 5/5] usb: host: Add ability to build new Broadcom STB USB drivers Al Cooper
2020-05-08 22:53   ` Florian Fainelli

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=Pine.LNX.4.44L0.2005082035460.2445-100000@netrider.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=alcooperx@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=robh+dt@kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.