* [PATCH] firewire: time out in fw_core_remove_card
@ 2008-09-14 8:35 Stefan Richter
2008-09-14 9:22 ` Stefan Richter
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Richter @ 2008-09-14 8:35 UTC (permalink / raw)
To: linux1394-devel; +Cc: linux-kernel
This allows "modprobe -r firewire-ohci" (or card unbinding in general)
to proceed after 40 seconds even if there is a reference counting bug or
other shutdown bug in upper layers.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
drivers/firewire/fw-card.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: linux/drivers/firewire/fw-card.c
===================================================================
--- linux.orig/drivers/firewire/fw-card.c
+++ linux/drivers/firewire/fw-card.c
@@ -16,6 +16,7 @@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <linux/bug.h>
#include <linux/completion.h>
#include <linux/crc-itu-t.h>
#include <linux/delay.h>
@@ -508,7 +509,8 @@ fw_core_remove_card(struct fw_card *card
/* Wait for all users, especially device workqueue jobs, to finish. */
fw_card_put(card);
- wait_for_completion(&card->done);
+ WARN(wait_for_completion_timeout(&card->done, 40 * HZ) == 0,
+ KBUILD_MODNAME ": forced card shutdown with references held\n");
cancel_delayed_work_sync(&card->work);
WARN_ON(!list_empty(&card->transaction_list));
--
Stefan Richter
-=====-==--- =--= -===-
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-14 9:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-14 8:35 [PATCH] firewire: time out in fw_core_remove_card Stefan Richter
2008-09-14 9:22 ` Stefan Richter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®