* sysfs-pci remove @ 2014-12-16 17:51 ratheesh kannoth 2014-12-17 1:00 ` Yijing Wang 0 siblings, 1 reply; 10+ messages in thread From: ratheesh kannoth @ 2014-12-16 17:51 UTC (permalink / raw) To: linux-pci@vger.kernel.org Hi list, https://www.kernel.org/doc/Documentation/filesystems/sysfs-pci.txt talks about "remove" entry. The 'remove' file is used to remove the PCI device, by writing a non-zero integer to the file. if i remove the device , will the bar resource map still appear on /proc/iomem ? -Ratheesh ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sysfs-pci remove 2014-12-16 17:51 sysfs-pci remove ratheesh kannoth @ 2014-12-17 1:00 ` Yijing Wang 2014-12-17 5:21 ` ratheesh kannoth 0 siblings, 1 reply; 10+ messages in thread From: Yijing Wang @ 2014-12-17 1:00 UTC (permalink / raw) To: ratheesh kannoth, linux-pci@vger.kernel.org On 2014/12/17 1:51, ratheesh kannoth wrote: > Hi list, > > https://www.kernel.org/doc/Documentation/filesystems/sysfs-pci.txt > talks about "remove" entry. > The 'remove' file is used to remove the PCI device, by writing a non-zero > integer to the file. if i remove the device , will the bar resource > map still appear on /proc/iomem ? Of course not. > > > -Ratheesh > -- > To unsubscribe from this list: send the line "unsubscribe linux-pci" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- Thanks! Yijing ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sysfs-pci remove 2014-12-17 1:00 ` Yijing Wang @ 2014-12-17 5:21 ` ratheesh kannoth 2014-12-17 5:50 ` Yijing Wang 0 siblings, 1 reply; 10+ messages in thread From: ratheesh kannoth @ 2014-12-17 5:21 UTC (permalink / raw) To: Yijing Wang; +Cc: linux-pci@vger.kernel.org I could see the pci resource in /proc/iomem. But , lspci -s 06:0.0 -vv shows that there is no kernel mode driver for that interface. On Wed, Dec 17, 2014 at 6:30 AM, Yijing Wang <wangyijing@huawei.com> wrote: > On 2014/12/17 1:51, ratheesh kannoth wrote: >> Hi list, >> >> https://www.kernel.org/doc/Documentation/filesystems/sysfs-pci.txt >> talks about "remove" entry. >> The 'remove' file is used to remove the PCI device, by writing a non-zero >> integer to the file. if i remove the device , will the bar resource >> map still appear on /proc/iomem ? > > Of course not. > >> >> >> -Ratheesh >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-pci" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> >> > > > -- > Thanks! > Yijing > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sysfs-pci remove 2014-12-17 5:21 ` ratheesh kannoth @ 2014-12-17 5:50 ` Yijing Wang 2014-12-17 6:08 ` ratheesh kannoth 0 siblings, 1 reply; 10+ messages in thread From: Yijing Wang @ 2014-12-17 5:50 UTC (permalink / raw) To: ratheesh kannoth; +Cc: linux-pci@vger.kernel.org On 2014/12/17 13:21, ratheesh kannoth wrote: > I could see the pci resource in /proc/iomem. > > But , lspci -s 06:0.0 -vv shows that there is no kernel mode driver > for that interface. If the device 06:0.0 was removed by "echo 1 > /sys/.../0000:6:0.0/remove", you could not see lspci info for this device anymore. Do you really remove the device ? > > > On Wed, Dec 17, 2014 at 6:30 AM, Yijing Wang <wangyijing@huawei.com> wrote: >> On 2014/12/17 1:51, ratheesh kannoth wrote: >>> Hi list, >>> >>> https://www.kernel.org/doc/Documentation/filesystems/sysfs-pci.txt >>> talks about "remove" entry. >>> The 'remove' file is used to remove the PCI device, by writing a non-zero >>> integer to the file. if i remove the device , will the bar resource >>> map still appear on /proc/iomem ? >> >> Of course not. >> >>> >>> >>> -Ratheesh >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-pci" in >>> the body of a message to majordomo@vger.kernel.org >>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>> >>> >> >> >> -- >> Thanks! >> Yijing >> > > -- Thanks! Yijing ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sysfs-pci remove 2014-12-17 5:50 ` Yijing Wang @ 2014-12-17 6:08 ` ratheesh kannoth 2014-12-17 6:14 ` Yijing Wang 0 siblings, 1 reply; 10+ messages in thread From: ratheesh kannoth @ 2014-12-17 6:08 UTC (permalink / raw) To: Yijing Wang; +Cc: linux-pci@vger.kernel.org On Wed, Dec 17, 2014 at 11:20 AM, Yijing Wang <wangyijing@huawei.com> wrote: > If the device 06:0.0 was removed by "echo 1 > /sys/.../0000:6:0.0/remove", > you could not see lspci info for this device anymore. > Do you really remove the device ? Oh , my bad. I did not remove the device. I did an unbind echo -n "0000:06:00.0" > /sys/bus/pci/drivers/enic/unbind0 Unbind wont remove it from /proc/iomem ? I thought enic pci driver is the one is calling ioremap on those memory ? Thanks, Ratheesh ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sysfs-pci remove 2014-12-17 6:08 ` ratheesh kannoth @ 2014-12-17 6:14 ` Yijing Wang 2014-12-17 6:21 ` ratheesh kannoth 0 siblings, 1 reply; 10+ messages in thread From: Yijing Wang @ 2014-12-17 6:14 UTC (permalink / raw) To: ratheesh kannoth; +Cc: linux-pci@vger.kernel.org On 2014/12/17 14:08, ratheesh kannoth wrote: > On Wed, Dec 17, 2014 at 11:20 AM, Yijing Wang <wangyijing@huawei.com> wrote: >> If the device 06:0.0 was removed by "echo 1 > /sys/.../0000:6:0.0/remove", >> you could not see lspci info for this device anymore. >> Do you really remove the device ? > > Oh , my bad. I did not remove the device. I did an unbind > > echo -n "0000:06:00.0" > /sys/bus/pci/drivers/enic/unbind0 > > Unbind wont remove it from /proc/iomem ? I thought enic pci driver is > the one is calling ioremap on those memory ? 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. > > Thanks, > Ratheesh > > -- Thanks! Yijing ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sysfs-pci remove 2014-12-17 6:14 ` Yijing Wang @ 2014-12-17 6:21 ` ratheesh kannoth 2014-12-17 7:36 ` Yijing Wang 0 siblings, 1 reply; 10+ messages in thread From: ratheesh kannoth @ 2014-12-17 6:21 UTC (permalink / raw) To: Yijing Wang; +Cc: linux-pci@vger.kernel.org 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 ? Thanks, Ratheesh ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sysfs-pci remove 2014-12-17 6:21 ` ratheesh kannoth @ 2014-12-17 7:36 ` Yijing Wang 2014-12-17 19:09 ` Bjorn Helgaas 0 siblings, 1 reply; 10+ messages in thread From: Yijing Wang @ 2014-12-17 7:36 UTC (permalink / raw) To: ratheesh kannoth; +Cc: linux-pci@vger.kernel.org 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() > > Thanks, > Ratheesh > -- > To unsubscribe from this list: send the line "unsubscribe linux-pci" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- Thanks! Yijing ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sysfs-pci remove 2014-12-17 7:36 ` Yijing Wang @ 2014-12-17 19:09 ` Bjorn Helgaas 2014-12-18 1:03 ` Yijing Wang 0 siblings, 1 reply; 10+ messages in thread From: Bjorn Helgaas @ 2014-12-17 19:09 UTC (permalink / raw) To: Yijing Wang; +Cc: ratheesh kannoth, linux-pci@vger.kernel.org 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. 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 ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sysfs-pci remove 2014-12-17 19:09 ` Bjorn Helgaas @ 2014-12-18 1:03 ` Yijing Wang 0 siblings, 0 replies; 10+ messages in thread From: Yijing Wang @ 2014-12-18 1:03 UTC (permalink / raw) To: Bjorn Helgaas; +Cc: ratheesh kannoth, linux-pci@vger.kernel.org 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 ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-12-18 1:03 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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).