Skip to content

Commit 42405cb

Browse files
hvilleneuvedoogregkh
authored andcommitted
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>
1 parent bee8828 commit 42405cb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/tty/serial/sc16is7xx.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,10 @@ EXPORT_SYMBOL_GPL(sc16is762_devtype);
499499
static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg)
500500
{
501501
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 */
506506
case SC16IS7XX_SPR_REG: /* Shared address space with TLR & XOFF2 */
507507
case SC16IS7XX_TXLVL_REG:
508508
case SC16IS7XX_RXLVL_REG:
@@ -711,6 +711,7 @@ static void sc16is7xx_update_mlines(struct sc16is7xx_one *one)
711711
unsigned long flags;
712712
unsigned int status, changed;
713713

714+
/* Lock required as MSR address is shared with TCR and XOFF1. */
714715
lockdep_assert_held_once(&one->lock);
715716

716717
status = sc16is7xx_get_hwmctrl(port);

0 commit comments

Comments
 (0)