public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: david.hagood@gmail.com
To: linux-kernel@vger.kernel.org
Subject: Rescan/resize/reallocate PCI device BAR when it changes?
Date: Fri, 17 Sep 2010 10:45:54 -0500	[thread overview]
Message-ID: <5cb62a8f48f639af132dfd4a1543750d.squirrel@localhost> (raw)

I have a PCI device which can, at run time, change the size of the BARs it
makes visible (e.g. a BAR which was disabled can become enabled, a BAR
that was 64kiByte becomes 128kiByte, etc.

I would like to get the kernel to reallocate the resources for that device
without having to shut the device down and reload the device driver - the
device driver will "know" how to handle this sort of event (actually, the
driver will be the one that caused the event).

I've tried various combinations of pci_scan_bus, pci_request_resources,
etc. to no avail: I can see the hardware change size, but the kernel data
structures for the PCI device steadfastly remain unchanged.

This is a fairly common issue for us embedded programmers: we have things
like FPGAs and microprocessors as endpoints that, as the device driver
finishes programming them, will suddenly have a need for different sized
BARs.

I realize that in some cases, it may not be possible to simply resize
things (e.g. not enough resources exist within the space allocated for the
bridge the device lives on to resize things), and I am prepared to handle
such events.



                 reply	other threads:[~2010-09-17 15:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=5cb62a8f48f639af132dfd4a1543750d.squirrel@localhost \
    --to=david.hagood@gmail.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox