Thread (5 messages) 5 messages, 2 authors, 2022-07-12

Re: [PATCH v3] tty: serial: samsung_tty: loopback mode support

From: Marek Szyprowski <m.szyprowski@samsung.com>
Date: 2022-07-12 14:01:13
Also in: linux-samsung-soc, linux-serial

On 12.07.2022 02:44, Chanho Park wrote:
quoted
quoted
+	if (mctrl & TIOCM_LOOP)
+		ucon |= S3C2410_UCON_LOOPBACK;
+	else
+		ucon &= ~S3C2410_UCON_LOOPBACK;
+
+	wr_regl(port, S3C2410_UCON, ucon);
S3C2410_UCON must be modified at least under the local_irq_save() or port
lock, otherwise it breaks kernel console operation on older Exynos SoCs
(especially when DMA mode is used).

The above read-modify-write sequence should be replaced with the following
pattern:

          if (mctrl & TIOCM_LOOP)
                  s3c24xx_set_bit(port, S3C2410_UCON_LOOPBACK, S3C2410_UCON);
          else
                  s3c24xx_clear_bit(port, S3C2410_UCON_LOOPBACK, S3C2410_UCON);
All the set_mctrl() call can be protected by spin_[un]lock_irq[save/restore] with port->lock.
So, I think it is not required.
Right. The problem is elsewhere. You used rd_reg(port, S3C2410_UCON) 
instead of rd_regl(port, S3C2410_UCON) what always zeroed upper bits. I 
will send a fix in a few minutes.


Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help