scsi: ufs: core: Fix the polling implementation
authorBart Van Assche <bvanassche@acm.org>
Fri, 18 Nov 2022 23:37:03 +0000 (15:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:32:36 +0000 (13:32 +0100)
commit02e0170c4da25c0d887bdea5ba83f9b516d90764
tree97d1b00f21ae825b886f3d859bdddee7247c3346
parent4141cd9e8b3379aea52a85d2c35f6eaf26d14e86
scsi: ufs: core: Fix the polling implementation

[ Upstream commit ee8c88cab4afbd5ee10a127d6cbecd6b200185a5 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ufs/core/ufshcd.c