Skip to contentSkip to conversation

2.6.5 - panic when intensive disk access on 120GB firewire disk

DISCUSSION Robert Gadsdon 2 participants 3 messages Apr 4, 2004 – Apr 5, 2004

lore
Share & tools
lore
#0 lore raw
Kernel panic from 2.6.5 'final' when running slocate (updatedb) accessing 120GB firewire disk:

Oops: 00002 [#1]
PREEMPT SMP
CPU: 0

EIP: 0060:[<f8a10a27>] Not tainted
EFLAGS: 00010047 (2.6.5)
EIP is at hpsb_packet_sent+0x27/0x90 [ieee1394]
eax: 00100100 ebx: f76e0000 ecx: e1fea3c0 edx: 00200200
esi: 00000001 edi: e1fea3c0 ebp: f76e2078 esp: c042df14 ds : 007b es: 007b ss : 0068
Process swapper (pid: 0, threadinfo=c042c000 task=c03aa160)

Stack: f76e21bc f89329e8 f76e0000 e1fea3c0 00000001 f75f8da0 f76e21e8 00000292
       f76e21fc 00000000 c042c000 c045b5d8 c0127d93 f76e21bc 00000001 
c042b028
       0000000a 00000046 c0127ac7 c042b028 c042c000 c042c000 00000009 
00000020
Call Trace :
 [<f89329e8>] dma_trm_tasklet+0xa8/0x1b0 [ohci1394]
 [<c0127d93>] tasklet_action+0x73/0xe0
 [<c0127ac7>] do_softirq+0xc7/0xd0
 [<c010b82b>] do_IRQ+0x13b/0x1a0
 [<c0109928>] common_interrupt+0x18/0x20
 [<c0106970>] default_idle+0x0/0x40
 [<c010699c>] default_idle+0x2c/0x40
 [<c0106a2b>] cpu_idle+0x3b/0x50
 [<c042e4c0>] unknown_bootoption +0x0/0x120
 [<c042e95b>] start_kernel+0x1bb/0x210
 [<c042e4c0>] unknown_bootoption+0x0/0x120

Code: 89 50 04 89 02 c7 41 04 00 02 20 00 c7 01 00 01 10 00 c6 41
 <0>Kernel panic: Fatal exception in interrupt

In interrupt handler - not syncing

Similar problem with 2.6.4 and 2.6.5-rc and 2.6.5-rc-mm kernels, and is 100% repeatable..

Robert Gadsdon

#1 lore raw
Quoted 9 lines · Robert Gadsdon
Kernel panic from 2.6.5 'final' when running slocate (updatedb) 

accessing 120GB firewire disk:

Oops: 00002 [#1]
PREEMPT SMP
CPU: 0

EIP: 0060:[<f8a10a27>] Not tainted
EFLAGS: 00010047 (2.6.5)
EIP is at hpsb_packet_sent+0x27/0x90 [ieee1394]

Could you please try the patch below.

Thank you.

Signature · 90 lines
Dmitry


===================================================================


[email protected], 2004-04-04 23:52:29-05:00, [email protected]
  IEEE1394: Make sure that a packet submitted into completion
            queue just once; race between hpsb_packet_sent and
            hpsb_packet_received


 ieee1394_core.c |   26 ++++++++++++++++++++++----
 ieee1394_core.h |    1 +
 2 files changed, 23 insertions(+), 4 deletions(-)


===================================================================



diff -Nru a/drivers/ieee1394/ieee1394_core.c b/drivers/ieee1394/ieee1394_core.c
--- a/drivers/ieee1394/ieee1394_core.c	Sun Apr  4 23:53:45 2004
+++ b/drivers/ieee1394/ieee1394_core.c	Sun Apr  4 23:53:45 2004
@@ -96,7 +96,7 @@
 	WARN_ON(packet->complete_routine != NULL);
 	packet->complete_routine = routine;
 	packet->complete_data = data;
-	return;
+	atomic_set(&packet->completion_armed, 1);
 }
 
 /**
@@ -412,8 +412,26 @@
 	}
 
 	if (ackcode != ACK_PENDING || !packet->expect_response) {
+		struct hpsb_packet *p;
+		struct list_head *lh;
+		unsigned long flags;
+
 		atomic_dec(&packet->refcnt);
-		list_del(&packet->list);
+
+		/*
+		 * Remove packet from host's pending queue
+		 * (and not from any other queue)
+		 */
+		spin_lock_irqsave(&host->pending_pkt_lock, flags);
+	        list_for_each(lh, &host->pending_packets) {
+                	p = list_entry(lh, struct hpsb_packet, list);
+                	if (p == packet) {
+				list_del(&packet->list);
+				break;
+                	}
+        	}
+		spin_unlock_irqrestore(&host->pending_pkt_lock, flags);
+
 		packet->state = hpsb_complete;
 		queue_packet_complete(packet);
 		return;
@@ -1003,7 +1021,8 @@
 
 static void queue_packet_complete(struct hpsb_packet *packet)
 {
-	if (packet->complete_routine != NULL) {
+	if (packet->complete_routine != NULL &&
+	    atomic_dec_and_test(&packet->completion_armed)) {
 		unsigned long flags;
 
 		spin_lock_irqsave(&khpsbpkt_lock, flags);
@@ -1013,7 +1032,6 @@
 		/* Signal the kernel thread to handle this */
 		up(&khpsbpkt_sig);
 	}
-	return;
 }
 
 static int hpsbpkt_thread(void *__hi)
diff -Nru a/drivers/ieee1394/ieee1394_core.h b/drivers/ieee1394/ieee1394_core.h
--- a/drivers/ieee1394/ieee1394_core.h	Sun Apr  4 23:53:45 2004
+++ b/drivers/ieee1394/ieee1394_core.h	Sun Apr  4 23:53:45 2004
@@ -66,6 +66,7 @@
 	 * packet is completed.  */
 	void (*complete_routine)(void *);
 	void *complete_data;
+	atomic_t completion_armed;
 
         /* Store jiffies for implementing bus timeouts. */
         unsigned long sendtime;
#2 lore raw

This fixes the problem on my system. All I get is a couple of 'ieee1394: unsolicited response packet received - no tlabel match' messages on the console.

Many thanks.

Robert Gadsdon.

Quoted 15 lines · Dmitry Torokhov
Quoted 8 lines · Robert Gadsdon
Kernel panic from 2.6.5 'final' when running slocate (updatedb) accessing 120GB firewire disk:

Oops: 00002 [#1]
PREEMPT SMP
CPU: 0

EIP: 0060:[<f8a10a27>] Not tainted
EFLAGS: 00010047 (2.6.5)
EIP is at hpsb_packet_sent+0x27/0x90 [ieee1394]

Could you please try the patch below.

Thank you.