linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Rob Herring <robh@kernel.org>,
	Oreoluwa Babatunde <oreoluwa.babatunde@oss.qualcomm.com>
Cc: ye.li@oss.nxp.com, kernel@oss.qualcomm.com, saravanak@google.com,
	akpm@linux-foundation.org, david@redhat.com,
	lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
	vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
	mhocko@suse.com, robin.murphy@arm.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, iommu@lists.linux.dev,
	quic_c_gdjako@quicinc.com
Subject: Re: [PATCH] of: reserved_mem: Allow reserved_mem framework detect "cma=" kernel param
Date: Tue, 27 Jan 2026 16:08:00 +0100	[thread overview]
Message-ID: <4df6023e-310b-4da7-95bd-f2952f40a873@samsung.com> (raw)
In-Reply-To: <CAL_JsqKWd2H0bV9Z8REMBYd2hPMTjDO1T4dYehM-QvemB9zrDg@mail.gmail.com>

On 26.01.2026 17:33, Rob Herring wrote:
> On Mon, Jan 19, 2026 at 4:38 AM Marek Szyprowski
> <m.szyprowski@samsung.com> wrote:
>> On 18.12.2025 15:42, Rob Herring wrote:
>>> On Thu, Dec 18, 2025 at 3:55 AM Marek Szyprowski
>>> <m.szyprowski@samsung.com> wrote:
>>>> On 10.12.2025 15:07, Rob Herring wrote:
>>>>> On Tue, Dec 9, 2025 at 6:20 PM Oreoluwa Babatunde
>>>>> <oreoluwa.babatunde@oss.qualcomm.com> wrote:
>>>>>> When initializing the default cma region, the "cma=" kernel parameter
>>>>>> takes priority over a DT defined linux,cma-default region. Hence, give
>>>>>> the reserved_mem framework the ability to detect this so that the DT
>>>>>> defined cma region can skip initialization accordingly.
>>>>> Please explain here why this is a new problem. Presumably the
>>>>> RESERVEDMEM_OF_DECLARE hook after commit xxxx gets called before the
>>>>> early_param hook. And why is it now earlier?
>>>>>
>>>>> I don't really like the state/ordering having to be worried about in 2 places.
>>>> I also don't like this spaghetti, but it originates from
>>>> commit 8a6e02d0c00e ("of: reserved_mem: Restructure how the reserved
>>>> memory regions are processed") and the first fixup for it: 2c223f7239f3
>>>> ("of: reserved_mem: Restructure call site for
>>>> dma_contiguous_early_fixup()").
>>> Honestly, this code wasn't great before. Every time it is touched it
>>> breaks someone.
>> Indeed it got a bit complicated and needs some improvement, but first I
>> want to fix the the reported regression. This patch does this and it
>> looks that there are no ideas how to fix this in a different way. Rob,
>> could I apply it via dma-mapping-fixes?
> Sigh, yes.
>
> Acked-by: Rob Herring (Arm) <robh@kernel.org>

Thanks! It's very late in this kernel rc cycle, but I will try to merge 
it to v6.19, as this issue is really a problem on some systems, see 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1116251

I've rebased this patch onto v6.19-rc1, fixed the build break reported 
by kernel test robot by adding a stub for 
cma_skip_dt_default_reserved_mem() if no CONFIG_DMA_CMA is set and added 
following fixes tags:

Fixes: 8a6e02d0c00e ("of: reserved_mem: Restructure how the reserved 
memory regions are processed")
Fixes: 2c223f7239f3 ("of: reserved_mem: Restructure call site for 
dma_contiguous_early_fixup()")

With the above mentioned changes I've applied it to my 
dma-mappping-fixes branch. Let's give it a day or two in the linux-next 
for tests and, if nothing explodes, I will send it at the last minute 
for the merge.

I will try to untangle this spaghetti a bit and cleanup the code in the 
next release cycle.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland



      reply	other threads:[~2026-01-27 15:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20251210002053eucas1p1d1408ad0fb49a49bf4371687f8df7395@eucas1p1.samsung.com>
2025-12-10  0:20 ` Oreoluwa Babatunde
2025-12-10 14:07   ` Rob Herring
2025-12-16 22:21     ` Oreoluwa Babatunde
2025-12-12 11:19   ` kernel test robot
2025-12-12 11:19   ` kernel test robot
2025-12-16  3:09   ` Joy Zou
     [not found]   ` <X-TH#1.CAL_JsqL6VVQ7K_ZAbHJ8Gb7ei_jusLx6wRn=AdOVgV50dX0ejQ@mail.gmail.com>
2025-12-18  9:55     ` Marek Szyprowski
2025-12-18 14:42       ` Rob Herring
2026-01-02 23:01         ` Oreoluwa Babatunde
2026-01-19 10:38         ` Marek Szyprowski
2026-01-26 16:33           ` Rob Herring
2026-01-27 15:08             ` Marek Szyprowski [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=4df6023e-310b-4da7-95bd-f2952f40a873@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=devicetree@vger.kernel.org \
    --cc=iommu@lists.linux.dev \
    --cc=kernel@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=oreoluwa.babatunde@oss.qualcomm.com \
    --cc=quic_c_gdjako@quicinc.com \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=rppt@kernel.org \
    --cc=saravanak@google.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --cc=ye.li@oss.nxp.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