Re: [PATCH] eeepc-laptop: disable pci hotplug code when all notifiers fail to load

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Len,
Please merge this patch too, I forgot so send it to you earlier.
Thanks,


On Sun, Dec 13, 2009 at 10:16 PM, Corentin Chary <corentincj@xxxxxxxxxx> wrote:
> This is a short term workaround for Eeepc 1005HA.
>
> refs: <http://bugzilla.kernel.org/show_bug.cgi?id=14570>
>
> Signed-off-by: Corentin Chary <corentincj@xxxxxxxxxx>
> ---
>  drivers/platform/x86/eeepc-laptop.c |   17 +++++++++++++----
>  1 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
> index 356ca11..45c3f52 100644
> --- a/drivers/platform/x86/eeepc-laptop.c
> +++ b/drivers/platform/x86/eeepc-laptop.c
> @@ -177,6 +177,7 @@ struct eeepc_laptop {
>
>        struct hotplug_slot *hotplug_slot;
>        struct mutex hotplug_lock;
> +       bool hotplug_enabled;
>
>        struct led_classdev tpd_led;
>        int tpd_led_wk;
> @@ -642,6 +643,7 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc,
>                                                     eeepc);
>                if (ACPI_FAILURE(status))
>                        pr_warning("Failed to register notify on %s\n", node);
> +               eeepc->hotplug_enabled = true;
>        } else
>                return -ENODEV;
>
> @@ -845,7 +847,17 @@ static int eeepc_rfkill_init(struct eeepc_laptop *eeepc)
>        if (result && result != -ENODEV)
>                goto exit;
>
> -       result = eeepc_setup_pci_hotplug(eeepc);
> +       /*
> +        * Register notifiers first, if they all fail, we won't enable
> +        * pci hotplug because it's probably not needed for this model
> +        * (eg: 1005HA)
> +        */
> +       eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P5");
> +       eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P6");
> +       eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P7");
> +
> +       if (eeepc->hotplug_enabled)
> +               result = eeepc_setup_pci_hotplug(eeepc);
>        /*
>         * If we get -EBUSY then something else is handling the PCI hotplug -
>         * don't fail in this case
> @@ -853,9 +865,6 @@ static int eeepc_rfkill_init(struct eeepc_laptop *eeepc)
>        if (result == -EBUSY)
>                result = 0;
>
> -       eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P5");
> -       eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P6");
> -       eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P7");
>        /*
>         * Refresh pci hotplug in case the rfkill state was changed during
>         * setup.
> --
> 1.6.5.4
>
>



-- 
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux