aboutsummaryrefslogtreecommitdiff
path: root/include/ufs
AgeCommit message (Collapse)AuthorFilesLines
2022-12-30Merge patch series "Prepare for upstreaming Pixel 6 and 7 UFS support"Martin K. Petersen2-2/+37
Bart Van Assche <[email protected]> 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/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2022-12-30scsi: ufs: core: Allow UFS host drivers to override the sg entry sizeEric Biggers2-2/+37
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 <[email protected]> Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Eric Biggers <[email protected]> [ bvanassche: edited commit message and introduced CONFIG_SCSI_UFS_VARIABLE_SG_ENTRY_SIZE ] Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-12-30scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsgBean Huo3-1/+11
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 <[email protected]> Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-12-30scsi: ufs: core: Advanced RPMB detectionBean Huo1-0/+24
Check UFS Advanced RPMB LU enablement during ufshcd_lu_init(). Signed-off-by: Bean Huo <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-11-08scsi: ufs: core: Remove check_upiu_size() from ufshcd.hKeoseong Park1-6/+0
Commit 68078d5cc1a5 ("[SCSI] ufs: Set fDeviceInit flag to initiate device initialization") added check_upiu_size(), but no caller. Cc: Dolev Raviv <[email protected]> Link: https://lore.kernel.org/r/20221103055349epcms2p338f2550c2dd78d00231a83b24719a3d4@epcms2p3 Signed-off-by: Keoseong Park <[email protected]> Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-10-22scsi: ufs: Track system suspend / resume activityBart Van Assche1-1/+4
Add a new boolean variable that tracks whether the system is suspending, suspended or resuming. This information will be used in a later commit to fix a deadlock between the SCSI error handler and the suspend code. Reviewed-by: Adrian Hunter <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
2022-10-07Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds1-25/+21
Pull SCSI updates from James Bottomley: "Updates to the usual drivers (qla2xxx, lpfc, ufs, hisi_sas, mpi3mr, mpt3sas, target). The biggest change (from my biased viewpoint) being that the mpi3mr now attached to the SAS transport class, making it the first fusion type device to do so. Beyond the usual bug fixing and security class reworks, there aren't a huge number of core changes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (141 commits) scsi: iscsi: iscsi_tcp: Fix null-ptr-deref while calling getpeername() scsi: mpi3mr: Remove unnecessary cast scsi: stex: Properly zero out the passthrough command structure scsi: mpi3mr: Update driver version to 8.2.0.3.0 scsi: mpi3mr: Fix scheduling while atomic type bug scsi: mpi3mr: Scan the devices during resume time scsi: mpi3mr: Free enclosure objects during driver unload scsi: mpi3mr: Handle 0xF003 Fault Code scsi: mpi3mr: Graceful handling of surprise removal of PCIe HBA scsi: mpi3mr: Schedule IRQ kthreads only on non-RT kernels scsi: mpi3mr: Support new power management framework scsi: mpi3mr: Update mpi3 header files scsi: mpt3sas: Revert "scsi: mpt3sas: Fix ioc->base_readl() use" scsi: mpt3sas: Revert "scsi: mpt3sas: Fix writel() use" scsi: wd33c93: Remove dead code related to the long-gone config WD33C93_PIO scsi: core: Add I/O timeout count for SCSI device scsi: qedf: Populate sysfs attributes for vport scsi: pm8001: Replace one-element array with flexible-array member scsi: 3w-xxxx: Replace one-element array with flexible-array member scsi: hptiop: Replace one-element array with flexible-array member in struct hpt_iop_request_ioctl_command() ...
2022-09-25scsi: ufs: core: Remove redundant function definitions from ufshcd.hArthur Simchaev1-20/+0
Remove Query-Request API function declarations from include/ufs/ufshcd.h and move them to the ufs core private header. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bean Huo <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Arthur Simchaev <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-08-22scsi: ufs: wb: Add explicit flush sysfs attributeJinyoung Choi1-0/+1
There is the following quirk to bypass "WB Flush" in Write Booster. - UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL If this quirk is not set, there is no knob that can control "WB Flush". There are three flags that control Write Booster Feature: 1. WB ON/OFF 2. WB Hibern Flush ON/OFF (implicitly) 3. WB Flush ON/OFF (explicit) The sysfs attribute that controls the WB was implemented. (1) In the case of "Hibern Flush", it is always good to turn on. Control may not be required. (2) Finally, "Flush" may be necessary because the Auto-Hibern8 is not supported in a specific environment. So the sysfs attribute that controls this is necessary. (3) Link: https://lore.kernel.org/r/20220804075354epcms2p8c21c894b4e28840c5fc651875b7f435f@epcms2p8 Reviewed-by: Avri Altman <[email protected]> Signed-off-by: Jinyoung Choi <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-08-22scsi: ufs: core: Allow host driver to disable wb toggling during clock scalingPeter Wang1-0/+11
Mediatek UFS does not want to toggle write booster during clock scaling. Permit host driver to disable wb toggling during clock scaling. Introduce a flag UFSHCD_CAP_WB_WITH_CLK_SCALING to decouple WB and clock scaling. UFSHCD_CAP_WB_WITH_CLK_SCALING is only valid when UFSHCD_CAP_CLK_SCALING is set. Just like UFSHCD_CAP_HIBERN8_WITH_CLK_GATING is valid only when UFSHCD_CAP_CLK_GATING set. Set UFSHCD_CAP_WB_WITH_CLK_SCALING for qcom to compatible legacy design at the same time. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Stanley Chu <[email protected]> Signed-off-by: Peter Wang <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-08-22scsi: ufs: core: Use local_clock() for debugging timestampsDaniil Lunev1-5/+9
CLOCK_MONOTONIC is not advanced when the system is in suspend. This becomes problematic when debugging issues related to suspend-resume: the timestamps printed by ufshcd_print_trs can not be correlated with dmesg entries, which are timestamped with local_clock(). Change the used clock to local_clock() for the informational timestamp variables and adds mirroring *_local_clock instances for variables used in subsequent derevations (to not change the semantics of those derevations). Link: https://lore.kernel.org/r/20220804065019.v5.1.I699244ea7efbd326a34a6dfd9b5a31e78400cf68@changeid Acked-by: Stanley Chu <[email protected]> Acked-by: Avri Altman <[email protected]> Signed-off-by: Daniil Lunev <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-08-11scsi: ufs: core: Enable link lost interruptKiwoong Kim1-5/+1
Link lost is treated as fatal error with commit c99b9b230149 ("scsi: ufs: Treat link loss as fatal error"), but the event isn't registered as interrupt source. Enable it. Link: https://lore.kernel.org/r/[email protected] Fixes: c99b9b230149 ("scsi: ufs: Treat link loss as fatal error") Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Kiwoong Kim <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-06-27scsi: ufs: ufshcd: Constify pointed dataKrzysztof Kozlowski1-3/+3
For code safety, constify arrays and pointers to data which is not modified. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-06-16scsi: ufs: Export regulator functionsStanley Chu1-0/+2
Export below regulator functions to allow vendors to customize regulator configuration in their own platforms. int ufshcd_populate_vreg(struct device *dev, const char *name, struct ufs_vreg **out_vreg); int ufshcd_get_vreg(struct device *dev, struct ufs_vreg *vreg); Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stanley Chu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-06-16scsi: ufs: ufs-mediatek: Introduce workaround for power mode changeCC Chou1-0/+1
Some MediaTek SoC chips need special flow for power mode change, especially for chips supporting HS-G5. Enable the workaround by setting the host-specific capability. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Stanley Chu <[email protected]> Signed-off-by: CC Chou <[email protected]> Signed-off-by: Eddie Huang <[email protected]> Signed-off-by: Dennis Yu <[email protected]> Signed-off-by: Peter Wang <[email protected]> Signed-off-by: Stanley Chu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-06-16scsi: ufs: Export ufshcd_uic_change_pwr_mode()Stanley Chu1-0/+1
Export ufshcd_uic_change_pwr_mode() to allow vendors to use it for SoC-specific power mode change design limitations. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Stanley Chu <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-06-16scsi: ufs: Rearrange addresses in increasing orderAlim Akhtar1-51/+51
Rearrange all the unipro and mphy addresses in their increasing order. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Chanho Park <[email protected]> Signed-off-by: Alim Akhtar <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-06-16scsi: ufs: host: ufs-exynos: Use already existing definitionAlim Akhtar1-1/+0
UFS core already uses RX_MIN_ACTIVATETIME_CAPABILITY macro, let's use the same in driver as well instead of having a different macro name for the same offset. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Chanho Park <[email protected]> Signed-off-by: Alim Akhtar <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-06-13scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTOYoshihiro Shimoda1-0/+6
Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports auto-hibernate the capability but only FASTAUTO mode. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-06-13scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESSYoshihiro Shimoda1-0/+6
Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS for host controllers which do not support 64-bit addressing. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
2022-05-19scsi: ufs: Split the drivers/scsi/ufs directoryBart Van Assche5-0/+2795
Split the drivers/scsi/ufs directory into 'core' and 'host' directories under the drivers/ufs/ directory. Move shared header files into the include/ufs/ directory. This separation makes it clear which header files UFS drivers are allowed to include (include/ufs/*.h) and which header files UFS drivers are not allowed to include (drivers/ufs/core/*.h). Update the MAINTAINERS file. Add myself as a UFS reviewer. Link: https://lore.kernel.org/r/[email protected] Cc: Adrian Hunter <[email protected]> Cc: Avri Altman <[email protected]> Cc: Bean Huo <[email protected]> Cc: Bjorn Andersson <[email protected]> Cc: Keoseong Park <[email protected]> Tested-by: Bean Huo <[email protected]> Tested-by: Adrian Hunter <[email protected]> Reviewed-by: Bean Huo <[email protected]> Acked-by: Avri Altman <[email protected]> Acked-by: Adrian Hunter <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>