lkml.org 
[lkml]   [2012]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v2 29/37] PCI, ACPI: Add acpi_pci_root_rescan()
    On Sat, Mar 10, 2012 at 12:00 AM, Yinghai Lu <yinghai@kernel.org> wrote:
    > It will rescan all acpi pci root if related pci root bus get removed before.

    I think this is a bad idea. The ACPI core already walks the entire
    ACPI namespace, finding devices and binding drivers to them.

    Walking the whole thing again looking for "hotplug" things we can do
    is just a hack. Maybe you want it for debugging, but I don't want it
    in Linux.

    > Signed-off-by: Yinghai <yinghai@kernel.org>
    > Cc: Len Brown <lenb@kernel.org>
    > Cc: linux-acpi@vger.kernel.org
    > ---
    >  drivers/acpi/pci_root_hp.c |   17 +++++++++++++++++
    >  include/linux/pci-acpi.h   |    7 +++++++
    >  2 files changed, 24 insertions(+), 0 deletions(-)
    >
    > diff --git a/drivers/acpi/pci_root_hp.c b/drivers/acpi/pci_root_hp.c
    > index b453181..ca73d51 100644
    > --- a/drivers/acpi/pci_root_hp.c
    > +++ b/drivers/acpi/pci_root_hp.c
    > @@ -268,3 +268,20 @@ static int __init acpi_pci_root_hp_init(void)
    >  }
    >
    >  subsys_initcall(acpi_pci_root_hp_init);
    > +
    > +static acpi_status
    > +rescan_root_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
    > +{
    > +       if (!acpi_is_root_bridge(handle))
    > +               return AE_OK;
    > +
    > +       handle_root_bridge_insertion(handle);
    > +
    > +       return AE_OK;
    > +}
    > +
    > +void acpi_pci_root_rescan(void)
    > +{
    > +       acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
    > +               ACPI_UINT32_MAX, rescan_root_bridge, NULL, NULL, NULL);
    > +}
    > diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
    > index 4462350..ac93634 100644
    > --- a/include/linux/pci-acpi.h
    > +++ b/include/linux/pci-acpi.h
    > @@ -35,6 +35,13 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
    >        return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus),
    >                                              pbus->number);
    >  }
    > +
    > +void acpi_pci_root_rescan(void);
    > +
    > +#else
    > +
    > +static inline void acpi_pci_root_rescan(void) { }
    > +
    >  #endif
    >
    >  #ifdef CONFIG_ACPI_APEI
    > --
    > 1.7.7
    >
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-03-13 04:35    [W:6.140 / U:0.188 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site