• Julian Wiedmann's avatar
    scsi: zfcp: Lift Input Queue tasklet from qdio · 0b524abc
    Julian Wiedmann authored
    Shift the IRQ tasklet processing from the qdio layer into zfcp.  This will
    allow for a good amount of cleanups in qdio, and provides future
    opportunity to improve the IRQ processing inside zfcp.
    
    We continue to use the qdio layer's internal tasklet/timer mechanism
    (ie. scan_threshold etc) to check for Request Queue completions.  Initially
    we planned to check for such completions after inspecting the Response
    Queue - this should typically work, but there's a theoretical race where
    the device only presents the Request Queue completions _after_ all Response
    Queue processing has finished.  If the Request Queue is then also
    _completely_ full, we could send no further IOs and thus get no interrupt
    that would trigger an inspection of the Request Queue.  So for now stick to
    the old model, where we can trust that such a race would be recovered by
    qdio's internal timer.
    
    Code-flow wise, this establishes two levels of control:
    
    1. The qdio layer will only deliver IRQs to the device driver if the
       QDIO_IRQ_DISABLED flag is cleared. zfcp manages this through
       qdio_start_irq() / qdio_stop_irq(). The initial state is DISABLED, and
       zfcp_qdio_open() schedules zfcp's IRQ tasklet once during startup to
       explicitly enable IRQ delivery.
    
    2. The zfcp tasklet is initialized with tasklet_disable(), and only gets
       enabled once we open the qdio device.  When closing the qdio device, we
       must disable the tasklet _before_ disabling IRQ delivery (otherwise a
       concurrently running tasklet could re-enable IRQ delivery after we
       disabled it).
    
       A final tasklet_kill() during teardown ensures that no lingering
       tasklet_schedule() is still accessing the tasklet structure.
    
    Link: https://lore.kernel.org/r/94a765211c48b74a7b91c5e60b158de01db98d43.1603908167.git.bblock@linux.ibm.comReviewed-by: default avatarBenjamin Block <bblock@linux.ibm.com>
    Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: default avatarBenjamin Block <bblock@linux.ibm.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    0b524abc
zfcp_qdio.c 14.5 KB