public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dell-laptop: add parameter to disable the backlight device.
@ 2013-12-08 13:40 Alex Davis
  2013-12-08 14:06 ` Levente Kurusa
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Davis @ 2013-12-08 13:40 UTC (permalink / raw)
  To: mjg59@srcf.ucam.org, linux-kernel@vger.kernel.org

I have a Dell Inspiron N7010 Laptop with Intel graphics. When the dell-laptop module is loaded,
two backlight device devices are created; dell_backlight, and intel_backlight from the Intel
graphics driver. The dell_backlight device is non-functional, but the graphics subsystem uses
it instead of the functioning intel_backlight device. The result is that, when running KDE,
screen brightness cannot be controlled. I've added a module parameter, disable_backlight
which, when true, will disable the dell_backlight device, and leave only the intel_backlight:
with this, screen brightness can be controlled.

This patch is against 3.10.

Signed-off-by: Alex Davis <alex14641@yahoo.com>
--- dell-laptop.c.orig    2013-12-01 19:05:39.693149050 -0500
+++ dell-laptop.c    2013-12-01 17:29:27.613372482 -0500
@@ -35,6 +35,9 @@
 /* This structure will be modified by the firmware when we enter
  * system management mode, hence the volatiles */
 
+static bool disable_backlight;
+module_param(disable_backlight, bool, 0644);
+
 struct calling_interface_buffer {
     u16 class;
     u16 select;
@@ -561,6 +564,9 @@ static int __init dell_init(void)
 
     dell_laptop_dir = debugfs_create_dir("dell_laptop", NULL);
 
+    if (disable_backlight)
+        return 0;
+
 #ifdef CONFIG_ACPI
     /* In the event of an ACPI backlight being available, don't
      * register the platform controller.

 
I code, therefore I am

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

* Re: [PATCH] dell-laptop: add parameter to disable the backlight device.
  2013-12-08 13:40 [PATCH] dell-laptop: add parameter to disable the backlight device Alex Davis
@ 2013-12-08 14:06 ` Levente Kurusa
  2013-12-08 20:38   ` Alex Davis
  0 siblings, 1 reply; 4+ messages in thread
From: Levente Kurusa @ 2013-12-08 14:06 UTC (permalink / raw)
  To: Alex Davis, mjg59@srcf.ucam.org, linux-kernel@vger.kernel.org


2013-12-08 14:40, Alex Davis:
> I have a Dell Inspiron N7010 Laptop with Intel graphics. When the dell-laptop module is loaded,
> two backlight device devices are created; dell_backlight, and intel_backlight from the Intel
> graphics driver. The dell_backlight device is non-functional, but the graphics subsystem uses
> it instead of the functioning intel_backlight device. The result is that, when running KDE,
> screen brightness cannot be controlled. I've added a module parameter, disable_backlight
> which, when true, will disable the dell_backlight device, and leave only the intel_backlight:
> with this, screen brightness can be controlled.
>

Hi,

I think it would be better if we could figure out why the
dell_blacklight device is not working rather than disabling it.


Regarding your patch, it creates a memory leak as you:
  * allocate a platform device
  * you add it
  * you allocated a page for SMI

Your if(disable_blacklight) code should go
where it checks the DMI.

-- 
Regards,
Levente Kurusa

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

* Re: [PATCH] dell-laptop: add parameter to disable the backlight device.
  2013-12-08 14:06 ` Levente Kurusa
@ 2013-12-08 20:38   ` Alex Davis
  2013-12-08 23:43     ` Alex Davis
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Davis @ 2013-12-08 20:38 UTC (permalink / raw)
  To: mjg59@srcf.ucam.org, linux-kernel@vger.kernel.org, Levente Kurusa



--------------------------------------------
On Sun, 12/8/13, Levente Kurusa <levex@linux.com> wrote:

> Subject: Re: [PATCH] dell-laptop: add parameter to disable the backlight device.
> To: "Alex Davis" <alex14641@yahoo.com>, "mjg59@srcf.ucam.org" <mjg59@srcf.ucam.org>, >"linux->kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
> Date: Sunday, December 8, 2013, 9:06 AM
 
 
 >>2013-12-08 14:40, Alex Davis:
 >> I have a Dell Inspiron N7010 Laptop with Intel
 graphics. When the dell-laptop module is loaded,
 >> two backlight device devices are created;
 dell_backlight, and intel_backlight from the Intel
 >> graphics driver. The dell_backlight device is
 non-functional, but the graphics subsystem uses
 >> it instead of the functioning intel_backlight device.
 The result is that, when running KDE,
 >> screen brightness cannot be controlled. I've added a
 module parameter, disable_backlight
 >> which, when true, will disable the dell_backlight
 device, and leave only the intel_backlight:
 >> with this, screen brightness can be controlled.
 >> 
 
> Hi,
 
 >I think it would be better if we could figure out why the
 >dell_blacklight device is not working rather than disabling
 >it.
 
 
> Regarding your patch, it creates a memory leak as you:
>  * allocate a platform device
>  * you add it
>  * you allocated a page for SMI
> 
> Your if(disable_blacklight) code should go
> where it checks the DMI.
> 
> -- Regards,
> Levente Kurusa

Levante,

You are correct. The existing code also has a memory leak. I will submit a patch for that.


 

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

* Re: [PATCH] dell-laptop: add parameter to disable the backlight device.
  2013-12-08 20:38   ` Alex Davis
@ 2013-12-08 23:43     ` Alex Davis
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Davis @ 2013-12-08 23:43 UTC (permalink / raw)
  To: mjg59@srcf.ucam.org, linux-kernel@vger.kernel.org, Levente Kurusa


I code, therefore I am

--------------------------------------------
On Sun, 12/8/13, Alex Davis <alex14641@yahoo.com> wrote:

 Subject: Re: [PATCH] dell-laptop: add parameter to disable the backlight device.
 To: "mjg59@srcf.ucam.org" <mjg59@srcf.ucam.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "Levente Kurusa" <levex@linux.com>
 Date: Sunday, December 8, 2013, 3:38 PM
 
 
 
 --------------------------------------------
 On Sun, 12/8/13, Levente Kurusa <levex@linux.com>
 wrote:
 
 > Subject: Re: [PATCH] dell-laptop: add parameter to
 disable the backlight device.
 > To: "Alex Davis" <alex14641@yahoo.com>,
 "mjg59@srcf.ucam.org"
 <mjg59@srcf.ucam.org>,
 >"linux->kernel@vger.kernel.org"
 <linux-kernel@vger.kernel.org>
 > Date: Sunday, December 8, 2013, 9:06 AM
  
  
  >>2013-12-08 14:40, Alex Davis:
  >> I have a Dell Inspiron N7010 Laptop with Intel
  graphics. When the dell-laptop module is loaded,
  >> two backlight device devices are created;
  dell_backlight, and intel_backlight from the Intel
  >> graphics driver. The dell_backlight device is
  non-functional, but the graphics subsystem uses
  >> it instead of the functioning intel_backlight
 device.
  The result is that, when running KDE,
  >> screen brightness cannot be controlled. I've added
 a
  module parameter, disable_backlight
  >> which, when true, will disable the dell_backlight
  device, and leave only the intel_backlight:
  >> with this, screen brightness can be controlled.
  >> 
  
 > Hi,
  
  >I think it would be better if we could figure out why
 the
  >dell_blacklight device is not working rather than
 disabling
  >it.
  
  
 > Regarding your patch, it creates a memory leak as you:
 >  * allocate a platform device
 >  * you add it
 >  * you allocated a page for SMI
 > 
 > Your if(disable_blacklight) code should go
 > where it checks the DMI.
 > 
 > -- Regards,
 > Levente Kurusa
 
 Levante,
 
 >You are correct. The existing code also has a memory leak. I
 >will submit a patch for that.
 
Upon further investigation, I'm not seeing the memory leak. I see the objects being allocated, but they are deallocated in the dell_exit method. 
 
  
 

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

end of thread, other threads:[~2013-12-08 23:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-08 13:40 [PATCH] dell-laptop: add parameter to disable the backlight device Alex Davis
2013-12-08 14:06 ` Levente Kurusa
2013-12-08 20:38   ` Alex Davis
2013-12-08 23:43     ` Alex Davis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox