<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/char/ipmi, branch linux-4.6.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>ipmi: Remove smi_msg from waiting_rcv_msgs list before handle_one_recv_msg()</title>
<updated>2016-07-27T15:42:15+00:00</updated>
<author>
<name>Junichi Nomura</name>
<email>j-nomura@ce.jp.nec.com</email>
</author>
<published>2016-06-10T04:31:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b6d3c5d06a1c6d72d4a5242c3d204524145b257e'/>
<id>b6d3c5d06a1c6d72d4a5242c3d204524145b257e</id>
<content type='text'>
commit ae4ea9a2460c7fee2ae8feeb4dfe96f5f6c3e562 upstream.

Commit 7ea0ed2b5be8 ("ipmi: Make the message handler easier to use for
SMI interfaces") changed handle_new_recv_msgs() to call handle_one_recv_msg()
for a smi_msg while the smi_msg is still connected to waiting_rcv_msgs list.
That could lead to following list corruption problems:

1) low-level function treats smi_msg as not connected to list

  handle_one_recv_msg() could end up calling smi_send(), which
  assumes the msg is not connected to list.

  For example, the following sequence could corrupt list by
  doing list_add_tail() for the entry still connected to other list.

    handle_new_recv_msgs()
      msg = list_entry(waiting_rcv_msgs)
      handle_one_recv_msg(msg)
        handle_ipmb_get_msg_cmd(msg)
          smi_send(msg)
            spin_lock(xmit_msgs_lock)
            list_add_tail(msg)
            spin_unlock(xmit_msgs_lock)

2) race between multiple handle_new_recv_msgs() instances

  handle_new_recv_msgs() once releases waiting_rcv_msgs_lock before calling
  handle_one_recv_msg() then retakes the lock and list_del() it.

  If others call handle_new_recv_msgs() during the window shown below
  list_del() will be done twice for the same smi_msg.

  handle_new_recv_msgs()
    spin_lock(waiting_rcv_msgs_lock)
    msg = list_entry(waiting_rcv_msgs)
    spin_unlock(waiting_rcv_msgs_lock)
  |
  | handle_one_recv_msg(msg)
  |
    spin_lock(waiting_rcv_msgs_lock)
    list_del(msg)
    spin_unlock(waiting_rcv_msgs_lock)

Fixes: 7ea0ed2b5be8 ("ipmi: Make the message handler easier to use for SMI interfaces")
Signed-off-by: Jun'ichi Nomura &lt;j-nomura@ce.jp.nec.com&gt;
[Added a comment to describe why this works.]
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Tested-by: Ye Feng &lt;yefeng.yl@alibaba-inc.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 ae4ea9a2460c7fee2ae8feeb4dfe96f5f6c3e562 upstream.

Commit 7ea0ed2b5be8 ("ipmi: Make the message handler easier to use for
SMI interfaces") changed handle_new_recv_msgs() to call handle_one_recv_msg()
for a smi_msg while the smi_msg is still connected to waiting_rcv_msgs list.
That could lead to following list corruption problems:

1) low-level function treats smi_msg as not connected to list

  handle_one_recv_msg() could end up calling smi_send(), which
  assumes the msg is not connected to list.

  For example, the following sequence could corrupt list by
  doing list_add_tail() for the entry still connected to other list.

    handle_new_recv_msgs()
      msg = list_entry(waiting_rcv_msgs)
      handle_one_recv_msg(msg)
        handle_ipmb_get_msg_cmd(msg)
          smi_send(msg)
            spin_lock(xmit_msgs_lock)
            list_add_tail(msg)
            spin_unlock(xmit_msgs_lock)

2) race between multiple handle_new_recv_msgs() instances

  handle_new_recv_msgs() once releases waiting_rcv_msgs_lock before calling
  handle_one_recv_msg() then retakes the lock and list_del() it.

  If others call handle_new_recv_msgs() during the window shown below
  list_del() will be done twice for the same smi_msg.

  handle_new_recv_msgs()
    spin_lock(waiting_rcv_msgs_lock)
    msg = list_entry(waiting_rcv_msgs)
    spin_unlock(waiting_rcv_msgs_lock)
  |
  | handle_one_recv_msg(msg)
  |
    spin_lock(waiting_rcv_msgs_lock)
    list_del(msg)
    spin_unlock(waiting_rcv_msgs_lock)

Fixes: 7ea0ed2b5be8 ("ipmi: Make the message handler easier to use for SMI interfaces")
Signed-off-by: Jun'ichi Nomura &lt;j-nomura@ce.jp.nec.com&gt;
[Added a comment to describe why this works.]
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Tested-by: Ye Feng &lt;yefeng.yl@alibaba-inc.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi/watchdog: use nmi_panic() when kernel panics in NMI handler</title>
<updated>2016-03-22T22:36:02+00:00</updated>
<author>
<name>Hidehiro Kawai</name>
<email>hidehiro.kawai.ez@hitachi.com</email>
</author>
<published>2016-03-22T21:27:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=73cbf4a1ddfab247f9018550637c28a7d8dd9108'/>
<id>73cbf4a1ddfab247f9018550637c28a7d8dd9108</id>
<content type='text'>
Commit 1717f2096b54 ("panic, x86: Fix re-entrance problem due to panic
on NMI") introduced nmi_panic() which prevents concurrent and recursive
execution of panic().  It also saves registers for the crash dump on x86
by later commit 58c5661f2144 ("panic, x86: Allow CPUs to save registers
even if looping in NMI context").

ipmi_watchdog driver can call panic() from NMI handler, so replace it
with nmi_panic().

Signed-off-by: Hidehiro Kawai &lt;hidehiro.kawai.ez@hitachi.com&gt;
Acked-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Acked-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Michal Hocko &lt;mhocko@suse.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 1717f2096b54 ("panic, x86: Fix re-entrance problem due to panic
on NMI") introduced nmi_panic() which prevents concurrent and recursive
execution of panic().  It also saves registers for the crash dump on x86
by later commit 58c5661f2144 ("panic, x86: Allow CPUs to save registers
even if looping in NMI context").

ipmi_watchdog driver can call panic() from NMI handler, so replace it
with nmi_panic().

Signed-off-by: Hidehiro Kawai &lt;hidehiro.kawai.ez@hitachi.com&gt;
Acked-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Acked-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Michal Hocko &lt;mhocko@suse.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: do not probe ACPI devices if si_tryacpi is unset</title>
<updated>2016-03-18T12:01:24+00:00</updated>
<author>
<name>Joe Lawrence</name>
<email>joe.lawrence@stratus.com</email>
</author>
<published>2016-02-18T21:02:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9f0257b39c138330fec96e0f8f1a0135c1f0b6a5'/>
<id>9f0257b39c138330fec96e0f8f1a0135c1f0b6a5</id>
<content type='text'>
Extend the tryacpi module parameter to turn off acpi_ipmi_probe such
that hard-coded options (type, ports, address, etc.) have complete
control over the smi_info data structures setup by the driver.

Signed-off-by: Joe Lawrence &lt;joe.lawrence@stratus.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend the tryacpi module parameter to turn off acpi_ipmi_probe such
that hard-coded options (type, ports, address, etc.) have complete
control over the smi_info data structures setup by the driver.

Signed-off-by: Joe Lawrence &lt;joe.lawrence@stratus.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi_si: Avoid a wrong long timeout on transaction done</title>
<updated>2016-03-18T12:01:23+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2016-01-25T22:11:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d9dffd2a0bd84039f1b4f7e8835f1b0bbde0b3a7'/>
<id>d9dffd2a0bd84039f1b4f7e8835f1b0bbde0b3a7</id>
<content type='text'>
Under some circumstances, the IPMI state machine could return
a call without delay option but the driver would still do a long
delay because the result wasn't checked.  Instead of calling
the state machine after transaction done, just go back to the
top of the processing to start over.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Under some circumstances, the IPMI state machine could return
a call without delay option but the driver would still do a long
delay because the result wasn't checked.  Instead of calling
the state machine after transaction done, just go back to the
top of the processing to start over.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi_si: Fix module parameter doc names</title>
<updated>2016-03-18T12:01:23+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2016-01-19T20:51:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f813655a36830c54111763ba1acdbb0fe35813d9'/>
<id>f813655a36830c54111763ba1acdbb0fe35813d9</id>
<content type='text'>
Several were tryacpi instead of their actual values.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Several were tryacpi instead of their actual values.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi_ssif: Fix logic around alert handling</title>
<updated>2016-03-18T12:01:23+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2016-01-06T15:32:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=21c8f9154d9b3d2d84b619c2afdb6965f9d57975'/>
<id>21c8f9154d9b3d2d84b619c2afdb6965f9d57975</id>
<content type='text'>
There was a mistake in the logic, if an alert came in very quickly
it would hang the driver.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There was a mistake in the logic, if an alert came in very quickly
it would hang the driver.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: put acpi.h with the other headers</title>
<updated>2016-02-03T16:35:52+00:00</updated>
<author>
<name>Tony Camuso</name>
<email>tcamuso@redhat.com</email>
</author>
<published>2016-02-02T18:57:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=58c9d61f86e86ebe1e45ac7a0cd89a2c6299b034'/>
<id>58c9d61f86e86ebe1e45ac7a0cd89a2c6299b034</id>
<content type='text'>
Enclosing '#include &lt;linux/acpi.h&gt;' within '#ifdef CONFIG_ACPI' is
unnecessary, since it has its own conditional compile for CONFIG_ACPI.

Commit 0fbcf4af7c83 ("ipmi: Convert the IPMI SI ACPI handling to a
platform device") exposed this as a problem for platforms that do not
support ACPI when it introduced a call to ACPI_PTR() macro outside of
the CONFIG_ACPI conditional compile. This would have been perfectly
acceptable if acpi.h were not conditionally excluded for the non-acpi
platform, because the conditional compile within acpi.h defines
ACPI_PTR() to return NULL when compiled for non acpi platforms.

Signed-off-by: Tony Camuso &lt;tcamuso@redhat.com&gt;

Fixed commit reference in header to conform to standard.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Enclosing '#include &lt;linux/acpi.h&gt;' within '#ifdef CONFIG_ACPI' is
unnecessary, since it has its own conditional compile for CONFIG_ACPI.

Commit 0fbcf4af7c83 ("ipmi: Convert the IPMI SI ACPI handling to a
platform device") exposed this as a problem for platforms that do not
support ACPI when it introduced a call to ACPI_PTR() macro outside of
the CONFIG_ACPI conditional compile. This would have been perfectly
acceptable if acpi.h were not conditionally excluded for the non-acpi
platform, because the conditional compile within acpi.h defines
ACPI_PTR() to return NULL when compiled for non acpi platforms.

Signed-off-by: Tony Camuso &lt;tcamuso@redhat.com&gt;

Fixed commit reference in header to conform to standard.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: Remove unnecessary pci_disable_device.</title>
<updated>2016-01-12T21:08:49+00:00</updated>
<author>
<name>Dave Jones</name>
<email>dsj@fb.com</email>
</author>
<published>2015-11-20T00:24:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bb0dcebef99fd024c0fb2703179bc7d1fd5ee995'/>
<id>bb0dcebef99fd024c0fb2703179bc7d1fd5ee995</id>
<content type='text'>
We call cleanup_one_si from ipmi_pci_remove, which calls -&gt;addr_source_cleanup,
 which gets set to point to ipmi_pci_cleanup, which does a pci_disable_device.

On return from this, we do a second pci_disable_device, which
results in the trace below.

ipmi_si 0000:00:16.0: disabling already-disabled device
Call Trace:
 [&lt;ffffffff818ce54c&gt;] dump_stack+0x45/0x57
 [&lt;ffffffff810525f7&gt;] warn_slowpath_common+0x97/0xe0
 [&lt;ffffffff810526f6&gt;] warn_slowpath_fmt+0x46/0x50
 [&lt;ffffffff81497ca1&gt;] pci_disable_device+0xb1/0xc0
 [&lt;ffffffffa00851a5&gt;] ipmi_pci_remove+0x25/0x30 [ipmi_si]
 [&lt;ffffffff8149a696&gt;] pci_device_remove+0x46/0xc0
 [&lt;ffffffff8156801f&gt;] __device_release_driver+0x7f/0xf0
 [&lt;ffffffff81568978&gt;] driver_detach+0xb8/0xc0
 [&lt;ffffffff81567e50&gt;] bus_remove_driver+0x50/0xa0
 [&lt;ffffffff8156914e&gt;] driver_unregister+0x2e/0x60
 [&lt;ffffffff8149a3e5&gt;] pci_unregister_driver+0x25/0x90
 [&lt;ffffffffa0085804&gt;] cleanup_ipmi_si+0xd4/0xf0 [ipmi_si]
 [&lt;ffffffff810c727a&gt;] SyS_delete_module+0x12a/0x200
 [&lt;ffffffff818d4d72&gt;] system_call_fastpath+0x12/0x17

Signed-off-by: Dave Jones &lt;dsj@fb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We call cleanup_one_si from ipmi_pci_remove, which calls -&gt;addr_source_cleanup,
 which gets set to point to ipmi_pci_cleanup, which does a pci_disable_device.

On return from this, we do a second pci_disable_device, which
results in the trace below.

ipmi_si 0000:00:16.0: disabling already-disabled device
Call Trace:
 [&lt;ffffffff818ce54c&gt;] dump_stack+0x45/0x57
 [&lt;ffffffff810525f7&gt;] warn_slowpath_common+0x97/0xe0
 [&lt;ffffffff810526f6&gt;] warn_slowpath_fmt+0x46/0x50
 [&lt;ffffffff81497ca1&gt;] pci_disable_device+0xb1/0xc0
 [&lt;ffffffffa00851a5&gt;] ipmi_pci_remove+0x25/0x30 [ipmi_si]
 [&lt;ffffffff8149a696&gt;] pci_device_remove+0x46/0xc0
 [&lt;ffffffff8156801f&gt;] __device_release_driver+0x7f/0xf0
 [&lt;ffffffff81568978&gt;] driver_detach+0xb8/0xc0
 [&lt;ffffffff81567e50&gt;] bus_remove_driver+0x50/0xa0
 [&lt;ffffffff8156914e&gt;] driver_unregister+0x2e/0x60
 [&lt;ffffffff8149a3e5&gt;] pci_unregister_driver+0x25/0x90
 [&lt;ffffffffa0085804&gt;] cleanup_ipmi_si+0xd4/0xf0 [ipmi_si]
 [&lt;ffffffff810c727a&gt;] SyS_delete_module+0x12a/0x200
 [&lt;ffffffff818d4d72&gt;] system_call_fastpath+0x12/0x17

Signed-off-by: Dave Jones &lt;dsj@fb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>char: ipmi: Drop owner assignment from i2c_driver</title>
<updated>2016-01-12T21:08:49+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>k.kozlowski@samsung.com</email>
</author>
<published>2015-11-19T03:56:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=aad756f869c445488f814a2bff9211d81c46535e'/>
<id>aad756f869c445488f814a2bff9211d81c46535e</id>
<content type='text'>
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: constify some struct and char arrays</title>
<updated>2016-01-12T21:08:49+00:00</updated>
<author>
<name>LABBE Corentin</name>
<email>clabbe.montjoie@gmail.com</email>
</author>
<published>2015-11-13T12:31:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=99ee67351bedf23fe6b969dd94cc2847b397cd20'/>
<id>99ee67351bedf23fe6b969dd94cc2847b397cd20</id>
<content type='text'>
Lots of char arrays could be set as const since they contain only literal
char arrays.
We could in the same time make const some struct members who are pointer
to those const char arrays.

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Lots of char arrays could be set as const since they contain only literal
char arrays.
We could in the same time make const some struct members who are pointer
to those const char arrays.

Signed-off-by: LABBE Corentin &lt;clabbe.montjoie@gmail.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
