From: "Thierry Reding" <thierry.reding@gmail.com>
To: "Marc Dietrich" <marvin24@gmx.de>, <linux-staging@lists.linux.dev>
Cc: <linux-tegra@vger.kernel.org>, <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 2/4] staging: nvec: make touchpad init synchronous
Date: Fri, 05 Apr 2024 16:40:29 +0200 [thread overview]
Message-ID: <D0C9MKZ155E9.GRG2F9N6JHBU@gmail.com> (raw)
In-Reply-To: <20240405140906.77831-3-marvin24@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 1935 bytes --]
On Fri Apr 5, 2024 at 4:09 PM CEST, Marc Dietrich wrote:
> Improve initialization stability by waiting for command completion before
> sending the next one.
>
> Signed-off-by: Marc Dietrich <marvin24@gmx.de>
> ---
> drivers/staging/nvec/nvec_ps2.c | 31 +++++++++++++++++++++----------
> 1 file changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/nvec/nvec_ps2.c b/drivers/staging/nvec/nvec_ps2.c
> index cb6d71b8dc83..f34016c4a26b 100644
> --- a/drivers/staging/nvec/nvec_ps2.c
> +++ b/drivers/staging/nvec/nvec_ps2.c
> @@ -60,16 +60,6 @@ static void ps2_stopstreaming(struct serio *ser_dev)
> nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
> }
>
> -static int ps2_sendcommand(struct serio *ser_dev, unsigned char cmd)
> -{
> - unsigned char buf[] = { NVEC_PS2, SEND_COMMAND, ENABLE_MOUSE, 1 };
> -
> - buf[2] = cmd & 0xff;
> -
> - dev_dbg(&ser_dev->dev, "Sending ps2 cmd %02x\n", cmd);
> - return nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
> -}
> -
> static int nvec_ps2_notifier(struct notifier_block *nb,
> unsigned long event_type, void *data)
> {
> @@ -98,6 +88,27 @@ static int nvec_ps2_notifier(struct notifier_block *nb,
> return NOTIFY_DONE;
> }
>
> +static int ps2_sendcommand(struct serio *ser_dev, unsigned char cmd)
> +{
> + unsigned char buf[] = { NVEC_PS2, SEND_COMMAND, ENABLE_MOUSE, 1 };
> + struct nvec_msg *msg;
> + int ret;
> +
> + buf[2] = cmd & 0xff;
> +
> + dev_dbg(&ser_dev->dev, "Sending ps2 cmd %02x\n", cmd);
> +
> + ret = nvec_write_sync(ps2_dev.nvec, buf, sizeof(buf), &msg);
> + if (ret < 0)
> + return ret;
> +
> + nvec_ps2_notifier(NULL, NVEC_PS2, msg->data);
> +
> + nvec_msg_free(ps2_dev.nvec, msg);
> +
> + return 0;
> +}
> +
Is there a particular reason why you've moved the function around? It'd
probably make the patch a tiny bit smaller if you kept it in the right
spot.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-04-05 14:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-05 14:09 [PATCH 0/4] Improve robustnes during initialization Marc Dietrich
2024-04-05 14:09 ` [PATCH 1/4] staging: nvec: make keyboard init synchronous Marc Dietrich
2024-04-05 14:38 ` Thierry Reding
2024-04-05 15:15 ` Dan Carpenter
2024-04-05 15:19 ` Dan Carpenter
2024-04-06 12:26 ` Marc Dietrich
2024-04-05 14:09 ` [PATCH 2/4] staging: nvec: make touchpad " Marc Dietrich
2024-04-05 14:40 ` Thierry Reding [this message]
2024-04-06 12:24 ` Marc Dietrich
2024-04-05 14:09 ` [PATCH 3/4] staging: nvec: make i2c controller register writes robust Marc Dietrich
2024-04-05 14:33 ` Thierry Reding
2024-04-05 15:21 ` Dan Carpenter
2024-04-05 14:09 ` [PATCH 4/4] staging: nvec: update TODO Marc Dietrich
2024-04-05 14:41 ` [PATCH 0/4] Improve robustnes during initialization Thierry Reding
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=D0C9MKZ155E9.GRG2F9N6JHBU@gmail.com \
--to=thierry.reding@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-tegra@vger.kernel.org \
--cc=marvin24@gmx.de \
/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.