Sathya Prakash
f762326b2b
scsi: mpi3mr: Propagate sense data for admin queue SCSI I/O
...
Copy the sense data to internal driver buffer when the firmware completes
any SCSI I/O command sent through admin queue with sense data for further
use.
Fixes: 506bc1a0d6 ("scsi: mpi3mr: Add support for MPT commands")
Cc: <stable@vger.kernel.org >
Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com >
Signed-off-by: Sumit Saxena <sumit.saxena@broadcom.com >
Link: https://lore.kernel.org/r/20230531184025.3803-1-sumit.saxena@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:29:59 -04:00
Martin K. Petersen
bc5fef0196
Merge patch series "ufs: core: mcq: Add ufshcd_abort() and error handler support in MCQ mode"
...
Bao D. Nguyen <quic_nguyenb@quicinc.com > says:
This patch series enables support for ufshcd_abort() and error handler
in MCQ mode.
Link: https://lore.kernel.org/r/cover.1685396241.git.quic_nguyenb@quicinc.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:19:31 -04:00
Bao D. Nguyen
ab248643d3
scsi: ufs: core: Add error handling for MCQ mode
...
Add support for error handling for MCQ mode.
Suggested-by: Can Guo <quic_cang@quicinc.com >
Co-developed-by: Stanley Chu <stanley.chu@mediatek.com >
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com >
Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com >
Link: https://lore.kernel.org/r/f0d923ee1f009f171a55c258d044e814ec0917ab.1685396241.git.quic_nguyenb@quicinc.com
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com >
Tested-by: Stanley Chu <stanley.chu@mediatek.com >
Reviewed-by: Can Guo <quic_cang@quicinc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:17:08 -04:00
Bao D. Nguyen
57d6ef4601
scsi: ufs: mcq: Use ufshcd_mcq_poll_cqe_lock() in MCQ mode
...
In preparation for adding MCQ error handler support, update the MCQ code to
use the ufshcd_mcq_poll_cqe_lock() in interrupt context instead of using
ufshcd_mcq_poll_cqe_nolock(). This is to keep synchronization between MCQ
interrupt and error handler contexts because both need to access the MCQ
hardware in separate contexts.
Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com >
Link: https://lore.kernel.org/r/6ae727ad2a4040469b8f0632b55e0577d80da11b.1685396241.git.quic_nguyenb@quicinc.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org >
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com >
Tested-by: Stanley Chu <stanley.chu@mediatek.com >
Reviewed-by: Can Guo <quic_cang@quicinc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:17:08 -04:00
Bao D. Nguyen
f1304d4420
scsi: ufs: mcq: Added ufshcd_mcq_abort()
...
Add ufshcd_mcq_abort() to support UFS abort in MCQ mode.
Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com >
Link: https://lore.kernel.org/r/c80c0adadf09ac1d909ed53b36d54737f62c2332.1685396241.git.quic_nguyenb@quicinc.com
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com >
Tested-by: Stanley Chu <stanley.chu@mediatek.com >
Reviewed-by: Can Guo <quic_cang@quicinc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:17:08 -04:00
Bao D. Nguyen
adf4526116
scsi: ufs: mcq: Add support for cleaning up MCQ resources
...
Update ufshcd_clear_cmd() to clean up the MCQ resources similar to the
function ufshcd_utrl_clear() does for SDB mode.
Update ufshcd_try_to_abort_task() to support MCQ mode so that this function
can be invoked in either mcq or SDB mode.
Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com >
Link: https://lore.kernel.org/r/dc6d30b3ee55e2072c162b2c08504ba349b87139.1685396241.git.quic_nguyenb@quicinc.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org >
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com >
Tested-by: Stanley Chu <stanley.chu@mediatek.com >
Reviewed-by: Can Guo <quic_cang@quicinc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:17:08 -04:00
Bao D. Nguyen
8d72903489
scsi: ufs: mcq: Add supporting functions for MCQ abort
...
Add supporting functions to handle UFS abort in MCQ mode.
Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com >
Link: https://lore.kernel.org/r/d452c5ad62dc863cc067ec82daa0885ec98bd508.1685396241.git.quic_nguyenb@quicinc.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org >
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com >
Tested-by: Stanley Chu <stanley.chu@mediatek.com >
Reviewed-by: Can Guo <quic_cang@quicinc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:17:08 -04:00
Bao D. Nguyen
7aa12d2fe8
scsi: ufs: core: Update the ufshcd_clear_cmds() functionality
...
In the ufshcd_clear_cmds(), the 2nd parameter would be the bit mask of the
command to be cleared in the transfer request door bell register. This bit
mask mechanism does not scale well in MCQ mode when the queue depth becomes
much greater than 64. Change the 2nd parameter to the function to be the
task_tag number of the corresponding bit to be cleared in the door bell
register. By doing so, MCQ mode with a large queue depth can reuse this
function.
Since the behavior of this function is changed from handling multiple
commands into a single command, rename ufshcd_clear_cmds() into
ufshcd_clear_cmd().
Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com >
Link: https://lore.kernel.org/r/8411fb5363acc90519bced30ea2c2ac582ff2340.1685396241.git.quic_nguyenb@quicinc.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org >
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com >
Tested-by: Stanley Chu <stanley.chu@mediatek.com >
Reviewed-by: Can Guo <quic_cang@quicinc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:17:08 -04:00
Bao D. Nguyen
a8f9a36e46
scsi: ufs: core: Combine 32-bit command_desc_base_addr_lo/hi
...
The UTP command descriptor base address is a 57-bit field in the UTP
transfer request descriptor. Combine the two 32-bit
command_desc_base_addr_lo/hi fields into a 64-bit for better handling of
this field.
Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com >
Link: https://lore.kernel.org/r/4e6f7f5a15000cdae77c3014b477264f57bf572c.1685396241.git.quic_nguyenb@quicinc.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org >
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com >
Tested-by: Stanley Chu <stanley.chu@mediatek.com >
Reviewed-by: Can Guo <quic_cang@quicinc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:17:07 -04:00
Christophe JAILLET
14ce2c261d
scsi: fnic: Use vzalloc()
...
Use vzalloc() instead of hand writing it with vmalloc()+memset(). This is
less verbose.
This also fixes some style issues :)
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Link: https://lore.kernel.org/r/a1179941a6d440140513e681f4f3a1b92c8d83ae.1685210773.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:07:42 -04:00
Changyuan Lyu
4851c39aae
scsi: pm80xx: Add fatal error checks
...
Add fatal error checking for the pm8001_phy_control() and
pm8001_lu_reset() functions.
Signed-off-by: Changyuan Lyu <changyuanl@google.com >
Signed-off-by: Pranav Prasad <pranavpp@google.com >
Link: https://lore.kernel.org/r/20230526235155.433243-1-pranavpp@google.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 20:06:53 -04:00
Niklas Schnelle
b58b2ba351
scsi: Add HAS_IOPORT dependencies
...
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not
being declared. We thus need to add HAS_IOPORT as dependency for those
drivers using them.
Co-developed-by: Arnd Bergmann <arnd@kernel.org >
Signed-off-by: Arnd Bergmann <arnd@kernel.org >
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com >
Link: https://lore.kernel.org/r/20230522105049.1467313-32-schnelle@linux.ibm.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 19:59:26 -04:00
Niklas Schnelle
c3f903472f
scsi: message: fusion: Add HAS_IOPORT dependencies
...
In a future patch HAS_IOPORT=n will result in inb()/outb() and friends not
being declared. We thus need to add HAS_IOPORT as dependency for those
drivers using them.
Co-developed-by: Arnd Bergmann <arnd@kernel.org >
Signed-off-by: Arnd Bergmann <arnd@kernel.org >
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com >
Link: https://lore.kernel.org/r/20230522105049.1467313-22-schnelle@linux.ibm.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 19:59:26 -04:00
Justin Tee
6e8a669e61
scsi: lpfc: Fix incorrect big endian type assignments in FDMI and VMID paths
...
The kernel test robot reported sparse warnings regarding the improper usage
of beXX_to_cpu() macros.
Change the flagged FDMI and VMID member variables to __beXX and redo the
beXX_to_cpu() macros appropriately.
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230530191405.21580-1-justintee8345@gmail.com
Reported-by: kernel test robot <lkp@intel.com >
Closes: https://lore.kernel.org/oe-kbuild-all/202305261159.lTW5NYrv-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202305260751.NWFvhLY5-lkp@intel.com/
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:17:52 -04:00
Martin K. Petersen
21be4d0344
Merge patch series "lpfc: Update lpfc to revision 14.2.0.13"
...
Justin Tee <justintee8345@gmail.com > says:
Update lpfc to revision 14.2.0.13
This patch set contains discovery bug fixes, firmware logging
improvements, clean up of CQ handling, and statistics collection
enhancements.
The patches were cut against Martin's 6.5/scsi-queue tree.
Link: https://lore.kernel.org/r/20230523183206.7728-1-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:15:07 -04:00
Justin Tee
b93f9eb8f4
scsi: lpfc: Copyright updates for 14.2.0.13 patches
...
Update copyrights to 2023 for files modified in the 14.2.0.13 patch set.
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230523183206.7728-10-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:14:20 -04:00
Justin Tee
48abf8b4b5
scsi: lpfc: Update lpfc version to 14.2.0.13
...
Update lpfc version to 14.2.0.13
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230523183206.7728-9-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:14:20 -04:00
Justin Tee
93190ac1d4
scsi: lpfc: Enhance congestion statistics collection
...
Various improvements are made for collecting congestion statistics:
- Pre-existing logic is replaced with use of an hrtimer for increased
reporting accuracy.
- Congestion timestamp information is reorganized into a single struct.
- Common statistic collection logic is refactored into a helper routine.
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230523183206.7728-8-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:14:20 -04:00
Justin Tee
6a84d01508
scsi: lpfc: Clean up SLI-4 CQE status handling
...
There is mishandling of SLI-4 CQE status values larger than what is allowed
by the LPFC_IOCB_STATUS_MASK of 4 bits. The LPFC_IOCB_STATUS_MASK is a
leftover SLI-3 construct and serves no purpose in SLI-4 path.
Remove the LPFC_IOCB_STATUS_MASK and clean up general CQE status handling
in SLI-4 completion paths.
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230523183206.7728-7-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:14:20 -04:00
Justin Tee
b9951e1cff
scsi: lpfc: Change firmware upgrade logging to KERN_NOTICE instead of TRACE_EVENT
...
A firmware upgrade does not necessitate dumping of phba->dbg_log[] to kmsg
via LOG_TRACE_EVENT. A simple KERN_NOTICE log message should suffice to
notify the user of successful or unsuccessful firmware upgrade. As such,
firmware upgrade log messages are updated to use KERN_NOTICE instead of
LOG_TRACE_EVENT. Additionally, in order to notify the user of reset type
for instantiating newly downloaded firmware, lpfc_log_msg's default
KERN_LEVEL is updated to 5 or KERN_NOTICE.
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230523183206.7728-6-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:14:20 -04:00
Justin Tee
9914a3d033
scsi: lpfc: Revise NPIV ELS unsol rcv cmpl logic to drop ndlp based on nlp_state
...
When NPIV ports are zoned to devices that support both initiator and target
mode, a remote device's initiated PRLI results in unintended final kref
clean up of the device's ndlp structure. This disrupts NPIV ports'
discovery for target devices that support both initiator and target mode.
Modify the NPIV lpfc_drop_node clause such that we allow the ndlp to live
so long as it was in NLP_STE_PLOGI_ISSUE, NLP_STE_REG_LOGIN_ISSUE, or
NLP_STE_PRLI_ISSUE nlp_state. This allows lpfc's issued PRLI completion
routine to determine if the final kref clean up should execute rather than
a remote device's issued PRLI.
Fixes: db651ec225 ("scsi: lpfc: Correct used_rpi count when devloss tmo fires with no recovery")
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230523183206.7728-5-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:14:20 -04:00
Justin Tee
73ded37869
scsi: lpfc: Account for fabric domain ctlr device loss recovery
...
Pre-existing device loss recovery logic via the NLP_IN_RECOV_POST_DEV_LOSS
flag only handled Fabric Port Login, Fabric Controller, Management, and
Name Server addresses.
Fabric domain controllers fall under the same category for usage of the
NLP_IN_RECOV_POST_DEV_LOSS flag. Add a default case statement to mark an
ndlp for device loss recovery.
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230523183206.7728-4-justintee8345@gmail.com
Acked-by: Martin Wilck <mwilck@suse.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:14:20 -04:00
Justin Tee
fd57a687d4
scsi: lpfc: Clear NLP_IN_DEV_LOSS flag if already in rediscovery
...
In dev_loss_tmo callback routine, we early return if the ndlp is in a state
of rediscovery. This occurs when a target proactively PLOGIs or PRLIs
after an RSCN before the dev_loss_tmo callback routine is scheduled to run.
Move clear of the NLP_IN_DEV_LOSS flag before the ndlp state check in such
cases.
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230523183206.7728-3-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:14:20 -04:00
Justin Tee
a4157aaf0f
scsi: lpfc: Fix use-after-free rport memory access in lpfc_register_remote_port()
...
Due to a target port D_ID swap, it is possible for the
lpfc_register_remote_port() routine to touch post mortem fc_rport memory
when trying to access fc_rport->dd_data.
The D_ID swap causes a simultaneous call to lpfc_unregister_remote_port(),
where fc_remote_port_delete() reclaims fc_rport memory.
Remove the fc_rport->dd_data->pnode NULL assignment because the following
line reassigns ndlp->rport with an fc_rport object from
fc_remote_port_add() anyways. The pnode nullification is superfluous.
Signed-off-by: Justin Tee <justin.tee@broadcom.com >
Link: https://lore.kernel.org/r/20230523183206.7728-2-justintee8345@gmail.com
Acked-by: Martin Wilck <mwilck@suse.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:14:19 -04:00
Azeem Shaikh
2516cb8822
scsi: ufs: Replace all non-returning strlcpy() with strscpy()
...
strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated [1]. In an effort
to remove strlcpy() completely [2], replace strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com >
Link: https://lore.kernel.org/r/20230530164131.987213-1-azeemshaikh38@gmail.com
Reviewed-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:06:54 -04:00
Azeem Shaikh
41e5d6f64d
scsi: smartpqi: Replace all non-returning strlcpy() with strscpy()
...
strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated [1]. In an effort
to remove strlcpy() completely [2], replace strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com >
Link: https://lore.kernel.org/r/20230530162321.984035-1-azeemshaikh38@gmail.com
Reviewed-by: Kees Cook <keescook@chromium.org >
Acked-by: Don Brace <don.brace@microchip.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:05:59 -04:00
Azeem Shaikh
af0ce90200
scsi: sym53c8xx: Replace all non-returning strlcpy() with strscpy()
...
strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated [1]. In an effort
to remove strlcpy() completely [2], replace strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com >
Link: https://lore.kernel.org/r/20230530160323.412484-1-azeemshaikh38@gmail.com
Reviewed-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:04:30 -04:00
Azeem Shaikh
dbe37c71d1
scsi: message: fusion: Replace all non-returning strlcpy() with strscpy()
...
strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated [1]. In an effort
to remove strlcpy() completely [2], replace strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com >
Link: https://lore.kernel.org/r/20230530160248.411637-1-azeemshaikh38@gmail.com
Reviewed-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:03:33 -04:00
Azeem Shaikh
4dae0262fb
scsi: libfcoe: Replace all non-returning strlcpy() with strscpy()
...
strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated [1]. In an effort
to remove strlcpy() completely [2], replace strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com >
Link: https://lore.kernel.org/r/20230530155818.368562-1-azeemshaikh38@gmail.com
Reviewed-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 18:00:06 -04:00
Azeem Shaikh
73be26b12d
scsi: lpfc: Replace all non-returning strlcpy() with strscpy()
...
strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated [1]. In an effort
to remove strlcpy() completely [2], replace strlcpy() here with strscpy().
No return values were used, so direct replacement is safe.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89
Signed-off-by: Azeem Shaikh <azeemshaikh38@gmail.com >
Link: https://lore.kernel.org/r/20230530155745.343032-1-azeemshaikh38@gmail.com
Reviewed-by: Justin Tee <justin.tee@broadcom.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 17:59:06 -04:00
Bartosz Golaszewski
8f0c17bf6b
scsi: dt-bindings: ufs: qcom: Add compatible for sa8775p
...
Add the compatible string for the UFS on sa8775p platforms.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org >
Link: https://lore.kernel.org/r/20230411130446.401440-2-brgl@bgdev.pl
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:53:53 -04:00
Avri Altman
23caa33d36
scsi: ufs: core: Do not open code SZ_x
...
Do not open code SZ_x.
Signed-off-by: Avri Altman <avri.altman@wdc.com >
Link: https://lore.kernel.org/r/20230531070009.4593-1-avri.altman@wdc.com
Reviewed-by: Bean Huo <beanhuo@micron.com >
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com >
Reviewed-by: Keoseong Park <keosung.park@samsung.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:49:28 -04:00
Martin K. Petersen
2ef23e4b53
Merge patch series "ufs: Do not requeue while ungating the clock"
...
Bart Van Assche <bvanassche@acm.org > says:
In the traces we recorded while testing zoned storage we noticed that UFS
commands are requeued while the clock is being ungated. Command requeueing
makes it harder than necessary to preserve the command order. Hence this
patch series that modifies the SCSI core and also the UFS driver such that
clock ungating does not trigger command requeueing.
Link: https://lore.kernel.org/r/20230529202640.11883-1-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:45:16 -04:00
Bart Van Assche
078f4f4b34
scsi: ufs: Ungate the clock synchronously
...
Ungating the clock asynchronously causes ufshcd_queuecommand() to return
SCSI_MLQUEUE_HOST_BUSY and hence causes commands to be requeued. This is
suboptimal. Allow ufshcd_queuecommand() to sleep such that clock ungating
does not trigger command requeuing. Remove the ufshcd_scsi_block_requests()
and ufshcd_scsi_unblock_requests() calls because these are no longer
needed. The flush_work(&hba->clk_gating.ungate_work) call is sufficient to
make the SCSI core wait for clock ungating to complete.
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Link: https://lore.kernel.org/r/20230529202640.11883-6-bvanassche@acm.org
Reviewed-by: Bean Huo <beanhuo@micron.com >
Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:44:01 -04:00
Bart Van Assche
4b68b7f9c4
scsi: ufs: Declare ufshcd_{hold,release}() once
...
ufshcd_hold() and ufshcd_release are declared twice: once in
drivers/ufs/core/ufshcd-priv.h and a second time in include/ufs/ufshcd.h.
Remove the declarations from ufshcd-priv.h.
Fixes: dd11376b9f ("scsi: ufs: Split the drivers/scsi/ufs directory")
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Link: https://lore.kernel.org/r/20230529202640.11883-5-bvanassche@acm.org
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com >
Reviewed-by: Keoseong Park <keosung.park@samsung.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:42:46 -04:00
Bart Van Assche
6c03c8e9b7
scsi: ufs: Conditionally enable the BLK_MQ_F_BLOCKING flag
...
Prepare for adding code in ufshcd_queuecommand() that may sleep.
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Link: https://lore.kernel.org/r/20230529202640.11883-4-bvanassche@acm.org
Reviewed-by: Bean Huo <beanhuo@micron.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:42:46 -04:00
Bart Van Assche
b125bb9955
scsi: core: Support setting BLK_MQ_F_BLOCKING
...
Prepare for adding code in ufshcd_queuecommand() that may sleep. This patch
is similar to a patch posted last year by Mike Christie. See also
https://lore.kernel.org/all/20220308003957.123312-2-michael.christie@oracle.com/
Cc: Mike Christie <michael.christie@oracle.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Link: https://lore.kernel.org/r/20230529202640.11883-3-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:42:46 -04:00
Bart Van Assche
c854bcdf5e
scsi: core: Rework scsi_host_block()
...
Make scsi_host_block() easier to read by converting it to the widely used
early-return style. See also commit f983622ae6 ("scsi: core: Avoid
calling synchronize_rcu() for each device in scsi_host_block()").
Reviewed-by: Mike Christie <michael.christie@oracle.com >
Reviewed-by: Ming Lei <ming.lei@redhat.com >
Cc: Ye Bin <yebin10@huawei.com >
Cc: Hannes Reinecke <hare@suse.de >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Link: https://lore.kernel.org/r/20230529202640.11883-2-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:42:46 -04:00
Christophe JAILLET
0e5e41ee3d
scsi: virtio_scsi: Remove a useless function call
...
'inq_result' is known to be NULL. There is no point calling kfree().
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Link: https://lore.kernel.org/r/08740635cdb0f8293e57c557b22e048daae50961.1685345683.git.christophe.jaillet@wanadoo.fr
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com >
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:37:37 -04:00
Damien Le Moal
401f8ef319
scsi: ata: libata-scsi: Fix ata_msense_control kdoc comment
...
Add missing description of the spg argument of ata_msense_control().
Fixes: df60f9c645 ("scsi: ata: libata: Add ATA feature control sub-page translation")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org >
Link: https://lore.kernel.org/r/20230523074701.293502-1-dlemoal@kernel.org
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com >
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:20:49 -04:00
Dan Carpenter
339020091e
scsi: qla2xxx: Fix end of loop test
...
This loop will exit successfully when "found" is false or in the failure
case it times out with "wait_iter" set to -1. The test for timeouts is
impossible as is.
Fixes: b843adde8d ("scsi: qla2xxx: Fix mem access after free")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Link: https://lore.kernel.org/r/cea5a62f-b873-4347-8f8e-c67527ced8d2@kili.mountain
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:19:20 -04:00
Bart Van Assche
8b566edbdb
scsi: core: Only kick the requeue list if necessary
...
Instead of running the request queue of each device associated with a host
every 3 ms (BLK_MQ_RESOURCE_DELAY) while host error handling is in
progress, run the request queue after error handling has finished.
Cc: Christoph Hellwig <hch@lst.de >
Cc: Ming Lei <ming.lei@redhat.com >
Cc: Hannes Reinecke <hare@suse.de >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Mike Christie <michael.christie@oracle.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Link: https://lore.kernel.org/r/20230518193159.1166304-4-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:05:34 -04:00
Bart Van Assche
8bb1c6243c
scsi: core: Trace SCSI sense data
...
If a command fails, SCSI sense data is essential to determine why it
failed. Hence make the sense key, ASC and ASCQ codes available in the
ftrace output.
Cc: Niklas Cassel <niklas.cassel@wdc.com >
Cc: Christoph Hellwig <hch@lst.de >
Cc: Ming Lei <ming.lei@redhat.com >
Cc: Hannes Reinecke <hare@suse.de >
Cc: John Garry <john.g.garry@oracle.com >
Cc: Mike Christie <michael.christie@oracle.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Link: https://lore.kernel.org/r/20230518193159.1166304-3-bvanassche@acm.org
Reviewed-by: Ming Lei <ming.lei@redhat.com >
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:05:34 -04:00
Bart Van Assche
416dace649
scsi: core: Use min() instead of open-coding it
...
Use min() instead of open-coding it in scsi_normalize_sense().
Reviewed-by: Christoph Hellwig <hch@lst.de >
Reviewed-by: Benjamin Block <bblock@linux.ibm.com >
Cc: Douglas Gilbert <dgilbert@interlog.com >
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Link: https://lore.kernel.org/r/20230518193159.1166304-2-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-31 11:05:34 -04:00
Randy Dunlap
f047d1e38b
scsi: docs: sym53c8xx_2: Shorten chapter heading
...
Make the chapter heading concise yet still descriptive.
This makes the subsystem table of contents more readable (IMO).
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Link: https://lore.kernel.org/r/20230518212749.18266-12-rdunlap@infradead.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com >
Cc: "Martin K. Petersen" <martin.petersen@oracle.com >
Cc: linux-scsi@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: linux-doc@vger.kernel.org
Cc: Matthew Wilcox <willy@infradead.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-22 18:36:07 -04:00
Randy Dunlap
7c891fe3db
scsi: docs: ncr53c8xx: Shorten chapter heading
...
Make the chapter heading concise yet still descriptive.
This makes the subsystem table of contents more readable (IMO).
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Link: https://lore.kernel.org/r/20230518212749.18266-11-rdunlap@infradead.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com >
Cc: "Martin K. Petersen" <martin.petersen@oracle.com >
Cc: linux-scsi@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: linux-doc@vger.kernel.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-22 18:36:07 -04:00
Randy Dunlap
0176d3395a
scsi: docs: megaraid: Clarify chapter heading
...
Include "Megaraid" in the chapter heading so that it is clear
what subject the document is about. This improves viewing in the TOC.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Link: https://lore.kernel.org/r/20230518212749.18266-10-rdunlap@infradead.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com >
Cc: "Martin K. Petersen" <martin.petersen@oracle.com >
Cc: linux-scsi@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: linux-doc@vger.kernel.org
Cc: Kashyap Desai <kashyap.desai@broadcom.com >
Cc: Sumit Saxena <sumit.saxena@broadcom.com >
Cc: Shivasharan S <shivasharan.srikanteshwara@broadcom.com >
Cc: megaraidlinux.pdl@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-22 18:36:07 -04:00
Randy Dunlap
b636a0297e
scsi: docs: g_NCR5380: Shorten chapter heading
...
Make the chapter heading be concise yet still descriptive.
This makes the subsystem table of contents more readable (IMO).
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Link: https://lore.kernel.org/r/20230518212749.18266-9-rdunlap@infradead.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com >
Cc: "Martin K. Petersen" <martin.petersen@oracle.com >
Cc: linux-scsi@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: linux-doc@vger.kernel.org
Cc: Finn Thain <fthain@linux-m68k.org >
Cc: Michael Schmitz <schmitzmic@gmail.com >
Acked-by: Finn Thain <fthain@linux-m68k.org >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-22 18:36:07 -04:00
Randy Dunlap
8ebddfeef5
scsi: docs: scsi-generic: Multiple cleanups
...
Make the heading be concise yet still descriptive.
This makes the subsystem table of contents more readable (IMO).
Spell "CDROM" as "CD-ROM".
Capitalize "Linux".
Use https instead of http for URLs.
Drop the Linux Documentation Project URL for the SCSI generic HOWTO
since it hasn't been updated since 2002. Use Doug Gilbert's URL
for it instead.
Drop some outdated documentation & references.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Link: https://lore.kernel.org/r/20230518212749.18266-8-rdunlap@infradead.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com >
Cc: "Martin K. Petersen" <martin.petersen@oracle.com >
Cc: linux-scsi@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: linux-doc@vger.kernel.org
Cc: Doug Gilbert <dgilbert@interlog.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-22 18:36:07 -04:00
Randy Dunlap
66fcd6026c
scsi: docs: scsi_fc_transport: Fix typo in heading
...
Fix the typo "Tansport" to be "Transport".
Update email address for James Smart.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Link: https://lore.kernel.org/r/20230518212749.18266-7-rdunlap@infradead.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com >
Cc: "Martin K. Petersen" <martin.petersen@oracle.com >
Cc: linux-scsi@vger.kernel.org
Cc: Jonathan Corbet <corbet@lwn.net >
Cc: linux-doc@vger.kernel.org
Cc: James Smart <james.smart@broadcom.com >
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com >
2023-05-22 18:36:07 -04:00