[ltp] Re: Gen 2 (Haswell) X1 Carbon suspend to RAM hang

Nikos Alexandris linux-thinkpad@linux-thinkpad.org
Mon, 22 Sep 2014 14:50:40 +0300


..

Bj=C3=B8rn:
>>>>> Maybe it's conflicting with some other unrelated change?


Nikos:
..
>>> So, here is some attempt:

>>> --%<---
>>> tpx1c2g linux-3.14.19 # patch -p1 < /tmp/foo
>>> patching file drivers/platform/x86/thinkpad_acpi.c
>>> Reversed (or previously applied) patch detected!  Assume -R? [n] n
>>> Apply anyway? [n] y
>>> Hunk #1 succeeded at 3537 with fuzz 1 (offset 100 lines).
>>> Hunk #2 FAILED at 3556.
>>> 1 out of 2 hunks FAILED -- saving rejects to file
>>> drivers/platform/x86/thinkpad_acpi.c.rej
>>> patch unexpectedly ends in middle of line
>>> --->%--
>>>
>>> and
>>>
>>> --%<---
>>> cat drivers/platform/x86/thinkpad_acpi.c.rej
>>> --- drivers/platform/x86/thinkpad_acpi.c
>>> +++ drivers/platform/x86/thinkpad_acpi.c
>>> @@ -3556,6 +3656,8 @@
>>>                         *ignore_acpi_ev =3D true;
>>>                 }
>>>                 return true;
>>> +       } else {
>>> +               return
>>> adaptive_keyboard_hotkey_notify_hotkey(scancode);
>>>         }
>>>         return false;
>>>  }
>>> --->%--


Bj=C3=B8rn:
>> So this failed hunk looks like something that should be fairly easy=20
>> to
>> add by hand.  Just open the drivers/platform/x86/thinkpad_acpi.c=20
>> file,
>> go look for whatever is there around line 3556 and add that
>> "else return ..." block at the right spot.


I think it's already there (after patching!?):

--%<---
static bool hotkey_notify_hotkey(const u32 hkey,
				 bool *send_acpi_ev,
				 bool *ignore_acpi_ev)
{
	/* 0x1000-0x1FFF: key presses */
	unsigned int scancode =3D hkey & 0xfff;
	*send_acpi_ev =3D true;
	*ignore_acpi_ev =3D false;

	/* HKEY event 0x1001 is scancode 0x00 */
	if (scancode > 0 && scancode <=3D TPACPI_HOTKEY_MAP_LEN) {
		scancode--;
		if (!(hotkey_source_mask & (1 << scancode))) {
			tpacpi_input_send_key_masked(scancode);
			*send_acpi_ev =3D false;
		} else {
			*ignore_acpi_ev =3D true;
		}
		return true;
	} else {
		return adaptive_keyboard_hotkey_notify_hotkey(scancode);
	}
	return false;
}
-->%--

The above is not my edit, it is just there in

tpx1c2g linux-3.14.19 # ls -l drivers/platform/x86/thinkpad_acpi.c
-rw-r--r-- 1 root root 242202 Sep 22 13:07=20
drivers/platform/x86/thinkpad_acpi.c

Looks like something else went wrong!  However, I can't force-remove=20
the module. It seems that the kernel I am running doesn't support this=20
kind of action.

Nikos