Subject: Re: how to debug an IDE driver
To: Klaus Heinz <k.heinz.nov.vier@onlinehome.de>
From: Jorgen Lundman <lundman@lundman.net>
List: tech-kern
Date: 11/29/2004 11:19:45
This most likely will have absolutely nothing to do with your problem, but the 
error messages are quite similar to those seen on a problem I had with a SATA 
device. It turned out in the end that the device defaulted to using INTx 
emulation, and by asking it to disable it made it work... it would but take you 
a minute to rule it out at least...

The patch we hacked in for it is attached, will not work "as is" at all, but 
could be adapted to yours.. The essentials are that we print out the CSR and 
check if bit 0x400 is set (listed as INTx in Linux), then unset it and send it 
back out.

Index: siside.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/siside.c,v
retrieving revision 1.13
diff -c -r1.13 siside.c
*** siside.c    21 Aug 2004 00:28:34 -0000    1.13
--- siside.c    19 Oct 2004 03:27:02 -0000
***************
*** 87,96 ****
--- 87,106 ----
   {
       struct pci_attach_args *pa = aux;
       struct pciide_softc *sc = (struct pciide_softc *)self;
+     pci_chipset_tag_t pc = pa->pa_pc;
+     pcitag_t tag = pa->pa_tag;
+     pcireg_t csr;

       pciide_common_attach(sc, pa,
           pciide_lookup_product(pa->pa_id, pciide_sis_products));

+     csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG);
+     printf("%s: CSR = %x\n",
+         sc->sc_wdcdev.sc_atac.atac_dev.dv_xname, csr);
+     if (csr & 0x400) {
+         csr &= ~0x400;
+         pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
+     }
   }

   static struct sis_hostbr_type {




Michael wrote:
> Hello,
> 
> 
>>the IDE driver for NetBSD/bebox does not work for me (I don't know about
>>other people). As I will have some time to spare looking for a solution
>>I ask here for some guidance how to attack the problem; the list
>>port-bebox has been very silent :-/.
> 
> add
> options ATADEBUG
> to your kernel config and have a look at src/sys/dev/ata/ata.c - adjust atadebug_mask as needed, this should give you a lot more debug output.
> 
> good luck
> Michael
> 
> 

-- 
Jorgen Lundman       | <lundman@lundman.net>
Unix Administrator   | +81 (0)3 -5456-2687 ext 1017 (work)
Shibuya-ku, Tokyo    | +81 (0)90-5578-8500          (cell)
Japan                | +81 (0)3 -3375-1767          (home)