serial: core: Remove BUG_ON(in_interrupt()) check
The usage of in_interrupt() in drivers is phased out for various reasons. In both exported functions where BUG_ON(in_interrupt()) is invoked, there is a mutex_lock() afterwards. mutex_lock() contains a might_sleep() which will already trigger a stack trace if the target functions is called from atomic context. Remove the BUG_ON() and add a "Context: " in the kernel-doc instead. Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Link: https://lore.kernel.org/r/20210208181615.381861-3-bigeasy@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>master
parent
151db8c08c
commit
a157270fbf
|
@ -2848,6 +2848,8 @@ static const struct attribute_group tty_dev_attr_group = {
|
||||||
* @drv: pointer to the uart low level driver structure for this port
|
* @drv: pointer to the uart low level driver structure for this port
|
||||||
* @uport: uart port structure to use for this port.
|
* @uport: uart port structure to use for this port.
|
||||||
*
|
*
|
||||||
|
* Context: task context, might sleep
|
||||||
|
*
|
||||||
* This allows the driver to register its own uart_port structure
|
* This allows the driver to register its own uart_port structure
|
||||||
* with the core driver. The main purpose is to allow the low
|
* with the core driver. The main purpose is to allow the low
|
||||||
* level uart drivers to expand uart_port, rather than having yet
|
* level uart drivers to expand uart_port, rather than having yet
|
||||||
|
@ -2861,8 +2863,6 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
|
||||||
struct device *tty_dev;
|
struct device *tty_dev;
|
||||||
int num_groups;
|
int num_groups;
|
||||||
|
|
||||||
BUG_ON(in_interrupt());
|
|
||||||
|
|
||||||
if (uport->line >= drv->nr)
|
if (uport->line >= drv->nr)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -2951,6 +2951,8 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
|
||||||
* @drv: pointer to the uart low level driver structure for this port
|
* @drv: pointer to the uart low level driver structure for this port
|
||||||
* @uport: uart port structure for this port
|
* @uport: uart port structure for this port
|
||||||
*
|
*
|
||||||
|
* Context: task context, might sleep
|
||||||
|
*
|
||||||
* This unhooks (and hangs up) the specified port structure from the
|
* This unhooks (and hangs up) the specified port structure from the
|
||||||
* core driver. No further calls will be made to the low-level code
|
* core driver. No further calls will be made to the low-level code
|
||||||
* for this port.
|
* for this port.
|
||||||
|
@ -2963,8 +2965,6 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *uport)
|
||||||
struct tty_struct *tty;
|
struct tty_struct *tty;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
BUG_ON(in_interrupt());
|
|
||||||
|
|
||||||
mutex_lock(&port_mutex);
|
mutex_lock(&port_mutex);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue