• Brett Creeley's avatar
    ice: fix issue where host reboots on unload when iommu=on · 0e04e8e1
    Brett Creeley authored
    Currently if the kernel has the intel_iommu=on parameter set, on some
    platforms removing the driver causes a system reboot. In initialization
    we associate the control queue interrupts with the pf->hw_oicr_idx and
    enable the interrupts by setting the CAUSE_ENA bit. The problem comes
    on teardown because we are not clearing the CAUSE_ENA bit for the
    control queues, but the vector at pf->hw_oicr_idx (miscellaneous
    interrupt vector) gets disabled.
    
    Fix this by clearing the CAUSE_ENA bit in the appropriate control queue
    registers on when freeing the miscellaneous interrupt vector. Also,
    move the call to ice_free_irq_msix_misc() to after ice_deinit_sw() in
    ice_remove() because ice_deinit_sw() makes an AQ call, but
    ice_free_irq_msix_misc() disables the miscellaneous vector and it's
    associated interrupts.
    
    Also, create two small helper functions to enable and disable the
    control queue interrupts respectively.
    Signed-off-by: default avatarBrett Creeley <brett.creeley@intel.com>
    Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
    Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    0e04e8e1
ice_main.c 106 KB