<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/ufs, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-25T10:05:51+00:00</updated>
<entry>
<title>scsi: ufs: core: Fix SError in ufshcd_rtc_work() during UFS suspend</title>
<updated>2026-03-25T10:05:51+00:00</updated>
<author>
<name>Wang Shuaiwei</name>
<email>wangshuaiwei1@xiaomi.com</email>
</author>
<published>2026-03-07T03:51:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a6a894413b043704b77a6294c379c93b1477e48d'/>
<id>urn:sha1:a6a894413b043704b77a6294c379c93b1477e48d</id>
<content type='text'>
[ Upstream commit b0bd84c39289ef6a6c3827dd52c875659291970a ]

In __ufshcd_wl_suspend(), cancel_delayed_work_sync() is called to cancel
the UFS RTC work, but it is placed after ufshcd_vops_suspend(hba, pm_op,
POST_CHANGE). This creates a race condition where ufshcd_rtc_work() can
still be running while ufshcd_vops_suspend() is executing. When
UFSHCD_CAP_CLK_GATING is not supported, the condition
!hba-&gt;clk_gating.active_reqs is always true, causing ufshcd_update_rtc()
to be executed. Since ufshcd_vops_suspend() typically performs clock
gating operations, executing ufshcd_update_rtc() at that moment triggers
an SError. The kernel panic trace is as follows:

Kernel panic - not syncing: Asynchronous SError Interrupt
Call trace:
 dump_backtrace+0xec/0x128
 show_stack+0x18/0x28
 dump_stack_lvl+0x40/0xa0
 dump_stack+0x18/0x24
 panic+0x148/0x374
 nmi_panic+0x3c/0x8c
 arm64_serror_panic+0x64/0x8c
 do_serror+0xc4/0xc8
 el1h_64_error_handler+0x34/0x4c
 el1h_64_error+0x68/0x6c
 el1_interrupt+0x20/0x58
 el1h_64_irq_handler+0x18/0x24
 el1h_64_irq+0x68/0x6c
 ktime_get+0xc4/0x12c
 ufshcd_mcq_sq_stop+0x4c/0xec
 ufshcd_mcq_sq_cleanup+0x64/0x1dc
 ufshcd_clear_cmd+0x38/0x134
 ufshcd_issue_dev_cmd+0x298/0x4d0
 ufshcd_exec_dev_cmd+0x1a4/0x1c4
 ufshcd_query_attr+0xbc/0x19c
 ufshcd_rtc_work+0x10c/0x1c8
 process_scheduled_works+0x1c4/0x45c
 worker_thread+0x32c/0x3e8
 kthread+0x120/0x1d8
 ret_from_fork+0x10/0x20

Fix this by moving cancel_delayed_work_sync() before the call to
ufshcd_vops_suspend(hba, pm_op, PRE_CHANGE), ensuring the UFS RTC work is
fully completed or cancelled at that point.

Cc: Bean Huo &lt;beanhuo@iokpp.de&gt;
Fixes: 6bf999e0eb41 ("scsi: ufs: core: Add UFS RTC support")
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Wang Shuaiwei &lt;wangshuaiwei1@xiaomi.com&gt;
Link: https://patch.msgid.link/20260307035128.3419687-1-wangshuaiwei1@xiaomi.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: ufs: core: Fix shift out of bounds when MAXQ=32</title>
<updated>2026-03-25T10:05:44+00:00</updated>
<author>
<name>wangshuaiwei</name>
<email>wangshuaiwei1@xiaomi.com</email>
</author>
<published>2026-02-24T06:32:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=32af155064503c20c9480ec3b3d4a0e659fafdcf'/>
<id>urn:sha1:32af155064503c20c9480ec3b3d4a0e659fafdcf</id>
<content type='text'>
[ Upstream commit 2f38fd99c0004676d835ae96ac4f3b54edc02c82 ]

According to JESD223F, the maximum number of queues (MAXQ) is 32. When MCQ
is enabled and ESI is disabled, nr_hw_queues=32 causes a shift overflow
problem.

Fix this by using 64-bit intermediate values to handle the nr_hw_queues=32
case safely.

Signed-off-by: wangshuaiwei &lt;wangshuaiwei1@xiaomi.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/20260224063228.50112-1-wangshuaiwei1@xiaomi.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: ufs: core: Fix possible NULL pointer dereference in ufshcd_add_command_trace()</title>
<updated>2026-03-25T10:05:44+00:00</updated>
<author>
<name>Peter Wang</name>
<email>peter.wang@mediatek.com</email>
</author>
<published>2026-02-23T06:56:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0614f5618c24fbc3d555efade22887b102ad7ad6'/>
<id>urn:sha1:0614f5618c24fbc3d555efade22887b102ad7ad6</id>
<content type='text'>
[ Upstream commit 30df81f2228d65bddf492db3929d9fcaffd38fc5 ]

The kernel log indicates a crash in ufshcd_add_command_trace, due to a NULL
pointer dereference when accessing hwq-&gt;id.  This can happen if
ufshcd_mcq_req_to_hwq() returns NULL.

This patch adds a NULL check for hwq before accessing its id field to
prevent a kernel crash.

Kernel log excerpt:
[&lt;ffffffd5d192dc4c&gt;] notify_die+0x4c/0x8c
[&lt;ffffffd5d1814e58&gt;] __die+0x60/0xb0
[&lt;ffffffd5d1814d64&gt;] die+0x4c/0xe0
[&lt;ffffffd5d181575c&gt;] die_kernel_fault+0x74/0x88
[&lt;ffffffd5d1864db4&gt;] __do_kernel_fault+0x314/0x318
[&lt;ffffffd5d2a3cdf8&gt;] do_page_fault+0xa4/0x5f8
[&lt;ffffffd5d2a3cd34&gt;] do_translation_fault+0x34/0x54
[&lt;ffffffd5d1864524&gt;] do_mem_abort+0x50/0xa8
[&lt;ffffffd5d2a297dc&gt;] el1_abort+0x3c/0x64
[&lt;ffffffd5d2a29718&gt;] el1h_64_sync_handler+0x44/0xcc
[&lt;ffffffd5d181133c&gt;] el1h_64_sync+0x80/0x88
[&lt;ffffffd5d255c1dc&gt;] ufshcd_add_command_trace+0x23c/0x320
[&lt;ffffffd5d255bad8&gt;] ufshcd_compl_one_cqe+0xa4/0x404
[&lt;ffffffd5d2572968&gt;] ufshcd_mcq_poll_cqe_lock+0xac/0x104
[&lt;ffffffd5d11c7460&gt;] ufs_mtk_mcq_intr+0x54/0x74 [ufs_mediatek_mod]
[&lt;ffffffd5d19ab92c&gt;] __handle_irq_event_percpu+0xc8/0x348
[&lt;ffffffd5d19abca8&gt;] handle_irq_event+0x3c/0xa8
[&lt;ffffffd5d19b1f0c&gt;] handle_fasteoi_irq+0xf8/0x294
[&lt;ffffffd5d19aa778&gt;] generic_handle_domain_irq+0x54/0x80
[&lt;ffffffd5d18102bc&gt;] gic_handle_irq+0x1d4/0x330
[&lt;ffffffd5d1838210&gt;] call_on_irq_stack+0x44/0x68
[&lt;ffffffd5d183af30&gt;] do_interrupt_handler+0x78/0xd8
[&lt;ffffffd5d2a29c00&gt;] el1_interrupt+0x48/0xa8
[&lt;ffffffd5d2a29ba8&gt;] el1h_64_irq_handler+0x14/0x24
[&lt;ffffffd5d18113c4&gt;] el1h_64_irq+0x80/0x88
[&lt;ffffffd5d2527fb4&gt;] arch_local_irq_enable+0x4/0x1c
[&lt;ffffffd5d25282e4&gt;] cpuidle_enter+0x34/0x54
[&lt;ffffffd5d195a678&gt;] do_idle+0x1dc/0x2f8
[&lt;ffffffd5d195a7c4&gt;] cpu_startup_entry+0x30/0x3c
[&lt;ffffffd5d18155c4&gt;] secondary_start_kernel+0x134/0x1ac
[&lt;ffffffd5d18640bc&gt;] __secondary_switched+0xc4/0xcc

Signed-off-by: Peter Wang &lt;peter.wang@mediatek.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/20260223065657.2432447-1-peter.wang@mediatek.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: ufs: core: Move link recovery for hibern8 exit failure to wl_resume</title>
<updated>2026-03-25T10:05:30+00:00</updated>
<author>
<name>Peter Wang</name>
<email>peter.wang@mediatek.com</email>
</author>
<published>2026-02-23T10:37:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=133c3f3dde72e5b0b6e2586eeac5fe3f5ce5cf6b'/>
<id>urn:sha1:133c3f3dde72e5b0b6e2586eeac5fe3f5ce5cf6b</id>
<content type='text'>
[ Upstream commit 62c015373e1cdb1cdca824bd2dbce2dac0819467 ]

Move the link recovery trigger from ufshcd_uic_pwr_ctrl() to
__ufshcd_wl_resume(). Ensure link recovery is only attempted when hibern8
exit fails during resume, not during hibern8 enter in suspend. Improve
error handling and prevent unnecessary link recovery attempts.

Fixes: 35dabf4503b9 ("scsi: ufs: core: Use link recovery when h8 exit fails during runtime resume")
Signed-off-by: Peter Wang &lt;peter.wang@mediatek.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/20260223103906.2533654-1-peter.wang@mediatek.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: ufs: core: Flush exception handling work when RPM level is zero</title>
<updated>2026-03-04T12:21:14+00:00</updated>
<author>
<name>Thomas Yen</name>
<email>thomasyen@google.com</email>
</author>
<published>2026-01-29T16:51:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa8d68d97c7f0ef966e51afc17fdbdc372700edf'/>
<id>urn:sha1:aa8d68d97c7f0ef966e51afc17fdbdc372700edf</id>
<content type='text'>
[ Upstream commit f8ef441811ec413717f188f63d99182f30f0f08e ]

Ensure that the exception event handling work is explicitly flushed during
suspend when the runtime power management level is set to UFS_PM_LVL_0.

When the RPM level is zero, the device power mode and link state both
remain active. Previously, the UFS core driver bypassed flushing exception
event handling jobs in this configuration. This created a race condition
where the driver could attempt to access the host controller to handle an
exception after the system had already entered a deep power-down state,
resulting in a system crash.

Explicitly flush this work and disable auto BKOPs before the suspend
callback proceeds. This guarantees that pending exception tasks complete
and prevents illegal hardware access during the power-down sequence.

Fixes: 57d104c153d3 ("ufs: add UFS power management support")
Signed-off-by: Thomas Yen &lt;thomasyen@google.com&gt;
Cc: Stable Tree &lt;stable@vger.kernel.org&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/20260129165156.956601-1-thomasyen@google.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: ufs: host: mediatek: Require CONFIG_PM</title>
<updated>2026-03-04T12:20:04+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2026-02-02T09:50:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=94a6c85a68bca80498bea771b74e1b93b1e8526e'/>
<id>urn:sha1:94a6c85a68bca80498bea771b74e1b93b1e8526e</id>
<content type='text'>
[ Upstream commit bbb8d98fb4536594cb104fd630ea0f7dce3771d6 ]

The added print statement from a recent fix causes the driver to fail
building when CONFIG_PM is disabled:

drivers/ufs/host/ufs-mediatek.c: In function 'ufs_mtk_resume':
drivers/ufs/host/ufs-mediatek.c:1890:40: error: 'struct dev_pm_info' has no member named 'request'
 1890 |                         hba-&gt;dev-&gt;power.request,

It seems unlikely that the driver can work at all without CONFIG_PM, so
just add a dependency and remove the existing ifdef checks, rather than
adding another ifdef.

Fixes: 15ef3f5aa822 ("scsi: ufs: host: mediatek: Enhance recovery on resume failure")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Link: https://patch.msgid.link/20260202095052.1232703-1-arnd@kernel.org
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: Fix EH failure after W-LUN resume error</title>
<updated>2026-01-17T15:29:56+00:00</updated>
<author>
<name>Brian Kao</name>
<email>powenkao@google.com</email>
</author>
<published>2025-11-12T06:32:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cf73e6020b3d7bd329c09eb21bb0568755ee8536'/>
<id>urn:sha1:cf73e6020b3d7bd329c09eb21bb0568755ee8536</id>
<content type='text'>
[ Upstream commit b4bb6daf4ac4d4560044ecdd81e93aa2f6acbb06 ]

When a W-LUN resume fails, its parent devices in the SCSI hierarchy,
including the scsi_target, may be runtime suspended. Subsequently, the
error handler in ufshcd_recover_pm_error() fails to set the W-LUN device
back to active because the parent target is not active.  This results in
the following errors:

  google-ufshcd 3c2d0000.ufs: ufshcd_err_handler started; HBA state eh_fatal; ...
  ufs_device_wlun 0:0:0:49488: START_STOP failed for power mode: 1, result 40000
  ufs_device_wlun 0:0:0:49488: ufshcd_wl_runtime_resume failed: -5
  ...
  ufs_device_wlun 0:0:0:49488: runtime PM trying to activate child device 0:0:0:49488 but parent (target0:0:0) is not active

Address this by:

 1. Ensuring the W-LUN's parent scsi_target is runtime resumed before
    attempting to set the W-LUN to active within
    ufshcd_recover_pm_error().

 2. Explicitly checking for power.runtime_error on the HBA and W-LUN
    devices before calling pm_runtime_set_active() to clear the error
    state.

 3. Adding pm_runtime_get_sync(hba-&gt;dev) in
    ufshcd_err_handling_prepare() to ensure the HBA itself is active
    during error recovery, even if a child device resume failed.

These changes ensure the device power states are managed correctly
during error recovery.

Signed-off-by: Brian Kao &lt;powenkao@google.com&gt;
Tested-by: Brian Kao &lt;powenkao@google.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/20251112063214.1195761-1-powenkao@google.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: ufs: core: Add ufshcd_update_evt_hist() for UFS suspend error</title>
<updated>2026-01-11T14:22:22+00:00</updated>
<author>
<name>Seunghwan Baek</name>
<email>sh8267.baek@samsung.com</email>
</author>
<published>2025-12-30T15:58:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d1d03d9184a686f6369d9a47eee9d562c6123af0'/>
<id>urn:sha1:d1d03d9184a686f6369d9a47eee9d562c6123af0</id>
<content type='text'>
[ Upstream commit c9f36f04a8a2725172cdf2b5e32363e4addcb14c ]

If UFS resume fails, the event history is updated in ufshcd_resume(), but
there is no code anywhere to record UFS suspend. Therefore, add code to
record UFS suspend error event history.

Fixes: dd11376b9f1b ("scsi: ufs: Split the drivers/scsi/ufs directory")
Cc: stable@vger.kernel.org
Signed-off-by: Seunghwan Baek &lt;sh8267.baek@samsung.com&gt;
Reviewed-by: Peter Wang &lt;peter.wang@mediatek.com&gt;
Link: https://patch.msgid.link/20251210063854.1483899-2-sh8267.baek@samsung.com
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
[ Adjust context ]
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: core: fix incorrect buffer duplication in ufshcd_read_string_desc()</title>
<updated>2026-01-11T14:21:22+00:00</updated>
<author>
<name>Bean Huo</name>
<email>beanhuo@micron.com</email>
</author>
<published>2025-11-07T23:05:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ef2bbc11b82b72e5672ffcd310ff298e2d1dfc8a'/>
<id>urn:sha1:ef2bbc11b82b72e5672ffcd310ff298e2d1dfc8a</id>
<content type='text'>
[ Upstream commit d794b499f948801f54d67ddbc34a6eac5a6d150a ]

The function ufshcd_read_string_desc() was duplicating memory starting
from the beginning of struct uc_string_id, which included the length and
type fields. As a result, the allocated buffer contained unwanted
metadata in addition to the string itself.

The correct behavior is to duplicate only the Unicode character array in
the structure. Update the code so that only the actual string content is
copied into the new buffer.

Fixes: 5f57704dbcfe ("scsi: ufs: Use kmemdup in ufshcd_read_string_desc()")
Reviewed-by: Avri Altman &lt;avri.altman@sandisk.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Bean Huo &lt;beanhuo@micron.com&gt;
Link: https://patch.msgid.link/20251107230518.4060231-3-beanhuo@iokpp.de
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: ufs-pci: Set UFSHCD_QUIRK_PERFORM_LINK_STARTUP_ONCE for Intel ADL</title>
<updated>2025-11-24T09:30:12+00:00</updated>
<author>
<name>Adrian Hunter</name>
<email>adrian.hunter@intel.com</email>
</author>
<published>2025-11-10T00:47:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=57692c303132857fda531adf273086826b409296'/>
<id>urn:sha1:57692c303132857fda531adf273086826b409296</id>
<content type='text'>
[ Upstream commit d968e99488c4b08259a324a89e4ed17bf36561a4 ]

Link startup becomes unreliable for Intel Alder Lake based host
controllers when a 2nd DME_LINKSTARTUP is issued unnecessarily.  Employ
UFSHCD_QUIRK_PERFORM_LINK_STARTUP_ONCE to suppress that from happening.

Fixes: 7dc9fb47bc9a ("scsi: ufs: ufs-pci: Add support for Intel ADL")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://patch.msgid.link/20251024085918.31825-4-adrian.hunter@intel.com
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
