I have made the following changes intended for :
  CE:Adaptation:N950-N9 / kernel-adaptation-n950

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/4045

Thank You,
vesku

[This message was auto-generated]

---

Request # 4045:

Messages from BOSS:
     WARNING check_package_is_complete_sources (kernel-adaptation-n950) failed: 
Failed to get source file list from spec or dsc: Failed to parse spec file: 
can't parse specfile
No dsc file found
     WARNING check_valid_changes (kernel-adaptation-n950) failed: Could not 
parse spec in kernel-adaptation-n950: can't parse specfile


State: review at 2012-01-11T10:21:32 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:vesku:branches:CE:Adaptation:N950-N9 / kernel-adaptation-n950 -> 
CE:Adaptation:N950-N9 / kernel-adaptation-n950
  
changes files:
--------------
--- kernel-adaptation-n950.changes
+++ kernel-adaptation-n950.changes
@@ -0,0 +1,4 @@
+* Wed Jan 11 2012 Vesa-Matti Hartikainen <[email protected]> - 
2.6.32.20112201
+- Fixes NEMO#46: login is really slow
+-- Added patch 
linux-2.6.38-tty-add-active-sysfs-attribute-to-tty0-and-console-d.patch
+

new:
----
  linux-2.6.38-tty-add-active-sysfs-attribute-to-tty0-and-console-d.patch

spec files:
-----------
--- kernel-adaptation-n950.spec
+++ kernel-adaptation-n950.spec
@@ -284,6 +284,9 @@
 # Fix for 20110105 kernel
 Patch96: 000-kcflag-mno-unaligned-access.patch
 
+# Fix for NEMO#46
+Patch97: 
linux-2.6.38-tty-add-active-sysfs-attribute-to-tty0-and-console-d.patch
+
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
 
@@ -615,6 +618,10 @@
 # 000-kcflag-mno-unaligned-access.patch
 %patch96 -p1
 
+# Fix for NEMO#46
+# linux-2.6.38-tty-add-active-sysfs-attribute-to-tty0-and-console-d.patch
+%patch97 -p1
+
 # Drop some necessary files from the source dir into the buildroot
 # HARMATTAN: no build-time config file generation, copy ready-made config file
 cp $RPM_SOURCE_DIR/kernel-*config .

other changes:
--------------

++++++ linux-2.6.38-tty-add-active-sysfs-attribute-to-tty0-and-console-d.patch 
(new)
--- linux-2.6.38-tty-add-active-sysfs-attribute-to-tty0-and-console-d.patch
+++ linux-2.6.38-tty-add-active-sysfs-attribute-to-tty0-and-console-d.patch
@@ -0,0 +1,222 @@
+From 71c3f254e2a83b675537d07d1b469fd6067b7fca Mon Sep 17 00:00:00 2001
+From: Kay Sievers <[email protected]>
+Date: Wed, 1 Dec 2010 17:51:05 +0100
+Subject: [PATCH] tty: add 'active' sysfs attribute to tty0 and console device
+ 
+tty: add 'active' sysfs attribute to tty0 and console device
+ 
+tty: add 'active' sysfs attribute to tty0 and console device
+ 
+Userspace can query the actual virtual console, and the configured
+console devices behind /dev/tt0 and /dev/console.
+ 
+The last entry in the list of devices is the active device, analog
+to the console= kernel command line option.
+ 
+The attribute supports poll(), which is raised when the virtual
+console is changed or /dev/console is reconfigured.
+ 
+Signed-off-by: Kay Sievers <[email protected]>
+Signed-off-by: Greg Kroah-Hartman <[email protected]>
+
+Fixed paths to original patch by:
+Vesa-Matti Hartikainen <[email protected]>
+ 
+index 0000000..b138b66
+---
+ Documentation/ABI/testing/sysfs-tty |   19 ++++++++++++++
+ drivers/tty/tty_io.c                |   47 ++++++++++++++++++++++++++++++++---
+ drivers/tty/vt/vt.c                 |   23 ++++++++++++++++-
+ include/linux/console.h             |    2 +-
+ kernel/printk.c                     |    2 +
+ 5 files changed, 87 insertions(+), 6 deletions(-)
+ create mode 100644 Documentation/ABI/testing/sysfs-tty
+ 
+diff --git a/Documentation/ABI/testing/sysfs-tty 
b/Documentation/ABI/testing/sysfs-tty
+new file mode 100644
+index 0000000..b138b66
+--- /dev/null
++++ b/Documentation/ABI/testing/sysfs-tty
+@@ -0,0 +1,19 @@
++What:         /sys/class/char/console/active
++Date:         Nov 2010
++Contact:      Kay Sievers <[email protected]>
++Description:
++               Shows the list of currently configured
++               console devices, like 'tty1 ttyS0'.
++               The last entry in the file is the active
++               device connected to /dev/console.
++               The file supports poll() to detect virtual
++               console switches.
++
++What:         /sys/class/char/tty0/active
++Date:         Nov 2010
++Contact:      Kay Sievers <[email protected]>
++Description:
++               Shows the currently active virtual console
++               device, like 'tty1'.
++               The file supports poll() to detect virtual
++               console switches.
+diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
+index 35480dd..cb9cb95 100644
+--- a/drivers/char/tty_io.c
++++ b/drivers/char/tty_io.c
+@@ -3241,9 +3241,45 @@ static int __init tty_class_init(void)
+ postcore_initcall(tty_class_init);
+ 
+ /* 3/2004 jmc: why do these devices exist? */
+-
+ static struct cdev tty_cdev, console_cdev;
+ 
++static ssize_t show_cons_active(struct device *dev,
++                              struct device_attribute *attr, char *buf)
++{
++      struct console *cs[16];
++      int i = 0;
++      struct console *c;
++      ssize_t count = 0;
++
++      acquire_console_sem();
++      for (c = console_drivers; c; c = c->next) {
++              if (!c->device)
++                      continue;
++              if (!c->write)
++                      continue;
++              if ((c->flags & CON_ENABLED) == 0)
++                      continue;
++              cs[i++] = c;
++              if (i >= ARRAY_SIZE(cs))
++                      break;
++      }
++      while (i--)
++              count += sprintf(buf + count, "%s%d%c",
++                               cs[i]->name, cs[i]->index, i ? ' ':'\n');
++      release_console_sem();
++
++      return count;
++}
++static DEVICE_ATTR(active, S_IRUGO, show_cons_active, NULL);
++
++static struct device *consdev;
++
++void console_sysfs_notify(void)
++{
++      if (consdev)
++              sysfs_notify(&consdev->kobj, NULL, "active");
++}
++
+ /*
+  * Ok, now we can initialize the rest of the tty devices and can count
+  * on memory allocations, interrupts etc..
+@@ -3254,15 +3290,18 @@ int __init tty_init(void)
+       if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) ||
+           register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)
+               panic("Couldn't register /dev/tty driver\n");
+-      device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL,
+-                            "tty");
++      device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty");
+ 
+       cdev_init(&console_cdev, &console_fops);
+       if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) ||
+           register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 
0)
+               panic("Couldn't register /dev/console driver\n");
+-      device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL,
++      consdev = device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL,
+                             "console");
++      if (IS_ERR(consdev))
++              consdev = NULL;
++      else
++              device_create_file(consdev, &dev_attr_active);
+ 
+ #ifdef CONFIG_VT
+       vty_init(&console_fops);
+diff --git a/drivers/char/vt.c b/drivers/char/vt.c
+index a8ec48e..76407ec 100644
+--- a/drivers/char/vt.c
++++ b/drivers/char/vt.c
+@@ -236,6 +236,14 @@ enum {
+ };
+ 
+ /*
++ * /sys/class/char/tty0/
++ *
++ * the attribute 'active' contains the name of the current vc
++ * console and it supports poll() to detect vc switches
++ */
++static struct device *tty0dev;
++
++/*
+  * Notifier list for console events.
+  */
+ static ATOMIC_NOTIFIER_HEAD(vt_notifier_list);
+@@ -688,6 +696,8 @@ void redraw_screen(struct vc_data *vc, int is_switch)
+                       save_screen(old_vc);
+                       set_origin(old_vc);
+               }
++              if (tty0dev)
++                      sysfs_notify(&tty0dev->kobj, NULL, "active");
+       } else {
+               hide_cursor(vc);
+               redraw = 1;
+@@ -2967,13 +2977,24 @@ static const struct tty_operations con_ops = {
+ 
+ static struct cdev vc0_cdev;
+ 
++static ssize_t show_tty_active(struct device *dev,
++                              struct device_attribute *attr, char *buf)
++{
++      return sprintf(buf, "tty%d\n", fg_console + 1);
++}
++static DEVICE_ATTR(active, S_IRUGO, show_tty_active, NULL);
++
+ int __init vty_init(const struct file_operations *console_fops)
+ {
+       cdev_init(&vc0_cdev, console_fops);
+       if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
+           register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
+               panic("Couldn't register /dev/tty0 driver\n");
+-      device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
++      tty0dev = device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, 
"tty0");
++      if (IS_ERR(tty0dev))
++              tty0dev = NULL;
++      else
++              device_create_file(tty0dev, &dev_attr_active);
+ 
+       vcs_init();
+ 
+diff --git a/include/linux/console.h b/include/linux/console.h
+index 95cf6f0..0752d92 100644
+--- a/include/linux/console.h
++++ b/include/linux/console.h
+@@ -145,7 +145,7 @@ extern int is_console_locked(void);
+ extern int braille_register_console(struct console *, int index,
+               char *console_options, char *braille_options);
+ extern int braille_unregister_console(struct console *);
+-
++extern void console_sysfs_notify(void);
+ extern int console_suspend_enabled;
+ 
+ /* Suspend and resume console messages over PM events */
(23 more lines skipped)

++++++ series
--- series
+++ series
@@ -120,4 +120,7 @@
 0001-fix-power-draw-for-g_multi.patch
 
 # Fix for 20110105 kernel
-000-kcflag-mno-unaligned-access.patch
\ No newline at end of file
+000-kcflag-mno-unaligned-access.patch
+
+# Fix for NEMO#46
+linux-2.6.38-tty-add-active-sysfs-attribute-to-tty0-and-console-d.patch



Reply via email to