lkml.org 
[lkml]   [2012]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] drivers/tty: Folding Android's keyreset driver in sysRQ
On 12-08-30 05:01 PM, Dmitry Torokhov wrote:
> Hi Matthieu,
>
> On Thu, Aug 30, 2012 at 04:30:54PM -0600, mathieu.poirier@linaro.org wrote:
>> From: "Mathieu J. Poirier" <mathieu.poirier@linaro.org>
>>
>> This patch adds keyreset functionality to the sysrq driver. It
>> allows certain button/key combinations to be used in order to
>> trigger device resets.
>>
>> The first time the key-combo is detected a work function that syncs
>> the filesystems is scheduled and the kernel rebooted. If all the keys
>> are released and then pressed again, it calls panic. Reboot on panic
>> should be set for this to work. A platform device that specify a
>> reset key-combo should be added to the board file to trigger the
>> feature.
>
> Why do we need to involve a platform device and not use, for example, a module
> parameter, that could be set up from userspace?

The platform device comes from the original design and was included to
minimise the amount of changes in code that make use of the current
keyreset driver.

I am definitely willing to explore the possibility of adding module
parameter to complement the platform data but again, to avoid impacting
board code I'm in favour of keeping the platform data/device - get back
to me if you disagree.

Thinking back on this it may be better to call 'platform_driver_probe'
rather than 'platform_driver_register'. That way one wouldn't have to
instantiate a platform_device.

>
> Also, why do we need reset_fn() and not simply invoke SysRq-B handler
> that should call ctrl_alt_del() for us?

The reset_fn() gives an implementer the chance of calling some custom
function before the reset sequence is started and in my opinion should
stay. On the flip side I'm not sure that I understand what you mean by
"SysRq-B handler" - are you talking about the "sysrq_reboot_op" ?
Please expand on that ?

Thanks for the review and comments,
Mathieu.

>
> Thanks.
>



\
 
 \ /
  Last update: 2012-09-01 00:21    [W:0.125 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site