<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/char/ipmi, branch v5.10.42</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.10.42</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.10.42'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2020-10-14T22:00:20Z</updated>
<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.stealer.net/cgit.cgi/user/sven/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: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.stealer.net/cgit.cgi/user/sven/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: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.stealer.net/cgit.cgi/user/sven/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: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.stealer.net/cgit.cgi/user/sven/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: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.stealer.net/cgit.cgi/user/sven/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: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.stealer.net/cgit.cgi/user/sven/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:20Z</updated>
<author>
<name>Xianting Tian</name>
<email>tian.xianting@h3c.com</email>
</author>
<published>2020-09-15T07:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:27Z</updated>
<author>
<name>Markus Boehme</name>
<email>markubo@amazon.com</email>
</author>
<published>2020-09-07T16:25:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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:35Z</updated>
<author>
<name>Xiongfeng Wang</name>
<email>wangxiongfeng2@huawei.com</email>
</author>
<published>2020-09-03T11:01:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/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>
<entry>
<title>treewide: Use fallthrough pseudo-keyword</title>
<updated>2020-08-23T22:36:59Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2020-08-23T22:36:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=df561f6688fef775baa341a0f5d960becd248b11'/>
<id>urn:sha1:df561f6688fef775baa341a0f5d960becd248b11</id>
<content type='text'>
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
</content>
</entry>
</feed>
