<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/char/ipmi, branch v5.10.78</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.78</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.78'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-07-19T07:44:59+00:00</updated>
<entry>
<title>ipmi/watchdog: Stop watchdog timer when the current action is 'none'</title>
<updated>2021-07-19T07:44:59+00:00</updated>
<author>
<name>Petr Pavlu</name>
<email>petr.pavlu@suse.com</email>
</author>
<published>2021-05-13T12:26:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ef5066f95c15c24ec9b1dbbcf33cb17d36742c9c'/>
<id>urn:sha1:ef5066f95c15c24ec9b1dbbcf33cb17d36742c9c</id>
<content type='text'>
commit 2253042d86f57d90a621ac2513a7a7a13afcf809 upstream.

When an IPMI watchdog timer is being stopped in ipmi_close() or
ipmi_ioctl(WDIOS_DISABLECARD), the current watchdog action is updated to
WDOG_TIMEOUT_NONE and _ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB) is called
to install this action. The latter function ends up invoking
__ipmi_set_timeout() which makes the actual 'Set Watchdog Timer' IPMI
request.

For IPMI 1.0, this operation results in fully stopping the watchdog timer.
For IPMI &gt;= 1.5, function __ipmi_set_timeout() always specifies the "don't
stop" flag in the prepared 'Set Watchdog Timer' IPMI request. This causes
that the watchdog timer has its action correctly updated to 'none' but the
timer continues to run. A problem is that IPMI firmware can then still log
an expiration event when the configured timeout is reached, which is
unexpected because the watchdog timer was requested to be stopped.

The patch fixes this problem by not setting the "don't stop" flag in
__ipmi_set_timeout() when the current action is WDOG_TIMEOUT_NONE which
results in stopping the watchdog timer. This makes the behaviour for
IPMI &gt;= 1.5 consistent with IPMI 1.0. It also matches the logic in
__ipmi_heartbeat() which does not allow to reset the watchdog if the
current action is WDOG_TIMEOUT_NONE as that would start the timer.

Signed-off-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;
Message-Id: &lt;10a41bdc-9c99-089c-8d89-fa98ce5ea080@suse.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge tag 'for-linus-5.10-1' of git://github.com/cminyard/linux-ipmi</title>
<updated>2020-10-14T22:00:20+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-10-14T22:00:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e4dc3d59284ea3bc7c3e40694bce84d988b01af'/>
<id>urn:sha1:6e4dc3d59284ea3bc7c3e40694bce84d988b01af</id>
<content type='text'>
Pull IPMI updates from Corey Minyard:
 "Some minor bug fixes, return values, cleanups of prints, conversion of
  tasklets to the new API.

  The biggest change is retrying the initial information fetch from the
  management controller. If that fails, the iterface is not operational,
  and one group was having trouble with the management controller not
  being ready when the OS started up. So a retry was added"

* tag 'for-linus-5.10-1' of git://github.com/cminyard/linux-ipmi:
  ipmi_si: Fix wrong return value in try_smi_init()
  ipmi: msghandler: Fix a signedness bug
  ipmi: add retry in try_get_dev_id()
  ipmi: Clean up some printks
  ipmi:msghandler: retry to get device id on an error
  ipmi:sm: Print current state when the state is invalid
  ipmi: Reset response handler when failing to send the command
  ipmi: add a newline when printing parameter 'panic_op' by sysfs
  char: ipmi: convert tasklets to use new tasklet_setup() API
</content>
</entry>
<entry>
<title>ipmi_si: Fix wrong return value in try_smi_init()</title>
<updated>2020-10-05T18:30:51+00:00</updated>
<author>
<name>Tianjia Zhang</name>
<email>tianjia.zhang@linux.alibaba.com</email>
</author>
<published>2020-10-05T14:52:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8fe7990ceda8597e407d06bffc4bdbe835a93ece'/>
<id>urn:sha1:8fe7990ceda8597e407d06bffc4bdbe835a93ece</id>
<content type='text'>
On an error exit path, a negative error code should be returned
instead of a positive return value.

Fixes: 90b2d4f15ff7 ("ipmi_si: Remove hacks for adding a dummy platform devices")
Cc: Corey Minyard &lt;cminyard@mvista.com&gt;
Signed-off-by: Tianjia Zhang &lt;tianjia.zhang@linux.alibaba.com&gt;
Message-Id: &lt;20201005145212.84435-1-tianjia.zhang@linux.alibaba.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: msghandler: Fix a signedness bug</title>
<updated>2020-09-18T21:34:52+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2020-09-18T14:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c011410d9145695c460567fa5ba1ade6a7b16f06'/>
<id>urn:sha1:c011410d9145695c460567fa5ba1ade6a7b16f06</id>
<content type='text'>
The type for the completion codes should be unsigned char instead of
char.  If it is declared as a normal char then the conditions in
__get_device_id() are impossible because the IPMI_DEVICE_IN_FW_UPDATE_ERR
error codes are higher than 127.

    drivers/char/ipmi/ipmi_msghandler.c:2449 __get_device_id()
    warn: impossible condition '(bmc-&gt;cc == 209) =&gt; ((-128)-127 == 209)'

Fixes: f8910ffa81b0 ("ipmi:msghandler: retry to get device id on an error")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Message-Id: &lt;20200918142756.GB909725@mwanda&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: add retry in try_get_dev_id()</title>
<updated>2020-09-16T13:54:53+00:00</updated>
<author>
<name>Xianting Tian</name>
<email>tian.xianting@h3c.com</email>
</author>
<published>2020-09-16T06:21:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=42d8a346c5c06689f4f25aecfa287a5aca501a55'/>
<id>urn:sha1:42d8a346c5c06689f4f25aecfa287a5aca501a55</id>
<content type='text'>
Use a retry machanism to give the BMC more opportunities to correctly
respond when we receive specific completion codes.

This is similar to what is done in __get_device_id().

Signed-off-by: Xianting Tian &lt;tian.xianting@h3c.com&gt;
Message-Id: &lt;20200916062129.26129-1-tian.xianting@h3c.com&gt;
[Moved GET_DEVICE_ID_MAX_RETRY to include/linux/ipmi.h, reworded some
 text.]
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: Clean up some printks</title>
<updated>2020-09-15T14:57:45+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2020-09-15T13:48:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a190db945bccdb8c51a02fc26a9f79b860dc586e'/>
<id>urn:sha1:a190db945bccdb8c51a02fc26a9f79b860dc586e</id>
<content type='text'>
Convert to dev_xxx() and fix some verbage.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi:msghandler: retry to get device id on an error</title>
<updated>2020-09-15T14:57:45+00:00</updated>
<author>
<name>Xianting Tian</name>
<email>tian.xianting@h3c.com</email>
</author>
<published>2020-09-15T07:18:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f8910ffa81b085030dc54814c85d338c26a3157e'/>
<id>urn:sha1:f8910ffa81b085030dc54814c85d338c26a3157e</id>
<content type='text'>
We fail to get the BMCS's device id with low probability when loading
the ipmi driver and it causes BMC device registration failed. When this
issue occurs we got below kernel prints:

  [Wed Sep  9 19:52:03 2020] ipmi_si IPI0001:00: IPMI message handler:
     device id demangle failed: -22
  [Wed Sep  9 19:52:03 2020] IPMI BT: using default values
  [Wed Sep  9 19:52:03 2020] IPMI BT: req2rsp=5 secs retries=2
  [Wed Sep  9 19:52:03 2020] ipmi_si IPI0001:00: Unable to get the
     device id: -5
  [Wed Sep  9 19:52:04 2020] ipmi_si IPI0001:00: Unable to register
     device: error -5

When this issue happens, we want to manually unload the driver and try to
load it again, but it can't be unloaded by 'rmmod' as it is already 'in
use'.

We add a print in handle_one_recv_msg(), when this issue happens,
the msg we received is "Recv: 1c 01 d5", which means the data_len is 1,
data[0] is 0xd5 (completion code), which means "bmc cannot execute
command.  Command, or request parameter(s), not supported in present
state".  Debug code:
	static int handle_one_recv_msg(struct ipmi_smi *intf,
                               struct ipmi_smi_msg *msg) {
        	printk("Recv: %*ph\n", msg-&gt;rsp_size, msg-&gt;rsp);
		... ...
	}
Then in ipmi_demangle_device_id(), it returned '-EINVAL' as 'data_len &lt; 7'
and 'data[0] != 0'.

We created this patch to retry the get device id when this error
happens.  We reproduced this issue again and the retry succeed on the
first retry, we finally got the correct msg and then all is ok:
Recv: 1c 01 00 01 81 05 84 02 af db 07 00 01 00 b9 00 10 00

So use a retry machanism in this patch to give bmc more opportunity to
correctly response kernel when we received specific completion codes.

Signed-off-by: Xianting Tian &lt;tian.xianting@h3c.com&gt;
Message-Id: &lt;20200915071817.4484-1-tian.xianting@h3c.com&gt;
[Cleaned up the verbage a bit in the header and prints.]
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi:sm: Print current state when the state is invalid</title>
<updated>2020-09-15T14:46:20+00:00</updated>
<author>
<name>Xianting Tian</name>
<email>tian.xianting@h3c.com</email>
</author>
<published>2020-09-15T07:44:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c2b1e76d8c91166ca5f7aa8df02d67b619e24dc3'/>
<id>urn:sha1:c2b1e76d8c91166ca5f7aa8df02d67b619e24dc3</id>
<content type='text'>
Print current state before returning IPMI_NOT_IN_MY_STATE_ERR so we can
know where this issue is coming from and possibly fix the state machine.

Signed-off-by: Xianting Tian &lt;tian.xianting@h3c.com&gt;
Message-Id: &lt;20200915074441.4090-1-tian.xianting@h3c.com&gt;
[Converted printk() to pr_xxx().]
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: Reset response handler when failing to send the command</title>
<updated>2020-09-15T13:52:27+00:00</updated>
<author>
<name>Markus Boehme</name>
<email>markubo@amazon.com</email>
</author>
<published>2020-09-07T16:25:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=81e7571ea35e2b8b74b777ac8484818c8a984ea9'/>
<id>urn:sha1:81e7571ea35e2b8b74b777ac8484818c8a984ea9</id>
<content type='text'>
When failing to send a command we don't expect a response. Clear the
`null_user_handler` like is done in the success path.

Signed-off-by: Markus Boehme &lt;markubo@amazon.com&gt;
Message-Id: &lt;1599495937-10654-1-git-send-email-markubo@amazon.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: add a newline when printing parameter 'panic_op' by sysfs</title>
<updated>2020-09-03T18:34:35+00:00</updated>
<author>
<name>Xiongfeng Wang</name>
<email>wangxiongfeng2@huawei.com</email>
</author>
<published>2020-09-03T11:01:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a00e56a14a706cdca9b2a575e7a709b641f3ce0'/>
<id>urn:sha1:8a00e56a14a706cdca9b2a575e7a709b641f3ce0</id>
<content type='text'>
When I cat ipmi_msghandler parameter 'panic_op' by sysfs, it displays as
follows. It's better to add a newline for easy reading.

root@(none):/# cat /sys/module/ipmi_msghandler/parameters/panic_op
noneroot@(none):/#

Signed-off-by: Xiongfeng Wang &lt;wangxiongfeng2@huawei.com&gt;
Message-Id: &lt;1599130873-2402-1-git-send-email-wangxiongfeng2@huawei.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
</feed>
