linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC v2 00/18] blk-mq/libata/scsi: SCSI driver tagging improvements
@ 2022-06-09 10:29 John Garry
  2022-06-09 10:29 ` [PATCH RFC v2 01/18] blk-mq: Add a flag for reserved requests John Garry
                   ` (17 more replies)
  0 siblings, 18 replies; 60+ messages in thread
From: John Garry @ 2022-06-09 10:29 UTC (permalink / raw)
  To: axboe, damien.lemoal, jejb, martin.petersen, brking, hare, hch
  Cc: linux-block, linux-ide, linux-kernel, linux-scsi, chenxiang66,
	John Garry

Currently SCSI low-level drivers are required to manage tags for commands
which do not come via the block layer - libata internal commands would be
an example of one of these. We want to make blk-mq manage these tags also.

There was some work to provide "reserved commands" support in such series
as https://lore.kernel.org/linux-scsi/20211125151048.103910-1-hare@suse.de/

This was based on allocating a request for the lifetime of the "internal"
command.

This series tries to solve that problem by not just allocating the request
but also sending it as a request through the block layer. Reasons to do
this:
- Normal flow of a request and also commonality for regular scsi command
  lifetime
- We don't leave request and scsi_cmnd fields dangling as when we just
  allocate and free the request for the lifetime of the "internal" command
- For poll mode support we can only poll in block layer, so could not send
  internal commands on poll mode queues if we did not do this, which is a
  problem
- Can get rid of duplicated code like libsas internal command timeout
  handling

Based on v5.19-rc1

Please consider as an PoC for now. I have broken builds, bisectablility,
and functionality for a lot of libsas drivers, like pm8001. Indeed, 
10/18 onwards need a lot of work...

Testing:
QEMU with AHCI with disk and cdrom attached and hisi_sas v2 both boot.

v1 was sent here:
https://lore.kernel.org/linux-scsi/1647945585-197349-1-git-send-email-john.garry@huawei.com/

Hannes Reinecke (1):
  scsi: core: Implement reserved command handling

John Garry (17):
  blk-mq: Add a flag for reserved requests
  scsi: core: Resurrect scsi_{get,free}_host_dev()
  scsi: core: Add support to send reserved commands
  scsi: core: Allocate SCSI host sdev when required
  libata-scsi: Add ata_scsi_queue_internal()
  libata-scsi: Add ata_internal_queuecommand()
  libata: Queue ATA internal commands as requests
  scsi: ipr: Support reserved commands
  libata/scsi: libsas: Add sas_queuecommand_internal()
  scsi: libsas: Don't attempt to find scsi host rphy in slave alloc
  scsi: libsas drivers: Prepare for reserved commands
  scsi: libsas: Allocate SCSI commands for tasks
  scsi: libsas: Queue SMP commands as requests
  scsi: libsas: Queue TMF commands as requests
  scsi: core: Add scsi_alloc_request_hwq()
  scsi: libsas: Queue internal abort commands as requests
  scsi: libsas drivers: Remove private tag management

 block/blk-mq.c                         |   6 +
 drivers/ata/libata-core.c              | 145 +++++++++++++++----------
 drivers/ata/libata-sata.c              |   5 +-
 drivers/ata/libata-scsi.c              |  61 ++++++++++-
 drivers/ata/libata.h                   |   4 -
 drivers/scsi/hisi_sas/hisi_sas_main.c  |  93 ++++------------
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c |   6 +-
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c |   3 +-
 drivers/scsi/hosts.c                   |  14 +++
 drivers/scsi/ipr.c                     |  17 ++-
 drivers/scsi/libsas/sas_ata.c          |  22 ++--
 drivers/scsi/libsas/sas_expander.c     |  24 ++--
 drivers/scsi/libsas/sas_init.c         |  74 ++++++++-----
 drivers/scsi/libsas/sas_internal.h     |   6 +
 drivers/scsi/libsas/sas_scsi_host.c    | 121 +++++++++++++++------
 drivers/scsi/scsi_lib.c                |  50 ++++++++-
 drivers/scsi/scsi_scan.c               |  57 ++++++++++
 include/linux/blk-mq.h                 |   6 +
 include/linux/libata.h                 |  13 ++-
 include/scsi/libsas.h                  |  57 +++++++++-
 include/scsi/scsi_cmnd.h               |   8 ++
 include/scsi/scsi_host.h               |  34 +++++-
 22 files changed, 597 insertions(+), 229 deletions(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2022-06-20 11:56 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 10:29 [PATCH RFC v2 00/18] blk-mq/libata/scsi: SCSI driver tagging improvements John Garry
2022-06-09 10:29 ` [PATCH RFC v2 01/18] blk-mq: Add a flag for reserved requests John Garry
2022-06-14  6:43   ` Christoph Hellwig
2022-06-14  9:29     ` John Garry
2022-06-14 18:00   ` Bart Van Assche
2022-06-14 18:30     ` John Garry
2022-06-09 10:29 ` [PATCH RFC v2 02/18] scsi: core: Resurrect scsi_{get,free}_host_dev() John Garry
2022-06-14  6:44   ` Christoph Hellwig
2022-06-14  9:33     ` John Garry
2022-06-14 19:33   ` Bart Van Assche
2022-06-15 13:44     ` John Garry
2022-06-09 10:29 ` [PATCH RFC v2 03/18] scsi: core: Implement reserved command handling John Garry
2022-06-13  7:01   ` Damien Le Moal
2022-06-13  8:25     ` John Garry
2022-06-13  9:06       ` Damien Le Moal
2022-06-13  9:34         ` John Garry
2022-06-13  9:43           ` Damien Le Moal
2022-06-13 10:05             ` John Garry
2022-06-20  6:45         ` Hannes Reinecke
2022-06-20  7:06           ` Damien Le Moal
2022-06-14 18:20     ` Bart Van Assche
2022-06-14 23:43       ` Damien Le Moal
2022-06-15  7:35         ` John Garry
2022-06-16  2:47           ` Damien Le Moal
2022-06-16  8:24             ` John Garry
2022-06-16  8:41               ` Damien Le Moal
2022-06-20  8:27                 ` Hannes Reinecke
2022-06-20  9:02                   ` Damien Le Moal
2022-06-20  9:05                     ` Christoph Hellwig
2022-06-20 11:24                       ` Damien Le Moal
2022-06-20 11:56                         ` Hannes Reinecke
2022-06-20  8:02           ` Hannes Reinecke
2022-06-20  6:24     ` Hannes Reinecke
2022-06-20  6:28       ` Christoph Hellwig
2022-06-20  7:03         ` Hannes Reinecke
2022-06-20  7:14           ` Damien Le Moal
2022-06-09 10:29 ` [PATCH RFC v2 04/18] scsi: core: Add support to send reserved commands John Garry
2022-06-13  7:03   ` Damien Le Moal
2022-06-13  9:40     ` John Garry
2022-06-13  9:41       ` Damien Le Moal
2022-06-09 10:29 ` [PATCH RFC v2 05/18] scsi: core: Allocate SCSI host sdev when required John Garry
2022-06-09 10:29 ` [PATCH RFC v2 06/18] libata-scsi: Add ata_scsi_queue_internal() John Garry
2022-06-13  7:12   ` Damien Le Moal
2022-06-13  9:41     ` John Garry
2022-06-09 10:29 ` [PATCH RFC v2 07/18] libata-scsi: Add ata_internal_queuecommand() John Garry
2022-06-13  7:16   ` Damien Le Moal
2022-06-13  9:44     ` John Garry
2022-06-09 10:29 ` [PATCH RFC v2 08/18] libata: Queue ATA internal commands as requests John Garry
2022-06-13  7:22   ` Damien Le Moal
2022-06-13  8:13     ` John Garry
2022-06-09 10:29 ` [PATCH RFC v2 09/18] scsi: ipr: Support reserved commands John Garry
2022-06-09 10:29 ` [PATCH RFC v2 10/18] libata/scsi: libsas: Add sas_queuecommand_internal() John Garry
2022-06-09 10:29 ` [PATCH RFC v2 11/18] scsi: libsas: Don't attempt to find scsi host rphy in slave alloc John Garry
2022-06-09 10:29 ` [PATCH RFC v2 12/18] scsi: libsas drivers: Prepare for reserved commands John Garry
2022-06-09 10:29 ` [PATCH RFC v2 13/18] scsi: libsas: Allocate SCSI commands for tasks John Garry
2022-06-09 10:29 ` [PATCH RFC v2 14/18] scsi: libsas: Queue SMP commands as requests John Garry
2022-06-09 10:29 ` [PATCH RFC v2 15/18] scsi: libsas: Queue TMF " John Garry
2022-06-09 10:29 ` [PATCH RFC v2 16/18] scsi: core: Add scsi_alloc_request_hwq() John Garry
2022-06-09 10:29 ` [PATCH RFC v2 17/18] scsi: libsas: Queue internal abort commands as requests John Garry
2022-06-09 10:29 ` [PATCH RFC v2 18/18] scsi: libsas drivers: Remove private tag management John Garry

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).