lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1a70f78c-a94c-4fcf-e89d-da90973cbc79@samsung.com>
Date:   Tue, 19 Dec 2017 09:53:42 +0100
From:   Andrzej Hajda <a.hajda@...sung.com>
To:     Marc Zyngier <marc.zyngier@....com>,
        Archit Taneja <architt@...eaurora.org>,
        Laurent Pinchart <Laurent.pinchart@...asonboard.com>
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/bridge: analogix_dp: Use relaxed MMIO accessors

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@....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);
>  	}
>  }
...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ