Re: Rescan PCIE bus to find recently powered on device.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 18, 2013 at 9:27 PM, Yijing Wang <wangyijing@xxxxxxxxxx> wrote:
> On 2013/4/19 10:59, Frank Rizzo wrote:
>> Hey list.
>>
>> I'm working on a driver for a device that's external from the PC.  It's connected to the PC via a weird cable that connects to a PCIE card inside the case that appears to be nothing other than glue logic to allow the signals from the cable to be tossed onto the bus.

The card probably contains a PCIe switch with the downstream link
being routed on the cable.

>>
>> When the external device is powered off during boot, nothing is found.  hwinfo doesn't find it, lspci doesn't find it, etc.

That's completely normal, of course.  When the device is powered off,
it doesn't respond, so we can't find it.

>> If you power on the device BEFORE booting, everything is found, and it works fine.

Also normal.

>> And lastly, if you power it on AFTER Linux has booted, you still can't find it.  I've tried echoing "1" to rescan, and everything else that I could find via Google search.
>>
>> So, what are my options here?  I'm not allergic to adding code to the driver to scan for the device periodically, if I knew HOW to find it.  And, once found, how do I get it registered?
>>
>
> When your device power off during boot, system maybe will not reserve resource like bus res for your device. So when you power on your device after system boot,
> system cannot scan your device by rescan interface, I guess.

I think Yijing is right; this is probably a resource allocation
problem.  Linux isn't smart enough to reassign bus numbers, MMIO
address space, or I/O port numbers at run-time, so if we didn't leave
space at boot-time to accommodate the new device, we won't be able to
use it.

I think your best option is to reserve space at boot-time.  The
"pci=hpmemsize=..." and "pci=hpiosize=..." parameters might be useful,
but since it sounds like we can't find the device at all, it's more
likely that bus number space is the problem, and we don't have a
parameter to reserve that.

If you collect "lspci -vv" output (when device was powered on before
boot) and complete dmesg logs (both from when device was powered on
before boot and when it was powered off at boot), we should be able to
figure out exactly what the problem is.

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux