From: Johan Hovold <johan@kernel.org>
To: Claire Chang <tientzu@chromium.org>
Cc: robh@kernel.org, changqi.hu@mediatek.com,
gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
long.cheng@mediatek.com, linux-mediatek@lists.infradead.org,
linux-serial@vger.kernel.org, jslaby@suse.com
Subject: Re: [PATCH 1/3] serdev: ttyport: add devt for tty port
Date: Mon, 18 May 2020 16:56:51 +0200 [thread overview]
Message-ID: <20200518145651.GL25962@localhost> (raw)
In-Reply-To: <20200506072314.112409-2-tientzu@chromium.org>
On Wed, May 06, 2020 at 03:23:12PM +0800, Claire Chang wrote:
> serial_match_port() uses devt to match devices. However, when serdev
> registers a tty port, devt has never been set. This makes
> device_find_child() always return NULL.
>
> Assign devt in serdev_tty_port_register() to fix this.
>
> Signed-off-by: Claire Chang <tientzu@chromium.org>
> ---
> drivers/tty/serdev/serdev-ttyport.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index d367803e2044f..9238119173a47 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
> @@ -267,6 +267,7 @@ struct device *serdev_tty_port_register(struct tty_port *port,
> {
> struct serdev_controller *ctrl;
> struct serport *serport;
> + dev_t devt = MKDEV(drv->major, drv->minor_start) + idx;
> int ret;
>
> if (!port || !drv || !parent)
> @@ -282,6 +283,7 @@ struct device *serdev_tty_port_register(struct tty_port *port,
> serport->tty_drv = drv;
>
> ctrl->ops = &ctrl_ops;
> + ctrl->dev.devt = devt;
This is conceptually wrong. A serdev controller is not a tty class
device with a corresponding character device.
It seems you need to rethink how serial core should handle the wakeup
flags with respect to serdev.
>
> port->client_ops = &client_ops;
> port->client_data = ctrl;
Johan
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org>
To: Claire Chang <tientzu@chromium.org>
Cc: robh@kernel.org, gregkh@linuxfoundation.org, jslaby@suse.com,
long.cheng@mediatek.com, changqi.hu@mediatek.com,
linux-serial@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] serdev: ttyport: add devt for tty port
Date: Mon, 18 May 2020 16:56:51 +0200 [thread overview]
Message-ID: <20200518145651.GL25962@localhost> (raw)
In-Reply-To: <20200506072314.112409-2-tientzu@chromium.org>
On Wed, May 06, 2020 at 03:23:12PM +0800, Claire Chang wrote:
> serial_match_port() uses devt to match devices. However, when serdev
> registers a tty port, devt has never been set. This makes
> device_find_child() always return NULL.
>
> Assign devt in serdev_tty_port_register() to fix this.
>
> Signed-off-by: Claire Chang <tientzu@chromium.org>
> ---
> drivers/tty/serdev/serdev-ttyport.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index d367803e2044f..9238119173a47 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
> @@ -267,6 +267,7 @@ struct device *serdev_tty_port_register(struct tty_port *port,
> {
> struct serdev_controller *ctrl;
> struct serport *serport;
> + dev_t devt = MKDEV(drv->major, drv->minor_start) + idx;
> int ret;
>
> if (!port || !drv || !parent)
> @@ -282,6 +283,7 @@ struct device *serdev_tty_port_register(struct tty_port *port,
> serport->tty_drv = drv;
>
> ctrl->ops = &ctrl_ops;
> + ctrl->dev.devt = devt;
This is conceptually wrong. A serdev controller is not a tty class
device with a corresponding character device.
It seems you need to rethink how serial core should handle the wakeup
flags with respect to serdev.
>
> port->client_ops = &client_ops;
> port->client_data = ctrl;
Johan
next prev parent reply other threads:[~2020-05-18 14:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 7:23 [PATCH 0/3] add wakeup_irq for in-band wakeup support Claire Chang
2020-05-06 7:23 ` Claire Chang
2020-05-06 7:23 ` [PATCH 1/3] serdev: ttyport: add devt for tty port Claire Chang
2020-05-06 7:23 ` Claire Chang
2020-05-15 12:46 ` Greg KH
2020-05-15 12:46 ` Greg KH
2020-05-18 10:04 ` Claire Chang
2020-05-18 10:04 ` Claire Chang
2020-05-18 14:56 ` Johan Hovold [this message]
2020-05-18 14:56 ` Johan Hovold
2020-05-06 7:23 ` [PATCH 2/3] tty: serial_core: add wakeup_irq to support in-band wakeup Claire Chang
2020-05-06 7:23 ` Claire Chang
2020-05-06 7:23 ` [PATCH 3/3] uart: mediatek: move the in-band wakeup logic to core Claire Chang
2020-05-06 7:23 ` Claire Chang
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=20200518145651.GL25962@localhost \
--to=johan@kernel.org \
--cc=changqi.hu@mediatek.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=long.cheng@mediatek.com \
--cc=robh@kernel.org \
--cc=tientzu@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.