All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] serial: sysrq cleanup and stm32 fixes
@ 2021-04-16 14:05 Johan Hovold
  2021-04-16 14:05 ` [PATCH 1/3] serial: do not restore interrupt state in sysrq helper Johan Hovold
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Johan Hovold @ 2021-04-16 14:05 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, Maxime Coquelin, Alexandre Torgue, dillon.minfei,
	Erwan Le Ray, linux-serial, linux-kernel, Johan Hovold

The first patch cleans up the interrupt handlers that rely on deferred
sysrq processing by not needlessly saving the interrupt state.

The second fixes the threaded interrupt handling of the stm32 driver
and properly fixes a couple of deadlocks that were incidentally worked
around by a recent commit.

The third patch cleans up the stm32 console implementation by switching
to deferred sysrq processing, thereby making the console code more
robust and allowing it to be used with PREEMPT_RT.

This series is against tty-next and and have only been compile tested.

Johan


Johan Hovold (3):
  serial: do not restore interrupt state in sysrq helper
  serial: stm32: fix threaded interrupt handling
  serial: stm32: defer sysrq processing

 drivers/tty/serial/8250/8250_aspeed_vuart.c |  5 ++-
 drivers/tty/serial/8250/8250_fsl.c          | 11 ++++---
 drivers/tty/serial/8250/8250_omap.c         |  6 ++--
 drivers/tty/serial/8250/8250_port.c         |  6 ++--
 drivers/tty/serial/qcom_geni_serial.c       |  6 ++--
 drivers/tty/serial/stm32-usart.c            | 36 ++++++++++-----------
 include/linux/serial_core.h                 | 10 +++---
 7 files changed, 39 insertions(+), 41 deletions(-)

-- 
2.26.3


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] serial: stm32: defer sysrq processing
@ 2021-04-20 23:04 kernel test robot
  0 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2021-04-20 23:04 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5671 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210416140557.25177-4-johan@kernel.org>
References: <20210416140557.25177-4-johan@kernel.org>
TO: Johan Hovold <johan@kernel.org>
TO: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
CC: Jiri Slaby <jirislaby@kernel.org>
CC: Maxime Coquelin <mcoquelin.stm32@gmail.com>
CC: Alexandre Torgue <alexandre.torgue@foss.st.com>
CC: dillon.minfei(a)gmail.com
CC: Erwan Le Ray <erwan.leray@foss.st.com>
CC: linux-serial(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: Johan Hovold <johan@kernel.org>

Hi Johan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on next-20210420]
[cannot apply to stm32/stm32-next usb/usb-testing v5.12-rc8]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Johan-Hovold/serial-sysrq-cleanup-and-stm32-fixes/20210416-221336
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: arm64-randconfig-s032-20210420 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/4554917dbd6d9c8d915616e748d7d1471d3b1366
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Johan-Hovold/serial-sysrq-cleanup-and-stm32-fixes/20210416-221336
        git checkout 4554917dbd6d9c8d915616e748d7d1471d3b1366
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)
   drivers/tty/serial/stm32-usart.c: note: in included file:
   drivers/tty/serial/stm32-usart.h:42:25: sparse: sparse: symbol 'stm32f4_info' was not declared. Should it be static?
   drivers/tty/serial/stm32-usart.h:63:25: sparse: sparse: symbol 'stm32f7_info' was not declared. Should it be static?
   drivers/tty/serial/stm32-usart.h:85:25: sparse: sparse: symbol 'stm32h7_info' was not declared. Should it be static?
>> drivers/tty/serial/stm32-usart.c:1449:9: sparse: sparse: context imbalance in 'stm32_usart_console_write' - different lock contexts for basic block

vim +/stm32_usart_console_write +1449 drivers/tty/serial/stm32-usart.c

48a6092fb41fab Maxime Coquelin  2015-06-10  1421  
56f9a76c27b51b Erwan Le Ray     2021-01-06  1422  static void stm32_usart_console_write(struct console *co, const char *s,
92fc00238675a1 Erwan Le Ray     2021-01-06  1423  				      unsigned int cnt)
48a6092fb41fab Maxime Coquelin  2015-06-10  1424  {
48a6092fb41fab Maxime Coquelin  2015-06-10  1425  	struct uart_port *port = &stm32_ports[co->index].port;
ada8618ff3bfe1 Alexandre TORGUE 2016-09-15  1426  	struct stm32_port *stm32_port = to_stm32_port(port);
d825f0bea20f49 Stephen Boyd     2021-01-22  1427  	const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
d825f0bea20f49 Stephen Boyd     2021-01-22  1428  	const struct stm32_usart_config *cfg = &stm32_port->info->cfg;
48a6092fb41fab Maxime Coquelin  2015-06-10  1429  	unsigned long flags;
48a6092fb41fab Maxime Coquelin  2015-06-10  1430  	u32 old_cr1, new_cr1;
48a6092fb41fab Maxime Coquelin  2015-06-10  1431  	int locked = 1;
48a6092fb41fab Maxime Coquelin  2015-06-10  1432  
4554917dbd6d9c Johan Hovold     2021-04-16  1433  	if (oops_in_progress)
4554917dbd6d9c Johan Hovold     2021-04-16  1434  		locked = spin_trylock_irqsave(&port->lock, flags);
48a6092fb41fab Maxime Coquelin  2015-06-10  1435  	else
4554917dbd6d9c Johan Hovold     2021-04-16  1436  		spin_lock_irqsave(&port->lock, flags);
48a6092fb41fab Maxime Coquelin  2015-06-10  1437  
87f1f809c9b909 Alexandre TORGUE 2016-09-15  1438  	/* Save and disable interrupts, enable the transmitter */
ada8618ff3bfe1 Alexandre TORGUE 2016-09-15  1439  	old_cr1 = readl_relaxed(port->membase + ofs->cr1);
48a6092fb41fab Maxime Coquelin  2015-06-10  1440  	new_cr1 = old_cr1 & ~USART_CR1_IE_MASK;
87f1f809c9b909 Alexandre TORGUE 2016-09-15  1441  	new_cr1 |=  USART_CR1_TE | BIT(cfg->uart_enable_bit);
ada8618ff3bfe1 Alexandre TORGUE 2016-09-15  1442  	writel_relaxed(new_cr1, port->membase + ofs->cr1);
48a6092fb41fab Maxime Coquelin  2015-06-10  1443  
56f9a76c27b51b Erwan Le Ray     2021-01-06  1444  	uart_console_write(port, s, cnt, stm32_usart_console_putchar);
48a6092fb41fab Maxime Coquelin  2015-06-10  1445  
48a6092fb41fab Maxime Coquelin  2015-06-10  1446  	/* Restore interrupt state */
ada8618ff3bfe1 Alexandre TORGUE 2016-09-15  1447  	writel_relaxed(old_cr1, port->membase + ofs->cr1);
48a6092fb41fab Maxime Coquelin  2015-06-10  1448  
48a6092fb41fab Maxime Coquelin  2015-06-10 @1449  	if (locked)
4554917dbd6d9c Johan Hovold     2021-04-16  1450  		spin_unlock_irqrestore(&port->lock, flags);
48a6092fb41fab Maxime Coquelin  2015-06-10  1451  }
48a6092fb41fab Maxime Coquelin  2015-06-10  1452  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 43421 bytes --]

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

end of thread, other threads:[~2021-04-22  9:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-16 14:05 [PATCH 0/3] serial: sysrq cleanup and stm32 fixes Johan Hovold
2021-04-16 14:05 ` [PATCH 1/3] serial: do not restore interrupt state in sysrq helper Johan Hovold
2021-04-16 14:05 ` [PATCH 2/3] serial: stm32: fix threaded interrupt handling Johan Hovold
2021-04-16 14:19   ` Johan Hovold
     [not found]   ` <CAL9mu0KwgOFQfa8ft4rB6+F=KLd1gZLYDvwpAW72zPAFntehVw@mail.gmail.com>
2021-04-16 14:46     ` Johan Hovold
2021-04-22  9:34   ` Valentin CARON - foss
2021-04-16 14:05 ` [PATCH 3/3] serial: stm32: defer sysrq processing Johan Hovold
2021-04-22  9:36   ` Valentin CARON - foss
  -- strict thread matches above, loose matches on Subject: below --
2021-04-20 23:04 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.