aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Jude <allanjude@FreeBSD.org>2021-02-23 20:06:16 +0000
committerAllan Jude <allanjude@FreeBSD.org>2021-02-23 20:06:16 +0000
commit11ba8488b8636a91668c0ee13d35d9e126dfba53 (patch)
tree221ce7e2ca7cd6378b64f314e083a3490ce460c0
parent6b7580f7b1b66134286813b971ab575862b95426 (diff)
downloadsrc-11ba8488b8636a91668c0ee13d35d9e126dfba53.tar.gz
src-11ba8488b8636a91668c0ee13d35d9e126dfba53.zip
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
-rw-r--r--sys/dev/iicbus/iicsmb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c
index 8e79452cf2a8..38e67c40d488 100644
--- a/sys/dev/iicbus/iicsmb.c
+++ b/sys/dev/iicbus/iicsmb.c
@@ -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) {