mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Changhuang Liang <changhuang.liang@starfivetech.com>
Cc: Conor Dooley <conor@kernel.org>, Rob Herring <robh@kernel.org>,
	 Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	 "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linusw@kernel.org" <linusw@kernel.org>
Subject: Re: [PATCH v1 2/2] soc: starfive: Add JHB100 UART Routing driver
Date: Thu, 3 Sep 2026 11:32:05 +0200	[thread overview]
Message-ID: <20260903-precise-diamond-loris-ae2da7@quoll> (raw)
In-Reply-To: <ZQ4PR01MB12029CCB91CB5673761C6F95F2A82@ZQ4PR01MB1202.CHNPR01.prod.partner.outlook.cn>

On Tue, Sep 01, 2026 at 01:38:15AM +0000, Changhuang Liang wrote:
> > > > > I may have misunderstood something,please correct me if I'm wrong:
> > > > >
> > > > > I have found two subsystems related to multiplexing so far:
> > > > >
> > > > > /drivers/pinctrl and /drivers/mux. However, neither of them seems
> > > > > to provide a user-space interface for switching multiplexing values.
> > > > >
> > > > > Do you have any suggestions on this?
> > > >
> > > > pinctrl has some interface, not sure if writable, though. If
> > > > interface is missing, it should be added via such subsystem.
> > >
> > > Okay, this needs a bit more time for deeper research.
> > >
> > > >
> > > > >
> > > > > Also, could you confirm whether the implementation in
> > > > > drivers/soc/aspeed/aspeed-uart-routing.c
> > > > > is there for historical reasons?
> > > >
> > > > I supposed sneaked in without SoC maintainers noticing.
> > 
> > 
> > My first reaction when this flew by over the weekend was whether it should
> > be in the pinctrl subsystem. I know there's no sysfs interface there, but I don't
> > even see an explanation for why changing this at runtime is a requirement.
> > 
> > I'd have thought that each BMC would only have one host, and so since you've
> > got like 12 uarts there'd be enough for a permanent routing.
> > 
> > Even without a permanent routing, the driver consuming the pinctrl should be
> > able perform the switching (uart in this case) whenever it was needed?
> 
> I can give you an example:
> 
> BMC typically has a use case like this.
> 
> When some customers use our SoC to design their own baseboards, in order to save 
> I/O resources, they usually reserve only one pin, IO6, which by default routes UART6 
> to IO6 for the BMC console. However, sometimes when they want to check the data 
> from the Host UART (UART0), they need a user interface to route UART0 to IO6 so 
> that they can view the UART0 data.

So the pin is physically multiplexed and user wants to change it only
form time to time? IOW, users accept that they will loos the BMC console
logs or host console logs the moment they switch the UART?

Anyway, as you pointed out there is already one code like this - Aspeed
- thus this is a second one and that makes it reasonable to make a
proper common user-space API.

Just like in entire rest of kernel development - we do not multiple
interfaces or frameworks per each driver, but use a common part. That
de-duplication is the biggest difference comparing to downstream
approaches and comparing to all the people tried to send us with
arguments "but I want to solve my problem" (if you disagree, then please
watch old Greg's talk: I don't want your code).


Best regards,
Krzysztof


  reply	other threads:[~2026-09-03  9:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-30  6:51 [PATCH v1 0/2] Add support for StarFive JHB100 UART Routing Changhuang Liang
2026-08-30  6:51 ` [PATCH v1 1/2] dt-bindings: soc: starfive: Add JHB100 UART routing controller Changhuang Liang
2026-08-30  6:51 ` [PATCH v1 2/2] soc: starfive: Add JHB100 UART Routing driver Changhuang Liang
2026-08-30  8:35   ` Krzysztof Kozlowski
2026-08-31  1:35     ` Changhuang Liang
2026-08-31  5:54       ` Krzysztof Kozlowski
2026-08-31  6:01         ` Changhuang Liang
2026-08-31 17:24           ` Conor Dooley
2026-09-01  1:38             ` Changhuang Liang
2026-09-03  9:32               ` Krzysztof Kozlowski [this message]
2026-09-03 11:29                 ` Changhuang Liang

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=20260903-precise-diamond-loris-ae2da7@quoll \
    --to=krzk@kernel.org \
    --cc=changhuang.liang@starfivetech.com \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®