LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor@chromium.org>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Dmitry Torokhov <dtor@chromium.org>,
	Charles Mooney <charliemooney@google.com>,
	Ming Lei <ming.lei@canonical.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] firmware_class: Add firmware filename overrides
Date: Thu, 5 Mar 2015 14:36:38 -0800	[thread overview]
Message-ID: <CAE_wzQ9kse7CLydFLwy8+YZvihFwgDu3kBU_EKod7=JcxMcaLg@mail.gmail.com> (raw)
In-Reply-To: <D92CDE6C-1FB9-492E-92CF-A765320E7990@holtmann.org>

On Thu, Mar 5, 2015 at 2:12 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Dmitry,
>
>>>>>>>> Specifically this was motivated by a situation where we have one
>>>>>>>> device with a dual-sourced touchscreen. Both use the same driver but
>>>>>>>> have different hardware & fw. Our FW updating software therefore,
>>>>>>>> needs to be able to update with the correct FW and detect all this at
>>>>>>>> runtime due to a read-only partition (so moving the firmware binaries
>>>>>>>> around isn't really an option)
>>>>>>>> Here the device has only one touchscreen at a time, but it isn't known
>>>>>>>> until run-time which will be present.
>>>>>>>>
>>>>>>>> So in this case the driver is serving the same function in each
>>>>>>>> situation (running a touchscreen) but may be working with different
>>>>>>>> hardware.
>>>>>>>>
>>>>>>>> Another situation where I've personally wanted this functionality is
>>>>>>>> on a device that uses the same touch driver for both a touchscreen and
>>>>>>>> a touchpad on the same device. If the driver only grabs a copy of FW
>>>>>>>> from, say, /lib/firmware/touch_fw.bin then you either need to move the
>>>>>>>> firmware binaries around on disk to update either device, or have a
>>>>>>>> change like this that allows you to override which filename it loads.
>>>>>>>> The moving option is not viable if you're using a RO filesystem.
>>>>>>>
>>>>>>> what is the actual problem here? We have drivers that load multiple firmware files and we have drivers that pick a different firmware depending on some parameters it reads from the device.
>>>>>>>
>>>>>>> Seems this is all possible already at the moment with the existing framework. You just need to update the drivers to operate properly.
>>>>>>>
>>>>>>
>>>>>> I totally agree, this functionality is not novel.  We could have added
>>>>>> this feature into the specific driver in question, but then we will
>>>>>> have to do the same thing on all the other drivers we might want to do
>>>>>> this on.  I guess the real problem that this solves is by adding the
>>>>>> change here, it allows you to override firmware names for *any* driver
>>>>>> without having to duplicate the functionality in each one as they come
>>>>>> up.
>>>>>>
>>>>>> For a specific instance, here at ChromiumOS we have devices that use
>>>>>> Atmel, Cypress, Synaptics, and Elan touchpads and touchscreens that
>>>>>> all can encounter this issue.  The Atmel driver has a similar version
>>>>>> of this feature baked into it but the others don't.  We could add a
>>>>>> fw_filename attribute to each of these drivers, but then it would have
>>>>>> to be maintained across (at least) four drivers.
>>>>>
>>>>> what I am hearing here is that you can not query the hardware and figure out which manufacturer it is and with that don't know which firmware you need.
>>>>
>>>> Right, the drivers in question (bunch of input drivers such as
>>>> elan_ts, atmel_mxt_ts, etc) might not be able to determine the
>>>> "proper" configuration to load. Factories quite often swap
>>>> pin-compatible parts and want to use the same image. Also the parts
>>>> can be swapped out during RMA while keeping the same image. Userspace
>>>> is able to query magnitude of sources and make an informed decision
>>>> that it then communicates to the kernel.
>>>>
>>>>> However if that is the case, then this seems to be something that should be solved with device tree.
>>>>
>>>> Why are we making device tree a hard dependency here?
>>>
>>> device tree is suppose to describe the hardware in your devices. If you can not determinate your hardware by enumeration or other means, then it should be done via device tree. Seems the perfect fit here.
>>
>> And if I do not have device tree?
>
> so if you do not have an enumeration method for your hardware, then I assume you most likely have device tree in one form or another.
>
> And even if you really don't, nothing is stopping you from adding device tree.

We have ACPI (for example) and no, it is not 5.0.

Thanks,
Dmitry

  reply	other threads:[~2015-03-05 22:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 23:25 Charlie Mooney
2015-03-04 23:57 ` Greg KH
2015-03-05  0:48   ` Dmitry Torokhov
2015-03-05  8:14     ` Ming Lei
2015-03-05 17:29       ` Charles Mooney
2015-03-05 17:39         ` Marcel Holtmann
2015-03-05 17:52           ` Charles Mooney
2015-03-05 18:13             ` Marcel Holtmann
2015-03-05 18:20               ` Dmitry Torokhov
2015-03-05 19:11                 ` Marcel Holtmann
2015-03-05 19:14                   ` Dmitry Torokhov
2015-03-05 22:12                     ` Marcel Holtmann
2015-03-05 22:36                       ` Dmitry Torokhov [this message]
2015-03-06  1:27                         ` Ming Lei
2015-03-06 22:50                           ` Charles Mooney
2015-03-06 23:33                             ` Marcel Holtmann
2015-03-10 15:51                               ` Charles Mooney

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='CAE_wzQ9kse7CLydFLwy8+YZvihFwgDu3kBU_EKod7=JcxMcaLg@mail.gmail.com' \
    --to=dtor@chromium.org \
    --cc=charliemooney@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=ming.lei@canonical.com \
    --subject='Re: [PATCH] firmware_class: Add firmware filename overrides' \
    /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

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).