Skip to contentSkip to conversation

ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list

PATCH Superseded John Dahlstrom 2 participants 6 messages Feb 20, 2016 – Feb 29, 2016 x86 platform drivers

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list

Some Lenovo ideapad models lack a physical rfkill switch. On Lenovo models ideapad Y700 Touch-15ISK and ideapad Y700-15ISK, ideapad-laptop would wrongly report all radios as blocked by hardware which caused wireless network connections to fail.

Add these models without an rfkill switch to the no_hw_rfkill list.

Cc <[email protected]> # 4.5.x
Cc <[email protected]> # 4.4.x
Cc <[email protected]> # 4.3.x
Cc <[email protected]> # 4.2.x
Cc <[email protected]> # 4.1.x
Cc <[email protected]> # 4.0.x
Cc <[email protected]> # 3.19.x
Cc <[email protected]> # 3.18.x
Cc <[email protected]> # 3.17.x
Cc <[email protected]> # 3.16.x

---
Test configuration
Hardware: Lenovo ideapad Y700 Touch-15ISK
Kernel version: 4.4.2

Patch changelog
v2 split patch between Touch and non-Touch devices v3 undo patch split and limit summary to 72 characters v4 include comprehensive list of patchable kernels in Cc

  drivers/platform/x86/ideapad-laptop.c |   14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/platform/x86/ideapad-laptop.c +14 -0
@@ -864,4 +864,18 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
 			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo G50-30"),
 		},
+	},
+	{
+		.ident = "Lenovo ideapad Y700-15ISK",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-15ISK"),
+		},
+	},
+	{
+		.ident = "Lenovo ideapad Y700 Touch-15ISK",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700 Touch-15ISK"),
+		},
 	},
 	{
#1 lore raw
Quoted 7 lines · John Dahlstrom

Some Lenovo ideapad models lack a physical rfkill switch. On Lenovo models ideapad Y700 Touch-15ISK and ideapad Y700-15ISK, ideapad-laptop would wrongly report all radios as blocked by hardware which caused wireless network connections to fail.

Add these models without an rfkill switch to the no_hw_rfkill list.

Quoted 11 lines
Cc <[email protected]> # 4.5.x
Cc <[email protected]> # 4.4.x
Cc <[email protected]> # 4.3.x
Cc <[email protected]> # 4.2.x
Cc <[email protected]> # 4.1.x
Cc <[email protected]> # 4.0.x
Cc <[email protected]> # 3.19.x
Cc <[email protected]> # 3.18.x
Cc <[email protected]> # 3.17.x
Cc <[email protected]> # 3.16.x

Unfortunately, backporting this to stable is not quite so simple.

First, 3.16 doesn't really work as between 3.16 and 3.17 the following patch landed:

ce363c2 ideapad-laptop: Change Lenovo Yoga 2 series rfkill handling

Which changes the name of the dmi_system_id struct from rfkill_blacklist to no_hw_rfkill_list.

Following that, there were several additions to the list which should be applied before this patch to each stable kernel for which they haven't been picked up in order for this one to apply cleanly. Several of those are included below:

$ git l v3.17.. drivers/platform/x86/ideapad-laptop.c
b7287f0 ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list
6b31de3 ideapad-laptop: Add Lenovo Yoga 700 to no_hw_rfkill dmi list
edde316 ideapad-laptop: Add Lenovo ideapad Y700-17ISK to no_hw_rfkill dmi list
f71c882 ideapad-laptop: Add Lenovo Yoga 900 to no_hw_rfkill dmi list
c789fff ideapad-laptop: include Yoga 3 1170 in add rfkill whitelist
74caab9 ideapad-laptop: add support for Yoga 3 ESC key
6d212b8 ideapad-laptop: add alternative representation for Yoga 2 to DMI table
fa92a31 ideapad-laptop: Add Lenovo Yoga 3 14 to no_hw_rfkill dmi list
05fde26 Merge tag 'platform-drivers-x86-v4.2-1' of
git://git.infradead.org/users/dvhart/linux-platform-drivers-x86
26bff5f ideapad-laptop: Port to new backlight interface selection API
4b200b4 ideapad: fix software rfkill setting
4fa9dab ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked
9b071a4 ideapad_laptop: Add Lenovo G40-30 to devices without radio switch
385336e Merge tag 'platform-drivers-x86-v3.19-1' of
git://git.infradead.org/users/dvhart/linux-platform-drivers-x86
e6b5be2 Merge tag 'driver-core-3.19-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
0098181 platform: x86: Deletion of checks before backlight_device_unregister()
725c7f6 quirk for Lenovo Yoga 3: no rfkill switch
3493f41 platform: x86: drop owner assignment from platform_drivers

If you are going to specify a kernel version, you should also include the commits above necessary to make the patch apply cleanly. That would be a long list as you would need many of these for each version.

What I'm going to do is include a single Cc to stable line without a kernel version. The maintainers will pull that back as far as they can using their own judgement. If you want this to go back earlier than they do on their own, you should submit it to linux-stable directly and include the Cc lines for the dependencies for each kernel you care to see this backported to. See the stable-kernel-rules for the specific formatting to accomplish this.

Quoted 35 lines

---
Test configuration
Hardware: Lenovo ideapad Y700 Touch-15ISK
Kernel version: 4.4.2

Patch changelog
v2 split patch between Touch and non-Touch devices v3 undo patch split and limit summary to 72 characters v4 include comprehensive list of patchable kernels in Cc

  drivers/platform/x86/ideapad-laptop.c |   14 ++++++++++++++
  1 file changed, 14 insertions(+)
drivers/platform/x86/ideapad-laptop.c +14 -0
@@ -864,4 +864,18 @@ static const struct dmi_system_id no_hw_rfkill_list[] = {
 			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo G50-30"),
 		},
+	},
+	{
+		.ident = "Lenovo ideapad Y700-15ISK",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-15ISK"),
+		},
+	},
+	{
+		.ident = "Lenovo ideapad Y700 Touch-15ISK",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700 Touch-15ISK"),
+		},
 	},
 	{
Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#2 lore raw
Quoted 5 lines · Darren Hart

Unfortunately, backporting this to stable is not quite so simple.

First, 3.16 doesn't really work as between 3.16 and 3.17 the following patch landed:

Quoted 9 lines

ce363c2 ideapad-laptop: Change Lenovo Yoga 2 series rfkill handling

Which changes the name of the dmi_system_id struct from rfkill_blacklist to no_hw_rfkill_list.

Following that, there were several additions to the list which should be applied before this patch to each stable kernel for which they haven't been picked up in order for this one to apply cleanly. Several of those are included below:

Despite the change in the no_hw_rfkill_list, GNU patch still yields the correct output but with fuzz. I interpret apply cleanly to mean that the patch must also apply with zero fuzz, such as with "patch -F 0".

In the case where the context has changed (including changes to an
enclosing struct or function), I gather that a patch exactly modified
for an older kernel is to be sent to [email protected] after the unmodified patch is accepted upstream with a commit ID.

Quoted 1 line
$ git l v3.17.. drivers/platform/x86/ideapad-laptop.c

[...]

Quoted 4 lines

If you are going to specify a kernel version, you should also include the commits above necessary to make the patch apply cleanly. That would be a long list as you would need many of these for each version.

Thank you for that information. One commit is sufficient to apply the patch to all kernel versions without fuzz:

4fa9dab ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked

Quoted 7 lines

What I'm going to do is include a single Cc to stable line without a kernel version. The maintainers will pull that back as far as they can using their own judgement. If you want this to go back earlier than they do on their own, you should submit it to linux-stable directly and include the Cc lines for the dependencies for each kernel you care to see this backported to. See the stable-kernel-rules for the specific formatting to accomplish this.

I've submitted v5 of the patch with a single Cc line with the prerequisite kernel(s) and commit ID specified exactly.

Kind regards,

John

#3 lore raw
Quoted 34 lines · John Dahlstrom
Quoted 5 lines · Darren Hart

Unfortunately, backporting this to stable is not quite so simple.

First, 3.16 doesn't really work as between 3.16 and 3.17 the following patch landed:

Quoted 9 lines

ce363c2 ideapad-laptop: Change Lenovo Yoga 2 series rfkill handling

Which changes the name of the dmi_system_id struct from rfkill_blacklist to no_hw_rfkill_list.

Following that, there were several additions to the list which should be applied before this patch to each stable kernel for which they haven't been picked up in order for this one to apply cleanly. Several of those are included below:

Despite the change in the no_hw_rfkill_list, GNU patch still yields the correct output but with fuzz. I interpret apply cleanly to mean that the patch must also apply with zero fuzz, such as with "patch -F 0".

In the case where the context has changed (including changes to an enclosing struct or function), I gather that a patch exactly modified for an older kernel is to be sent to [email protected] after the unmodified patch is accepted upstream with a commit ID.

Quoted 1 line
$ git l v3.17.. drivers/platform/x86/ideapad-laptop.c

[...]

Quoted 4 lines

If you are going to specify a kernel version, you should also include the commits above necessary to make the patch apply cleanly. That would be a long list as you would need many of these for each version.

Quoted 4 lines

Thank you for that information. One commit is sufficient to apply the patch to all kernel versions without fuzz:

4fa9dab ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked

This does not yield correct results for me on 3.17 (or 3.17.8). Do you get different results from the following?

dvhart@dvhart-mobl5:~/source/linux/linux-pdx86 [testing]

$ git co -b 3.17 v3.17
Checking out files: 100% (36214/36214), done.
Switched to a new branch '3.17'

dvhart@dvhart-mobl5:~/source/linux/linux-pdx86 [3.17]

$ git cp 4fa9dab
[3.17 d2cdd70] ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked
 Author: Dmitry Tunin <[email protected]>
 Date: Sun Jan 18 15:44:40 2015 +0300
 1 file changed, 7 insertions(+)

dvhart@dvhart-mobl5:~/source/linux/linux-pdx86 [3.17]

$ git am ~/incoming/PATCH_v5_1-1_ideapad-laptop_Add_ideapad_Y700_15_to_the_no_hw_rfkill_DMI_list.mbox
Applying: ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list
error: patch failed: drivers/platform/x86/ideapad-laptop.c:864
error: drivers/platform/x86/ideapad-laptop.c: patch does not apply
Patch failed at 0001 ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list
The copy of the patch that failed is found in:
   /home/dvhart/source/linux/linux-pdx86/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

dvhart@dvhart-mobl5:~/source/linux/linux-pdx86 [3.17|AM 1/1]

$ patch -p1 < ~/incoming/PATCH_v5_1-1_ideapad-laptop_Add_ideapad_Y700_15_to_the_no_hw_rfkill_DMI_list.mbox 
patching file drivers/platform/x86/ideapad-laptop.c
Hunk #1 succeeded at 864 with fuzz 2.
$ cat drivers/platform/x86/ideapad-laptop.c | head -n 880 | tail -n 32

static int ideapad_acpi_add(struct platform_device *pdev)

{
	int ret, i;
	int cfg;
	struct ideapad_private *priv;
	struct acpi_device *adev;

	ret = acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev);
	if (ret)
		return -ENODEV;

	if (read_method_int(adev->handle, "_CFG", &cfg))
		return -ENODEV;

	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
	if (!priv)
	},
	{
		.ident = "Lenovo ideapad Y700-15ISK",
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700-15ISK"),
		},
	},
	{
		.ident = "Lenovo ideapad Y700 Touch-15ISK",
		.matches = {
			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad Y700 Touch-15ISK"),
		},
		return -ENOMEM;

Note that the DMI match blocks were stuffed in the middle of the ideapad_acpi_add() function instead of the no_hw_rfkill.

Quoted 16 lines
Quoted 8 lines

What I'm going to do is include a single Cc to stable line without a kernel version. The maintainers will pull that back as far as they can using their own judgement. If you want this to go back earlier than they do on their own, you should submit it to linux-stable directly and include the Cc lines for the dependencies for each kernel you care to see this backported to. See the stable-kernel-rules for the specific formatting to accomplish this.

I've submitted v5 of the patch with a single Cc line with the prerequisite kernel(s) and commit ID specified exactly.

Kind regards,

John

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#4 lore raw
Quoted 1 line · Darren Hart

On Mon, Feb 22, 2016 at 10:29:48PM -0600, John Dahlstrom wrote:

[...]

Quoted 8 lines
Quoted 4 lines

Thank you for that information. One commit is sufficient to apply the patch to all kernel versions without fuzz:

4fa9dab ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked

This does not yield correct results for me on 3.17 (or 3.17.8). Do you get different results from the following?

[...]

Quoted 2 lines

Note that the DMI match blocks were stuffed in the middle of the ideapad_acpi_add() function instead of the no_hw_rfkill.

The v3, v4, and v5 patch submissions had been corrupted by spurious whitespace inserted by my email client. I have sent a corrected version, [PATCH v6 1/1] ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list

After submission, I verified the successful application of the patch as received by the mailing list.

I also ran git clone, "git checkout -b 3.17 v3.17", and "git cherry-pick 4fa9dab", followed by patch with success.

Kind regards,

John

#5 lore raw
Quoted 19 lines · John Dahlstrom
Quoted 1 line · Darren Hart

On Mon, Feb 22, 2016 at 10:29:48PM -0600, John Dahlstrom wrote:

[...]

Quoted 8 lines
Quoted 4 lines

Thank you for that information. One commit is sufficient to apply the patch to all kernel versions without fuzz:

4fa9dab ideapad_laptop: Lenovo G50-30 fix rfkill reports wireless blocked

This does not yield correct results for me on 3.17 (or 3.17.8). Do you get different results from the following?

[...]

Quoted 2 lines

Note that the DMI match blocks were stuffed in the middle of the ideapad_acpi_add() function instead of the no_hw_rfkill.

The v3, v4, and v5 patch submissions had been corrupted by spurious whitespace inserted by my email client. I have sent a corrected version, [PATCH v6 1/1] ideapad-laptop: Add ideapad Y700 (15) to the no_hw_rfkill DMI list

Quoted 5 lines

After submission, I verified the successful application of the patch as received by the mailing list.

I also ran git clone, "git checkout -b 3.17 v3.17", and "git cherry-pick 4fa9dab", followed by patch with success.

OK, I've replaced the one in for-next with this one.

I'm not keen on backporting only certain dmi match patches back to stable, but I don't want to discourage people from working to get the hardware they care about supported in stable either.

Thanks for sticking with it and seeing this through to completion.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center