mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Heidelberg via B4 Relay <devnull+david.ixit.cz@kernel.org>
To: Lee Jones <lee@kernel.org>, Thomas Tai <thomas.tai@oracle.com>,
	 Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	 Krzysztof Kozlowski <krzk@kernel.org>
Cc: mfd@lists.linux.dev, linux-kernel@vger.kernel.org,
	 phone-devel@vger.kernel.org, David Heidelberg <david@ixit.cz>,
	 stable@vger.kernel.org
Subject: [PATCH v3 2/2] mfd: wcd934x: Set DMA mask on parent to silence "DMA mask not set"
Date: Thu, 03 Sep 2026 17:21:43 +0200	[thread overview]
Message-ID: <20260903-wcd-dma-v3-2-d3920c6563c4@ixit.cz> (raw)
In-Reply-To: <20260903-wcd-dma-v3-0-d3920c6563c4@ixit.cz>

From: David Heidelberg <david@ixit.cz>

The wcd934x MFD parent (a slim_device) never initializes its
dma_mask/coherent_dma_mask. When the DT-aware children pass through
of_dma_configure() this triggers the "DMA mask not set" warning for
each child.

Cc: stable@vger.kernel.org
Fixes: f959dcd6ddfd ("dma-direct: Fix potential NULL pointer dereference")
Assisted-by: tencent:hy3
Signed-off-by: David Heidelberg <david@ixit.cz>
---
 drivers/mfd/wcd934x.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c
index 3a939e7ad3da5..fc17c39791301 100644
--- a/drivers/mfd/wcd934x.c
+++ b/drivers/mfd/wcd934x.c
@@ -1,12 +1,13 @@
 // SPDX-License-Identifier: GPL-2.0
 // Copyright (c) 2019, Linaro Limited
 
 #include <linux/clk.h>
+#include <linux/dma-mapping.h>
 #include <linux/gpio/consumer.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/wcd934x/registers.h>
 #include <linux/mfd/wcd934x/wcd934x.h>
 #include <linux/module.h>
 #include <linux/of.h>
@@ -212,16 +213,21 @@ static int wcd934x_slim_status(struct slim_device *sdev,
 static int wcd934x_slim_probe(struct slim_device *sdev)
 {
 	struct device *dev = &sdev->dev;
 	struct device_node *np = dev->of_node;
 	struct wcd934x_ddata *ddata;
 	struct gpio_desc *reset_gpio;
 	int ret;
 
+	ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
+	if (ret)
+		return dev_err_probe(dev, ret,
+				     "Failed to set dma mask\n");
+
 	ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
 	if (!ddata)
 		return	-ENOMEM;
 
 	ddata->irq = of_irq_get(np, 0);
 	if (ddata->irq < 0)
 		return dev_err_probe(dev, ddata->irq,
 				     "Failed to get IRQ\n");

-- 
2.55.0



  parent reply	other threads:[~2026-09-03 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-03 15:21 [PATCH v3 0/2] wcd934x fixes David Heidelberg via B4 Relay
2026-09-03 15:21 ` [PATCH v3 1/2] mfd: wcd934x: Fix NULL pointer dereference on IRQ probe deferral David Heidelberg via B4 Relay
2026-09-16 13:53   ` (subset) " Lee Jones
2026-09-16 14:04     ` Lee Jones
2026-09-03 15:21 ` David Heidelberg via B4 Relay [this message]
2026-09-16 13:49   ` [PATCH v3 2/2] mfd: wcd934x: Set DMA mask on parent to silence "DMA mask not set" Lee Jones
2026-09-16 13:53 ` [PATCH v3 0/2] wcd934x fixes Lee Jones

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=20260903-wcd-dma-v3-2-d3920c6563c4@ixit.cz \
    --to=devnull+david.ixit.cz@kernel.org \
    --cc=david@ixit.cz \
    --cc=konrad.wilk@oracle.com \
    --cc=krzk@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfd@lists.linux.dev \
    --cc=phone-devel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thomas.tai@oracle.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

all inboxes | Powered by JetHome®