Re: [PATCH v5 2/2] fbcon: Silence fbcon logo on 'quiet' boots

2019-04-02 Thread Prarit Bhargava


On 4/1/19 3:31 PM, Andreas Schwab wrote:
> On Jan 29 2019, Prarit Bhargava  wrote:
> 
>> @@ -1066,6 +1069,9 @@ static void fbcon_init(struct vc_data *vc, int init)
>>  
>>  cap = info->flags;
>>  
>> +if (console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
>> +logo_shown = FBCON_LOGO_DONTSHOW;
>> +
>>  if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
>>  (info->fix.type == FB_TYPE_TEXT))
>>  logo = 0;
> 
> This causes the scroll region to no longer be reset when the logo is
> removed.
> 

Andreas, my apologies but I'm not sure what you mean.  Could you elaborate on
the broken and expected behaviour?

I'm absolutely not disputing that there's a bug.

Thanks,

P.

> Andreas.
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH v5 2/2] fbcon: Silence fbcon logo on 'quiet' boots

2019-01-29 Thread Prarit Bhargava
On text-based systems the 'quiet' boot option will show printk levels
higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them.  Remove extra
bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export 
console_printk
v4: move console_printk change to separate patch, and drop logo cleanup
v5: Only set FBCON_LOGO_DONTSHOW for console loglevel

Signed-off-by: Prarit Bhargava 
Cc: Hans de Goede 
Cc: Marko Myllynen 
Cc: Steven Rostedt (VMware) 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Kees Cook 
Cc: Daniel Vetter 
Cc: Thierry Reding 
Cc: Yisheng Xie 
Cc: dri-devel@lists.freedesktop.org
---
 drivers/video/fbdev/core/fbcon.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index bfa1360ec750..59b626356983 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -656,11 +656,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct 
fb_info *info,
kfree(save);
}
 
+   if (logo_shown == FBCON_LOGO_DONTSHOW)
+   return;
+
if (logo_lines > vc->vc_bottom) {
logo_shown = FBCON_LOGO_CANSHOW;
printk(KERN_INFO
   "fbcon_init: disable boot-logo (boot-logo bigger than 
screen).\n");
-   } else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+   } else {
logo_shown = FBCON_LOGO_DRAW;
vc->vc_top = logo_lines;
}
@@ -1066,6 +1069,9 @@ static void fbcon_init(struct vc_data *vc, int init)
 
cap = info->flags;
 
+   if (console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
+   logo_shown = FBCON_LOGO_DONTSHOW;
+
if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
(info->fix.type == FB_TYPE_TEXT))
logo = 0;
-- 
2.17.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v5 0/2] Do not output logo on quiet boots

2019-01-29 Thread Prarit Bhargava
On text-based systems the 'quiet' boot option will show printk levels
higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them.  Remove extra
bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export 
console_printk
v4: move console_printk change to separate patch, and drop logo cleanup
v5: Only set FBCON_LOGO_DONTSHOW for console loglevel


Signed-off-by: Prarit Bhargava 
Cc: Hans de Goede 
Cc: Marko Myllynen 
Cc: Steven Rostedt (VMware) 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Kees Cook 
Cc: Daniel Vetter 
Cc: Thierry Reding 
Cc: Yisheng Xie 
Cc: Petr Mladek 
Cc: Sergey Senozhatsky 
Cc: dri-devel@lists.freedesktop.org

Prarit Bhargava (2):
  printk: Export console_printk
  fbcon: Silence fbcon logo on 'quiet' boots

 drivers/video/fbdev/core/fbcon.c | 8 +++-
 kernel/printk/printk.c   | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

-- 
2.17.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 0/2] Do not output logo on quiet boots

2019-01-10 Thread Prarit Bhargava
On text-based systems the 'quiet' boot option will show printk levels
higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them.  Remove extra
bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export 
console_printk
v4: move console_printk change to separate patch, and drop logo cleanup

Signed-off-by: Prarit Bhargava 
Cc: Hans de Goede 
Cc: Marko Myllynen 
Cc: Steven Rostedt (VMware) 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Kees Cook 
Cc: Daniel Vetter 
Cc: Thierry Reding 
Cc: Yisheng Xie 
Cc: Petr Mladek 
Cc: Sergey Senozhatsky 
Cc: dri-devel@lists.freedesktop.org

Prarit Bhargava (2):
  fbcon: Silence fbcon logo on 'quiet' boots
  printk: Export console_printk

 drivers/video/fbdev/core/fbcon.c | 11 ---
 kernel/printk/printk.c   |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

-- 
2.17.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 1/2] fbcon: Silence fbcon logo on 'quiet' boots

2019-01-10 Thread Prarit Bhargava
On text-based systems the 'quiet' boot option will show printk levels
higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them.  Remove extra
bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export 
console_printk
v4: move console_printk change to separate patch, and drop logo cleanup

Signed-off-by: Prarit Bhargava 
Cc: Hans de Goede 
Cc: Marko Myllynen 
Cc: Steven Rostedt (VMware) 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Kees Cook 
Cc: Daniel Vetter 
Cc: Thierry Reding 
Cc: Yisheng Xie 
Cc: Petr Mladek 
Cc: Sergey Senozhatsky 
Cc: dri-devel@lists.freedesktop.org
---
 drivers/video/fbdev/core/fbcon.c | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 8976190b6c1f..66e37bdff1d9 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct 
fb_info *info,
kfree(save);
}
 
+   if (logo_shown == FBCON_LOGO_DONTSHOW)
+   return;
+
if (logo_lines > vc->vc_bottom) {
logo_shown = FBCON_LOGO_CANSHOW;
printk(KERN_INFO
   "fbcon_init: disable boot-logo (boot-logo bigger than 
screen).\n");
-   } else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+   } else {
logo_shown = FBCON_LOGO_DRAW;
vc->vc_top = logo_lines;
}
@@ -1059,9 +1062,11 @@ static void fbcon_init(struct vc_data *vc, int init)
 
cap = info->flags;
 
-   if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
-   (info->fix.type == FB_TYPE_TEXT))
+   if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
+   (info->fix.type == FB_TYPE_TEXT)) {
logo = 0;
+   logo_shown = FBCON_LOGO_DONTSHOW;
+   }
 
if (var_to_display(p, >var, info))
return;
-- 
2.17.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v4 2/2] printk: Export console_printk

2019-01-10 Thread Prarit Bhargava
The fbcon code can be built as a module and requires console_printk.

Export console_printk.

Signed-off-by: Prarit Bhargava 
Cc: Petr Mladek 
Cc: Sergey Senozhatsky 
Cc: Hans de Goede 
Cc: Marko Myllynen 
Cc: Steven Rostedt (VMware) 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Kees Cook 
Cc: Daniel Vetter 
Cc: Thierry Reding 
Cc: Yisheng Xie 
Cc: Petr Mladek 
Cc: Sergey Senozhatsky 
Cc: dri-devel@lists.freedesktop.org
---
 kernel/printk/printk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index d3d170374ceb..8201019d1fff 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -65,6 +65,7 @@ int console_printk[4] = {
CONSOLE_LOGLEVEL_MIN,   /* minimum_console_loglevel */
CONSOLE_LOGLEVEL_DEFAULT,   /* default_console_loglevel */
 };
+EXPORT_SYMBOL_GPL(console_printk);
 
 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 EXPORT_SYMBOL(ignore_console_lock_warning);
-- 
2.17.2

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v3] fbcon: Silence fbcon logo on 'quiet' boots

2019-01-10 Thread Prarit Bhargava


On 1/2/19 11:05 AM, Petr Mladek wrote:
> On Thu 2018-12-20 17:31:57, Bartlomiej Zolnierkiewicz wrote:
>>
>> [ added Petr & Sergey to Cc: ]
>>
>> Hi,
>>
>> On 10/30/2018 04:44 PM, Prarit Bhargava wrote:
>>> On text-based systems the 'quiet' boot option will show printk levels
>>> higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
>>> during boot can cause some consoles to lose display data and as a result
>>> confuse the end user.
>>>
>>> Do not display the Tux logo on systems that are in 'quiet' boot.
>>>
>>> v2: It helps to commit all my changes before sending them.  Remove extra
>>> bracket.
>>> v3: buildbot error fix: fbcon can be built as part of a module so export 
>>> console_printk
>>>
>>> Signed-off-by: Prarit Bhargava 
>>> Cc: Hans de Goede 
>>> Cc: Marko Myllynen 
>>> Cc: Steven Rostedt (VMware) 
>>> Cc: Bartlomiej Zolnierkiewicz 
>>> Cc: Kees Cook 
>>> Cc: Daniel Vetter 
>>> Cc: Thierry Reding 
>>> Cc: Yisheng Xie 
>>> Cc: dri-devel@lists.freedesktop.org
>>> ---
>>>  drivers/video/fbdev/core/fbcon.c | 13 -
>>>  kernel/printk/printk.c   |  1 +
>>>  2 files changed, 9 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/video/fbdev/core/fbcon.c 
>>> b/drivers/video/fbdev/core/fbcon.c
>>> index 8958ccc8b1ac..08e092eaf45c 100644
>>> --- a/drivers/video/fbdev/core/fbcon.c
>>> +++ b/drivers/video/fbdev/core/fbcon.c
>>> @@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, 
>>> struct fb_info *info,
>>> kfree(save);
>>> }
>>>  
>>> +   if (logo_shown == FBCON_LOGO_DONTSHOW)
>>> +   return;
>>> +
>>> if (logo_lines > vc->vc_bottom) {
>>> logo_shown = FBCON_LOGO_CANSHOW;
>>> printk(KERN_INFO
>>>"fbcon_init: disable boot-logo (boot-logo bigger than 
>>> screen).\n");
>>> -   } else if (logo_shown != FBCON_LOGO_DONTSHOW) {
>>> +   } else {
>>> logo_shown = FBCON_LOGO_DRAW;
>>> vc->vc_top = logo_lines;
>>> }
>>> @@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int init)
>>> struct vc_data **default_mode = vc->vc_display_fg;
>>> struct vc_data *svc = *default_mode;
>>> struct display *t, *p = _display[vc->vc_num];
>>> -   int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
>>> +   int new_rows, new_cols, rows, cols, charcnt = 256;
>>> int cap, ret;
>>>  
>>> if (info_idx == -1 || info == NULL)
>>> @@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int init)
>>>  
>>> cap = info->flags;
>>>  
>>> -   if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
>>> +   if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
>>> (info->fix.type == FB_TYPE_TEXT))
>>> -   logo = 0;
>>> +   logo_shown = FBCON_LOGO_DONTSHOW;
>>
>> "logo" variable removal is an unrelated change which actually
>> changes the code behavior ("logo_shown" will be now modified
>> also for "vc != svc" and "info->fix.type == FB_TYPE_TEXT" cases).
>>
>> Please either drop it or explain in the patch description why
>> it is a safe thing to do.
> 

Hi Petr, I will drop it from the patch.

P.

> Good question! I am not familiar with fbcon code but it seems
> that there might be more instances and they share the behavior
> via this variable.
> 
> Note that console_loglevel might get modified at anytime. What if
> the first fbcon was initialized with a different loglevel?
> 
> 
>>> if (var_to_display(p, >var, info))
>>> return;
>>> @@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int init)
>>> } else
>>> vc_resize(vc, new_cols, new_rows);
>>>  
>>> -   if (logo)
>>> +   if (logo_shown != FBCON_LOGO_DONTSHOW)
>>> fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
>>>  
>>> if (vc == svc && softback_buf)
>>> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
>>> index b77150ad1965..391e390feac9 100644
>>> --- a/kernel/printk/printk.c
>>> +++ b/kernel/printk/printk.c
>>> @@ -66,6 +66,7 @@ int console_printk[4] = {
>>> CONSOLE_LOGLEVEL_MIN,   /* minimum_console_loglevel */
>>> CONSOLE_LOGLEVEL_DEFAULT,   /* default_console_loglevel */
>>>  };
>>> +EXPORT_SYMBOL(console_printk);
>>
>> You need printk Maintainers Ack on it.
> 
> I am fine with the added export (as a printk maintainer).
> 
> Best Regards,
> Petr
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [kbuild-all] [PATCH] fbcon: Silence fbcon logo on 'quiet' boots

2018-11-12 Thread Prarit Bhargava


On 11/11/2018 10:18 PM, Rong Chen wrote:
> 
> 
> On 10/29/2018 11:15 PM, Prarit Bhargava wrote:
>>
>> On 10/29/2018 09:56 AM, kbuild test robot wrote:
>>> Hi Prarit,
>>>
>>> Thank you for the patch! Yet something to improve:
>>>
>>> [auto build test ERROR on sof-driver-fuweitax/master]
>>> [also build test ERROR on v4.19 next-20181029]
>>> [if your patch is applied to the wrong git tree, please drop us a note to
>>> help improve the system]
>>>
>>> url:   
>>> https://github.com/0day-ci/linux/commits/Prarit-Bhargava/fbcon-Silence-fbcon-logo-on-quiet-boots/20181029-211617
>>>
>>> base:   https://github.com/fuweitax/linux master
>>> config: m68k-multi_defconfig (attached as .config)
>>> compiler: m68k-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
>>> reproduce:
>>>  wget
>>> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
>>> ~/bin/make.cross
>>>  chmod +x ~/bin/make.cross
>>>  # save the attached .config to linux build tree
>>>  GCC_VERSION=7.2.0 make.cross ARCH=m68k
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>> drivers/video/fbdev/core/fbcon.c: In function 'fbcon_prepare_logo':
>>> drivers/video/fbdev/core/fbcon.c:680:13: error: invalid storage class 
>>> for
>>> function 'set_blitting_type'
>>>  static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
>>>  ^
>>> drivers/video/fbdev/core/fbcon.c:680:1: warning: ISO C90 forbids mixed
>>> declarations and code [-Wdeclaration-after-statement]
>>>  static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
>>>  ^~
>>> drivers/video/fbdev/core/fbcon.c:690:12: error: invalid storage class 
>>> for
>>> function 'fbcon_invalid_charcount'
>>>  static int fbcon_invalid_charcount(struct fb_info *info, unsigned
>>> charcount)
>>> ^~~
>>> drivers/video/fbdev/core/fbcon.c:698:12: error: invalid storage class 
>>> for
>>> function 'con2fb_acquire_newinfo'
>>>  static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info 
>>> *info,
>>> ^~
>>> drivers/video/fbdev/core/fbcon.c:734:12: error: invalid storage class 
>>> for
>>> function 'con2fb_release_oldinfo'
>>>  static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info
>>> *oldinfo,
>>> ^~
>>> drivers/video/fbdev/core/fbcon.c:780:13: error: invalid storage class 
>>> for
>>> function 'con2fb_init_display'
>>>  static void con2fb_init_display(struct vc_data *vc, struct fb_info 
>>> *info,
>>>  ^~~
>>> drivers/video/fbdev/core/fbcon.c:825:12: error: invalid storage class 
>>> for
>>> function 'set_con2fb_map'
>>>  static int set_con2fb_map(int unit, int newidx, int user)
>>> ^~
>>> drivers/video/fbdev/core/fbcon.c:882:12: error: invalid storage class 
>>> for
>>> function 'var_to_display'
>>>  static int var_to_display(struct display *disp,
>>> ^~
>>> drivers/video/fbdev/core/fbcon.c:906:13: error: invalid storage class 
>>> for
>>> function 'display_to_var'
>>>  static void display_to_var(struct fb_var_screeninfo *var,
>>>  ^~
>>> drivers/video/fbdev/core/fbcon.c:925:20: error: invalid storage class 
>>> for
>>> function 'fbcon_startup'
>>>  static const char *fbcon_startup(void)
>>> ^
>>> drivers/video/fbdev/core/fbcon.c:1036:13: error: invalid storage class
>>> for function 'fbcon_init'
>>>  static void fbcon_init(struct vc_data *vc, int init)
>>>  ^~
>>> drivers/video/fbdev/core/fbcon.c:1183:13: error: invalid storage class
>>> for function 'fbcon_free_font'
>>>  static void fbcon_free_font(struct display *p, bool freefont)
>>>  ^~~
>>> drivers/video/fbdev/core/fbcon.c:1191:13: error: invalid storage class
>>> for function 'set_vc_hi_font'
>>>  static void set_vc_hi_font(struct vc_data *vc, bool set);
>>>  ^~

Re: [PATCH v3] fbcon: Silence fbcon logo on 'quiet' boots

2018-10-30 Thread Prarit Bhargava


On 10/30/2018 05:35 PM, Steven Rostedt wrote:
> I guess you we not very productive with that first patch ;-)
> 

Hah :) It was a LONG day. :)

P.

> -- Steve
> 
> 
> On October 30, 2018 5:44:19 PM GMT+02:00, Prarit Bhargava  
> wrote:
>> On text-based systems the 'quiet' boot option will show printk levels
>> higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
>> during boot can cause some consoles to lose display data and as a
>> result
>> confuse the end user.
>>
>> Do not display the Tux logo on systems that are in 'quiet' boot.
>>
>> v2: It helps to commit all my changes before sending them.  Remove
>> extra
>> bracket.
>> v3: buildbot error fix: fbcon can be built as part of a module so
>> export console_printk
>>
>> Signed-off-by: Prarit Bhargava 
>> Cc: Hans de Goede 
>> Cc: Marko Myllynen 
>> Cc: Steven Rostedt (VMware) 
>> Cc: Bartlomiej Zolnierkiewicz 
>> Cc: Kees Cook 
>> Cc: Daniel Vetter 
>> Cc: Thierry Reding 
>> Cc: Yisheng Xie 
>> Cc: dri-devel@lists.freedesktop.org
>> ---
>> drivers/video/fbdev/core/fbcon.c | 13 -
>> kernel/printk/printk.c   |  1 +
>> 2 files changed, 9 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/core/fbcon.c
>> b/drivers/video/fbdev/core/fbcon.c
>> index 8958ccc8b1ac..08e092eaf45c 100644
>> --- a/drivers/video/fbdev/core/fbcon.c
>> +++ b/drivers/video/fbdev/core/fbcon.c
>> @@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data
>> *vc, struct fb_info *info,
>>  kfree(save);
>>  }
>>
>> +if (logo_shown == FBCON_LOGO_DONTSHOW)
>> +return;
>> +
>>  if (logo_lines > vc->vc_bottom) {
>>  logo_shown = FBCON_LOGO_CANSHOW;
>>  printk(KERN_INFO
>> "fbcon_init: disable boot-logo (boot-logo bigger than
>> screen).\n");
>> -} else if (logo_shown != FBCON_LOGO_DONTSHOW) {
>> +} else {
>>  logo_shown = FBCON_LOGO_DRAW;
>>  vc->vc_top = logo_lines;
>>  }
>> @@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int
>> init)
>>  struct vc_data **default_mode = vc->vc_display_fg;
>>  struct vc_data *svc = *default_mode;
>>  struct display *t, *p = _display[vc->vc_num];
>> -int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
>> +int new_rows, new_cols, rows, cols, charcnt = 256;
>>  int cap, ret;
>>
>>  if (info_idx == -1 || info == NULL)
>> @@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int
>> init)
>>
>>  cap = info->flags;
>>
>> -if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
>> +if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
>>  (info->fix.type == FB_TYPE_TEXT))
>> -logo = 0;
>> +logo_shown = FBCON_LOGO_DONTSHOW;
>>
>>  if (var_to_display(p, >var, info))
>>  return;
>> @@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int
>> init)
>>  } else
>>  vc_resize(vc, new_cols, new_rows);
>>
>> -if (logo)
>> +if (logo_shown != FBCON_LOGO_DONTSHOW)
>>  fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
>>
>>  if (vc == svc && softback_buf)
>> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
>> index b77150ad1965..391e390feac9 100644
>> --- a/kernel/printk/printk.c
>> +++ b/kernel/printk/printk.c
>> @@ -66,6 +66,7 @@ int console_printk[4] = {
>>  CONSOLE_LOGLEVEL_MIN,   /* minimum_console_loglevel */
>>  CONSOLE_LOGLEVEL_DEFAULT,   /* default_console_loglevel */
>> };
>> +EXPORT_SYMBOL(console_printk);
>>
>> atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
>> EXPORT_SYMBOL(ignore_console_lock_warning);
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3] fbcon: Silence fbcon logo on 'quiet' boots

2018-10-30 Thread Prarit Bhargava
On text-based systems the 'quiet' boot option will show printk levels
higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them.  Remove extra
bracket.
v3: buildbot error fix: fbcon can be built as part of a module so export 
console_printk

Signed-off-by: Prarit Bhargava 
Cc: Hans de Goede 
Cc: Marko Myllynen 
Cc: Steven Rostedt (VMware) 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Kees Cook 
Cc: Daniel Vetter 
Cc: Thierry Reding 
Cc: Yisheng Xie 
Cc: dri-devel@lists.freedesktop.org
---
 drivers/video/fbdev/core/fbcon.c | 13 -
 kernel/printk/printk.c   |  1 +
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 8958ccc8b1ac..08e092eaf45c 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -649,11 +649,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct 
fb_info *info,
kfree(save);
}
 
+   if (logo_shown == FBCON_LOGO_DONTSHOW)
+   return;
+
if (logo_lines > vc->vc_bottom) {
logo_shown = FBCON_LOGO_CANSHOW;
printk(KERN_INFO
   "fbcon_init: disable boot-logo (boot-logo bigger than 
screen).\n");
-   } else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+   } else {
logo_shown = FBCON_LOGO_DRAW;
vc->vc_top = logo_lines;
}
@@ -1051,7 +1054,7 @@ static void fbcon_init(struct vc_data *vc, int init)
struct vc_data **default_mode = vc->vc_display_fg;
struct vc_data *svc = *default_mode;
struct display *t, *p = _display[vc->vc_num];
-   int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+   int new_rows, new_cols, rows, cols, charcnt = 256;
int cap, ret;
 
if (info_idx == -1 || info == NULL)
@@ -1059,9 +1062,9 @@ static void fbcon_init(struct vc_data *vc, int init)
 
cap = info->flags;
 
-   if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
+   if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
(info->fix.type == FB_TYPE_TEXT))
-   logo = 0;
+   logo_shown = FBCON_LOGO_DONTSHOW;
 
if (var_to_display(p, >var, info))
return;
@@ -1176,7 +1179,7 @@ static void fbcon_init(struct vc_data *vc, int init)
} else
vc_resize(vc, new_cols, new_rows);
 
-   if (logo)
+   if (logo_shown != FBCON_LOGO_DONTSHOW)
fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
if (vc == svc && softback_buf)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index b77150ad1965..391e390feac9 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -66,6 +66,7 @@ int console_printk[4] = {
CONSOLE_LOGLEVEL_MIN,   /* minimum_console_loglevel */
CONSOLE_LOGLEVEL_DEFAULT,   /* default_console_loglevel */
 };
+EXPORT_SYMBOL(console_printk);
 
 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 EXPORT_SYMBOL(ignore_console_lock_warning);
-- 
2.14.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v2] fbcon: Silence fbcon logo on 'quiet' boots

2018-10-29 Thread Prarit Bhargava
A variant of this patch has been in Fedora since at least 2010 and
AFAWCT there haven't been any complaints about the change in behavior.

https://src.fedoraproject.org/cgit/rpms/kernel.git/tree/silence-fbcon-logo.patch

P.

---8<---

On text-based systems the 'quiet' boot option will show printk levels
higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

v2: It helps to commit all my changes before sending them.  Remove extra
bracket.

Signed-off-by: Prarit Bhargava 
Cc: Hans de Goede 
Cc: Marko Myllynen 
Cc: Steven Rostedt (VMware) 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Kees Cook 
Cc: Daniel Vetter 
Cc: Thierry Reding 
Cc: Yisheng Xie 
Cc: dri-devel@lists.freedesktop.org
---
 drivers/video/fbdev/core/fbcon.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 75ebbbf0a1fb..53fc151f3f7b 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -650,11 +650,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct 
fb_info *info,
kfree(save);
}
 
+   if (logo_shown == FBCON_LOGO_DONTSHOW)
+   return;
+
if (logo_lines > vc->vc_bottom) {
logo_shown = FBCON_LOGO_CANSHOW;
printk(KERN_INFO
   "fbcon_init: disable boot-logo (boot-logo bigger than 
screen).\n");
-   } else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+   } else {
logo_shown = FBCON_LOGO_DRAW;
vc->vc_top = logo_lines;
}
@@ -1052,7 +1055,7 @@ static void fbcon_init(struct vc_data *vc, int init)
struct vc_data **default_mode = vc->vc_display_fg;
struct vc_data *svc = *default_mode;
struct display *t, *p = _display[vc->vc_num];
-   int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+   int new_rows, new_cols, rows, cols, charcnt = 256;
int cap, ret;
 
if (info_idx == -1 || info == NULL)
@@ -1060,9 +1063,9 @@ static void fbcon_init(struct vc_data *vc, int init)
 
cap = info->flags;
 
-   if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
+   if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
(info->fix.type == FB_TYPE_TEXT))
-   logo = 0;
+   logo_shown = FBCON_LOGO_DONTSHOW;
 
if (var_to_display(p, >var, info))
return;
@@ -1178,7 +1181,7 @@ static void fbcon_init(struct vc_data *vc, int init)
} else
vc_resize(vc, new_cols, new_rows);
 
-   if (logo)
+   if (logo_shown != FBCON_LOGO_DONTSHOW)
fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
if (vc == svc && softback_buf)
-- 
2.14.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] fbcon: Silence fbcon logo on 'quiet' boots

2018-10-29 Thread Prarit Bhargava


On 10/29/2018 11:24 AM, Thierry Reding wrote:
> On Mon, Oct 29, 2018 at 09:02:32AM -0400, Prarit Bhargava wrote:
>> A variant of this patch has been in Fedora since at least 2010 and
>> AFAWCT there haven't been any complaints about the change in behavior.
>>
>> https://src.fedoraproject.org/cgit/rpms/kernel.git/tree/silence-fbcon-logo.patch
>>
>> P.
>>
>> ---8<---
>>
>> On text-based systems the 'quiet' boot option will show printk levels
>> higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
>> during boot can cause some consoles to lose display data and as a result
>> confuse the end user.
>>
>> Do not display the Tux logo on systems that are in 'quiet' boot.
>>
>> Signed-off-by: Prarit Bhargava 
>> Cc: Hans de Goede 
>> Cc: Marko Myllynen 
>> Cc: Bartlomiej Zolnierkiewicz 
>> Cc: Kees Cook 
>> Cc: Daniel Vetter 
>> Cc: Thierry Reding 
>> Cc: Yisheng Xie 
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: Steven Rostedt (VMware) 
>> ---
>>  drivers/video/fbdev/core/fbcon.c | 13 -
>>  1 file changed, 8 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/core/fbcon.c 
>> b/drivers/video/fbdev/core/fbcon.c
>> index 75ebbbf0a1fb..a2f2c7ea11ef 100644
>> --- a/drivers/video/fbdev/core/fbcon.c
>> +++ b/drivers/video/fbdev/core/fbcon.c
>> @@ -650,11 +650,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, 
>> struct fb_info *info,
>>  kfree(save);
>>  }
>>  
>> +if (logo_shown == FBCON_LOGO_DONTSHOW) {
>> +return;
>> +
> 
> You're missing a closing } here (well, you really shouldn't have the
> opening { in the first place since this is a single line block.
> 
> That's what's causing the warnings from the 0-day builder.

Will send v2.

P.

> 
> Thierry
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] fbcon: Silence fbcon logo on 'quiet' boots

2018-10-29 Thread Prarit Bhargava


On 10/29/2018 09:56 AM, kbuild test robot wrote:
> Hi Prarit,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on sof-driver-fuweitax/master]
> [also build test ERROR on v4.19 next-20181029]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Prarit-Bhargava/fbcon-Silence-fbcon-logo-on-quiet-boots/20181029-211617
> base:   https://github.com/fuweitax/linux master
> config: m68k-multi_defconfig (attached as .config)
> compiler: m68k-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> GCC_VERSION=7.2.0 make.cross ARCH=m68k 
> 
> All errors (new ones prefixed by >>):
> 
>drivers/video/fbdev/core/fbcon.c: In function 'fbcon_prepare_logo':
>drivers/video/fbdev/core/fbcon.c:680:13: error: invalid storage class for 
> function 'set_blitting_type'
> static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
> ^
>drivers/video/fbdev/core/fbcon.c:680:1: warning: ISO C90 forbids mixed 
> declarations and code [-Wdeclaration-after-statement]
> static void set_blitting_type(struct vc_data *vc, struct fb_info *info)
> ^~
>drivers/video/fbdev/core/fbcon.c:690:12: error: invalid storage class for 
> function 'fbcon_invalid_charcount'
> static int fbcon_invalid_charcount(struct fb_info *info, unsigned 
> charcount)
>^~~
>drivers/video/fbdev/core/fbcon.c:698:12: error: invalid storage class for 
> function 'con2fb_acquire_newinfo'
> static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info 
> *info,
>^~
>drivers/video/fbdev/core/fbcon.c:734:12: error: invalid storage class for 
> function 'con2fb_release_oldinfo'
> static int con2fb_release_oldinfo(struct vc_data *vc, struct fb_info 
> *oldinfo,
>^~
>drivers/video/fbdev/core/fbcon.c:780:13: error: invalid storage class for 
> function 'con2fb_init_display'
> static void con2fb_init_display(struct vc_data *vc, struct fb_info *info,
> ^~~
>drivers/video/fbdev/core/fbcon.c:825:12: error: invalid storage class for 
> function 'set_con2fb_map'
> static int set_con2fb_map(int unit, int newidx, int user)
>^~
>drivers/video/fbdev/core/fbcon.c:882:12: error: invalid storage class for 
> function 'var_to_display'
> static int var_to_display(struct display *disp,
>^~
>drivers/video/fbdev/core/fbcon.c:906:13: error: invalid storage class for 
> function 'display_to_var'
> static void display_to_var(struct fb_var_screeninfo *var,
> ^~
>drivers/video/fbdev/core/fbcon.c:925:20: error: invalid storage class for 
> function 'fbcon_startup'
> static const char *fbcon_startup(void)
>^
>drivers/video/fbdev/core/fbcon.c:1036:13: error: invalid storage class for 
> function 'fbcon_init'
> static void fbcon_init(struct vc_data *vc, int init)
> ^~
>drivers/video/fbdev/core/fbcon.c:1183:13: error: invalid storage class for 
> function 'fbcon_free_font'
> static void fbcon_free_font(struct display *p, bool freefont)
> ^~~
>drivers/video/fbdev/core/fbcon.c:1191:13: error: invalid storage class for 
> function 'set_vc_hi_font'
> static void set_vc_hi_font(struct vc_data *vc, bool set);
> ^~
>drivers/video/fbdev/core/fbcon.c:1193:13: error: invalid storage class for 
> function 'fbcon_deinit'
> static void fbcon_deinit(struct vc_data *vc)
> ^~~~
>drivers/video/fbdev/core/fbcon.c: In function 'fbcon_deinit':
>>> drivers/video/fbdev/core/fbcon.c:1229:3: error: implicit declaration of 
>>> function 'set_vc_hi_font'; did you mean 'seq_path_root'? 
>>> [-Werror=implicit-function-declaration]
>   set_vc_hi_font(vc, false);
>   ^~

Hmm ... this doesn't look like anything that is at fault with my patch.

There's a lot of warnings here, and perhaps another fix is required to make
sure that the configs are set correctly?  I can certainly take a look in
another patch but AFAICT this isn't an issue with my patch.

P.

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] fbcon: Silence fbcon logo on 'quiet' boots

2018-10-29 Thread Prarit Bhargava
A variant of this patch has been in Fedora since at least 2010 and
AFAWCT there haven't been any complaints about the change in behavior.

https://src.fedoraproject.org/cgit/rpms/kernel.git/tree/silence-fbcon-logo.patch

P.

---8<---

On text-based systems the 'quiet' boot option will show printk levels
higher than CONSOLE_LOGLEVEL_QUIET.  The displaying of the Tux logo
during boot can cause some consoles to lose display data and as a result
confuse the end user.

Do not display the Tux logo on systems that are in 'quiet' boot.

Signed-off-by: Prarit Bhargava 
Cc: Hans de Goede 
Cc: Marko Myllynen 
Cc: Bartlomiej Zolnierkiewicz 
Cc: Kees Cook 
Cc: Daniel Vetter 
Cc: Thierry Reding 
Cc: Yisheng Xie 
Cc: dri-devel@lists.freedesktop.org
Cc: Steven Rostedt (VMware) 
---
 drivers/video/fbdev/core/fbcon.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 75ebbbf0a1fb..a2f2c7ea11ef 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -650,11 +650,14 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct 
fb_info *info,
kfree(save);
}
 
+   if (logo_shown == FBCON_LOGO_DONTSHOW) {
+   return;
+
if (logo_lines > vc->vc_bottom) {
logo_shown = FBCON_LOGO_CANSHOW;
printk(KERN_INFO
   "fbcon_init: disable boot-logo (boot-logo bigger than 
screen).\n");
-   } else if (logo_shown != FBCON_LOGO_DONTSHOW) {
+   } else {
logo_shown = FBCON_LOGO_DRAW;
vc->vc_top = logo_lines;
}
@@ -1052,7 +1055,7 @@ static void fbcon_init(struct vc_data *vc, int init)
struct vc_data **default_mode = vc->vc_display_fg;
struct vc_data *svc = *default_mode;
struct display *t, *p = _display[vc->vc_num];
-   int logo = 1, new_rows, new_cols, rows, cols, charcnt = 256;
+   int new_rows, new_cols, rows, cols, charcnt = 256;
int cap, ret;
 
if (info_idx == -1 || info == NULL)
@@ -1060,9 +1063,9 @@ static void fbcon_init(struct vc_data *vc, int init)
 
cap = info->flags;
 
-   if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
+   if (vc != svc || console_loglevel <= CONSOLE_LOGLEVEL_QUIET ||
(info->fix.type == FB_TYPE_TEXT))
-   logo = 0;
+   logo_shown = FBCON_LOGO_DONTSHOW;
 
if (var_to_display(p, >var, info))
return;
@@ -1178,7 +1181,7 @@ static void fbcon_init(struct vc_data *vc, int init)
} else
vc_resize(vc, new_cols, new_rows);
 
-   if (logo)
+   if (logo_shown != FBCON_LOGO_DONTSHOW)
fbcon_prepare_logo(vc, info, cols, rows, new_cols, new_rows);
 
if (vc == svc && softback_buf)
-- 
2.14.5

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH] drm, ttm Fix uninitialized warning

2013-09-13 Thread Prarit Bhargava
Fix uninitialized warning.

drivers/gpu/drm/ttm/ttm_object.c: In function ‘ttm_base_object_lookup’:
drivers/gpu/drm/ttm/ttm_object.c:213:10: error: ‘base’ may be used 
uninitialized in this function [-Werror=maybe-uninitialized]
  kref_put(base-refcount, ttm_release_base);
  ^
drivers/gpu/drm/ttm/ttm_object.c:221:26: note: ‘base’ was declared here
  struct ttm_base_object *base;

Signed-off-by: Prarit Bhargava pra...@redhat.com
Cc: David Airlie airl...@linux.ie
Cc: rcl...@redhat.com
---
 drivers/gpu/drm/ttm/ttm_object.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ttm/ttm_object.c b/drivers/gpu/drm/ttm/ttm_object.c
index 58a5f32..a868176 100644
--- a/drivers/gpu/drm/ttm/ttm_object.c
+++ b/drivers/gpu/drm/ttm/ttm_object.c
@@ -218,7 +218,7 @@ struct ttm_base_object *ttm_base_object_lookup(struct 
ttm_object_file *tfile,
   uint32_t key)
 {
struct ttm_object_device *tdev = tfile-tdev;
-   struct ttm_base_object *base;
+   struct ttm_base_object *uninitialized_var(base);
struct drm_hash_item *hash;
int ret;
 
-- 
1.7.9.3

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 34/34] Remove old DMI & SMBIOS code and make SMBIOS default on

2011-07-18 Thread Prarit Bhargava
This code has now been completely replaced by the new System Firmware
Interface (SYSFW) and SMBIOS code.  It is no longer needed in the kernel.

Cc: linux-ia64 at vger.kernel.org
Cc: x86 at kernel.org
Cc: linux-acpi at vger.kernel.org
Cc: linux-ide at vger.kernel.org
Cc: openipmi-developer at lists.sourceforge.net
Cc: platform-driver-x86 at vger.kernel.org
Cc: linux-crypto at vger.kernel.org
Cc: dri-devel at lists.freedesktop.org
Cc: lm-sensors at lm-sensors.org
Cc: linux-i2c at vger.kernel.org
Cc: linux-ide at vger.kernel.org
Cc: linux-input at vger.kernel.org
Cc: linux-media at vger.kernel.org
Cc: netdev at vger.kernel.org
Cc: linux-pci at vger.kernel.org
Cc: rtc-linux at googlegroups.com
Cc: evel at driverdev.osuosl.org
Cc: linux-usb at vger.kernel.org
Cc: device-drivers-devel at blackfin.uclinux.org
Cc: linux-watchdog at vger.kernel.org
Cc: grant.likely at secretlab.ca
Cc: dz at debian.org
Cc: rpurdie at rpsys.net
Cc: eric.piel at tremplin-utc.net
Cc: abelay at mit.edu
Cc: johnpol at 2ka.mipt.ru
Signed-off-by: Prarit Bhargava 
---
 arch/ia64/include/asm/dmi.h |   12 -
 arch/x86/Kconfig|9 -
 arch/x86/include/asm/dmi.h  |   19 -
 drivers/firmware/Kconfig|   20 -
 drivers/firmware/Makefile   |3 -
 drivers/firmware/dmi-id.c   |  245 -
 drivers/firmware/dmi-sysfs.c|  696 
 drivers/firmware/dmi_scan.c |  751 ---
 include/linux/dmi.h |  139 ---
 include/linux/mod_devicetable.h |   55 ---
 10 files changed, 0 insertions(+), 1949 deletions(-)
 delete mode 100644 arch/ia64/include/asm/dmi.h
 delete mode 100644 arch/x86/include/asm/dmi.h
 delete mode 100644 drivers/firmware/dmi-id.c
 delete mode 100644 drivers/firmware/dmi-sysfs.c
 delete mode 100644 drivers/firmware/dmi_scan.c
 delete mode 100644 include/linux/dmi.h

diff --git a/arch/ia64/include/asm/dmi.h b/arch/ia64/include/asm/dmi.h
deleted file mode 100644
index 1ed4c8f..000
--- a/arch/ia64/include/asm/dmi.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_DMI_H
-#define _ASM_DMI_H 1
-
-#include 
-#include 
-
-/* Use normal IO mappings for DMI */
-#define dmi_ioremap ioremap
-#define dmi_iounmap(x,l) iounmap(x)
-#define dmi_alloc(l) kmalloc(l, GFP_ATOMIC)
-
-#endif
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e7cdde8..92ee12b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -626,15 +626,6 @@ config APB_TIMER

 # Mark as expert because too many people got it wrong.
 # The code disables itself when not needed.
-config DMI
-   default y
-   bool "Enable DMI scanning" if EXPERT
-   ---help---
- Enabled scanning of DMI to identify machine quirks. Say Y
- here unless you have verified that your setup is not
- affected by entries in the DMI blacklist. Required by PNP
- BIOS code.
-
 config SMBIOS
depends on SYSTEM_FIRMWARE
bool "Enable SMBIOS scanning" if EXPERT
diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h
deleted file mode 100644
index fd8f9e2..000
--- a/arch/x86/include/asm/dmi.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _ASM_X86_DMI_H
-#define _ASM_X86_DMI_H
-
-#include 
-#include 
-
-#include 
-#include 
-
-static __always_inline __init void *dmi_alloc(unsigned len)
-{
-   return extend_brk(len, sizeof(int));
-}
-
-/* Use early IO mappings for DMI because it's initialized early */
-#define dmi_ioremap early_ioremap
-#define dmi_iounmap early_iounmap
-
-#endif /* _ASM_X86_DMI_H */
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 23066d8..a46c162 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -104,26 +104,6 @@ config DCDBAS
  Say Y or M here to enable the driver for use by Dell systems
  management software such as Dell OpenManage.

-config DMIID
-bool "Export DMI identification via sysfs to userspace"
-depends on DMI
-default y
-   help
- Say Y here if you want to query SMBIOS/DMI system identification
- information from userspace through /sys/class/dmi/id/ or if you want
- DMI-based module auto-loading.
-
-config DMI_SYSFS
-   tristate "DMI table support in sysfs"
-   depends on SYSFS && DMI
-   default n
-   help
- Say Y or M here to enable the exporting of the raw DMI table
- data via sysfs.  This is useful for consuming the data without
- requiring any access to /dev/mem at all.  Tables are found
- under /sys/firmware/dmi when this option is enabled and
- loaded.
-
 config ISCSI_IBFT_FIND
bool "iSCSI Boot Firmware Table Attributes"
depends on X86
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 5c9d81f..f372289 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -1,14 +1,11 @@
 #
 # Makefile for the linux ker

[PATCH 10/34] drivers/gpu changes for SMBIOS and System Firmware

2011-07-18 Thread Prarit Bhargava
As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: dri-devel at lists.freedesktop.org
Acked-by: Chris Wilson 
Signed-off-by: Prarit Bhargava 
---
 drivers/gpu/drm/i915/intel_lvds.c |   81 ++---
 drivers/gpu/vga/vga_switcheroo.c  |1 -
 2 files changed, 40 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c 
b/drivers/gpu/drm/i915/intel_lvds.c
index b28f7bd..5d59058 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -28,7 +28,7 @@
  */

 #include 
-#include 
+#include 
 #include 
 #include 
 #include "drmP.h"
@@ -502,20 +502,20 @@ static int intel_lvds_get_modes(struct drm_connector 
*connector)
return 1;
 }

-static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
+static int intel_no_modeset_on_lid_callback(const struct sysfw_id *id)
 {
DRM_DEBUG_KMS("Skipping forced modeset for %s\n", id->ident);
return 1;
 }

 /* The GPU hangs up on these systems if modeset is performed on LID open */
-static const struct dmi_system_id intel_no_modeset_on_lid[] = {
+static const struct sysfw_id intel_no_modeset_on_lid[] = {
{
-   .callback = intel_no_modeset_on_lid_dmi_callback,
+   .callback = intel_no_modeset_on_lid_callback,
.ident = "Toshiba Tecra A11",
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-   DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"),
+   SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"),
+   SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA A11"),
},
},

@@ -551,7 +551,7 @@ static int intel_lid_notify(struct notifier_block *nb, 
unsigned long val,
 false);

/* Don't force modeset on machines where it causes a GPU lockup */
-   if (dmi_check_system(intel_no_modeset_on_lid))
+   if (sysfw_callback(intel_no_modeset_on_lid))
return NOTIFY_OK;
if (!acpi_lid_open()) {
dev_priv->modeset_on_lid = 1;
@@ -648,95 +648,94 @@ static const struct drm_encoder_funcs 
intel_lvds_enc_funcs = {
.destroy = intel_encoder_destroy,
 };

-static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
+static int __init intel_no_lvds_callback(const struct sysfw_id *id)
 {
DRM_DEBUG_KMS("Skipping LVDS initialization for %s\n", id->ident);
return 1;
 }

 /* These systems claim to have LVDS, but really don't */
-static const struct dmi_system_id intel_no_lvds[] = {
+static const struct sysfw_id intel_no_lvds[] = {
{
-   .callback = intel_no_lvds_dmi_callback,
+   .callback = intel_no_lvds_callback,
.ident = "Apple Mac Mini (Core series)",
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
-   DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
+   SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple"),
+   SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini1,1"),
},
},
{
-   .callback = intel_no_lvds_dmi_callback,
+   .callback = intel_no_lvds_callback,
.ident = "Apple Mac Mini (Core 2 series)",
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, "Apple"),
-   DMI_MATCH(DMI_PRODUCT_NAME, "Macmini2,1"),
+   SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple"),
+   SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini2,1"),
},
},
{
-   .callback = intel_no_lvds_dmi_callback,
+   .callback = intel_no_lvds_callback,
.ident = "MSI IM-945GSE-A",
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
-   DMI_MATCH(DMI_PRODUCT_NAME, "A9830IMS"),
+   SYSFW_MATCH(SYSFW_SYS_VENDOR, "MSI"),
+   SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A9830IMS"),
},
},
{
-   .callback = intel_no_lvds_dmi_callback,
+   .callback = intel_no_lvds_callback,
.ident = "Dell Studio Hybrid",
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
-   DMI_

[PATCH 02/34] New SMBIOS driver for x86 and ia64.

2011-07-18 Thread Prarit Bhargava
This, along with the System Firmware (sysfw) interface replaces the existing
DMI code in the kernel.

This subsystem provides functionality for individual drivers to access
the SMBIOS structures for their own use, smbios_walk(), as well as some
helper functions for some kernel modules.

Cc: linux-ia64 at vger.kernel.org
Cc: x86 at kernel.org
Cc: linux-acpi at vger.kernel.org
Cc: linux-ide at vger.kernel.org
Cc: openipmi-developer at lists.sourceforge.net
Cc: platform-driver-x86 at vger.kernel.org
Cc: linux-crypto at vger.kernel.org
Cc: dri-devel at lists.freedesktop.org
Cc: lm-sensors at lm-sensors.org
Cc: linux-i2c at vger.kernel.org
Cc: linux-ide at vger.kernel.org
Cc: linux-input at vger.kernel.org
Cc: linux-media at vger.kernel.org
Cc: netdev at vger.kernel.org
Cc: linux-pci at vger.kernel.org
Cc: rtc-linux at googlegroups.com
Cc: evel at driverdev.osuosl.org
Cc: linux-usb at vger.kernel.org
Cc: device-drivers-devel at blackfin.uclinux.org
Cc: linux-watchdog at vger.kernel.org
Cc: grant.likely at secretlab.ca
Cc: dz at debian.org
Cc: rpurdie at rpsys.net
Cc: eric.piel at tremplin-utc.net
Cc: abelay at mit.edu
Cc: johnpol at 2ka.mipt.ru
Signed-off-by: Prarit Bhargava 
---
 Documentation/ABI/obsolete/sysfs-dmi   |   40 ++
 Documentation/ABI/testing/sysfw-smbios |   36 ++
 arch/ia64/Kconfig  |5 +
 arch/ia64/include/asm/smbios.h |   12 +
 arch/x86/Kconfig   |   10 +
 arch/x86/include/asm/smbios.h  |   19 +
 drivers/firmware/Kconfig   |   20 +
 drivers/firmware/Makefile  |2 +
 drivers/firmware/smbios-sysfs.c|  705 
 drivers/firmware/smbios.c  |  687 +++
 include/linux/smbios.h |  243 +++
 11 files changed, 1779 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/obsolete/sysfs-dmi
 create mode 100644 Documentation/ABI/testing/sysfw-smbios
 create mode 100644 arch/ia64/include/asm/smbios.h
 create mode 100644 arch/x86/include/asm/smbios.h
 create mode 100644 drivers/firmware/smbios-sysfs.c
 create mode 100644 drivers/firmware/smbios.c
 create mode 100644 include/linux/smbios.h

diff --git a/Documentation/ABI/obsolete/sysfs-dmi 
b/Documentation/ABI/obsolete/sysfs-dmi
new file mode 100644
index 000..547dc4b
--- /dev/null
+++ b/Documentation/ABI/obsolete/sysfs-dmi
@@ -0,0 +1,40 @@
+What:  /sys/class/dmi
+Date:  July 2011
+KernelVersion: 3.0
+Contact:   Prarit Bhargava 
+Description:
+   The dmi class is exported if CONFIG_SMBIOS_DMI_COMPAT is
+   set.
+
+   The DMI code currently exposes several values via sysfs.
+   These values are:
+
+   bios_date: The datestamp of the BIOS.
+   bios_vendor: The company that wrote the BIOS.
+   bios_version: The version of the BIOS.
+   board_asset_tag: A unique identifier for the system
+motherboard.
+   board_name: The name of the type of motherboard.
+   board_serial: The serial number of the motherboard.
+   board_vendor: The company that designed the motherboard.
+   board_version: The version of the motherboard.
+   chassis_asset_tag: A unique identifier for the chassis.
+   chassis_serial: The serial number of the chassis.
+   chassis_type: The type of chassis.
+   chassis_vendor: The company that designed the chassis.
+   chassis_version: The version of the chassis.
+   product_name: The name of the system as determined by the
+ OEM.
+   product_serial: The serial number of the system.
+   product_uuid: A unique UUID for the system.
+   product_version: The version number of the system.
+   sys_vendor: The OEM company for the system.
+
+   In addition to these the standard class files are exposed
+   for DMI (uvent, power, subsystem) as well as a modalias
+   file.
+
+   The dmi class is deprecated and should not be used by new
+   code.  Existing code should be migrated to use
+   /sys/class/smbios/* which exposes the same data.
+   The dmi class link will be removed in July of 2013.
diff --git a/Documentation/ABI/testing/sysfw-smbios 
b/Documentation/ABI/testing/sysfw-smbios
new file mode 100644
index 000..c6045f1
--- /dev/null
+++ b/Documentation/ABI/testing/sysfw-smbios
@@ -0,0 +1,36 @@
+What:  /sys/bus/sysfw
+Date:  May 1 2011
+KernelVersion: 2.6.39
+Contact:   Prarit Bhargava 
+Description:
+   The dmi class is exported if CONFIG_SMBIOS is set.
+
+   The SMBIOS code currently exposes several values via sysfs
+   primarily for use by module handling code

[PATCH 01/34] System Firmware Interface

2011-07-18 Thread Prarit Bhargava
This patch introduces a general System Firmware interface to the kernel, called
sysfw.

Inlcluded in this interface is the ability to search a standard set of fields,
sysfw_lookup().  The fields are currently based upon the x86 and ia64 SMBIOS
fields but exapandable to fields that other arches may introduce.  Also
included is  the ability to search and match against those fields, and run
a callback function against the matches, sysfw_callback().

Modify module code to use sysfw instead of old DMI interface.

[v2]: Modified sysfw_id to include up to 8 matches.  Almost all declarations of
sysfw_id are __init so the increased kernel image size isn't a big issue.

[v3]: Use sysfs bus instead of class, restore existing dmi class for backwards
compatibility.

Cc: linux-ia64 at vger.kernel.org
Cc: x86 at kernel.org
Cc: linux-acpi at vger.kernel.org
Cc: linux-ide at vger.kernel.org
Cc: openipmi-developer at lists.sourceforge.net
Cc: platform-driver-x86 at vger.kernel.org
Cc: linux-crypto at vger.kernel.org
Cc: dri-devel at lists.freedesktop.org
Cc: lm-sensors at lm-sensors.org
Cc: linux-i2c at vger.kernel.org
Cc: linux-ide at vger.kernel.org
Cc: linux-input at vger.kernel.org
Cc: linux-media at vger.kernel.org
Cc: netdev at vger.kernel.org
Cc: linux-pci at vger.kernel.org
Cc: rtc-linux at googlegroups.com
Cc: evel at driverdev.osuosl.org
Cc: linux-usb at vger.kernel.org
Cc: device-drivers-devel at blackfin.uclinux.org
Cc: linux-watchdog at vger.kernel.org
Cc: grant.likely at secretlab.ca
Cc: dz at debian.org
Cc: rpurdie at rpsys.net
Cc: eric.piel at tremplin-utc.net
Cc: abelay at mit.edu
Cc: johnpol at 2ka.mipt.ru
Signed-off-by: Prarit Bhargava 
---
 drivers/firmware/Kconfig|   25 +++
 drivers/firmware/Makefile   |3 +-
 drivers/firmware/sysfw-sysfs.c  |  306 +++
 drivers/firmware/sysfw.c|  168 +
 include/linux/mod_devicetable.h |   62 
 include/linux/sysfw.h   |  113 ++
 init/main.c |3 +
 scripts/mod/file2alias.c|   52 
 8 files changed, 705 insertions(+), 27 deletions(-)
 create mode 100644 drivers/firmware/sysfw-sysfs.c
 create mode 100644 drivers/firmware/sysfw.c
 create mode 100644 include/linux/sysfw.h

diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index efba163..79a1b9d 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -157,6 +157,31 @@ config SIGMA
  If unsure, say N here.  Drivers that need these helpers will select
  this option automatically.

+config SYSTEM_FIRMWARE
+   bool "System Firmware Interface"
+   default y
+   help
+ Enables common System Firmware Interface to export system firmware
+ (SMBIOS, DMI, etc.) information to kernel and userspace.
+
+config SYSTEM_FIRMWARE_SYSFS
+   bool "Export System Firmware identification via sysfs to userspace"
+   depends on SYSTEM_FIRMWARE
+   help
+ Say Y here if you want to query system identification information
+ from userspace through /sys/class/sysfw/id/ or if you want
+ system firmware (sysfw) based module auto-loading.
+
+config SYSTEM_FIRMWARE_DMI_COMPAT
+   bool "Export dmi compatibility class in sysfs"
+   depends on SYSTEM_FIRMWARE
+   default y
+   help
+ This exposes /sys/class/dmi/* as a pointer to the sysfw class for
+ old software.  This is purely a backwards compatability feature and
+ should not be used in new user space software.  Please see
+ Documentation/ABI for details.
+
 source "drivers/firmware/google/Kconfig"

 endmenu
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 47338c9..41bc64a 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -13,5 +13,6 @@ obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o
 obj-$(CONFIG_ISCSI_IBFT)   += iscsi_ibft.o
 obj-$(CONFIG_FIRMWARE_MEMMAP)  += memmap.o
 obj-$(CONFIG_SIGMA)+= sigma.o
-
 obj-$(CONFIG_GOOGLE_FIRMWARE)  += google/
+obj-$(CONFIG_SYSTEM_FIRMWARE)  += sysfw.o
+obj-$(CONFIG_SYSTEM_FIRMWARE_SYSFS)+= sysfw-sysfs.o
diff --git a/drivers/firmware/sysfw-sysfs.c b/drivers/firmware/sysfw-sysfs.c
new file mode 100644
index 000..48d7d07
--- /dev/null
+++ b/drivers/firmware/sysfw-sysfs.c
@@ -0,0 +1,306 @@
+/*
+ * Export sysfs sysfw_field's to userspace
+ *
+ * Updated 2011, Prarit Bhargava, prarit at redhat.com
+ * Copyright 2007, Lennart Poettering
+ *
+ * Licensed under GPLv2
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct sysfw_device_attribute {
+   struct device_attribute dev_attr;
+   int field;
+};
+#define to_sysfw_dev_attr(_dev_attr) \
+   container_of(_dev_attr, struct sysfw_device_attribute, dev_attr)
+
+static ssize_t sys_sysfw_field_show(struct device *dev,
+  

[PATCH 10/34] drivers/gpu changes for SMBIOS and System Firmware

2011-07-18 Thread Prarit Bhargava
As part of the new SMBIOS and System Firmware code:

- Replace old dmi* structures and functions with new sysfw* and smbios*
structures and functions in individual drivers
- cleanup sysfw_id lookup tables
- cleanup of includes for dmi.h and mod_devicetable.h which were included in
some files that did not need them

Cc: dri-devel@lists.freedesktop.org
Acked-by: Chris Wilson ch...@chris-wilson.co.uk
Signed-off-by: Prarit Bhargava pra...@redhat.com
---
 drivers/gpu/drm/i915/intel_lvds.c |   81 ++---
 drivers/gpu/vga/vga_switcheroo.c  |1 -
 2 files changed, 40 insertions(+), 42 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_lvds.c 
b/drivers/gpu/drm/i915/intel_lvds.c
index b28f7bd..5d59058 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -28,7 +28,7 @@
  */
 
 #include acpi/button.h
-#include linux/dmi.h
+#include linux/sysfw.h
 #include linux/i2c.h
 #include linux/slab.h
 #include drmP.h
@@ -502,20 +502,20 @@ static int intel_lvds_get_modes(struct drm_connector 
*connector)
return 1;
 }
 
-static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id)
+static int intel_no_modeset_on_lid_callback(const struct sysfw_id *id)
 {
DRM_DEBUG_KMS(Skipping forced modeset for %s\n, id-ident);
return 1;
 }
 
 /* The GPU hangs up on these systems if modeset is performed on LID open */
-static const struct dmi_system_id intel_no_modeset_on_lid[] = {
+static const struct sysfw_id intel_no_modeset_on_lid[] = {
{
-   .callback = intel_no_modeset_on_lid_dmi_callback,
+   .callback = intel_no_modeset_on_lid_callback,
.ident = Toshiba Tecra A11,
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, TOSHIBA),
-   DMI_MATCH(DMI_PRODUCT_NAME, TECRA A11),
+   SYSFW_MATCH(SYSFW_SYS_VENDOR, TOSHIBA),
+   SYSFW_MATCH(SYSFW_PRODUCT_NAME, TECRA A11),
},
},
 
@@ -551,7 +551,7 @@ static int intel_lid_notify(struct notifier_block *nb, 
unsigned long val,
 false);
 
/* Don't force modeset on machines where it causes a GPU lockup */
-   if (dmi_check_system(intel_no_modeset_on_lid))
+   if (sysfw_callback(intel_no_modeset_on_lid))
return NOTIFY_OK;
if (!acpi_lid_open()) {
dev_priv-modeset_on_lid = 1;
@@ -648,95 +648,94 @@ static const struct drm_encoder_funcs 
intel_lvds_enc_funcs = {
.destroy = intel_encoder_destroy,
 };
 
-static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
+static int __init intel_no_lvds_callback(const struct sysfw_id *id)
 {
DRM_DEBUG_KMS(Skipping LVDS initialization for %s\n, id-ident);
return 1;
 }
 
 /* These systems claim to have LVDS, but really don't */
-static const struct dmi_system_id intel_no_lvds[] = {
+static const struct sysfw_id intel_no_lvds[] = {
{
-   .callback = intel_no_lvds_dmi_callback,
+   .callback = intel_no_lvds_callback,
.ident = Apple Mac Mini (Core series),
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, Apple),
-   DMI_MATCH(DMI_PRODUCT_NAME, Macmini1,1),
+   SYSFW_MATCH(SYSFW_SYS_VENDOR, Apple),
+   SYSFW_MATCH(SYSFW_PRODUCT_NAME, Macmini1,1),
},
},
{
-   .callback = intel_no_lvds_dmi_callback,
+   .callback = intel_no_lvds_callback,
.ident = Apple Mac Mini (Core 2 series),
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, Apple),
-   DMI_MATCH(DMI_PRODUCT_NAME, Macmini2,1),
+   SYSFW_MATCH(SYSFW_SYS_VENDOR, Apple),
+   SYSFW_MATCH(SYSFW_PRODUCT_NAME, Macmini2,1),
},
},
{
-   .callback = intel_no_lvds_dmi_callback,
+   .callback = intel_no_lvds_callback,
.ident = MSI IM-945GSE-A,
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, MSI),
-   DMI_MATCH(DMI_PRODUCT_NAME, A9830IMS),
+   SYSFW_MATCH(SYSFW_SYS_VENDOR, MSI),
+   SYSFW_MATCH(SYSFW_PRODUCT_NAME, A9830IMS),
},
},
{
-   .callback = intel_no_lvds_dmi_callback,
+   .callback = intel_no_lvds_callback,
.ident = Dell Studio Hybrid,
.matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, Dell Inc.),
-   DMI_MATCH(DMI_PRODUCT_NAME, Studio Hybrid 140g),
+   SYSFW_MATCH(SYSFW_SYS_VENDOR, Dell Inc.),
+   SYSFW_MATCH(SYSFW_PRODUCT_NAME, Studio Hybrid 140g

[PATCH 01/34] System Firmware Interface

2011-07-18 Thread Prarit Bhargava
This patch introduces a general System Firmware interface to the kernel, called
sysfw.

Inlcluded in this interface is the ability to search a standard set of fields,
sysfw_lookup().  The fields are currently based upon the x86 and ia64 SMBIOS
fields but exapandable to fields that other arches may introduce.  Also
included is  the ability to search and match against those fields, and run
a callback function against the matches, sysfw_callback().

Modify module code to use sysfw instead of old DMI interface.

[v2]: Modified sysfw_id to include up to 8 matches.  Almost all declarations of
sysfw_id are __init so the increased kernel image size isn't a big issue.

[v3]: Use sysfs bus instead of class, restore existing dmi class for backwards
compatibility.

Cc: linux-i...@vger.kernel.org
Cc: x...@kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: openipmi-develo...@lists.sourceforge.net
Cc: platform-driver-...@vger.kernel.org
Cc: linux-cry...@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: lm-sens...@lm-sensors.org
Cc: linux-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-in...@vger.kernel.org
Cc: linux-me...@vger.kernel.org
Cc: net...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: rtc-li...@googlegroups.com
Cc: e...@driverdev.osuosl.org
Cc: linux-...@vger.kernel.org
Cc: device-drivers-de...@blackfin.uclinux.org
Cc: linux-watch...@vger.kernel.org
Cc: grant.lik...@secretlab.ca
Cc: d...@debian.org
Cc: rpur...@rpsys.net
Cc: eric.p...@tremplin-utc.net
Cc: abe...@mit.edu
Cc: john...@2ka.mipt.ru
Signed-off-by: Prarit Bhargava pra...@redhat.com
---
 drivers/firmware/Kconfig|   25 +++
 drivers/firmware/Makefile   |3 +-
 drivers/firmware/sysfw-sysfs.c  |  306 +++
 drivers/firmware/sysfw.c|  168 +
 include/linux/mod_devicetable.h |   62 
 include/linux/sysfw.h   |  113 ++
 init/main.c |3 +
 scripts/mod/file2alias.c|   52 
 8 files changed, 705 insertions(+), 27 deletions(-)
 create mode 100644 drivers/firmware/sysfw-sysfs.c
 create mode 100644 drivers/firmware/sysfw.c
 create mode 100644 include/linux/sysfw.h

diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index efba163..79a1b9d 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -157,6 +157,31 @@ config SIGMA
  If unsure, say N here.  Drivers that need these helpers will select
  this option automatically.
 
+config SYSTEM_FIRMWARE
+   bool System Firmware Interface
+   default y
+   help
+ Enables common System Firmware Interface to export system firmware
+ (SMBIOS, DMI, etc.) information to kernel and userspace.
+
+config SYSTEM_FIRMWARE_SYSFS
+   bool Export System Firmware identification via sysfs to userspace
+   depends on SYSTEM_FIRMWARE
+   help
+ Say Y here if you want to query system identification information
+ from userspace through /sys/class/sysfw/id/ or if you want
+ system firmware (sysfw) based module auto-loading.
+
+config SYSTEM_FIRMWARE_DMI_COMPAT
+   bool Export dmi compatibility class in sysfs
+   depends on SYSTEM_FIRMWARE
+   default y
+   help
+ This exposes /sys/class/dmi/* as a pointer to the sysfw class for
+ old software.  This is purely a backwards compatability feature and
+ should not be used in new user space software.  Please see
+ Documentation/ABI for details.
+
 source drivers/firmware/google/Kconfig
 
 endmenu
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 47338c9..41bc64a 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -13,5 +13,6 @@ obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o
 obj-$(CONFIG_ISCSI_IBFT)   += iscsi_ibft.o
 obj-$(CONFIG_FIRMWARE_MEMMAP)  += memmap.o
 obj-$(CONFIG_SIGMA)+= sigma.o
-
 obj-$(CONFIG_GOOGLE_FIRMWARE)  += google/
+obj-$(CONFIG_SYSTEM_FIRMWARE)  += sysfw.o
+obj-$(CONFIG_SYSTEM_FIRMWARE_SYSFS)+= sysfw-sysfs.o
diff --git a/drivers/firmware/sysfw-sysfs.c b/drivers/firmware/sysfw-sysfs.c
new file mode 100644
index 000..48d7d07
--- /dev/null
+++ b/drivers/firmware/sysfw-sysfs.c
@@ -0,0 +1,306 @@
+/*
+ * Export sysfs sysfw_field's to userspace
+ *
+ * Updated 2011, Prarit Bhargava, pra...@redhat.com
+ * Copyright 2007, Lennart Poettering
+ *
+ * Licensed under GPLv2
+ */
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/sysfw.h
+#include linux/device.h
+#include linux/slab.h
+#include linux/sysfw.h
+
+struct sysfw_device_attribute {
+   struct device_attribute dev_attr;
+   int field;
+};
+#define to_sysfw_dev_attr(_dev_attr) \
+   container_of(_dev_attr, struct sysfw_device_attribute, dev_attr)
+
+static ssize_t sys_sysfw_field_show(struct device *dev,
+ struct device_attribute *attr

[PATCH 02/34] New SMBIOS driver for x86 and ia64.

2011-07-18 Thread Prarit Bhargava
This, along with the System Firmware (sysfw) interface replaces the existing
DMI code in the kernel.

This subsystem provides functionality for individual drivers to access
the SMBIOS structures for their own use, smbios_walk(), as well as some
helper functions for some kernel modules.

Cc: linux-i...@vger.kernel.org
Cc: x...@kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: openipmi-develo...@lists.sourceforge.net
Cc: platform-driver-...@vger.kernel.org
Cc: linux-cry...@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: lm-sens...@lm-sensors.org
Cc: linux-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-in...@vger.kernel.org
Cc: linux-me...@vger.kernel.org
Cc: net...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: rtc-li...@googlegroups.com
Cc: e...@driverdev.osuosl.org
Cc: linux-...@vger.kernel.org
Cc: device-drivers-de...@blackfin.uclinux.org
Cc: linux-watch...@vger.kernel.org
Cc: grant.lik...@secretlab.ca
Cc: d...@debian.org
Cc: rpur...@rpsys.net
Cc: eric.p...@tremplin-utc.net
Cc: abe...@mit.edu
Cc: john...@2ka.mipt.ru
Signed-off-by: Prarit Bhargava pra...@redhat.com
---
 Documentation/ABI/obsolete/sysfs-dmi   |   40 ++
 Documentation/ABI/testing/sysfw-smbios |   36 ++
 arch/ia64/Kconfig  |5 +
 arch/ia64/include/asm/smbios.h |   12 +
 arch/x86/Kconfig   |   10 +
 arch/x86/include/asm/smbios.h  |   19 +
 drivers/firmware/Kconfig   |   20 +
 drivers/firmware/Makefile  |2 +
 drivers/firmware/smbios-sysfs.c|  705 
 drivers/firmware/smbios.c  |  687 +++
 include/linux/smbios.h |  243 +++
 11 files changed, 1779 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ABI/obsolete/sysfs-dmi
 create mode 100644 Documentation/ABI/testing/sysfw-smbios
 create mode 100644 arch/ia64/include/asm/smbios.h
 create mode 100644 arch/x86/include/asm/smbios.h
 create mode 100644 drivers/firmware/smbios-sysfs.c
 create mode 100644 drivers/firmware/smbios.c
 create mode 100644 include/linux/smbios.h

diff --git a/Documentation/ABI/obsolete/sysfs-dmi 
b/Documentation/ABI/obsolete/sysfs-dmi
new file mode 100644
index 000..547dc4b
--- /dev/null
+++ b/Documentation/ABI/obsolete/sysfs-dmi
@@ -0,0 +1,40 @@
+What:  /sys/class/dmi
+Date:  July 2011
+KernelVersion: 3.0
+Contact:   Prarit Bhargava pra...@redhat.com
+Description:
+   The dmi class is exported if CONFIG_SMBIOS_DMI_COMPAT is
+   set.
+
+   The DMI code currently exposes several values via sysfs.
+   These values are:
+
+   bios_date: The datestamp of the BIOS.
+   bios_vendor: The company that wrote the BIOS.
+   bios_version: The version of the BIOS.
+   board_asset_tag: A unique identifier for the system
+motherboard.
+   board_name: The name of the type of motherboard.
+   board_serial: The serial number of the motherboard.
+   board_vendor: The company that designed the motherboard.
+   board_version: The version of the motherboard.
+   chassis_asset_tag: A unique identifier for the chassis.
+   chassis_serial: The serial number of the chassis.
+   chassis_type: The type of chassis.
+   chassis_vendor: The company that designed the chassis.
+   chassis_version: The version of the chassis.
+   product_name: The name of the system as determined by the
+ OEM.
+   product_serial: The serial number of the system.
+   product_uuid: A unique UUID for the system.
+   product_version: The version number of the system.
+   sys_vendor: The OEM company for the system.
+
+   In addition to these the standard class files are exposed
+   for DMI (uvent, power, subsystem) as well as a modalias
+   file.
+
+   The dmi class is deprecated and should not be used by new
+   code.  Existing code should be migrated to use
+   /sys/class/smbios/* which exposes the same data.
+   The dmi class link will be removed in July of 2013.
diff --git a/Documentation/ABI/testing/sysfw-smbios 
b/Documentation/ABI/testing/sysfw-smbios
new file mode 100644
index 000..c6045f1
--- /dev/null
+++ b/Documentation/ABI/testing/sysfw-smbios
@@ -0,0 +1,36 @@
+What:  /sys/bus/sysfw
+Date:  May 1 2011
+KernelVersion: 2.6.39
+Contact:   Prarit Bhargava pra...@redhat.com
+Description:
+   The dmi class is exported if CONFIG_SMBIOS is set.
+
+   The SMBIOS code currently exposes several values via sysfs
+   primarily for use by module handling code.
+
+   These values

[PATCH 34/34] Remove old DMI SMBIOS code and make SMBIOS default on

2011-07-18 Thread Prarit Bhargava
This code has now been completely replaced by the new System Firmware
Interface (SYSFW) and SMBIOS code.  It is no longer needed in the kernel.

Cc: linux-i...@vger.kernel.org
Cc: x...@kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: openipmi-develo...@lists.sourceforge.net
Cc: platform-driver-...@vger.kernel.org
Cc: linux-cry...@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: lm-sens...@lm-sensors.org
Cc: linux-...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: linux-in...@vger.kernel.org
Cc: linux-me...@vger.kernel.org
Cc: net...@vger.kernel.org
Cc: linux-...@vger.kernel.org
Cc: rtc-li...@googlegroups.com
Cc: e...@driverdev.osuosl.org
Cc: linux-...@vger.kernel.org
Cc: device-drivers-de...@blackfin.uclinux.org
Cc: linux-watch...@vger.kernel.org
Cc: grant.lik...@secretlab.ca
Cc: d...@debian.org
Cc: rpur...@rpsys.net
Cc: eric.p...@tremplin-utc.net
Cc: abe...@mit.edu
Cc: john...@2ka.mipt.ru
Signed-off-by: Prarit Bhargava pra...@redhat.com
---
 arch/ia64/include/asm/dmi.h |   12 -
 arch/x86/Kconfig|9 -
 arch/x86/include/asm/dmi.h  |   19 -
 drivers/firmware/Kconfig|   20 -
 drivers/firmware/Makefile   |3 -
 drivers/firmware/dmi-id.c   |  245 -
 drivers/firmware/dmi-sysfs.c|  696 
 drivers/firmware/dmi_scan.c |  751 ---
 include/linux/dmi.h |  139 ---
 include/linux/mod_devicetable.h |   55 ---
 10 files changed, 0 insertions(+), 1949 deletions(-)
 delete mode 100644 arch/ia64/include/asm/dmi.h
 delete mode 100644 arch/x86/include/asm/dmi.h
 delete mode 100644 drivers/firmware/dmi-id.c
 delete mode 100644 drivers/firmware/dmi-sysfs.c
 delete mode 100644 drivers/firmware/dmi_scan.c
 delete mode 100644 include/linux/dmi.h

diff --git a/arch/ia64/include/asm/dmi.h b/arch/ia64/include/asm/dmi.h
deleted file mode 100644
index 1ed4c8f..000
--- a/arch/ia64/include/asm/dmi.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASM_DMI_H
-#define _ASM_DMI_H 1
-
-#include linux/slab.h
-#include asm/io.h
-
-/* Use normal IO mappings for DMI */
-#define dmi_ioremap ioremap
-#define dmi_iounmap(x,l) iounmap(x)
-#define dmi_alloc(l) kmalloc(l, GFP_ATOMIC)
-
-#endif
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e7cdde8..92ee12b 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -626,15 +626,6 @@ config APB_TIMER
 
 # Mark as expert because too many people got it wrong.
 # The code disables itself when not needed.
-config DMI
-   default y
-   bool Enable DMI scanning if EXPERT
-   ---help---
- Enabled scanning of DMI to identify machine quirks. Say Y
- here unless you have verified that your setup is not
- affected by entries in the DMI blacklist. Required by PNP
- BIOS code.
-
 config SMBIOS
depends on SYSTEM_FIRMWARE
bool Enable SMBIOS scanning if EXPERT
diff --git a/arch/x86/include/asm/dmi.h b/arch/x86/include/asm/dmi.h
deleted file mode 100644
index fd8f9e2..000
--- a/arch/x86/include/asm/dmi.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef _ASM_X86_DMI_H
-#define _ASM_X86_DMI_H
-
-#include linux/compiler.h
-#include linux/init.h
-
-#include asm/io.h
-#include asm/setup.h
-
-static __always_inline __init void *dmi_alloc(unsigned len)
-{
-   return extend_brk(len, sizeof(int));
-}
-
-/* Use early IO mappings for DMI because it's initialized early */
-#define dmi_ioremap early_ioremap
-#define dmi_iounmap early_iounmap
-
-#endif /* _ASM_X86_DMI_H */
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 23066d8..a46c162 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -104,26 +104,6 @@ config DCDBAS
  Say Y or M here to enable the driver for use by Dell systems
  management software such as Dell OpenManage.
 
-config DMIID
-bool Export DMI identification via sysfs to userspace
-depends on DMI
-default y
-   help
- Say Y here if you want to query SMBIOS/DMI system identification
- information from userspace through /sys/class/dmi/id/ or if you want
- DMI-based module auto-loading.
-
-config DMI_SYSFS
-   tristate DMI table support in sysfs
-   depends on SYSFS  DMI
-   default n
-   help
- Say Y or M here to enable the exporting of the raw DMI table
- data via sysfs.  This is useful for consuming the data without
- requiring any access to /dev/mem at all.  Tables are found
- under /sys/firmware/dmi when this option is enabled and
- loaded.
-
 config ISCSI_IBFT_FIND
bool iSCSI Boot Firmware Table Attributes
depends on X86
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
index 5c9d81f..f372289 100644
--- a/drivers/firmware/Makefile
+++ b/drivers/firmware/Makefile
@@ -1,14 +1,11 @@
 #
 # Makefile for the linux kernel.
 #
-obj-$(CONFIG_DMI)  += dmi_scan.o
-obj

[PATCH]: radeon: Fix uninitialized variable warning in atombios_crtc_set_pll()

2010-05-27 Thread Prarit Bhargava
Fixes:

drivers/gpu/drm/radeon/atombios_crtc.c: In function ???atombios_crtc_set_pll???:
drivers/gpu/drm/radeon/atombios_crtc.c:678: error: ???pll??? may be used 
uninitialized in this function

Signed-off-by: Prarit Bhargava 

diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c 
b/drivers/gpu/drm/radeon/atombios_crtc.c
index 3feca6a..520deae 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -675,7 +675,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, 
struct drm_display_mode
union set_pixel_clock args;
u32 pll_clock = mode->clock;
u32 ref_div = 0, fb_div = 0, frac_fb_div = 0, post_div = 0;
-   struct radeon_pll *pll;
+   struct radeon_pll *(uninitialized_var(pll);
u32 adjusted_clock;
int encoder_mode = 0;



[PATCH]: i915: fix uninitialized variable warning in i915_setup_compression()

2010-05-27 Thread Prarit Bhargava
Fixes:

drivers/gpu/drm/i915/i915_dma.c: In function ???i915_setup_compression???:
drivers/gpu/drm/i915/i915_dma.c:1311: error: ???compressed_llb??? may be used 
uninitialized in this function

Signed-off-by: Prarit Bhargava 

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 4c03ee5..e6a63d1 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1308,7 +1308,7 @@ static void i915_warn_stolen(struct drm_device *dev)
 static void i915_setup_compression(struct drm_device *dev, int size)
 {
struct drm_i915_private *dev_priv = dev->dev_private;
-   struct drm_mm_node *compressed_fb, *compressed_llb;
+   struct drm_mm_node *compressed_fb, *uninitialized_var(compressed_llb);
unsigned long cfb_base;
unsigned long ll_base = 0;



[PATCH]: i915: Fix missing linux/types.h warning in header

2010-05-27 Thread Prarit Bhargava
>
> Prarit Bhargava wrote:
>
>> Fixes warning:
>>
>> /usr/include/drm/i915_drm.h:119: found __[us]{8,16,32,64} type without 
>> #include
>>
>> Signed-off-by: Prarit Bhargava
>>
>> diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
>> index b64a8d7..5cf7f5b 100644
>> --- a/include/drm/i915_drm.h
>> +++ b/include/drm/i915_drm.h
>> @@ -27,6 +27,7 @@
>>   #ifndef _I915_DRM_H_
>>   #define _I915_DRM_H_
>>
>> +#include
>>   #include "drm.h"
>>  
> drm.h includes it, safely tucked inside #ifdef __linux__ so it won't
> break BSD&  OpenSolaris DRI builds - isn't that good enough?
>

Hmm ... it doesn't appear to be :/  From a week-old compile of linux-next

/home/linux-next/usr/include/drm/drm_mode.h:84: found __[us]{8,16,32,64} 
type without #include 
/home/linux-next/usr/include/drm/i915_drm.h:119: found 
__[us]{8,16,32,64} type without #include 
/home/linux-next/usr/include/drm/mga_drm.h:260: found __[us]{8,16,32,64} 
type without #include 
/home/linux-next/usr/include/drm/radeon_drm.h:758: found 
__[us]{8,16,32,64} type without #include 
/home/linux-next/usr/include/drm/via_drm.h:117: found __[us]{8,16,32,64} 
type without #include 

It could certainly be that the error check is busted ...

P.
>


[PATCH]: i915: Fix missing linux/types.h warning in header

2010-05-27 Thread Prarit Bhargava
Fixes warning:

/usr/include/drm/i915_drm.h:119: found __[us]{8,16,32,64} type without #include 


Signed-off-by: Prarit Bhargava 

diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index b64a8d7..5cf7f5b 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -27,6 +27,7 @@
 #ifndef _I915_DRM_H_
 #define _I915_DRM_H_

+#include 
 #include "drm.h"

 /* Please note that modifications to all structs defined here are


[PATCH]: nouveau and radeon checkstack fixes

2010-05-22 Thread Prarit Bhargava


On 05/22/2010 03:57 PM, Maarten Maathuis wrote:
> On Sat, May 22, 2010 at 2:30 AM, Prarit Bhargava  wrote:
>
>> Fixes linux-next&  linux-2.6 checkstack warnings:
>>
>> drivers/gpu/drm/nouveau/nv40_graph.c: In function `nv40_graph_init':
>> drivers/gpu/drm/nouveau/nv40_graph.c:400: warning: the frame size of 1184 
>> bytes is larger than 1024 bytes
>> drivers/gpu/drm/radeon/radeon_atombios.c: In function 
>> `radeon_get_atom_connector_info_from_supported_devices_table':
>> drivers/gpu/drm/radeon/radeon_atombios.c:857: warning: the frame size of 
>> 1872 bytes is larger than 1024 bytes
>>
>> Signed-off-by: Prarit Bhargava
>>
>> diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c 
>> b/drivers/gpu/drm/nouveau/nv40_graph.c
>> index 0616c96..3604394 100644
>> --- a/drivers/gpu/drm/nouveau/nv40_graph.c
>> +++ b/drivers/gpu/drm/nouveau/nv40_graph.c
>> @@ -253,7 +253,11 @@ nv40_graph_init(struct drm_device *dev)
>>
>> if (!dev_priv->engine.graph.ctxprog) {
>> struct nouveau_grctx ctx = {};
>> -   uint32_t cp[256];
>> +   uint32_t *cp;
>> +
>> +   cp = kmalloc(sizeof(*cp), GFP_KERNEL);
>> +   if (!cp)
>> +   return -ENOMEM;
>>
>>  
> This seems wrong, allocating 1 uint32_t isn't enough.
>

Oops!  That obviously should have been (sizeof(*cp) * 256) ... New patch.

Thanks Maarten,

P.

>
>> ctx.dev = dev;
>> ctx.mode = NOUVEAU_GRCTX_PROG;
>> @@ -265,6 +269,8 @@ nv40_graph_init(struct drm_device *dev)
>> nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
>> for (i = 0; i<  ctx.ctxprog_len; i++)
>> nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]);
>> +
>> +   kfree(cp);
>> }
>>
>> /* No context present currently */
>> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
>> b/drivers/gpu/drm/radeon/radeon_atombios.c
>> index 1d05deb..5ad208c 100644
>> --- a/drivers/gpu/drm/radeon/radeon_atombios.c
>> +++ b/drivers/gpu/drm/radeon/radeon_atombios.c
>> @@ -682,10 +682,18 @@ bool 
>> radeon_get_atom_connector_info_from_supported_devices_table(struct
>> uint8_t dac;
>> union atom_supported_devices *supported_devices;
>> int i, j, max_device;
>> -   struct bios_connector bios_connectors[ATOM_MAX_SUPPORTED_DEVICE];
>> +   struct bios_connector *bios_connectors;
>> +   size_t bc_size = sizeof(*bios_connectors) * 
>> ATOM_MAX_SUPPORTED_DEVICE;
>>
>> -   if (!atom_parse_data_header(ctx, 
>> index_offset))
>> +   bios_connectors = kzalloc(bc_size, GFP_KERNEL);
>> +   if (!bios_connectors)
>> +   return false;
>> +
>> +   if (!atom_parse_data_header(ctx, index
>> +_offset)) {
>> +   kfree(bios_connectors);
>> return false;
>> +   }
>>
>> supported_devices =
>> (union atom_supported_devices *)(ctx->bios + data_offset);
>> @@ -853,6 +861,7 @@ bool 
>> radeon_get_atom_connector_info_from_supported_devices_table(struct
>>
>> radeon_link_encoder_connector(dev);
>>
>> +   kfree(bios_connectors);
>> return true;
>>   }
>>
>> ___
>> dri-devel mailing list
>> dri-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>>  
-- next part --
An embedded and charset-unspecified text was scrubbed...
Name: drm.patch
URL: 
<http://lists.freedesktop.org/archives/dri-devel/attachments/20100522/5f95926d/attachment.ksh>


[PATCH]: nouveau and radeon checkstack fixes

2010-05-22 Thread Prarit Bhargava
Fixes linux-next  linux-2.6 checkstack warnings:

drivers/gpu/drm/nouveau/nv40_graph.c: In function `nv40_graph_init':
drivers/gpu/drm/nouveau/nv40_graph.c:400: warning: the frame size of 1184 bytes 
is larger than 1024 bytes
drivers/gpu/drm/radeon/radeon_atombios.c: In function 
`radeon_get_atom_connector_info_from_supported_devices_table':
drivers/gpu/drm/radeon/radeon_atombios.c:857: warning: the frame size of 1872 
bytes is larger than 1024 bytes

Signed-off-by: Prarit Bhargava pra...@redhat.com

diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c 
b/drivers/gpu/drm/nouveau/nv40_graph.c
index 0616c96..3604394 100644
--- a/drivers/gpu/drm/nouveau/nv40_graph.c
+++ b/drivers/gpu/drm/nouveau/nv40_graph.c
@@ -253,7 +253,11 @@ nv40_graph_init(struct drm_device *dev)
 
if (!dev_priv-engine.graph.ctxprog) {
struct nouveau_grctx ctx = {};
-   uint32_t cp[256];
+   uint32_t *cp;
+
+   cp = kmalloc(sizeof(*cp), GFP_KERNEL);
+   if (!cp)
+   return -ENOMEM;
 
ctx.dev = dev;
ctx.mode = NOUVEAU_GRCTX_PROG;
@@ -265,6 +269,8 @@ nv40_graph_init(struct drm_device *dev)
nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
for (i = 0; i  ctx.ctxprog_len; i++)
nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]);
+
+   kfree(cp);
}
 
/* No context present currently */
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 1d05deb..5ad208c 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -682,10 +682,18 @@ bool 
radeon_get_atom_connector_info_from_supported_devices_table(struct
uint8_t dac;
union atom_supported_devices *supported_devices;
int i, j, max_device;
-   struct bios_connector bios_connectors[ATOM_MAX_SUPPORTED_DEVICE];
+   struct bios_connector *bios_connectors;
+   size_t bc_size = sizeof(*bios_connectors) * ATOM_MAX_SUPPORTED_DEVICE;
 
-   if (!atom_parse_data_header(ctx, index, size, frev, crev, 
data_offset))
+   bios_connectors = kzalloc(bc_size, GFP_KERNEL);
+   if (!bios_connectors)
+   return false;
+
+   if (!atom_parse_data_header(ctx, index, size, frev, crev,
+   data_offset)) {
+   kfree(bios_connectors);
return false;
+   }   
 
supported_devices =
(union atom_supported_devices *)(ctx-bios + data_offset);
@@ -853,6 +861,7 @@ bool 
radeon_get_atom_connector_info_from_supported_devices_table(struct
 
radeon_link_encoder_connector(dev);
 
+   kfree(bios_connectors);
return true;
 }
 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH]: nouveau and radeon checkstack fixes

2010-05-21 Thread Prarit Bhargava
Fixes linux-next & linux-2.6 checkstack warnings:

drivers/gpu/drm/nouveau/nv40_graph.c: In function `nv40_graph_init':
drivers/gpu/drm/nouveau/nv40_graph.c:400: warning: the frame size of 1184 bytes 
is larger than 1024 bytes
drivers/gpu/drm/radeon/radeon_atombios.c: In function 
`radeon_get_atom_connector_info_from_supported_devices_table':
drivers/gpu/drm/radeon/radeon_atombios.c:857: warning: the frame size of 1872 
bytes is larger than 1024 bytes

Signed-off-by: Prarit Bhargava 

diff --git a/drivers/gpu/drm/nouveau/nv40_graph.c 
b/drivers/gpu/drm/nouveau/nv40_graph.c
index 0616c96..3604394 100644
--- a/drivers/gpu/drm/nouveau/nv40_graph.c
+++ b/drivers/gpu/drm/nouveau/nv40_graph.c
@@ -253,7 +253,11 @@ nv40_graph_init(struct drm_device *dev)

if (!dev_priv->engine.graph.ctxprog) {
struct nouveau_grctx ctx = {};
-   uint32_t cp[256];
+   uint32_t *cp;
+
+   cp = kmalloc(sizeof(*cp), GFP_KERNEL);
+   if (!cp)
+   return -ENOMEM;

ctx.dev = dev;
ctx.mode = NOUVEAU_GRCTX_PROG;
@@ -265,6 +269,8 @@ nv40_graph_init(struct drm_device *dev)
nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_INDEX, 0);
for (i = 0; i < ctx.ctxprog_len; i++)
nv_wr32(dev, NV40_PGRAPH_CTXCTL_UCODE_DATA, cp[i]);
+
+   kfree(cp);
}

/* No context present currently */
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c 
b/drivers/gpu/drm/radeon/radeon_atombios.c
index 1d05deb..5ad208c 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -682,10 +682,18 @@ bool 
radeon_get_atom_connector_info_from_supported_devices_table(struct
uint8_t dac;
union atom_supported_devices *supported_devices;
int i, j, max_device;
-   struct bios_connector bios_connectors[ATOM_MAX_SUPPORTED_DEVICE];
+   struct bios_connector *bios_connectors;
+   size_t bc_size = sizeof(*bios_connectors) * ATOM_MAX_SUPPORTED_DEVICE;

-   if (!atom_parse_data_header(ctx, index, , , , 
_offset))
+   bios_connectors = kzalloc(bc_size, GFP_KERNEL);
+   if (!bios_connectors)
+   return false;
+
+   if (!atom_parse_data_header(ctx, index, , , ,
+   _offset)) {
+   kfree(bios_connectors);
return false;
+   }   

supported_devices =
(union atom_supported_devices *)(ctx->bios + data_offset);
@@ -853,6 +861,7 @@ bool 
radeon_get_atom_connector_info_from_supported_devices_table(struct

radeon_link_encoder_connector(dev);

+   kfree(bios_connectors);
return true;
 }