a1906678 | 27-Jul-2022 |
Daniil Lunev <dlunev@chromium.org> |
scsi: ufs: ufs-pci: Correct check for RESET DSM
dsm_fns is a bitmap, and it is 0-indexed according to the check in __intel_dsm function. But common initialization was checking it as if it was 1-inde
scsi: ufs: ufs-pci: Correct check for RESET DSM
dsm_fns is a bitmap, and it is 0-indexed according to the check in __intel_dsm function. But common initialization was checking it as if it was 1-indexed. This patch corrects the discrepancy. This change won't break any existing calls to the function, since before the change both bits 0 and 1 were checked and needed to be set.
Link: https://lore.kernel.org/r/20220728111748.v3.1.I22460c4f4a9ccf2c96c3f9bb392b409926d80b2f@changeid Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Daniil Lunev <dlunev@chromium.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
00511d2a | 26-Jul-2022 |
Peter Wang <peter.wang@mediatek.com> |
scsi: ufs: core: Correct ufshcd_shutdown() flow
After ufshcd_wl_shutdown() set device power off and link off, ufshcd_shutdown() could turn off clock/power. Also remove pm_runtime_get_sync.
The reas
scsi: ufs: core: Correct ufshcd_shutdown() flow
After ufshcd_wl_shutdown() set device power off and link off, ufshcd_shutdown() could turn off clock/power. Also remove pm_runtime_get_sync.
The reason why it is safe to remove pm_runtime_get_sync() is because:
- ufshcd_wl_shutdown() -> pm_runtime_get_sync() will resume hba->dev too.
- device resume(turn on clk/power) is not required, even if device is in RPM_SUSPENDED.
Link: https://lore.kernel.org/r/20220727030526.31022-1-peter.wang@mediatek.com Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun") Cc: <stable@vger.kernel.org> # 5.15.x Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
86a44f04 | 26-Jul-2022 |
Bart Van Assche <bvanassche@acm.org> |
scsi: ufs: core: Increase the maximum data buffer size
Measurements for one particular UFS controller + UFS device show a 25% higher read bandwidth if the maximum data buffer size is increased from
scsi: ufs: core: Increase the maximum data buffer size
Measurements for one particular UFS controller + UFS device show a 25% higher read bandwidth if the maximum data buffer size is increased from 512 KiB to 1 MiB. Hence increase the maximum size of the data buffer associated with a single request from SCSI_DEFAULT_MAX_SECTORS (1024) * 512 bytes = 512 KiB to 1 MiB.
Notes:
- The maximum data buffer size supported by the UFSHCI specification is 65535 * 256 KiB or about 16 GiB.
- The maximum data buffer size for READ(10) commands is 65535 logical blocks. To transfer more than 65535 * 4096 bytes = 255 MiB with a single SCSI command, the READ(16) command is required. Support for READ(16) is optional in the UFS 3.1 and UFS 4.0 standards.
Link: https://lore.kernel.org/r/20220726225232.1362251-1-bvanassche@acm.org Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Bean Huo <beanhuo@micron.com> Cc: Stanley Chu <stanley.chu@mediatek.com> Tested-by: Avri Altman <avri.altman@wdc.com> Acked-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 ...
|
f5c2976e | 20-Jul-2022 |
Bart Van Assche <bvanassche@acm.org> |
scsi: ufs: core: Fix a race condition related to device management
If a device management command completion happens after wait_for_completion_timeout() times out and before ufshcd_clear_cmds() is c
scsi: ufs: core: Fix a race condition related to device management
If a device management command completion happens after wait_for_completion_timeout() times out and before ufshcd_clear_cmds() is called, then the completion code may crash on the complete() call in __ufshcd_transfer_req_compl().
Fix the following crash:
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008 Call trace: complete+0x64/0x178 __ufshcd_transfer_req_compl+0x30c/0x9c0 ufshcd_poll+0xf0/0x208 ufshcd_sl_intr+0xb8/0xf0 ufshcd_intr+0x168/0x2f4 __handle_irq_event_percpu+0xa0/0x30c handle_irq_event+0x84/0x178 handle_fasteoi_irq+0x150/0x2e8 __handle_domain_irq+0x114/0x1e4 gic_handle_irq.31846+0x58/0x300 el1_irq+0xe4/0x1c0 efi_header_end+0x110/0x680 __irq_exit_rcu+0x108/0x124 __handle_domain_irq+0x118/0x1e4 gic_handle_irq.31846+0x58/0x300 el1_irq+0xe4/0x1c0 cpuidle_enter_state+0x3ac/0x8c4 do_idle+0x2fc/0x55c cpu_startup_entry+0x84/0x90 kernel_init+0x0/0x310 start_kernel+0x0/0x608 start_kernel+0x4ec/0x608
Link: https://lore.kernel.org/r/20220720170228.1598842-1-bvanassche@acm.org Fixes: 5a0b0cb9bee7 ("[SCSI] ufs: Add support for sending NOP OUT UPIU") Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: Bean Huo <beanhuo@micron.com> Cc: 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 ...
|
a3435afb | 19-Jul-2022 |
Liang He <windhl@126.com> |
scsi: ufs: host: Hold reference returned by of_parse_phandle()
In ufshcd_populate_vreg(), we should hold the reference returned by of_parse_phandle() and then use it to call of_node_put() for refcou
scsi: ufs: host: Hold reference returned by of_parse_phandle()
In ufshcd_populate_vreg(), we should hold the reference returned by of_parse_phandle() and then use it to call of_node_put() for refcount balance.
Link: https://lore.kernel.org/r/20220719071529.1081166-1-windhl@126.com Fixes: aa4976130934 ("ufs: Add regulator enable support") Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Liang He <windhl@126.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
ca452621 | 15-Jul-2022 |
Daniil Lunev <dlunev@chromium.org> |
scsi: ufs: core: Read device property for ref clock
UFS storage devices require bRefClkFreq attribute to be set to operate correctly at high speed mode. The necessary value is determined by what the
scsi: ufs: core: Read device property for ref clock
UFS storage devices require bRefClkFreq attribute to be set to operate correctly at high speed mode. The necessary value is determined by what the SoC / board supports. The standard doesn't specify a method to query the value, so the information needs to be fed in separately.
DT information feeds into setting up the clock framework, so platforms using DT can get the UFS reference clock frequency from the clock framework. A special node "ref_clk" from the clock array for the UFS controller node is used as the source for the information.
On the platforms that do not use DT (e.g. Intel), the alternative mechanism to feed the intended reference clock frequency is necessary. Specifying the necessary information in DSD of the UFS controller ACPI node is an alternative mechanism proposed in this patch. Those can be accessed via firmware property facility in the kernel and in many ways simillar to querying properties defined in DT.
This patch introduces a small helper function to query a predetermined ACPI supplied property of the UFS controller, and uses it to attempt retrieving reference clock value, unless that was already done by the clock infrastructure.
Link: https://lore.kernel.org/r/20220715210230.1.I365d113d275117dee8fd055ce4fc7e6aebd0bce9@changeid Reviewed-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Daniil Lunev <dlunev@chromium.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
52a51801 | 11-Jul-2022 |
Po-Wen Kao <powen.kao@mediatek.com> |
scsi: ufs: core: Fix missing clk change notification on host reset
In ufshcd_host_reset_and_restore(), ufshcd_set_clk_freq() is called to scale clock rate. However, this did not call vops->clk_scale
scsi: ufs: core: Fix missing clk change notification on host reset
In ufshcd_host_reset_and_restore(), ufshcd_set_clk_freq() is called to scale clock rate. However, this did not call vops->clk_scale_notify() to inform platform driver of clock change.
Call ufshcd_scale_clks() instead so that clock change can be properly handled.
Link: https://lore.kernel.org/r/20220711144224.17916-2-powen.kao@mediatek.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Po-Wen Kao <powen.kao@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
c641ffdb | 08-Jul-2022 |
Keoseong Park <keosung.park@samsung.com> |
scsi: ufs: core: Remove UIC_HIBERN8_ENTER_RETRIES
Commit 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths") removed all callers of UIC_HIBERN8_ENTER_RETRIES.
scsi: ufs: core: Remove UIC_HIBERN8_ENTER_RETRIES
Commit 4db7a2360597 ("scsi: ufs: Fix concurrency of error handler and other error recovery paths") removed all callers of UIC_HIBERN8_ENTER_RETRIES. Hence also remove the macro itself.
Link: https://lore.kernel.org/r/20220708052006epcms2p2d1129dbf95fd77f46906200ccb0a9ccd@epcms2p2 Reviewed-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>
show more ...
|
3d73b200 | 05-Jul-2022 |
Chanho Park <chanho61.park@samsung.com> |
scsi: ufs: ufs-exynos: Change ufs phy control sequence
Since commit 1599069a62c6 ("phy: core: Warn when phy_power_on is called before phy_init"), the following warning has been reported:
phy_power
scsi: ufs: ufs-exynos: Change ufs phy control sequence
Since commit 1599069a62c6 ("phy: core: Warn when phy_power_on is called before phy_init"), the following warning has been reported:
phy_power_on was called before phy_init
To address this, we need to remove phy_power_on from exynos_ufs_phy_init() and move it after phy_init. phy_power_off and phy_exit are also necessary in exynos_ufs_remove().
Link: https://lore.kernel.org/r/20220706020255.151177-4-chanho61.park@samsung.com Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
174e909b | 05-Jul-2022 |
Junwoo Lee <junwoo80.lee@samsung.com> |
scsi: ufs: Skip last hci reset to get valid register values
Once the host link startup fails 3 times, all host registers are reset to default values except in ufshcd_hba_enable().
The ufs host cont
scsi: ufs: Skip last hci reset to get valid register values
Once the host link startup fails 3 times, all host registers are reset to default values except in ufshcd_hba_enable().
The ufs host controller is disabled and enabled in ufshcd_hba_enable(). Consequently we need to skip last hci reset to get valid host register values.
e.g. [ 1.898026] [2: kworker/u16:2: 211] ufs: link startup failed 1 [ 1.898133] [2: kworker/u16:2: 211] host_regs: 00000000: 1383ff1f 00000000 00000300 00000000 [ 1.898141] [2: kworker/u16:2: 211] host_regs: 00000010: 00000106 000001ce 00000000 00000000 [ 1.898148] [2: kworker/u16:2: 211] host_regs: 00000020: 00000000 00000470 00000000 00000000 [ 1.898155] [2: kworker/u16:2: 211] host_regs: 00000030: 00000008 00000003 00000000 00000000 [ 1.898163] [2: kworker/u16:2: 211] host_regs: 00000040: 00000000 00000000 00000000 00000000 [ 1.898171] [2: kworker/u16:2: 211] host_regs: 00000050: 00000000 00000000 00000000 00000000 [ 1.898177] [2: kworker/u16:2: 211] host_regs: 00000060: 00000000 00000000 00000000 00000000 [ 1.898186] [2: kworker/u16:2: 211] host_regs: 00000070: 00000000 00000000 00000000 00000000 [ 1.898194] [2: kworker/u16:2: 211] host_regs: 00000080: 00000000 00000000 00000000 00000000 [ 1.898201] [2: kworker/u16:2: 211] host_regs: 00000090: 00000000 00000000 00000000 00000000
Link: https://lore.kernel.org/r/20220705083538.15143-1-sh043.lee@samsung.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Junwoo Lee <junwoo80.lee@samsung.com> Signed-off-by: Seunghui Lee <sh043.lee@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
bcec04b3 | 27-Jun-2022 |
ChanWoo Lee <cw9316.lee@samsung.com> |
scsi: ufs: ufs-qcom: Remove unneeded code
Checks information about tx_lanes, but is not used.
Since commit 1e1e465c6d23 ("scsi/ufs: qcom: Remove ufs_qcom_phy_*() calls from host"), tx_lanes is depr
scsi: ufs: ufs-qcom: Remove unneeded code
Checks information about tx_lanes, but is not used.
Since commit 1e1e465c6d23 ("scsi/ufs: qcom: Remove ufs_qcom_phy_*() calls from host"), tx_lanes is deprecated.
As a result, ufs_qcom_link_startup_notify -> POST_CHANGE action does nothing. If it is not going to be updated, it can be removed.
Link: https://lore.kernel.org/r/20220627235545.16943-1-cw9316.lee@samsung.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: ChanWoo Lee <cw9316.lee@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
df1ea242 | 22-Jun-2022 |
Alice Chao <alice.chao@mediatek.com> |
scsi: ufs: ufs-mediatek: Fix invalid access to vccqx
NULL pointer access issue was found for the regulator released by ufs_mtk_vreg_fix_vccq(). Simply fix this issue by clearing the released vreg po
scsi: ufs: ufs-mediatek: Fix invalid access to vccqx
NULL pointer access issue was found for the regulator released by ufs_mtk_vreg_fix_vccq(). Simply fix this issue by clearing the released vreg pointer in ufs_hba struct.
Link: https://lore.kernel.org/r/20220623035052.18802-9-stanley.chu@mediatek.com Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Alice Chao <alice.chao@mediatek.com> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|
c64c487d | 22-Jun-2022 |
Peter Wang <peter.wang@mediatek.com> |
scsi: ufs: ufs-mediatek: Support performance boosting
Add pm-qos request to support performance boosting in MediaTek UFS platforms.
At the same time, adjust the order of function calls to be symmet
scsi: ufs: ufs-mediatek: Support performance boosting
Add pm-qos request to support performance boosting in MediaTek UFS platforms.
At the same time, adjust the order of function calls to be symmetric during the low-power control flow.
Link: https://lore.kernel.org/r/20220623035052.18802-8-stanley.chu@mediatek.com Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Peter Wang <peter.wang@mediatek.com> Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
show more ...
|