[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 01/16] pci/shpc: set attention led to OFF on reset
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 01/16] pci/shpc: set attention led to OFF on reset |
Date: |
Mon, 13 Feb 2023 15:16:23 +0100 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 |
On 13/2/23 15:00, Vladimir Sementsov-Ogievskiy wrote:
0 is not a valid state for the led. Let's start with OFF.
"0 is not valid" so we should abort(value != 0) in shpc_set_status(),
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
hw/pci/shpc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c
index fca7f6691a..1b3f619dc9 100644
--- a/hw/pci/shpc.c
+++ b/hw/pci/shpc.c
@@ -223,6 +223,7 @@ void shpc_reset(PCIDevice *d)
SHPC_SLOT_STATUS_PRSNT_MASK);
shpc_set_status(shpc, i, SHPC_LED_OFF, SHPC_SLOT_PWR_LED_MASK);
}
+ shpc_set_status(shpc, i, SHPC_LED_OFF, SHPC_SLOT_ATTN_LED_MASK);
shpc_set_status(shpc, i, 0, SHPC_SLOT_STATUS_66);
... however value=0 is used:
hw/pci/shpc.c:215: shpc_set_status(shpc, i, 0,
SHPC_SLOT_STATUS_MRL_OPEN);
hw/pci/shpc.c:226: shpc_set_status(shpc, i, 0, SHPC_SLOT_STATUS_66);
hw/pci/shpc.c:522: shpc_set_status(shpc, slot, 0,
SHPC_SLOT_STATUS_MRL_OPEN);
hw/pci/shpc.c:531: shpc_set_status(shpc, slot, 0,
SHPC_SLOT_STATUS_MRL_OPEN);
hw/pci/shpc.c:543: shpc_set_status(shpc, slot, 0, SHPC_SLOT_STATUS_66);
hw/pci/shpc.c:589: shpc_set_status(shpc, slot, 0, SHPC_SLOT_STATUS_66);
Is this fixable?
- [PATCH v4 02/16] pci/shpc: change shpc_get_status() return type to uint8_t, (continued)
- [PATCH v4 02/16] pci/shpc: change shpc_get_status() return type to uint8_t, Vladimir Sementsov-Ogievskiy, 2023/02/13
- [PATCH v4 06/16] pci/shpc: refactor shpc_device_plug_common(), Vladimir Sementsov-Ogievskiy, 2023/02/13
- [PATCH v4 03/16] pci/shpc: shpc_slot_command(): handle PWRONLY -> ENABLED transition, Vladimir Sementsov-Ogievskiy, 2023/02/13
- [PATCH v4 07/16] pcie: pcie_cap_slot_write_config(): use correct macro, Vladimir Sementsov-Ogievskiy, 2023/02/13
- [PATCH v4 10/16] pcie: pcie_cap_slot_enable_power() use correct helper, Vladimir Sementsov-Ogievskiy, 2023/02/13
- [PATCH v4 01/16] pci/shpc: set attention led to OFF on reset, Vladimir Sementsov-Ogievskiy, 2023/02/13
- [PATCH v4 04/16] pci/shpc: more generic handle hot-unplug in shpc_slot_command(), Vladimir Sementsov-Ogievskiy, 2023/02/13
- [PATCH v4 05/16] pci/shpc: pass PCIDevice pointer to shpc_slot_command(), Vladimir Sementsov-Ogievskiy, 2023/02/13
- [PATCH v4 14/16] qapi: deprecate "device" field of DEVICE_* events, Vladimir Sementsov-Ogievskiy, 2023/02/13