All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] eeepc-laptop: fix for 2.6.32-rc5
@ 2009-10-12 22:13 Corentin Chary
  2009-10-12 22:13 ` [PATCH 1/2] eeepc-laptop: Properly annote eeepc_enable_camera() Corentin Chary
  0 siblings, 1 reply; 6+ messages in thread
From: Corentin Chary @ 2009-10-12 22:13 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, Corentin Chary

Hi Len,
Here is 2 patchs for 2.6.32-rc5.
Sorry for the first batch, there was a typo and it was send to the wrong address.

Darren Salt (1):
  eeepc-laptop: Prevent a panic when disabling RT2860 wireless when
    associated

Rakib Mullick (1):
  eeepc-laptop: Properly annote eeepc_enable_camera().

 drivers/platform/x86/eeepc-laptop.c |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)


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

* [PATCH 1/2] eeepc-laptop: Properly annote eeepc_enable_camera().
  2009-10-12 22:13 [PATCH 0/2] eeepc-laptop: fix for 2.6.32-rc5 Corentin Chary
@ 2009-10-12 22:13 ` Corentin Chary
  2009-10-12 22:13   ` [PATCH 2/2] eeepc-laptop: Prevent a panic when disabling RT2860 wireless when associated Corentin Chary
  2009-10-13  5:25   ` [PATCH 1/2] eeepc-laptop: Properly annote eeepc_enable_camera() Len Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Corentin Chary @ 2009-10-12 22:13 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, Rakib Mullick, Corentin Chary

From: Rakib Mullick <rakib.mullick@gmail.com>

Currently the annotation for function eeepc_enable_camera() is
__init, and refers to a
function eeepc_hotk_add() which is non-init. Use __devinit for both
functions which is
more appropriate and fixes a section mismatch warning.

 We were warned by the following warning:

  LD      drivers/platform/x86/built-in.o
WARNING: drivers/platform/x86/built-in.o(.text+0x12e1): Section
mismatch in reference from the function eeepc_hotk_add() to the
function .init.text:eeepc_enable_camera()
The function eeepc_hotk_add() references
the function __init eeepc_enable_camera().
This is often because eeepc_hotk_add lacks a __init
annotation or the annotation of eeepc_enable_camera is wrong.

Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
Signed-off-by: Corentin Chary <corentincj@iksaif.net>
---
 drivers/platform/x86/eeepc-laptop.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index b77d758..879b2e9 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -351,7 +351,7 @@ static const struct rfkill_ops eeepc_rfkill_ops = {
 	.set_block = eeepc_rfkill_set,
 };
 
-static void __init eeepc_enable_camera(void)
+static void __devinit eeepc_enable_camera(void)
 {
 	/*
 	 * If the following call to set_acpi() fails, it's because there's no
@@ -1249,7 +1249,7 @@ static int eeepc_led_init(struct device *dev)
 	return 0;
 }
 
-static int eeepc_hotk_add(struct acpi_device *device)
+static int __devinit eeepc_hotk_add(struct acpi_device *device)
 {
 	struct device *dev;
 	int result;
-- 
1.6.5.rc2


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

* [PATCH 2/2] eeepc-laptop: Prevent a panic when disabling RT2860 wireless when associated
  2009-10-12 22:13 ` [PATCH 1/2] eeepc-laptop: Properly annote eeepc_enable_camera() Corentin Chary
@ 2009-10-12 22:13   ` Corentin Chary
  2009-10-13  5:26     ` Len Brown
  2009-10-13  5:25   ` [PATCH 1/2] eeepc-laptop: Properly annote eeepc_enable_camera() Len Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Corentin Chary @ 2009-10-12 22:13 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, Darren Salt

From: Darren Salt <linux@youmustbejoking.demon.co.uk>

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@youmustbejoking.demon.co.uk>
---
 drivers/platform/x86/eeepc-laptop.c |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 879b2e9..477d8c1 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -151,6 +151,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);
@@ -344,7 +346,16 @@ static bool eeepc_wlan_rfkill_blocked(void)
 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 = {
@@ -677,13 +688,13 @@ static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
 	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);
@@ -726,7 +737,7 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
 	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)
@@ -884,7 +895,7 @@ static int eeepc_hotk_restore(struct device *device)
 {
 	/* 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,
@@ -1027,7 +1038,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);
 
@@ -1151,7 +1162,7 @@ static int eeepc_rfkill_init(struct device *dev)
 	 * Refresh pci hotplug in case the rfkill state was changed during
 	 * setup.
 	 */
-	eeepc_rfkill_hotplug();
+	eeepc_rfkill_hotplug(true);
 
 exit:
 	if (result && result != -ENODEV)
-- 
1.6.5.rc2


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

* Re: [PATCH 1/2] eeepc-laptop: Properly annote eeepc_enable_camera().
  2009-10-12 22:13 ` [PATCH 1/2] eeepc-laptop: Properly annote eeepc_enable_camera() Corentin Chary
  2009-10-12 22:13   ` [PATCH 2/2] eeepc-laptop: Prevent a panic when disabling RT2860 wireless when associated Corentin Chary
@ 2009-10-13  5:25   ` Len Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Len Brown @ 2009-10-13  5:25 UTC (permalink / raw)
  To: Corentin Chary; +Cc: linux-acpi, Rakib Mullick

applied

thanks,
Len Brown, Intel Open Source Technology Center


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

* Re: [PATCH 2/2] eeepc-laptop: Prevent a panic when disabling RT2860 wireless when associated
  2009-10-12 22:13   ` [PATCH 2/2] eeepc-laptop: Prevent a panic when disabling RT2860 wireless when associated Corentin Chary
@ 2009-10-13  5:26     ` Len Brown
  2009-10-13  8:25       ` Corentin Chary
  0 siblings, 1 reply; 6+ messages in thread
From: Len Brown @ 2009-10-13  5:26 UTC (permalink / raw)
  To: Corentin Chary; +Cc: linux-acpi, Darren Salt

applied

thanks,
Len Brown, Intel Open Source Technology Center


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

* Re: [PATCH 2/2] eeepc-laptop: Prevent a panic when disabling RT2860 wireless when associated
  2009-10-13  5:26     ` Len Brown
@ 2009-10-13  8:25       ` Corentin Chary
  0 siblings, 0 replies; 6+ messages in thread
From: Corentin Chary @ 2009-10-13  8:25 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, Darren Salt

On Tue, Oct 13, 2009 at 7:26 AM, Len Brown <lenb@kernel.org> wrote:
> applied
>
> thanks,
> Len Brown, Intel Open Source Technology Center
>
>

Darren just reported:
> ... er, oops. I'd only forgotten to apply the patch to -rc4...
>
> I've re-tested and I get two results, depending on which card (and therefore
> driver) is in use. rt2860sta is fine with the patch as is, but iwl3945 isn't
> (eeepc_rfkill_set() needs to call eeepc_rfkill_hotplug(true) – which means
> that we're back to causing the rt2860sta panic :-|

Please revert this patch, Darren is currently trying to fix the
rt2860sta instead
Sorry for that :/

-- 
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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2009-10-13  8:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-12 22:13 [PATCH 0/2] eeepc-laptop: fix for 2.6.32-rc5 Corentin Chary
2009-10-12 22:13 ` [PATCH 1/2] eeepc-laptop: Properly annote eeepc_enable_camera() Corentin Chary
2009-10-12 22:13   ` [PATCH 2/2] eeepc-laptop: Prevent a panic when disabling RT2860 wireless when associated Corentin Chary
2009-10-13  5:26     ` Len Brown
2009-10-13  8:25       ` Corentin Chary
2009-10-13  5:25   ` [PATCH 1/2] eeepc-laptop: Properly annote eeepc_enable_camera() Len Brown

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.