From: Sean Paul <seanpaul@chromium.org>
To: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
Cc: dri-devel@lists.freedesktop.org, Dave Airlie <airlied@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/udl: Fix unaligned memory access in udl_render_hline
Date: Tue, 11 Apr 2017 09:30:53 -0400 [thread overview]
Message-ID: <20170411133053.stmwmsmjf7ybq42v@art_vandelay> (raw)
In-Reply-To: <20170407200229.20642-1-j.neuschaefer@gmx.net>
On Fri, Apr 07, 2017 at 10:02:29PM +0200, Jonathan Neuschäfer wrote:
> On SPARC, the udl driver filled my kernel log with these messages:
>
> [186668.910612] Kernel unaligned access at TPC[76609c] udl_render_hline+0x13c/0x3a0
>
> Use put_unaligned_be16 to avoid them. On x86 this results in the same
> code, but on SPARC the compiler emits two single-byte stores.
>
Pushed to drm-misc-fixes with Dave's IRC Ack.
Thanks,
Sean
> Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---
> drivers/gpu/drm/udl/udl_transfer.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/udl/udl_transfer.c b/drivers/gpu/drm/udl/udl_transfer.c
> index 917dcb978c2c..0c87b1ac6b68 100644
> --- a/drivers/gpu/drm/udl/udl_transfer.c
> +++ b/drivers/gpu/drm/udl/udl_transfer.c
> @@ -14,6 +14,7 @@
> #include <linux/slab.h>
> #include <linux/fb.h>
> #include <linux/prefetch.h>
> +#include <asm/unaligned.h>
>
> #include <drm/drmP.h>
> #include "udl_drv.h"
> @@ -163,7 +164,7 @@ static void udl_compress_hline16(
> const u8 *const start = pixel;
> const uint16_t repeating_pixel_val16 = pixel_val16;
>
> - *(uint16_t *)cmd = cpu_to_be16(pixel_val16);
> + put_unaligned_be16(pixel_val16, cmd);
>
> cmd += 2;
> pixel += bpp;
> --
> 2.11.0
--
Sean Paul, Software Engineer, Google / Chromium OS
next prev parent reply other threads:[~2017-04-11 13:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-07 20:02 [PATCH] drm/udl: Fix unaligned memory access in udl_render_hline Jonathan Neuschäfer
2017-04-11 13:30 ` Sean Paul [this message]
2017-04-11 15:34 ` Jonathan Neuschäfer
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=20170411133053.stmwmsmjf7ybq42v@art_vandelay \
--to=seanpaul@chromium.org \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=j.neuschaefer@gmx.net \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).