From patchwork Mon Jun 29 13:27:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Jenkins X-Patchwork-Id: 32949 X-Patchwork-Delegate: corentincj@iksaif.net Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5TDS4lx004922 for ; Mon, 29 Jun 2009 13:28:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759143AbZF2N17 (ORCPT ); Mon, 29 Jun 2009 09:27:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759299AbZF2N17 (ORCPT ); Mon, 29 Jun 2009 09:27:59 -0400 Received: from mail-ew0-f210.google.com ([209.85.219.210]:63121 "EHLO mail-ew0-f210.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759143AbZF2N16 (ORCPT ); Mon, 29 Jun 2009 09:27:58 -0400 Received: by ewy6 with SMTP id 6so5623872ewy.37 for ; Mon, 29 Jun 2009 06:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=5BVWTmnKb8uzh2CeaZURNlbo96nCD3jTb77XARLcuzE=; b=bNcw1CdV6HzfMuJknxw8onNoFR+tjpNxStdBhQkrhBAdRl0Kdo3X07zNG/jTQ2yNWy QGJ1giKfqLKSDjTAF09UBKyHASPhKLGnBhFSsuEHOscEviwzU/4SbClDm5I4REn7F4jO KkRuytza1fdBOHOuNF7q1E9gO8cPiz8etQ/gA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=G8G2/UorynXDBGiKXvHA4xKrqn9H542i33riM6pNDvZAt0U2XU9x2uWDdjPBXdIYsl lyWoG17xC/qi0WjZ9aULhdl8awAyM44KbzxZmrP8DjatctcpdwDVl1PcYlc/d8jVuM7z faX0HYG45xrYbWKKjhcbiOei8PfzdyIqpl24o= Received: by 10.210.35.17 with SMTP id i17mr3082822ebi.72.1246282080026; Mon, 29 Jun 2009 06:28:00 -0700 (PDT) Received: from ?192.168.0.4? ([86.53.68.233]) by mx.google.com with ESMTPS id 28sm8100804eye.46.2009.06.29.06.27.58 (version=SSLv3 cipher=RC4-MD5); Mon, 29 Jun 2009 06:27:59 -0700 (PDT) Message-ID: <4A48C15C.3000509@tuffmail.co.uk> Date: Mon, 29 Jun 2009 14:27:56 +0100 From: Alan Jenkins User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: Corentin Chary CC: linux-acpi@vger.kernel.org, Matthew Garrett , Len Brown , Randy Dunlap Subject: [PATCH] eeepc-laptop: don't touch the pci slot if it was claimed by a different driver References: <1245990020-20455-1-git-send-email-lenb@kernel.org> <6af05c22969dce2776375953131b56e9f4282848.1245989983.git.len.brown@intel.com> <9b2b86520906290544g2f5d1da9m8539a5a6f67cf33c@mail.gmail.com> In-Reply-To: <9b2b86520906290544g2f5d1da9m8539a5a6f67cf33c@mail.gmail.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 Acked-by: Matthew Garrett --- 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)