<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/ufs, branch v6.3.12</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.3.12</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.3.12'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2023-06-09T08:48:08Z</updated>
<entry>
<title>scsi: ufs: core: Fix MCQ nr_hw_queues</title>
<updated>2023-06-09T08:48:08Z</updated>
<author>
<name>Po-Wen Kao</name>
<email>powen.kao@mediatek.com</email>
</author>
<published>2023-05-04T15:44:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b1e65473a717725045aad378cc8d824b3be4351b'/>
<id>urn:sha1:b1e65473a717725045aad378cc8d824b3be4351b</id>
<content type='text'>
[ Upstream commit 72a81bb0b6fc9b759ac0fdaca3ec5884a8b2f304 ]

Since MAXQ is 0-based value, add one to obtain number of hardware queues.

Signed-off-by: Po-Wen Kao &lt;powen.kao@mediatek.com&gt;
Link: https://lore.kernel.org/r/20230504154454.26654-4-powen.kao@mediatek.com
Reviewed-by: Bean Huo &lt;beanhuo@micron.com&gt;
Reviewed-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Reviewed-by: Stanley Chu &lt;stanley.chu@mediatek.com&gt;
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: Rename symbol sizeof_utp_transfer_cmd_desc()</title>
<updated>2023-06-09T08:48:08Z</updated>
<author>
<name>Po-Wen Kao</name>
<email>powen.kao@mediatek.com</email>
</author>
<published>2023-05-04T15:44:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c953c5377cf3153fca31cd007755659f4d186c0e'/>
<id>urn:sha1:c953c5377cf3153fca31cd007755659f4d186c0e</id>
<content type='text'>
[ Upstream commit 06caeb536b2b21668efd2d6fa97c09461957b3a7 ]

Naming the functions after standard operators like sizeof() may cause
confusion. Rename it to ufshcd_get_ucd_size().

Signed-off-by: Po-Wen Kao &lt;powen.kao@mediatek.com&gt;
Link: https://lore.kernel.org/r/20230504154454.26654-3-powen.kao@mediatek.com
Suggested-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Reviewed-by: Stanley Chu &lt;stanley.chu@mediatek.com&gt;
Reviewed-by: Ziqi Chen &lt;quic_ziqichen@quicinc.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
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 MCQ tag calculation</title>
<updated>2023-06-09T08:48:08Z</updated>
<author>
<name>Po-Wen Kao</name>
<email>powen.kao@mediatek.com</email>
</author>
<published>2023-05-04T15:44:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=38a898c2e6c9d74882096793640e252af97ea3ab'/>
<id>urn:sha1:38a898c2e6c9d74882096793640e252af97ea3ab</id>
<content type='text'>
[ Upstream commit 5149452ca66289ef33d13897ee845a2f6f5b680f ]

The transfer command descriptor is allocated in ufshcd_memory_alloc() and
referenced by the transfer request descriptor with stride size
sizeof_utp_transfer_cmd_desc() instead of sizeof(struct
utp_transfer_cmd_desc).

Consequently, computing tag by address offset should also refer to the
same stride.

Signed-off-by: Po-Wen Kao &lt;powen.kao@mediatek.com&gt;
Link: https://lore.kernel.org/r/20230504154454.26654-2-powen.kao@mediatek.com
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Reviewed-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Reviewed-by: Stanley Chu &lt;stanley.chu@mediatek.com&gt;
Reviewed-by: Ziqi Chen &lt;quic_ziqichen@quicinc.com&gt;
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: Add support for Intel Lunar Lake</title>
<updated>2023-05-24T16:30:05Z</updated>
<author>
<name>Adrian Hunter</name>
<email>adrian.hunter@intel.com</email>
</author>
<published>2023-03-28T10:58:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=269d858757778fab335a7ed027f858f9f2f340a9'/>
<id>urn:sha1:269d858757778fab335a7ed027f858f9f2f340a9</id>
<content type='text'>
[ Upstream commit 0a07d3c7a1d205b47d9f3608ff4e9d1065d63b6d ]

Add PCI ID to support Intel Lunar Lake, same as MTL.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Link: https://lore.kernel.org/r/20230328105832.3495-1-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;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Fix I/O hang that occurs when BKOPS fails in W-LUN suspend</title>
<updated>2023-05-24T16:29:58Z</updated>
<author>
<name>Keoseong Park</name>
<email>keosung.park@samsung.com</email>
</author>
<published>2023-04-25T03:17:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5afaca177c115a5f62d0b99e293cd88b206b704c'/>
<id>urn:sha1:5afaca177c115a5f62d0b99e293cd88b206b704c</id>
<content type='text'>
[ Upstream commit 1a7edd041f2d252f251523ba3f2eaead076a8f8d ]

Even when urgent BKOPS fails, the consumer will get stuck in runtime
suspend status. Like commit 1a5665fc8d7a ("scsi: ufs: core: WLUN suspend
SSU/enter hibern8 fail recovery"), trigger the error handler and return
-EBUSY to break the suspend.

Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun")
Signed-off-by: Keoseong Park &lt;keosung.park@samsung.com&gt;
Link: https://lore.kernel.org/r/20230425031721epcms2p5d4de65616478c967d466626e20c42a3a@epcms2p5
Reviewed-by: Avri Altman &lt;avri.altman@wdc.com&gt;
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: mcq: Fix &amp;hwq-&gt;cq_lock deadlock issue</title>
<updated>2023-05-17T12:01:36Z</updated>
<author>
<name>Alice Chao</name>
<email>alice.chao@mediatek.com</email>
</author>
<published>2023-04-24T08:03:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2ce8c49c7b53e0a2258b833eeab16a6d78f732d1'/>
<id>urn:sha1:2ce8c49c7b53e0a2258b833eeab16a6d78f732d1</id>
<content type='text'>
[ Upstream commit 948afc69615167a3c82430f99bfd046332b89912 ]

When ufshcd_err_handler() is executed, CQ event interrupt can enter waiting
for the same lock. This can happen in ufshcd_handle_mcq_cq_events() and
also in ufs_mtk_mcq_intr(). The following warning message will be generated
when &amp;hwq-&gt;cq_lock is used in IRQ context with IRQ enabled. Use
ufshcd_mcq_poll_cqe_lock() with spin_lock_irqsave instead of spin_lock to
resolve the deadlock issue.

[name:lockdep&amp;]WARNING: inconsistent lock state
[name:lockdep&amp;]--------------------------------
[name:lockdep&amp;]inconsistent {IN-HARDIRQ-W} -&gt; {HARDIRQ-ON-W} usage.
[name:lockdep&amp;]kworker/u16:4/260 [HC0[0]:SC0[0]:HE1:SE1] takes:
  ffffff8028444600 (&amp;hwq-&gt;cq_lock){?.-.}-{2:2}, at:
ufshcd_mcq_poll_cqe_lock+0x30/0xe0
[name:lockdep&amp;]{IN-HARDIRQ-W} state was registered at:
  lock_acquire+0x17c/0x33c
  _raw_spin_lock+0x5c/0x7c
  ufshcd_mcq_poll_cqe_lock+0x30/0xe0
  ufs_mtk_mcq_intr+0x60/0x1bc [ufs_mediatek_mod]
  __handle_irq_event_percpu+0x140/0x3ec
  handle_irq_event+0x50/0xd8
  handle_fasteoi_irq+0x148/0x2b0
  generic_handle_domain_irq+0x4c/0x6c
  gic_handle_irq+0x58/0x134
  call_on_irq_stack+0x40/0x74
  do_interrupt_handler+0x84/0xe4
  el1_interrupt+0x3c/0x78
&lt;snip&gt;

Possible unsafe locking scenario:
       CPU0
       ----
  lock(&amp;hwq-&gt;cq_lock);
  &lt;Interrupt&gt;
    lock(&amp;hwq-&gt;cq_lock);
  *** DEADLOCK ***
2 locks held by kworker/u16:4/260:

[name:lockdep&amp;]
 stack backtrace:
CPU: 7 PID: 260 Comm: kworker/u16:4 Tainted: G S      W  OE
6.1.17-mainline-android14-2-g277223301adb #1
Workqueue: ufs_eh_wq_0 ufshcd_err_handler

 Call trace:
  dump_backtrace+0x10c/0x160
  show_stack+0x20/0x30
  dump_stack_lvl+0x98/0xd8
  dump_stack+0x20/0x60
  print_usage_bug+0x584/0x76c
  mark_lock_irq+0x488/0x510
  mark_lock+0x1ec/0x25c
  __lock_acquire+0x4d8/0xffc
  lock_acquire+0x17c/0x33c
  _raw_spin_lock+0x5c/0x7c
  ufshcd_mcq_poll_cqe_lock+0x30/0xe0
  ufshcd_poll+0x68/0x1b0
  ufshcd_transfer_req_compl+0x9c/0xc8
  ufshcd_err_handler+0x3bc/0xea0
  process_one_work+0x2f4/0x7e8
  worker_thread+0x234/0x450
  kthread+0x110/0x134
  ret_from_fork+0x10/0x20

Fixes: ed975065c31c ("scsi: ufs: core: mcq: Add completion support in poll")
Reviewed-by: Can Guo &lt;quic_cang@quicinc.com&gt;
Reviewed-by: Stanley Chu &lt;stanley.chu@mediatek.com&gt;
Signed-off-by: Alice Chao &lt;alice.chao@mediatek.com&gt;
Link: https://lore.kernel.org/r/20230424080400.8955-1-alice.chao@mediatek.com
Reviewed-by: AngeloGioacchino Del Regno &lt;angelogioacchino.delregno@collabora.com&gt;
Reviewed-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
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: Revert "scsi: ufs: core: Initialize devfreq synchronously"</title>
<updated>2023-04-03T01:12:34Z</updated>
<author>
<name>Adrien Thierry</name>
<email>athierry@redhat.com</email>
</author>
<published>2023-03-29T20:54:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=86eb94bf8006a85738f0ccf49e3ce894e03922a6'/>
<id>urn:sha1:86eb94bf8006a85738f0ccf49e3ce894e03922a6</id>
<content type='text'>
This reverts commit 7dafc3e007918384c8693ff8d70381b5c1e9c247.

This patch introduced a regression [1] where hba-&gt;pwr_info is used before
being initialized, which could create issues in ufshcd_scale_gear(). Revert
it until a better solution is found.

[1] https://lore.kernel.org/all/CAGaU9a_PMZhqv+YJ0r3w-hJMsR922oxW6Kg59vw+oen-NZ6Otw@mail.gmail.com

Signed-off-by: Adrien Thierry &lt;athierry@redhat.com&gt;
Link: https://lore.kernel.org/r/20230329205426.46393-1-athierry@redhat.com
Reviewed-by: Stanley Chu &lt;stanley.chu@mediatek.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: mcq: Use active_reqs to check busy in clock scaling</title>
<updated>2023-03-10T02:09:28Z</updated>
<author>
<name>Asutosh Das</name>
<email>quic_asutoshd@quicinc.com</email>
</author>
<published>2023-03-08T23:13:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c6001025d53ab56d7159cf313313c6b5bd250380'/>
<id>urn:sha1:c6001025d53ab56d7159cf313313c6b5bd250380</id>
<content type='text'>
Multi Circular Queue doesn't use outstanding_reqs. However, the UFS clock
scaling functions use outstanding_reqs to determine if there are requests
pending. When MCQ is enabled, this check always returns false.

Hence use active_reqs to check if there are pending requests.

Fixes: eacb139b77ff ("scsi: ufs: core: mcq: Enable multi-circular queue")
Signed-off-by: Asutosh Das &lt;quic_asutoshd@quicinc.com&gt;
Reviewed-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Link: https://lore.kernel.org/r/a24e0d646aac70eae0fc5e05fac0c58bb7e6e680.1678317160.git.quic_asutoshd@quicinc.com
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: mcq: qcom: Clean the return path of ufs_qcom_mcq_config_resource()</title>
<updated>2023-03-06T23:33:12Z</updated>
<author>
<name>Asutosh Das</name>
<email>quic_asutoshd@quicinc.com</email>
</author>
<published>2023-03-02T01:42:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c9507eab9fa7af7ab4c80856eeafd1481ff16f7c'/>
<id>urn:sha1:c9507eab9fa7af7ab4c80856eeafd1481ff16f7c</id>
<content type='text'>
Smatch static checker reported:
drivers/ufs/host/ufs-qcom.c:1469
ufs_qcom_mcq_config_resource() info: returning a literal zero is
cleaner

Fix the above warning by returning in place instead of a jump to a label.
Also remove the usage of devm_kfree() as it's unnecessary in this function.

Fixes: c263b4ef737e ("scsi: ufs: core: mcq: Configure resource regions")
Reported-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Asutosh Das &lt;quic_asutoshd@quicinc.com&gt;
Link: https://lore.kernel.org/r/3ebd2582af74b81ef7b57149f57c6a3bf0963953.1677721229.git.quic_asutoshd@quicinc.com
Reviewed-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Reviewed-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: mcq: qcom: Fix passing zero to PTR_ERR</title>
<updated>2023-03-06T23:33:12Z</updated>
<author>
<name>Asutosh Das</name>
<email>quic_asutoshd@quicinc.com</email>
</author>
<published>2023-03-02T01:41:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c8be073bd2bced20f58e65276281fc116758c7cb'/>
<id>urn:sha1:c8be073bd2bced20f58e65276281fc116758c7cb</id>
<content type='text'>
Fix an error case in ufs_qcom_mcq_config_resource(), where the return value
is set to 0 before passing it to PTR_ERR.

This led to Smatch warning:

drivers/ufs/host/ufs-qcom.c:1455 ufs_qcom_mcq_config_resource() warn:
passing zero to 'PTR_ERR'

Fixes: c263b4ef737e ("scsi: ufs: core: mcq: Configure resource regions")
Reported-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Asutosh Das &lt;quic_asutoshd@quicinc.com&gt;
Link: https://lore.kernel.org/r/94ca99b327af634799ce5f25d0112c28cd00970d.1677721072.git.quic_asutoshd@quicinc.com
Reviewed-by: Bjorn Andersson &lt;andersson@kernel.org&gt;
Reviewed-by: Manivannan Sadhasivam &lt;mani@kernel.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
