<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/char/ipmi, branch v5.11</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.11</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.11'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-12-16T13:54:54Z</updated>
<entry>
<title>char: ipmi: convert comma to semicolon</title>
<updated>2020-12-16T13:54:54Z</updated>
<author>
<name>Zheng Yongjun</name>
<email>zhengyongjun3@huawei.com</email>
</author>
<published>2020-12-16T13:26:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fad0319cacdf02a8d4d31aa1d8dc18c5bd5e397e'/>
<id>urn:sha1:fad0319cacdf02a8d4d31aa1d8dc18c5bd5e397e</id>
<content type='text'>
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun &lt;zhengyongjun3@huawei.com&gt;
Message-Id: &lt;20201216132615.15529-1-zhengyongjun3@huawei.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: msghandler: Suppress suspicious RCU usage warning</title>
<updated>2020-11-19T12:36:28Z</updated>
<author>
<name>Qinglang Miao</name>
<email>miaoqinglang@huawei.com</email>
</author>
<published>2020-11-19T07:08:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=368ffd9adc7a01234c0c68ffd72cc76840f20134'/>
<id>urn:sha1:368ffd9adc7a01234c0c68ffd72cc76840f20134</id>
<content type='text'>
while running ipmi, ipmi_smi_watcher_register() caused
a suspicious RCU usage warning.

-----

=============================
WARNING: suspicious RCU usage
5.10.0-rc3+ #1 Not tainted
-----------------------------
drivers/char/ipmi/ipmi_msghandler.c:750 RCU-list traversed in non-reader section!!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
2 locks held by syz-executor.0/4254:
stack backtrace:
CPU: 0 PID: 4254 Comm: syz-executor.0 Not tainted 5.10.0-rc3+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1 04/ 01/2014
Call Trace:
dump_stack+0x19d/0x200
ipmi_smi_watcher_register+0x2d3/0x340 [ipmi_msghandler]
acpi_ipmi_init+0xb1/0x1000 [acpi_ipmi]
do_one_initcall+0x149/0x7e0
do_init_module+0x1ef/0x700
load_module+0x3467/0x4140
__do_sys_finit_module+0x10d/0x1a0
do_syscall_64+0x34/0x80
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x468ded

-----

It is safe because smi_watchers_mutex is locked and srcu_read_lock
has been used, so simply pass lockdep_is_held() to the
list_for_each_entry_rcu() to suppress this warning.

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Qinglang Miao &lt;miaoqinglang@huawei.com&gt;
Message-Id: &lt;20201119070839.381-1-miaoqinglang@huawei.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi/watchdog: replace atomic_add() and atomic_sub()</title>
<updated>2020-11-17T12:57:45Z</updated>
<author>
<name>Yejune Deng</name>
<email>yejune.deng@gmail.com</email>
</author>
<published>2020-11-16T07:30:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a01a89b1db1066a6af23ae08b9a0c345b7966f0b'/>
<id>urn:sha1:a01a89b1db1066a6af23ae08b9a0c345b7966f0b</id>
<content type='text'>
atomic_inc() and atomic_dec() looks better

Signed-off-by: Yejune Deng &lt;yejune.deng@gmail.com&gt;
Message-Id: &lt;1605511807-7135-1-git-send-email-yejune.deng@gmail.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>char: ipmi: remove unneeded break</title>
<updated>2020-10-27T21:08:22Z</updated>
<author>
<name>Tom Rix</name>
<email>trix@redhat.com</email>
</author>
<published>2020-10-19T19:48:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0df7b988d9df24d1ea120fde69b3e9cbd2555597'/>
<id>urn:sha1:0df7b988d9df24d1ea120fde69b3e9cbd2555597</id>
<content type='text'>
A break is not needed if it is preceded by a return

Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Message-Id: &lt;20201019194805.14996-1-trix@redhat.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&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:20Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-10-14T22:00:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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:51Z</updated>
<author>
<name>Tianjia Zhang</name>
<email>tianjia.zhang@linux.alibaba.com</email>
</author>
<published>2020-10-05T14:52:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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:52Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2020-09-18T14:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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:53Z</updated>
<author>
<name>Xianting Tian</name>
<email>tian.xianting@h3c.com</email>
</author>
<published>2020-09-16T06:21:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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:45Z</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2020-09-15T13:48:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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:45Z</updated>
<author>
<name>Xianting Tian</name>
<email>tian.xianting@h3c.com</email>
</author>
<published>2020-09-15T07:18:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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>
</feed>
