All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tapio Reijonen" <tapio.reijonen@vaisala.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v2 1/3] serial: core: Forget the RS485 GPIO descriptors when a port is removed
Date: Thu, 05 Nov 2026 07:25:57 +0000	[thread overview]
Message-ID: <sashiko-outbox-198665@kernel.org> (raw)
In-Reply-To: <20261105-serial-rs485-mode-gpio-v2-1-027e5348892f@vaisala.com>

> The RS485 termination and RX-during-TX GPIO descriptors are acquired
> with devm on behalf of the port's device in uart_get_rs485_mode() and
> stored in struct uart_port, but nothing ever clears them. A uart_port
> can outlive the device it was registered with: the 8250 core keeps its
> ports in a static array, re-adds an unregistered entry as a placeholder
> and hands it to the next device that claims the slot. If that device
> has no RS485 support or no firmware node, uart_get_rs485_mode() returns
> before acquiring anything and the stale descriptors stay in place,
> pointing at lines that devres has already released. Enabling RS485 on
> such a port then drives GPIO lines the port no longer owns. The same
> happens when uart_get_rs485_mode() itself fails after the first
> descriptor was acquired.
> 
> Forget the descriptors when a port is removed, on entry to
> uart_get_rs485_mode() and on its error paths, so a port only ever
> carries descriptors acquired for its current device.
> 
> Signed-off-by: Tapio Reijonen <tapio.reijonen@vaisala.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105-serial-rs485-mode-gpio-v2-0-027e5348892f@vaisala.com?part=1


  reply	other threads:[~2026-11-05  7:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  7:12 [PATCH v2 0/3] serial: core: add transceiver interface select GPIO Tapio Reijonen
2026-11-05  7:12 ` [PATCH v2 1/3] serial: core: Forget the RS485 GPIO descriptors when a port is removed Tapio Reijonen
2026-11-05  7:25   ` sashiko-bot [this message]
2026-11-05  7:12 ` [PATCH v2 2/3] dt-bindings: serial: rs485: Add transceiver interface select GPIO Tapio Reijonen
2026-11-05  7:18   ` sashiko-bot
2026-11-05  7:12 ` [PATCH v2 3/3] serial: core: Drive the " Tapio Reijonen
2026-11-05  7:26   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-198665@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tapio.reijonen@vaisala.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.