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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54590a79-7047-cd6f-0f54-a005bdc69769@daenzer.net>
Date:   Fri, 13 Aug 2021 17:03:49 +0200
From:   Michel Dänzer <michel@...nzer.net>
To:     zhaoxiao <zhaoxiao@...ontech.com>, airlied@...ux.ie
Cc:     alexander.deucher@....com, christian.koenig@....com,
        David1.Zhou@....com, amd-gfx@...ts.freedesktop.org,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm: radeon: r600_dma: Replace cpu_to_le32() by
 lower_32_bits()

On 2021-08-13 10:54 a.m., zhaoxiao wrote:
> This patch fixes the following sparse errors:
> drivers/gpu/drm/radeon/r600_dma.c:247:30: warning: incorrect type in assignment (different base types)
> drivers/gpu/drm/radeon/r600_dma.c:247:30:    expected unsigned int volatile [usertype]
> drivers/gpu/drm/radeon/r600_dma.c:247:30:    got restricted __le32 [usertype]
> 
> Signed-off-by: zhaoxiao <zhaoxiao@...ontech.com>
> ---
>  drivers/gpu/drm/radeon/r600_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/radeon/r600_dma.c b/drivers/gpu/drm/radeon/r600_dma.c
> index fb65e6fb5c4f..a2d0b1edcd22 100644
> --- a/drivers/gpu/drm/radeon/r600_dma.c
> +++ b/drivers/gpu/drm/radeon/r600_dma.c
> @@ -244,7 +244,7 @@ int r600_dma_ring_test(struct radeon_device *rdev,
>  	gpu_addr = rdev->wb.gpu_addr + index;
>  
>  	tmp = 0xCAFEDEAD;
> -	rdev->wb.wb[index/4] = cpu_to_le32(tmp);
> +	rdev->wb.wb[index/4] = lower_32_bits(tmp);
>  
>  	r = radeon_ring_lock(rdev, ring, 4);
>  	if (r) {
> 

Seems better to mark rdev->wb.wb as little endian instead. It's read with le32_to_cpu (with some exceptions which look like bugs), which would result in 0xADEDFECA like this.


-- 
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ