linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: tang pengchuan <kevin3.tang@gmail.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Baolin Wang <baolin.wang@linaro.org>,
	Dave Airlie <airlied@linux.ie>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	ML dri-devel <dri-devel@lists.freedesktop.org>,
	Orson Zhai <orsonzhai@gmail.com>, Sean Paul <sean@poorly.run>
Subject: Re: [PATCH RFC v4 4/6] drm/sprd: add Unisoc's drm display controller driver
Date: Sat, 7 Mar 2020 17:14:45 +0100	[thread overview]
Message-ID: <20200307161445.GA7524@ravnborg.org> (raw)
In-Reply-To: <CAFPSGXaN1SHCK1QqEca3XcYxTV45fdRBzj5KejW6zr3z4dx_aw@mail.gmail.com>

Hi Kevin

> > > +
> > > +ifdef CONFIG_ARM64
> > > +KBUILD_CFLAGS += -mstrict-align
> >
> >
> > There are many other drivers that do not use readl/writel for register access,
> > yet none has this workaround... Even those that they are exclusively ARM64.
> >
> > Have you tried that it's not a buggy version of GCC? At the very least, I'd
> > encourage you to add a brief comment about the problem + setup.
> >
> > ... In general I think one should follow the suggestions from Rob Herring.
> >
> Yocto v2.5
> aarch64-linaro-linux-gcc (Linaro GCC 7.2-2017.11) 7.2.1 20171011
> 
> Crash Stack:
> /sprd/drv/dispc/dpu_r2p0.c:729
> 1796256 ffffff8008486650:       f803c043        stur    x3, [x2,#60]
> =>Unhandled fault: alignment fault (0x96000061) at 0xffffff80098b883c
> 
> 729         reg->mmu_min_ppn1 = 0;
> 730         reg->mmu_ppn_range1 = 0xffff;
> 731         reg->mmu_min_ppn2 = 0;
> 732         reg->mmu_ppn_range2 = 0xffff;
> 
> The above C code operation are continuous. The compiler may think that
> the access can be completed by directly using two 64-bit assignment
> operations, so it is optimized to 64-bit operation.

What you see is a side-effect of using a sturct for register access.
When you ave your code change to use readl()/writel() and friends
this is no logner a problem, and you can drop the cc flag.

	Sam

  reply	other threads:[~2020-03-07 16:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  9:46 [PATCH RFC v4 0/6] Add Unisoc's drm kms module Kevin Tang
2020-02-26  9:46 ` [PATCH RFC v4 1/6] dt-bindings: display: add Unisoc's drm master bindings Kevin Tang
2020-02-27 16:50   ` Rob Herring
2020-02-26  9:46 ` [PATCH RFC v4 2/6] drm/sprd: add Unisoc's drm kms master Kevin Tang
2020-02-26  9:46 ` [PATCH RFC v4 3/6] dt-bindings: display: add Unisoc's dpu bindings Kevin Tang
2020-02-26  9:46 ` [PATCH RFC v4 4/6] drm/sprd: add Unisoc's drm display controller driver Kevin Tang
2020-02-27 20:37   ` Rob Herring
2020-03-02 18:28   ` Emil Velikov
     [not found]     ` <CAFPSGXYgY7=vgX6ZPWRgfxfZfBeVRj7=gUOwrcTyYpkYE1C1cA@mail.gmail.com>
2020-03-06 17:14       ` Emil Velikov
2020-03-07 13:26         ` tang pengchuan
2020-03-07 10:00     ` tang pengchuan
2020-03-07 16:14       ` Sam Ravnborg [this message]
2020-02-26  9:46 ` [PATCH RFC v4 5/6] dt-bindings: display: add Unisoc's mipi dsi&dphy bindings Kevin Tang
2020-02-26  9:46 ` [PATCH RFC v4 6/6] drm/sprd: add Unisoc's drm mipi dsi&dphy driver Kevin Tang

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=20200307161445.GA7524@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=airlied@linux.ie \
    --cc=baolin.wang@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=kevin3.tang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=orsonzhai@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sean@poorly.run \
    --cc=zhang.lyra@gmail.com \
    /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).