public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony.lindgren@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Tony Lindgren" <tony@atomide.com>,
	"Maximilian Luz" <luzmaximilian@gmail.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	linux-serial@vger.kernel.org,
	"Weifeng Liu" <weifeng.liu.z@gmail.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Subject: Re: [PATCH] serial: Clear UPF_DEAD before calling tty_port_register_device_attr_serdev()
Date: Fri, 10 May 2024 16:01:22 +0300	[thread overview]
Message-ID: <Zj4aoqqsRq5A5Qvg@tlindgre-MOBL1> (raw)
In-Reply-To: <20240509141549.63704-1-hdegoede@redhat.com>

On Thu, May 09, 2024 at 04:15:49PM +0200, Hans de Goede wrote:
> If a serdev_device_driver is already loaded for a serdev_tty_port when it
> gets registered by tty_port_register_device_attr_serdev() then that
> driver's probe() method will be called immediately.
> 
> The serdev_device_driver's probe() method should then be able to call
> serdev_device_open() successfully, but because UPF_DEAD is still dead
> serdev_device_open() will fail with -ENXIO in this scenario:
> 
>   serdev_device_open()
>   ctrl->ops->open()	/* this callback being ttyport_open() */
>   tty->ops->open()	/* this callback being uart_open() */
>   tty_port_open()
>   port->ops->activate()	/* this callback being uart_port_activate() */
>   Find bit UPF_DEAD is set in uport->flags and fail with errno -ENXIO.
> 
> Fix this be clearing UPF_DEAD before tty_port_register_device_attr_serdev()

Looks OK to me:

Reviewed-by: Tony Lindgren <tony.lindgren@linux.intel.com>

  reply	other threads:[~2024-05-10 13:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 14:15 [PATCH] serial: Clear UPF_DEAD before calling tty_port_register_device_attr_serdev() Hans de Goede
2024-05-10 13:01 ` Tony Lindgren [this message]
2024-05-10 13:43 ` 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=Zj4aoqqsRq5A5Qvg@tlindgre-MOBL1 \
    --to=tony.lindgren@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=luzmaximilian@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=weifeng.liu.z@gmail.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