From: Yijing Wang <wangyijing@huawei.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: ratheesh kannoth <ratheesh.ksz@gmail.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: sysfs-pci remove
Date: Thu, 18 Dec 2014 09:03:20 +0800 [thread overview]
Message-ID: <549227D8.8030001@huawei.com> (raw)
In-Reply-To: <CAErSpo6jHcNVPj4AT6ZdT82HUeewrqCFnB19oBQXhjZ+fFLGHg@mail.gmail.com>
On 2014/12/18 3:09, Bjorn Helgaas wrote:
> On Wed, Dec 17, 2014 at 12:36 AM, Yijing Wang <wangyijing@huawei.com> wrote:
>> On 2014/12/17 14:21, ratheesh kannoth wrote:
>>> On Wed, Dec 17, 2014 at 11:44 AM, Yijing Wang <wangyijing@huawei.com> wrote:
>>>> Unbind won't release PCI device bar resource, resources in /proc/iomem is the
>>>> physical address resource(added by request_resource()), if you iounmap the bar resource,
>>>> it won't change anything in /proc/iomem.
>>>
>>> who is calling request_resource() ...is it enic driver ?
>>
>> PCI core interface, E.g pci_bus_assign_resources()
>
> Hi Ratheesh,
>
> There are two things going on in /proc/iomem:
>
> 1) The core should put all the hardware that responds to physical
> accesses in /proc/iomem. These entries should be there regardless of
> whether we have a driver for the device. These are used when
> assigning addresses to new devices, to make sure we don't assign the
> same address to two different devices. These entries include RAM,
> ACPI tables, APICs, PCI host bridges, PCI MMCONFIG regions, PCI
> devices, etc. It *should* also include address space consumed by
> other things like PNP and ACPI devices, but that is currently missing.
>
> 2) Individual drivers claim address space they use to control their
> device, e.g., with pci_request_regions(), ioremap(), etc. This puts
> an entry in /proc/iomem with the driver name on it. A device may
> respond to several physical address regions, and a driver need not
> claim all of them, and it may even claim only part of a region.
Yes, exactly, I missed this.
>
> So when you unbind a driver, you should see the second type of entry
> go away. When you actually remove a device (hot-remove or sysfs
> remove), you should see the first type go away as well, which means
> there's no longer anything that will respond to that physical address
> space.
>
> Bjorn
>
>
--
Thanks!
Yijing
prev parent reply other threads:[~2014-12-18 1:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-16 17:51 sysfs-pci remove ratheesh kannoth
2014-12-17 1:00 ` Yijing Wang
2014-12-17 5:21 ` ratheesh kannoth
2014-12-17 5:50 ` Yijing Wang
2014-12-17 6:08 ` ratheesh kannoth
2014-12-17 6:14 ` Yijing Wang
2014-12-17 6:21 ` ratheesh kannoth
2014-12-17 7:36 ` Yijing Wang
2014-12-17 19:09 ` Bjorn Helgaas
2014-12-18 1:03 ` Yijing Wang [this message]
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=549227D8.8030001@huawei.com \
--to=wangyijing@huawei.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=ratheesh.ksz@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).