Commit 7613068f authored by Can Guo's avatar Can Guo Committed by Sandeep Patil
Browse files

BACKPORT: FROMGIT: scsi: ufs: Optimize host lock on transfer requests send/compl paths

Current UFS IRQ handler is completely wrapped by host lock, and because
ufshcd_send_command() is also protected by host lock, when IRQ handler
fires, not only the CPU running the IRQ handler cannot send new requests,
the rest CPUs can neither. Move the host lock wrapping the IRQ handler into
specific branches, i.e., ufshcd_uic_cmd_compl(), ufshcd_check_errors(),
ufshcd_tmc_handler() and ufshcd_transfer_req_compl(). Meanwhile, to further
reduce occpuation of host lock in ufshcd_transfer_req_compl(), host lock is
no longer required to call __ufshcd_transfer_req_compl(). As per test, the
optimization can bring considerable gain to random read/write performance.

Link: https://lore.kernel.org/r/1621845419-14194-3-git-send-email-cang@codeaurora.org


Cc: Stanley Chu <stanley.chu@mediatek.com>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reviewed-by: default avatarBean Huo <beanhuo@micron.com>
Reviewed-by: default avatarStanley Chu <stanley.chu@mediatek.com>
Co-developed-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>

Bug: 190637035
(cherry picked from commit a45f9371
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git

 5.14/scsi-staging)
[Can Guo: Resolved minor conflict in ufshcd.c and squashed with
commit eb783bb8 picked from 5.14/scsi-staging]
Change-Id: I3e842d8bdaec700e11372b2293630bf864ec4929
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
parent bfcb3876
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment