Date: Tue, 23 Feb 2021 20:07:54 GMT From: Allan Jude <allanjude@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 11ba8488b863 - main - iicsmb: Request the bus recursively in bread() Message-ID: <202102232007.11NK7sYE007082@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=11ba8488b8636a91668c0ee13d35d9e126dfba53 commit 11ba8488b8636a91668c0ee13d35d9e126dfba53 Author: Allan Jude <allanjude@FreeBSD.org> AuthorDate: 2021-02-23 20:06:16 +0000 Commit: Allan Jude <allanjude@FreeBSD.org> CommitDate: 2021-02-23 20:06:16 +0000 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 --- sys/dev/iicbus/iicsmb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102232007.11NK7sYE007082>