lkml.org 
[lkml]   [2018]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 09/12] nvme-pci: Use PCI p2pmem subsystem to manage the CMB


On 05/01/18 08:30 AM, Marta Rybczynska wrote:
>> @@ -429,10 +429,7 @@ static void __nvme_submit_cmd(struct nvme_queue *nvmeq,
>> {
>> u16 tail = nvmeq->sq_tail;
>>
>> - if (nvmeq->sq_cmds_io)
>> - memcpy_toio(&nvmeq->sq_cmds_io[tail], cmd, sizeof(*cmd));
>> - else
>> - memcpy(&nvmeq->sq_cmds[tail], cmd, sizeof(*cmd));
>> + memcpy(&nvmeq->sq_cmds[tail], cmd, sizeof(*cmd));
>>
>
> Why is it always memcpy() and not memcpy_toio()? I'd expect something like
> if (nvmeq->sq_cmds_is_io)
> memcpy_toio(&nvmeq->sq_cmds_io[tail], cmd, sizeof(*cmd));
> else
> memcpy(&nvmeq->sq_cmds[tail], cmd, sizeof(*cmd));

We're going on the assumption that memory mapped with
devm_memremap_pages() can be treated as regular memory. So memcpy_toio
is not necessary for P2P memory.

Logan

\
 
 \ /
  Last update: 2018-01-05 19:15    [W:0.069 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site