[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C94EB729-09A2-4E67-91A2-65551114DFEF@gmail.com>
Date: Sun, 31 Jul 2016 00:17:13 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Arend van Spriel <arend.vanspriel@...adcom.com>,
Daniel Wagner <daniel.wagner@...-carit.de>,
Bjorn Andersson <bjorn.andersson@...aro.org>
CC: Daniel Wagner <wagi@...om.org>, Bastien Nocera <hadess@...ess.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Johannes Berg <johannes.berg@...el.com>,
Kalle Valo <kvalo@...eaurora.org>,
Ohad Ben-Cohen <ohad@...ery.com>, linux-input@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-wireless@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Luis R. Rodriguez" <mcgrof@...nel.org>
Subject: Re: [RFC v0 7/8] Input: ims-pcu: use firmware_stat instead of completion
On July 30, 2016 5:42:41 AM PDT, Arend van Spriel <arend.vanspriel@...adcom.com> wrote:
>+ Luis (again) ;-)
>
>On 29-07-16 08:13, Daniel Wagner wrote:
>> On 07/28/2016 09:01 PM, Bjorn Andersson wrote:
>>> On Thu 28 Jul 11:33 PDT 2016, Dmitry Torokhov wrote:
>>>
>>>> On Thu, Jul 28, 2016 at 09:55:11AM +0200, Daniel Wagner wrote:
>>>>> From: Daniel Wagner <daniel.wagner@...-carit.de>
>>>>>
>>> [..]
>>>>
>>>> Do not quite like it... I'd rather asynchronous request give out a
>>>> firmware status pointer that could be used later on.
>
>Excellent. Why not get rid of the callback function as well and have
>fw_loading_wait() return result (0 = firmware available, < 0 = fail).
>Just to confirm, you are proposing a new API function next to
>request_firmware_nowait(), right?
Yes, that would be a new API call. Maybe we could replace old API with the new at some point.
>>>> pcu->fw_st = request_firmware_async(IMS_PCU_FIRMWARE_NAME,
>>>> - pcu,
>>>> - ims_pcu_process_async_firmware);
> + pcu);
>>>> if (IS_ERR(pcu->fw_st))
>>>> return PTR_ERR(pcu->fw_st);
>>>>
>>>> ....
>>>>
>>>> err = fw_loading_wait(pcu->fw_st);
> if (err)
> return err;
>
> fw = fwstat_get_firmware(pcu->fw_st);
>
>Or whatever consistent prefix it is going to be.
>
>>>>
>>>
>>> In the remoteproc case (patch 6) this would clean up the code,
>rather
>>> than replacing the completion API 1 to 1. I like it!
>>
>> IIRC most drivers do it the same way. So request_firmware_async()
>indeed
>> would be good thing to have. Let me try that.
>
>While the idea behind this series is a good one I am wondering about
>the
>need for these drivers to use the asynchronous API. The historic reason
>might be to avoid timeout caused by user-mode helper, but that may no
>longer apply and these drivers could be better off using
>request_firmware_direct().
Actually systems using this driver rely on usermode helper to provide necessary delay and load the firmware from storage once root partition is mounted. Converting to request_firmware_direct() would break them.
Thanks.
--
Dmitry
Powered by blists - more mailing lists