linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: Stefan Wahren <wahrenst@gmx.net>, helgaas@kernel.org
Cc: linux-usb@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org, tim.gover@raspberrypi.org,
	linux-pci@vger.kernel.org, f.fainelli@gmail.com,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, RayJui <rjui@broadcom.com>,
	ScottBranden <sbranden@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com
Subject: Re: [PATCH v7 2/4] firmware: raspberrypi: Introduce vl805 init routine
Date: Mon, 04 May 2020 10:59:29 +0200	[thread overview]
Message-ID: <d105712418b93ebce7c0498d05eea77171892366.camel@suse.de> (raw)
In-Reply-To: <5fce05ca-5d7e-f4cc-be34-0764fbe4edff@gmx.net>

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

Hi Stefan, thanks for the review!

On Sat, 2020-05-02 at 11:05 +0200, Stefan Wahren wrote:
> > +	/* Make sure we don't trigger a firmware load unnecesarely *
> s/unnecesarely/unnecessarily/

Noted

> > +	pci_read_config_dword(pdev, VL805_PCI_CONFIG_VERSION_OFFSET, &version);
> pci_read_config_dword() can fail, we might want to store the return value?

I planned on doing that, but realised that the vast majority of
pci_read_config_*() users pass on checking for errors.

Bjorn, any rule of thumb on when to check for errors here?

> > +	if (version)
> > +		goto exit;
> > +
> > +	dev_addr = pdev->bus->number << 20 | PCI_SLOT(pdev->devfn) << 15 |
> > +		   PCI_FUNC(pdev->devfn) << 12;
> > +
> > +	ret = rpi_firmware_property(fw, RPI_FIRMWARE_NOTIFY_XHCI_RESET,
> > +				    &dev_addr, sizeof(dev_addr));
> > +	/* Wait for vl805 to startup */
> > +	udelay(200);
> 
> I know, it makes it harder to read but do we really want to wait
> unnecessarily if rpi_firmware_property failed?

Yes, I figured that it wouldn't hurt much at that faulty state, and you'll be
waiting some extra 5s further down the line in quirk_usb_handoff_xhci().

But if you feel it's more correct I'll be happy to change it.

> Btw i assume we are in non-atomic context, so maybe it's worth to use
> usleep_range() here?

Of course, I'll fix that.

Regards,
Nicolas


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-05-04  8:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 16:47 [PATCH v7 0/4] USB: pci-quirks: Add Raspberry Pi 4 quirk Nicolas Saenz Julienne
2020-04-29 16:47 ` [PATCH v7 1/4] soc: bcm2835: Add notify xHCI reset property Nicolas Saenz Julienne
2020-04-29 16:47 ` [PATCH v7 2/4] firmware: raspberrypi: Introduce vl805 init routine Nicolas Saenz Julienne
2020-05-02  9:05   ` Stefan Wahren
2020-05-04  8:59     ` Nicolas Saenz Julienne [this message]
2020-05-04 19:06       ` Stefan Wahren
2020-05-04 22:52       ` Bjorn Helgaas
2020-04-29 16:47 ` [PATCH v7 3/4] PCI: brcmstb: Wait for Raspberry Pi's firmware when present Nicolas Saenz Julienne
2020-04-29 16:47 ` [PATCH v7 4/4] USB: pci-quirks: Add Raspberry Pi 4 quirk Nicolas Saenz Julienne

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=d105712418b93ebce7c0498d05eea77171892366.camel@suse.de \
    --to=nsaenzjulienne@suse.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=helgaas@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=tim.gover@raspberrypi.org \
    --cc=wahrenst@gmx.net \
    /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).