From: David Milburn <dmilburn@redhat.com> Date: Thu, 18 Sep 2008 12:39:01 -0500 Subject: [ata] libata: rmmod pata_sil680 hangs Message-id: 20080918173901.GA21887@dhcp-210.hsv.redhat.com O-Subject: [RHEL5.3 PATCH] libata: rmmod pata_sil680 hangs Bugzilla: 462743 RH-Acked-by: Jeff Garzik <jgarzik@redhat.com> Dell reported they were unable to successfully unload the pata_sil680 module on a RHEL5 test kernel built with the sata update. I have been able to reproduce in house using the -115.el5 kernel. The problem is due to the RHEL5.3 sata update pulling in an upstream change in ata_port_detach which results in spinning in cancel_rearming_delayed_workqueue if there is no pending timer. This patch reverts back to the RHEL5.2 code and fixes BZ 462743, Dell confirmed this has fixed their unload problem and I have verified a patched -115.el5 kernel. Dell's testing results were reported in previous post. http://post-office.corp.redhat.com/archives/rhkernel-list/2008-September/msg00676.html Please review and ACK. Thanks, David diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c2d1cca..ca76707 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -5958,7 +5958,10 @@ static void ata_port_detach(struct ata_port *ap) spin_unlock_irqrestore(ap->lock, flags); ata_port_wait_eh(ap); - cancel_rearming_delayed_work(&ap->hotplug_task); + + flush_workqueue(ata_aux_wq); + if (!cancel_delayed_work(&ap->hotplug_task)) + flush_workqueue(ata_aux_wq); skip_eh: /* remove the associated SCSI host */