[kernel/f17] Add patch to allow "8250." prefix to keep working (rhbz 911771)
Josh Boyer
jwboyer at fedoraproject.org
Mon Mar 11 19:00:54 UTC 2013
commit 9a0a8c2024bcc15c19f5e47157fb174d8b8ca18c
Author: Josh Boyer <jwboyer at redhat.com>
Date: Mon Mar 11 14:59:03 2013 -0400
Add patch to allow "8250." prefix to keep working (rhbz 911771)
kernel.spec | 7 ++
...-Keep-8250.-xxxx-module-options-functiona.patch | 63 ++++++++++++++++++++
2 files changed, 70 insertions(+), 0 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 4bef27a..7883325 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -769,6 +769,9 @@ Patch24104: TTY-do-not-reset-master-s-packet-mode.patch
#rhbz 857954
Patch24105: w1-fix-oops-when-w1_search-is-called-from.patch
+#rhbz 911771
+Patch24106: serial-8250-Keep-8250.-xxxx-module-options-functiona.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1496,6 +1499,9 @@ ApplyPatch TTY-do-not-reset-master-s-packet-mode.patch
#rhbz 857954
ApplyPatch w1-fix-oops-when-w1_search-is-called-from.patch
+#rhbz 911771
+ApplyPatch serial-8250-Keep-8250.-xxxx-module-options-functiona.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -2353,6 +2359,7 @@ fi
# '-'
%changelog
* Mon Mar 11 2013 Josh Boyer <jwboyer at redhat.com>
+- Add patch to allow "8250." prefix to keep working (rhbz 911771)
- Add patch to fix w1_search oops (rhbz 857954)
- Add patch to fix broken tty handling (rhbz 904182)
diff --git a/serial-8250-Keep-8250.-xxxx-module-options-functiona.patch b/serial-8250-Keep-8250.-xxxx-module-options-functiona.patch
new file mode 100644
index 0000000..b16be44
--- /dev/null
+++ b/serial-8250-Keep-8250.-xxxx-module-options-functiona.patch
@@ -0,0 +1,63 @@
+From e94256528a988231ccc7a2a0b6b206a1131cb358 Mon Sep 17 00:00:00 2001
+From: Josh Boyer <jwboyer at redhat.com>
+Date: Fri, 8 Mar 2013 21:13:52 -0500
+Subject: [PATCH] serial: 8250: Keep 8250.<xxxx> module options functional
+ after driver rename
+
+With commit 835d844d1 (8250_pnp: do pnp probe before legacy probe), the
+8250 driver was renamed to 8250_core. This means any existing usage of
+the 8259.<xxxx> module parameters or as a kernel command line switch is
+now broken, as the 8250_core driver doesn't parse options belonging to
+something called "8250".
+
+To solve this, we redefine the module options in a dummy function using
+a redefined MODULE_PARAM_PREFX when built into the kernel. In the case
+where we're building as a module, we provide an alias to the old 8250
+name. The dummy function prevents compiler errors due to global variable
+redefinitions that happen as part of the module_param_ macro expansions.
+
+Signed-off-by: Josh Boyer <jwboyer at redhat.com>
+---
+ drivers/tty/serial/8250/8250.c | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
+index 0efc815..f982633 100644
+--- a/drivers/tty/serial/8250/8250.c
++++ b/drivers/tty/serial/8250/8250.c
+@@ -3396,3 +3396,32 @@ module_param_array(probe_rsa, ulong, &probe_rsa_count, 0444);
+ MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
+ #endif
+ MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
++
++#ifndef MODULE
++/* This module was renamed to 8250_core in 3.7. Keep the old "8250" name
++ * working as well for the module options so we don't break people. We
++ * need to keep the names identical and the convenient macros will happily
++ * refuse to let us do that by failing the build with redefinition errors
++ * of global variables. So we stick them inside a dummy function to avoid
++ * those conflicts. The options still get parsed, and the redefined
++ * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive.
++ *
++ * This is hacky. I'm sorry.
++ */
++static void __used s8250_options(void)
++{
++#undef MODULE_PARAM_PREFIX
++#define MODULE_PARAM_PREFIX "8250."
++
++ module_param_cb(share_irqs, ¶m_ops_uint, &share_irqs, 0644);
++ module_param_cb(nr_uarts, ¶m_ops_uint, &nr_uarts, 0644);
++ module_param_cb(skip_txen_test, ¶m_ops_uint, &skip_txen_test, 0644);
++#ifdef CONFIG_SERIAL_8250_RSA
++ __module_param_call(MODULE_PARAM_PREFIX, probe_rsa,
++ ¶m_array_ops, .arr = &__param_arr_probe_rsa,
++ 0444, -1);
++#endif
++}
++#else
++MODULE_ALIAS("8250");
++#endif
+--
+1.8.1.2
+
More information about the scm-commits
mailing list