Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ata: libata-core: fix cancellation of a port deferred qc work

cancel_work_sync() is a sleeping function so it cannot be called with
the spin lock of a port being held. Move the call to this function in
ata_port_detach() after EH completes, with the port lock released,
together with other work cancellation calls.

Fixes: 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Igor Pylypiv <ipylypiv@google.com>

+3 -5
+3 -5
drivers/ata/libata-core.c
··· 6269 6269 } 6270 6270 } 6271 6271 6272 - /* Make sure the deferred qc work finished. */ 6273 - cancel_work_sync(&ap->deferred_qc_work); 6274 - WARN_ON(ap->deferred_qc); 6275 - 6276 6272 /* Tell EH to disable all devices */ 6277 6273 ap->pflags |= ATA_PFLAG_UNLOADING; 6278 6274 ata_port_schedule_eh(ap); ··· 6279 6283 /* wait till EH commits suicide */ 6280 6284 ata_port_wait_eh(ap); 6281 6285 6282 - /* it better be dead now */ 6286 + /* It better be dead now and not have any remaining deferred qc. */ 6283 6287 WARN_ON(!(ap->pflags & ATA_PFLAG_UNLOADED)); 6288 + WARN_ON(ap->deferred_qc); 6284 6289 6290 + cancel_work_sync(&ap->deferred_qc_work); 6285 6291 cancel_delayed_work_sync(&ap->hotplug_task); 6286 6292 cancel_delayed_work_sync(&ap->scsi_rescan_task); 6287 6293