linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] sata_via broken by recent libata updates
@ 2004-03-24 16:33 Sergey Vlasov
  2004-03-24 18:08 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Vlasov @ 2004-03-24 16:33 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2107 bytes --]

Hello!

After updating from 2.4.25-libata1 to 2.4.25-libata9 the sata_via
driver stopped working.  The module loads and even seems to detect
the presense of drives, but the SCSI-emulation devices are not
registered:

===== messages hand-copied from screen =====
sata_via (00:0f.0) routed to hard irq line 11
ata1: SATA max UDMA/133 cmd 0xB800 ctl 0xBC02 bmdma 0xC800 irq 20
ata2: SATA max UDMA/133 cmd 0xC000 ctl 0xC402 bmdma 0xC808 irq 20
ata1: dev 0 ATA, max UDMA7, 234493056 sectors (lba48)
ata2: no device found (phy stat 00000000)
===== end of messages from sata_via =====

The machine does not hang - booting fails later, because the root
device is not accessible.

2.4.25-libata1 worked fine on the same hardware:

===== log from a successful boot ======
libata version 1.00 loaded.
sata_via version 0.11
ata1: SATA max UDMA/133 cmd 0xB800 ctl 0xBC02 bmdma 0xC800 irq 20
ata2: SATA max UDMA/133 cmd 0xC000 ctl 0xC402 bmdma 0xC808 irq 20
ata1: dev 0 cfg 49:2f00 82:346b 83:7f01 84:4003 85:3c68 86:3c01 87:4003 88:80ff
ata1: dev 0 ATA, max UDMA7, 234493056 sectors (lba48)
ata1: dev 0 configured for UDMA/133
ATA: abnormal status 0x7F on port 0xC007
ata2: thread exiting
scsi0 : sata_via
scsi1 : sata_via
  Vendor: ATA       Model: SAMSUNG SP1213C    Rev: 1.00
  Type:   Direct-Access     ANSI SCSI revision: 05
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 234493056 512-byte hdwr sectors (120060 MB)
===== end =====

Seems that the problem is caused by changes in the device
initialization - calling ata_device_add() from svia_init_one() does
not work (at least with the 2.4.x SCSI layer).  The following patch
solves the initialization problem:

--- kernel-source-2.4.25/drivers/scsi/sata_via.c.sata_via-init-fix	2004-03-22 14:03:31 +0300
+++ kernel-source-2.4.25/drivers/scsi/sata_via.c	2004-03-24 16:27:50 +0300
@@ -264,9 +264,7 @@ static int svia_init_one (struct pci_dev
 
 	pci_set_master(pdev);
 
-	/* FIXME: check ata_device_add return value */
-	ata_device_add(probe_ent);
-	kfree(probe_ent);
+	ata_add_to_probe_list(probe_ent);
 
 	return 0;
 

-- 
Sergey Vlasov

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [BUG] sata_via broken by recent libata updates
  2004-03-24 16:33 [BUG] sata_via broken by recent libata updates Sergey Vlasov
@ 2004-03-24 18:08 ` Jeff Garzik
  2004-03-24 21:19   ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2004-03-24 18:08 UTC (permalink / raw)
  To: Sergey Vlasov; +Cc: linux-ide, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

Sergey Vlasov wrote:
> Hello!
> 
> After updating from 2.4.25-libata1 to 2.4.25-libata9 the sata_via
> driver stopped working.  The module loads and even seems to detect
> the presense of drives, but the SCSI-emulation devices are not
> registered:
[...]
> Seems that the problem is caused by changes in the device
> initialization - calling ata_device_add() from svia_init_one() does
> not work (at least with the 2.4.x SCSI layer).  The following patch
> solves the initialization problem:
> 
> --- kernel-source-2.4.25/drivers/scsi/sata_via.c.sata_via-init-fix	2004-03-22 14:03:31 +0300
> +++ kernel-source-2.4.25/drivers/scsi/sata_via.c	2004-03-24 16:27:50 +0300
> @@ -264,9 +264,7 @@ static int svia_init_one (struct pci_dev
>  
>  	pci_set_master(pdev);
>  
> -	/* FIXME: check ata_device_add return value */
> -	ata_device_add(probe_ent);
> -	kfree(probe_ent);
> +	ata_add_to_probe_list(probe_ent);
>  
>  	return 0;

Ah, indeed.  A bug in the 2.4 backport.  Seems to be present in sata_sis 
too.

Thanks for spotting, I just checked in the attached patch.

	Jeff



[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1464 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/03/24 13:07:52-05:00 jgarzik@redhat.com 
#   [libata] Fix probing bug in VIA, SiS drivers
#   
#   Some 2.6 code leaked into the 2.4 backport.
#   
#   Spotted by Sergey Vlasov.
# 
# drivers/scsi/sata_via.c
#   2004/03/24 13:07:50-05:00 jgarzik@redhat.com +1 -3
#   [libata] Fix probing bug in VIA, SiS drivers
#   
#   Some 2.6 code leaked into the 2.4 backport.
#   
#   Spotted by Sergey Vlasov.
# 
# drivers/scsi/sata_sis.c
#   2004/03/24 13:07:50-05:00 jgarzik@redhat.com +1 -3
#   [libata] Fix probing bug in VIA, SiS drivers
#   
#   Some 2.6 code leaked into the 2.4 backport.
#   
#   Spotted by Sergey Vlasov.
# 
diff -Nru a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c
--- a/drivers/scsi/sata_sis.c	Wed Mar 24 13:08:01 2004
+++ b/drivers/scsi/sata_sis.c	Wed Mar 24 13:08:01 2004
@@ -182,9 +182,7 @@
 	pci_set_master(pdev);
 	pci_enable_intx(pdev);
 
-	/* FIXME: check ata_device_add return value */
-	ata_device_add(probe_ent);
-	kfree(probe_ent);
+	ata_add_to_probe_list(probe_ent);
 
 	return 0;
 
diff -Nru a/drivers/scsi/sata_via.c b/drivers/scsi/sata_via.c
--- a/drivers/scsi/sata_via.c	Wed Mar 24 13:08:01 2004
+++ b/drivers/scsi/sata_via.c	Wed Mar 24 13:08:01 2004
@@ -264,9 +264,7 @@
 
 	pci_set_master(pdev);
 
-	/* FIXME: check ata_device_add return value */
-	ata_device_add(probe_ent);
-	kfree(probe_ent);
+	ata_add_to_probe_list(probe_ent);
 
 	return 0;
 

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

* Re: [BUG] sata_via broken by recent libata updates
  2004-03-24 18:08 ` Jeff Garzik
@ 2004-03-24 21:19   ` Jeff Garzik
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2004-03-24 21:19 UTC (permalink / raw)
  To: Sergey Vlasov; +Cc: linux-ide, linux-kernel

Jeff Garzik wrote:
> Sergey Vlasov wrote:
> 
>> Hello!
>>
>> After updating from 2.4.25-libata1 to 2.4.25-libata9 the sata_via
>> driver stopped working.  The module loads and even seems to detect
>> the presense of drives, but the SCSI-emulation devices are not
>> registered:
> 
> [...]
> 
>> Seems that the problem is caused by changes in the device
>> initialization - calling ata_device_add() from svia_init_one() does
>> not work (at least with the 2.4.x SCSI layer).  The following patch
>> solves the initialization problem:
>>
>> --- kernel-source-2.4.25/drivers/scsi/sata_via.c.sata_via-init-fix    
>> 2004-03-22 14:03:31 +0300
>> +++ kernel-source-2.4.25/drivers/scsi/sata_via.c    2004-03-24 
>> 16:27:50 +0300
>> @@ -264,9 +264,7 @@ static int svia_init_one (struct pci_dev
>>  
>>      pci_set_master(pdev);
>>  
>> -    /* FIXME: check ata_device_add return value */
>> -    ata_device_add(probe_ent);
>> -    kfree(probe_ent);
>> +    ata_add_to_probe_list(probe_ent);
>>  
>>      return 0;
> 
> 
> Ah, indeed.  A bug in the 2.4 backport.  Seems to be present in sata_sis 
> too.
> 
> Thanks for spotting, I just checked in the attached patch.


FYI, this fix is in the 2.4.x patch just posted,

http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/2.4.25-libata12.patch.bz2



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

end of thread, other threads:[~2004-03-24 21:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-24 16:33 [BUG] sata_via broken by recent libata updates Sergey Vlasov
2004-03-24 18:08 ` Jeff Garzik
2004-03-24 21:19   ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).