Re: SiS 5513 rev 0x015597/5598 freeze diff

2012-01-17 Thread Chris Cappuccio
Jonathan Gray [j...@goblin.cx] wrote:
 
 I've committed this now.  Unknown SiS devices could still be attached
 with udma disabled if we were sure the 5597/5598 case is only
 used in machines with 5597_HB and and another else.

Ironically, according to Logan's experience as he tried to get this working, 
the 5597/5598 code worked fine in UDMA mode on his 968, but didn't work in MW 
DMA mode. I suggested that he try to move the 5597/5598 check to sis_hostbr. 
The chip also has a pure SATA pciide mode that apparently works and AHCI.



Re: SiS 5513 rev 0x015597/5598 freeze diff

2012-01-15 Thread Jonathan Gray
On Sat, Jan 14, 2012 at 06:41:31PM +0400, Loganaden Velvindron wrote:
 Yep, Chris Cappuccio.
 
 He says that there are still issues with the SiS code. Instead
 of defaulting to SiS 5597/5598, perhaps it would have been
 better not to attach as it would have made the problem more
 obvious.

I've committed this now.  Unknown SiS devices could still be attached
with udma disabled if we were sure the 5597/5598 case is only
used in machines with 5597_HB and and another else.

For now I've opted not to do this, it seems they are out
of the chipset business.  Their webpage doesn't mention
them in the products section, so we can only hope.



Re: SiS 5513 rev 0x015597/5598 freeze diff

2012-01-14 Thread Loganaden Velvindron
On Wed, Jan 04, 2012 at 02:55:04PM +1100, Jonathan Gray wrote:
 On Mon, Jan 02, 2012 at 04:35:39PM -0500, Loganaden Velvindron wrote:
  Attaching any CDROM/DVDRIVE causes this error message
  when mouting a disk.
  
  cd0(pciide0:0:1): timeout
  type: atapi
  c_bcount : 2048
  c_skip : 0
  
  The machine then freezes and a hard reboot is necessary.
  
  This issue has been reported by 2 users in the past:
  http://archives.neohapsis.com/archives/openbsd/2005-11/0782.html
  ``
cd0(pciide0:0:0): timeout
type: atapi
c_bcount: 0
c_skip: 0
cd0(pciide0:0:0): timeout
type: atapi
c_bcount: 32
  
  A workaround was to disable pciide:
  UKC disable pciide*
  59 pciide* disabled
  UKC quit
  Continuing... 
  
  Looking closely, these problems occur with this variant of the SiS 5513
  EIDE chipset:
  pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 5597/5598: DMA, 
  chann
  el 0 wired to compatibility, channel 1 wired to compatibility
  atapiscsi0 at pciide0 channel 0 drive 1
  scsibus0 at atapiscsi0: 2 targets
  cd0 at scsibus0 targ 0 lun 0: ATAPI, CD-ROM 52X, 172A ATAPI 5/cdrom 
  removable
  cd0(pciide0:0:1): using PIO mode 4, DMA mode 2
  
  By disabling dma, the issue goes away.
  
  Looking at pciide.c shows that there are 2 variants of the 5597/5598:
  The one with rev 0xd0 which support UDMA and the previous versions
  with no support for UltraDMA. To be more precise UDMA exists but it's
  buggy.
  
  It appears that rev 0x01 has a buggy DMA support. Falling back to PIO
  works fine. The diff disables DMA silently but not enabling DMA capabilities
  on rev 0x01 of 5597/5598.
 
 Disabling DMA is quite a large hammer, it seems more likely the timings need
 to be adjusted or some config space io needs to happen.  I can't see any
 revision specific errata in the FreeBSD/Linux code.

Chris (chris@) tracked down the problem. According to:
http://svn.netlabs.org/repos/xata/ATA/tags/v1.8.11/doc/ChipList.txt
Variants below 0xd0 have a problem using UDMA.

Mine is hooked to this:
pcib0 at pci0 dev 2 function 0 SiS 968 ISA rev 0x01

What's needed is to add it to the sis_hostbr table.
pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 968: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
avail mem = 2042195968 (1947MB)
pcib0 at pci0 dev 2 function 0 SiS 968 ISA rev 0x01
pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 968: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility

(Huge thanks to Chris :-))


Here's the diff:
Index: src/sys/dev/pci/pciide.c
===
RCS file: /cvs/src/sys/dev/pci/pciide.c,v
retrieving revision 1.336
diff -u -p -r1.336 pciide.c
--- src/sys/dev/pci/pciide.c4 Jan 2012 03:38:59 -   1.336
+++ src/sys/dev/pci/pciide.c14 Jan 2012 13:50:30 -
@@ -4966,7 +4966,8 @@ static struct sis_hostbr_type {
{PCI_PRODUCT_SIS_962, 0x00, 6, 962, SIS_TYPE_133NEW},
{PCI_PRODUCT_SIS_963, 0x00, 6, 963, SIS_TYPE_133NEW},
{PCI_PRODUCT_SIS_964, 0x00, 6, 964, SIS_TYPE_133NEW},
-   {PCI_PRODUCT_SIS_965, 0x00, 6, 965, SIS_TYPE_133NEW}
+   {PCI_PRODUCT_SIS_965, 0x00, 6, 965, SIS_TYPE_133NEW},
+   {PCI_PRODUCT_SIS_968, 0x00, 6, 968, SIS_TYPE_133NEW}
 };
 
 static struct sis_hostbr_type *sis_hostbr_type_match;



Re: SiS 5513 rev 0x015597/5598 freeze diff

2012-01-14 Thread Jonathan Gray
On Sat, Jan 14, 2012 at 08:56:58AM -0500, Loganaden Velvindron wrote:
 On Wed, Jan 04, 2012 at 02:55:04PM +1100, Jonathan Gray wrote:
  On Mon, Jan 02, 2012 at 04:35:39PM -0500, Loganaden Velvindron wrote:
   Attaching any CDROM/DVDRIVE causes this error message
   when mouting a disk.
   
   cd0(pciide0:0:1): timeout
   type: atapi
   c_bcount : 2048
   c_skip : 0
   
   The machine then freezes and a hard reboot is necessary.
   
   This issue has been reported by 2 users in the past:
   http://archives.neohapsis.com/archives/openbsd/2005-11/0782.html
   ``
 cd0(pciide0:0:0): timeout
 type: atapi
 c_bcount: 0
 c_skip: 0
 cd0(pciide0:0:0): timeout
 type: atapi
 c_bcount: 32
   
   A workaround was to disable pciide:
   UKC disable pciide*
   59 pciide* disabled
   UKC quit
   Continuing... 
   
   Looking closely, these problems occur with this variant of the SiS 5513
   EIDE chipset:
   pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 5597/5598: 
   DMA, chann
   el 0 wired to compatibility, channel 1 wired to compatibility
   atapiscsi0 at pciide0 channel 0 drive 1
   scsibus0 at atapiscsi0: 2 targets
   cd0 at scsibus0 targ 0 lun 0: ATAPI, CD-ROM 52X, 172A ATAPI 5/cdrom 
   removable
   cd0(pciide0:0:1): using PIO mode 4, DMA mode 2
   
   By disabling dma, the issue goes away.
   
   Looking at pciide.c shows that there are 2 variants of the 5597/5598:
   The one with rev 0xd0 which support UDMA and the previous versions
   with no support for UltraDMA. To be more precise UDMA exists but it's
   buggy.
   
   It appears that rev 0x01 has a buggy DMA support. Falling back to PIO
   works fine. The diff disables DMA silently but not enabling DMA 
   capabilities
   on rev 0x01 of 5597/5598.
  
  Disabling DMA is quite a large hammer, it seems more likely the timings need
  to be adjusted or some config space io needs to happen.  I can't see any
  revision specific errata in the FreeBSD/Linux code.
 
 Chris (chris@) tracked down the problem. According to:
 http://svn.netlabs.org/repos/xata/ATA/tags/v1.8.11/doc/ChipList.txt
 Variants below 0xd0 have a problem using UDMA.
 
 Mine is hooked to this:
 pcib0 at pci0 dev 2 function 0 SiS 968 ISA rev 0x01
 
 What's needed is to add it to the sis_hostbr table.
 pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 968: DMA, channel 
 0 wired to compatibility, channel 1 wired to compatibility
 avail mem = 2042195968 (1947MB)
 pcib0 at pci0 dev 2 function 0 SiS 968 ISA rev 0x01
 pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 968: DMA, channel 
 0 wired to compatibility, channel 1 wired to compatibility
 
 (Huge thanks to Chris :-))

Ah yes, I'd forgotten the horrors of the sis part of pciide.  I wish they'd
stop making chipsets already.

Which Chris by the way?  Chris Cappuccio?

Anyway, I'll likely commit the diff with the addition of 966 tomorrow,
(the 967 doesn't seem to exist).

Index: pciide.c
===
RCS file: /cvs/src/sys/dev/pci/pciide.c,v
retrieving revision 1.336
diff -u -p -r1.336 pciide.c
--- pciide.c4 Jan 2012 03:38:59 -   1.336
+++ pciide.c14 Jan 2012 14:12:40 -
@@ -4966,7 +4966,9 @@ static struct sis_hostbr_type {
{PCI_PRODUCT_SIS_962, 0x00, 6, 962, SIS_TYPE_133NEW},
{PCI_PRODUCT_SIS_963, 0x00, 6, 963, SIS_TYPE_133NEW},
{PCI_PRODUCT_SIS_964, 0x00, 6, 964, SIS_TYPE_133NEW},
-   {PCI_PRODUCT_SIS_965, 0x00, 6, 965, SIS_TYPE_133NEW}
+   {PCI_PRODUCT_SIS_965, 0x00, 6, 965, SIS_TYPE_133NEW},
+   {PCI_PRODUCT_SIS_966, 0x00, 6, 966, SIS_TYPE_133NEW},
+   {PCI_PRODUCT_SIS_968, 0x00, 6, 968, SIS_TYPE_133NEW}
 };
 
 static struct sis_hostbr_type *sis_hostbr_type_match;



Re: SiS 5513 rev 0x015597/5598 freeze diff

2012-01-14 Thread Loganaden Velvindron
Yep, Chris Cappuccio.

He says that there are still issues with the SiS code. Instead
of defaulting to SiS 5597/5598, perhaps it would have been
better not to attach as it would have made the problem more
obvious.

Also, I sent a mail to a guy who works on SiS chipset support
in Linux. No reply up to now. I was looking for the datasheets.

According to the URL chris sent me, the 966 should also work,
but I can't test it.

Thanks for the upcoming commit, I'll be able to upgrade painlessly
to 5.1 :-)

On Sat, Jan 14, 2012 at 6:21 PM, Jonathan Gray j...@goblin.cx wrote:

 On Sat, Jan 14, 2012 at 08:56:58AM -0500, Loganaden Velvindron wrote:
  On Wed, Jan 04, 2012 at 02:55:04PM +1100, Jonathan Gray wrote:
   On Mon, Jan 02, 2012 at 04:35:39PM -0500, Loganaden Velvindron wrote:
Attaching any CDROM/DVDRIVE causes this error message
when mouting a disk.
   
cd0(pciide0:0:1): timeout
type: atapi
c_bcount : 2048
c_skip : 0
   
The machine then freezes and a hard reboot is necessary.
   
This issue has been reported by 2 users in the past:
http://archives.neohapsis.com/archives/openbsd/2005-11/0782.html
``
  cd0(pciide0:0:0): timeout
  type: atapi
  c_bcount: 0
  c_skip: 0
  cd0(pciide0:0:0): timeout
  type: atapi
  c_bcount: 32
   
A workaround was to disable pciide:
UKC disable pciide*
59 pciide* disabled
UKC quit
Continuing...
   
Looking closely, these problems occur with this variant of the SiS
 5513
EIDE chipset:
pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01:
 5597/5598: DMA, chann
el 0 wired to compatibility, channel 1 wired to compatibility
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: ATAPI, CD-ROM 52X, 172A ATAPI
 5/cdrom removable
cd0(pciide0:0:1): using PIO mode 4, DMA mode 2
   
By disabling dma, the issue goes away.
   
Looking at pciide.c shows that there are 2 variants of the 5597/5598:
The one with rev 0xd0 which support UDMA and the previous versions
with no support for UltraDMA. To be more precise UDMA exists but it's
buggy.
   
It appears that rev 0x01 has a buggy DMA support. Falling back to PIO
works fine. The diff disables DMA silently but not enabling DMA
 capabilities
on rev 0x01 of 5597/5598.
  
   Disabling DMA is quite a large hammer, it seems more likely the
 timings need
   to be adjusted or some config space io needs to happen.  I can't see
 any
   revision specific errata in the FreeBSD/Linux code.
 
  Chris (chris@) tracked down the problem. According to:
  http://svn.netlabs.org/repos/xata/ATA/tags/v1.8.11/doc/ChipList.txt
  Variants below 0xd0 have a problem using UDMA.
 
  Mine is hooked to this:
  pcib0 at pci0 dev 2 function 0 SiS 968 ISA rev 0x01
 
  What's needed is to add it to the sis_hostbr table.
  pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 968: DMA,
 channel 0 wired to compatibility, channel 1 wired to compatibility
  avail mem = 2042195968 (1947MB)
  pcib0 at pci0 dev 2 function 0 SiS 968 ISA rev 0x01
  pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 968: DMA,
 channel 0 wired to compatibility, channel 1 wired to compatibility
 
  (Huge thanks to Chris :-))

 Ah yes, I'd forgotten the horrors of the sis part of pciide.  I wish they'd
 stop making chipsets already.

 Which Chris by the way?  Chris Cappuccio?

 Anyway, I'll likely commit the diff with the addition of 966 tomorrow,
 (the 967 doesn't seem to exist).

 Index: pciide.c
 ===
 RCS file: /cvs/src/sys/dev/pci/pciide.c,v
 retrieving revision 1.336
 diff -u -p -r1.336 pciide.c
 --- pciide.c4 Jan 2012 03:38:59 -   1.336
 +++ pciide.c14 Jan 2012 14:12:40 -
 @@ -4966,7 +4966,9 @@ static struct sis_hostbr_type {
 {PCI_PRODUCT_SIS_962, 0x00, 6, 962, SIS_TYPE_133NEW},
{PCI_PRODUCT_SIS_963, 0x00, 6, 963, SIS_TYPE_133NEW},
{PCI_PRODUCT_SIS_964, 0x00, 6, 964, SIS_TYPE_133NEW},
 -   {PCI_PRODUCT_SIS_965, 0x00, 6, 965, SIS_TYPE_133NEW}
 +   {PCI_PRODUCT_SIS_965, 0x00, 6, 965, SIS_TYPE_133NEW},
 +   {PCI_PRODUCT_SIS_966, 0x00, 6, 966, SIS_TYPE_133NEW},
 +   {PCI_PRODUCT_SIS_968, 0x00, 6, 968, SIS_TYPE_133NEW}
  };

  static struct sis_hostbr_type *sis_hostbr_type_match;




-- 
Brightest day,
Blackest night,
No bug shall escape my sight,
And those who worship evil's mind,
be wary of my powers,
puffy lantern's light !



Re: SiS 5513 rev 0x015597/5598 freeze diff

2012-01-12 Thread Loganaden Velvindron
On Wed, Jan 04, 2012 at 02:55:04PM +1100, Jonathan Gray wrote:
 On Mon, Jan 02, 2012 at 04:35:39PM -0500, Loganaden Velvindron wrote:
  Attaching any CDROM/DVDRIVE causes this error message
  when mouting a disk.
  
  cd0(pciide0:0:1): timeout
  type: atapi
  c_bcount : 2048
  c_skip : 0
  
  The machine then freezes and a hard reboot is necessary.
  
  This issue has been reported by 2 users in the past:
  http://archives.neohapsis.com/archives/openbsd/2005-11/0782.html
  ``
cd0(pciide0:0:0): timeout
type: atapi
c_bcount: 0
c_skip: 0
cd0(pciide0:0:0): timeout
type: atapi
c_bcount: 32
  
  A workaround was to disable pciide:
  UKC disable pciide*
  59 pciide* disabled
  UKC quit
  Continuing... 
  
  Looking closely, these problems occur with this variant of the SiS 5513
  EIDE chipset:
  pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 5597/5598: DMA, 
  chann
  el 0 wired to compatibility, channel 1 wired to compatibility
  atapiscsi0 at pciide0 channel 0 drive 1
  scsibus0 at atapiscsi0: 2 targets
  cd0 at scsibus0 targ 0 lun 0: ATAPI, CD-ROM 52X, 172A ATAPI 5/cdrom 
  removable
  cd0(pciide0:0:1): using PIO mode 4, DMA mode 2
  
  By disabling dma, the issue goes away.
  
  Looking at pciide.c shows that there are 2 variants of the 5597/5598:
  The one with rev 0xd0 which support UDMA and the previous versions
  with no support for UltraDMA. To be more precise UDMA exists but it's
  buggy.
  
  It appears that rev 0x01 has a buggy DMA support. Falling back to PIO
  works fine. The diff disables DMA silently but not enabling DMA capabilities
  on rev 0x01 of 5597/5598.
 
 Disabling DMA is quite a large hammer, it seems more likely the timings need
 to be adjusted or some config space io needs to happen.  I can't see any
 revision specific errata in the FreeBSD/Linux code.

Indeed. The driver disables UDMA on drivers less than rev 0xd0.

From the commit message:
Don't enable UDMA modes for revisions of SiS 5513  0xd0
The only revisions I know which don't actually support UDMA are 0x09 and below..
But the only revision I know which does support UDMA is 0xd0 (and presumably
above that)

rev 0x01 supports UDMA and works fine up to now.


pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 5597/5598: DMA, chann
el 0 wired to compatibility, channel 1 wired to compatibility
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: ATAPI, CD-ROM 52X, 172A ATAPI 5/cdrom removable
cd0(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 ignored (disabled)

I can copy the 5.0 distribution set from the CD.

# mount /dev/cd0a /mnt/
# ls /mnt/
5.0   TRANS.TBL etc
# cp -r /mnt/5.0/ /tmp/
#

I also tested with a hard disk
pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 5597/5598: DMA, chann
el 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: Hitachi HDS721680PLAT80
wd0: 16-sector PIO, LBA48, 76319MB, 156301488 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 ignored (disabled)

I can copy /usr/src to the mounted disk:

# cp -r /usr/src/ /mnt/temp/
CVS/  sys/
# cp -r /usr/src /mnt/temp/
# ls /mnt/temp/
home src
#

Diff:
Index: src/sys/dev/pci/pciide.c
===
RCS file: /cvs/src/sys/dev/pci/pciide.c,v
retrieving revision 1.336
diff -u -p -r1.336 pciide.c
--- src/sys/dev/pci/pciide.c4 Jan 2012 03:38:59 -   1.336
+++ src/sys/dev/pci/pciide.c12 Jan 2012 15:04:57 -
@@ -5042,7 +5042,7 @@ sis_chip_map(struct pciide_softc *sc, st
printf(: %s, sis_hostbr_type_match-name);
} else {
printf(: 5597/5598);
-   if (rev = 0xd0) {
+   if (rev == 0x01 || rev = 0xd0) {
sc-sc_wdcdev.UDMA_cap = 2;
sis-sis_type = SIS_TYPE_66;
} else {



Re: SiS 5513 rev 0x015597/5598 freeze diff

2012-01-03 Thread Jonathan Gray
On Mon, Jan 02, 2012 at 04:35:39PM -0500, Loganaden Velvindron wrote:
 Attaching any CDROM/DVDRIVE causes this error message
 when mouting a disk.
 
 cd0(pciide0:0:1): timeout
 type: atapi
 c_bcount : 2048
 c_skip : 0
 
 The machine then freezes and a hard reboot is necessary.
 
 This issue has been reported by 2 users in the past:
 http://archives.neohapsis.com/archives/openbsd/2005-11/0782.html
 ``
   cd0(pciide0:0:0): timeout
   type: atapi
   c_bcount: 0
   c_skip: 0
   cd0(pciide0:0:0): timeout
   type: atapi
   c_bcount: 32
 
 A workaround was to disable pciide:
 UKC disable pciide*
 59 pciide* disabled
 UKC quit
 Continuing... 
 
 Looking closely, these problems occur with this variant of the SiS 5513
 EIDE chipset:
 pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 5597/5598: DMA, 
 chann
 el 0 wired to compatibility, channel 1 wired to compatibility
 atapiscsi0 at pciide0 channel 0 drive 1
 scsibus0 at atapiscsi0: 2 targets
 cd0 at scsibus0 targ 0 lun 0: ATAPI, CD-ROM 52X, 172A ATAPI 5/cdrom 
 removable
 cd0(pciide0:0:1): using PIO mode 4, DMA mode 2
 
 By disabling dma, the issue goes away.
 
 Looking at pciide.c shows that there are 2 variants of the 5597/5598:
 The one with rev 0xd0 which support UDMA and the previous versions
 with no support for UltraDMA. To be more precise UDMA exists but it's
 buggy.
 
 It appears that rev 0x01 has a buggy DMA support. Falling back to PIO
 works fine. The diff disables DMA silently but not enabling DMA capabilities
 on rev 0x01 of 5597/5598.

Disabling DMA is quite a large hammer, it seems more likely the timings need
to be adjusted or some config space io needs to happen.  I can't see any
revision specific errata in the FreeBSD/Linux code.



SiS 5513 rev 0x015597/5598 freeze diff

2012-01-02 Thread Loganaden Velvindron
Attaching any CDROM/DVDRIVE causes this error message
when mouting a disk.

cd0(pciide0:0:1): timeout
type: atapi
c_bcount : 2048
c_skip : 0

The machine then freezes and a hard reboot is necessary.

This issue has been reported by 2 users in the past:
http://archives.neohapsis.com/archives/openbsd/2005-11/0782.html
``
  cd0(pciide0:0:0): timeout
  type: atapi
  c_bcount: 0
  c_skip: 0
  cd0(pciide0:0:0): timeout
  type: atapi
  c_bcount: 32

A workaround was to disable pciide:
UKC disable pciide*
59 pciide* disabled
UKC quit
Continuing... 

Looking closely, these problems occur with this variant of the SiS 5513
EIDE chipset:
pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 5597/5598: DMA, chann
el 0 wired to compatibility, channel 1 wired to compatibility
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: ATAPI, CD-ROM 52X, 172A ATAPI 5/cdrom removable
cd0(pciide0:0:1): using PIO mode 4, DMA mode 2

By disabling dma, the issue goes away.

Looking at pciide.c shows that there are 2 variants of the 5597/5598:
The one with rev 0xd0 which support UDMA and the previous versions
with no support for UltraDMA. To be more precise UDMA exists but it's
buggy.

It appears that rev 0x01 has a buggy DMA support. Falling back to PIO
works fine. The diff disables DMA silently but not enabling DMA capabilities
on rev 0x01 of 5597/5598.

new dmesg:
pciide0 at pci0 dev 2 function 5 SiS 5513 EIDE rev 0x01: 5597/5598: DMA, 
channel 0 wired to compatibility, channel 1 wired to compatibility
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: ATAPI, CD-ROM 52X, 172A ATAPI 5/cdrom removable
cd0(pciide0:0:1): using PIO mode 4
pciide0: channel 1 ignored (disabled)

Diff:
Index: sys/dev/pci/pciide.c
===
RCS file: /cvs/src/sys/dev/pci/pciide.c,v
retrieving revision 1.335
diff -u -p -r1.335 pciide.c
--- sys/dev/pci/pciide.c12 Nov 2011 18:39:23 -  1.335
+++ sys/dev/pci/pciide.c2 Jan 2012 20:47:37 -
@@ -4908,13 +4908,14 @@ static struct sis_hostbr_type {
u_int8_t udma_mode;
char *name;
u_int8_t type;
-#define SIS_TYPE_NOUDMA0
-#define SIS_TYPE_661
-#define SIS_TYPE_100OLD2
-#define SIS_TYPE_100NEW 3
-#define SIS_TYPE_133OLD 4
-#define SIS_TYPE_133NEW 5
-#define SIS_TYPE_SOUTH 6
+#define SIS_TYPE_NODMA 0
+#define SIS_TYPE_NOUDMA1
+#define SIS_TYPE_662
+#define SIS_TYPE_100OLD3
+#define SIS_TYPE_100NEW 4
+#define SIS_TYPE_133OLD 5
+#define SIS_TYPE_133NEW 6
+#define SIS_TYPE_SOUTH  7
 } sis_hostbr_type[] = {
/* Most infos here are from s...@freebsd.org */
{PCI_PRODUCT_SIS_530, 0x00, 4, 530, SIS_TYPE_66},
@@ -5043,7 +5044,12 @@ sis_chip_map(struct pciide_softc *sc, st
sis-sis_type = SIS_TYPE_66;
} else {
sc-sc_wdcdev.UDMA_cap = 0;
-   sis-sis_type = SIS_TYPE_NOUDMA;
+   if (rev == 0x01) {
+   sc-sc_wdcdev.DMA_cap = 0;
+   sis-sis_type = SIS_TYPE_NODMA;
+   }
+   else
+   sis-sis_type = SIS_TYPE_NOUDMA;
}
}
 
@@ -5052,19 +5058,22 @@ sis_chip_map(struct pciide_softc *sc, st
 
sc-sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 |
WDC_CAPABILITY_MODE;
+   sc-sc_wdcdev.PIO_cap = 4;
if (sc-sc_dma_ok) {
-   sc-sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
-   sc-sc_wdcdev.irqack = pciide_irqack;
-   if (sis-sis_type = SIS_TYPE_66)
-   sc-sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
+   if (sis-sis_type  SIS_TYPE_NODMA) {
+   sc-sc_wdcdev.cap |= WDC_CAPABILITY_DMA |
+   WDC_CAPABILITY_IRQACK;
+   sc-sc_wdcdev.irqack = pciide_irqack;
+   sc-sc_wdcdev.DMA_cap = 2;
+   if (sis-sis_type = SIS_TYPE_66)
+   sc-sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
+   }
}
 
-   sc-sc_wdcdev.PIO_cap = 4;
-   sc-sc_wdcdev.DMA_cap = 2;
-
sc-sc_wdcdev.channels = sc-wdc_chanarray;
sc-sc_wdcdev.nchannels = PCIIDE_NUM_CHANNELS;
switch (sis-sis_type) {
+   case SIS_TYPE_NODMA:
case SIS_TYPE_NOUDMA:
case SIS_TYPE_66:
case SIS_TYPE_100OLD:
@@ -5264,6 +5273,7 @@ sis_setup_channel(struct channel_softc *
}
idedma_ctl |= IDEDMA_CTL_DRV_DMA(drive);
 pio:   switch (sis-sis_type) {
+   case SIS_TYPE_NODMA:
case SIS_TYPE_NOUDMA:
case SIS_TYPE_66:
case SIS_TYPE_100OLD: