Return-path: <alan.christopher.jenkins@googlemail.com>
Envelope-to: preining@logic.at
Delivery-date: Fri, 25 Sep 2009 11:18:29 +0200
Received: from mx.logic.tuwien.ac.at ([128.130.175.19])
	by gamma.logic.tuwien.ac.at with esmtp (Exim 4.69)
	(envelope-from <alan.christopher.jenkins@googlemail.com>)
	id 1Mr6we-0003ug-VR
	for preining@logic.at; Fri, 25 Sep 2009 11:18:29 +0200
Received: from dspam by mx.logic.tuwien.ac.at with spam-scanned (Exim 4.69)
	(envelope-from <alan.christopher.jenkins@googlemail.com>)
	id 1Mr6we-0007sX-UD
	for preining@logic.at; Fri, 25 Sep 2009 11:18:28 +0200
Received: from mail-bw0-f206.google.com ([209.85.218.206])
	by mx.logic.tuwien.ac.at with esmtp (Exim 4.69)
	(envelope-from <alan.christopher.jenkins@googlemail.com>)
	id 1Mr6we-0007sQ-Q2
	for preining@logic.at; Fri, 25 Sep 2009 11:18:28 +0200
Received: by bwz2 with SMTP id 2so1874718bwz.23
        for <preining@logic.at>; Fri, 25 Sep 2009 02:18:23 -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:content-type
         :content-transfer-encoding;
        bh=LwWk89iEAG1NlmLy91MPmiG4i497Rvr4RlTOzGwlcy8=;
        b=v5NXcIUb2JpReRR4hjEMoYtEw0zWO05kZMZOihvPz15iYT9jRj+4l2rBmNlzZvGMMT
         03p8BPKc60BKTvQUTOyEkkWXjawqOEUaOyHxEuERVBZyVCSD/YxS+u9lWPNc/a4LWuiv
         3DloMeuhLWTq4QGuiMvtFxmL1+OKXmU6SnJcc=
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
         :content-type:content-transfer-encoding;
        b=sdO+ysONNKKfDPkndiYI5XJO62q8g2eVungoUAfng1IqDZSy3Dl8PZxiGNHsksWdK3
         A8wVmTiFXcnuWV3FQdjeLaRzgwmjP6R900SVKH48Baa/UzgldSZQeGKW9EjZampzhFW7
         bB/X8zDsY/NHsh3G9LFafFPqqCF3Xlol10WdA=
Received: by 10.204.8.72 with SMTP id g8mr3949652bkg.199.1253870303416;
        Fri, 25 Sep 2009 02:18:23 -0700 (PDT)
Received: from ?192.168.0.5? ([86.53.68.233])
        by mx.google.com with ESMTPS id k29sm531510fkk.57.2009.09.25.02.18.22
        (version=SSLv3 cipher=RC4-MD5);
        Fri, 25 Sep 2009 02:18:23 -0700 (PDT)
Sender: Alan Jenkins <alan.christopher.jenkins@googlemail.com>
Message-ID: <4ABC8ADD.3090803@tuffmail.co.uk>
Date: Fri, 25 Sep 2009 10:18:21 +0100
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
User-Agent: Thunderbird 2.0.0.21 (X11/20090318)
MIME-Version: 1.0
To: "John W. Linville" <linville@tuxdriver.com>
CC: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
 Mattia Dongili <malattia@linux.it>,
 Norbert Preining <preining@logic.at>
Subject: [PATCH] [RFT] sony-laptop: re-read the rfkill state when resuming
 from suspend
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-FILTER-DSPAM: by mx.logic.tuwien.ac.at 
X-DSPAM-Result: Whitelisted
X-DSPAM-Processed: Fri Sep 25 11:18:28 2009
X-DSPAM-Confidence: 0.8949
X-DSPAM-Improbability: 1 in 852 chance of being spam
X-DSPAM-Probability: 0.0000
X-DSPAM-Signature: 4abc8ae4302871591419864
X-DSPAM-Factors: 27,
	From*Alan Jenkins <alan-jenkins@tuffmail.co.uk>, 0.00069,
	switch, 0.00896,
	device), 0.01000,
	From*Alan, 0.01000,
	diff, 0.01000,
	static, 0.03076,
	off+by, 0.04656,
	Signed, 0.05753,
	uk>, 0.06426,
	CC*logic.at>, 0.08020,
	hardware, 0.08354,
	0+}, 0.11649,
	int, 0.12673,
	(and, 0.12860,
	Alan, 0.13643,
	restore, 0.14271,
	laptop, 0.14578,
	laptop, 0.14578,
	if+the, 0.15940,
	code, 0.18988,
	DKIM-Signature*h=domainkey, 0.19597,
	DKIM-Signature*signature, 0.19597,
	DKIM-Signature*sha256+c=relaxed/relaxed, 0.19601,
	DKIM-Signature*a=rsa+sha256, 0.19602,
	DKIM-Signature*sha256, 0.19624,
	DKIM-Signature*h=domainkey+signature, 0.20015,
	DomainKey-Signature*s=gamma, 0.20279

Without this, the hard-blocked state will be reported incorrectly if
the hardware switch is changed while the laptop is suspended.

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

Again, this is from code inspection only.  Since suspend/resume can
be tricky, please test that this change works (and is necessary).


diff a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1044,6 +1044,9 @@ static int sony_nc_resume(struct acpi_device *device)
 			sony_backlight_update_status(sony_backlight_device) < 0)
 		printk(KERN_WARNING DRV_PFX "unable to restore brightness level\n");
 
+	/* re-read rfkill state */
+	sony_nc_rfkill_update();
+
 	return 0;
 }
 

