From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Prashant Malani <pmalani@chromium.org>
Cc: linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev,
bleung@chromium.org
Subject: Re: [PATCH] platform/chrome: cros_typec_vdm: Fix VDO copy
Date: Tue, 31 Jan 2023 11:49:34 +0800 [thread overview]
Message-ID: <Y9iPzvfJkxii390K@google.com> (raw)
In-Reply-To: <20230113182626.1149539-1-pmalani@chromium.org>
On Fri, Jan 13, 2023 at 06:26:26PM +0000, Prashant Malani wrote:
> The usage of memcpy() affects the representation of the VDOs as they are
> copied to the EC Host Command buffer. Specifically, all higher order
> bits get dropped (for example: a VDO of 0x406 just gets copied as 0x6).
memcpy() is byte-oriented; however, `vdo` is a pointer to u32.
> Avoid this by explicitly copying each VDO in the array. The number of
> VDOs generated by alternate mode drivers in their VDMs is almost always
> just 1 (apart from the header) so this doesn't affect performance in a
> meaningful way).
Although the patch has applied, I am wondering if the following would be a
better way to fix the issue:
memcpy(&vdm_req.vdm_data[1], vdo, (cnt - 1) * sizeof(*vdo));
next prev parent reply other threads:[~2023-01-31 3:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-13 18:26 [PATCH] platform/chrome: cros_typec_vdm: Fix VDO copy Prashant Malani
2023-01-20 18:50 ` Benson Leung
2023-01-24 19:10 ` patchwork-bot+chrome-platform
2023-01-26 19:50 ` patchwork-bot+chrome-platform
2023-01-31 3:49 ` Tzung-Bi Shih [this message]
2023-01-31 18:17 ` Prashant Malani
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=Y9iPzvfJkxii390K@google.com \
--to=tzungbi@kernel.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=pmalani@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.