Re: <SOLEVD> Rocketport uPCI ioaddr mapping failed under FreeBSD-5.3&CURRENT

From: John Baldwin (jhb_at_FreeBSD.org)
Date: 03/24/05

  • Next message: Dag-Erling Smørgrav: "Re: UPDATE3: ATA mkIII official patches - please test!"
    To: wsk <wsk@gddsn.org.cn>
    Date: Thu, 24 Mar 2005 10:45:42 -0500
    
    

    On Thursday 24 March 2005 05:08 am, wsk wrote:
    > >Can you try this patch below and verify it works? If so, I'd like to
    > > commit it. Thanks!
    > >
    > >Index: rp_pci.c
    > >===================================================================
    > >RCS file: /usr/cvs/src/sys/dev/rp/rp_pci.c,v
    > >retrieving revision 1.9
    > >diff -u -r1.9 rp_pci.c
    > >--- rp_pci.c 21 Jun 2004 13:02:25 -0000 1.9
    > >+++ rp_pci.c 23 Mar 2005 19:37:43 -0000
    > >@@ -67,6 +67,7 @@
    > > #define RP_DEVICE_ID_4J 0x0007
    > > #define RP_DEVICE_ID_6M 0x000C
    > > #define RP_DEVICE_ID_4M 0x000D
    > >+#define RP_DEVICE_ID_UPCI_8O 0x0805
    > >
    > > /************************************************************************
    > >** MUDBAC remapped for PCI
    > >@@ -177,7 +178,14 @@
    > >
    > > ctlp->bus_ctlp = NULL;
    > >
    > >- ctlp->io_rid[0] = 0x10;
    > >+ switch (pci_get_devid(dev)) {
    > >+ case RP_DEVICE_ID_UPCI_8O:
    > >+ ctlp->io_rid[0] = PCIR_BAR(2);
    > >+ break;
    > >+ default:
    > >+ ctlp->io_rid[0] = PCIR_BAR(0);
    > >+ break;
    > >+ }
    > > ctlp->io[0] = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
    > > &ctlp->io_rid[0], RF_ACTIVE);
    > > if(ctlp->io[0] == NULL) {
    >
    > I've been tested and works failled after patched your diff! here is
    > my boot msgs:
    > rp0: <RocketPort PCI> port 0xdd80-0xddff,0xde00-0xdeff mem
    > 0xfcedff80-0xfcedffff irq 19 at device 10.0 on pci2
    > rp0: failed: rid 0x10 is memory, requested 4
    > rp0: ioaddr mapping failed for RocketPort(PCI).
    > device_attach: rp0 attach returned 6

    Oh, I see the bug. Can you try this patch instead? It fixes the bug and
    simplifies a few other places in the code:

    Index: rp_pci.c
    ===================================================================
    RCS file: /usr/cvs/src/sys/dev/rp/rp_pci.c,v
    retrieving revision 1.10
    diff -u -r1.10 rp_pci.c
    --- rp_pci.c 1 Mar 2005 08:58:04 -0000 1.10
    +++ rp_pci.c 24 Mar 2005 15:44:38 -0000
    @@ -67,6 +67,7 @@
     #define RP_DEVICE_ID_4J 0x0007
     #define RP_DEVICE_ID_6M 0x000C
     #define RP_DEVICE_ID_4M 0x000D
    +#define RP_DEVICE_ID_UPCI_8O 0x0805
     
     /**************************************************************************
       MUDBAC remapped for PCI
    @@ -129,7 +130,7 @@
             char *s;
     
             s = NULL;
    - if ((pci_get_devid(dev) & 0xffff) == RP_VENDOR_ID)
    + if (pci_get_vendor(dev) == RP_VENDOR_ID)
                     s = "RocketPort PCI";
     
             if (s != NULL) {
    @@ -177,7 +178,14 @@
     
             ctlp->bus_ctlp = NULL;
     
    - ctlp->io_rid[0] = 0x10;
    + switch (pci_get_device(dev)) {
    + case RP_DEVICE_ID_UPCI_8O:
    + ctlp->io_rid[0] = PCIR_BAR(2);
    + break;
    + default:
    + ctlp->io_rid[0] = PCIR_BAR(0);
    + break;
    + }
             ctlp->io[0] = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
                     &ctlp->io_rid[0], RF_ACTIVE);
             if(ctlp->io[0] == NULL) {
    @@ -188,7 +196,7 @@
     
             num_aiops = sPCIInitController(ctlp,
                                            MAX_AIOPS_PER_BOARD, 0,
    - FREQ_DIS, 0, (pci_get_devid(dev) >> 16) & 0xffff);
    + FREQ_DIS, 0, pci_get_device(dev));
     
             num_ports = 0;
             for(aiop=0; aiop < num_aiops; aiop++) {

    -- 
    John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
    "Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Dag-Erling Smørgrav: "Re: UPDATE3: ATA mkIII official patches - please test!"

    Relevant Pages

    • fix iounmap and a pageattr memleak (x86 and x86-64)
      ... This first patch fixes silent memleak in the pageattr code that I found ... diff -u -p -r1.13 pageattr.c ... This below patch from Andi is also needed to make the above work on x86 ... a bug was there). ...
      (Linux-Kernel)
    • Re: PATCH: Speed up direct string concatenation by 20+%!
      ... Note that while developing this patch I discovered a Subtle Bug ... you should diff your source against the current SVN repository and lodge that diff as a patch on SourceForge. ... Your suggested bug isn't, I think a real bug in the current implementation because as I understand it Python strings do always include a trailing null byte to act as a terminator when the string is passed to C code in extensions. ...
      (comp.lang.python)
    • Re: [PATCH] BUG_ON() bad input to request_irq
      ... The BUG catches future changes, ... See patch below which preceeded it, ... Breaking his drivers might make him notice:) ... diff -r 0b7e4fbb6238 drivers/net/3c503.c ...
      (Linux-Kernel)
    • Re: [Bug #11205] x86: 2.6.27-rc1 does not build with gcc-3.2.3 any more
      ... Please verify if it still should be listed and let me know ... No change, the bug is still present, and the patch still applies & works. ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: <SOLEVD> Rocketport uPCI ioaddr mapping failed under FreeBSD-5.3&CURRENT
      ... John Baldwin wrote: ... >> I've been tested and works failled after patched your diff! ... >Oh, I see the bug. ... Can you try this patch instead? ...
      (freebsd-current)