linux/drivers/ufs/core
Adrian Hunter a2b32bc1d9 scsi: ufs: core: Fix invalid probe error return value
After DME Link Startup, the error return value is set to the MIPI UniPro
GenericErrorCode which can be 0 (SUCCESS) or 1 (FAILURE).  Upon failure
during driver probe, the error code 1 is propagated back to the driver
probe function which must return a negative value to indicate an error,
but 1 is not negative, so the probe is considered to be successful even
though it failed.  Subsequently, removing the driver results in an oops
because it is not in a valid state.

This happens because none of the callers of ufshcd_init() expect a
non-negative error code.

Fix the return value and documentation to match actual usage.

Fixes: 69f5eb78d4 ("scsi: ufs: core: Move the ufshcd_device_init(hba, true) call")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251024085918.31825-5-adrian.hunter@intel.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2025-10-29 23:20:19 -04:00
..
Kconfig scsi: ufs: core: Remove HPB support 2023-07-23 16:40:39 -04:00
Makefile scsi: ufs: core: Remove HPB support 2023-07-23 16:40:39 -04:00
ufs-debugfs.c
ufs-debugfs.h
ufs-fault-injection.c fault-inject: improve build for CONFIG_FAULT_INJECTION=n 2024-09-01 20:43:33 -07:00
ufs-fault-injection.h scsi: ufs: core: Make fault injection dynamically configurable per HBA 2023-11-24 19:23:35 -05:00
ufs-hwmon.c scsi: ufs: Rename a function argument 2023-07-31 15:17:50 -04:00
ufs-mcq.c SCSI misc on 20251002 2025-10-03 19:17:48 -07:00
ufs-sysfs.c scsi: ufs: core: Revert "Make HID attributes visible" 2025-10-29 23:12:33 -04:00
ufs-sysfs.h scsi: ufs: core: Revert "Make HID attributes visible" 2025-10-29 23:12:33 -04:00
ufs_bsg.c scsi: ufs: core: bsg: Fix crash when arpmb command fails 2025-02-20 22:18:24 -05:00
ufs_bsg.h
ufs_trace.h scsi: ufs: core: Move the tracing enumeration types into a new file 2025-08-30 21:49:48 -04:00
ufs_trace_types.h scsi: ufs: core: Move the tracing enumeration types into a new file 2025-08-30 21:49:48 -04:00
ufshcd-crypto.c blk-crypto: add basic hardware-wrapped key support 2025-02-10 09:54:19 -07:00
ufshcd-crypto.h scsi: ufs: core: Add UFSHCD_QUIRK_KEYS_IN_PRDT 2024-07-10 22:32:30 -04:00
ufshcd-priv.h scsi: ufs: core: Add device level exception support 2025-04-03 10:54:31 -04:00
ufshcd.c scsi: ufs: core: Fix invalid probe error return value 2025-10-29 23:20:19 -04:00