Skip to content
  • Peter Maydell's avatar
    f837b468
    hw/intc/allwinner-a10-pic: Handle IRQ levels other than 0 or 1 · f837b468
    Peter Maydell authored
    
    
    In commit 2c5fa077 we fixed an endianness bug in the Allwinner
    A10 PIC model; however in the process we introduced a regression.
    This is because the old code was robust against the incoming 'level'
    argument being something other than 0 or 1, whereas the new code was
    not.
    
    In particular, the allwinner-sdhost code treats its IRQ line
    as 0-vs-non-0 rather than 0-vs-1, so when the SD controller
    set its IRQ line for any reason other than transmit the
    interrupt controller would ignore it. The observed effect
    was a guest timeout when rebooting the guest kernel.
    
    Handle level values other than 0 or 1, to restore the old
    behaviour.
    
    Fixes: 2c5fa077 ("hw/intc/allwinner-a10-pic: Don't use set_bit()/clear_bit()")
    Cc: qemu-stable@nongnu.org
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Message-id: 20230606104609.3692557-2-peter.maydell@linaro.org
    f837b468
    hw/intc/allwinner-a10-pic: Handle IRQ levels other than 0 or 1
    Peter Maydell authored
    
    
    In commit 2c5fa077 we fixed an endianness bug in the Allwinner
    A10 PIC model; however in the process we introduced a regression.
    This is because the old code was robust against the incoming 'level'
    argument being something other than 0 or 1, whereas the new code was
    not.
    
    In particular, the allwinner-sdhost code treats its IRQ line
    as 0-vs-non-0 rather than 0-vs-1, so when the SD controller
    set its IRQ line for any reason other than transmit the
    interrupt controller would ignore it. The observed effect
    was a guest timeout when rebooting the guest kernel.
    
    Handle level values other than 0 or 1, to restore the old
    behaviour.
    
    Fixes: 2c5fa077 ("hw/intc/allwinner-a10-pic: Don't use set_bit()/clear_bit()")
    Cc: qemu-stable@nongnu.org
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
    Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Message-id: 20230606104609.3692557-2-peter.maydell@linaro.org
Loading