linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Christoph Hellwig <hch@lst.de>
Cc: <axboe@kernel.dk>, <damien.lemoal@opensource.wdc.com>,
	<bvanassche@acm.org>, <jejb@linux.ibm.com>,
	<martin.petersen@oracle.com>, <ming.lei@redhat.com>,
	<hare@suse.de>, <chenxiang66@hisilicon.com>,
	<linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-ide@vger.kernel.org>, <linux-scsi@vger.kernel.org>,
	<dm-devel@redhat.com>, <beanhuo@micron.com>
Subject: Re: [PATCH 03/11] libata: Send internal commands through the block layer
Date: Thu, 7 Apr 2022 15:32:07 +0100	[thread overview]
Message-ID: <3e1914a8-5f6b-8fcf-7fb3-2d1edb9766e1@huawei.com> (raw)
In-Reply-To: <20220322112057.GC29270@lst.de>

On 22/03/2022 11:20, Christoph Hellwig wrote:
> On Tue, Mar 22, 2022 at 06:39:37PM +0800, John Garry wrote:
>> When SCSI HBA device drivers are required to process an ATA internal
>> command they still need a tag for the IO. This often requires the driver
>> to set aside a set of tags for these sorts of IOs and manage the tags
>> themselves.
>>
>> If we associate a SCSI command (and request) with an ATA internal command
>> then the tag is already provided, so introduce the change to send ATA
>> internal commands through the block layer with a set of custom blk-mq ops.
>>
>> note: I think that the timeout handling needs to be fixed up.

Hi Christoph,

> Any reason to not just send them through an ATA_16 passthrough CDB and
> just use all the normal SCSI command handling?

I had a go at implementing this but I have come up against a few issues:

- ATA_16 handling translates the passthrough CDB to a ATA TF. However 
ata_exec_internal_sg() is passed a TF already. So what to do? Change the 
callers to generate a ATA_16 CDB? I guess not. Otherwise we could put 
the already-generated TF in the SCSI cmd CDB somehow and use directly.

- We may have no SCSI device (yet) for the target when issuing an 
internal command, but only the ATA port+dev. So need a method to pass 
these pointers to ATA_16 handling

- we would need to change ata_scsi_translate(), ata_scsi_pass_thru() and 
other friends to deal with ATA_TAG_INTERNAL and its peculiarities - 
today it just deals with regular qc's.

It still does seem a reasonable idea to use ATA_16, but it looks like 
significant modifications would be required....

Thanks,
John

  parent reply	other threads:[~2022-04-07 14:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 10:39 [PATCH RFC 00/11] blk-mq/libata/scsi: SCSI driver tagging improvements John Garry
2022-03-22 10:39 ` [PATCH 01/11] blk-mq: Add blk_mq_init_queue_ops() John Garry
2022-03-22 11:18   ` Christoph Hellwig
2022-03-22 11:33     ` John Garry
2022-03-22 12:16       ` Hannes Reinecke
2022-03-22 12:30         ` John Garry
2022-03-22 14:03           ` Hannes Reinecke
2022-03-22 15:17             ` John Garry
2022-03-22 15:31               ` Hannes Reinecke
2022-03-23  2:57   ` Bart Van Assche
2022-03-23  9:01     ` John Garry
2022-03-22 10:39 ` [PATCH 02/11] scsi: core: Add SUBMITTED_BY_SCSI_CUSTOM_OPS John Garry
2022-03-22 11:20   ` Christoph Hellwig
2022-03-22 10:39 ` [PATCH 03/11] libata: Send internal commands through the block layer John Garry
2022-03-22 11:20   ` Christoph Hellwig
2022-03-22 11:36     ` John Garry
2022-04-07 14:32     ` John Garry [this message]
2022-03-22 10:39 ` [PATCH 04/11] scsi: libsas: Send SMP " John Garry
2022-03-22 11:23   ` Christoph Hellwig
2022-03-22 14:37     ` John Garry
2022-03-22 10:39 ` [PATCH 05/11] scsi: libsas: Send TMF " John Garry
2022-03-22 10:39 ` [PATCH 06/11] scsi: core: Add scsi_alloc_request_hwq() John Garry
2022-03-22 10:39 ` [PATCH 07/11] scsi: libsas: Send internal abort commands through the block layer John Garry
2022-03-22 10:39 ` [PATCH 08/11] scsi: libsas: Change ATA support to deal with each qc having a SCSI command John Garry
2022-03-22 10:39 ` [PATCH 09/11] scsi: libsas: Add sas_task_to_unique_tag() John Garry
2022-03-22 10:39 ` [PATCH 10/11] scsi: libsas: Add sas_task_to_hwq() John Garry
2022-03-22 10:39 ` [PATCH 11/11] scsi: hisi_sas: Remove private tag management John Garry
2022-03-22 11:30 ` [PATCH RFC 00/11] blk-mq/libata/scsi: SCSI driver tagging improvements Hannes Reinecke
2022-03-22 12:17   ` John Garry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e1914a8-5f6b-8fcf-7fb3-2d1edb9766e1@huawei.com \
    --to=john.garry@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=chenxiang66@hisilicon.com \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).