From: Andrzej Hajda <a.hajda@samsung.com>
To: Marc Zyngier <marc.zyngier@arm.com>,
Archit Taneja <architt@codeaurora.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/bridge: analogix_dp: Use relaxed MMIO accessors
Date: Tue, 19 Dec 2017 09:53:42 +0100 [thread overview]
Message-ID: <1a70f78c-a94c-4fcf-e89d-da90973cbc79@samsung.com> (raw)
In-Reply-To: <20171218113935.8438-1-marc.zyngier@arm.com>
On 18.12.2017 12:39, Marc Zyngier wrote:
> The analogix DP bridge is entierely driven via MMIO accesses, and
> does not do any DMA that requires coherency with the CPU. Yet, the
> driver uses the non-relaxed accessors, forcing strong barriers to
> be emitted on architectures with a relaxed memory ordering.
>
> This is of course completely unnecessary, and only serves as a way
> to pointlessly reduce the performance of unsuspecting platforms.
>
> Switch the driver to the _relaxed accessors, making my kevin platform
> a slightly better machine.
Do you have any stats to justify this change?
The common practice is/was to use writel/readl accessors to access MMIO,
even if it is suboptimal in many cases. Has something changed in these
practices?
To be clear, I am not against this change. I am just curious.
Regards
Andrzej
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
> drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 488 +++++++++++-----------
> 1 file changed, 244 insertions(+), 244 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> index 303083ad28e3..248d6ba913dc 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
> @@ -31,13 +31,13 @@ void analogix_dp_enable_video_mute(struct analogix_dp_device *dp, bool enable)
> u32 reg;
>
> if (enable) {
> - reg = readl(dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1);
> + reg = readl_relaxed(dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1);
> reg |= HDCP_VIDEO_MUTE;
> - writel(reg, dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1);
> + writel_relaxed(reg, dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1);
> } else {
> - reg = readl(dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1);
> + reg = readl_relaxed(dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1);
> reg &= ~HDCP_VIDEO_MUTE;
> - writel(reg, dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1);
> + writel_relaxed(reg, dp->reg_base + ANALOGIX_DP_VIDEO_CTL_1);
> }
> }
...
next prev parent reply other threads:[~2017-12-19 8:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-18 11:39 Marc Zyngier
[not found] ` <CGME20171219085343eucas1p18d361316271ce95bd3778aad118993bb@eucas1p1.samsung.com>
2017-12-19 8:53 ` Andrzej Hajda [this message]
2017-12-19 11:18 ` Marc Zyngier
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=1a70f78c-a94c-4fcf-e89d-da90973cbc79@samsung.com \
--to=a.hajda@samsung.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=architt@codeaurora.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.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
all inboxes | Powered by JetHome®