Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp869977pxb; Fri, 13 Aug 2021 08:07:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnPCwQWN3lt0FD2O3mgxIuBiivhMZhvBk6dqdevlZJtbE/7jqFO7s5DBsv+75qUh6Uhbqp X-Received: by 2002:a17:907:7896:: with SMTP id ku22mr3072377ejc.166.1628867254843; Fri, 13 Aug 2021 08:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628867254; cv=none; d=google.com; s=arc-20160816; b=DH308OSAQbZYduoPcEK6zRzPKk1itvwBvT2A0TfzHu0cDZ4T90YrLAZcY3M8juDdXm iqInDxFb0WLDg3MNVQOTIir6hG5xTE2z7/1aXj0kEHwF52T/YkB2ryalRfBd3gm6HRro wZXEdHemYdzzNacHFiwQR1tywD2bnAi0Nd5edSRxRUxT8ARKzU0MwSv26ghwQ4uXNOCy Zi94HzF6GNPmhCWxG7QYYkHdB9y7tUCQDwsIr9Rh90yoHyGtElwuqduJvXKi+d21+uWT YXf7gOw19moQGe273Fxpt/1gUpBIyDKJrxOvCOcS7KSmp9ARwUTz515YVOxCmBBAdx7S VIXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=prD+/tV9DipN27pgnF0cQqoFo/JnYMvJKwpRaKui0Fs=; b=gzSEaxcsr9Z3bJnyIyrZeB8uD0r/MfPkixJaawJolTxEUTiwiw304MCyessrvzHkbx RjKeS1dApeiKinHNr7TybDyq4ZlnNJBZI+Q9ERS96MMA9/C9Tgek1oWnJayh4Jn+yxDv ZkH4WYoHzBQuJCSwB3ghQwFI92CYsm1mQ9V9tL+uUHma1txWYNxIBPngCdFWl5RImOpz 9BP5CvBWqyjS1gJPG1/prWCcb3Yc1JE3dNb+1b9QGRNBs6XKa+FlSBJZ4JIR4aPcWPx7 4M6Iwe1XpJPpkYr45frM88Q+PEunug4kEEr8wwO42o+39VFHAfD9XhE/OFMwFd5jLudy 2bjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si1869043ejs.401.2021.08.13.08.07.10; Fri, 13 Aug 2021 08:07:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240973AbhHMPEY (ORCPT + 99 others); Fri, 13 Aug 2021 11:04:24 -0400 Received: from mail.netline.ch ([148.251.143.180]:47467 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240928AbhHMPEY (ORCPT ); Fri, 13 Aug 2021 11:04:24 -0400 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id AD1DE20201B; Fri, 13 Aug 2021 17:03:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ETYiRXdf4Gu5; Fri, 13 Aug 2021 17:03:51 +0200 (CEST) Received: from thor (24.99.2.85.dynamic.wline.res.cust.swisscom.ch [85.2.99.24]) by netline-mail3.netline.ch (Postfix) with ESMTPA id A87E120201A; Fri, 13 Aug 2021 17:03:50 +0200 (CEST) Received: from localhost ([::1]) by thor with esmtp (Exim 4.94.2) (envelope-from ) id 1mEYir-000Dnl-Sf; Fri, 13 Aug 2021 17:03:49 +0200 To: zhaoxiao , airlied@linux.ie Cc: alexander.deucher@amd.com, christian.koenig@amd.com, David1.Zhou@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20210813085434.3890-1-zhaoxiao@uniontech.com> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Subject: Re: [PATCH] drm: radeon: r600_dma: Replace cpu_to_le32() by lower_32_bits() Message-ID: <54590a79-7047-cd6f-0f54-a005bdc69769@daenzer.net> Date: Fri, 13 Aug 2021 17:03:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210813085434.3890-1-zhaoxiao@uniontech.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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