OSDN Git Service

scsi: ufs: core: Fix the polling implementation
authorBart Van Assche <bvanassche@acm.org>
Fri, 18 Nov 2022 23:37:03 +0000 (15:37 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 26 Nov 2022 02:31:10 +0000 (02:31 +0000)
commitee8c88cab4afbd5ee10a127d6cbecd6b200185a5
treef6f27b3b5dd8e6dbe3351d4df556929b5d50a70d
parent4d450cf2b00d34b53f52d93216dd23af57bdca73
scsi: ufs: core: Fix the polling implementation

Fix the following issues in ufshcd_poll():

 - If polling succeeds, return a positive value.

 - Do not complete polling requests from interrupt context because the
   block layer expects these requests to be completed from thread
   context. From block/bio.c:

     If REQ_ALLOC_CACHE is set, the final put of the bio MUST be done from
     process context, not hard/soft IRQ.

Fixes: eaab9b573054 ("scsi: ufs: Implement polling support")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221118233717.441298-1-bvanassche@acm.org
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c