Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iicbus/iicsmb.c
Show First 20 Lines • Show All 449 Lines • ▼ Show 20 Lines | iicsmb_bread(device_t dev, u_char slave, char cmd, u_char *count, char *buf) | ||||
}; | }; | ||||
struct iic_msg block_msg[] = { | struct iic_msg block_msg[] = { | ||||
{ slave, IIC_M_RD | IIC_M_NOSTART, 0, buf }, | { slave, IIC_M_RD | IIC_M_NOSTART, 0, buf }, | ||||
}; | }; | ||||
device_t parent = device_get_parent(dev); | device_t parent = device_get_parent(dev); | ||||
int error; | int error; | ||||
/* Have to do this because the command is split in two transfers. */ | /* 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); | ||||
manu: Why ? | |||||
Done Inline Actionsipmi_ssif will smbus_request_bus to do multiple requests 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. scottph: ipmi_ssif will `smbus_request_bus` to do multiple requests smbus requests (which requests the… | |||||
Done Inline ActionsThat should be in the commit then. manu: That should be in the commit then. | |||||
if (error == 0) | if (error == 0) | ||||
error = TRANSFER_MSGS(dev, msgs); | error = TRANSFER_MSGS(dev, msgs); | ||||
if (error == 0) { | if (error == 0) { | ||||
/* | /* | ||||
* If the slave offers an empty or a too long reply, | * If the slave offers an empty or a too long reply, | ||||
* read one byte to generate the stop or abort. | * read one byte to generate the stop or abort. | ||||
*/ | */ | ||||
if (*count > SMB_MAXBLOCKSIZE || *count == 0) | if (*count > SMB_MAXBLOCKSIZE || *count == 0) | ||||
Show All 16 Lines |
Why ?