<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/drivers/mmc/host, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2026-08-04T13:39:35+00:00</updated>
<entry>
<title>mmc: Merge branch fixes into next</title>
<updated>2026-08-04T13:39:35+00:00</updated>
<author>
<name>Ulf Hansson</name>
<email>ulfh@kernel.org</email>
</author>
<published>2026-08-04T13:39:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fae38c1b0b6e06d87efb2fc583e15e7846294410'/>
<id>urn:sha1:fae38c1b0b6e06d87efb2fc583e15e7846294410</id>
<content type='text'>
Merge the mmc fixes for v7.2-rc[n] into the next branch, to allow them to
get tested together with the mmc changes that are targeted for the next
release.

Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: loongson2: Fix sg iteration in data reorder functions</title>
<updated>2026-08-04T13:39:11+00:00</updated>
<author>
<name>Binbin Zhou</name>
<email>zhoubinbin@loongson.cn</email>
</author>
<published>2026-08-04T06:12:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=00179ed9fbe07799676e2cb63c4e7f0e7cd80a5c'/>
<id>urn:sha1:00179ed9fbe07799676e2cb63c4e7f0e7cd80a5c</id>
<content type='text'>
In ls2k0500_mmc_reorder_cmd_data() and ls2k2000_mmc_reorder_cmd_data(),
the for_each_sg() macro already iterates over the scatterlist entries,
with 'sg' pointing to the current entry. However, the code incorrectly
uses '&amp;sg[i]' and 'sg_dma_len(&amp;sg[i])' inside the loop, which treats
'sg' as an array base and indexes it again, leading to access of
wrong sg entries (or out-of-bounds if the list is not an array).

Cc: stable@vger.kernel.org
Fixes: d0f8e961deae ("mmc: loongson2: Add Loongson-2K2000 SD/SDIO/eMMC controller driver")
Fixes: 2115772014bd ("mmc: loongson2: Add Loongson-2K SD/SDIO controller driver")
Signed-off-by: Binbin Zhou &lt;zhoubinbin@loongson.cn&gt;
Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: omap_hsmmc: fix busy_timeout overflow in ns conversion on 32-bit</title>
<updated>2026-08-04T13:39:11+00:00</updated>
<author>
<name>Zhan Xusheng</name>
<email>zhanxusheng1024@gmail.com</email>
</author>
<published>2026-08-04T02:25:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f64ea900e4bda3055ef24a2c906f8d049cf1c3bd'/>
<id>urn:sha1:f64ea900e4bda3055ef24a2c906f8d049cf1c3bd</id>
<content type='text'>
omap_hsmmc_prepare_data() converts the command busy timeout to nanoseconds
with:

	timeout = req-&gt;cmd-&gt;busy_timeout * NSEC_PER_MSEC;

busy_timeout is an unsigned int (milliseconds) and timeout is a u64, but
NSEC_PER_MSEC is 1000000L.  On 32-bit builds the multiplication is
performed in 32-bit arithmetic and wraps for busy_timeout values above
~4294 ms, before the result is assigned to the u64.

The driver does not set mmc-&gt;max_busy_timeout, so the core does not cap the
busy timeout, and commands such as erase or SANITIZE (MMC_SANITIZE_TIMEOUT_MS
is 240000 ms) can pass a busy_timeout far larger than 4294 ms.  The wrapped,
much smaller ns value is then programmed via set_data_timeout(), so the data
timeout is set too short and the operation can time out prematurely.

Cast busy_timeout to u64 before the multiplication so the conversion is done
in 64-bit arithmetic.

Fixes: 8cc9a3e73de1 ("mmc: host: omap_hsmmc: use generic_cmd6_time to program timeout value for CMD6")
Cc: stable@vger.kernel.org
Signed-off-by: Zhan Xusheng &lt;zhanxusheng@xiaomi.com&gt;
Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: atmel-mci: Fix use-after-free in atmci_remove due to race condition</title>
<updated>2026-08-04T13:05:39+00:00</updated>
<author>
<name>Pei Xiao</name>
<email>xiaopei01@kylinos.cn</email>
</author>
<published>2026-08-03T09:48:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c125ee35a49a0518521b52b27631eef061b8719a'/>
<id>urn:sha1:c125ee35a49a0518521b52b27631eef061b8719a</id>
<content type='text'>
In atmci_probe, &amp;host-&gt;bh_work is bound with atmci_work_func, and
atmci_interrupt, atmci_timeout_timer and atmci_dma_complete can all
queue this work on system_bh_wq.

If we remove the module, atmci_remove makes cleanup and the memory
allocated for host with devm_kzalloc() is released after the remove
callback returns, while the work mentioned above may still be pending
or running. The sequence of operations that may lead to a UAF bug is
as follows:

CPU0                                      CPU1

                                          | atmci_interrupt
                                          | queue_work(system_bh_wq,
                                          |            &amp;host-&gt;bh_work)
atmci_remove                              |
atmci_cleanup_slot(...)                   |
atmci_writel(host, ATMCI_IDR, ~0UL)       |
timer_delete_sync(&amp;host-&gt;timer)           |
dma_release_channel(host-&gt;dma.chan)       |
free_irq(platform_get_irq(pdev, 0), host) |
                                          | atmci_work_func
                                          | // use host
// devm resources released after          |
// remove returns, host is freed          |
                                          | // use host (use-after-free)

Fix it by canceling the work after all the sources that can schedule
it (IRQ handler, timeout timer and DMA completion callback) have been
stopped, and before proceeding with the remaining cleanup in
atmci_remove.

Fixes: 7d2be0749a59 ("atmel-mci: Driver for Atmel on-chip MMC controllers")
Assisted-by: Codex:deepseek-v4-flash
Signed-off-by: Pei Xiao &lt;xiaopei01@kylinos.cn&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: sdhci: unmap the bounce buffer before device release</title>
<updated>2026-08-04T11:24:20+00:00</updated>
<author>
<name>Myeonghun Pak</name>
<email>mhun512@gmail.com</email>
</author>
<published>2026-07-27T14:03:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9e9f561269dff35e6f84ed21776ec37fd6360b03'/>
<id>urn:sha1:9e9f561269dff35e6f84ed21776ec37fd6360b03</id>
<content type='text'>
sdhci_allocate_bounce_buffer() allocates its buffer with devm_kmalloc()
but maps it with dma_map_single(). The buffer is therefore released by
devres without the streaming DMA mapping being unmapped.

Register a managed action after dma_map_single() succeeds so the mapping
is removed before devres releases the buffer. The action is registered
only for buffers allocated and mapped by the SDHCI core, leaving buffers
provided by host drivers under their existing ownership.

Fixes: bd9b902798ab ("mmc: sdhci: Implement an SDHCI-specific bounce buffer")
Cc: stable@vger.kernel.org
Co-developed-by: Ijae Kim &lt;ae878000@gmail.com&gt;
Signed-off-by: Ijae Kim &lt;ae878000@gmail.com&gt;
Signed-off-by: Myeonghun Pak &lt;mhun512@gmail.com&gt;
Reviewed-by: Linus Walleij &lt;linusw@kernel.org&gt;
Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: sdhci: make tuning_err a signed int</title>
<updated>2026-08-04T11:23:00+00:00</updated>
<author>
<name>Haibo Chen</name>
<email>haibo.chen@nxp.com</email>
</author>
<published>2026-07-27T10:38:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=ae31bcc92bb42502bb7c9029e6dc7a824cf6cd14'/>
<id>urn:sha1:ae31bcc92bb42502bb7c9029e6dc7a824cf6cd14</id>
<content type='text'>
Coverity report INTEGER_OVERFLOW for host-&gt;tuning_err.
The tuning_err field in struct sdhci_host is used to store an error
code for re-tuning, but it was declared as unsigned int. Several call
sites store negative error codes into it and later compare against
negative values:

  - sdhci.c, sdhci-of-dwcmshc.c and sdhci-pci-gli.c assign it the
    return value of __sdhci_execute_tuning()/__sdhci_execute_tuning_9750(),
    both of which return a signed int (possibly a negative errno);
  - sdhci-of-esdhc.c assigns host-&gt;tuning_err = -EAGAIN and later does
    "ret = host-&gt;tuning_err; if (ret == -EAGAIN ...)";
  - sdhci-of-dwcmshc.c prints it with the %d (signed) conversion.

Storing a negative errno in an unsigned int and reading it back as a
signed int only happens to work because of two's-complement, same-width
integer conversions. It is misleading and triggers sign-conversion
warnings. All users treat the value either as a signed error code or as
a boolean (zero / non-zero), so changing the type to a signed int is
safe and makes the intent explicit.

Fixes: 7d8bb1f46e13 ("mmc: sdhci: add tuning error codes")
Assisted-by: Cline:claude-sonnet [read_file, search_files, git]
Signed-off-by: Haibo Chen &lt;haibo.chen@nxp.com&gt;
Reviewed-by: Frank Li &lt;Frank.Li@nxp.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: sdhci-tegra: Add Tegra264 SoC data</title>
<updated>2026-08-03T12:33:36+00:00</updated>
<author>
<name>Prathamesh Shete</name>
<email>pshete@nvidia.com</email>
</author>
<published>2026-07-24T07:56:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f92c238425e17b50095797276dbae757582ca3a5'/>
<id>urn:sha1:f92c238425e17b50095797276dbae757582ca3a5</id>
<content type='text'>
Add a new SoC data structure for Tegra264 platforms and register the
nvidia,tegra264-sdhci compatible string. Configure the supported
features and tap delay values for the Tegra264 SDHCI controller.

Signed-off-by: Prathamesh Shete &lt;pshete@nvidia.com&gt;
Reviewed-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: sdhci-tegra: Add Tegra238 SoC data</title>
<updated>2026-08-03T12:33:36+00:00</updated>
<author>
<name>Prathamesh Shete</name>
<email>pshete@nvidia.com</email>
</author>
<published>2026-07-24T07:56:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=114939f96ecf07d044800d63be0cf4000ba275bc'/>
<id>urn:sha1:114939f96ecf07d044800d63be0cf4000ba275bc</id>
<content type='text'>
Add a new SoC data structure for Tegra238 platforms and register the
nvidia,tegra238-sdhci compatible string. Configure the supported
features and tap delay values for the Tegra238 SDHCI controller.

Signed-off-by: Prathamesh Shete &lt;pshete@nvidia.com&gt;
Reviewed-by: Jon Hunter &lt;jonathanh@nvidia.com&gt;
Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: omap_hsmmc: use platform_get_irq_optional for wake IRQ</title>
<updated>2026-07-27T16:21:36+00:00</updated>
<author>
<name>Rosen Penev</name>
<email>rosenp@gmail.com</email>
</author>
<published>2026-07-26T21:57:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8a5a1e727fcaf4bc9f742bf71a4de7eb49de9623'/>
<id>urn:sha1:8a5a1e727fcaf4bc9f742bf71a4de7eb49de9623</id>
<content type='text'>
Replace irq_of_parse_and_map() with platform_get_irq_optional() to
get the wake IRQ. This is a more portable approach that works with
both DT and non-DT platforms, and follows the modern platform API
conventions for optional IRQ resources.

The wake IRQ is now fetched earlier in the probe function alongside
the main IRQ, and the -EPROBE_DEFER case is handled properly before
the deferred probe can be triggered.

Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
<entry>
<title>mmc: via-sdmmc: cancel card-detect work on remove</title>
<updated>2026-07-27T15:59:33+00:00</updated>
<author>
<name>Fan Wu</name>
<email>fanwu01@zju.edu.cn</email>
</author>
<published>2026-07-23T11:28:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=57e5d877f898d5e5c9d672a77bb6bdd24f0d9bf5'/>
<id>urn:sha1:57e5d877f898d5e5c9d672a77bb6bdd24f0d9bf5</id>
<content type='text'>
Disabling the device interrupt and freeing the IRQ prevents new card-detect
work from being queued, but carddet_work already queued by the handler can
still run after via_sd_remove() returns. via_sdc_card_detect() recovers the
host through container_of() and dereferences its MMIO base; once remove()
returns the host can be freed, so that work would touch freed memory.

Cancel carddet_work after freeing the IRQ and before cancelling
finish_bh_work, which the card-detect handler can also queue. carddet_work
can re-enable the interrupt through via_reset_pcictrl(); mask it again
afterwards.

This issue was found by an in-house static analysis tool and confirmed by
manual code review.

Fixes: f0bf7f61b840 ("mmc: Add new via-sdmmc host controller driver")
Cc: stable@vger.kernel.org
Assisted-by: Codex:gpt-5.6
Signed-off-by: Fan Wu &lt;fanwu01@zju.edu.cn&gt;
Signed-off-by: Ulf Hansson &lt;ulfh@kernel.org&gt;
</content>
</entry>
</feed>
