From nobody Wed Dec 17 14:10:49 2025 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7DA02C158F; Mon, 27 Oct 2025 14:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761575410; cv=none; b=gmP8VsD/+ocqGCCL/qcvpiD4XdBa0gVItxa+kT9+Rh4dovl/EkQKKG7/YSIE0QRjEaRMDw6OSux/DRbek0mL8Mvlt4DLGJdB69hHPzp0AFcf8SErDUCyuXB69URAvE7Vul4ZcHKKGoqdbzLU+OcHOpTKazBzAO1deHkbNHtgWBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761575410; c=relaxed/simple; bh=3GSup+pKaTPRC904bUvLbtEi8OPatrZ73gmCrwgiD90=; h=From:To:Cc:Date:Message-Id:In-Reply-To:References:MIME-Version: Subject; b=WikUAvh8Bb/5loNPyIVh+SYRfnZrccUqbarSHCy7Ji1zblfo2CZ9Smp3uC9XUuuXLSQkCz7AU+kz/o7LmZ/FPgk2KKZ8PFqODe3ufavdxX3gwO6Qt1YTGD00bdlkbfK96ocjFOmVO0R7Q3EGogD7ofb9l8y68YsEdrssc4WqBjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=vv6Ee9Vm; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="vv6Ee9Vm" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=aJMlqD2Q484a3VTqtujlReqh/fkDfF327hDpwcyhVMY=; b=vv6Ee9VmPW8bLYWF7puBb5nw2r wQSTyQyAZk0+53MzF6VpcFkJKeXev0n2zWdaXjSH5IgWsrKBrlzC0/7v/39QThnl7M7pqLvtFP3p/ +5/kI5aSB88B/EspO2Iy+7rCT2Gnm8eJTsGKzlwOMgBkHIrZy2yzc0FxaLLIaVA6GVF8=; Received: from [70.80.174.168] (port=45472 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1vDOET-0007wg-Qm; Mon, 27 Oct 2025 10:30:02 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve Date: Mon, 27 Oct 2025 10:29:44 -0400 Message-Id: <20251027142957.1032073-3-hugo@hugovil.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20251027142957.1032073-1-hugo@hugovil.com> References: <20251027142957.1032073-1-hugo@hugovil.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Level: X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP Subject: [PATCH v3 02/14] serial: sc16is7xx: rename EFR mutex with generic name X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Content-Type: text/plain; charset="utf-8" From: Hugo Villeneuve This mutex is used as a lock when accessing registers that share the same address space, not necessarily EFR registers. For example, address 0x06 is shared by MSR, TCR and XOFF1 registers, independently of EFR. Rename the mutex with a more generic name to avoid misinterpreting its usage. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 330d95446f1d7..26b34f23ed5fe 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -330,7 +330,7 @@ struct sc16is7xx_one_config { struct sc16is7xx_one { struct uart_port port; struct regmap *regmap; - struct mutex efr_lock; /* EFR registers access */ + struct mutex lock; /* For registers sharing same address space. */ struct kthread_work tx_work; struct kthread_work reg_work; struct kthread_delayed_work ms_work; @@ -438,7 +438,7 @@ static void sc16is7xx_efr_lock(struct uart_port *port) { struct sc16is7xx_one *one =3D to_sc16is7xx_one(port, port); =20 - mutex_lock(&one->efr_lock); + mutex_lock(&one->lock); =20 /* Backup content of LCR. */ one->old_lcr =3D sc16is7xx_port_read(port, SC16IS7XX_LCR_REG); @@ -460,7 +460,7 @@ static void sc16is7xx_efr_unlock(struct uart_port *port) /* Restore original content of LCR */ sc16is7xx_port_write(port, SC16IS7XX_LCR_REG, one->old_lcr); =20 - mutex_unlock(&one->efr_lock); + mutex_unlock(&one->lock); } =20 static void sc16is7xx_ier_clear(struct uart_port *port, u8 bit) @@ -595,7 +595,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, i= nt baud) SC16IS7XX_MCR_CLKSEL_BIT, prescaler =3D=3D 1 ? 0 : SC16IS7XX_MCR_CLKSEL_BIT); =20 - mutex_lock(&one->efr_lock); + mutex_lock(&one->lock); =20 /* Backup LCR and access special register set (DLL/DLH) */ lcr =3D sc16is7xx_port_read(port, SC16IS7XX_LCR_REG); @@ -611,7 +611,7 @@ static int sc16is7xx_set_baud(struct uart_port *port, i= nt baud) /* Restore LCR and access to general register set */ sc16is7xx_port_write(port, SC16IS7XX_LCR_REG, lcr); =20 - mutex_unlock(&one->efr_lock); + mutex_unlock(&one->lock); =20 return DIV_ROUND_CLOSEST((clk / prescaler) / 16, div); } @@ -758,7 +758,7 @@ static void sc16is7xx_update_mlines(struct sc16is7xx_on= e *one) unsigned long flags; unsigned int status, changed; =20 - lockdep_assert_held_once(&one->efr_lock); + lockdep_assert_held_once(&one->lock); =20 status =3D sc16is7xx_get_hwmctrl(port); changed =3D status ^ one->old_mctrl; @@ -789,7 +789,7 @@ static bool sc16is7xx_port_irq(struct sc16is7xx_port *s= , int portno) struct uart_port *port =3D &s->p[portno].port; struct sc16is7xx_one *one =3D to_sc16is7xx_one(port, port); =20 - mutex_lock(&one->efr_lock); + mutex_lock(&one->lock); =20 iir =3D sc16is7xx_port_read(port, SC16IS7XX_IIR_REG); if (iir & SC16IS7XX_IIR_NO_INT_BIT) { @@ -836,7 +836,7 @@ static bool sc16is7xx_port_irq(struct sc16is7xx_port *s= , int portno) } =20 out_port_irq: - mutex_unlock(&one->efr_lock); + mutex_unlock(&one->lock); =20 return rc; } @@ -880,9 +880,9 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws) (port->rs485.delay_rts_before_send > 0)) msleep(port->rs485.delay_rts_before_send); =20 - mutex_lock(&one->efr_lock); + mutex_lock(&one->lock); sc16is7xx_handle_tx(port); - mutex_unlock(&one->efr_lock); + mutex_unlock(&one->lock); } =20 static void sc16is7xx_reconf_rs485(struct uart_port *port) @@ -949,9 +949,9 @@ static void sc16is7xx_ms_proc(struct kthread_work *ws) struct sc16is7xx_port *s =3D dev_get_drvdata(one->port.dev); =20 if (one->port.state) { - mutex_lock(&one->efr_lock); + mutex_lock(&one->lock); sc16is7xx_update_mlines(one); - mutex_unlock(&one->efr_lock); + mutex_unlock(&one->lock); =20 kthread_queue_delayed_work(&s->kworker, &one->ms_work, HZ); } @@ -1625,7 +1625,7 @@ int sc16is7xx_probe(struct device *dev, const struct = sc16is7xx_devtype *devtype, s->p[i].old_mctrl =3D 0; s->p[i].regmap =3D regmaps[i]; =20 - mutex_init(&s->p[i].efr_lock); + mutex_init(&s->p[i].lock); =20 ret =3D uart_get_rs485_mode(&s->p[i].port); if (ret) --=20 2.39.5