From: "Michel Dänzer" <michel@daenzer.net>
To: Alex Deucher <alexdeucher@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/radeon: fix atom aux payload size check for writes (v2)
Date: Tue, 24 Feb 2015 13:18:06 +0900 [thread overview]
Message-ID: <54EBFB7E.2040705@daenzer.net> (raw)
In-Reply-To: <1424708679-10581-1-git-send-email-alexander.deucher@amd.com>
On 24.02.2015 01:24, Alex Deucher wrote:
> The atom aux param interface only supports 4 bits for
> the total write transfer size (header + payload). This
> limits us to 12 bytes of payload rather than 16. Add a
> check for this. Reads are not affected.
>
> v2: switch to WARN_ON_ONCE
>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/radeon/atombios_dp.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
> index 5bf825d..8d74de8 100644
> --- a/drivers/gpu/drm/radeon/atombios_dp.c
> +++ b/drivers/gpu/drm/radeon/atombios_dp.c
> @@ -178,6 +178,13 @@ radeon_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
> switch (msg->request & ~DP_AUX_I2C_MOT) {
> case DP_AUX_NATIVE_WRITE:
> case DP_AUX_I2C_WRITE:
> + /* The atom implementation only supports writes with a max payload of
> + * 12 bytes since it uses 4 bits for the total count (header + payload)
> + * in the parameter space. The atom interface supports 16 byte
> + * payloads for reads. The hw itself supports up to 16 bytes of payload.
> + */
> + if (WARN_ON_ONCE(msg->size > 12))
> + return -E2BIG;
> /* tx_size needs to be 4 even for bare address packets since the atom
> * table needs the info in tx_buf[3].
> */
>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2015-02-24 4:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-23 16:24 [PATCH] drm/radeon: fix atom aux payload size check for writes (v2) Alex Deucher
2015-02-24 4:18 ` Michel Dänzer [this message]
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=54EBFB7E.2040705@daenzer.net \
--to=michel@daenzer.net \
--cc=alexdeucher@gmail.com \
--cc=dri-devel@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox