From: leedom@chelsio.com (Casey Leedom)
To: cocci@systeme.lip6.fr
Subject: [Cocci] [PATCH 2/3] cxgb4: make configuration load use request_firmware_direct()
Date: Wed, 25 Jun 2014 11:58:52 -0700 [thread overview]
Message-ID: <53AB1BEC.4080107@chelsio.com> (raw)
In-Reply-To: <20140625173156.GW27687@wotan.suse.de>
Okay, I'll leave the whole request_firmware{,_direct,_nowait}() thing
alone. The request_firmware_direct() will "solve" a non-problem (since
all of our "firmware" files are _supposed to be_ always present. (And
the 60 second timeout for udev to confirm that a file doesn't exist
seems like udev is just basically broken.)
That aside, we still need to solve the real problem that we're
experiencing in that the boot-time load of cxgb4 is timing out on SLE12
because a maximum load timeout has been instituted in that distribution
for driver modules and if there are two 10Gb/s-BT adapters present in a
system which need both base firmware and BT PHY firmware, we exceed that
timeout. The timeout really should be per device (since there ~could~
be an arbitrary number of devices in a system) and there probably should
be a way for the driver to notify the kernel timeout mechanism that
forward progress is being made ...
Casey
On 06/25/14 10:31, Luis R. Rodriguez wrote:
> On Wed, Jun 25, 2014 at 10:12:20AM -0700, Casey Leedom wrote:
>> On 06/24/14 18:50, Luis R. Rodriguez wrote:
>>> On Tue, Jun 24, 2014 at 03:54:44PM -0700, Casey Leedom wrote:
>>>> [[ Hopefully this makes it through to the kernel.org lists -- I?m using the
>>>> Mac OS/X Mailer and it?s not clear how to force it not to use HTML format.
>>>> -- Casey ]]
>>>>
>>>> So does request_firmware_direct() only fail if the requested file is not
>>>> present on the file system or does it fail in other cases as well?
>>> Same as before they are the same exact call with the only difference
>>> being udev is not used as an extra helper, so it saves the extra
>>> delay caused by udev. That's all.
>>>
>>>> If it?s the former, then the change to cxgb4 is fine.
>>>>
>>>> But if it?s the latter, then it?s definitely not okay. While the driver
>>>> _can_ continue running without the local on-disk Firmware Configuration
>>>> File, that file can be used to significantly change the behavior and
>>>> capabilities of the adapter and is user-customizable. If a user makes
>>>> changes to the local on-disk Firmware Configuration File and these are
>>>> randomly silently ignored this will lead to highly annoying support issues.
>>> This just avoids udev, the request goes directly to the filesystem. The
>>> failure will happen when the file is not present just as before, the
>>> only difference here is skipping udev, it doesn't suffer from the extra
>>> 60 second timeout. There's another possible failure, when
>>> usermodehelper_read_trylock() fails but that is just as the code was before
>>> so this change doesn't introduce that as a new false check. When that
>>> triggers yout get a nasty WARN_ON() just as before.
>> Huh, okay. I guess I'm confused about the value of request_firmware()
>> and the User Device helper. If request_firmware_direct() just goes to the
>> file system to grab the file and returns with ENOENT if it's not there,
>> then you could replace every usage of request_firmware() in the cxgb4
>> driver as far as I can see ... Either the files are there and we'll use
>> them or they won't be and we'll have to cope with that. Am I missing
>> something?
> You're actually right specially given that udev firmware uploading will
> hopefully eventually be removed eventually (it seems it was just one driver
> that caused to consider waiting on the removal, some driver that required
> looking for firmware on some custom path I think or used a custom loader), for
> now however its best to keep things consistent otherwise we'd replace
> everything already. The _direct() call then is best used for optional firmware
> for now. Perhaps in the end will be that the non _direct() call will have an
> explicit print to the ring buffer if the file was not found.
>
>> And again, this definitely isn't going to solve the problem that started
>> this whole line of research:
> I consider this research part of understanding and optimizing firmware
> loading on cxgb4, in this case this would save 60 seconds for each
> optional configuration file not present when loading, its not clear to
> me how often devices don't have optional configs so its unclear to me the
> exact savings in general, but if there's at least one user that should
> speed things up.
>
>> we're still going to time out the load of
>> cxgb4 if there are multiple 10Gb/s BT adapters in a system and we need to
>> load each one with both base firmware and PHY firmware.
> Again, the timeout is *within* firmware_request(), firmware_release() does
> not tell the firmware loader the timeout is over. The timeout is for the
> kernel doing the hunt for the file.
>
> As I see it the next steps on the evaluation on firmware loading on cxgb4
> would be to evaluate a clean strategy to split things up, and also would
> appreciate feedback on the bus master thing. Perhaps best we continue that
> discussoin on that thread?
>
> Luis
>
WARNING: multiple messages have this Message-ID (diff)
From: Casey Leedom <leedom@chelsio.com>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
tiwai@suse.de, chunkeey@googlemail.com, cocci@systeme.lip6.fr,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
gregkh@linuxfoundation.org, Philip Oswald <poswald@suse.com>,
Santosh Rastapur <santosh@chelsio.com>,
Jeffrey Cheung <jcheung@suse.com>, David Chang <dchang@suse.com>,
Hariprasad Shenai <hariprasad@chelsio.com>
Subject: Re: [PATCH 2/3] cxgb4: make configuration load use request_firmware_direct()
Date: Wed, 25 Jun 2014 11:58:52 -0700 [thread overview]
Message-ID: <53AB1BEC.4080107@chelsio.com> (raw)
In-Reply-To: <20140625173156.GW27687@wotan.suse.de>
Okay, I'll leave the whole request_firmware{,_direct,_nowait}() thing
alone. The request_firmware_direct() will "solve" a non-problem (since
all of our "firmware" files are _supposed to be_ always present. (And
the 60 second timeout for udev to confirm that a file doesn't exist
seems like udev is just basically broken.)
That aside, we still need to solve the real problem that we're
experiencing in that the boot-time load of cxgb4 is timing out on SLE12
because a maximum load timeout has been instituted in that distribution
for driver modules and if there are two 10Gb/s-BT adapters present in a
system which need both base firmware and BT PHY firmware, we exceed that
timeout. The timeout really should be per device (since there ~could~
be an arbitrary number of devices in a system) and there probably should
be a way for the driver to notify the kernel timeout mechanism that
forward progress is being made ...
Casey
On 06/25/14 10:31, Luis R. Rodriguez wrote:
> On Wed, Jun 25, 2014 at 10:12:20AM -0700, Casey Leedom wrote:
>> On 06/24/14 18:50, Luis R. Rodriguez wrote:
>>> On Tue, Jun 24, 2014 at 03:54:44PM -0700, Casey Leedom wrote:
>>>> [[ Hopefully this makes it through to the kernel.org lists -- I’m using the
>>>> Mac OS/X Mailer and it’s not clear how to force it not to use HTML format.
>>>> -- Casey ]]
>>>>
>>>> So does request_firmware_direct() only fail if the requested file is not
>>>> present on the file system or does it fail in other cases as well?
>>> Same as before they are the same exact call with the only difference
>>> being udev is not used as an extra helper, so it saves the extra
>>> delay caused by udev. That's all.
>>>
>>>> If it’s the former, then the change to cxgb4 is fine.
>>>>
>>>> But if it’s the latter, then it’s definitely not okay. While the driver
>>>> _can_ continue running without the local on-disk Firmware Configuration
>>>> File, that file can be used to significantly change the behavior and
>>>> capabilities of the adapter and is user-customizable. If a user makes
>>>> changes to the local on-disk Firmware Configuration File and these are
>>>> randomly silently ignored this will lead to highly annoying support issues.
>>> This just avoids udev, the request goes directly to the filesystem. The
>>> failure will happen when the file is not present just as before, the
>>> only difference here is skipping udev, it doesn't suffer from the extra
>>> 60 second timeout. There's another possible failure, when
>>> usermodehelper_read_trylock() fails but that is just as the code was before
>>> so this change doesn't introduce that as a new false check. When that
>>> triggers yout get a nasty WARN_ON() just as before.
>> Huh, okay. I guess I'm confused about the value of request_firmware()
>> and the User Device helper. If request_firmware_direct() just goes to the
>> file system to grab the file and returns with ENOENT if it's not there,
>> then you could replace every usage of request_firmware() in the cxgb4
>> driver as far as I can see ... Either the files are there and we'll use
>> them or they won't be and we'll have to cope with that. Am I missing
>> something?
> You're actually right specially given that udev firmware uploading will
> hopefully eventually be removed eventually (it seems it was just one driver
> that caused to consider waiting on the removal, some driver that required
> looking for firmware on some custom path I think or used a custom loader), for
> now however its best to keep things consistent otherwise we'd replace
> everything already. The _direct() call then is best used for optional firmware
> for now. Perhaps in the end will be that the non _direct() call will have an
> explicit print to the ring buffer if the file was not found.
>
>> And again, this definitely isn't going to solve the problem that started
>> this whole line of research:
> I consider this research part of understanding and optimizing firmware
> loading on cxgb4, in this case this would save 60 seconds for each
> optional configuration file not present when loading, its not clear to
> me how often devices don't have optional configs so its unclear to me the
> exact savings in general, but if there's at least one user that should
> speed things up.
>
>> we're still going to time out the load of
>> cxgb4 if there are multiple 10Gb/s BT adapters in a system and we need to
>> load each one with both base firmware and PHY firmware.
> Again, the timeout is *within* firmware_request(), firmware_release() does
> not tell the firmware loader the timeout is over. The timeout is for the
> kernel doing the hunt for the file.
>
> As I see it the next steps on the evaluation on firmware loading on cxgb4
> would be to evaluate a clean strategy to split things up, and also would
> appreciate feedback on the bus master thing. Perhaps best we continue that
> discussoin on that thread?
>
> Luis
>
next prev parent reply other threads:[~2014-06-25 18:58 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 22:39 [Cocci] [PATCH 0/3] drivers: expand usage of request_firmware_direct() Luis R. Rodriguez
2014-06-24 22:39 ` Luis R. Rodriguez
2014-06-24 22:39 ` [Cocci] [PATCH 1/3] mmc: vub300: use request_firmware_direct() for pseudo code Luis R. Rodriguez
2014-06-24 22:39 ` Luis R. Rodriguez
2014-06-24 22:39 ` [Cocci] [PATCH 2/3] cxgb4: make configuration load use request_firmware_direct() Luis R. Rodriguez
2014-06-24 22:39 ` Luis R. Rodriguez
2014-06-24 22:54 ` [Cocci] " Casey Leedom
2014-06-24 22:54 ` Casey Leedom
2014-06-25 1:50 ` [Cocci] " Luis R. Rodriguez
2014-06-25 1:50 ` Luis R. Rodriguez
2014-06-25 17:12 ` [Cocci] " Casey Leedom
2014-06-25 17:12 ` Casey Leedom
2014-06-25 17:31 ` [Cocci] " Luis R. Rodriguez
2014-06-25 17:31 ` Luis R. Rodriguez
2014-06-25 18:58 ` Casey Leedom [this message]
2014-06-25 18:58 ` Casey Leedom
2014-06-25 20:05 ` [Cocci] " Luis R. Rodriguez
2014-06-25 20:05 ` Luis R. Rodriguez
2014-06-24 22:39 ` [Cocci] [PATCH 3/3] p54: use request_firmware_direct() for optional EEPROM override Luis R. Rodriguez
2014-06-24 22:39 ` Luis R. Rodriguez
2014-06-25 1:10 ` [Cocci] [RESEND][PATCH " Christian Lamparter
2014-06-25 1:10 ` Christian Lamparter
2014-06-25 7:26 ` [Cocci] [PATCH " Arend van Spriel
2014-06-25 7:26 ` Arend van Spriel
2014-06-25 8:06 ` [Cocci] " Luis R. Rodriguez
2014-06-25 8:06 ` Luis R. Rodriguez
2014-06-26 16:18 ` [Cocci] [PATCH 0/3] drivers: expand usage of request_firmware_direct() Takashi Iwai
2014-06-26 16:18 ` Takashi Iwai
2014-06-26 19:21 ` [Cocci] " Greg KH
2014-06-26 19:21 ` Greg KH
2014-07-08 22:25 ` [Cocci] " Greg KH
2014-07-08 22:25 ` Greg KH
2014-07-08 23:52 ` [Cocci] " Luis R. Rodriguez
2014-07-08 23:52 ` Luis R. Rodriguez
2014-07-09 0:24 ` [Cocci] " Greg KH
2014-07-09 0:24 ` Greg KH
2014-07-09 0:46 ` [Cocci] " Luis R. Rodriguez
2014-07-09 0:46 ` Luis R. Rodriguez
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=53AB1BEC.4080107@chelsio.com \
--to=leedom@chelsio.com \
--cc=cocci@systeme.lip6.fr \
/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.