All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Assign BAR address for pci device after hotplug
Date: Tue, 09 Aug 2016 17:18:27 +0000	[thread overview]
Message-ID: <20160809171827.GA31077@kroah.com> (raw)
In-Reply-To: <AT5PR84MB0177723391A9CA3EAEE43C0088050@AT5PR84MB0177.NAMPRD84.PROD.OUTLOOK.COM>


A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?

http://daringfireball.net/2007/07/on_top

On Tue, Aug 09, 2016 at 10:00:22AM -0700, divakar wrote:
> Hi ,
> 
> The modified probe function was the one with the pci_reassign_resource 
> function. 

Don't do that.  That's for the pci core to use only.


> 
> 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. 

If the pciehp driver does not bind to your hardware, then it will not
work properly.

Again, PCI hotplug requires a PCI hotplug controller, or special
firmware/bios support for it.  You can't do it properly without it, read
the specification for all of the nasty details.

good luck!

greg k-h

  parent reply	other threads:[~2016-08-09 17:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02 21:11 Assign BAR address for pci device after hotplug Chitturi, Divakar
2016-08-03  5:12 ` Greg KH
2016-08-04 17:09 ` Chitturi, Divakar
2016-08-05 10:53 ` Greg KH
2016-08-09  0:32 ` divakar
2016-08-09  0:49 ` Greg KH
2016-08-09 17:00 ` divakar
2016-08-09 17:18 ` Greg KH [this message]
2016-08-09 18:48 ` divakar
2016-08-09 18:59 ` Greg KH
2016-08-10  0:26 ` divakar
2016-08-10  8:47 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160809171827.GA31077@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.