summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/Kconfig
AgeCommit message (Collapse)AuthorFilesLines
2022-05-19scsi: ufs: Split the drivers/scsi/ufs directoryBart Van Assche1-187/+0
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/20220511212552.655341-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: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Keoseong Park <keosung.park@samsung.com> Tested-by: Bean Huo <beanhuo@micron.com> Tested-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Acked-by: Avri Altman <avri.altman@wdc.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2022-04-25scsi: ufs: Remove paths from source code commentsBart Van Assche1-1/+0
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>
2022-04-25scsi: ufs: Use an SPDX license identifier in the Kconfig fileBart Van Assche1-24/+1
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>
2021-11-18scsi: ufs: Fix double space in SCSI_UFS_HWMON descriptionGeert Uytterhoeven1-1/+1
There's no reason to have a double space between "UFS" and "Temperature", hence drop it. Link: https://lore.kernel.org/r/20211106164741.1571206-1-geert@linux-m68k.org Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature notification support") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-11-18scsi: ufs: Wrap Universal Flash Storage drivers in SCSI_UFSHCDGeert Uytterhoeven1-6/+7
The build only descends into drivers/scsi/ufs/ if SCSI_UFSHCD is enabled. Hence all later config symbols should depend on SCSI_UFSHCD to prevent asking the user about config symbols for driver code that won't be built anyway. Unfortunately not all symbols have that dependency. Fix this by wrapping them all into a big if/endif block. Remove the now superfluous explicit dependencies on SCSI_UFSHCD from all symbols that already had it. Link: https://lore.kernel.org/r/20211106164650.1571068-1-geert@linux-m68k.org Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-09-28scsi: ufs: core: SCSI_UFS_HWMON depends on HWMON=yAnders Roxell1-1/+1
When building an allmodconfig kernel, the following build error shows up: aarch64-linux-gnu-ld: drivers/scsi/ufs/ufs-hwmon.o: in function `ufs_hwmon_probe': /kernel/next/drivers/scsi/ufs/ufs-hwmon.c:177: undefined reference to `hwmon_device_register_with_info' /kernel/next/drivers/scsi/ufs/ufs-hwmon.c:177:(.text+0x510): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `hwmon_device_register_with_info' aarch64-linux-gnu-ld: drivers/scsi/ufs/ufs-hwmon.o: in function `ufs_hwmon_remove': /kernel/next/drivers/scsi/ufs/ufs-hwmon.c:195: undefined reference to `hwmon_device_unregister' /kernel/next/drivers/scsi/ufs/ufs-hwmon.c:195:(.text+0x5c8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `hwmon_device_unregister' aarch64-linux-gnu-ld: drivers/scsi/ufs/ufs-hwmon.o: in function `ufs_hwmon_notify_event': /kernel/next/drivers/scsi/ufs/ufs-hwmon.c:206: undefined reference to `hwmon_notify_event' /kernel/next/drivers/scsi/ufs/ufs-hwmon.c:206:(.text+0x64c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `hwmon_notify_event' aarch64-linux-gnu-ld: /home/anders/src/kernel/next/drivers/scsi/ufs/ufs-hwmon.c:209: undefined reference to `hwmon_notify_event' /kernel/next/drivers/scsi/ufs/ufs-hwmon.c:209:(.text+0x66c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `hwmon_notify_event' Since SCSI_UFS_HWMON can't be built as a module, SCSI_UFS_HWMON has to depend on HWMON=y. Link: https://lore.kernel.org/r/20210927084615.1938432-1-anders.roxell@linaro.org Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature notification support") Also-reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Acked-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-09-28scsi: ufs: exynos: Unify namingKrzysztof Kozlowski1-5/+5
Use "Samsung" and "Exynos", not the uppercase versions. Link: https://lore.kernel.org/r/20210924132658.109814-2-krzysztof.kozlowski@canonical.com Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-09-22scsi: ufs: core: Probe for temperature notification supportAvri Altman1-0/+9
Probe the dExtendedUFSFeaturesSupport register for the device's temperature notification support and, if supported, add a hardware monitor device. Link: https://lore.kernel.org/r/20210915060407.40-2-avri.altman@wdc.com Reviewed-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Daejun Park <daejun7.park@samsung.com> Signed-off-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-08-03scsi: ufs: Add fault injection supportBart Van Assche1-0/+7
Make it easier to test the UFS error handler and abort handler. Link: https://lore.kernel.org/r/20210722033439.26550-19-bvanassche@acm.org Acked-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>
2021-08-01scsi: ufs: ufshpb: Introduce Host Performance Buffer featureDaejun Park1-0/+9
Implement Host Performance Buffer (HPB) initialization and add function calls to UFS core driver. NAND flash-based storage devices, including UFS, have mechanisms to translate logical addresses of I/O requests to the corresponding physical addresses of the flash storage. In UFS, logical-to-physical-address (L2P) map data, which is required to identify the physical address for the requested I/Os, can only be partially stored in SRAM from NAND flash. Due to this partial loading, accessing the flash address area, where the L2P information for that address is not loaded in the SRAM, can result in serious performance degradation. The basic concept of HPB is to cache L2P mapping entries in host system memory so that both physical block address (PBA) and logical block address (LBA) can be delivered in HPB read command. The HPB read command allows to read data faster than a regular read command in UFS since it provides the physical address (HPB Entry) of the desired logical block in addition to its logical address. The UFS device can access the physical block in NAND directly without searching and uploading L2P mapping table. This improves read performance because the NAND read operation for uploading L2P mapping table is removed. In HPB initialization, the host checks if the UFS device supports HPB feature and retrieves related device capabilities. Then, HPB parameters are configured in the device. Total start-up time of popular applications was measured and the difference observed between HPB being enabled and disabled. Popular applications are 12 game apps and 24 non-game apps. Each test cycle consists of running 36 applications in sequence. We repeated the cycle for observing performance improvement by L2P mapping cache hit in HPB. The following is the test environment: - kernel version: 4.4.0 - RAM: 8GB - UFS 2.1 (64GB) Results: +-------+----------+----------+-------+ | cycle | baseline | with HPB | diff | +-------+----------+----------+-------+ | 1 | 272.4 | 264.9 | -7.5 | | 2 | 250.4 | 248.2 | -2.2 | | 3 | 226.2 | 215.6 | -10.6 | | 4 | 230.6 | 214.8 | -15.8 | | 5 | 232.0 | 218.1 | -13.9 | | 6 | 231.9 | 212.6 | -19.3 | +-------+----------+----------+-------+ We also measured HPB performance using iozone: $ iozone -r 4k -+n -i2 -ecI -t 16 -l 16 -u 16 -s $IO_RANGE/16 -F \ mnt/tmp_1 mnt/tmp_2 mnt/tmp_3 mnt/tmp_4 mnt/tmp_5 mnt/tmp_6 mnt/tmp_7 \ mnt/tmp_8 mnt/tmp_9 mnt/tmp_10 mnt/tmp_11 mnt/tmp_12 mnt/tmp_13 \ mnt/tmp_14 mnt/tmp_15 mnt/tmp_16 Results: +----------+--------+---------+ | IO range | HPB on | HPB off | +----------+--------+---------+ | 1 GB | 294.8 | 300.87 | | 4 GB | 293.51 | 179.35 | | 8 GB | 294.85 | 162.52 | | 16 GB | 293.45 | 156.26 | | 32 GB | 277.4 | 153.25 | +----------+--------+---------+ Link: https://lore.kernel.org/r/20210712085830epcms2p8c1288b7f7a81b044158a18232617b572@epcms2p8 Reported-by: kernel test robot <lkp@intel.com> Tested-by: Bean Huo <beanhuo@micron.com> Tested-by: Can Guo <cang@codeaurora.org> Tested-by: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Can Guo <cang@codeaurora.org> Reviewed-by: Bean Huo <beanhuo@micron.com> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Acked-by: Avri Altman <Avri.Altman@wdc.com> Signed-off-by: Daejun Park <daejun7.park@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-06-15scsi: ufs-mediatek: Create reset control device_linkPeter Wang1-0/+1
Mediatek UFS reset function relies on Reset Control provided by reset-ti-syscon. To make Mediatek Reset Control work properly, select reset-ti-syscon to ensure it is being built. In addition, establish device_link to wait until reset-ti-syscon initialization is complete during UFS probing. Link: https://lore.kernel.org/r/1622601720-22466-1-git-send-email-peter.wang@mediatek.com 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>
2021-01-26Merge branch '5.11/scsi-fixes' into 5.12/scsi-queueMartin K. Petersen1-0/+1
The UFS core has received a substantial rework this cycle. This in turn has caused a merge conflict in linux-next. Merge 5.11/scsi-fixes into 5.12/scsi-queue and resolve the conflict. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-01-07scsi: ufs: Fix all Kconfig help text indentationRandy Dunlap1-7/+7
Use consistent and expected indentation for all Kconfig text. Link: https://lore.kernel.org/r/20210106205554.18082-1-rdunlap@infradead.org Cc: Alim Akhtar <alim.akhtar@samsung.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: linux-scsi@vger.kernel.org Cc: "James E.J. Bottomley" <jejb@linux.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-01-07scsi: ufs: ufshcd-pltfrm depends on HAS_IOMEMRandy Dunlap1-0/+1
Building ufshcd-pltfrm.c on arch/s390/ has a linker error since S390 does not support IOMEM, so add a dependency on HAS_IOMEM. s390-linux-ld: drivers/scsi/ufs/ufshcd-pltfrm.o: in function `ufshcd_pltfrm_init': ufshcd-pltfrm.c:(.text+0x38e): undefined reference to `devm_platform_ioremap_resource' where that devm_ function is inside an #ifdef CONFIG_HAS_IOMEM/#endif block. Link: lore.kernel.org/r/202101031125.ZEFCUiKi-lkp@intel.com Link: https://lore.kernel.org/r/20210106040822.933-1-rdunlap@infradead.org Fixes: 03b1781aa978 ("[SCSI] ufs: Add Platform glue driver for ufshcd") Cc: "James E.J. Bottomley" <jejb@linux.ibm.com> Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: Alim Akhtar <alim.akhtar@samsung.com> Cc: Avri Altman <avri.altman@wdc.com> Cc: linux-scsi@vger.kernel.org Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-11-16scsi: ufs-qcom: Only select QCOM_SCM if SCSI_UFS_CRYPTOEric Biggers1-1/+1
QCOM_SCM is only needed to make the qcom_scm_*() calls in ufs-qcom-ice.c, which is only compiled when SCSI_UFS_CRYPTO=y. So don't unnecessarily enable QCOM_SCM when SCSI_UFS_CRYPTO=n. Link: https://lore.kernel.org/r/20201114004754.235378-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-09-09scsi: ufs: Fix 'unmet direct dependencies' config warningAlim Akhtar1-1/+0
With !CONFIG_OF and SCSI_UFS_EXYNOS selected, the below warning is given: WARNING: unmet direct dependencies detected for PHY_SAMSUNG_UFS Depends on [n]: OF [=n] && (ARCH_EXYNOS || COMPILE_TEST [=y]) Selected by [y]: - SCSI_UFS_EXYNOS [=y] && SCSI_LOWLEVEL [=y] && SCSI [=y] && SCSI_UFSHCD_PLATFORM [=y] && (ARCH_EXYNOS || COMPILE_TEST [=y]) Fix it by removing PHY_SAMSUNG_UFS dependency. Link: https://lore.kernel.org/r/20200721172021.28922-1-alim.akhtar@samsung.com Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-24scsi: ufs-qcom: Add Inline Crypto Engine supportEric Biggers1-0/+1
Add support for Qualcomm Inline Crypto Engine (ICE) to ufs-qcom. The standards-compliant parts, such as querying the crypto capabilities and enabling crypto for individual UFS requests, are already handled by ufshcd-crypto.c, which itself is wired into the blk-crypto framework. However, ICE requires vendor-specific init, enable, and resume logic, and it requires that keys be programmed and evicted by vendor-specific SMC calls. Make the ufs-qcom driver handle these details. I tested this on Dragonboard 845c, which is a publicly available development board that uses the Snapdragon 845 SoC and runs the upstream Linux kernel. This is the same SoC used in the Pixel 3 and Pixel 3 XL phones. This testing included (among other things) verifying that the expected ciphertext was produced, both manually using ext4 encryption and automatically using a block layer self-test I've written. I've also tested that this driver works nearly as-is on the Snapdragon 765 and Snapdragon 865 SoCs. And others have tested it on Snapdragon 850, Snapdragon 855, and Snapdragon 865 (see the Tested-by tags). This is based very loosely on the vendor-provided driver in the kernel source code for the Pixel 3, but I've greatly simplified it. Also, for now I've only included support for major version 3 of ICE, since that's all I have the hardware to test with the mainline kernel. Plus it appears that version 3 is easier to use than older versions of ICE. For now, only allow using AES-256-XTS. The hardware also declares support for AES-128-XTS, AES-{128,256}-ECB, and AES-{128,256}-CBC (BitLocker variant). But none of these others are really useful, and they'd need to be individually tested to be sure they worked properly. This commit also changes the name of the loadable module from "ufs-qcom" to "ufs_qcom", as this is necessary to compile it from multiple source files (unless we were to rename ufs-qcom.c). Link: https://lore.kernel.org/r/20200710072013.177481-6-ebiggers@kernel.org Tested-by: Steev Klimaszewski <steev@kali.org> # Lenovo Yoga C630 Tested-by: Thara Gopinath <thara.gopinath@linaro.org> # db845c, sm8150-mtp, sm8250-mtp Reviewed-by: Avri Altman <avri.altman@wdc.com> Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-07-08scsi: ufs: UFS crypto APISatya Tangirala1-0/+9
Introduce functions to manipulate UFS inline encryption hardware in line with the JEDEC UFSHCI v2.1 specification and to work with the block keyslot manager. The UFS crypto API will assume by default that a vendor driver doesn't support UFS crypto, even if the hardware advertises the capability, because a lot of hardware requires some special handling that's not specified in the aforementioned JEDEC spec. Each vendor driver must explicitly set hba->caps |= UFSHCD_CAP_CRYPTO before ufshcd_hba_init_crypto_capabilities() is called to opt-in to UFS crypto support. Link: https://lore.kernel.org/r/20200706200414.2027450-3-satyat@google.com Reviewed-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Satya Tangirala <satyat@google.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-06-24scsi: ufs: Allow exynos ufs driver to build as moduleAlim Akhtar1-1/+1
Allow Exynos UFS driver to build as a module. This patch fixes the followin build issue reported by kernel build robot. drivers/scsi/ufs/ufs-exynos.o: in function `exynos_ufs_probe': drivers/scsi/ufs/ufs-exynos.c:1231: undefined reference to `ufshcd_pltfrm_init' drivers/scsi/ufs/ufs-exynos.o: in function `exynos_ufs_pre_pwr_mode': drivers/scsi/ufs/ufs-exynos.c:635: undefined reference to `ufshcd_get_pwr_dev_param' drivers/scsi/ufs/ufs-exynos.o:undefined reference to `ufshcd_pltfrm_shutdown' drivers/scsi/ufs/ufs-exynos.o:undefined reference to `ufshcd_pltfrm_suspend' drivers/scsi/ufs/ufs-exynos.o:undefined reference to `ufshcd_pltfrm_resume' drivers/scsi/ufs/ufs-exynos.o:undefined reference to `ufshcd_pltfrm_runtime_suspend' drivers/scsi/ufs/ufs-exynos.o:undefined reference to `ufshcd_pltfrm_runtime_resume' drivers/scsi/ufs/ufs-exynos.o:undefined reference to `ufshcd_pltfrm_runtime_idle' Link: https://lore.kernel.org/r/20200620173232.52521-1-alim.akhtar@samsung.com Fixes: 55f4b1f73631 ("scsi: ufs: ufs-exynos: Add UFS host support for Exynos SoCs") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-06-15scsi: ufs: ufs-exynos: Add UFS host support for Exynos SoCsAlim Akhtar1-0/+12
This patch introduces Exynos UFS host controller driver which mainly handles vendor-specific operations including link startup, power mode change and hibernation/unhibernation. [robot: drivers/scsi/ufs/ufs-exynos.c:931:8-10: WARNING: possible condition with no effect (if == else) ] Link: https://lore.kernel.org/r/20200528011658.71590-10-alim.akhtar@samsung.com Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Tested-by: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com> Reviewed-by: Kiwoong Kim <kwmad.kim@samsung.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Seungwon Jeon <essuuj@gmail.com> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-06-14treewide: replace '---help---' in Kconfig files with 'help'Masahiro Yamada1-6/+6
Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over '---help---'"), the number of '---help---' has been gradually decreasing, but there are still more than 2400 instances. This commit finishes the conversion. While I touched the lines, I also fixed the indentation. There are a variety of indentation styles found. a) 4 spaces + '---help---' b) 7 spaces + '---help---' c) 8 spaces + '---help---' d) 1 space + 1 tab + '---help---' e) 1 tab + '---help---' (correct indentation) f) 1 tab + 1 space + '---help---' g) 1 tab + 2 spaces + '---help---' In order to convert all of them to 1 tab + 'help', I ran the following commend: $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/' Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-03-11scsi: docs: convert ufs.txt to ReSTMauro Carvalho Chehab1-1/+1
Link: https://lore.kernel.org/r/052d45576e342a217185e91a83793b384b1592a4.1583136624.git.mchehab+huawei@kernel.org Acked-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-11-12scsi: ufs: Add driver for TI wrapper for Cadence UFS IPVignesh Raghavendra1-0/+10
TI's J721e SoC has a Cadence UFS IP with a TI specific wrapper. This is a minimal driver to configure the wrapper. It releases the UFS slave device out of reset and sets up registers to indicate PHY reference clock input frequency before probing child Cadence UFS driver. Link: https://lore.kernel.org/r/20191108164857.11466-3-vigneshr@ti.com Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com> Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-05-08Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds1-0/+14
Pull SCSI updates from James Bottomley: "This is mostly update of the usual drivers: qla2xxx, qedf, smartpqi, hpsa, lpfc, ufs, mpt3sas, ibmvfc and hisi_sas. Plus number of minor changes, spelling fixes and other trivia" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (298 commits) scsi: qla2xxx: Avoid that lockdep complains about unsafe locking in tcm_qla2xxx_close_session() scsi: qla2xxx: Avoid that qlt_send_resp_ctio() corrupts memory scsi: qla2xxx: Fix hardirq-unsafe locking scsi: qla2xxx: Complain loudly about reference count underflow scsi: qla2xxx: Use __le64 instead of uint32_t[2] for sending DMA addresses to firmware scsi: qla2xxx: Introduce the dsd32 and dsd64 data structures scsi: qla2xxx: Check the size of firmware data structures at compile time scsi: qla2xxx: Pass little-endian values to the firmware scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands scsi: qla2xxx: Use an on-stack completion in qla24xx_control_vp() scsi: qla2xxx: Make qla24xx_async_abort_cmd() static scsi: qla2xxx: Remove unnecessary locking from the target code scsi: qla2xxx: Remove qla_tgt_cmd.released scsi: qla2xxx: Complain if a command is released that is owned by the firmware scsi: qla2xxx: target: Fix offline port handling and host reset handling scsi: qla2xxx: Fix abort handling in tcm_qla2xxx_write_pending() scsi: qla2xxx: Fix error handling in qlt_alloc_qfull_cmd() scsi: qla2xxx: Simplify qlt_send_term_imm_notif() scsi: qla2xxx: Fix use-after-free issues in qla2xxx_qpair_sp_free_dma() scsi: qla2xxx: Fix a qla24xx_enable_msix() error path ...
2019-04-17scsi: ufs: qcom: Expose the reset controller for PHYEvan Green1-0/+1
Expose a reset controller that the phy will later use to control its own PHY reset in the UFS controller. This will enable the combining of PHY init functionality into a single function. Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
2019-03-19scsi: ufs-mediatek: Add UFS support for Mediatek SoC chipsStanley Chu1-0/+14
This patch adds UFS support for MediaTek SoC chips. Signed-off-by: Stanley Chu <stanley.chu@mediatek.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-01-11scsi: ufs: Remove select of phy-qcom-ufs from ufs-qcomEvan Green1-1/+0
CONFIG_SCSI_UFS_QCOM selects CONFIG_PHY_QCOM_UFS, assuming that this was the only possible PHY driver Qualcomm's UFS controller would use. But in SDM845, the UFS driver is bundled into phy-qcom-qmp, and phy-qcom-ufs is unused. Remove the select, since for SDM845 it adds useless drivers to the build. Signed-off-by: Evan Green <evgreen@chromium.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-09scsi: ufs: Add UFS platform driver for Cadence UFSJanek Kotas1-0/+8
This patch adds a device tree platform driver for Cadence UFS Host Controller. It can be enabled with SCSI_UFS_CDNS_PLATFORM Kconfig option. Signed-off-by: Jan Kotas <jank@cadence.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-10-10scsi: ufs: Add a bsg endpoint that supports UPIUsAvri Altman1-0/+19
For now, just provide an API to allocate and remove ufs-bsg node. We will use this framework to manage ufs devices by sending UPIU transactions. For the time being, implements an empty bsg_request() - will add some more functionality in coming patches. Nonetheless, we reveal here the protocol we are planning to use: UFS Transport Protocol Transactions. UFS transactions consist of packets called UFS Protocol Information Units (UPIU). There are UPIU’s defined for UFS SCSI commands, responses, data in and data out, task management, utility functions, vendor functions, transaction synchronization and control, and more. By using UPIUs, we get access to the most fine-grained internals of this protocol, and able to communicate with the device in ways, that are sometimes beyond the capacity of the ufs driver. Moreover and as a result, our core structure - ufs_bsg_node has a pretty lean structure: using upiu transactions that contains the outmost detailed info, so we don't really need complex constructs to support it. Signed-off-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <Bart.VanAssche@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-07-19scsi: ufs: add Hisilicon ufs driver codeliwei1-0/+9
add Hisilicon ufs driver code. Signed-off-by: Li Wei <liwei213@huawei.com> Signed-off-by: Geng Jianfeng <gengjianfeng@hisilicon.com> Signed-off-by: Zang Leigang <zangleigang@hisilicon.com> Signed-off-by: Yu Jianfeng <steven.yujianfeng@hisilicon.com> Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-09-29scsi: ufs: Kconfig fixJoao Pinto1-1/+1
Currently if we have PCI and UFSHCD configured in the kernel, both SCSI_UFS_DWC_TC_PCI and SCSI_UFSHCD_PCI show up, which is not correct. This patch changes the UFS Kconfig to assure hierarchy between the 2 options. Signed-off-by: Joao Pinto <jpinto@synopsys.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-07-12ufs: add TC G210 pci driverJoao Pinto1-0/+8
This patch adds a glue pci driver for the Synopsys G210 Test Chip. [mkp: Fixed Kconfig depends and module name] Signed-off-by: Joao Pinto <jpinto@synopsys.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-07-12ufs: add TC G210 platform driverJoao Pinto1-0/+8
This patch adds a glue platform driver for the Synopsys G210 Test Chip. Signed-off-by: Joao Pinto <jpinto@synopsys.com> Reviewed-by: Hannes Reinicke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2016-03-18scsi: ufs: select CONFIG_NLSArnd Bergmann1-0/+1
A recent change to ufshcd introduced a call to utf16s_to_utf8s, a function that is provided by the NLS module, so we get a link error when that is not present: drivers/scsi/built-in.o: In function `ufshcd_read_string_desc': :(.text+0x124d0): undefined reference to `utf16s_to_utf8s' This adds a Kconfig 'select' statement to avoid the build error. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: b573d484e4ff ("scsi: ufs: add support to read device and string descriptors") Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-11-09scsi: ufs-qcom: update configuration option of SCSI_UFS_QCOM componentYaniv Gardi1-1/+1
This change is required in order to be able to build the component as a module. Reviewed-by: Akinobu Mita <akinobu.mita@gmail.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2015-05-25ufs-qcom: Switch dependency to ARCH_QCOMStephen Boyd1-1/+1
This device only exists on platforms under ARCH_QCOM, not ARCH_MSM. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Reviewed-by: Yaniv Gardi <ygardi@codeaurora.org> Signed-off-by: James Bottomley <JBottomley@Odin.com>
2015-01-20ufs-qcom: add support for Qualcomm Technologies Inc platformsYaniv Gardi1-0/+13
This change adds support for Qualcomm Technologies Inc platforms that use UFS driver. for example, it adds : - PM specific operations during hibern8, suspend, resume, clock setup - qcom-ufs generic phy driver initialization, calibration, power-on/off sequence, etc. - UFS Controller specific configuration - Rate, Gear, Mode negotiation between device and controller Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org> Reviewed-by: Dov Levenglick <dovl@codeaurora.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
2014-10-01ufs: Add support for clock scaling using devfreq frameworkSahitya Tummala1-0/+2
The clocks for UFS device will be managed by generic DVFS (Dynamic Voltage and Frequency Scaling) framework within kernel. This devfreq framework works with different governors to scale the clocks. By default, UFS devices uses simple_ondemand governor which scales the clocks up if the load is more than upthreshold and scales down if the load is less than downthreshold. Signed-off-by: Sahitya Tummala <stummala@codeaurora.org> Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
2013-06-04[SCSI] ufs: SCSI_UFSHCD should depend on SCSI_DMAGeert Uytterhoeven1-1/+1
If NO_DMA=y: drivers/built-in.o: In function `ufshcd_transfer_req_compl': drivers/scsi/ufs/ufshcd.c:1182: undefined reference to `scsi_dma_unmap' drivers/built-in.o: In function `ufshcd_map_sg': drivers/scsi/ufs/ufshcd.c:377: undefined reference to `scsi_dma_map' drivers/built-in.o: In function `ufshcd_do_reset': drivers/scsi/ufs/ufshcd.c:912: undefined reference to `scsi_dma_unmap' drivers/built-in.o: In function `ufshcd_memory_alloc': drivers/scsi/ufs/ufshcd.c:565: undefined reference to `dma_alloc_coherent' drivers/built-in.o: In function `ufshcd_free_hba_memory': drivers/scsi/ufs/ufshcd.c:185: undefined reference to `dma_free_coherent' drivers/scsi/ufs/ufshcd.c:192: undefined reference to `dma_free_coherent' drivers/scsi/ufs/ufshcd.c:199: undefined reference to `dma_free_coherent' drivers/scsi/ufs/ufshcd.c:185: undefined reference to `dma_free_coherent' drivers/scsi/ufs/ufshcd.c:192: undefined reference to `dma_free_coherent' drivers/built-in.o:drivers/scsi/ufs/ufshcd.c:199: more undefined references to `dma_free_coherent' follow drivers/built-in.o: In function `ufshcd_abort': drivers/scsi/ufs/ufshcd.c:1498: undefined reference to `scsi_dma_unmap' drivers/built-in.o: In function `ufshcd_device_reset': drivers/scsi/ufs/ufshcd.c:1436: undefined reference to `scsi_dma_unmap' Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Santosh Y <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-05-02[SCSI] ufs: Add Platform glue driver for ufshcdVinayak Holikatti1-0/+11
This patch adds Platform glue driver for ufshcd. Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Reviewed-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Tested-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Vinayak Holikatti <vinholikatti@gmail.com> Signed-off-by: Santosh Yaraganavi <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-25[SCSI] ufs: Separate PCI code into glue driverVinayak Holikatti1-3/+23
This patch separates PCI code from ufshcd.c and makes it as a core driver module and adds a new file ufshcd-pci.c as PCI glue driver. [jejb: strip __devinit and devexit_p()] Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Tested-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Vinayak Holikatti <vinholikatti@gmail.com> Signed-off-by: Santosh Yaraganavi <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2013-02-25[SCSI] ufs: Segregate PCI Specific CodeVinayak Holikatti1-30/+20
This patch segregates the PCI specific code in ufshcd.c to make it ready for splitting into core ufs driver and PCI glue driver. Also copyright header modification to remove extra warranty disclaim. Reviewed-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com> Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org> Tested-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Vinayak Holikatti <vinholikatti@gmail.com> Signed-off-by: Santosh Yaraganavi <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
2012-03-27[SCSI] ufshcd: UFS Host controller driverSantosh Yaraganavi1-0/+49
This patch adds support for Universal Flash Storage(UFS) host controllers. The UFS host controller driver includes host controller initialization method. The Initialization process involves following steps: - Initiate UFS Host Controller initialization process by writing to Host controller enable register - Configure UFS Host controller registers with host memory space datastructure offsets. - Unipro link startup procedure - Check for connected device - Configure UFS host controller to process requests - Enable required interrupts - Configure interrupt aggregation [jejb: fix warnings in 32 bit compile] Signed-off-by: Santosh Yaraganavi <santoshsy@gmail.com> Signed-off-by: Vinayak Holikatti <vinholikatti@gmail.com> Reviewed-by: Arnd Bergmann <arnd@linaro.org> Reviewed-by: Vishak G <vishak.g@samsung.com> Reviewed-by: Girish K S <girish.shivananjappa@linaro.org> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>