From nobody Mon Jun 15 22:05:38 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51B0C3B5305; Tue, 14 Apr 2026 08:36:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776155782; cv=none; b=jEBECQirOJXXg2yZOnHkZ5m/3yHlhpy6Rvu27b1pOZcAEfp8fb1F9GWMwYGYnnAxJ/9VvL3SYFO6M9UetPQHTBr6bL6BU7zGn5QKydPHQbbFJPnowCaITR/W2jpXg0p6mSniYhD95E/1owEgiELu+0A+YwEpYBdUsH60kTBj5S8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776155782; c=relaxed/simple; bh=lGIiTmh/Tvj2Fo/RSnjUrTEXiEw1HIe+Smy8NJBXI3s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AA3oxxzAgHfVdU4L5iPAsQsj0MgGkPzh+8YTgLZTpqHhsaRx3MEoNVZChv5Ws4BUg6PxGiPmTRz+mJTlrlgJv2E8yxmK5+MLMFvhbGM8yultpjvR/vKO+CuSQ3apCW4NbN91GkkmErbwSKgBesqCoRe5skmjS5/KrAwOw2KhNNE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=Kf/xX/s4; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="Kf/xX/s4" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id EF581260C9; Tue, 14 Apr 2026 10:36:18 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id DQARs8_HN2Qc; Tue, 14 Apr 2026 10:36:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1776155778; bh=lGIiTmh/Tvj2Fo/RSnjUrTEXiEw1HIe+Smy8NJBXI3s=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=Kf/xX/s4mGX8l7QFaxFhEmb2fN+KPznqwW/gfpQKwf1CUGIp711F7lAjJkC/HK/cA 6yhKUdbeqY/ML+AAATWJAlzNGmm6o23ppryEmChlu2S/+kgbl4mkOBq+Xj1fcjy2GY /a/WB//+KdD3sZZIt3ombYCo26hyCeTL/YjwG6EDtpfRHuXGwyXJJaIk6eTyGyc8Rk 3QRpowBcL+9tlbryQ2047gmpbvQtXNA4SthbnhmD7rxFCsyqavWvUoG49A0PtCoIFr 33BJJ/Y7adLf5zUtWKRhDHvm43q5ZFyym0/pyljIy/iQu6iw5eAqwZNh+C8N580bJr T9R2HoWjKx37Q== From: Kaustabh Chakraborty Date: Tue, 14 Apr 2026 14:06:00 +0530 Subject: [PATCH v2 1/2] mmc: dw_mmc: implement option for configuring DMA threshold Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260414-dwmmc-dma-thr-v2-1-4058078f5361@disroot.org> References: <20260414-dwmmc-dma-thr-v2-0-4058078f5361@disroot.org> In-Reply-To: <20260414-dwmmc-dma-thr-v2-0-4058078f5361@disroot.org> To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaehoon Chung , Shawn Lin , Krzysztof Kozlowski , Alim Akhtar Cc: linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Kaustabh Chakraborty Some controllers, such as certain Exynos SDIO ones, are unable to perform DMA transfers of small amount of bytes properly. Following the device tree schema, implement the property to define the DMA transfer threshold (from a hard coded value of 16 bytes) so that lesser number of bytes can be transferred safely skipping DMA in such controllers. The value of 16 bytes stays as the default for controllers which do not define it. This value can be overridden by implementation-specific init sequences. Signed-off-by: Kaustabh Chakraborty --- drivers/mmc/host/dw_mmc.c | 5 +++-- drivers/mmc/host/dw_mmc.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 20193ee7b73eb..9dd9fed4ccf49 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -40,7 +40,6 @@ SDMMC_INT_RESP_ERR | SDMMC_INT_HLE) #define DW_MCI_ERROR_FLAGS (DW_MCI_DATA_ERROR_FLAGS | \ DW_MCI_CMD_ERROR_FLAGS) -#define DW_MCI_DMA_THRESHOLD 16 =20 #define DW_MCI_FREQ_MAX 200000000 /* unit: HZ */ #define DW_MCI_FREQ_MIN 100000 /* unit: HZ */ @@ -821,7 +820,7 @@ static int dw_mci_pre_dma_transfer(struct dw_mci *host, * non-word-aligned buffers or lengths. Also, we don't bother * with all the DMA setup overhead for short transfers. */ - if (data->blocks * data->blksz < DW_MCI_DMA_THRESHOLD) + if (data->blocks * data->blksz < host->dma_threshold) return -EINVAL; =20 if (data->blksz & 3) @@ -3245,6 +3244,8 @@ int dw_mci_probe(struct dw_mci *host) goto err_clk_ciu; } =20 + host->dma_threshold =3D 16; + if (host->rstc) { reset_control_assert(host->rstc); usleep_range(10, 50); diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index 42e58be74ce09..fc7601fba849f 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -164,6 +164,8 @@ struct dw_mci { void __iomem *fifo_reg; u32 data_addr_override; bool wm_aligned; + /* Configurable data byte threshold value for DMA transfer. */ + u32 dma_threshold; =20 struct scatterlist *sg; struct sg_mapping_iter sg_miter; --=20 2.53.0 From nobody Mon Jun 15 22:05:38 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F9C23B2FC8; Tue, 14 Apr 2026 08:36:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776155787; cv=none; b=k6Qy6NNHLvNqyk5UzsZzNtcUHyEjeLWtRIkiv8jk9JQ6v0h/M7bODd8VosEL2/IPLtfFOuzobh4zYMZ9N7PRrls5dhJTWg84wPPkJSM9S4whzUXXQi3LrWXS4Q4GxYTSQ28tGkUoStZYr+KhdXdPwfRMl/PCEG5G+Na92y4qnn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776155787; c=relaxed/simple; bh=L84JWopRw4FxKWz9AQYxbsooFwv6BpfQMhWnSZT5k/o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lSLVxHdoCfGcepYI6/CVrcNK6IaKgtRddTclQeslO1DnrZQ5if/8EIvootSeL7y3yBKCVKnJRkVCXtu+PQnD1gylPJu9F9uKSMy2Vd0+epxkURxKzIEhTr27d5OxRVrbfJ1710PLMdQeJJc+1euhNASZ50VnBEoK9oXbnR/cIEc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=OzUEG68B; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="OzUEG68B" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id B648826E15; Tue, 14 Apr 2026 10:36:24 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 8is0GWIGNF3i; Tue, 14 Apr 2026 10:36:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1776155784; bh=L84JWopRw4FxKWz9AQYxbsooFwv6BpfQMhWnSZT5k/o=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=OzUEG68BWraLt82oL6eodF8oRYmwxfCV4V6DLSn7ixMtUcgoTkTXeR5eihNNsp7XY y8GCEs24oPSKfRaCrIB+ospXIOJREXsi8C5xf7Q35UY6GhR8mVH9GkCsykC3lmwC04 Y5yvtC+VG8cqkEzK0eIFVMEcsB8owjhfO1F1C+al/o54navyRFD4J+zDzK91Fjteme 2IYiVMevdh2uMYGpT/hBri3k9GTK73JQXuBavFJ8PuBSrZSc9kb0Jy1QwFWtrvH9KE h9o2Vhiup8ael14tYg/NdFjf6OL/Bo+Y3gfWQRvuzbd6dG4pkWHsYtTUtEvhbir70q dh/TzFf+52uLA== From: Kaustabh Chakraborty Date: Tue, 14 Apr 2026 14:06:01 +0530 Subject: [PATCH v2 2/2] mmc: dw_mmc: exynos: increase DMA threshold value for exynos7870 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260414-dwmmc-dma-thr-v2-2-4058078f5361@disroot.org> References: <20260414-dwmmc-dma-thr-v2-0-4058078f5361@disroot.org> In-Reply-To: <20260414-dwmmc-dma-thr-v2-0-4058078f5361@disroot.org> To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jaehoon Chung , Shawn Lin , Krzysztof Kozlowski , Alim Akhtar Cc: linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Kaustabh Chakraborty Exynos 7870 compatible controllers, such as SDIO ones are not able to perform DMA transfers for small sizes of data (~16 to ~512 bytes), resulting in cache issues in subsequent transfers. Increase the DMA transfer threshold to 512 to allow the shorter transfers to take place, bypassing DMA. Signed-off-by: Kaustabh Chakraborty --- drivers/mmc/host/dw_mmc-exynos.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exy= nos.c index 261344d3a8cfe..4b76b997ddc15 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -141,6 +141,7 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host) priv->ctrl_type =3D=3D DW_MCI_TYPE_EXYNOS7870_SMU) { /* Quirk needed for certain Exynos SoCs */ host->quirks |=3D DW_MMC_QUIRK_FIFO64_32; + host->dma_threshold =3D 512; } =20 if (priv->ctrl_type =3D=3D DW_MCI_TYPE_ARTPEC8) { --=20 2.53.0