<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/drivers/ufs, branch linux-7.2.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-7.2.y</id>
<link rel='self' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/atom?h=linux-7.2.y'/>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2026-09-14T11:40:45+00:00</updated>
<entry>
<title>scsi: ufs: core: Set task state before io_schedule_timeout()</title>
<updated>2026-09-14T11:40:45+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2026-08-07T22:49:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c52f3c102687b48186f3c8f422a941a52609f44b'/>
<id>urn:sha1:c52f3c102687b48186f3c8f422a941a52609f44b</id>
<content type='text'>
[ Upstream commit 720d8b2f2457f4962ca353dd90395e2660d9a10d ]

Set the task state to TASK_UNINTERRUPTIBLE before calling
io_schedule_timeout() in ufshcd_wait_for_pending_cmds().  Without
setting the task state, io_schedule_timeout() returns immediately
because the task state remains TASK_RUNNING. This results in a busy loop
that wastes CPU cycles.

Fixes: 2000bc309703 ("scsi: ufs: core: Reduce the clock scaling latency")
Reviewed-by: Peter Wang &lt;peter.wang@mediatek.com&gt;
Reported-by: Sashiko &lt;sashiko-bot@kernel.org&gt;
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/8fe4526ce272811b28e99048b42358dd8f7c48af.1786142946.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: debugfs: Reserve space for a string terminator</title>
<updated>2026-09-14T11:39:49+00:00</updated>
<author>
<name>Li Qiang</name>
<email>liqiang01@kylinos.cn</email>
</author>
<published>2026-07-17T15:39:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2b3fb5693c25c21741f357a8c9d0e1f19b7e368f'/>
<id>urn:sha1:2b3fb5693c25c21741f357a8c9d0e1f19b7e368f</id>
<content type='text'>
[ Upstream commit abd26e6b53c4169122d61fdd4cabe09bdd916aac ]

ufs_saved_err_write() copies user input into a zero-initialized stack
buffer and passes it to kstrtoint(). A write that fills the entire buffer
overwrites its only terminator.

Reject an input whose length leaves no room for the trailing NUL.

Fixes: 7340faae9474 ("scsi: ufs: core: Add debugfs attributes for triggering the UFS EH")
Signed-off-by: Li Qiang &lt;liqiang01@kylinos.cn&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Reviewed-by: Peter Wang &lt;peter.wang@mediatek.com&gt;
Link: https://patch.msgid.link/20260717153914.26321-7-liqiang01@kylinos.cn
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: rpmb: Validate request frame length before parsing</title>
<updated>2026-09-14T11:39:49+00:00</updated>
<author>
<name>Li Qiang</name>
<email>liqiang01@kylinos.cn</email>
</author>
<published>2026-07-17T15:39:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=cfef700703d98d3629159dcade27c695959ecf1c'/>
<id>urn:sha1:cfef700703d98d3629159dcade27c695959ecf1c</id>
<content type='text'>
[ Upstream commit a947b8edbdcec8415a80ca55e9f38801322ffdd3 ]

The RPMB core only verifies that request and response buffers are
nonempty. This callback reads req_resp at the end of the first request
frame before validating the request length.  Require a complete frame
before that access.

Fixes: b06b8c421485 ("scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices")
Signed-off-by: Li Qiang &lt;liqiang01@kylinos.cn&gt;
Reviewed-by: Peter Wang &lt;peter.wang@mediatek.com&gt;
Reviewed-by: Bean Huo &lt;beanhuo@micron.com&gt;
Link: https://patch.msgid.link/20260717153914.26321-5-liqiang01@kylinos.cn
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Validate connected lane counts</title>
<updated>2026-09-14T11:39:49+00:00</updated>
<author>
<name>Li Qiang</name>
<email>liqiang01@kylinos.cn</email>
</author>
<published>2026-07-17T15:39:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4b62f73836f4d037c9afd20c4c6084e4d44b3a57'/>
<id>urn:sha1:4b62f73836f4d037c9afd20c4c6084e4d44b3a57</id>
<content type='text'>
[ Upstream commit 9e6dd452f1affb5c412ca64bf5809ce9fde3174d ]

The connected lane count is used by TX equalization code to index arrays
sized by UFS_MAX_LANES. Reject zero and out-of-range RX or TX lane counts
before they can be propagated.

Fixes: 03e5d38e2f98 ("scsi: ufs: core: Add support for TX Equalization")
Signed-off-by: Li Qiang &lt;liqiang01@kylinos.cn&gt;
Link: https://patch.msgid.link/20260717153914.26321-4-liqiang01@kylinos.cn
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: Avoid NULL CQE dereference when reporting invalid tags</title>
<updated>2026-09-14T11:39:49+00:00</updated>
<author>
<name>Li Qiang</name>
<email>liqiang01@kylinos.cn</email>
</author>
<published>2026-07-17T15:39:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a769095d1d74ebac2b1474c56bbd29bb0b9ed5a7'/>
<id>urn:sha1:a769095d1d74ebac2b1474c56bbd29bb0b9ed5a7</id>
<content type='text'>
[ Upstream commit 331bda797e6afc143127ce72b1469d73316f49b4 ]

The single-doorbell completion path can call ufshcd_compl_one_cqe() with a
NULL CQE. If no command is associated with the completion tag, the warning
message dereferences the CQE while reporting the error.  Avoid that
dereference and include the invalid tag in the warning.

Fixes: 22089c218037 ("scsi: ufs: core: Optimize the hot path")
Signed-off-by: Li Qiang &lt;liqiang01@kylinos.cn&gt;
Reviewed-by: Peter Wang &lt;peter.wang@mediatek.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/20260717153914.26321-3-liqiang01@kylinos.cn
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Validate string descriptors</title>
<updated>2026-09-14T11:39:49+00:00</updated>
<author>
<name>Li Qiang</name>
<email>liqiang01@kylinos.cn</email>
</author>
<published>2026-07-17T15:39:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=66da25277256b6bf4c3fdbf3c9bfd43324c9cf25'/>
<id>urn:sha1:66da25277256b6bf4c3fdbf3c9bfd43324c9cf25</id>
<content type='text'>
[ Upstream commit d96e83d028d7d8762e424e49c671d49ac2ecf14f ]

The string descriptor length includes a two-byte header while the UTF-16
payload starts after it. utf16s_to_utf8s() expects a count of UTF-16 code
units, not bytes. Passing the payload byte count can make it read beyond
the descriptor buffer.

Validate that the payload has an even byte count, pass a code-unit count to
the converter, and allocate sufficient UTF-8 output space.

The raw string buffer starts after the descriptor header but its size is
bLength. Copying bLength bytes from that pointer can read beyond the
response buffer.

Allocate a zeroed bLength-sized buffer and copy only the UTF-16
payload. This preserves the raw buffer size consumed by the RPMB device-ID
ABI while avoiding the overread.

Fixes: 4b828fe156a6 ("scsi: ufs: revamp string descriptor reading")
Fixes: d794b499f948 ("scsi: ufs: core: fix incorrect buffer duplication in ufshcd_read_string_desc()")
Signed-off-by: Li Qiang &lt;liqiang01@kylinos.cn&gt;
Reviewed-by: Peter Wang &lt;peter.wang@mediatek.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/20260717153914.26321-2-liqiang01@kylinos.cn
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Avoid possible memory reclaim deadlock in TX EQTR context</title>
<updated>2026-09-14T11:39:35+00:00</updated>
<author>
<name>Can Guo</name>
<email>can.guo@oss.qualcomm.com</email>
</author>
<published>2026-06-18T14:09:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a28a7d9b3bb116da788ae492c90465ec1a7fa6e8'/>
<id>urn:sha1:a28a7d9b3bb116da788ae492c90465ec1a7fa6e8</id>
<content type='text'>
[ Upstream commit 760fc6f0e25a72832c2fcf37ecf5f1b770ec8374 ]

TX EQTR may run while devfreq gear scaling has quiesced the UFS
tagset. In that context, functions ufshcd_tx_eqtr(), __ufshcd_tx_eqtr()
and ufs_qcom_get_rx_fom() allocate memory with GFP_KERNEL. If direct
reclaim is triggered, reclaim/writeback can depend on I/O to UFS
device. Because the queue is quiesced, this can cause deadlock.

Use memalloc_noio_save/restore() in ufshcd_tx_eqtr() to cover all
allocations in the TX EQTR call tree, including:

 - params-&gt;eqtr_record in ufshcd_tx_eqtr()

 - eqtr_data in __ufshcd_tx_eqtr()

 - params in ufs_qcom_get_rx_fom()

This is preferred over tagging individual call sites with GFP_NOIO, as it
automatically covers any future allocations added anywhere in the call tree
without requiring each caller to be aware of this constraint.

[mkp: fix label as suggested by Bart]

Fixes: 03e5d38e2f98 ("scsi: ufs: core: Add support for TX Equalization")
Closes: https://sashiko.dev/#/patchset/20260615132834.2985346-1-can.guo@oss.qualcomm.com?part=2
Signed-off-by: Can Guo &lt;can.guo@oss.qualcomm.com&gt;
Reviewed-by: Ziqi Chen &lt;ziqi.chen@oss.qualcomm.com&gt;
Reviewed-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Link: https://patch.msgid.link/20260618140941.902000-1-can.guo@oss.qualcomm.com
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: core: pair EH runtime PM get and put</title>
<updated>2026-08-07T15:00:49+00:00</updated>
<author>
<name>Hongjie Fang</name>
<email>hongjiefang@asrmicro.com</email>
</author>
<published>2026-07-29T11:16:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=872f486259ae0bc6b73ca4735a15d013241f73e9'/>
<id>urn:sha1:872f486259ae0bc6b73ca4735a15d013241f73e9</id>
<content type='text'>
shost-&gt;eh_noresume is currently consulted twice in one error handling
iteration: once before scsi_autopm_get_host() and once again before
scsi_autopm_put_host().

That is racy when a PM-triggered error path flips shost-&gt;eh_noresume
while the SCSI EH thread is still running.

The problem flow looks like this:
PM path
  ufshcd_set_dev_pwr_mode()
    shost-&gt;eh_noresume = 1
    ufshcd_execute_start_stop  &lt;-- trigger EH
    ...
    shost-&gt;eh_noresume = 0

EH path
  scsi_error_handler()
    if (!shost-&gt;eh_noresume)
      scsi_autopm_get_host()  &lt;-- skipped
    ...
    if (!shost-&gt;eh_noresume)
       scsi_autopm_put_host()  &lt;-- executed later

In that case one EH iteration can skip autoresume on entry and still
drop a runtime PM reference on exit. That leaves an unmatched runtime PM
put and can trigger a runtime PM usage count underflow.

Fix this by making eh_noresume a regular bool so it can be accessed with
READ_ONCE() and WRITE_ONCE(). Snapshot it once per EH iteration and use
that snapshot for both runtime PM get and put decisions.

Fixes: ae0751ffc77e ("[SCSI] add flag to skip the runtime PM calls on the host")
Signed-off-by: Hongjie Fang &lt;hongjiefang@asrmicro.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Reviewed-by: Peter Wang &lt;peter.wang@mediatek.com&gt;
Link: https://patch.msgid.link/20260729111614.2407559-1-hongjiefang@asrmicro.com
Signed-off-by: Martin K. Petersen (Oracle) &lt;mkp@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Initialize hba-&gt;rpmbs list in ufshcd</title>
<updated>2026-07-29T02:26:51+00:00</updated>
<author>
<name>Ao Sun</name>
<email>ao.sun@transsion.com</email>
</author>
<published>2026-07-23T03:45:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0279fd451a9971c0d5b959fc59f3e11b55e1694e'/>
<id>urn:sha1:0279fd451a9971c0d5b959fc59f3e11b55e1694e</id>
<content type='text'>
Initialize the hba-&gt;rpmbs list in ufshcd_alloc_host() to prevent NULL
pointer dereference in the device teardown path if ufs_rpmb_probe()
fails.

Fixes: b06b8c421485 ("scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices")
Co-developed-by: Jiazi Li &lt;jiazi.li@transsion.com&gt;
Signed-off-by: Jiazi Li &lt;jiazi.li@transsion.com&gt;
Signed-off-by: Ao Sun &lt;ao.sun@transsion.com&gt;
Reviewed-by: Bean Huo &lt;beanhuo@micron.com&gt;
Link: https://patch.msgid.link/20260723034440.217-1-ao.sun@transsion.com
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Revert "Delegate the interrupt service routine to a threaded IRQ handler"</title>
<updated>2026-07-29T01:52:09+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2026-07-15T17:12:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.landau.one/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8a309036f557d3ff4efb2beea5132ba91172d934'/>
<id>urn:sha1:8a309036f557d3ff4efb2beea5132ba91172d934</id>
<content type='text'>
There have been multiple reports of performance regressions caused by
commit 3c7ac40d7322 ("scsi: ufs: core: Delegate the interrupt service
routine to a threaded IRQ handler"). Hence this revert.

This patch reverts most of the following commits:

 * 3c7ac40d7322 ("scsi: ufs: core: Delegate the interrupt service
   routine to a threaded IRQ handler")

 * 6475cfb81fc4 ("scsi: ufs: core: Avoid IRQ thread wakeup during active
   UIC command")

This patch preserves the following commits:

 * 034d319c8899 ("scsi: ufs: core: Fix interrupt handling for MCQ Mode")

 * eabcac808ca3 ("scsi: ufs: core: Fix IRQ lock inversion for the SCSI
   host lock")

Cc: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Cc: 孙魁 (Kui Sun) &lt;kui.sun@unisoc.com&gt;
Cc: André Draszik &lt;andre.draszik@linaro.org&gt;
Cc: Gregory CLEMENT &lt;gregory.clement@bootlin.com&gt;
Cc: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Fixes: 3c7ac40d7322 ("scsi: ufs: core: Delegate the interrupt service routine to a threaded IRQ handler")
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Reviewed-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Tested-by: André Draszik &lt;andre.draszik@linaro.org&gt; # on Pixel 6
Reviewed-by: André Draszik &lt;andre.draszik@linaro.org&gt;
Link: https://patch.msgid.link/b70eb60a01f971bed68c42c5b555929db5f835df.1784135511.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
