All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Liu <liucong2@kylinos.cn>
To: airlied@redhat.com, kraxel@redhat.com, airlied@linux.ie,
	daniel@ffwll.ch, christian.koenig@amd.com, ray.huang@amd.com,
	virtualization@lists.linux-foundation.org,
	spice-devel@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Cc: Cong Liu <liucong2@kylinos.cn>
Subject: [PATCH v1 2/2] drm/ttm: enable ioremap buffer according to TTM mem caching setting for arm64
Date: Tue, 22 Mar 2022 17:34:44 +0800	[thread overview]
Message-ID: <20220322093444.1236582-2-liucong2@kylinos.cn> (raw)
In-Reply-To: <20220322093444.1236582-1-liucong2@kylinos.cn>

Arm64 also need the function in commit b849bec29a99 ("drm/ttm:
ioremap buffer according to TTM mem caching setting"), so enable
it. The following Call Trace captured in arm64 with qxl card.

[    5.609923] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
[    5.610592] pstate: 00400005 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    5.611271] pc : __memset+0x90/0x188
[    5.611641] lr : qxl_create_monitors_object+0xe0/0x180 [qxl]
[    5.612208] sp : ffff800012cd37a0
[    5.612533] x29: ffff800012cd37a0 x28: 0000000000000000 x27: 0000000000000001
[    5.613228] x26: ffff800012cd3d30 x25: ffffb70116ef5f10 x24: ffffb70116ef5ed8
[    5.613953] x23: ffffb70116ef5000 x22: 0000000000000000 x21: ffff000300020000
[    5.614645] x20: ffff0003008e4000 x19: 0000000000000074 x18: 0000000000000014
[    5.615331] x17: 0000000038ca76f1 x16: ffffb70138fd0600 x15: ffffb7013b1a9950
[    5.616018] x14: ffff800010000000 x13: ffffb7013a8a2d78 x12: ffffb7013a8a2d78
[    5.616709] x11: ffffb7013a8aa767 x10: 0000000000000000 x9 : ffffb701398fc5bc
[    5.617409] x8 : ffff8000100ad074 x7 : 0000000000000000 x6 : 0000000000000002
[    5.618206] x5 : ffff0003008e50b0 x4 : 0000000000000000 x3 : 0000000000000030
[    5.618933] x2 : 0000000000000004 x1 : 0000000000000000 x0 : ffff8000100ad000
[    5.619624] Call trace:
[    5.619872]  __memset+0x90/0x188
[    5.620188]  qxl_modeset_init+0x4c/0x320 [qxl]
[    5.620627]  qxl_pci_probe+0x11c/0x1d0 [qxl]
[    5.621029]  local_pci_probe+0x48/0xb8
[    5.621390]  pci_device_probe+0x194/0x208
[    5.621762]  really_probe+0xd0/0x458
[    5.622122]  __driver_probe_device+0x124/0x1c0
[    5.622534]  driver_probe_device+0x48/0x130
[    5.622923]  __driver_attach+0xc4/0x1a8
[    5.623280]  bus_for_each_dev+0x78/0xd0
[    5.623636]  driver_attach+0x2c/0x38
[    5.623969]  bus_add_driver+0x154/0x248
[    5.624324]  driver_register+0x6c/0x128
[    5.624678]  __pci_register_driver+0x4c/0x58
[    5.625072]  qxl_init+0x48/0x1000 [qxl]
[    5.625439]  do_one_initcall+0x50/0x240
[    5.625825]  do_init_module+0x60/0x238
[    5.626189]  load_module+0x2458/0x2900
[    5.626543]  __do_sys_finit_module+0xbc/0x128
[    5.626952]  __arm64_sys_finit_module+0x28/0x38
[    5.627384]  invoke_syscall+0x74/0xf0
[    5.627732]  el0_svc_common.constprop.0+0x58/0x1a8
[    5.628190]  do_el0_svc+0x2c/0x90
[    5.628503]  el0_svc+0x40/0x190
[    5.628811]  el0t_64_sync_handler+0xb0/0xb8
[    5.629206]  el0t_64_sync+0x1a4/0x1a8
[    5.629552] Code: a8811d07 f2400c42 b4000062 8b020108 (a93f1d07)
[    5.630152] ---[ end trace 35a380fcdcd5b8f7 ]---

Signed-off-by: Cong Liu <liucong2@kylinos.cn>
---
 drivers/gpu/drm/ttm/ttm_bo_util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 72a94301bc95..3df96e76c424 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -281,7 +281,7 @@ static int ttm_bo_ioremap(struct ttm_buffer_object *bo,
 		map->bo_kmap_type = ttm_bo_map_iomap;
 		if (mem->bus.caching == ttm_write_combined)
 			map->virtual = ioremap_wc(res, size);
-#ifdef CONFIG_X86
+#if (defined CONFIG_X86) || (defined CONFIG_ARM64)
 		else if (mem->bus.caching == ttm_cached)
 			map->virtual = ioremap_cache(res, size);
 #endif
@@ -402,7 +402,7 @@ int ttm_bo_vmap(struct ttm_buffer_object *bo, struct dma_buf_map *map)
 		else if (mem->bus.caching == ttm_write_combined)
 			vaddr_iomem = ioremap_wc(mem->bus.offset,
 						 bo->base.size);
-#ifdef CONFIG_X86
+#if (defined CONFIG_X86) || (defined CONFIG_ARM64)
 		else if (mem->bus.caching == ttm_cached)
 			vaddr_iomem = ioremap_cache(mem->bus.offset,
 						  bo->base.size);
-- 
2.25.1


  reply	other threads:[~2022-03-23 11:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22  9:34 [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64 Cong Liu
2022-03-22  9:34 ` Cong Liu [this message]
2022-03-23  7:15 ` Christian König via Virtualization
2022-03-23  7:15   ` Christian König
2022-03-23  9:45   ` Robin Murphy
2022-03-23  9:45     ` Robin Murphy
2022-03-23  9:46     ` Christian König via Virtualization
2022-03-23  9:46       ` Christian König
2022-03-23 10:11     ` Gerd Hoffmann
2022-03-23 10:11       ` Gerd Hoffmann
2022-03-23 10:26       ` Robin Murphy
2022-03-23 10:26         ` Robin Murphy

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=20220322093444.1236582-2-liucong2@kylinos.cn \
    --to=liucong2@kylinos.cn \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=ray.huang@amd.com \
    --cc=spice-devel@lists.freedesktop.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.