[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200225090551.jhj7sc75neyphbss@pengutronix.de>
Date: Tue, 25 Feb 2020 10:05:51 +0100
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: Johan Hovold <johan@...nel.org>
Cc: kernel@...gutronix.de, linux-serial@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, Dan Murphy <dmurphy@...com>,
Pavel Machek <pavel@....cz>, Jiri Slaby <jslaby@...e.com>,
linux-leds@...r.kernel.org,
Jacek Anaszewski <jacek.anaszewski@...il.com>
Subject: Re: [PATCH v6 2/4] tty: rename tty_kopen() and add new function
tty_kopen_shared()
On Tue, Feb 25, 2020 at 09:55:03AM +0100, Johan Hovold wrote:
> On Thu, Feb 20, 2020 at 12:04:27PM +0100, Uwe Kleine-König wrote:
> > Ah I think I see. tty_driver_lookup_tty() might return NULL which for
> > the trigger driver indicates that tty_kopen_shared should be retried,
> > right?
>
> I'm not sure how best to handle this, but yes, your trigger can only be
> enabled while the port is open currently. And no error is returned to a
> user trying to enable the trigger before it has been opened.
>
> But regardless of the error reporting, I don't think failing when the
> port isn't open is the right thing to do as as this makes the interface
> rather useless since you cannot enable a trigger from for example a udev
> rule.
>
> If this approach is to be used at all, it seems you may need to allocate
> the struct tty when the trigger is enabled. And make sure you don't mess
> up some other assumption in tty core...
My idea is instead to retry opening the device later. At least this
sounds easier.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Powered by blists - more mailing lists