<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git, branch v4.4.20</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>Linux 4.4.20</title>
<updated>2016-09-07T06:32:59+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2016-09-07T06:32:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=2cb99ded2f551c78506e5f7bbf6c0d7613351ab1'/>
<id>2cb99ded2f551c78506e5f7bbf6c0d7613351ab1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>sysfs: correctly handle read offset on PREALLOC attrs</title>
<updated>2016-09-07T06:32:46+00:00</updated>
<author>
<name>Konstantin Khlebnikov</name>
<email>khlebnikov@yandex-team.ru</email>
</author>
<published>2016-06-22T18:42:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=625ddb785d013221458ab851ac718495eba1dcbf'/>
<id>625ddb785d013221458ab851ac718495eba1dcbf</id>
<content type='text'>
commit 17d0774f80681020eccc9638d925a23f1fc4f671 upstream.

Attributes declared with __ATTR_PREALLOC use sysfs_kf_read() which returns
zero bytes for non-zero offset. This breaks script checkarray in mdadm tool
in debian where /bin/sh is 'dash' because its builtin 'read' reads only one
byte at a time. Script gets 'i' instead of 'idle' when reads current action
from /sys/block/$dev/md/sync_action and as a result does nothing.

This patch adds trivial implementation of partial read: generate whole
string and move required part into buffer head.

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Fixes: 4ef67a8c95f3 ("sysfs/kernfs: make read requests on pre-alloc files use the buffer.")
Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=787950
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 17d0774f80681020eccc9638d925a23f1fc4f671 upstream.

Attributes declared with __ATTR_PREALLOC use sysfs_kf_read() which returns
zero bytes for non-zero offset. This breaks script checkarray in mdadm tool
in debian where /bin/sh is 'dash' because its builtin 'read' reads only one
byte at a time. Script gets 'i' instead of 'idle' when reads current action
from /sys/block/$dev/md/sync_action and as a result does nothing.

This patch adds trivial implementation of partial read: generate whole
string and move required part into buffer head.

Signed-off-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Fixes: 4ef67a8c95f3 ("sysfs/kernfs: make read requests on pre-alloc files use the buffer.")
Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=787950
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>hwmon: (iio_hwmon) fix memory leak in name attribute</title>
<updated>2016-09-07T06:32:46+00:00</updated>
<author>
<name>Quentin Schulz</name>
<email>quentin.schulz@free-electrons.com</email>
</author>
<published>2016-07-26T07:47:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=dde898fba89069f78be1d0174f5184dc939cce5f'/>
<id>dde898fba89069f78be1d0174f5184dc939cce5f</id>
<content type='text'>
commit 5d17d3b4bbf3becb89fd48b74340a50a39736f6d upstream.

The "name" variable's memory is now freed when the device is destructed
thanks to devm function.

Signed-off-by: Quentin Schulz &lt;quentin.schulz@free-electrons.com&gt;
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Fixes: e0f8a24e0edfd ("staging:iio::hwmon interface client driver.")
Fixes: 61bb53bcbdd86 ("hwmon: (iio_hwmon) Add support for humidity sensors")
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5d17d3b4bbf3becb89fd48b74340a50a39736f6d upstream.

The "name" variable's memory is now freed when the device is destructed
thanks to devm function.

Signed-off-by: Quentin Schulz &lt;quentin.schulz@free-electrons.com&gt;
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Fixes: e0f8a24e0edfd ("staging:iio::hwmon interface client driver.")
Fixes: 61bb53bcbdd86 ("hwmon: (iio_hwmon) Add support for humidity sensors")
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: line6: Fix POD sysfs attributes segfault</title>
<updated>2016-09-07T06:32:46+00:00</updated>
<author>
<name>Andrej Krutak</name>
<email>dev@andree.sk</email>
</author>
<published>2016-08-18T21:52:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=a2d9e40c8fdc8d206ebee3ec8066bf240a340c65'/>
<id>a2d9e40c8fdc8d206ebee3ec8066bf240a340c65</id>
<content type='text'>
commit b027d11263836a0cd335520175257dcb99b43757 upstream.

The commit 02fc76f6a changed base of the sysfs attributes from device to card.
The "show" callbacks dereferenced wrong objects because of this.

Fixes: 02fc76f6a7db ('ALSA: line6: Create sysfs via snd_card_add_dev_attr()')
Reviewed-by: Stefan Hajnoczi &lt;stefanha@gmail.com&gt;
Signed-off-by: Andrej Krutak &lt;dev@andree.sk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b027d11263836a0cd335520175257dcb99b43757 upstream.

The commit 02fc76f6a changed base of the sysfs attributes from device to card.
The "show" callbacks dereferenced wrong objects because of this.

Fixes: 02fc76f6a7db ('ALSA: line6: Create sysfs via snd_card_add_dev_attr()')
Reviewed-by: Stefan Hajnoczi &lt;stefanha@gmail.com&gt;
Signed-off-by: Andrej Krutak &lt;dev@andree.sk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: line6: Give up on the lock while URBs are released.</title>
<updated>2016-09-07T06:32:46+00:00</updated>
<author>
<name>Andrej Krutak</name>
<email>dev@andree.sk</email>
</author>
<published>2016-08-18T21:52:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=d21befeb0d9ad10a69850969963de00a46eb992a'/>
<id>d21befeb0d9ad10a69850969963de00a46eb992a</id>
<content type='text'>
commit adc8a43a6d6688272ebffa81789fa857e603dec6 upstream.

Done, because line6_stream_stop() locks and calls line6_unlink_audio_urbs(),
which in turn invokes audio_out_callback(), which tries to lock 2nd time.

Fixes:

=============================================
[ INFO: possible recursive locking detected ]
4.4.15+ #15 Not tainted
---------------------------------------------
mplayer/3591 is trying to acquire lock:
 (&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock){-.-...}, at: [&lt;bfa27655&gt;] audio_out_callback+0x70/0x110 [snd_usb_line6]

but task is already holding lock:
 (&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock){-.-...}, at: [&lt;bfa26aad&gt;] line6_stream_stop+0x24/0x5c [snd_usb_line6]

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock);
  lock(&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by mplayer/3591:
 #0:  (snd_pcm_link_rwlock){.-.-..}, at: [&lt;bf8d49a7&gt;] snd_pcm_stream_lock+0x1e/0x40 [snd_pcm]
 #1:  (&amp;(&amp;substream-&gt;self_group.lock)-&gt;rlock){-.-...}, at: [&lt;bf8d49af&gt;] snd_pcm_stream_lock+0x26/0x40 [snd_pcm]
 #2:  (&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock){-.-...}, at: [&lt;bfa26aad&gt;] line6_stream_stop+0x24/0x5c [snd_usb_line6]

stack backtrace:
CPU: 0 PID: 3591 Comm: mplayer Not tainted 4.4.15+ #15
Hardware name: Generic AM33XX (Flattened Device Tree)
[&lt;c0015d85&gt;] (unwind_backtrace) from [&lt;c001253d&gt;] (show_stack+0x11/0x14)
[&lt;c001253d&gt;] (show_stack) from [&lt;c02f1bdf&gt;] (dump_stack+0x8b/0xac)
[&lt;c02f1bdf&gt;] (dump_stack) from [&lt;c0076f43&gt;] (__lock_acquire+0xc8b/0x1780)
[&lt;c0076f43&gt;] (__lock_acquire) from [&lt;c007810d&gt;] (lock_acquire+0x99/0x1c0)
[&lt;c007810d&gt;] (lock_acquire) from [&lt;c06171e7&gt;] (_raw_spin_lock_irqsave+0x3f/0x4c)
[&lt;c06171e7&gt;] (_raw_spin_lock_irqsave) from [&lt;bfa27655&gt;] (audio_out_callback+0x70/0x110 [snd_usb_line6])
[&lt;bfa27655&gt;] (audio_out_callback [snd_usb_line6]) from [&lt;c04294db&gt;] (__usb_hcd_giveback_urb+0x53/0xd0)
[&lt;c04294db&gt;] (__usb_hcd_giveback_urb) from [&lt;c046388d&gt;] (musb_giveback+0x3d/0x98)
[&lt;c046388d&gt;] (musb_giveback) from [&lt;c04647f5&gt;] (musb_urb_dequeue+0x6d/0x114)
[&lt;c04647f5&gt;] (musb_urb_dequeue) from [&lt;c042ac11&gt;] (usb_hcd_unlink_urb+0x39/0x98)
[&lt;c042ac11&gt;] (usb_hcd_unlink_urb) from [&lt;bfa26a87&gt;] (line6_unlink_audio_urbs+0x6a/0x6c [snd_usb_line6])
[&lt;bfa26a87&gt;] (line6_unlink_audio_urbs [snd_usb_line6]) from [&lt;bfa26acb&gt;] (line6_stream_stop+0x42/0x5c [snd_usb_line6])
[&lt;bfa26acb&gt;] (line6_stream_stop [snd_usb_line6]) from [&lt;bfa26fe7&gt;] (snd_line6_trigger+0xb6/0xf4 [snd_usb_line6])
[&lt;bfa26fe7&gt;] (snd_line6_trigger [snd_usb_line6]) from [&lt;bf8d47b7&gt;] (snd_pcm_do_stop+0x36/0x38 [snd_pcm])
[&lt;bf8d47b7&gt;] (snd_pcm_do_stop [snd_pcm]) from [&lt;bf8d462f&gt;] (snd_pcm_action_single+0x22/0x40 [snd_pcm])
[&lt;bf8d462f&gt;] (snd_pcm_action_single [snd_pcm]) from [&lt;bf8d46f9&gt;] (snd_pcm_action+0xac/0xb0 [snd_pcm])
[&lt;bf8d46f9&gt;] (snd_pcm_action [snd_pcm]) from [&lt;bf8d4b61&gt;] (snd_pcm_drop+0x38/0x64 [snd_pcm])
[&lt;bf8d4b61&gt;] (snd_pcm_drop [snd_pcm]) from [&lt;bf8d6233&gt;] (snd_pcm_common_ioctl1+0x7fe/0xbe8 [snd_pcm])
[&lt;bf8d6233&gt;] (snd_pcm_common_ioctl1 [snd_pcm]) from [&lt;bf8d6779&gt;] (snd_pcm_playback_ioctl1+0x15c/0x51c [snd_pcm])
[&lt;bf8d6779&gt;] (snd_pcm_playback_ioctl1 [snd_pcm]) from [&lt;bf8d6b59&gt;] (snd_pcm_playback_ioctl+0x20/0x28 [snd_pcm])
[&lt;bf8d6b59&gt;] (snd_pcm_playback_ioctl [snd_pcm]) from [&lt;c016714b&gt;] (do_vfs_ioctl+0x3af/0x5c8)

Fixes: 63e20df1e5b2 ('ALSA: line6: Reorganize PCM stream handling')
Reviewed-by: Stefan Hajnoczi &lt;stefanha@gmail.com&gt;
Signed-off-by: Andrej Krutak &lt;dev@andree.sk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit adc8a43a6d6688272ebffa81789fa857e603dec6 upstream.

Done, because line6_stream_stop() locks and calls line6_unlink_audio_urbs(),
which in turn invokes audio_out_callback(), which tries to lock 2nd time.

Fixes:

=============================================
[ INFO: possible recursive locking detected ]
4.4.15+ #15 Not tainted
---------------------------------------------
mplayer/3591 is trying to acquire lock:
 (&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock){-.-...}, at: [&lt;bfa27655&gt;] audio_out_callback+0x70/0x110 [snd_usb_line6]

but task is already holding lock:
 (&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock){-.-...}, at: [&lt;bfa26aad&gt;] line6_stream_stop+0x24/0x5c [snd_usb_line6]

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock);
  lock(&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

3 locks held by mplayer/3591:
 #0:  (snd_pcm_link_rwlock){.-.-..}, at: [&lt;bf8d49a7&gt;] snd_pcm_stream_lock+0x1e/0x40 [snd_pcm]
 #1:  (&amp;(&amp;substream-&gt;self_group.lock)-&gt;rlock){-.-...}, at: [&lt;bf8d49af&gt;] snd_pcm_stream_lock+0x26/0x40 [snd_pcm]
 #2:  (&amp;(&amp;line6pcm-&gt;out.lock)-&gt;rlock){-.-...}, at: [&lt;bfa26aad&gt;] line6_stream_stop+0x24/0x5c [snd_usb_line6]

stack backtrace:
CPU: 0 PID: 3591 Comm: mplayer Not tainted 4.4.15+ #15
Hardware name: Generic AM33XX (Flattened Device Tree)
[&lt;c0015d85&gt;] (unwind_backtrace) from [&lt;c001253d&gt;] (show_stack+0x11/0x14)
[&lt;c001253d&gt;] (show_stack) from [&lt;c02f1bdf&gt;] (dump_stack+0x8b/0xac)
[&lt;c02f1bdf&gt;] (dump_stack) from [&lt;c0076f43&gt;] (__lock_acquire+0xc8b/0x1780)
[&lt;c0076f43&gt;] (__lock_acquire) from [&lt;c007810d&gt;] (lock_acquire+0x99/0x1c0)
[&lt;c007810d&gt;] (lock_acquire) from [&lt;c06171e7&gt;] (_raw_spin_lock_irqsave+0x3f/0x4c)
[&lt;c06171e7&gt;] (_raw_spin_lock_irqsave) from [&lt;bfa27655&gt;] (audio_out_callback+0x70/0x110 [snd_usb_line6])
[&lt;bfa27655&gt;] (audio_out_callback [snd_usb_line6]) from [&lt;c04294db&gt;] (__usb_hcd_giveback_urb+0x53/0xd0)
[&lt;c04294db&gt;] (__usb_hcd_giveback_urb) from [&lt;c046388d&gt;] (musb_giveback+0x3d/0x98)
[&lt;c046388d&gt;] (musb_giveback) from [&lt;c04647f5&gt;] (musb_urb_dequeue+0x6d/0x114)
[&lt;c04647f5&gt;] (musb_urb_dequeue) from [&lt;c042ac11&gt;] (usb_hcd_unlink_urb+0x39/0x98)
[&lt;c042ac11&gt;] (usb_hcd_unlink_urb) from [&lt;bfa26a87&gt;] (line6_unlink_audio_urbs+0x6a/0x6c [snd_usb_line6])
[&lt;bfa26a87&gt;] (line6_unlink_audio_urbs [snd_usb_line6]) from [&lt;bfa26acb&gt;] (line6_stream_stop+0x42/0x5c [snd_usb_line6])
[&lt;bfa26acb&gt;] (line6_stream_stop [snd_usb_line6]) from [&lt;bfa26fe7&gt;] (snd_line6_trigger+0xb6/0xf4 [snd_usb_line6])
[&lt;bfa26fe7&gt;] (snd_line6_trigger [snd_usb_line6]) from [&lt;bf8d47b7&gt;] (snd_pcm_do_stop+0x36/0x38 [snd_pcm])
[&lt;bf8d47b7&gt;] (snd_pcm_do_stop [snd_pcm]) from [&lt;bf8d462f&gt;] (snd_pcm_action_single+0x22/0x40 [snd_pcm])
[&lt;bf8d462f&gt;] (snd_pcm_action_single [snd_pcm]) from [&lt;bf8d46f9&gt;] (snd_pcm_action+0xac/0xb0 [snd_pcm])
[&lt;bf8d46f9&gt;] (snd_pcm_action [snd_pcm]) from [&lt;bf8d4b61&gt;] (snd_pcm_drop+0x38/0x64 [snd_pcm])
[&lt;bf8d4b61&gt;] (snd_pcm_drop [snd_pcm]) from [&lt;bf8d6233&gt;] (snd_pcm_common_ioctl1+0x7fe/0xbe8 [snd_pcm])
[&lt;bf8d6233&gt;] (snd_pcm_common_ioctl1 [snd_pcm]) from [&lt;bf8d6779&gt;] (snd_pcm_playback_ioctl1+0x15c/0x51c [snd_pcm])
[&lt;bf8d6779&gt;] (snd_pcm_playback_ioctl1 [snd_pcm]) from [&lt;bf8d6b59&gt;] (snd_pcm_playback_ioctl+0x20/0x28 [snd_pcm])
[&lt;bf8d6b59&gt;] (snd_pcm_playback_ioctl [snd_pcm]) from [&lt;c016714b&gt;] (do_vfs_ioctl+0x3af/0x5c8)

Fixes: 63e20df1e5b2 ('ALSA: line6: Reorganize PCM stream handling')
Reviewed-by: Stefan Hajnoczi &lt;stefanha@gmail.com&gt;
Signed-off-by: Andrej Krutak &lt;dev@andree.sk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ALSA: line6: Remove double line6_pcm_release() after failed acquire.</title>
<updated>2016-09-07T06:32:46+00:00</updated>
<author>
<name>Andrej Krutak</name>
<email>dev@andree.sk</email>
</author>
<published>2016-08-18T21:52:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=85db22a1079b6e10d30b83aca749c98b612d2867'/>
<id>85db22a1079b6e10d30b83aca749c98b612d2867</id>
<content type='text'>
commit 7e4379eae0e31994ea645db1d13006ea8e5ce539 upstream.

If there's an error, pcm is released in line6_pcm_acquire already.

Fixes: 247d95ee6dd2 ('ALSA: line6: Handle error from line6_pcm_acquire()')
Reviewed-by: Stefan Hajnoczi &lt;stefanha@gmail.com&gt;
Signed-off-by: Andrej Krutak &lt;dev@andree.sk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 7e4379eae0e31994ea645db1d13006ea8e5ce539 upstream.

If there's an error, pcm is released in line6_pcm_acquire already.

Fixes: 247d95ee6dd2 ('ALSA: line6: Handle error from line6_pcm_acquire()')
Reviewed-by: Stefan Hajnoczi &lt;stefanha@gmail.com&gt;
Signed-off-by: Andrej Krutak &lt;dev@andree.sk&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ACPI / SRAT: fix SRAT parsing order with both LAPIC and X2APIC present</title>
<updated>2016-09-07T06:32:45+00:00</updated>
<author>
<name>Lukasz Anaczkowski</name>
<email>lukasz.anaczkowski@intel.com</email>
</author>
<published>2016-04-21T09:29:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=37e16dc96556fbcba12b6bb1d151df5a769e7928'/>
<id>37e16dc96556fbcba12b6bb1d151df5a769e7928</id>
<content type='text'>
commit 702b07fcc9b264c9afd372676bbdd50a762dcde0 upstream.

SRAT maps APIC ID to proximity domains ids (PXM). Mapping from PXM to
NUMA node ids is based on order of entries in SRAT table.
SRAT table has just LAPIC entires or mix of LAPIC and X2APIC entries.
As long as there are only LAPIC entires, mapping from proximity domain
id to NUMA node id is as assumed by BIOS. However, once APIC entries are
mixed, X2APIC entries would be first mapped which causes unexpected NUMA
node mapping.

To fix that, change parsing to check each entry against both LAPIC and
X2APIC so mapping is in the SRAT/PXM order.

This is supplemental change to the fix made by commit d81056b5278
(Handle apic/x2apic entries in MADT in correct order) and using the
mechanism introduced by 9b3fedd (ACPI / tables: Add acpi_subtable_proc
to ACPI table parsers).

Fixes: d81056b5278 (Handle apic/x2apic entries in MADT in correct order)
Signed-off-by: Lukasz Anaczkowski &lt;lukasz.anaczkowski@intel.com&gt;
[ rjw : Subject &amp; changelog ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 702b07fcc9b264c9afd372676bbdd50a762dcde0 upstream.

SRAT maps APIC ID to proximity domains ids (PXM). Mapping from PXM to
NUMA node ids is based on order of entries in SRAT table.
SRAT table has just LAPIC entires or mix of LAPIC and X2APIC entries.
As long as there are only LAPIC entires, mapping from proximity domain
id to NUMA node id is as assumed by BIOS. However, once APIC entries are
mixed, X2APIC entries would be first mapped which causes unexpected NUMA
node mapping.

To fix that, change parsing to check each entry against both LAPIC and
X2APIC so mapping is in the SRAT/PXM order.

This is supplemental change to the fix made by commit d81056b5278
(Handle apic/x2apic entries in MADT in correct order) and using the
mechanism introduced by 9b3fedd (ACPI / tables: Add acpi_subtable_proc
to ACPI table parsers).

Fixes: d81056b5278 (Handle apic/x2apic entries in MADT in correct order)
Signed-off-by: Lukasz Anaczkowski &lt;lukasz.anaczkowski@intel.com&gt;
[ rjw : Subject &amp; changelog ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ACPI / sysfs: fix error code in get_status()</title>
<updated>2016-09-07T06:32:45+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-05-05T13:23:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=a37b834402b27800d028b06b8e0c1275b607ff37'/>
<id>a37b834402b27800d028b06b8e0c1275b607ff37</id>
<content type='text'>
commit f18ebc211e259d4f591e39e74b2aa2de226c9a1d upstream.

The problem with ornamental, do-nothing gotos is that they lead to
"forgot to set the error code" bugs.  We should be returning -EINVAL
here but we don't.  It leads to an uninitalized variable in
counter_show():

    drivers/acpi/sysfs.c:603 counter_show()
    error: uninitialized symbol 'status'.

Fixes: 1c8fce27e275 (ACPI: introduce drivers/acpi/sysfs.c)
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f18ebc211e259d4f591e39e74b2aa2de226c9a1d upstream.

The problem with ornamental, do-nothing gotos is that they lead to
"forgot to set the error code" bugs.  We should be returning -EINVAL
here but we don't.  It leads to an uninitalized variable in
counter_show():

    drivers/acpi/sysfs.c:603 counter_show()
    error: uninitialized symbol 'status'.

Fixes: 1c8fce27e275 (ACPI: introduce drivers/acpi/sysfs.c)
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ACPI / drivers: replace acpi_probe_lock spinlock with mutex</title>
<updated>2016-09-07T06:32:45+00:00</updated>
<author>
<name>Lorenzo Pieralisi</name>
<email>lorenzo.pieralisi@arm.com</email>
</author>
<published>2016-08-16T15:59:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=b0917f5dae67620aaab79e98cdb53a5620570e58'/>
<id>b0917f5dae67620aaab79e98cdb53a5620570e58</id>
<content type='text'>
commit 5331d9cab32ef640b4cd38a43b0858874fbb7168 upstream.

Commit e647b532275b ("ACPI: Add early device probing infrastructure")
introduced code that allows inserting driver specific
struct acpi_probe_entry probe entries into ACPI linker sections
(one per-subsystem, eg irqchip, clocksource) that are then walked
to retrieve the data and function hooks required to probe the
respective kernel components.

Probing for all entries in a section is triggered through
the __acpi_probe_device_table() function, that in turn, according
to the table ID a given probe entry reports parses the table
with the function retrieved from the respective section structures
(ie struct acpi_probe_entry). Owing to the current ACPI table
parsing implementation, the __acpi_probe_device_table() function
has to share global variables with the acpi_match_madt() function, so
in order to guarantee mutual exclusion locking is required
between the two functions.

Current kernel code implements the locking through the acpi_probe_lock
spinlock; this has the side effect of requiring all code called
within the lock (ie struct acpi_probe_entry.probe_{table/subtbl} hooks)
not to sleep.

However, kernel subsystems that make use of the early probing
infrastructure are relying on kernel APIs that may sleep (eg
irq_domain_alloc_fwnode(), among others) in the function calls
pointed at by struct acpi_probe_entry.{probe_table/subtbl} entries
(eg gic_v2_acpi_init()), which is a bug.

Since __acpi_probe_device_table() is called from context
that is allowed to sleep the acpi_probe_lock spinlock can be replaced
with a mutex; this fixes the issue whilst still guaranteeing
mutual exclusion.

Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Fixes: e647b532275b (ACPI: Add early device probing infrastructure)
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5331d9cab32ef640b4cd38a43b0858874fbb7168 upstream.

Commit e647b532275b ("ACPI: Add early device probing infrastructure")
introduced code that allows inserting driver specific
struct acpi_probe_entry probe entries into ACPI linker sections
(one per-subsystem, eg irqchip, clocksource) that are then walked
to retrieve the data and function hooks required to probe the
respective kernel components.

Probing for all entries in a section is triggered through
the __acpi_probe_device_table() function, that in turn, according
to the table ID a given probe entry reports parses the table
with the function retrieved from the respective section structures
(ie struct acpi_probe_entry). Owing to the current ACPI table
parsing implementation, the __acpi_probe_device_table() function
has to share global variables with the acpi_match_madt() function, so
in order to guarantee mutual exclusion locking is required
between the two functions.

Current kernel code implements the locking through the acpi_probe_lock
spinlock; this has the side effect of requiring all code called
within the lock (ie struct acpi_probe_entry.probe_{table/subtbl} hooks)
not to sleep.

However, kernel subsystems that make use of the early probing
infrastructure are relying on kernel APIs that may sleep (eg
irq_domain_alloc_fwnode(), among others) in the function calls
pointed at by struct acpi_probe_entry.{probe_table/subtbl} entries
(eg gic_v2_acpi_init()), which is a bug.

Since __acpi_probe_device_table() is called from context
that is allowed to sleep the acpi_probe_lock spinlock can be replaced
with a mutex; this fixes the issue whilst still guaranteeing
mutual exclusion.

Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Fixes: e647b532275b (ACPI: Add early device probing infrastructure)
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ACPI / drivers: fix typo in ACPI_DECLARE_PROBE_ENTRY macro</title>
<updated>2016-09-07T06:32:45+00:00</updated>
<author>
<name>Lorenzo Pieralisi</name>
<email>lorenzo.pieralisi@arm.com</email>
</author>
<published>2016-08-16T15:59:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=0b21b21b58706dc35102b24a566bb578c32218df'/>
<id>0b21b21b58706dc35102b24a566bb578c32218df</id>
<content type='text'>
commit 3feab13c919f99b0a17d0ca22ae00cf90f5d3fd1 upstream.

When the ACPI_DECLARE_PROBE_ENTRY macro was added in
commit e647b532275b ("ACPI: Add early device probing infrastructure"),
a stub macro adding an unused entry was added for the !CONFIG_ACPI
Kconfig option case to make sure kernel code making use of the
macro did not require to be guarded within CONFIG_ACPI in order to
be compiled.

The stub macro was never used since all kernel code that defines
ACPI_DECLARE_PROBE_ENTRY entries is currently guarded within
CONFIG_ACPI; it contains a typo that should be nonetheless fixed.

Fix the typo in the stub (ie !CONFIG_ACPI) ACPI_DECLARE_PROBE_ENTRY()
macro so that it can actually be used if needed.

Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Fixes: e647b532275b (ACPI: Add early device probing infrastructure)
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3feab13c919f99b0a17d0ca22ae00cf90f5d3fd1 upstream.

When the ACPI_DECLARE_PROBE_ENTRY macro was added in
commit e647b532275b ("ACPI: Add early device probing infrastructure"),
a stub macro adding an unused entry was added for the !CONFIG_ACPI
Kconfig option case to make sure kernel code making use of the
macro did not require to be guarded within CONFIG_ACPI in order to
be compiled.

The stub macro was never used since all kernel code that defines
ACPI_DECLARE_PROBE_ENTRY entries is currently guarded within
CONFIG_ACPI; it contains a typo that should be nonetheless fixed.

Fix the typo in the stub (ie !CONFIG_ACPI) ACPI_DECLARE_PROBE_ENTRY()
macro so that it can actually be used if needed.

Signed-off-by: Lorenzo Pieralisi &lt;lorenzo.pieralisi@arm.com&gt;
Fixes: e647b532275b (ACPI: Add early device probing infrastructure)
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
