Fwd: Can kldload trigger pci bus rescan?

2006-04-27 Thread Zaphod Beeblebrox
It would be cool if pccard and usb also reprobed when kldload ran.  The usb
case is slightly more complex --- having (say) uscanner claim something that
ugen is currently claiming.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can kldload trigger pci bus rescan?

2006-04-27 Thread M. Warner Losh
In message: [EMAIL PROTECTED]
Zaphod Beeblebrox [EMAIL PROTECTED] writes:
: It would be cool if pccard and usb also reprobed when kldload ran.  The usb
: case is slightly more complex --- having (say) uscanner claim something that
: ugen is currently claiming.

PC Card has done so for years, OLDCARD and NEWCARD.  In fact, you can
even load and unload the bridge driver (cbb today, pcic in yesteryear)
and the pccard bus driver.  pccard works very hard to make sure that
these things work.

usb does also, but not in a manner that's useful.  It does work with
usb for simple devices when ugen isn't loaded into the kernel.
However, the brain dead way that usb dollops out subdevices makes
fixing it to work like rest of the system difficult...  The port from
NetBSD didn't take the time to make the device model match FreeBSD,
but rather just shoe-horned it into the system.

Warner
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Can kldload trigger pci bus rescan?

2006-04-26 Thread hongz
Hi guys:

 

I tried to use kldload to load our HBA driver. But the driver's pci probe
function can not find the HBA card! Does it mean that kldload can not
trigger pci bus rescan? If so, what should I do for triggering pci bus
rescan after loading our pci driver?

 

Thank you for your help!

 

Hong

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can kldload trigger pci bus rescan?

2006-04-26 Thread Daniel O'Connor
On Wednesday 26 April 2006 17:17, [EMAIL PROTECTED] wrote:
 I tried to use kldload to load our HBA driver. But the driver's pci probe
 function can not find the HBA card! Does it mean that kldload can not
 trigger pci bus rescan? If so, what should I do for triggering pci bus
 rescan after loading our pci driver?

It will reprobe..
Well, all of the probe functions in the kernel will be called again.

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


pgpKZKi45FocR.pgp
Description: PGP signature


Re: Can kldload trigger pci bus rescan?

2006-04-26 Thread M. Warner Losh
In message: [EMAIL PROTECTED]@promisechina.com
[EMAIL PROTECTED] writes:
: I tried to use kldload to load our HBA driver. But the driver's pci probe
: function can not find the HBA card! Does it mean that kldload can not
: trigger pci bus rescan? If so, what should I do for triggering pci bus
: rescan after loading our pci driver?

kldload of a driver with a pci attachment will cause all pci busses to
reprobe/attach their unattached children automatically.  When you say
that the driver's probe function can not find the HBA card, what do
you mean?  That none of the devices presented to it are accepted?

Warner
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can kldload trigger pci bus rescan?

2006-04-26 Thread Darren Pilgrim

[EMAIL PROTECTED] wrote:

I tried to use kldload to load our HBA driver. But the driver's pci probe
function can not find the HBA card!


By this do you mean that when you have the card in the system, FreeBSD 
booted and you kldload the driver, you don't see kernel messages showing 
the appropriate attach messages?  Is anything printed?


 Does it mean that kldload can not

trigger pci bus rescan? If so, what should I do for triggering pci bus
rescan after loading our pci driver?


As Daniel and Warner already stated, the PCI rescan is automatic.  This 
is more likely an identification or driver mismatch problem.  Please 
provide the following:


- The exact make and model of the HBA card.
- The exact version of FreeBSD you're using.
- Which driver you're trying to use.

This information will allow us to nail down possible reasons why the 
attach is not occuring.


___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Can kldload trigger pci bus rescan?

2006-04-26 Thread Darren Pilgrim

[EMAIL PROTECTED] 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:

[EMAIL PROTECTED]: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
[EMAIL PROTECTED]: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

--- 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_PDC405180x3d18105a
 #define ATA_PDC405190x3519105a
 #define ATA_PDC407180x3d17105a
-#define ATA_PDC407190x3515105a
 #define ATA_PDC206170x6617105a
 #define ATA_PDC206180x6626105a
 #define ATA_PDC206190x6629105a
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]