Re: [PATCH 2/2] scsi: ufs: Fix a deadlock in the error handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/3/21 9:27 AM, Christoph Hellwig wrote:
On Wed, Nov 03, 2021 at 06:45:34AM -0700, Bart Van Assche wrote:
But more importantly: SCSI LLDDs have absolutel no business calling
blk_get_request or blk_mq_alloc_request directly, but as usual UFS is
completely fucked up here.

As explained by Adrian, the UFS protocol uses a single tag space for SCSI
commands and UFS device commands. blk_mq_alloc_request() is used in this
context to allocate a tag only from the shared tag space only. I think using
blk_mq_alloc_request() for that purpose is fine.

The problem is not the shared tag space, the problem is that it is
poking through layers.  IFF we have good use cases for just allocating
a tag (and we don't want to reserve it, which does make sense for many
things like task management) we need a SCSI layer API that returns just
the tag (and preferably also poisons the request in some way).

How about changing the blk_mq_alloc_request() / blk_put_request() calls in
ufshcd_exec_dev_cmd() and __ufshcd_issue_tm_cmd() into
scsi_{get,put}_internal_command() calls once Hannes' patch series that
introduces these functions is upstream? See also "[PATCH 03/18] scsi: add
scsi_{get,put}_internal_cmd() helper"
(https://lore.kernel.org/linux-scsi/20210503150333.130310-4-hare@xxxxxxx/).
See also patch "[PATCH 10/18] scsi: implement reserved command handling"
(https://lore.kernel.org/linux-scsi/20210503150333.130310-11-hare@xxxxxxx/).

Thanks,

Bart.





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux