• Kenji Kaneshige's avatar
    pciehp: fix interrupt initialization · c4635eb0
    Kenji Kaneshige authored
    Current pciehp driver's intialization sequence is as follows:
    
    (1) initialize controller data structure
    (2) install interrupt handler
    (3) enable software notification
    (4) initialize controller specific slot data structure
    (5) initialize generic slot data structure and register it to pci hotplug core
    
    The interrupt handler of pciehp assumes that controller specific slot
    data structure is already initialized. However, it is installed at (2)
    before initializing controller specific slot data structure at
    (4). Because of this, pciehp driver cannot handle the following cases
    properly.
    
    - If devices that shares IRQ with pciehp raise interrupts between (2) and (4).
    - If hotplug events (e.g. MRL open) happen between (3) and (4).
    
    We already have a workaround for this problem ("pciehp: fix NULL
    dereference in interrupt handler: dbd79aed).
    But we still need fundamental fix.
    
    This patch fix the problem by changing the initilization sequence as follows:
    
    (1) initialize controller data structure
    (2) initialize controller specific slot data structure
    (3) install interrupt handler
    (4) enable software notification
    (5) initialize generic slot data structure and register it to pci hotplug core
    Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
    Acked-by: default avatarAlex Chiang <achiang@hp.com>
    Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
    c4635eb0
pciehp.h 7.3 KB