• Tejun Heo's avatar
    [PATCH] fix atapi_packet_task vs. intr race (take 2) · c1389503
    Tejun Heo authored
    Interrupts from devices sharing the same IRQ could cause
    ata_host_intr to finish commands being processed by atapi_packet_task
    if the commands are using ATA_PROT_ATAPI_NODATA or ATA_PROT_ATAPI_DMA
    protocol.  This is because libata interrupt handler is unaware that
    interrupts are not expected during that period.  This patch adds
    ATA_FLAG_NOINTR flag to tell the interrupt handler that we're not
    expecting interrupts.
    
     Note that once proper HSM is implemented for interrupt-driven PIO,
    this should be merged into it and this flag will be removed.
    
     ahci.c is a different kind of beast, so it's left alone.
    
    * The following drivers use ata_qc_issue_prot and ata_interrupt, so
      changes in libata core will do.
    
      ata_piix sata_sil sata_svw sata_via sata_sis sata_uli
    
    * The following drivers use ata_qc_issue_prot and custom intr handler.
      They need this change to work correctly.
    
      sata_nv sata_vsc
    
    * The following drivers use custom issue function and intr handler.
      Currently all custom issue functions don't support ATAPI, so this
      change is irrelevant, updated for consistency and to avoid later
      mistakes.
    
      sata_promise sata_qstor sata_sx4
    Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
    Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
    c1389503
sata_nv.c 16.5 KB