public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* zalon/ncr53c720 crashes K460  (parisc port) on bootup.
@ 2003-09-27  3:43 Ryan Bradetich
  2003-09-27  7:48 ` [parisc-linux] " Matthew Wilcox
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ryan Bradetich @ 2003-09-27  3:43 UTC (permalink / raw)
  To: linux-scsi; +Cc: parisc-linux

Hello all,

The zalon/ncr53c720 combination is fatal during booting on my K460
parisc box.  I believe the scsi termination is correct since I performed
a fresh debian install on the scsi disks and I can boot from then every
time I use a 2.4 kernel :)  This problem appeared with with the latest
cvs kernel from parisc-linux.org.

This system does boot and function when I do not compile zalon support
into the kernel and use a nfsroot.

I can provide addtional information and test patches (or give access to
this system) if requested.

Any thoughts or feedback appreciated!  

Thanks,

- Ryan

P.S. please copy me on any replies as i am not subscribed to the
linux-scsi list.


Here is the relevant (I hope) information I copied from the bootup

Linux version 2.6.0-test5-pa20 (rbrad@beavis) (gcc version 3.0.3) #34
Fri Sep 26 21:09:34 MDT 2003


zalon_probe: Zalon vers field is 0x1, IRQ 36
ncr53c720-0: rev 0xf on bus 0 device 0 function 0 irq 36
ncr53c720-0: ID 7, Fast-10, Parity Checking, Differential
ncr53c720-0: suspicious SCSI data while resetting the BUS.
ncr53c720-0: dp1,d15-8,dp0,d7-0,rst,req,ack,bsy,sel,atn,msg,c/d,i/o =
0x3fdff00, expecting 0x100
ncr53c720-0: FATAL ERROR: CHECK SCSI BUS - CABLES, TERMINATION, DEVICE
POWER etc.!
ncr53c720-0: detaching...

 
Kernel addresses on the stack:
 [<101227bc>] copy_process+0x714/0xa4c
 [<10104144>] parisc_terminate+0x60/0xb0
 [<1010c264>] pdc_iodc_putc+0x88/0x11c
 [<101043e0>] handle_interruption+0x24c/0x598
 [<1010c264>] pdc_iodc_putc+0x88/0x11c
 [<10140b40>] do_drain+0x1c/0x2c
 [<101404c4>] slab_destroy+0x15c/0x208
 [<10109088>] intr_check_sig+0x0/0xc
 [<10140c0c>] __cache_shrink+0x70/0xc4
 [<10220640>] ncr_detach+0x0/0x364
 [<101238f0>] call_console_drivers+0xac/0x170
 [<1015747c>] dentry_open+0x78/0x1b0
 [<10123cc8>] release_console_sem+0x64/0x11c
 [<101573e4>] filp_open+0x4c/0x6c
 [<10348518>] start_kernel+0x4/0x1b8
 [<101e0780>] gsc_alloc_irq+0x38/0x68
 [<10358dec>] zalon_probe+0x1b0/0x230
 [<1018c548>] sysfs_create+0x94/0xe4
 [<1018cf6c>] create_dir+0x80/0xe0
 [<1010cc44>] parisc_driver_probe+0x30/0x60
 [<101fa208>] bus_match+0x4c/0x80
 [<101fa384>] driver_attach+0x88/0xbc
 [<101fa604>] bus_add_driver+0x98/0xa4
 [<1035888c>] tulip_init+0x40/0x74
 [<10348744>] do_initcalls+0x64/0xe0
 [<1010019c>] init+0x28/0x144
 [<10108c5c>] ret_from_kernel_thread+0x1c/0x24

Kernel Fault: Code=26 regs=effb8380 (Addr=00000194)
 
     YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00000000000011101111111100001111 Not tainted
r00-03  00000000 1030a810 10224b2c efffb6e0
r04-07  00000000 efffb688 00000024 10318010
r08-11  efffb600 ffffffed 102f3810 10348518
r12-15  000000f2 000000fa 00000003 f0000d2c
r16-19  f0001790 f0000124 f000011c 00000021
r20-23  10315a40 00000021 0000000f 00100100
r24-27  000002c7 103d9380 00000000 102ea010
r28-31  00000000 0000000b effb8380 101415e8
sr0-3   00000000 00000000 00000000 00000000
sr4-7   00000000 00000000 00000000 00000000
 
IASQ: 00000000 00000000 IAOQ: 10224b28 10220640
 IIR: 4b5a0328    ISR: 00000000  IOR: 00000194
 CPU:        0   CR30: effb8000 CR31: 1033e000
 ORIG_R28: 102f3810
 IAOQ[0]: ncr53c8xx_release+0xc/0x20
 IAOQ[1]: ncr_detach+0x0/0x364
 RP(r2): ncr53c8xx_release+0x10/0x20



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [parisc-linux] zalon/ncr53c720 crashes K460  (parisc port) on bootup.
  2003-09-27  3:43 zalon/ncr53c720 crashes K460 (parisc port) on bootup Ryan Bradetich
@ 2003-09-27  7:48 ` Matthew Wilcox
  2003-09-27 13:45 ` James Bottomley
  2003-09-27 15:45 ` James Bottomley
  2 siblings, 0 replies; 9+ messages in thread
From: Matthew Wilcox @ 2003-09-27  7:48 UTC (permalink / raw)
  To: Ryan Bradetich; +Cc: linux-scsi, parisc-linux

On Fri, Sep 26, 2003 at 09:43:08PM -0600, Ryan Bradetich wrote:
> ncr53c720-0: ID 7, Fast-10, Parity Checking, Differential
> ncr53c720-0: suspicious SCSI data while resetting the BUS.
> ncr53c720-0: dp1,d15-8,dp0,d7-0,rst,req,ack,bsy,sel,atn,msg,c/d,i/o =
> 0x3fdff00, expecting 0x100

3fdff00 is
rst set
d7-d0 set
dp0 clear
d8-d15 set
dp1 clear

SCSI is even parity, right?  So we're seeing all 1s on the bus when
we're expecting all 0s, but there's no parity problem.

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zalon/ncr53c720 crashes K460  (parisc port) on bootup.
  2003-09-27  3:43 zalon/ncr53c720 crashes K460 (parisc port) on bootup Ryan Bradetich
  2003-09-27  7:48 ` [parisc-linux] " Matthew Wilcox
@ 2003-09-27 13:45 ` James Bottomley
  2003-09-27 15:45 ` James Bottomley
  2 siblings, 0 replies; 9+ messages in thread
From: James Bottomley @ 2003-09-27 13:45 UTC (permalink / raw)
  To: Ryan Bradetich; +Cc: SCSI Mailing List, PARISC list

On Fri, 2003-09-26 at 22:43, Ryan Bradetich wrote:
> The zalon/ncr53c720 combination is fatal during booting on my K460
> parisc box.  I believe the scsi termination is correct since I performed
> a fresh debian install on the scsi disks and I can boot from then every
> time I use a 2.4 kernel :)  This problem appeared with with the latest
> cvs kernel from parisc-linux.org.
> 
> This system does boot and function when I do not compile zalon support
> into the kernel and use a nfsroot.
> 
> I can provide addtional information and test patches (or give access to
> this system) if requested.
> 
> Any thoughts or feedback appreciated!  

I'm not familiar with how the K class is wired.  However, the ncr53c8xx
driver that underlies the zalon720 is extremely ratty.  On my C360, I
can precipitate exactly this panic just by inserting the zalon7xx module
with an unterminated bluefish card.

Although we really need to track this down and fix it (which I'll look
into doing), all it would do would be to detach the driver correctly at
that point (so you still wouldn't see any devices).  Could you look at
your SCSI setup to see if the driver has a point (i.e. is there a
termination or cabling problem)?

James



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zalon/ncr53c720 crashes K460  (parisc port) on bootup.
  2003-09-27  3:43 zalon/ncr53c720 crashes K460 (parisc port) on bootup Ryan Bradetich
  2003-09-27  7:48 ` [parisc-linux] " Matthew Wilcox
  2003-09-27 13:45 ` James Bottomley
@ 2003-09-27 15:45 ` James Bottomley
  2003-09-27 17:23   ` Matthew Wilcox
  2003-09-27 18:37   ` Matthew Wilcox
  2 siblings, 2 replies; 9+ messages in thread
From: James Bottomley @ 2003-09-27 15:45 UTC (permalink / raw)
  To: Ryan Bradetich; +Cc: SCSI Mailing List, PARISC list

On Fri, 2003-09-26 at 22:43, Ryan Bradetich wrote:
> The zalon/ncr53c720 combination is fatal during booting on my K460
> parisc box.  I believe the scsi termination is correct since I performed
> a fresh debian install on the scsi disks and I can boot from then every
> time I use a 2.4 kernel :)  This problem appeared with with the latest
> cvs kernel from parisc-linux.org.
> 
> This system does boot and function when I do not compile zalon support
> into the kernel and use a nfsroot.
> 
> I can provide addtional information and test patches (or give access to
> this system) if requested.
> 
> Any thoughts or feedback appreciated!  

This should fix the panic, but it simply detaches correctly.

James

===== drivers/scsi/ncr53c8xx.c 1.37 vs edited =====
--- 1.37/drivers/scsi/ncr53c8xx.c	Thu Sep 25 20:08:49 2003
+++ edited/drivers/scsi/ncr53c8xx.c	Sat Sep 27 09:44:21 2003
@@ -8585,12 +8585,17 @@
 
 int ncr53c8xx_release(struct Scsi_Host *host)
 {
+	ncb_p np;
+	struct host_data *host_data;
+
 #ifdef DEBUG_NCR53C8XX
-printk("ncr53c8xx : release\n");
+	printk("ncr53c8xx : release\n");
 #endif
-     ncr_detach(((struct host_data *) host->hostdata)->ncb);
+	if((host_data = (struct host_data *)host->hostdata) &&
+	   host_data->ncb)
+		ncr_detach(host_data->ncb);
 
-     return 1;
+	return 1;
 }
 

===== drivers/scsi/zalon.c 1.11 vs edited =====
--- 1.11/drivers/scsi/zalon.c	Thu Sep 25 20:08:51 2003
+++ edited/drivers/scsi/zalon.c	Sat Sep 27 10:31:52 2003
@@ -146,7 +146,7 @@
 
 	host = ncr_attach(&zalon7xx_template, unit, &device);
 	if (!host)
-		goto fail;
+		goto out;
 
 	if (request_irq(irq, ncr53c8xx_intr, SA_SHIRQ, dev->dev.bus_id, host)) {
 		printk(KERN_ERR "%s: irq problem with %d, detaching\n ",
@@ -169,6 +169,7 @@
 	free_irq(irq, host);
  fail:
 	ncr53c8xx_release(host);
+ out:
 	return error;
 }
 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zalon/ncr53c720 crashes K460  (parisc port) on bootup.
  2003-09-27 15:45 ` James Bottomley
@ 2003-09-27 17:23   ` Matthew Wilcox
  2003-09-27 18:37   ` Matthew Wilcox
  1 sibling, 0 replies; 9+ messages in thread
From: Matthew Wilcox @ 2003-09-27 17:23 UTC (permalink / raw)
  To: James Bottomley; +Cc: Ryan Bradetich, SCSI Mailing List, PARISC list

On Sat, Sep 27, 2003 at 10:45:50AM -0500, James Bottomley wrote:
> This should fix the panic, but it simply detaches correctly.

Necessary, but not sufficient, I think ... look at ncr_attach().
It doesn't zero hostdata->ncb.  Adding that is easy enough ... I'm about
to commit a patch to the parisc tree containing this fix.

> ===== drivers/scsi/ncr53c8xx.c 1.37 vs edited =====
> --- 1.37/drivers/scsi/ncr53c8xx.c	Thu Sep 25 20:08:49 2003
> +++ edited/drivers/scsi/ncr53c8xx.c	Sat Sep 27 09:44:21 2003
> @@ -8585,12 +8585,17 @@
>  
>  int ncr53c8xx_release(struct Scsi_Host *host)
>  {
> +	ncb_p np;
> +	struct host_data *host_data;
> +
>  #ifdef DEBUG_NCR53C8XX
> -printk("ncr53c8xx : release\n");
> +	printk("ncr53c8xx : release\n");
>  #endif
> -     ncr_detach(((struct host_data *) host->hostdata)->ncb);
> +	if((host_data = (struct host_data *)host->hostdata) &&
> +	   host_data->ncb)
> +		ncr_detach(host_data->ncb);
>  
> -     return 1;
> +	return 1;
>  }
>  
> 
> ===== drivers/scsi/zalon.c 1.11 vs edited =====
> --- 1.11/drivers/scsi/zalon.c	Thu Sep 25 20:08:51 2003
> +++ edited/drivers/scsi/zalon.c	Sat Sep 27 10:31:52 2003
> @@ -146,7 +146,7 @@
>  
>  	host = ncr_attach(&zalon7xx_template, unit, &device);
>  	if (!host)
> -		goto fail;
> +		goto out;
>  
>  	if (request_irq(irq, ncr53c8xx_intr, SA_SHIRQ, dev->dev.bus_id, host)) {
>  		printk(KERN_ERR "%s: irq problem with %d, detaching\n ",
> @@ -169,6 +169,7 @@
>  	free_irq(irq, host);
>   fail:
>  	ncr53c8xx_release(host);
> + out:
>  	return error;
>  }

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zalon/ncr53c720 crashes K460  (parisc port) on bootup.
  2003-09-27 15:45 ` James Bottomley
  2003-09-27 17:23   ` Matthew Wilcox
@ 2003-09-27 18:37   ` Matthew Wilcox
  2003-09-27 18:43     ` Christoph Hellwig
  2003-09-27 18:58     ` James Bottomley
  1 sibling, 2 replies; 9+ messages in thread
From: Matthew Wilcox @ 2003-09-27 18:37 UTC (permalink / raw)
  To: James Bottomley; +Cc: Ryan Bradetich, SCSI Mailing List, PARISC list

On Sat, Sep 27, 2003 at 10:45:50AM -0500, James Bottomley wrote:
> This should fix the panic, but it simply detaches correctly.

We both missed it.  This is why it's panicing:

        host = ncr_attach(&zalon7xx_template, unit, &device);
        if (!host)
                goto fail;
 fail:
        ncr53c8xx_release(host);
        return error;

ie we're calling ncr53c8xx_release(NULL) so both your & my patch fail
to fix the problem.  This looks best to me:

+++ drivers/scsi/ncr53c8xx.c    27 Sep 2003 18:31:13 -0000
@@ -8855,11 +8855,14 @@ struct Scsi_Host * __init ncr_attach(str
 
 int ncr53c8xx_release(struct Scsi_Host *host)
 {
-       struct host_data *host_data = (struct host_data *)host->hostdata;
+       struct host_data *host_data;
 #ifdef DEBUG_NCR53C8XX
        printk("ncr53c8xx: release\n");
 #endif
-       if (host_data->ncb)
+       if (!host)
+               return 1;
+       host_data = (struct host_data *)host->hostdata;
+       if (host_data && host_data->ncb)
                ncr_detach(host_data->ncb);
        return 1;
 }

and it does fix the problem.  Maybe it's too much checking, but I'm not
interested in tracking down bugs like this again ;-)

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zalon/ncr53c720 crashes K460  (parisc port) on bootup.
  2003-09-27 18:37   ` Matthew Wilcox
@ 2003-09-27 18:43     ` Christoph Hellwig
  2003-09-27 18:58     ` James Bottomley
  1 sibling, 0 replies; 9+ messages in thread
From: Christoph Hellwig @ 2003-09-27 18:43 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: James Bottomley, Ryan Bradetich, SCSI Mailing List, PARISC list

On Sat, Sep 27, 2003 at 07:37:56PM +0100, Matthew Wilcox wrote:
> -       struct host_data *host_data = (struct host_data *)host->hostdata;
> +       struct host_data *host_data;
>  #ifdef DEBUG_NCR53C8XX
>         printk("ncr53c8xx: release\n");
>  #endif
> -       if (host_data->ncb)
> +       if (!host)
> +               return 1;
> +       host_data = (struct host_data *)host->hostdata;
> +       if (host_data && host_data->ncb)
>                 ncr_detach(host_data->ncb);
>         return 1;
>  }
> 
> and it does fix the problem.  Maybe it's too much checking, but I'm not
> interested in tracking down bugs like this again ;-)

Or better just stop calling ncr53c8xx_release if ncr_attach failed..


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zalon/ncr53c720 crashes K460  (parisc port) on bootup.
  2003-09-27 18:37   ` Matthew Wilcox
  2003-09-27 18:43     ` Christoph Hellwig
@ 2003-09-27 18:58     ` James Bottomley
  2003-09-27 20:06       ` Matthew Wilcox
  1 sibling, 1 reply; 9+ messages in thread
From: James Bottomley @ 2003-09-27 18:58 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Ryan Bradetich, SCSI Mailing List, PARISC list

On Sat, 2003-09-27 at 13:37, Matthew Wilcox wrote:
> On Sat, Sep 27, 2003 at 10:45:50AM -0500, James Bottomley wrote:
> > This should fix the panic, but it simply detaches correctly.
> 
> We both missed it.  This is why it's panicing:
> 
>         host = ncr_attach(&zalon7xx_template, unit, &device);
>         if (!host)
>                 goto fail;
>  fail:
>         ncr53c8xx_release(host);
>         return error;
> 
> ie we're calling ncr53c8xx_release(NULL) so both your & my patch fail
> to fix the problem.  This looks best to me:

No, I fixed that...that was changed to goto out; in my patch, and out
was just before the return (i.e. no longer do the release).

James



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: zalon/ncr53c720 crashes K460  (parisc port) on bootup.
  2003-09-27 18:58     ` James Bottomley
@ 2003-09-27 20:06       ` Matthew Wilcox
  0 siblings, 0 replies; 9+ messages in thread
From: Matthew Wilcox @ 2003-09-27 20:06 UTC (permalink / raw)
  To: James Bottomley
  Cc: Matthew Wilcox, Ryan Bradetich, SCSI Mailing List, PARISC list

On Sat, Sep 27, 2003 at 01:58:06PM -0500, James Bottomley wrote:
> No, I fixed that...that was changed to goto out; in my patch, and out
> was just before the return (i.e. no longer do the release).

Oops, I didn't scroll all the way down.  Anyway, we have a tradition
of allowing, eg, kfree(NULL) to succeed, so it's a little more robust.

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-09-27 20:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-27  3:43 zalon/ncr53c720 crashes K460 (parisc port) on bootup Ryan Bradetich
2003-09-27  7:48 ` [parisc-linux] " Matthew Wilcox
2003-09-27 13:45 ` James Bottomley
2003-09-27 15:45 ` James Bottomley
2003-09-27 17:23   ` Matthew Wilcox
2003-09-27 18:37   ` Matthew Wilcox
2003-09-27 18:43     ` Christoph Hellwig
2003-09-27 18:58     ` James Bottomley
2003-09-27 20:06       ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox