linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular
@ 2015-10-18 22:21 Paul Gortmaker
  2015-10-18 22:21 ` [PATCH 5/5] drivers/tty/serial: make 8250/8250_mtk.c " Paul Gortmaker
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Paul Gortmaker @ 2015-10-18 22:21 UTC (permalink / raw)
  To: linux-arm-kernel

This next set of patches to drivers/tty fixes up more drivers that would
perhaps appear modular when looking at the code, but are controlled by
a bool Kconfig.  We make sure they don't look modular and get rid
of module related code in the drivers that would never be used.

The one common thread here for all the patches is that we also
scrap the .remove functions which would only be used for module
unload (impossible) and driver unbind.  For the drivers here, there
doesn't seem to be a sensible unbind use case (vs. e.g. a multiport
PCI ethernet driver where one port is unbound and passed through to
a kvm guest or similar).  Hence we just explicitly disallow any
driver unbind operations to help prevent root from doing something
illogical to the machine that they could have done previously.

We've already done this for drivers/tty/serial/mpsc.c previously.

Build tested for allmodconfig on ARM64 and powerpc for tty/tty-testing.

Paul.

---

Cc: Andy Gross <agross@codeaurora.org>
Cc: Anton Blanchard <anton@samba.org>
Cc: David Brown <davidb@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-arm-msm at vger.kernel.org
Cc: linux-mediatek at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-serial at vger.kernel.org
Cc: linux-soc at vger.kernel.org

Paul Gortmaker (5):
  drivers/tty: make hvc/hvc_vio.c explicitly non-modular
  drivers/tty: make ehv_bytechan.c explicitly non-modular
  drivers/tty/serial: make serial/atmel_serial.c explicitly non-modular
  drivers/tty/serial: make msm_serial.c explicitly non-modular
  drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular

 drivers/tty/ehv_bytechan.c         | 40 +++------------------------------
 drivers/tty/hvc/hvc_vio.c          | 29 ++++--------------------
 drivers/tty/serial/8250/8250_mtk.c | 35 ++++++-----------------------
 drivers/tty/serial/atmel_serial.c  | 45 ++++----------------------------------
 drivers/tty/serial/msm_serial.c    | 30 ++++---------------------
 5 files changed, 22 insertions(+), 157 deletions(-)

-- 
2.6.1

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular
@ 2015-08-09  0:51 Paul Gortmaker
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Gortmaker @ 2015-08-09  0:51 UTC (permalink / raw)
  To: linux-arm-kernel

This second set of patches to drivers/tty steps outside of the serial
dir, and an improved auditing finds two more serial drivers pretending
to be modular that really are not.

The reasoning for doing this is the same as the first set[1] of patches
and is largely copied below:

  In the previous merge window, we made changes to allow better
  delineation between modular and non-modular code in commit
  0fd972a7d91d6e15393c449492a04d94c0b89351 ("module: relocate module_init
  from init.h to module.h").  This allows us to now ensure module code
  looks modular and non-modular code does not accidentally look modular
  without suffering build breakage.
  
  Here we target code that is, by nature of their Kconfig settings, only
  available to be built-in, but implicitly presenting itself as being
  possibly modular by way of using modular headers, macros, and functions.
  
  The goal here is to remove that illusion of modularity from these
  drivers, but in a way that leaves the actual runtime unchanged.
  In doing so, we remove code that has never been tested and adds
  no value to the tree.  And we begin the process of expecting a
  level of consistency between the Kconfig of a driver and the code
  that the driver uses.
  
Build tested for allyesconfig on x86_64, and ARM for lpc81xx, and powerpc
for hvc_console and mpsc, layered onto tty/tty-next as a baseline.

Paul.

[1] https://lkml.kernel.org/r/1437530538-5078-1-git-send-email-paul.gortmaker at windriver.com
--

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Joachim Eastwood <manabian@gmail.com>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linuxppc-dev at lists.ozlabs.org
Cc: linux-serial at vger.kernel.org

Paul Gortmaker (5):
  drivers/tty: make pty.c slightly more explicitly non-modular
  drivers/tty: make sysrq.c slightly more explicitly non-modular
  drivers/tty: make hvc_console.c explicitly non-modular
  drivers/tty: make serial/mpsc.c driver explicitly non-modular
  drivers/tty: make serial 8250_lpc18xx.c explicitly non-modular

 drivers/tty/hvc/hvc_console.c          | 18 +----------------
 drivers/tty/pty.c                      |  7 +++++--
 drivers/tty/serial/8250/8250_lpc18xx.c | 19 ++++--------------
 drivers/tty/serial/mpsc.c              | 36 +++-------------------------------
 drivers/tty/sysrq.c                    |  6 +++++-
 5 files changed, 18 insertions(+), 68 deletions(-)

-- 
2.5.0

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

end of thread, other threads:[~2015-12-15 22:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-18 22:21 [PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular Paul Gortmaker
2015-10-18 22:21 ` [PATCH 5/5] drivers/tty/serial: make 8250/8250_mtk.c " Paul Gortmaker
2015-10-20 15:10 ` [PATCH 0/5] drivers/tty: make more bool drivers " Alexandre Belloni
2015-10-21  0:20   ` Paul Gortmaker
2015-10-21  8:38     ` Alexandre Belloni
2015-12-15 22:29 ` Paul Gortmaker
  -- strict thread matches above, loose matches on Subject: below --
2015-08-09  0:51 Paul Gortmaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).