public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: linux-kernel@vger.kernel.org,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>,
	"Claudio Imbrenda" <imbrenda@linux.ibm.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Janosch Frank" <frankja@linux.ibm.com>,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	"Sven Schnelle" <svens@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Yury Norov" <yury.norov@gmail.com>,
	linux-s390@vger.kernel.org, kvm@vger.kernel.org,
	"Evan Quan" <evan.quan@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Lijo Lazar" <lijo.lazar@amd.com>,
	"Guchun Chen" <guchun.chen@amd.com>,
	"Chengming Gui" <Jack.Gui@amd.com>,
	"Darren Powell" <darren.powell@amd.com>,
	"Luben Tuikov" <luben.tuikov@amd.com>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	"Kevin Wang" <kevin1.wang@amd.com>,
	"Xiaomeng Hou" <Xiaomeng.Hou@amd.com>,
	"Prike Liang" <Prike.Liang@amd.com>,
	"Yifan Zhang" <yifan1.zhang@amd.com>,
	"Tao Zhou" <tao.zhou1@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [PATCH 4/4] drm/amd/pm: use bitmap_{from,to}_arr32 where appropriate
Date: Wed, 20 Apr 2022 15:41:28 -0700	[thread overview]
Message-ID: <20220420224128.911759-1-yury.norov@gmail.com> (raw)
In-Reply-To: <20220420222530.910125-1-yury.norov@gmail.com>

The smu_v1X_0_set_allowed_mask() uses bitmap_copy() to convert
bitmap to 32-bit array. This may be wrong due to endianness issues.
Fix it by switching to bitmap_{from,to}_arr32.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
 drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 +-
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
index b87f550af26b..5f8809f6990d 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
@@ -781,7 +781,7 @@ int smu_v11_0_set_allowed_mask(struct smu_context *smu)
 		goto failed;
 	}
 
-	bitmap_copy((unsigned long *)feature_mask, feature->allowed, 64);
+	bitmap_to_arr32(feature_mask, feature->allowed, 64);
 
 	ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetAllowedFeaturesMaskHigh,
 					  feature_mask[1], NULL);
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
index cf09e30bdfe0..747430ce6394 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
@@ -730,7 +730,7 @@ int smu_v13_0_set_allowed_mask(struct smu_context *smu)
 	    feature->feature_num < 64)
 		return -EINVAL;
 
-	bitmap_copy((unsigned long *)feature_mask, feature->allowed, 64);
+	bitmap_to_arr32(feature_mask, feature->allowed, 64);
 
 	ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetAllowedFeaturesMaskHigh,
 					      feature_mask[1], NULL);
-- 
2.32.0


      parent reply	other threads:[~2022-04-20 22:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 22:25 [PATCH 0/4] bitmap: fix conversion from/to fix-sized arrays Yury Norov
2022-04-20 22:25 ` [PATCH 1/4] lib/bitmap: extend comment for bitmap_(from,to)_arr32() Yury Norov
2022-04-20 22:25 ` [PATCH 2/4] lib: add bitmap_{from,to}_arr64 Yury Norov
2022-04-21  7:40   ` David Laight
2022-04-21 16:31     ` Yury Norov
2022-04-20 22:25 ` [PATCH 3/4] KVM: s390: replace bitmap_copy with bitmap_{from,to}_arr64 where appropriate Yury Norov
2022-04-21  7:24   ` David Hildenbrand
2022-04-21 13:01     ` Yury Norov
2022-04-20 22:41 ` Yury Norov [this message]

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=20220420224128.911759-1-yury.norov@gmail.com \
    --to=yury.norov@gmail.com \
    --cc=Jack.Gui@amd.com \
    --cc=Prike.Liang@amd.com \
    --cc=Xiaomeng.Hou@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=agordeev@linux.ibm.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=darren.powell@amd.com \
    --cc=david@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=evan.quan@amd.com \
    --cc=frankja@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=guchun.chen@amd.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kevin1.wang@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=lijo.lazar@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=luben.tuikov@amd.com \
    --cc=mario.limonciello@amd.com \
    --cc=svens@linux.ibm.com \
    --cc=tao.zhou1@amd.com \
    --cc=yifan1.zhang@amd.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