Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Apr 2006 22:51:45 -0700
From:      Darren Pilgrim <darren.pilgrim@bitfreak.org>
To:        hongz@promisechina.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Can kldload trigger pci bus rescan?
Message-ID:  <44505BF1.80806@bitfreak.org>
In-Reply-To: <1146110516$75164$50215385@hongz@promisechina.com>
References:  <1146110516$75164$50215385@hongz@promisechina.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------000201020006050802060608
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

hongz@promisechina.com wrote:
> Hi guys:
> 
> My situation is:
> (1) We are porting our HBA driver (Promise FastTrak TX4310 SoftRaid5) from
> Linux to FreeBSD(6.0). Our HBA driver can work normally under Linux.
> (2) At this time, I just wrote a sample driver code (see sr5.c in the
> attached file) to check the driver's probe function in FreeBSD.
> (3) After I successfully compiled the codes, I run "make load" (see Makefile
> and load.info in the attached file) for testing.
> (4) Our probe function was called indeed, but no matching pci device was
> found! (Yes, I have plugged our HBA card in the system).  
> (5) Our HBA card information can be found by running pciconf (see
> pciconf.info in the attached file).

The only two storage devices in the pciconf output are:

atapci0@pci0:7:1:	class=0x01018a card=0x74411022 chip=0x74411022 
rev=0x04 hdr=0x00
     vendor   = 'Advanced Micro Devices (AMD)'
     device   = 'AMD-768 EIDE Controller'
     class    = mass storage
     subclass = ATA
atapci1@pci2:4:0:	class=0x010400 card=0x3515105a chip=0x3515105a 
rev=0x02 hdr=0x00
     vendor   = 'Promise Technology Inc'
     class    = mass storage
     subclass = RAID

The first looks like the ATA controller on the motherboard.  The second 
is your Promise ATA RAID card.  Both devices are already attached by 
FreeBSD's ATA framework.  You will need to patch FreeBSD's ATA framework 
to not detect your card.  The attached patch should do the trick (it 
removes the corresponding PCI ID for your card).  I tested the patch to 
the point that it compiles, but I can't guarantee this will prevent the 
attach or even result in a bootable kernel, so test carefully.

To apply the patch, do the following with root privileges:

cd /usr/src      # Replace /usr/src with the base of your src tree.
patch </path/to/ata_no_PDC40719.diff

If you have ata compiled into your kernel, rebuild your kernel.  If 
you're loading the ATA modules, you can get away with just rebuilding 
the ata modules:

cd /usr/src/sys/modules/ata
make clean && make depend && make && make install


--------------000201020006050802060608
Content-Type: text/plain;
 name="ata_no_PDC40719.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ata_no_PDC40719.diff"

--- sys/dev/ata/ata-chipset.c.old	Fri Oct 14 02:34:50 2005
+++ sys/dev/ata/ata-chipset.c	Wed Apr 26 22:14:14 2006
@@ -2409,7 +2409,6 @@
      { ATA_PDC40518,  0, PRMIO, PRSATA2, ATA_SA150, "Promise PDC40518" },
      { ATA_PDC40519,  0, PRMIO, PRSATA2, ATA_SA150, "Promise PDC40519" },
      { ATA_PDC40718,  0, PRMIO, PRSATA2, ATA_SA300, "Promise PDC40718" },
-     { ATA_PDC40719,  0, PRMIO, PRSATA2, ATA_SA300, "Promise PDC40719" },
      { 0, 0, 0, 0, 0, 0}};
     char buffer[64];
     uintptr_t devid = 0;
--- sys/dev/ata/ata-pci.h.old	Fri Oct 14 02:34:50 2005
+++ sys/dev/ata/ata-pci.h	Wed Apr 26 22:14:45 2006
@@ -213,7 +213,6 @@
 #define ATA_PDC40518            0x3d18105a
 #define ATA_PDC40519            0x3519105a
 #define ATA_PDC40718            0x3d17105a
-#define ATA_PDC40719            0x3515105a
 #define ATA_PDC20617            0x6617105a
 #define ATA_PDC20618            0x6626105a
 #define ATA_PDC20619            0x6629105a

--------------000201020006050802060608--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44505BF1.80806>