[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YUyXA5UStMHGQDZZ@atomide.com>
Date: Thu, 23 Sep 2021 18:02:27 +0300
From: Tony Lindgren <tony@...mide.com>
To: Johan Hovold <johan@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andy Shevchenko <andriy.shevchenko@...el.com>,
Jiri Slaby <jirislaby@...nel.org>,
Vignesh Raghavendra <vigneshr@...com>,
linux-serial@...r.kernel.org, linux-omap@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/6] serial: core: Add new prep_tx for power management
* Johan Hovold <johan@...nel.org> [210923 12:46]:
> On Tue, Sep 21, 2021 at 01:33:43PM +0300, Tony Lindgren wrote:
> > If the serial driver implements PM runtime with autosuspend, the port may
> > be powered off for TX. To wake up the port, let's add new prep_tx() call
> > for serial drivers to implement as needed. We call it from serial
> > write_room() and write() functions. If the serial port is not enabled,
> > we just return 0.
>
> This isn't right. If there's room in the driver buffer, there's no
> reason to not accept those characters.
Maybe. We might get away with returning zero bytes written in write().
But to me it seems better to stop things early when write is known
to not succeed.
> It's the drivers responsibility to resume writing when write() is
> called and that me need to be done in a runtime resume callback in case
> the device is suspended.
I think we currently need to return zero bytes written from write()
when the serial port is not usable.
I don't think we can return a fake number of bytes written from write().
And even if we could return a fake number of bytes written, we could
run into issues doing the real write to the serial port.
> No need to be patching line disciplines for this.
Do you see issues with handling the errors in line disciplines?
Regards,
Tony
Powered by blists - more mailing lists