All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: Christian Lamparter <chunkeey@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	John Stultz <john.stultz@linaro.org>,
	Mathias Nyman <mathias.nyman@intel.com>,
	linux-arm-msm@vger.kernel.org,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	USB list <linux-usb@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>
Subject: Re: [PATCH v6 0/5] usb: xhci: Add support for Renesas USB controllers
Date: Tue, 4 Feb 2020 18:33:58 +0200	[thread overview]
Message-ID: <1ce257f5-df10-73ac-53ea-1c771abe70f2@linux.intel.com> (raw)
In-Reply-To: <20200131084041.GI2841@vkoul-mobl>

On 31.1.2020 10.40, Vinod Koul wrote:
> Hi Mathias,
> 
> On 30-01-20, 19:07, Mathias Nyman wrote:
>> On 25.1.2020 7.32, Vinod Koul wrote:
>>>>>>>>
>>>>>>>> On Mon, Jan 13, 2020 at 12:42 AM Vinod Koul <vkoul@kernel.org> wrote:
>>>>>>>>>
>>>>>>>>> This series add support for Renesas USB controllers uPD720201 and uPD720202.
>>>>>>>>> These require firmware to be loaded and in case devices have ROM those can
>>>>>>>>> also be programmed if empty. If ROM is programmed, it runs from ROM as well.
>>>>>>>>>
>>>>>>>>> This includes two patches from Christian which supported these controllers
>>>>>>>>> w/o ROM and later my patches for ROM support and multiple firmware versions,
>>>>>>>>> debugfs hook for rom erase and export of xhci-pci functions.
>>>>>>>>>

...

>>
>> There are a few other opens regarding this series. Mostly because I'm not (yet)
>> familiar with all the details, so I'll just just list them here.
>>
>> - Is it really enough to add the Renesas driver to Makefile before xhci-pci
>>    driver to make sure it gets matched and probed based on vendor/device id
>>    before xhci-pci driver is matched and probed based on pci class?
>>    What if the Renesas driver is a module and xhci-pci compiled in?
> 
> The driver loading rules are based on level and makefile order. So
> renesas will always be loaded before xhci driver. This is required since
> xhci claims all devices, so we need to make sure it loads before.
> 
> I think we should make it inbuilt driver rather than a module. xhci
> driver is only inbuilt.
> 
> If there is a better way to handle this, am all for it.
> 
>> - Previously probe didn't return before hcd's were added and everything set up.
>>    Now with request_firmware_nowait() probe returns early successfully, and the
>>    old xhci_pci_probe() which sets up everything is called later by the request
>>    firmware callback. So there could be whole new set of races possible.
>>    For example pci remove can be called mid firmware loading, or when the old
>>    xhci_pci_probe is still setting up things.
> 
> I think this is a valid concern. Let me think about how to solve this..
> maybe add a flag in remove which ensure remove doesnt run untill the
> probe/firmware callback is completed.

How about initiating async firmware loading before probe is called by using
DECLARE_PCI_FIXUP_*() hooks?

Probe would then just check if there is a valid running firmware, if not just
defer probe until later (return -EPROBE_DEFER).

No need for a separate Renesas xhci driver, no worries about which driver
claims the device first, no races because of probe returning successfully
too early.

Can we check the device for a valid running firmware without disrupting a
ongoing firmware write?

-Mathias

  reply	other threads:[~2020-02-04 16:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13  8:40 [PATCH v6 0/5] usb: xhci: Add support for Renesas USB controllers Vinod Koul
2020-01-13  8:40 ` [PATCH v6 1/5] usb: xhci: export few functions Vinod Koul
2020-01-13  8:40 ` [PATCH v6 2/5] usb: renesas-xhci: Add the renesas xhci driver Vinod Koul
2020-01-13  8:40 ` [PATCH v6 3/5] usb: renesas-xhci: Add ROM loader for uPD720201 Vinod Koul
2020-01-13  8:40 ` [PATCH v6 4/5] usb: renesas-xhci: allow multiple firmware versions Vinod Koul
2020-01-13  8:40 ` [PATCH v6 5/5] usb: xhci: provide a debugfs hook for erasing rom Vinod Koul
2020-01-13 20:09 ` [PATCH v6 0/5] usb: xhci: Add support for Renesas USB controllers John Stultz
2020-01-13 20:33   ` Christian Lamparter
2020-01-21  6:46     ` Vinod Koul
2020-01-21 20:26       ` Christian Lamparter
2020-01-24 21:38         ` Christian Lamparter
2020-01-25  5:32           ` Vinod Koul
2020-01-30 17:07             ` Mathias Nyman
2020-01-31  8:40               ` Vinod Koul
2020-02-04 16:33                 ` Mathias Nyman [this message]
2020-03-12  6:56                   ` Vinod Koul
2020-01-31 15:47               ` Alan Stern
2020-03-10 11:55                 ` Vinod Koul
2020-01-26  0:11 ` Andreas Böhler
2020-01-26 13:07   ` Christian Lamparter

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=1ce257f5-df10-73ac-53ea-1c771abe70f2@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=chunkeey@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=stern@rowland.harvard.edu \
    --cc=vkoul@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.