Skip to content

Commit

Permalink
Merge tag 'tty-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/gregkh/tty

Pull tty/serial driver updates from Greg KH:
 "Here are the big set of tty and serial driver updates for 5.6-rc1

  Included in here are:
   - dummy_con cleanups (touches lots of arch code)
   - sysrq logic cleanups (touches lots of serial drivers)
   - samsung driver fixes (wasn't really being built)
   - conmakeshash move to tty subdir out of scripts
   - lots of small tty/serial driver updates

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'tty-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits)
  tty: n_hdlc: Use flexible-array member and struct_size() helper
  tty: baudrate: SPARC supports few more baud rates
  tty: baudrate: Synchronise baud_table[] and baud_bits[]
  tty: serial: meson_uart: Add support for kernel debugger
  serial: imx: fix a race condition in receive path
  serial: 8250_bcm2835aux: Document struct bcm2835aux_data
  serial: 8250_bcm2835aux: Use generic remapping code
  serial: 8250_bcm2835aux: Allocate uart_8250_port on stack
  serial: 8250_bcm2835aux: Suppress register_port error on -EPROBE_DEFER
  serial: 8250_bcm2835aux: Suppress clk_get error on -EPROBE_DEFER
  serial: 8250_bcm2835aux: Fix line mismatch on driver unbind
  serial_core: Remove unused member in uart_port
  vt: Correct comment documenting do_take_over_console()
  vt: Delete comment referencing non-existent unbind_con_driver()
  arch/xtensa/setup: Drop dummy_con initialization
  arch/x86/setup: Drop dummy_con initialization
  arch/unicore32/setup: Drop dummy_con initialization
  arch/sparc/setup: Drop dummy_con initialization
  arch/sh/setup: Drop dummy_con initialization
  arch/s390/setup: Drop dummy_con initialization
  ...
  • Loading branch information
torvalds committed Jan 29, 2020
2 parents aac9662 + 85f4c95 commit ca9b5b6
Show file tree
Hide file tree
Showing 106 changed files with 824 additions and 934 deletions.
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6181,6 +6181,12 @@ M: Maxim Levitsky <[email protected]>
S: Maintained
F: drivers/media/rc/ene_ir.*

EPAPR HYPERVISOR BYTE CHANNEL DEVICE DRIVER
M: Laurentiu Tudor <[email protected]>
L: [email protected]
S: Maintained
F: drivers/tty/ehv_bytechan.c

EPSON S1D13XXX FRAMEBUFFER DRIVER
M: Kristoffer Ericson <[email protected]>
S: Maintained
Expand Down
2 changes: 0 additions & 2 deletions arch/alpha/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,6 @@ setup_arch(char **cmdline_p)
#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
conswitchp = &vga_con;
#elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
#endif

Expand Down
4 changes: 0 additions & 4 deletions arch/arc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,6 @@ void __init setup_arch(char **cmdline_p)
*/
root_mountflags &= ~MS_RDONLY;

#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif

arc_unwind_init();
}

Expand Down
2 changes: 0 additions & 2 deletions arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,8 +1164,6 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
conswitchp = &vga_con;
#elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
#endif

Expand Down
3 changes: 0 additions & 3 deletions arch/arm64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,6 @@ void __init setup_arch(char **cmdline_p)
init_task.thread_info.ttbr0 = __pa_symbol(empty_zero_page);
#endif

#ifdef CONFIG_VT
conswitchp = &dummy_con;
#endif
if (boot_args[1] || boot_args[2] || boot_args[3]) {
pr_err("WARNING: x1-x3 nonzero in violation of boot protocol:\n"
"\tx1: %016llx\n\tx2: %016llx\n\tx3: %016llx\n"
Expand Down
4 changes: 0 additions & 4 deletions arch/csky/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_HIGHMEM
kmap_init();
#endif

#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
}

unsigned long va_pa_offset;
Expand Down
3 changes: 0 additions & 3 deletions arch/ia64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,9 +608,6 @@ setup_arch (char **cmdline_p)

#ifdef CONFIG_VT
if (!conswitchp) {
# if defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
# endif
# if defined(CONFIG_VGA_CONSOLE)
/*
* Non-legacy systems may route legacy VGA MMIO range to system
Expand Down
4 changes: 0 additions & 4 deletions arch/m68k/kernel/setup_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@ void __init setup_arch(char **cmdline_p)

parse_early_param();

#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif

switch (m68k_machtype) {
#ifdef CONFIG_AMIGA
case MACH_AMIGA:
Expand Down
4 changes: 0 additions & 4 deletions arch/m68k/kernel/setup_no.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ void __init setup_arch(char **cmdline_p)
memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
boot_command_line[COMMAND_LINE_SIZE-1] = 0;

#if defined(CONFIG_FRAMEBUFFER_CONSOLE) && defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif

/*
* Give all the memory to the bootmap allocator, tell it to put the
* boot mem_map at the start of memory.
Expand Down
1 change: 0 additions & 1 deletion arch/m68k/sun3x/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ void __init config_sun3x(void)
break;
default:
serial_console = 0;
conswitchp = &dummy_con;
break;
}
#endif
Expand Down
4 changes: 0 additions & 4 deletions arch/microblaze/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ void __init setup_arch(char **cmdline_p)
microblaze_cache_init();

xilinx_pci_init();

#if defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
}

#ifdef CONFIG_MTD_UCLINUX
Expand Down
2 changes: 0 additions & 2 deletions arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,6 @@ void __init setup_arch(char **cmdline_p)
#if defined(CONFIG_VT)
#if defined(CONFIG_VGA_CONSOLE)
conswitchp = &vga_con;
#elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
#endif

Expand Down
5 changes: 0 additions & 5 deletions arch/nds32/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,6 @@ void __init setup_arch(char **cmdline_p)

unflatten_and_copy_device_tree();

if(IS_ENABLED(CONFIG_VT)) {
if(IS_ENABLED(CONFIG_DUMMY_CONSOLE))
conswitchp = &dummy_con;
}

*cmdline_p = boot_command_line;
early_trap_init();
}
Expand Down
4 changes: 0 additions & 4 deletions arch/nios2/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,4 @@ void __init setup_arch(char **cmdline_p)
* get kmalloc into gear
*/
paging_init();

#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
}
5 changes: 0 additions & 5 deletions arch/openrisc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,6 @@ void __init setup_arch(char **cmdline_p)
/* paging_init() sets up the MMU and marks all pages as reserved */
paging_init();

#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
if (!conswitchp)
conswitchp = &dummy_con;
#endif

*cmdline_p = boot_command_line;

printk(KERN_INFO "OpenRISC Linux -- http://openrisc.io\n");
Expand Down
4 changes: 0 additions & 4 deletions arch/parisc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ void __init setup_arch(char **cmdline_p)
dma_ops_init();
#endif

#if defined(CONFIG_VT) && defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con; /* we use do_take_over_console() later ! */
#endif

clear_sched_clock_stable();
}

Expand Down
4 changes: 3 additions & 1 deletion arch/powerpc/kernel/legacy_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,10 @@ static void __init fixup_port_irq(int index,
port->irq = virq;

#ifdef CONFIG_SERIAL_8250_FSL
if (of_device_is_compatible(np, "fsl,ns16550"))
if (of_device_is_compatible(np, "fsl,ns16550")) {
port->handle_irq = fsl8250_handle_irq;
port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE);
}
#endif
}

Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/kernel/setup-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,9 +949,6 @@ void __init setup_arch(char **cmdline_p)

early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);

if (IS_ENABLED(CONFIG_DUMMY_CONSOLE))
conswitchp = &dummy_con;

if (ppc_md.setup_arch)
ppc_md.setup_arch();

Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/platforms/cell/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ static void __init cell_setup_arch(void)
init_pci_config_tokens();

cbe_pervasive_init();
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif

mmio_nvram_init();
}
Expand Down
3 changes: 0 additions & 3 deletions arch/powerpc/platforms/maple/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ static void __init maple_setup_arch(void)
/* Lookup PCI hosts */
maple_pci_init();

#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif
maple_use_rtas_reboot_and_halt_if_present();

printk(KERN_DEBUG "Using native/NAP idle loop\n");
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/pasemi/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,6 @@ static void __init pas_setup_arch(void)
/* Lookup PCI hosts */
pas_pci_init();

#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif

/* Remap SDC register for doing reset */
/* XXXOJN This should maybe come out of the device tree */
reset_reg = ioremap(0xfc101100, 4);
Expand Down
4 changes: 0 additions & 4 deletions arch/powerpc/platforms/ps3/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@ static void __init ps3_setup_arch(void)
smp_init_ps3();
#endif

#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif

prealloc_ps3fb_videomemory();
prealloc_ps3flash_bounce_buffer();

Expand Down
4 changes: 0 additions & 4 deletions arch/riscv/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,5 @@ void __init setup_arch(char **cmdline_p)
setup_smp();
#endif

#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif

riscv_fill_hwcap();
}
2 changes: 0 additions & 2 deletions arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,6 @@ static void __init conmode_default(void)
SET_CONSOLE_SCLP;
#endif
}
if (IS_ENABLED(CONFIG_VT) && IS_ENABLED(CONFIG_DUMMY_CONSOLE))
conswitchp = &dummy_con;
}

#ifdef CONFIG_CRASH_DUMP
Expand Down
4 changes: 0 additions & 4 deletions arch/sh/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,6 @@ void __init setup_arch(char **cmdline_p)

paging_init();

#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif

/* Perform the machine specific initialisation */
if (likely(sh_mv.mv_setup))
sh_mv.mv_setup(cmdline_p);
Expand Down
4 changes: 0 additions & 4 deletions arch/sparc/kernel/setup_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,6 @@ void __init setup_arch(char **cmdline_p)
break;
}

#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif

idprom_init();
load_mmu();

Expand Down
4 changes: 0 additions & 4 deletions arch/sparc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,6 @@ void __init setup_arch(char **cmdline_p)
else
pr_info("ARCH: SUN4U\n");

#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif

idprom_init();

if (!root_flags)
Expand Down
2 changes: 0 additions & 2 deletions arch/unicore32/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,6 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
conswitchp = &vga_con;
#elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
#endif
early_trap_init();
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,8 +1228,6 @@ void __init setup_arch(char **cmdline_p)
#if defined(CONFIG_VGA_CONSOLE)
if (!efi_enabled(EFI_BOOT) || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))
conswitchp = &vga_con;
#elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
#endif
#endif
x86_init.oem.banner();
Expand Down
2 changes: 0 additions & 2 deletions arch/xtensa/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_VT
# if defined(CONFIG_VGA_CONSOLE)
conswitchp = &vga_con;
# elif defined(CONFIG_DUMMY_CONSOLE)
conswitchp = &dummy_con;
# endif
#endif
}
Expand Down
15 changes: 9 additions & 6 deletions drivers/char/ttyprintk.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
#include <linux/serial.h>
#include <linux/tty.h>
#include <linux/module.h>
#include <linux/spinlock.h>

struct ttyprintk_port {
struct tty_port port;
struct mutex port_write_mutex;
spinlock_t spinlock;
};

static struct ttyprintk_port tpk_port;
Expand Down Expand Up @@ -99,11 +100,12 @@ static int tpk_open(struct tty_struct *tty, struct file *filp)
static void tpk_close(struct tty_struct *tty, struct file *filp)
{
struct ttyprintk_port *tpkp = tty->driver_data;
unsigned long flags;

mutex_lock(&tpkp->port_write_mutex);
spin_lock_irqsave(&tpkp->spinlock, flags);
/* flush tpk_printk buffer */
tpk_printk(NULL, 0);
mutex_unlock(&tpkp->port_write_mutex);
spin_unlock_irqrestore(&tpkp->spinlock, flags);

tty_port_close(&tpkp->port, tty, filp);
}
Expand All @@ -115,13 +117,14 @@ static int tpk_write(struct tty_struct *tty,
const unsigned char *buf, int count)
{
struct ttyprintk_port *tpkp = tty->driver_data;
unsigned long flags;
int ret;


/* exclusive use of tpk_printk within this tty */
mutex_lock(&tpkp->port_write_mutex);
spin_lock_irqsave(&tpkp->spinlock, flags);
ret = tpk_printk(buf, count);
mutex_unlock(&tpkp->port_write_mutex);
spin_unlock_irqrestore(&tpkp->spinlock, flags);

return ret;
}
Expand Down Expand Up @@ -171,7 +174,7 @@ static int __init ttyprintk_init(void)
{
int ret = -ENOMEM;

mutex_init(&tpk_port.port_write_mutex);
spin_lock_init(&tpk_port.spinlock);

ttyprintk_driver = tty_alloc_driver(1,
TTY_DRIVER_RESET_TERMIOS |
Expand Down
Loading

0 comments on commit ca9b5b6

Please sign in to comment.