Re: Assign BAR address for pci device after hotplug
divakar <[email protected]> Tue, 09 Aug 2016 17:00:22 +0000
| Newsgroups | org.kernel.vger.linux-hotplug |
|---|---|
| Message-ID | <6546287.A3zTfYYbsh@div_linux> |
Hi ,
The modified probe function was the one with the pci_reassign_resource
function.
modified_my_driver_probe:
static int my_probe(struct pci_dev *pdev, const struct pci_device_id
*id)
{
/* Enable hotplug support
TODO: Check if this is right way to do it */
if( pci_resource_start (pdev,0) <= 0) {
ret = pci_assign_resource(pdev,0);
if( 0 > ret) {
dev_err(&pdev->dev, " Failed to assign resource
\n");
return ret;
}
}
ret = pci_enable_device(pdev);
}
Thanks for your comments on the hardware. I hope my previous message
with the output log snippets came through. My observation of the events
happening seem to suggest there is a hotplug controller as i can see the
difference between with and without enabling "pciehp". Also
pci_resource_start in the probe function of the endpoint device driver
seem to work. Hence my persistence in understanding the behavior.
Thanks
On Tuesday, August 09, 2016 02:49:39 AM Greg KH wrote:
> On Mon, Aug 08, 2016 at 05:32:42PM -0700, divakar wrote:
> > Hi Greg,
> >
> > Thanks for your comments. I managed to install a client which will
> > do
> > the auto format. Hopefully this is better than before. Please find
> > my
> > responses inline. Also added extra questions and information about
> > the setup.
> >
> > Questions:
> > 1. Since the modified_my_driver_probe is working, is that the
> > recommended way of doing it? I couldn't find any sample drivers
> > using it. So wanted your guidance
>
> I dont understand, what "modified" probe function?
>
> > 2. There is no hotplug controller as far is know off in the setup (
> > assuming native x86 soc has root port which has inbuilt hp
> > controller
> > and pcieport driver takes care of it). Am i missing something?
>
> Then your hardware does not support PCI hotplug, so I don't recommend
> trying to use it.
>
> Seriously, this is a hardware and BIOS requirement to support this, if
> you don't have that hardware, you can't really work around it in the
> kernel. Go buy some real hardware for this please.
>
> > 3. When card 2 is inserted there is no hotplug event. Not sure why.
>
> Why would there be? You don't have hardware that notices this.
>
> good luck,
>
> greg k-h