Commit Graph

1055915 Commits

Author SHA1 Message Date
Bart Van Assche
c32bb82fd9 UPSTREAM: scsi: ufs: Split the ufshcd.h header file
Split the ufshcd.h header file into a header file that defines the
interface used by UFS drivers and another header file with declarations and
data structures only used by the UFS core.

Link: https://lore.kernel.org/r/20220419225811.4127248-27-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 4bc26113c6)
Change-Id: I3628a104f07e78da259db0f5c16d0c586db17ae5
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:27 -07:00
Bart Van Assche
de7478829f UPSTREAM: scsi: ufs: Minimize #include directives
Follow the convention that is used elsewhere in the Linux kernel source
code and only include those headers of which the declarations are used
directly.

Link: https://lore.kernel.org/r/20220419225811.4127248-26-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 3f06f7800b)
Change-Id: I7940c2fcced6a5bdff4f96a812670cc7ac432c67
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:27 -07:00
Bart Van Assche
ab2a9f61fd UPSTREAM: scsi: ufs: Fix kernel-doc syntax in ufshcd.h
This patch fixes all the warnings and errors reported by the following
command:

scripts/kernel-doc -none drivers/scsi/ufs/ufshcd.h

Link: https://lore.kernel.org/r/20220419225811.4127248-25-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit cff91daf52)
Change-Id: Iff495e4cf75c980bb5526e43b7f96745405dc0fe
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
dbb9373276 UPSTREAM: scsi: ufs: Remove unnecessary ufshcd-crypto.h include directives
ufshcd-crypto.h declares functions that must only be called by the UFS
core. Hence remove the #include "ufshcd-crypto.h" directive from UFS
drivers.

Link: https://lore.kernel.org/r/20220419225811.4127248-24-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit c10d52d73a)
Change-Id: Ic43e2bc475219ff58bde970da305791ff36620eb
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
e8d1bcb857 UPSTREAM: scsi: ufs: qcom: Fix ufs_qcom_resume()
Clearing hba->is_sys_suspended if ufs_qcom_resume() succeeds is wrong. That
variable must only be cleared if all actions involved in a resume succeed.
Hence remove the statement that clears hba->is_sys_suspended from
ufs_qcom_resume().

Link: https://lore.kernel.org/r/20220419225811.4127248-23-bvanassche@acm.org
Fixes: 81c0fc51b7 ("ufs-qcom: add support for Qualcomm Technologies Inc platforms")
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit bee40dc167)
Change-Id: I4ee687c2ef42ff7d13de76522c9944072b42dca4
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
d8d1d7ec78 UPSTREAM: scsi: ufs: Introduce ufshcd_clkgate_delay_set()
Since the code to modify delay_ms while holding the host lock occurs twice,
introduce a function that performs this action.

Link: https://lore.kernel.org/r/20220419225811.4127248-22-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit ad8a647e77)
Change-Id: I72c7cf385c041a7e1b073b25768a703df6d13eee
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
2d122e3802 UPSTREAM: scsi: ufs: Remove locking from around single register writes
Single register writes are atomic and hence do not need to be surrounded by
locking. Additionally, MMIO writes are typically posted asynchronously.
Hence, there is no guarantee that these have finished by the time the
spin_unlock*() call has finished. See also the nonposted-mmio property of
the Open Firmware tree. See also pci_iomap().

Link: https://lore.kernel.org/r/20220419225811.4127248-21-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 3fb20fcd93)
Change-Id: I50811ddab2c745ac1fe898e83bf7a0cd4e4ce7e4
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
97ce892ac4 UPSTREAM: scsi: ufs: Remove the TRUE and FALSE definitions
In the Linux kernel coding style document
(Documentation/process/coding-style.rst) it is recommended to use the type
'bool' and also the values 'true' and 'false'. Hence this patch that
removes the definitions and uses of TRUE and FALSE from the UFS driver.

Link: https://lore.kernel.org/r/20220419225811.4127248-20-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 21c2e3418d)
Change-Id: I57b30acc698d9f1f9afa7d3f0408d45c53637ca6
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
be4c229787 UPSTREAM: scsi: ufs: Remove paths from source code comments
Since specifying the path in a source file is redundant, remove the paths
from source code comments.

Link: https://lore.kernel.org/r/20220419225811.4127248-19-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit d0c1725b1e)
Change-Id: I42c454bfac9741b2a90c0c292ad5c8bd1b5ec471
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:25 -07:00
Bart Van Assche
bcbe10d414 UPSTREAM: scsi: ufs: Use an SPDX license identifier in the Kconfig file
As requested in Documentation/process/license-rules.rst, use an SPDX
license identifier.

Link: https://lore.kernel.org/r/20220419225811.4127248-18-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 2b10863f71)
Change-Id: I4571f6bcc729085d2a43e0ab1102833c0f77878b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:25 -07:00
Bart Van Assche
46ef253523 UPSTREAM: scsi: ufs: Rename sdev_ufs_device into ufs_device_wlun
The new name reflects the role of this member variable better: a WLUN
through which the power mode of the UFS device is controlled.

Link: https://lore.kernel.org/r/20220419225811.4127248-17-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit e2106584d0)
Change-Id: Icc065359bdf2390f6b24d8e7a8d7e50be99012e8
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:25 -07:00
Bart Van Assche
558fd80aa7 UPSTREAM: scsi: ufs: Remove the driver version
The current version number is 0.2. That driver version was assigned more
than nine years ago. A version number that is not updated while the driver
is updated is not useful. Hence remove the driver version number from the
UFS driver. See also commit e0eca63e34 ("[SCSI] ufs: Separate PCI code
into glue driver").

Link: https://lore.kernel.org/r/20220419225811.4127248-16-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit b4ade33b0d)
Change-Id: I6aa972d63992543c35346a07ca231b3f3bffa2dc
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:25 -07:00
Bart Van Assche
8a620499b4 UPSTREAM: scsi: ufs: Make the config_scaling_param calls type safe
Pass the actual type to config_scaling_param callback as the third argment
instead of a void pointer. Remove a superfluous NULL pointer check from
ufs_qcom_config_scaling_param().

Link: https://lore.kernel.org/r/20220419225811.4127248-15-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit c906e8328d)
Change-Id: Id5105607f237d98bd34ed2f5ccb633f38efa31c3
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:25 -07:00
Bart Van Assche
a34bbc2365 UPSTREAM: scsi: ufs: Switch to aggregate initialization
Make it easier to verify for humans that ufshcd_init_pwr_dev_param()
initializes all structure members. This patch does not change any
functionality.

Link: https://lore.kernel.org/r/20220419225811.4127248-14-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 778d2b0ec6)
Change-Id: Ib057a7b3b5bf61dc32e6f342124b1847c8c6e207
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:25 -07:00
Bart Van Assche
8bf192b30c UPSTREAM: scsi: ufs: Remove unused constants and code
Commit 5b44a07b6b ("scsi: ufs: Remove pre-defined initial voltage values
of device power") removed the code that uses the UFS_VREG_VCC* constants
and also the code that sets the min_uV and max_uV member variables. Hence
also remove these constants and that member variable.

Link: https://lore.kernel.org/r/20220419225811.4127248-13-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 9474c64e83)
Change-Id: Ic89dfc0eb6dc5f378f1f41dc6419d0b3f918a47d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:25 -07:00
Bart Van Assche
19a799fc71 UPSTREAM: scsi: ufs: Invert the return value of ufshcd_is_hba_active()
It is confusing that ufshcd_is_hba_active() returns 'true' if the HBA is
not active. Clear up this confusion by inverting the return value of
ufshcd_is_hba_active(). This patch does not change any functionality.

Link: https://lore.kernel.org/r/20220419225811.4127248-12-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit acbbfe484f)
Change-Id: I83dadb18f36b9f96846f5224705dc6ef1f780f62
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:24 -07:00
Bart Van Assche
1a042f80d2 UPSTREAM: scsi: ufs: Declare the quirks array const
Declare the quirks array and also its 'model' member const to make it
explicit that these are not modified.

Link: https://lore.kernel.org/r/20220419225811.4127248-11-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit aead21f32a)
Change-Id: I30b68f9e8cfc82f7e2ea3dda27e551308cfb7eb2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:24 -07:00
Bart Van Assche
d6a23949d5 UPSTREAM: scsi: ufs: Rename struct ufs_dev_fix into ufs_dev_quirk
Since struct ufs_dev_fix contains quirk information, rename it into struct
ufs_dev_quirk.

Link: https://lore.kernel.org/r/20220419225811.4127248-10-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 25eff2f543)
Change-Id: I35f677c62134685df5d777343ed2d4b4ba36cccf
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:24 -07:00
Bart Van Assche
0b019cd9e3 UPSTREAM: scsi: ufs: Remove the UFS_FIX() and END_FIX() macros
Since these two macros reduce code readability, remove them.

Link: https://lore.kernel.org/r/20220419225811.4127248-9-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit dd2cf44ff4)
Change-Id: I0aba23a732fc1b50fb40449fbfb37d267b4ff4d5
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:24 -07:00
Bart Van Assche
5f8fd2d6c9 UPSTREAM: scsi: ufs: Use get_unaligned_be16() instead of be16_to_cpup()
Use get_unaligned_be16(...) instead of the equivalent but harder to read
be16_to_cpup((__be16 *)...).

Link: https://lore.kernel.org/r/20220419225811.4127248-8-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 9d3ab17e84)
Change-Id: Iafcdacc6059eda4cf720a71bb3882a34a9b45984
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:24 -07:00
Bart Van Assche
7a975b5e5d UPSTREAM: scsi: ufs: Remove ufshcd_lrb.sense_buffer
ufshcd_lrb.sense_buffer is NULL if ufshcd_lrb.cmd is NULL and
ufshcd_lrb.sense_buffer points at cmd->sense_buffer if ufshcd_lrb.cmd is
set. In other words, the ufshcd_lrb.sense_buffer member is identical to
cmd->sense_buffer. Hence this patch that removes the
ufshcd_lrb.sense_buffer structure member.

Link: https://lore.kernel.org/r/20220419225811.4127248-7-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 1de4378f60)
Change-Id: I1c926f8ee35f64fe5cc6881d6d55c9ef78a0d18d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:24 -07:00
Bart Van Assche
33d6987272 UPSTREAM: scsi: ufs: Remove ufshcd_lrb.sense_bufflen
ufshcd_lrb.sense_bufflen is set but never read. Hence remove this struct
member.

Link: https://lore.kernel.org/r/20220419225811.4127248-6-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit b639b59b44)
Change-Id: Ib1c719852e235f48acbe37828eeec72ff15c7bcc
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:23 -07:00
Bart Van Assche
c92cce7069 UPSTREAM: scsi: ufs: Simplify statements that return a boolean
Convert "if (expr) return true; else return false;" into "return expr;" if
either 'expr' is a boolean expression or the return type of the function is
'bool'.

Link: https://lore.kernel.org/r/20220419225811.4127248-5-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit a858af9a9e)
Change-Id: Idf101d4cd43bb7756db4b849e40baeb5c6039ba8
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:23 -07:00
Bart Van Assche
4fb19dce9e UPSTREAM: scsi: ufs: Remove superfluous boolean conversions
Remove "? true : false" if the preceding expression yields a boolean or if
the result of the expression is assigned to a boolean since in these two
cases the "? true : false" part is superfluous.

Link: https://lore.kernel.org/r/20220419225811.4127248-4-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 51d1628fc4)
Change-Id: I186099e423bd1f6543982d091675f8593e5d624c
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:23 -07:00
Bart Van Assche
2dc2b1d128 UPSTREAM: scsi: ufs: Declare ufshcd_wait_for_register() static
Declare this function static since it is only used inside the ufshcd.c
source file.

Link: https://lore.kernel.org/r/20220419225811.4127248-3-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 59a57bb79e)
Change-Id: I3f6135d522766443fd2d943a6a9da315ac45ae88
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:23 -07:00
Bart Van Assche
44b8c5b189 UPSTREAM: scsi: ufs: Fix a spelling error in a source code comment
Change one occurrence of "adpater" into "adapter".

Link: https://lore.kernel.org/r/20220419225811.4127248-2-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 2abe580023)
Change-Id: I53eb8cabfddf0cdba4025258148ccaa7e465c3a1
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:23 -07:00
Konstantin Vyshetsky
2df89985d1 UPSTREAM: scsi: ufs: core: Increase fDeviceInit poll frequency
UFS devices are expected to clear fDeviceInit flag in single digit
milliseconds. Current values of 5 to 10 millisecond sleep add to increased
latency during the initialization and resume path. This CL lowers the sleep
range to 500 to 1000 microseconds.

Link: https://lore.kernel.org/r/20220421002429.3136933-1-bvanassche@acm.org
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Konstantin Vyshetsky <vkon@google.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit a4e6496fca)
Change-Id: I0636586d7ce9ab470b7de3749c556592968b37cf
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:23 -07:00
Po-Wen Kao
e17ad49da7 UPSTREAM: scsi: ufs: core: Remove redundant HPB unmap
Since the HPB mapping is already reset in ufshpb_init() by setting flag
QUERY_FLAG_IDN_HPB_RESET, there is no need doing so again in
ufshpb_hpb_lu_prepared().

This also resolves the issue where HPB WRITE BUFFER is issued before UAC is
cleared.

Link: https://lore.kernel.org/r/20220412073131.10644-1-powen.kao@mediatek.com
Acked-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Po-Wen Kao <powen.kao@mediatek.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 25a0bf213b)
Change-Id: Ib0e4e50c5bac33e4db39b0c46d93dfeb5b1e4e34
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:22 -07:00
Krzysztof Kozlowski
d612831d20 UPSTREAM: scsi: ufs: ufshcd-pltfrm: Simplify pdev->dev usage
The 'struct device' pointer is already cached as a local variable in
ufshcd_pltfrm_init(), so use it.

Link: https://lore.kernel.org/r/20220401085050.119323-1-krzysztof.kozlowski@linaro.org
Reviewed-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 9ad659be37)
Change-Id: Idf97e48b4b9d8a88e06a02681fc8cb3deec748d5
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:22 -07:00
Bart Van Assche
262a7bbdcc ANDROID: scsi: ufs: Do not use the struct scsi_request cmd field
This patch is a subset of the upstream commit ce70fd9a55 ("scsi: core:
Remove the cmd field from struct scsi_request").

Bug: 234653003
Change-Id: Ie1b93162025e732d192b7866b865a683113c157b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:22 -07:00
Krzysztof Kozlowski
8206d48ec2 UPSTREAM: scsi: ufs: qcom: Drop custom Android boot parameters
The QCOM UFS driver requires an androidboot.bootdevice command line
argument matching the UFS device name.  If the name is different, it
refuses to probe.  This androidboot.bootdevice is provided by stock/vendor
(from an Android-based device) bootloader.

This does not make sense from Linux point of view.  Driver should be able
to boot regardless of bootloader.  Driver should not depend on some Android
custom environment data.

Link: https://lore.kernel.org/r/20220321151853.24138-1-krzk@kernel.org
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Tested-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 5ca0faf9c2)
Change-Id: Ia38504b9449159186ad6acf9c69977e32618ee16
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:22 -07:00
Keoseong Park
6e2ea6e76d UPSTREAM: scsi: ufs: core: Remove unused field in struct ufs_hba
Remove unused fields 'rpm_lvl_attr' and 'spm_lvl_attr' in struct ufs_hba.
Commit cbb6813ee7 ("scsi: ufs: sysfs: attribute group for existing sysfs
entries.") removed all code using that field.

Link: https://lore.kernel.org/r/413601558.101648105683746.JavaMail.epsvc@epcpadp4
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Keoseong Park <keosung.park@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 8ee15ea779)
Change-Id: I392f49173afe0a2c9bcdcec55fbcb42593f170f9
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:22 -07:00
Keoseong Park
a7b23857ed UPSTREAM: scsi: ufs: core: Remove wlun_dev_to_hba()
Commit edc0596cc0 ("scsi: ufs: core: Stop clearing UNIT ATTENTIONS")
removed all callers of wlun_dev_to_hba(). Hence also remove the macro
itself.

Link: https://lore.kernel.org/r/1891546521.01644927481711.JavaMail.epsvc@epcpadp4
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Keoseong Park <keosung.park@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 482dcaa1c9)
Change-Id: I144d92c770847ca87e06231acf0aab51fe0f1501
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:22 -07:00
Jinyoung Choi
fa0e3961cc UPSTREAM: scsi: ufs: core: Fix divide by zero in ufshcd_map_queues()
Before calling blk_mq_map_queues(), the mq_map and nr_queues belonging to
struct blk_mq_queue_map must have a valid value.

If nr_queues is set to 0, the system may encounter a divide by zero
depending on the type of architecture.

    blk_mq_map_queues() -> queue_index()

Link: https://lore.kernel.org/r/1891546521.01644873481638.JavaMail.epsvc@epcpadp4
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jinyoung Choi <j-young.choi@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 10af115646)
Change-Id: Iaf94a3fe8200fdfc336e5951fcbb760a1de3dd1d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:22 -07:00
Jinyoung Choi
d99b8a625f UPSTREAM: scsi: ufs: Add checking lifetime attribute for WriteBooster
Because WB performs writes in SLC mode, it is not possible to use
WriteBooster indefinitely. Vendors can set a lifetime limit in the device.
If the lifetime exceeds this limit, the device ican disable the WB feature.

The feature is defined in the "bWriteBoosterBufferLifeTimeEst (IDN = 1E)"
attribute.

With lifetime exceeding the limit value, the current driver continuously
performs the following query:

	- Write Flag: WB_ENABLE / DISABLE
	- Read attr: Available Buffer Size
	- Read attr: Current Buffer Size

This patch recognizes that WriteBooster is no longer supported by the
device, and prevents unnecessary queries.

Link: https://lore.kernel.org/r/1891546521.01643252701746.JavaMail.epsvc@epcpadp3
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Jinyoung Choi <j-young.choi@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit f681d1078d)
Change-Id: I5d5f61725c0d7ec2c5166122da37c1f1ffc1c233
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:21 -07:00
SEO HOYOUNG
a7da5e48c1 UPSTREAM: scsi: ufs: Modify Tactive time setting conditions
The Tactive time determines the waiting time before burst at hibern8 exit
and is determined by hardware at linkup time. However, in the case of
Samsung devices, increase host's Tactive time +100us for stability. If the
HCI's Tactive time is equal or greater than the device, +100us should be
set.

Link: https://lore.kernel.org/r/20220106213924.186263-1-hy50.seo@samsung.com
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Acked-by: Avri Altman <Avri.Altman@wdc.com>
Signed-off-by: SEO HOYOUNG <hy50.seo@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 9008661e19)
Change-Id: I6c2f7b517efb60bf3e1fd4922fbec3d464909d44
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:21 -07:00
Bean Huo
39df8aeec1 UPSTREAM: scsi: ufs: core: Fix deadlock issue in ufshcd_wait_for_doorbell_clr()
Call shost_for_each_device() with holding host->host_lock will cause a
deadlock situation, which will cause the system to stall (the log as
follow). Fix this issue by using __shost_for_each_device() in
ufshcd_pending_cmds().

stalls on CPUs/tasks:
all trace:
__switch_to+0x120/0x170
0xffff800011643998
ask dump for CPU 5:
ask:kworker/u16:2   state:R  running task     stack:    0 pid:   80 ppid:     2 flags:0x0000000a
orkqueue: events_unbound async_run_entry_fn
all trace:
__switch_to+0x120/0x170
0x0
ask dump for CPU 6:
ask:kworker/u16:6   state:R  running task     stack:    0 pid:  164 ppid:     2 flags:0x0000000a
orkqueue: events_unbound async_run_entry_fn
all trace:
__switch_to+0x120/0x170
0xffff54e7c4429f80
ask dump for CPU 7:
ask:kworker/u16:4   state:R  running task     stack:    0 pid:  153 ppid:     2 flags:0x0000000a
orkqueue: events_unbound async_run_entry_fn
all trace:
__switch_to+0x120/0x170
blk_mq_run_hw_queue+0x34/0x110
blk_mq_sched_insert_request+0xb0/0x120
blk_execute_rq_nowait+0x68/0x88
blk_execute_rq+0x4c/0xd8
__scsi_execute+0xec/0x1d0
scsi_vpd_inquiry+0x84/0xf0
scsi_get_vpd_buf+0x34/0xb8
scsi_attach_vpd+0x34/0x140
scsi_probe_and_add_lun+0xa6c/0xab8
__scsi_scan_target+0x438/0x4f8
scsi_scan_channel+0x6c/0xa8
scsi_scan_host_selected+0xf0/0x150
do_scsi_scan_host+0x88/0x90
scsi_scan_host+0x1b4/0x1d0
ufshcd_async_scan+0x248/0x310
async_run_entry_fn+0x30/0x178
process_one_work+0x1e8/0x368
worker_thread+0x40/0x478
kthread+0x174/0x180
ret_from_fork+0x10/0x20

Link: https://lore.kernel.org/r/20211214120537.531628-1-huobean@gmail.com
Fixes: 8d077ede48 ("scsi: ufs: Optimize the command queueing code")
Reported-by: YongQin Liu <yongqin.liu@linaro.org>
Reported-by: Amit Pundir <amit.pundir@linaro.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Co-developed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 99c66a8868)
Change-Id: I32ef0b93a17ed59c9011c5104b9843a8f9e38e8e
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:21 -07:00
Bart Van Assche
cc7519a1c9 UPSTREAM: scsi: ufs: Implement polling support
The time spent in io_schedule() and also the interrupt latency are
significant when submitting direct I/O to a UFS device. Hence this patch
that implements polling support. User space software can enable polling by
passing the RWF_HIPRI flag to the preadv2() system call or the
IORING_SETUP_IOPOLL flag to the io_uring interface.

Although the block layer supports to partition the tag space for
interrupt-based completions (HCTX_TYPE_DEFAULT) purposes and polling
(HCTX_TYPE_POLL), the choice has been made to use the same hardware queue
for both hctx types because partitioning the tag space would negatively
affect performance.

On my test setup this patch increases IOPS from 2736 to 22000 (8x) for the
following test:

for hipri in 0 1; do
    fio --ioengine=io_uring --iodepth=1 --rw=randread \
    --runtime=60 --time_based=1 --direct=1 --name=qd1 \
    --filename=/dev/block/sda --ioscheduler=none --gtod_reduce=1 \
    --norandommap --hipri=$hipri
done

Link: https://lore.kernel.org/r/20211203231950.193369-18-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit eaab9b5730)
Change-Id: I18905c9948fea32d26e11b36b9a292cb5e9569dd
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:21 -07:00
Bart Van Assche
ccf604bdef UPSTREAM: scsi: ufs: Optimize the command queueing code
Remove the clock scaling lock from ufshcd_queuecommand() since it is a
performance bottleneck. Instead check the SCSI device budget bitmaps in the
code that waits for ongoing ufshcd_queuecommand() calls. A bit is set in
sdev->budget_map just before scsi_queue_rq() is called and a bit is cleared
from that bitmap if scsi_queue_rq() does not submit the request or after
the request has finished. See also the blk_mq_{get,put}_dispatch_budget()
calls in the block layer.

There is no risk for a livelock since the block layer delays queue reruns
if queueing a request fails because the SCSI host has been blocked.

Link: https://lore.kernel.org/r/20211203231950.193369-17-bvanassche@acm.org
Cc: Asutosh Das (asd) <asutoshd@codeaurora.org>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 8d077ede48)
Change-Id: I8f9e5c07bf7effd8a8df13de187c4a3190acffd7
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:21 -07:00
Bart Van Assche
82c80c5065 UPSTREAM: scsi: ufs: Stop using the clock scaling lock in the error handler
Instead of locking and unlocking the clock scaling lock, surround the
command queueing code with an RCU reader lock and call synchronize_rcu().
This patch prepares for removal of the clock scaling lock.

Link: https://lore.kernel.org/r/20211203231950.193369-16-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 5675c381ea)
Change-Id: Ic1f47d7bab37a74292c82ebb1d1204b3d7b003b7
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:21 -07:00
Bart Van Assche
c07d3620e4 UPSTREAM: scsi: ufs: Improve SCSI abort handling further
Release resources when aborting a command. Make sure that aborted commands
are completed once by clearing the corresponding tag bit from
hba->outstanding_reqs. This patch is an improved version of commit
3ff1f6b6ba ("scsi: ufs: core: Improve SCSI abort handling").

Link: https://lore.kernel.org/r/20211203231950.193369-14-bvanassche@acm.org
Fixes: 7a3e97b0dc ("[SCSI] ufshcd: UFS Host controller driver")
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 1fbaa02dfd)
Change-Id: Iaf5b306dfbf9e9d8aa1c2daeba978b22c2b836e6
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:20 -07:00
Bart Van Assche
13286b5c45 UPSTREAM: scsi: ufs: Introduce ufshcd_release_scsi_cmd()
The only functional change in this patch is that scsi_done() is now called
after ufshcd_release() and ufshcd_clk_scaling_update_busy() instead of
before.

The next patch in this series will introduce a call to
ufshcd_release_scsi_cmd() in the abort handler.

Link: https://lore.kernel.org/r/20211203231950.193369-13-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 6f8dafdee6)
Change-Id: Ia490230413395462ae2ada5902edf659cc03f525
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:20 -07:00
Bart Van Assche
38fedd62cf UPSTREAM: scsi: ufs: Remove the 'update_scaling' local variable
This patch does not change any functionality but makes the next patch in
this series easier to read.

Link: https://lore.kernel.org/r/20211203231950.193369-12-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 3eb9dcc027)
Change-Id: Ia50b3af3bb231acd7a4c42551873397e8c98df74
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:20 -07:00
Bart Van Assche
b5a9874a16 UPSTREAM: scsi: ufs: Remove hba->cmd_queue
The previous patch removed all code that uses hba->cmd_queue. Hence also
remove hba->cmd_queue itself.

Link: https://lore.kernel.org/r/20211203231950.193369-11-bvanassche@acm.org
Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 511a083b8b)
Change-Id: I5b787dbb35f4ef6d2739903c05068616e1cc878a
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:20 -07:00
Bart Van Assche
8be982b2bf UPSTREAM: scsi: ufs: Rework ufshcd_change_queue_depth()
Prepare for making sdev->host->can_queue less than hba->nutrs. This patch
does not change any functionality.

Link: https://lore.kernel.org/r/20211203231950.193369-9-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit fc21da8a84)
Change-Id: I35b283ce6d1c36364b08cfcb9659699fb14be964
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:20 -07:00
Bart Van Assche
bda51ed6ae UPSTREAM: scsi: ufs: Remove ufshcd_any_tag_in_use()
Use hba->outstanding_reqs instead of ufshcd_any_tag_in_use(). This patch
prepares for removal of the blk_mq_start_request() call from
ufshcd_wait_for_dev_cmd(). blk_mq_tagset_busy_iter() only iterates over
started requests.

Link: https://lore.kernel.org/r/20211203231950.193369-8-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit bd0b353831)
Change-Id: I7adea1a3cc0a1290fb8b8f8731fcb5e10b03b8f9
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:20 -07:00
Bart Van Assche
585d3a6a99 UPSTREAM: scsi: ufs: Remove the sdev_rpmb member
Since the sdev_rpmb member of struct ufs_hba is only used inside
ufshcd_scsi_add_wlus(), convert it into a local variable.

Link: https://lore.kernel.org/r/20211203231950.193369-5-bvanassche@acm.org
Suggested-by: Jaegeuk Kim <jaegeuk@kernel.org>
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 59830c095c)
Change-Id: If402fcfa8397ecabeac468a6a5fafb456b5cf368
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:19 -07:00
Bart Van Assche
04d6424e3d UPSTREAM: scsi: ufs: Remove is_rpmb_wlun()
Commit edc0596cc0 ("scsi: ufs: core: Stop clearing UNIT ATTENTIONS")
removed all callers of is_rpmb_wlun(). Hence also remove the function
itself.

Link: https://lore.kernel.org/r/20211203231950.193369-4-bvanassche@acm.org
Reported-by: kernel test robot <lkp@intel.com>
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit d656dc9b0b)
Change-Id: I46cec9932804815a5bdef38b3280c7ddf7b68f87
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:19 -07:00
Bart Van Assche
184282026c UPSTREAM: scsi: ufs: Rename a function argument
The new name makes it clear what the meaning of the function argument is.

Link: https://lore.kernel.org/r/20211203231950.193369-3-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Acked-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit b427609e11)
Change-Id: I70f449082acfa65359b59ee4d4f18486e9547b88
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:19 -07:00
Bart Van Assche
102a37cdb3 ANDROID: scsi: ufs: Remove a superfluous #include <linux/async.h> directive
Remove this include directive from UFS code that does not use any
functionality from kernel/async.c. This patch is a subset of upstream
commit db33028647 ("scsi: Remove superfluous #include <linux/async.h>
directives").

Link: https://lore.kernel.org/r/20211129194609.3466071-13-bvanassche@acm.org
Reviewed-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
Change-Id: I7bd2c3a646b35b61cb0057c928532b820417b89c
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:19 -07:00