From: Yijing Wang <wangyijing@huawei.com>
To: Yijing Wang <wangyijing@huawei.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>, <linux-pci@vger.kernel.org>,
Hanjun Guo <guohanjun@huawei.com>,
Jiang Liu <jiang.liu@huawei.com>, Yinghai Lu <yinghai@kernel.org>
Subject: Re: [PATCH 3/3] PCI, acpiphp: Use res->flags to determine whether the resouce is valid
Date: Fri, 17 Aug 2012 08:58:12 +0800 [thread overview]
Message-ID: <502D9724.2030307@huawei.com> (raw)
In-Reply-To: <1345119142-5896-3-git-send-email-wangyijing@huawei.com>
Hi Bjorn,
Please ignore these three patches, I'm very sorry I still have some confusion about allocating resources
to pci devices.So this patch is not appropriate. I will provide new version patches when I find a better
solution for this problem.
> When we hot plug pci devices, system will allocate resources to these new add
> devices, pci_bus_assign_resources() will be called.If the pci devices was assigned
> resource fail, the resource struct will reset to zero.So I think use res->flags here
> to determine whether the resource is valid is reliable.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> ---
> drivers/pci/hotplug/acpiphp_glue.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
> index 7bbd6bf..2161902 100644
> --- a/drivers/pci/hotplug/acpiphp_glue.c
> +++ b/drivers/pci/hotplug/acpiphp_glue.c
> @@ -1084,13 +1084,11 @@ static void acpiphp_sanitize_bus(struct pci_bus *bus)
> {
> struct pci_dev *dev, *tmp;
> int i;
> - unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM;
>
> list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
> for (i=0; i<PCI_BRIDGE_RESOURCES; i++) {
> struct resource *res = &dev->resource[i];
> - if ((res->flags & type_mask) && !res->start &&
> - res->end) {
> + if (!res->flags) {
> /* Could not assign a required resources
> * for this device, remove it */
> pci_stop_and_remove_bus_device(dev);
>
--
Thanks!
Yijing
next prev parent reply other threads:[~2012-08-17 1:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 12:12 [PATCH 1/3] PCI, acpiphp: Add module parameter "complete_add" used to determine whether to hot add all devices regardless of be assigned resources fail Yijing Wang
2012-08-16 12:12 ` [PATCH 2/3] PCI, acpiphp: Use list_for_each_entry_safe instead of list_for_each_entry Yijing Wang
2012-08-16 12:12 ` [PATCH 3/3] PCI, acpiphp: Use res->flags to determine whether the resouce is valid Yijing Wang
2012-08-17 0:58 ` Yijing Wang [this message]
2012-08-17 2:34 ` Bjorn Helgaas
2012-08-17 4:59 ` Yijing Wang
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=502D9724.2030307@huawei.com \
--to=wangyijing@huawei.com \
--cc=bhelgaas@google.com \
--cc=guohanjun@huawei.com \
--cc=jiang.liu@huawei.com \
--cc=linux-pci@vger.kernel.org \
--cc=yinghai@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.