Linux wireless drivers development
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Cc: "René Mérou" <eldeinformatica@pm.me>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"Bjorn Andersson" <andersson@kernel.org>
Subject: Re: CMA allocation fails with default 128M on X1E80100 (Lenovo 21N1CT01WW) for ath12k
Date: Mon, 2 Mar 2026 17:14:55 +0100	[thread overview]
Message-ID: <964b56dc-035e-4d7a-b9a0-5ac5dc6c5787@oss.qualcomm.com> (raw)
In-Reply-To: <ornmlrnmwzpxusdv7e5d27zvqn5ey73dt4gsh7kjrzvcbrrlrp@r5gaj7dphh4l>

On 02/03/2026 14:17, Dmitry Baryshkov wrote:
> On Mon, Mar 02, 2026 at 12:20:17PM +0100, Konrad Dybcio wrote:
>> On 3/2/26 12:19 PM, Konrad Dybcio wrote:
>>> On 2/28/26 10:29 AM, René Mérou wrote:
>>>> Hi,
>>>> I'm experiencing CMA allocation failures with the ath12k WiFi driver on my new Lenovo 21N1CT01WW (Snapdragon X1E80100).
>>>>
>>>> Error in dmesg
>>>>   cma: __cma_alloc: reserved: alloc failed, req-size: 257 pages, ret: -16
>>>>   cma: => 1042 free of 32768 total pages
>>>>
>>>> System details
>>>>     Kernel: 6.17.0-8-qcom-x1e (Ubuntu)
>>>>     Default CMA size: 128M (set by the distribution for this hardware)
>>>>     WiFi chip: ath12k_pci (Qualcomm WCN685x)
>>>>
>>>> What I found
>>>>     With the default 128M CMA, the allocation of 257 pages (~1MB) fails
>>>>     After increasing CMA to 256M (by adding cma=256M to the kernel command line), the error disappears and WiFi works correctly
>>>>
>>>> My questions
>>>>     Is 128M expected to be sufficient for ath12k on this platform?
>>>>     Could the driver be optimized to need less contiguous memory?
>>>>     Should the default CMA size be increased to 256M for X1E80100 devices?
>>>
>>> The default value in the arm64 defconfig is CONFIG_CMA_SIZE_MBYTES=32,
>>> although most laptop DTs individually add a 128M zone under /reserved-memory
>>>
>>> We should probably enlarge this value in either of those places, although I
>>> don't know whether changing the defconfig is going to be welcomed..
> 
> Can we change DT instead of changing defconfig?
> 

I don't think this is a DT property, because it depends how the driver
behaves. If driver allocates smaller or bigger memory, then you keep
changing the DT. And then if other OS does not use CMA, but "TrulyCMA",
then we need to keep this growing, so just propose a change to defconfig.

You can as well fix the drivers to use proper size, based on that DT,
not cmdline argument.

Best regards,
Krzysztof

      reply	other threads:[~2026-03-02 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28  9:29 CMA allocation fails with default 128M on X1E80100 (Lenovo 21N1CT01WW) for ath12k René Mérou
2026-03-02 11:19 ` Konrad Dybcio
2026-03-02 11:20   ` Konrad Dybcio
2026-03-02 13:17     ` Dmitry Baryshkov
2026-03-02 16:14       ` Krzysztof Kozlowski [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=964b56dc-035e-4d7a-b9a0-5ac5dc6c5787@oss.qualcomm.com \
    --to=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=eldeinformatica@pm.me \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox