Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1250076 > unrolled thread

[PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2015-10-18 07:00 +0200
Last post2015-10-26 18:00 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-10-18 07:00 +0200
    Re: [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on  some toshiba models Ben Hutchings <ben@decadent.org.uk> - 2015-10-20 01:40 +0200
      Re: [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on  some toshiba models Darren Hart <dvhart@infradead.org> - 2015-10-21 10:50 +0200
        Re: [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on  some toshiba models Azael Avalos <coproscefalo@gmail.com> - 2015-10-26 18:00 +0100

#1250076 — [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2015-10-18 07:00 +0200
Subject[PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models
Message-ID<qkOeE-385-49@gated-at.bofh.it>
4.2-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Azael Avalos <coproscefalo@gmail.com>

commit 53147b6cabee5e8d1997b5682fcc0c3b72ddf9c2 upstream.

Commit a2b3471b5b13 ("toshiba_acpi: Use the Hotkey Event Type function
for keymap choosing") changed the *setup_keyboard function to query for
the Hotkey Event Type to help choose the correct keymap, but turns out
that here are certain Toshiba models out there not implementing this
feature, and thus, failing to continue the input device registration and
leaving such laptops without hotkey support.

This patch changes such check, and instead of returning an error if
the Hotkey Event Type is not present, we simply inform userspace about it,
changing the message printed from err to notice, making the function
responsible for registering the input device to continue.

This issue was found on a Toshiba Portege Z30-B, but there might be
some other models out there affected by this regression as well.

Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/platform/x86/toshiba_acpi.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- a/drivers/platform/x86/toshiba_acpi.c
+++ b/drivers/platform/x86/toshiba_acpi.c
@@ -2408,11 +2408,9 @@ static int toshiba_acpi_setup_keyboard(s
 	if (error)
 		return error;
 
-	error = toshiba_hotkey_event_type_get(dev, &events_type);
-	if (error) {
-		pr_err("Unable to query Hotkey Event Type\n");
-		return error;
-	}
+	if (toshiba_hotkey_event_type_get(dev, &events_type))
+		pr_notice("Unable to query Hotkey Event Type\n");
+
 	dev->hotkey_event_type = events_type;
 
 	dev->hotkey_dev = input_allocate_device();


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1251153 — Re: [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models

FromBen Hutchings <ben@decadent.org.uk>
Date2015-10-20 01:40 +0200
SubjectRe: [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models
Message-ID<qlsc2-2Le-3@gated-at.bofh.it>
In reply to#1250076

[Multipart message — attachments visible in raw view] — view raw

On Sat, 2015-10-17 at 18:55 -0700, Greg Kroah-Hartman wrote:
> 4.2-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Azael Avalos <coproscefalo@gmail.com>
> 
> commit 53147b6cabee5e8d1997b5682fcc0c3b72ddf9c2 upstream.
> 
> Commit a2b3471b5b13 ("toshiba_acpi: Use the Hotkey Event Type function
> for keymap choosing") changed the *setup_keyboard function to query for
> the Hotkey Event Type to help choose the correct keymap, but turns out
> that here are certain Toshiba models out there not implementing this
> feature, and thus, failing to continue the input device registration and
> leaving such laptops without hotkey support.
> 
> This patch changes such check, and instead of returning an error if
> the Hotkey Event Type is not present, we simply inform userspace about it,
> changing the message printed from err to notice, making the function
> responsible for registering the input device to continue.
[...]

But then this function proceeds without events_type being initialised
at all, with unpredictable results.  This doesn't look like a proper
 fix.

Ben.

-- 
Ben Hutchings
The first rule of tautology club is the first rule of tautology club.

[toc] | [prev] | [next] | [standalone]


#1252566 — Re: [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models

FromDarren Hart <dvhart@infradead.org>
Date2015-10-21 10:50 +0200
SubjectRe: [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models
Message-ID<qlXfQ-6bq-7@gated-at.bofh.it>
In reply to#1251153
On Tue, Oct 20, 2015 at 12:32:45AM +0100, Ben Hutchings wrote:
> On Sat, 2015-10-17 at 18:55 -0700, Greg Kroah-Hartman wrote:
> > 4.2-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Azael Avalos <coproscefalo@gmail.com>
> > 
> > commit 53147b6cabee5e8d1997b5682fcc0c3b72ddf9c2 upstream.
> > 
> > Commit a2b3471b5b13 ("toshiba_acpi: Use the Hotkey Event Type function
> > for keymap choosing") changed the *setup_keyboard function to query for
> > the Hotkey Event Type to help choose the correct keymap, but turns out
> > that here are certain Toshiba models out there not implementing this
> > feature, and thus, failing to continue the input device registration and
> > leaving such laptops without hotkey support.
> > 
> > This patch changes such check, and instead of returning an error if
> > the Hotkey Event Type is not present, we simply inform userspace about it,
> > changing the message printed from err to notice, making the function
> > responsible for registering the input device to continue.
> [...]
> 
> But then this function proceeds without events_type being initialised
> at all, with unpredictable results.  This doesn't look like a proper
>  fix.

Azael, Ben has a point. Even after later patches, dev->hotkey_event_type doesn't
have a default value, so the later check for HCI_SYSTEM_TYPE1 or
HCI_SYSTEM_TYPE2 or failure is unpredictable.

-- 
Darren Hart
Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1256158 — Re: [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models

FromAzael Avalos <coproscefalo@gmail.com>
Date2015-10-26 18:00 +0100
SubjectRe: [PATCH 4.2 022/258] toshiba_acpi: Fix hotkeys registration on some toshiba models
Message-ID<qnThM-2d0-13@gated-at.bofh.it>
In reply to#1252566
Hi there,

Sorry for the late reply :-(

2015-10-21 2:48 GMT-06:00 Darren Hart <dvhart@infradead.org>:
> On Tue, Oct 20, 2015 at 12:32:45AM +0100, Ben Hutchings wrote:
>> On Sat, 2015-10-17 at 18:55 -0700, Greg Kroah-Hartman wrote:
>> > 4.2-stable review patch.  If anyone has any objections, please let me know.
>> >
>> > ------------------
>> >
>> > From: Azael Avalos <coproscefalo@gmail.com>
>> >
>> > commit 53147b6cabee5e8d1997b5682fcc0c3b72ddf9c2 upstream.
>> >
>> > Commit a2b3471b5b13 ("toshiba_acpi: Use the Hotkey Event Type function
>> > for keymap choosing") changed the *setup_keyboard function to query for
>> > the Hotkey Event Type to help choose the correct keymap, but turns out
>> > that here are certain Toshiba models out there not implementing this
>> > feature, and thus, failing to continue the input device registration and
>> > leaving such laptops without hotkey support.
>> >
>> > This patch changes such check, and instead of returning an error if
>> > the Hotkey Event Type is not present, we simply inform userspace about it,
>> > changing the message printed from err to notice, making the function
>> > responsible for registering the input device to continue.
>> [...]
>>
>> But then this function proceeds without events_type being initialised
>> at all, with unpredictable results.  This doesn't look like a proper
>>  fix.
>
> Azael, Ben has a point. Even after later patches, dev->hotkey_event_type doesn't
> have a default value, so the later check for HCI_SYSTEM_TYPE1 or
> HCI_SYSTEM_TYPE2 or failure is unpredictable.

Yes, I see the issue here.
Since the function was returning before the variable value didin't matter,
and when "fixing" the issue on the mentioned model I never took the
variable initialization into account.

I'll send a patch probably later today addressing this issue.

>
> --
> Darren Hart
> Intel Open Source Technology Center


Cheers
Azael


-- 
-- El mundo apesta y vosotros apestais tambien --
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web