<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/ufs/core, branch linux-6.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-09-13T07:48:27Z</updated>
<entry>
<title>scsi: ufs: Fix residual handling</title>
<updated>2023-09-13T07:48:27Z</updated>
<author>
<name>Bart Van Assche</name>
</author>
<published>2023-07-24T20:08:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d431b85179b2eaca0f2677d9a1ebd17f74478363'/>
<id>urn:sha1:d431b85179b2eaca0f2677d9a1ebd17f74478363</id>
<content type='text'>
[ Upstream commit 2903265e27bfc6dea915dd9e17a1b2587f621f73 ]

Only call scsi_set_resid() in case of an underflow. Do not call
scsi_set_resid() in case of an overflow.

Cc: Avri Altman &lt;avri.altman@wdc.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Fixes: cb38845d90fc ("scsi: ufs: core: Set the residual byte count")
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://lore.kernel.org/r/20230724200843.3376570-2-bvanassche@acm.org
Reviewed-by: Avri Altman &lt;avri.altman@wdc.com&gt;
Reviewed-by: Adrian Hunter &lt;adrian.hunter@intel.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 the incorrect OCS value for the device command</title>
<updated>2023-07-19T14:36:16Z</updated>
<author>
<name>Stanley Chu</name>
</author>
<published>2023-06-10T02:15:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32a76e5f5fe19de976a1565afa8f8365dccc1fdf'/>
<id>urn:sha1:32a76e5f5fe19de976a1565afa8f8365dccc1fdf</id>
<content type='text'>
[ Upstream commit 0fef6bb730c490fcdc4347dbd21646d3ffe62cf5 ]

In MCQ mode, when a device command uses a hardware queue shared with other
commands, a race condition may occur in the following scenario:

 1. A device command is completed in CQx with CQE entry "e".

 2. The interrupt handler copies the "cqe" pointer to "hba-&gt;dev_cmd.cqe"
    and completes "hba-&gt;dev_cmd.complete".

 3. The "ufshcd_wait_for_dev_cmd()" function is awakened and retrieves the
    OCS value from "hba-&gt;dev_cmd.cqe".

However, there is a possibility that the CQE entry "e" will be overwritten
by newly completed commands in CQx, resulting in an incorrect OCS value
being received by "ufshcd_wait_for_dev_cmd()".

To avoid this race condition, the OCS value should be immediately copied to
the struct "lrb" of the device command. Then "ufshcd_wait_for_dev_cmd()"
can retrieve the OCS value from the struct "lrb".

Fixes: 57b1c0ef89ac ("scsi: ufs: core: mcq: Add support to allocate multiple queues")
Suggested-by: Can Guo &lt;quic_cang@quicinc.com&gt;
Signed-off-by: Stanley Chu &lt;stanley.chu@mediatek.com&gt;
Link: https://lore.kernel.org/r/20230610021553.1213-2-powen.kao@mediatek.com
Tested-by: Po-Wen Kao &lt;powen.kao@mediatek.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: Remove a ufshcd_add_command_trace() call</title>
<updated>2023-07-19T14:36:15Z</updated>
<author>
<name>Bart Van Assche</name>
</author>
<published>2023-05-31T22:40:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5b4af2dbf12558e7f445f451f9b63a0a0a199803'/>
<id>urn:sha1:5b4af2dbf12558e7f445f451f9b63a0a0a199803</id>
<content type='text'>
[ Upstream commit 72554035b9797e00e68cd866e6cefa7f0b2c6f76 ]

ufshcd_add_command_trace() traces SCSI commands. Remove a
ufshcd_add_command_trace() call from a code path that is not related to
SCSI commands.

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://lore.kernel.org/r/20230531224050.25554-1-bvanassche@acm.org
Reviewed-by: Avri Altman &lt;avri.altman@wdc.com&gt;
Reviewed-by: Bean Huo &lt;beanhuo@micron.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Stable-dep-of: 0fef6bb730c4 ("scsi: ufs: core: mcq: Fix the incorrect OCS value for the device command")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Fix handling of lrbp-&gt;cmd</title>
<updated>2023-07-19T14:36:11Z</updated>
<author>
<name>Bart Van Assche</name>
</author>
<published>2023-05-24T20:36:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=49234a401e161a2f2698f4612ab792c49b3cad1b'/>
<id>urn:sha1:49234a401e161a2f2698f4612ab792c49b3cad1b</id>
<content type='text'>
[ Upstream commit 549e91a9bbaa0ee480f59357868421a61d369770 ]

ufshcd_queuecommand() may be called two times in a row for a SCSI command
before it is completed. Hence make the following changes:

 - In the functions that submit a command, do not check the old value of
   lrbp-&gt;cmd nor clear lrbp-&gt;cmd in error paths.

 - In ufshcd_release_scsi_cmd(), do not clear lrbp-&gt;cmd.

See also scsi_send_eh_cmnd().

This commit prevents that the following appears if a command times out:

WARNING: at drivers/ufs/core/ufshcd.c:2965 ufshcd_queuecommand+0x6f8/0x9a8
Call trace:
 ufshcd_queuecommand+0x6f8/0x9a8
 scsi_send_eh_cmnd+0x2c0/0x960
 scsi_eh_test_devices+0x100/0x314
 scsi_eh_ready_devs+0xd90/0x114c
 scsi_error_handler+0x2b4/0xb70
 kthread+0x16c/0x1e0

Fixes: 5a0b0cb9bee7 ("[SCSI] ufs: Add support for sending NOP OUT UPIU")
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://lore.kernel.org/r/20230524203659.1394307-3-bvanassche@acm.org
Acked-by: Adrian Hunter &lt;adrian.hunter@intel.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: Increase the START STOP UNIT timeout from one to ten seconds</title>
<updated>2023-07-19T14:36:11Z</updated>
<author>
<name>Bart Van Assche</name>
</author>
<published>2023-05-24T20:36:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1aba31fdb39140ccdf3be20d8ee3fadb5f64b140'/>
<id>urn:sha1:1aba31fdb39140ccdf3be20d8ee3fadb5f64b140</id>
<content type='text'>
[ Upstream commit fe8637f7708c16765ecf4035813efbfdd2c9be10 ]

One UFS vendor asked to increase the UFS timeout from 1 s to 3 s.  Another
UFS vendor asked to increase the UFS timeout from 1 s to 10 s.  Hence this
patch that increases the UFS timeout to 10 s. This patch can cause the
total timeout to exceed 20 s, the Android shutdown timeout.  This is fine
since the loop around ufshcd_execute_start_stop() exists to deal with unit
attentions and because unit attentions are reported quickly.

Fixes: dcd5b7637c6d ("scsi: ufs: Reduce the START STOP UNIT timeout")
Fixes: 8f2c96420c6e ("scsi: ufs: core: Reduce the power mode change timeout")
Acked-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Reviewed-by: Stanley Chu &lt;stanley.chu@mediatek.com&gt;
Reviewed-by: Bean Huo &lt;beanhuo@micron.com&gt;
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://lore.kernel.org/r/20230524203659.1394307-2-bvanassche@acm.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: Declare ufshcd_{hold,release}() once</title>
<updated>2023-07-19T14:36:11Z</updated>
<author>
<name>Bart Van Assche</name>
</author>
<published>2023-05-29T20:26:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0e5279a5c336a47b48edf3d71e08e816125c2e1f'/>
<id>urn:sha1:0e5279a5c336a47b48edf3d71e08e816125c2e1f</id>
<content type='text'>
[ Upstream commit 4b68b7f9c46d90c541d39c8b397a86ac0ca4c765 ]

ufshcd_hold() and ufshcd_release are declared twice: once in
drivers/ufs/core/ufshcd-priv.h and a second time in include/ufs/ufshcd.h.
Remove the declarations from ufshcd-priv.h.

Fixes: dd11376b9f1b ("scsi: ufs: Split the drivers/scsi/ufs directory")
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Link: https://lore.kernel.org/r/20230529202640.11883-5-bvanassche@acm.org
Reviewed-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Reviewed-by: Keoseong Park &lt;keosung.park@samsung.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: Fix MCQ nr_hw_queues</title>
<updated>2023-05-17T01:07:26Z</updated>
<author>
<name>Po-Wen Kao</name>
</author>
<published>2023-05-04T15:44:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=72a81bb0b6fc9b759ac0fdaca3ec5884a8b2f304'/>
<id>urn:sha1:72a81bb0b6fc9b759ac0fdaca3ec5884a8b2f304</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Rename symbol sizeof_utp_transfer_cmd_desc()</title>
<updated>2023-05-17T01:07:26Z</updated>
<author>
<name>Po-Wen Kao</name>
</author>
<published>2023-05-04T15:44:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=06caeb536b2b21668efd2d6fa97c09461957b3a7'/>
<id>urn:sha1:06caeb536b2b21668efd2d6fa97c09461957b3a7</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Fix MCQ tag calculation</title>
<updated>2023-05-17T01:07:26Z</updated>
<author>
<name>Po-Wen Kao</name>
</author>
<published>2023-05-04T15:44:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5149452ca66289ef33d13897ee845a2f6f5b680f'/>
<id>urn:sha1:5149452ca66289ef33d13897ee845a2f6f5b680f</id>
<content type='text'>
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;
</content>
</entry>
<entry>
<title>scsi: ufs: core: Fix I/O hang that occurs when BKOPS fails in W-LUN suspend</title>
<updated>2023-05-08T11:15:05Z</updated>
<author>
<name>Keoseong Park</name>
</author>
<published>2023-04-25T03:17:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a7edd041f2d252f251523ba3f2eaead076a8f8d'/>
<id>urn:sha1:1a7edd041f2d252f251523ba3f2eaead076a8f8d</id>
<content type='text'>
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;
</content>
</entry>
</feed>
