sony-laptop: re-read the rfkill state when resuming from suspend
Subsystems (2)
PATCH 1/1 sony-laptop: re-read the rfkill state when resuming from suspend
Without this, the hard-blocked state will be reported incorrectly if the hardware switch is changed while the laptop is suspended.
--
Again, this is from code inspection only. Since suspend/resume can be tricky, please test that this change works (and is necessary).
drivers/platform/x86/sony-laptop.c +3 -0
@@ -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 ; }
Quoted 2 lines · Alan Jenkins
Without this, the hard-blocked state will be reported incorrectly if the hardware switch is changed while the laptop is suspended.
I confirm that with the old module (without that patch) after:
- having rfkill de-activated (so devices working)
- suspend to ram
- while suspended turn on rfkill (disable all devices)
- resume
the rfkill event shows:
RFKILL event: idx 0 type 1 op 0 soft 0 hard 0
RFKILL event: idx 1 type 2 op 0 soft 0 hard 0
RFKILL event: idx 2 type 5 op 0 soft 0 hard 0
RFKILL event: idx 4 type 1 op 0 soft 0 hard 1
so it didn't work.
Adding the patch after resume I have RFKILL event: idx 0 type 1 op 0 soft 0 hard 1 RFKILL event: idx 1 type 2 op 0 soft 0 hard 1 RFKILL event: idx 2 type 5 op 0 soft 0 hard 1 RFKILL event: idx 5 type 1 op 0 soft 0 hard 1
so that is fixed.
Quoted 13 lines
Signed-off-by Alan Jenkins <[email protected]>--
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.cb/drivers/platform/x86/sony-laptop.c
drivers/platform/x86/sony-laptop.c static int sony_nc_resume(struct acpi_device *device) · line 1052
Quoted 9 lines
drivers/platform/x86/sony-laptop.c +3
-0@@ -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 ; }
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining <[email protected]> Vienna University of Technology
Debian Developer <[email protected]> Debian TeX Group
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
HUTTOFT (n.)
The fibrous algae which grows in the dark, moist environment of trouser turn-ups.
--- Douglas Adams, The Meaning of Liff
Quoted 4 lines · Alan Jenkins
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 <[email protected]>
Thanks Alan.
Quoted 21 lines
--
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.cb/drivers/platform/x86/sony-laptop.cdrivers/platform/x86/sony-laptop.c +3
-0@@ -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 ; }
Signature · 2 lines
mattia :wq!