All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2.6.32-rc3] Prevent a panic when disabling RT2860 wireless when associated
       [not found] ` <mpro.kr41l600vf1lc0bg3.linux-Ym6Ivm/Ks7B65+NM0QMiFAbYiX8G1TQY9dF7HbQ/qKg@public.gmane.org>
@ 2009-10-06 21:18   ` Corentin Chary
       [not found]     ` <71cd59b00910061418o6a9e3e65n6365972ee0980780-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Corentin Chary @ 2009-10-06 21:18 UTC (permalink / raw)
  To: corentincj-EjuBZuxMvz2sTnJN9+BGXg,
	acpi4asus-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Darren Salt
  Cc: linux acpi, Alan Jenkins

On Tue, Oct 6, 2009 at 10:43 PM, Darren Salt
<linux-Ym6Ivm/Ks7B65+NM0QMiFAbYiX8G1TQY9dF7HbQ/qKg@public.gmane.org> wrote:
> This works around what I think is actually a bug in rt2860sta which is
> triggered when the hardware "disappears" from beneath the driver, i.e. when
> wireless is toggled off via ACPI. It does so by ensuring that the rfkill
> soft-block flag is set before the hardware is disabled.
>
> I do not know whether this patch is required if rt2800pci is in use instead
> of rt2860sta; at the time of submission of this patch, I've not been able to
> test this.
>
> (Ref. http://bugzilla.kernel.org/show_bug.cgi?id=13390)
>
> Signed-off-by: Darren Salt <linux-Ym6Ivm/Ks7B65+NM0QMiFAbYiX8G1TQY9dF7HbQ/qKg@public.gmane.org>
>
> --- a/drivers/platform/x86/eeepc-laptop.c       2009-10-06 02:03:33.656944837 +0100
> +++ b/drivers/platform/x86/eeepc-laptop.c       2009-10-06 03:03:15.693022131 +0100
> @@ -150,6 +150,8 @@ struct eeepc_hotk {
>  /* The actual device the driver binds to */
>  static struct eeepc_hotk *ehotk;
>
> +static void eeepc_rfkill_hotplug(bool real);
> +
>  /* Platform device/driver */
>  static int eeepc_hotk_thaw(struct device *device);
>  static int eeepc_hotk_restore(struct device *device);
> @@ -343,7 +345,16 @@ static bool eeepc_wlan_rfkill_blocked(vo
>  static int eeepc_rfkill_set(void *data, bool blocked)
>  {
>        unsigned long asl = (unsigned long)data;
> -       return set_acpi(asl, !blocked);
> +       int ret;
> +
> +       if (asl != CM_ASL_WLAN)
> +               return set_acpi(asl, !blocked);
> +
> +       /* hack to avoid panic with rt2860sta */
> +       if (blocked)
> +               eeepc_rfkill_hotplug(false);
> +       ret = set_acpi(asl, !blocked);
> +       return ret;
>  }
>
>  static const struct rfkill_ops eeepc_rfkill_ops = {
> @@ -643,13 +654,13 @@ static int eeepc_get_adapter_status(stru
>        return 0;
>  }
>
> -static void eeepc_rfkill_hotplug(void)
> +static void eeepc_rfkill_hotplug(bool real)
>  {
>        struct pci_dev *dev;
>        struct pci_bus *bus;
> -       bool blocked = eeepc_wlan_rfkill_blocked();
> +       bool blocked = real ? eeepc_wlan_rfkill_blocked() : true;
>
> -       if (ehotk->wlan_rfkill)
> +       if (real && ehotk->wlan_rfkill)
>                rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
>
>        mutex_lock(&ehotk->hotplug_lock);
> @@ -692,7 +703,7 @@ static void eeepc_rfkill_notify(acpi_han
>        if (event != ACPI_NOTIFY_BUS_CHECK)
>                return;
>
> -       eeepc_rfkill_hotplug();
> +       eeepc_rfkill_hotplug(true);
>  }
>
>  static void eeepc_hotk_notify(struct acpi_device *device, u32 event)
> @@ -850,7 +861,7 @@ static int eeepc_hotk_restore(struct dev
>  {
>        /* Refresh both wlan rfkill state and pci hotplug */
>        if (ehotk->wlan_rfkill)
> -               eeepc_rfkill_hotplug();
> +               eeepc_rfkill_hotplug(true);
>
>        if (ehotk->bluetooth_rfkill)
>                rfkill_set_sw_state(ehotk->bluetooth_rfkill,
> @@ -993,7 +1004,7 @@ static void eeepc_rfkill_exit(void)
>         * Refresh pci hotplug in case the rfkill state was changed after
>         * eeepc_unregister_rfkill_notifier()
>         */
> -       eeepc_rfkill_hotplug();
> +       eeepc_rfkill_hotplug(true);
>        if (ehotk->hotplug_slot)
>                pci_hp_deregister(ehotk->hotplug_slot);
>
> @@ -1109,7 +1120,7 @@ static int eeepc_rfkill_init(struct devi
>         * Refresh pci hotplug in case the rfkill state was changed during
>         * setup.
>         */
> -       eeepc_rfkill_hotplug();
> +       eeepc_rfkill_hotplug(true);
>
>  exit:
>        if (result && result != -ENODEV)
>
> --
> | Darren Salt            | linux at youmustbejoking | nr. Ashington, | Doon
> | using Debian GNU/Linux | or ds    ,demon,co,uk    | Northumberland | Army
> | + Lobby friends, family, business, government.    WE'RE KILLING THE PLANET.
>
> Insanity is just a state of mind.
>

Hi,
Did you test this patch with other hardware ?
Can't we fix that directly in rt2860sta ?
Thanks,

-- 
Corentin Chary
http://xf.iksaif.net

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2.6.32-rc3] Prevent a panic when disabling RT2860 wireless when associated
       [not found]     ` <71cd59b00910061418o6a9e3e65n6365972ee0980780-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-10-12 20:53       ` Darren Salt
  0 siblings, 0 replies; 2+ messages in thread
From: Darren Salt @ 2009-10-12 20:53 UTC (permalink / raw)
  To: Corentin Chary
  Cc: linux acpi, acpi4asus-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Alan Jenkins

I demand that Corentin Chary may or may not have written...

> On Tue, Oct 6, 2009 at 10:43 PM, Darren Salt
> <linux-Ym6Ivm/Ks7B65+NM0QMiFAbYiX8G1TQY9dF7HbQ/qKg@public.gmane.org> wrote:
>> This works around what I think is actually a bug in rt2860sta which is
>> triggered when the hardware "disappears" from beneath the driver, i.e.
>> when wireless is toggled off via ACPI. It does so by ensuring that the
>> rfkill soft-block flag is set before the hardware is disabled.

>> I do not know whether this patch is required if rt2800pci is in use
>> instead of rt2860sta; at the time of submission of this patch, I've not
>> been able to test this.

>> (Ref. http://bugzilla.kernel.org/show_bug.cgi?id=13390)
[snip]
> Did you test this patch with other hardware?

All that I've been able to test with is an Intel 3945, temporarily placed in
my 901. That seems fine anyway, and the patch doesn't affect it in any way.

> Can't we fix that directly in rt2860sta ?

Probably. One of us should bisect to see exactly where this happened;
however, for me, this workaround will do until that's done or rt2800pci is
working well enough (whichever happens first). And I think that I'd prefer
the latter.

-- 
| Darren Salt            | linux at youmustbejoking | nr. Ashington, | Doon
| using Debian GNU/Linux | or ds    ,demon,co,uk    | Northumberland | Army
|   Kill all extremists!

He looked at me as if I was a side dish he hadn't ordered.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-12 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mpro.kr41l600vf1lc0bg3.linux@youmustbejoking.demon.co.uk>
     [not found] ` <mpro.kr41l600vf1lc0bg3.linux-Ym6Ivm/Ks7B65+NM0QMiFAbYiX8G1TQY9dF7HbQ/qKg@public.gmane.org>
2009-10-06 21:18   ` [PATCH 2.6.32-rc3] Prevent a panic when disabling RT2860 wireless when associated Corentin Chary
     [not found]     ` <71cd59b00910061418o6a9e3e65n6365972ee0980780-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-12 20:53       ` Darren Salt

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.