wdt_i6300esb: fix incorrect mask for interrupt type
PATCH 1/1 wdt_i6300esb: fix incorrect mask for interrupt type
According to Intel 6300ESB Controller Hub Datasheet 14.4.15, the interrupt type mask should be 0x03 (0b11) instead of 0x11. In the original implementation, when we want to disable all interrupt by setting the value to 0x03, we will get 0x01 which is incorrect when we want to read the value again. However, there is no problem whe considering the correct behavior since 0x01 is reserved and unused just like 0x03. This patch is just a fix to return the register value.
--- hw/watchdog/wdt_i6300esb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/watchdog/wdt_i6300esb.c +1 -1
@@ -55,7 +55,7 @@/* Config register bits */ #define ESB_WDT_REBOOT (0x01 << 5)/* Enable reboot on timeout */ #define ESB_WDT_FREQ (0x01 << 2)/* Decrement frequency */ -#define ESB_WDT_INTTYPE (0x11 << 0)/* Interrupt type on timer1 timeout */ +#define ESB_WDT_INTTYPE (0x03 << 0)/* Interrupt type on timer1 timeout */ /* Reload register bits */ #define ESB_WDT_RELOAD (0x01 << 8)/* prevent timeout */
Signature · 1 line
2.50.1
Please send all patches to qemu-devel@ (CC'ed), not just qemu-trivial@, -- the same as for previous one.
Quoted 1 line · ShengYi Hung
According to Intel 6300ESB Controller Hub Datasheet 14.4.15, the interrupt
Which datasheet you refer to here?
Quoted 6 lines
type mask should be
0x03(0b11) instead of0x11. In the original implementation, when we want to disable all interrupt by setting the value to0x03, we will get0x01which is incorrect when we want to read the value again. However, there is no problem whe considering the correct behavior since0x01is reserved and unused just like0x03. This patch is just a fix to return the register value.
Applying to the trivial-patches tree, with spelling fix for the patch description.
Thanks,
/mjt
Quoted 18 lines
Signed-off-by ShengYi Hung <[email protected]>--- hw/watchdog/wdt_i6300esb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/watchdog/wdt_i6300esb.c +1
-1@@ -55,7 +55,7 @@/* Config register bits */ #define ESB_WDT_REBOOT (0x01 << 5)/* Enable reboot on timeout */ #define ESB_WDT_FREQ (0x01 << 2)/* Decrement frequency */ -#define ESB_WDT_INTTYPE (0x11 << 0)/* Interrupt type on timer1 timeout */ +#define ESB_WDT_INTTYPE (0x03 << 0)/* Interrupt type on timer1 timeout */ /* Reload register bits */ #define ESB_WDT_RELOAD (0x01 << 8)/* prevent timeout */