All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Chen Li <chenli@uniontech.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/[amdgpu|radeon]: fix memset on io mem
Date: Fri, 18 Dec 2020 11:41:47 +0100	[thread overview]
Message-ID: <c8edb5ab-a668-db01-b357-cda0be046c9e@amd.com> (raw)
In-Reply-To: <87v9czxzr6.wl-chenli@uniontech.com>

Am 18.12.20 um 09:52 schrieb Chen Li:
> On Fri, 18 Dec 2020 16:10:12 +0800,
> Christian König wrote:
>> Am 18.12.20 um 04:51 schrieb Chen Li:
>>> [SNIP]
>>>>>> If your ARM base board can't do that for some then you can't use the hardware
>>>>>> with that board.
>>>>> Good to know, thanks! BTW, have you ever seen or heard boards like mine which cannot mmap device memory correctly from userspace correctly?
>>>> Unfortunately yes. We haven't been able to figure out what exactly goes wrong in
>>>> those cases.
>>> Ok. one more question: only e8860 or all radeon cards have this issue?
>> This applies to all hardware with dedicated memory which needs to be mapped to
>> userspace.
>>
>> That includes all graphics hardware from AMD as well as NVidia and probably a
>> whole bunch of other PCIe devices.
> Can mmio on these devices work fine in kernel space?

The kernel drivers know that this is MMIO and can use special 
instructions/functions like 
writel()/writeq()/memcpy_fromio()/memcpy_toio() etc...

> I cannot see the difference here except user space should use uncacheable mmap to map virtual memory to device space(though I don't know how to use uncacheable mmap), while kernel use uncache ioremap.

The problem with mmap() of MMIO into the userspace is that this can 
easily crash the whole system.

When an application uses memset()/memcpy() on the mapped region and the 
system spontaneous reboots than that's a rather big hardware problem.

Regards,
Christian.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-12-18 10:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  5:41 [PATCH] drm/[amdgpu|radeon]: fix memset on io mem Chen Li
2020-12-16  7:59 ` Christian König
2020-12-16 13:48   ` Chen Li
2020-12-16 14:19     ` Christian König
2020-12-17  1:07       ` Chen Li
2020-12-17 10:25         ` Christian König
2020-12-17 13:37           ` Chen Li
2020-12-17 14:16             ` Christian König
2020-12-18  3:51               ` Chen Li
2020-12-18  8:10                 ` Christian König
2020-12-18  8:52                   ` Chen Li
2020-12-18 10:41                     ` Christian König [this message]
2020-12-17 13:45           ` Robin Murphy
2020-12-17 14:02             ` Christian König
2020-12-17 14:18               ` Lucas Stach
2020-12-18 14:17               ` Robin Murphy
2020-12-18 14:33                 ` Christian König
2020-12-18 15:19                   ` Robin Murphy
2020-12-18  6:14             ` Chen Li
2020-12-18 14:42               ` Robin Murphy
2020-12-16 12:52 ` [kbuild] " Dan Carpenter
2020-12-16 12:52   ` Dan Carpenter
2020-12-16 12:52   ` Dan Carpenter
2020-12-16 13:00 ` kernel test robot
2020-12-16 13:00   ` kernel test robot
2020-12-16 12:12 kernel test robot

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=c8edb5ab-a668-db01-b357-cda0be046c9e@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=chenli@uniontech.com \
    --cc=dri-devel@lists.freedesktop.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.