linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Arend Van Spriel <arend.vanspriel@broadcom.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	Sebastian Reichel <sre@kernel.org>, Pavel Machek <pavel@ucw.cz>,
	Michal Kazior <michal.kazior@tieto.com>,
	Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Tony Lindgren <tony@atomide.com>,
	"linux-wireless" <linux-wireless@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	"Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: Re: wl1251 & mac address & calibration data
Date: Fri, 16 Dec 2016 11:26:55 +0100	[thread overview]
Message-ID: <201612161126.55249@pali> (raw)
In-Reply-To: <76365770-f5ba-9565-3fca-710518f64d81@broadcom.com>

[-- Attachment #1: Type: Text/Plain, Size: 3509 bytes --]

On Thursday 15 December 2016 21:12:47 Arend Van Spriel wrote:
> On 15-12-2016 16:33, Pali Rohár wrote:
> > On Thu Dec 15 09:18:44 2016 Kalle Valo <kvalo@codeaurora.org> wrote:
> >> (Adding Luis because he has been working on request_firmware()
> >> lately)
> >> 
> >> Pali Rohár <pali.rohar@gmail.com> writes:
> >>>>> So no, there is no argument against... request_firmware() in
> >>>>> fallback mode with userspace helper is by design blocking and
> >>>>> waiting for userspace. But waiting for some change in DTS in
> >>>>> kernel is just nonsense.
> >>>> 
> >>>> I would just mark the wlan device with status = "disabled" and
> >>>> enable it in the overlay together with adding the NVS & MAC
> >>>> info.
> >>> 
> >>> So if you think that this solution make sense, we can wait what
> >>> net wireless maintainers say about it...
> >>> 
> >>> For me it looks like that solution can be:
> >>> 
> >>> extending request_firmware() to use only userspace helper
> >> 
> >> I haven't followed the discussion very closely but this is my
> >> preference what drivers should do:
> >> 
> >> 1) First the driver should do try to get the calibration data and
> >> mac
> >> 
> >>        address from the device tree.
> > 
> > Ok, but there is no (dynamic, device specific) data in DTS for
> > N900. So 1) is noop.
> 
> Uhm. What do you mean? You can propose a patch to the DT bindings [1]
> to get it in there and create your N900 DTB or am I missing
> something here. Are there hardware restrictions that do not allow
> you to boot with your own DTB.

What is [1]?

N900's bootloader does not support DTB and it does not pass any DTB. It 
boots kernel in ATAGs mode. What we are doing is appending DTB compiled 
from kernel sources to end of zImage.

But that appended DTB cannot contains device specific nodes (e.g. 
calibration data for device) as zImage is there for any N900 device, not 
just only one.

> >> 2) If they are not in DT the driver should retrieve the
> >> calibration data
> >> 
> >>        with request_firmware(). BUT with an option for user space
> >>        to implement that with a helper script so that the data
> >>        can be created dynamically, which I believe openwrt does
> >>        with ath10k calibration data right now.
> > 
> > Currently there is flag for request_firmware() that it should
> > fallback to user helper if direct VFS access not find needed
> > firmware.
> > 
> > But this flag is not suitable as /lib/firmware already provides
> > default (not device specific) calibration data.
> > 
> > So I would suggest to add another flag/function which will primary
> > use user helper.
> 
> I recall Luis saying that user-mode helper (fallback) should be
> discouraged, because there is no assurance that there is a user-mode
> helper so you might just be pissing in the wind. The idea was to have
> a dedicated API call that explicitly does the request towards
> user-space.
> 
> By the way, are we talking here about wl1251 device or driver as you
> also mentioned wl12xx? I did not read the entire thread.

Yes, we are talking about wl1251 device, which is in Nokia N900 and 
wl1251.ko and wl1251_spi.ko drivers.

I mentioned wl12xx as it already uses similar approach with mac address 
via request_firmware(). And as those drivers are very similar plus from 
one manufactor and in same kernel folder I mentioned similar API for 
consistency...

-- 
Pali Rohár
pali.rohar@gmail.com

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

  parent reply	other threads:[~2016-12-16 10:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 17:20 wl1251 & mac address & calibration data Pali Rohár
2016-11-21 15:51 ` Pali Rohár
2016-11-22 15:22   ` Michal Kazior
2016-11-22 15:31     ` Pali Rohár
2016-11-22 16:14       ` Michal Kazior
2016-11-22 17:05         ` Pali Rohár
2016-11-23  8:24           ` Arend Van Spriel
2016-11-23 22:23           ` Pavel Machek
2016-11-23 22:39             ` Pali Rohár
2016-11-24  7:51               ` Pavel Machek
2016-11-24  8:33                 ` Pali Rohár
2016-11-24 15:13                   ` Sebastian Reichel
2016-11-24 15:20                     ` Pali Rohár
2016-11-24 15:31                       ` Ivaylo Dimitrov
2016-11-24 16:08                       ` Sebastian Reichel
2016-11-24 16:49                         ` Pali Rohár
2016-11-24 18:11                           ` Sebastian Reichel
2016-11-24 18:35                             ` Pali Rohár
2016-12-15  8:18                               ` Kalle Valo
2016-12-15 15:33                                 ` Pali Rohár
2016-12-15 20:12                                   ` Arend Van Spriel
2016-12-16  2:03                                     ` Luis R. Rodriguez
2016-12-16  7:25                                       ` Daniel Wagner
2016-12-16 10:40                                         ` Pali Rohár
2016-12-18 10:49                                           ` Arend Van Spriel
2016-12-18 11:04                                             ` Pali Rohár
2016-12-18 11:54                                               ` Arend Van Spriel
2016-12-18 12:09                                                 ` Pali Rohár
2016-12-18 20:08                                                   ` Arend Van Spriel
2016-12-20 11:47                                                     ` Kalle Valo
2016-12-20 16:56                                                       ` Tony Lindgren
2016-12-20 17:06                                                         ` Pali Rohár
2016-12-20 17:11                                                         ` Kalle Valo
2016-12-20 17:21                                                           ` Tony Lindgren
2017-01-12  8:50                                                       ` Pavel Machek
2016-12-16 10:35                                       ` Pali Rohár
2016-12-16 10:26                                     ` Pali Rohár [this message]
2016-11-24 18:46                       ` Aaro Koskinen
2016-11-26 17:17                         ` Pavel Machek
2016-11-26 17:20                         ` Pali Rohár
2016-12-05 23:51                           ` Tony Lindgren

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=201612161126.55249@pali \
    --to=pali.rohar@gmail.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=arend.vanspriel@broadcom.com \
    --cc=ivo.g.dimitrov.75@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=michal.kazior@tieto.com \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=sre@kernel.org \
    --cc=tony@atomide.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 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).