[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/27] hw/i2c: pmbus: Page #255 is valid page for read requests.
From: |
Cédric Le Goater |
Subject: |
[PULL 15/27] hw/i2c: pmbus: Page #255 is valid page for read requests. |
Date: |
Thu, 30 Jun 2022 13:23:59 +0200 |
From: Maheswara Kurapati <quic_mkurapat@quicinc.com>
Current implementation of the pmbus core driver treats the read request
for page 255 as invalid request and sets the invalid command bit (bit 7)
in the STATUS_CML register. As per the PMBus specification it is a valid
request.
Refer to the PMBus specification, revision 1.3.1, section 11.10 PAGE,
on the page 58:
"Setting the PAGE to FFh means that all subsequent comands are to be
applied to all outputs.
Some commands, such as READ_TEMPERATURE, may use a common sensor but
be available on all pages of a device. Such implementations are the
decision of each device manufacturer or are specified in a PMBus
Application Profile. Consult the manufacturer's documents or the
Application Profile Specification as needed."
For e.g.,
The VOUT_MODE is a valid command for page 255 for maxim 31785 device.
refer to Table 1. PMBus Command Codes on page 14 in the datasheet.
https://datasheets.maximintegrated.com/en/ds/MAX31785.pdf
Fixes: 38870253f1d1 ("hw/i2c: pmbus: fix error returns and guard against out of
range accesses")
Signed-off-by: Maheswara Kurapati <quic_mkurapat@quicinc.com>
Signed-off-by: Jae Hyun Yoo <quic_jaehyoo@quicinc.com>
Reviewed-by: Titus Rwantare <titusr@google.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220627154703.148943-4-quic_jaehyoo@quicinc.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/i2c/pmbus_device.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/hw/i2c/pmbus_device.c b/hw/i2c/pmbus_device.c
index 62885fa6a15e..749a33af827b 100644
--- a/hw/i2c/pmbus_device.c
+++ b/hw/i2c/pmbus_device.c
@@ -284,14 +284,10 @@ static uint8_t pmbus_receive_byte(SMBusDevice *smd)
/*
* Reading from all pages will return the value from page 0,
- * this is unspecified behaviour in general.
+ * means that all subsequent commands are to be applied to all output.
*/
if (pmdev->page == PB_ALL_PAGES) {
index = 0;
- qemu_log_mask(LOG_GUEST_ERROR,
- "%s: tried to read from all pages\n",
- __func__);
- pmbus_cml_error(pmdev);
} else if (pmdev->page > pmdev->num_pages - 1) {
qemu_log_mask(LOG_GUEST_ERROR,
"%s: page %d is out of range\n",
--
2.35.3
- [PULL 07/27] aspeed/smc: Fix potential overflow, (continued)
- [PULL 07/27] aspeed/smc: Fix potential overflow, Cédric Le Goater, 2022/06/30
- [PULL 05/27] aspeed/i2c: Change trace event for NORMAL_STOP states, Cédric Le Goater, 2022/06/30
- [PULL 06/27] aspeed/hace: Accumulative mode supported, Cédric Le Goater, 2022/06/30
- [PULL 08/27] aspeed: Set CPU memory property explicitly, Cédric Le Goater, 2022/06/30
- [PULL 09/27] aspeed: Add memory property to Aspeed SoC, Cédric Le Goater, 2022/06/30
- [PULL 10/27] aspeed: Remove usage of sysbus_mmio_map, Cédric Le Goater, 2022/06/30
- [PULL 12/27] aspeed: Remove use of qemu_get_cpu, Cédric Le Goater, 2022/06/30
- [PULL 11/27] aspeed: Map unimplemented devices in SoC memory, Cédric Le Goater, 2022/06/30
- [PULL 13/27] hw/arm/aspeed: add support for the Qualcomm DC-SCM v1 board, Cédric Le Goater, 2022/06/30
- [PULL 14/27] hw/arm/aspeed: add Qualcomm Firework BMC machine, Cédric Le Goater, 2022/06/30
- [PULL 15/27] hw/i2c: pmbus: Page #255 is valid page for read requests.,
Cédric Le Goater <=
- [PULL 17/27] hw/arm/aspeed: Add MAX31785 Fan controllers, Cédric Le Goater, 2022/06/30
- [PULL 16/27] hw/sensor: add Maxim MAX31785 device, Cédric Le Goater, 2022/06/30
- [PULL 18/27] hw/arm/aspeed: firework: Add Thermal Diodes, Cédric Le Goater, 2022/06/30
- [PULL 19/27] hw/arm/aspeed: firework: add I2C MUXes for VR channels, Cédric Le Goater, 2022/06/30
- [PULL 20/27] hw/i2c/aspeed: Fix R_I2CD_FUN_CTRL reference, Cédric Le Goater, 2022/06/30
- [PULL 21/27] hw/i2c/aspeed: Fix DMA len write-enable bit handling, Cédric Le Goater, 2022/06/30
- [PULL 22/27] hw/i2c/aspeed: Fix MASTER_EN missing error message, Cédric Le Goater, 2022/06/30
- [PULL 23/27] hw/i2c: support multiple masters, Cédric Le Goater, 2022/06/30
- [PULL 25/27] hw/i2c/aspeed: add slave device in old register mode, Cédric Le Goater, 2022/06/30
- [PULL 27/27] hw/misc/aspeed: Add PECI controller, Cédric Le Goater, 2022/06/30