Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: sc16is7xx: add comments for lock requirements

Indicate why lock needs to be asserted when accessing
MSR register, as this is not immediately obvious when looking at this
register in the device datasheet.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://patch.msgid.link/20251027142957.1032073-15-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Hugo Villeneuve and committed by
Greg Kroah-Hartman
42405cb7 bee8828a

+5 -4
+5 -4
drivers/tty/serial/sc16is7xx.c
··· 499 499 static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg) 500 500 { 501 501 switch (reg) { 502 - case SC16IS7XX_RHR_REG: 503 - case SC16IS7XX_IIR_REG: 504 - case SC16IS7XX_LSR_REG: 505 - case SC16IS7XX_MSR_REG: 502 + case SC16IS7XX_RHR_REG: /* Shared address space with THR & DLL */ 503 + case SC16IS7XX_IIR_REG: /* Shared address space with FCR & EFR */ 504 + case SC16IS7XX_LSR_REG: /* Shared address space with XON2 */ 505 + case SC16IS7XX_MSR_REG: /* Shared address space with TCR & XOFF1 */ 506 506 case SC16IS7XX_SPR_REG: /* Shared address space with TLR & XOFF2 */ 507 507 case SC16IS7XX_TXLVL_REG: 508 508 case SC16IS7XX_RXLVL_REG: ··· 711 711 unsigned long flags; 712 712 unsigned int status, changed; 713 713 714 + /* Lock required as MSR address is shared with TCR and XOFF1. */ 714 715 lockdep_assert_held_once(&one->lock); 715 716 716 717 status = sc16is7xx_get_hwmctrl(port);