linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Tony Lindgren <tony@atomide.com>
Cc: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Johan Hovold" <johan@kernel.org>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	linux-serial@vger.kernel.org, linux-omap@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] serial: core: Start managing serial controllers to enable runtime PM
Date: Mon, 27 Jun 2022 14:16:47 +0200	[thread overview]
Message-ID: <Yrmfr3GfXYhclKXA@kroah.com> (raw)
In-Reply-To: <20220615062455.15490-1-tony@atomide.com>

On Wed, Jun 15, 2022 at 09:24:55AM +0300, Tony Lindgren wrote:
> We want to enable runtime PM for serial port device drivers in a generic
> way. To do this, we want to have the serial core layer manage the
> registered serial port controllers. For runtime PM, we need a way to find
> the serial ports for each serial port controller device.
> 
> The serial core manages ports. Each serial controller can have multiple
> ports. As serial core has no struct device, and the serial port device
> drivers have their own driver data, we cannot currently start making
> use of serial core generic data easily without changing all the serial
> port device drivers.

Really?  Why not make struct uart_port a real struct device?

> We could consider adding a serial core specific struct device. It would
> be a child of the serial port device, and would allow us eventually to use
> device_links to add generic runtime PM calls for example. But as the serial
> core layer is not a device driver, driver specific features would need to
> be added, and are probably not justified for a virtual device.

I think it's very justified, let's not paper over this whole thing by
adding a kref stuck in in the middle and trying to hook up the PM code
to it, instead of just using all of the PM logic that the driver model
already provides.

> Considering the above, let's improve the serial core layer so we can
> manage the serial port controllers better. Let's register the controllers
> with the serial core layer in addition to the serial ports.

Why can't controllers be a device as well?

Let's try to work with the driver model here, not work around it, if at
all possible.  We never did a full conversion of the serial layer to the
driver core all those decades ago.  Perhaps now is the time to really do
that.

thanks,

greg k-h

  parent reply	other threads:[~2022-06-27 12:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15  6:24 [PATCH v2 1/1] serial: core: Start managing serial controllers to enable runtime PM Tony Lindgren
2022-06-15  9:17 ` Andy Shevchenko
2022-06-16  8:23   ` Tony Lindgren
2022-06-16  8:51   ` Tony Lindgren
2022-06-27 12:16 ` Greg Kroah-Hartman [this message]
2022-06-27 13:48   ` Tony Lindgren
2022-11-24  6:53     ` Jiri Slaby
2022-11-24 15:37       ` Tony Lindgren
2022-11-24 16:06         ` Andy Shevchenko

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=Yrmfr3GfXYhclKXA@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=vigneshr@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).