iicsmb: Request the bus recursively in bread()

ipmi_ssif will `smbus_request_bus()` to do multiple smbus requests
(which requests the iicbus), and then here in `bread()` we also need to
request the bus because `bread()` takes multiple transactions.
This causes deadlock as it's waiting for the bus it already has without
`IIC_RECURSIVE`.

Sponsored by:	Ampere Computing LLC
Submitted by:	Klara Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D28742
This commit is contained in:
Allan Jude 2021-02-23 20:06:16 +00:00
parent 6b7580f7b1
commit 11ba8488b8

View File

@ -455,7 +455,7 @@ iicsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf)
int error;
/* Have to do this because the command is split in two transfers. */
error = iicbus_request_bus(parent, dev, IIC_WAIT);
error = iicbus_request_bus(parent, dev, IIC_WAIT | IIC_RECURSIVE);
if (error == 0)
error = TRANSFER_MSGS(dev, msgs);
if (error == 0) {