All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: Corentin Chary <corentincj@iksaif.net>
Cc: linux-acpi@vger.kernel.org, Matthew Garrett <mjg@redhat.com>,
	Len Brown <len.brown@intel.com>,
	Randy Dunlap <randy.dunlap@oracle.com>
Subject: [PATCH] eeepc-laptop: don't touch the pci slot if it was claimed by a different driver
Date: Mon, 29 Jun 2009 14:27:56 +0100	[thread overview]
Message-ID: <4A48C15C.3000509@tuffmail.co.uk> (raw)
In-Reply-To: <9b2b86520906290544g2f5d1da9m8539a5a6f67cf33c@mail.gmail.com>

The whole point of registering as a PCI hotplug driver was to prevent
conflict with pciehp.  At the moment it happens to work because
eeepc-laptop is loaded first, but it doesn't work the other way round.
If pciehp is loaded first then we fail to claim the slot - we need to
respect this and not handle hotplug events.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---

IMO this is not an urgent patch - it's not a regression from 2.6.30. 
Given the number of other changes, I'd be happier if it could be held
back for 2.6.32.

 drivers/platform/x86/eeepc-laptop.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index 76dc3d9..faedee5 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -664,15 +664,20 @@ static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
 static void eeepc_hotplug_work(struct work_struct *work)
 {
 	struct pci_dev *dev;
-	struct pci_bus *bus = pci_find_bus(0, 1);
-	bool blocked;
+	struct pci_bus *bus;
+	bool blocked = eeepc_wlan_rfkill_blocked();
+
+	rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
 
+	if (ehotk->hotplug_slot == NULL)
+		return;
+
+	bus = pci_find_bus(0, 1);
 	if (!bus) {
 		pr_warning("Unable to find PCI bus 1?\n");
 		return;
 	}
 
-	blocked = eeepc_wlan_rfkill_blocked();
 	if (!blocked) {
 		dev = pci_get_slot(bus, 0);
 		if (dev) {
@@ -693,8 +698,6 @@ static void eeepc_hotplug_work(struct work_struct *work)
 			pci_dev_put(dev);
 		}
 	}
-
-	rfkill_set_sw_state(ehotk->wlan_rfkill, blocked);
 }
 
 static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
-- 
1.6.3.2




  reply	other threads:[~2009-06-29 13:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26  4:20 ACPI and driver patches for 2.6.31-rc1 Len Brown
2009-06-26  4:20 ` [PATCH 1/8] eeepc-laptop: Register as a pci-hotplug device Len Brown
2009-06-26  4:20   ` [PATCH 2/8] eeepc-laptop.c: use pr_fmt and pr_<level> Len Brown
2009-06-26  4:20   ` [PATCH 3/8] eeepc-laptop: rfkill refactoring Len Brown
2009-06-26  4:20   ` [PATCH 4/8] eeepc-laptop: right parent device Len Brown
2009-06-26  4:20   ` [PATCH 5/8] eeepc-laptop: makes get_acpi() returns -ENODEV Len Brown
2009-06-26  4:20   ` [PATCH 6/8] eeepc-laptop: get the right value for CMSG Len Brown
2009-06-26  4:20   ` [PATCH 7/8] eeepc-laptop: add rfkill support for the 3G modem in Eee PC 901 Go Len Brown
2009-06-26  4:20   ` [PATCH 8/8] ACPI: video: prevent NULL deref in acpi_get_pci_dev() Len Brown
2009-06-29 12:44   ` [PATCH 1/8] eeepc-laptop: Register as a pci-hotplug device Alan Jenkins
2009-06-29 13:27     ` Alan Jenkins [this message]
2009-06-29 19:22       ` [PATCH] eeepc-laptop: don't touch the pci slot if it was claimed by a different driver Matthew Garrett
2009-06-29 20:03         ` Corentin Chary

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=4A48C15C.3000509@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=corentincj@iksaif.net \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=randy.dunlap@oracle.com \
    /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.