a98c2183 | 22-Dec-2022 |
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
scsi: ufs: ufs-qcom: Remove unnecessary WARN_ON()
In the reset assert and deassert callbacks, the supplied "id" is not used at all and only the HBA reset is performed all the time. So there is no re
scsi: ufs: ufs-qcom: Remove unnecessary WARN_ON()
In the reset assert and deassert callbacks, the supplied "id" is not used at all and only the HBA reset is performed all the time. So there is no reason to use a WARN_ON() on the "id".
Reviewed-by: Andrew Halaney <ahalaney@redhat.com> Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com> Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
031312db | 22-Dec-2022 |
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
scsi: ufs: ufs-qcom: Remove unnecessary goto statements
A goto statement in an error path is useful if the function needs to do cleanup other than returning the error code. But in this driver, goto
scsi: ufs: ufs-qcom: Remove unnecessary goto statements
A goto statement in an error path is useful if the function needs to do cleanup other than returning the error code. But in this driver, goto statements are used for just returning the error code in many places. This really makes it hard to read the code.
Get rid of those goto statements and just return the error code directly.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com> Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
df7320ba | 09-Dec-2022 |
Zhe Wang <zhe.wang1@unisoc.com> |
scsi: ufs: ufs-unisoc: Add support for Unisoc UFS host controller
Add driver code for Unisoc UFS host controller, along with UFS initialization.
Signed-off-by: Zhe Wang <zhe.wang1@unisoc.com> Revie
scsi: ufs: ufs-unisoc: Add support for Unisoc UFS host controller
Add driver code for Unisoc UFS host controller, along with UFS initialization.
Signed-off-by: Zhe Wang <zhe.wang1@unisoc.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
2d95c6de | 30-Dec-2022 |
Martin K. Petersen <martin.petersen@oracle.com> |
Merge patch series "scsi: ufs: core: Always read the descriptors with max length"
Arthur Simchaev <Arthur.Simchaev@wdc.com> says:
Read any descriptor with a maximum size of QUERY_DESC_MAX_SIZE. Acc
Merge patch series "scsi: ufs: core: Always read the descriptors with max length"
Arthur Simchaev <Arthur.Simchaev@wdc.com> says:
Read any descriptor with a maximum size of QUERY_DESC_MAX_SIZE. According to the spec the device returns the actual size. Thus can improve code readability and save CPU cycles. While at it, clean up few leftovers around the descriptor size parameter.
Link: https://lore.kernel.org/r/1670763911-8695-1-git-send-email-Arthur.Simchaev@wdc.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
16ed9d31 | 11-Dec-2022 |
Arthur Simchaev <Arthur.Simchaev@wdc.com> |
scsi: ufs: core: Remove ufshcd_map_desc_id_to_length()
There shouldn't be any restriction of the descriptor size (not the descriptor id for that matter) up to QUERY_DESC_MAX_SIZE. According to the
scsi: ufs: core: Remove ufshcd_map_desc_id_to_length()
There shouldn't be any restriction of the descriptor size (not the descriptor id for that matter) up to QUERY_DESC_MAX_SIZE. According to the spec, the caller can use any descriptor size, and it is up to the device to return the actual size. Therefore there shouldn't be any sizes hardcoded in the kernel, nor any need to cache it, hence the ufshcd_map_desc_id_to_length() function is redundant. Always read the descriptors with QUERY_DESC_MAX_SIZE size.
Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Bean Huo <beanhuo@micron.com> Suggested-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Arthur Simchaev <Arthur.Simchaev@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
01a0d515 | 11-Dec-2022 |
Arthur Simchaev <Arthur.Simchaev@wdc.com> |
scsi: ufs: core: Remove len parameter from ufshcd_set_active_icc_lvl()
len argument is not used anymore in ufshcd_set_active_icc_lvl() function.
Signed-off-by: Arthur Simchaev <Arthur.Simchaev@wdc.
scsi: ufs: core: Remove len parameter from ufshcd_set_active_icc_lvl()
len argument is not used anymore in ufshcd_set_active_icc_lvl() function.
Signed-off-by: Arthur Simchaev <Arthur.Simchaev@wdc.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
f2a89b07 | 11-Dec-2022 |
Arthur Simchaev <Arthur.Simchaev@wdc.com> |
scsi: ufs: core: Remove redundant desc_size variable from hba
Always read the descriptor with QUERY_DESC_MAX_SIZE. According to the spec, the device returns the actual size.
Signed-off-by: Arthur
scsi: ufs: core: Remove redundant desc_size variable from hba
Always read the descriptor with QUERY_DESC_MAX_SIZE. According to the spec, the device returns the actual size.
Signed-off-by: Arthur Simchaev <Arthur.Simchaev@wdc.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
358ae02f | 11-Dec-2022 |
Arthur Simchaev <Arthur.Simchaev@wdc.com> |
scsi: ufs: core: Remove redundant wb check
We used to use the extended-feature field in the device descriptor as an indication that the device supported UFS 2.2 or later. Remove that as this check
scsi: ufs: core: Remove redundant wb check
We used to use the extended-feature field in the device descriptor as an indication that the device supported UFS 2.2 or later. Remove that as this check is specifically done few lines above.
Signed-off-by: Arthur Simchaev <Arthur.Simchaev@wdc.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
4a5bd1a9 | 30-Dec-2022 |
Martin K. Petersen <martin.petersen@oracle.com> |
Merge patch series "Prepare for upstreaming Pixel 6 and 7 UFS support"
Bart Van Assche <bvanassche@acm.org> says:
The patches in this series are a first step towards integrating support in the upst
Merge patch series "Prepare for upstreaming Pixel 6 and 7 UFS support"
Bart Van Assche <bvanassche@acm.org> says:
The patches in this series are a first step towards integrating support in the upstream kernel for the UFS controller in the Pixel 6 and 7.
[mkp: resolve conflict with RPMB series]
Link: https://lore.kernel.org/r/20221208234358.252031-1-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
ada1e653 | 08-Dec-2022 |
Eric Biggers <ebiggers@google.com> |
scsi: ufs: core: Allow UFS host drivers to override the sg entry size
Modify the UFSHCD core to allow 'struct ufshcd_sg_entry' to be variable-length. The default is the standard length, but variants
scsi: ufs: core: Allow UFS host drivers to override the sg entry size
Modify the UFSHCD core to allow 'struct ufshcd_sg_entry' to be variable-length. The default is the standard length, but variants can override ufs_hba::sg_entry_size with a larger value if there are vendor-specific fields following the standard ones.
This is needed to support inline encryption with ufs-exynos (FMP).
Cc: Eric Biggers <ebiggers@google.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Eric Biggers <ebiggers@google.com> [ bvanassche: edited commit message and introduced CONFIG_SCSI_UFS_VARIABLE_SG_ENTRY_SIZE ] Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
b434ecfb | 08-Dec-2022 |
Bart Van Assche <bvanassche@acm.org> |
scsi: ufs: core: Pass the clock scaling timeout as an argument
Prepare for adding an additional ufshcd_clock_scaling_prepare() call with a different timeout.
Reviewed-by: Avri Altman <avri.altman@w
scsi: ufs: core: Pass the clock scaling timeout as an argument
Prepare for adding an additional ufshcd_clock_scaling_prepare() call with a different timeout.
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>
show more ...
|
2000bc30 | 08-Dec-2022 |
Bart Van Assche <bvanassche@acm.org> |
scsi: ufs: core: Reduce the clock scaling latency
Wait at most 20 ms before rechecking the doorbells instead of waiting for a potentially long time between doorbell checks.
Reviewed-by: Avri Altman
scsi: ufs: core: Reduce the clock scaling latency
Wait at most 20 ms before rechecking the doorbells instead of waiting for a potentially long time between doorbell checks.
Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
9a3a5a85 | 30-Dec-2022 |
Martin K. Petersen <martin.petersen@oracle.com> |
Merge patch series "scsi: ufs: ufs-qcom: Debug clean ups"
Andrew Halaney <ahalaney@redhat.com> says:
This patch series attempts to clean up some debug code paths in the ufs-qcom driver.
Link: http
Merge patch series "scsi: ufs: ufs-qcom: Debug clean ups"
Andrew Halaney <ahalaney@redhat.com> says:
This patch series attempts to clean up some debug code paths in the ufs-qcom driver.
Link: https://lore.kernel.org/r/20221201230810.1019834-1-ahalaney@redhat.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
1026f7d3 | 01-Dec-2022 |
Andrew Halaney <ahalaney@redhat.com> |
scsi: ufs: ufs-qcom: Use dev_err() where possible
dev_err() statements are better to use than pr_err(), so switch to those.
In a similar vein, the check on the dev_req_params pointer here is not ne
scsi: ufs: ufs-qcom: Use dev_err() where possible
dev_err() statements are better to use than pr_err(), so switch to those.
In a similar vein, the check on the dev_req_params pointer here is not needed, the two places this function is called never pass in a NULL pointer, so instead of using dev_err() there just remove it.
Signed-off-by: Andrew Halaney <ahalaney@redhat.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
e4ce23fb | 01-Dec-2022 |
Andrew Halaney <ahalaney@redhat.com> |
scsi: ufs: ufs-qcom: Remove usage of dbg_print_en
This bitmask is unconditionally set in the current driver, so all conditionals using it can be considered bit rot.
Let's take the current default c
scsi: ufs: ufs-qcom: Remove usage of dbg_print_en
This bitmask is unconditionally set in the current driver, so all conditionals using it can be considered bit rot.
Let's take the current default conditional path everywhere and remove dbg_print_en from the driver.
Signed-off-by: Andrew Halaney <ahalaney@redhat.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
50a427a0 | 01-Dec-2022 |
Andrew Halaney <ahalaney@redhat.com> |
scsi: ufs: ufs-qcom: Clean up dbg_register_dump
The current implementation has abstractions that don't give any benefits.
The print_fn callback (and its only callback implementation, ufs_qcom_dump_
scsi: ufs: ufs-qcom: Clean up dbg_register_dump
The current implementation has abstractions that don't give any benefits.
The print_fn callback (and its only callback implementation, ufs_qcom_dump_regs_wrapper()) was only used by ufs_qcom_print_hw_debug_reg_all() and just multiplies len by 4 before calling ufshcd_dump_regs().
ufs_qcom_print_hw_debug_reg_all() is only called by ufs_qcom_dump_dbg_regs().
There's no real gain in those abstractions, so let's just do the work directly in ufs_qcom_dump_dbg_regs() (the dbg_register_dump callback).
Signed-off-by: Andrew Halaney <ahalaney@redhat.com> Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
6ff265fc | 01-Dec-2022 |
Bean Huo <beanhuo@micron.com> |
scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsg
Add advanced RPMB support in ufs_bsg:
1. According to the UFS specification, only one RPMB operation can be performed at any time. We
scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsg
Add advanced RPMB support in ufs_bsg:
1. According to the UFS specification, only one RPMB operation can be performed at any time. We can ensure this by using reserved slot and its dev_cmd sync operation protection mechanism.
2. For Advanced RPMB, RPMB metadata is packaged in an EHS (Extra Header Segment) of a command UPIU, and the corresponding reply EHS (from the device) should also be returned to the user space. bsg_job->request and bsg_job->reply allow us to pass and return EHS from/back to userspace.
Compared to normal/legacy RPMB, the advantages of advanced RPMB are:
1. The data length in the Advanced RPMB data read/write command can be larger than 4KB. For the legacy RPMB, the data length in a single RPMB data transfer is 256 bytes.
2. All of the advanced RPMB operations will be a single command. For legacy RPMB, take the read write-counter value as an example, you need two commands (first SECURITY PROTOCOL OUT, then second SECURITY PROTOCOL IN).
Signed-off-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
a4b1c9b9 | 01-Dec-2022 |
Bean Huo <beanhuo@micron.com> |
scsi: ufs: core: Pass EHS length into ufshcd_prepare_req_desc_hdr()
We need to fill in the total EHS length in UTP Transfer Request Descriptor. Add this functionality to ufshcd_prepare_req_desc_hdr(
scsi: ufs: core: Pass EHS length into ufshcd_prepare_req_desc_hdr()
We need to fill in the total EHS length in UTP Transfer Request Descriptor. Add this functionality to ufshcd_prepare_req_desc_hdr().
Signed-off-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
f6b9d0fe | 01-Dec-2022 |
Bean Huo <beanhuo@micron.com> |
scsi: ufs: core: Advanced RPMB detection
Check UFS Advanced RPMB LU enablement during ufshcd_lu_init().
Signed-off-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Martin K. Petersen <martin.peters
scsi: ufs: core: Advanced RPMB detection
Check UFS Advanced RPMB LU enablement during ufshcd_lu_init().
Signed-off-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
7a4df79d | 01-Dec-2022 |
Bean Huo <beanhuo@micron.com> |
scsi: ufs: core: Split ufshcd_map_sg()
Take out the "map scatter-gather list to prdt" part of the code in ufshcd_map_sg() and split it into a new function ufshcd_sgl_to_prdt().
Signed-off-by: Bean
scsi: ufs: core: Split ufshcd_map_sg()
Take out the "map scatter-gather list to prdt" part of the code in ufshcd_map_sg() and split it into a new function ufshcd_sgl_to_prdt().
Signed-off-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
765ab00d | 01-Dec-2022 |
Bean Huo <beanhuo@micron.com> |
scsi: ufs: bsg: Clean up ufs_bsg_request()
Move sg_copy_from_buffer() below its associated case statement.
Signed-off-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com
scsi: ufs: bsg: Clean up ufs_bsg_request()
Move sg_copy_from_buffer() below its associated case statement.
Signed-off-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
64d48647 | 01-Dec-2022 |
Bean Huo <beanhuo@micron.com> |
scsi: ufs: bsg: Remove unnecessary length checkup
Remove checks on job->request_len and job->reply_len because msgcode checks in a subseqent commit will rule out malicious requests.
Signed-off-by:
scsi: ufs: bsg: Remove unnecessary length checkup
Remove checks on job->request_len and job->reply_len because msgcode checks in a subseqent commit will rule out malicious requests.
Signed-off-by: Bean Huo <beanhuo@micron.com> Acked-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|