From: Bingbu Cao <bingbu.cao@linux.intel.com>
To: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>,
"Huan Yang" <link@vivo.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Dave Airlie" <airlied@redhat.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linaro-mm-sig@lists.linaro.org" <linaro-mm-sig@lists.linaro.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "opensource.kernel@vivo.com" <opensource.kernel@vivo.com>
Subject: Re: [PATCH 2/2] udmabuf: fix vmap missed offset page
Date: Fri, 25 Apr 2025 10:59:22 +0800 [thread overview]
Message-ID: <70a4ae40-dbfe-a8ff-c4d7-a11c35490b3a@linux.intel.com> (raw)
In-Reply-To: <IA0PR11MB7185796FAA2A065CBE4EAB37F8BB2@IA0PR11MB7185.namprd11.prod.outlook.com>
On 4/22/25 1:22 PM, Kasireddy, Vivek wrote:
> Hi Huan,
>
>> Subject: [PATCH 2/2] udmabuf: fix vmap missed offset page
>>
>> Before invoke vmap, we need offer a pages pointer array which each page
>> need to map in vmalloc area.
>>
>> But currently vmap_udmabuf only set each folio's head page into pages,
>> missed each offset pages when iter.
>>
>> This patch set the correctly offset page in each folio into array.
>>
>> Signed-off-by: Huan Yang <link@vivo.com>
>> Fixes: 5e72b2b41a21 ("udmabuf: convert udmabuf driver to use folios")
>> ---
>> drivers/dma-buf/udmabuf.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
>> index 79845565089d..af5200e360a6 100644
>> --- a/drivers/dma-buf/udmabuf.c
>> +++ b/drivers/dma-buf/udmabuf.c
>> @@ -120,7 +120,8 @@ static int vmap_udmabuf(struct dma_buf *buf, struct
>> iosys_map *map)
>> return -ENOMEM;
>>
>> for (pg = 0; pg < ubuf->pagecount; pg++)
>> - pages[pg] = &ubuf->folios[pg]->page;
>> + pages[pg] = folio_page(ubuf->folios[pg],
>> + ubuf->offsets[pg] >> PAGE_SHIFT);
> IIUC, it does not look like vm_map_ram() or the other functions it calls would
> write to these tail page pointers (struct page*), which should be safe even
> when HVO is enabled (based on your conversations with Muchun). However,
> I am wondering whether Bingbu can test this out with HVO enabled?
Sorry, I cannot test HVO enabled case. I was running my case with local
revert patch. :)
>
> Regardless,
> Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
>
> Thanks,
> Vivek
>
>>
>> vaddr = vm_map_ram(pages, ubuf->pagecount, -1);
>> kvfree(pages);
>> --
>> 2.48.1
>
--
Best regards,
Bingbu Cao
prev parent reply other threads:[~2025-04-25 3:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 3:15 [PATCH 0/2] Fix udmabuf vmap error Huan Yang
2025-04-15 3:15 ` [PATCH 1/2] Revert "udmabuf: fix vmap_udmabuf error page set" Huan Yang
2025-04-22 5:14 ` Kasireddy, Vivek
2025-04-23 7:22 ` Huan Yang
2025-04-23 7:26 ` Huan Yang
2025-04-28 4:16 ` Kasireddy, Vivek
2025-04-28 7:03 ` Huan Yang
2025-04-15 3:15 ` [PATCH 2/2] udmabuf: fix vmap missed offset page Huan Yang
2025-04-22 5:22 ` Kasireddy, Vivek
2025-04-23 7:25 ` Huan Yang
2025-04-25 2:59 ` Bingbu Cao [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=70a4ae40-dbfe-a8ff-c4d7-a11c35490b3a@linux.intel.com \
--to=bingbu.cao@linux.intel.com \
--cc=airlied@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=link@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=opensource.kernel@vivo.com \
--cc=sumit.semwal@linaro.org \
--cc=vivek.kasireddy@intel.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