All of lore.kernel.org
 help / color / mirror / Atom feed
From: michael.christie@oracle.com
To: Christoph Hellwig <hch@lst.de>
Cc: john.g.garry@oracle.com, bvanassche@acm.org, mwilck@suse.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	james.bottomley@hansenpartnership.com
Subject: Re: [PATCH v3 12/15] scsi: virtio_scsi: Convert to scsi_execute_cmd
Date: Fri, 23 Dec 2022 12:43:25 -0600	[thread overview]
Message-ID: <58558cf2-5e2e-4c4c-36d4-461b37f3f563@oracle.com> (raw)
In-Reply-To: <20221223155727.GA30763@lst.de>

On 12/23/22 9:57 AM, Christoph Hellwig wrote:
> On Sun, Dec 18, 2022 at 03:40:48PM -0600, Mike Christie wrote:
>> It looks like a hack around scsi_scan_host not removing devices.
>> Going forward, it looks like we can remove the inquiry code by having
>> scsi_scan_host be able to remove devices that are no longer returned.
> 
> Yes, that's the place to do it.  I can see arguments for and against
> that, but doing it from and LLDD (and including sd.h in the LLDD
> implementation!) just doesn't make sense.
> 
>> I was thinking to handle the DID_BAD_TARGET use case above and this type
>> of issue:
>>
>> https://lore.kernel.org/linux-scsi/CA+PODjqrRzyJnOKoabMOV4EPByNnL1LgTi+QAKENP3NwUq5YCw@mail.gmail.com/
>>
>> maybe we want to have a driver level BLIST like:
> 
> Maybe instead of a blist we just need better way to communicate
> this rather than abusing DID_BAD_TARGET?

Yeah, after I sent the blist email I looked into qemu and the DID_BAD_TARGET uses
more and we can do more what you are thinking.

I'm going to do:

0. qemu only uses VIRTIO_SCSI_S_BAD_TARGET (this gets converted to DID_BAD_TARGET)
when the device does not exist, or if you are using a sg device and it returns
DID_BAD_TARGET.

1. Most driver uses of DID_BAD_TARGET are when the device is missing, disconnected,
timedout, or the bus:target_id:LUN value was not supported by the driver. So I was going
to rename DID_BAD_TARGET to DID_INVALID_DEVICE/DID_DEVICE_INACCESSIBLE for those cases.

2. Create a new DID_ error code for the other use cases where the driver meant that the
target did something incorrect/invalid like send a invalid response.

In the scan code then we know if we got a DID_INVALID_DEVICE the device is not there
anymore so we can remove it.

  reply	other threads:[~2022-12-23 18:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-14 23:49 [PATCH v3 00/15] scsi: Add struct for args to execution functions Mike Christie
2022-12-14 23:49 ` [PATCH v3 01/15] " Mike Christie
2022-12-15  1:13   ` Bart Van Assche
2022-12-15  8:13   ` Christoph Hellwig
2022-12-15  9:59   ` John Garry
2022-12-14 23:49 ` [PATCH v3 02/15] ata: libata-scsi: Convert to scsi_execute_cmd Mike Christie
2022-12-14 23:49 ` [PATCH v3 03/15] hwmon: drivetemp: " Mike Christie
2022-12-14 23:49 ` [PATCH v3 04/15] scsi: ch: " Mike Christie
2022-12-14 23:49 ` [PATCH v3 05/15] scsi: scsi_dh: " Mike Christie
2022-12-14 23:49 ` [PATCH v3 06/15] scsi: core: " Mike Christie
2022-12-15  8:14   ` Christoph Hellwig
2022-12-14 23:49 ` [PATCH v3 07/15] scsi: spi: " Mike Christie
2022-12-14 23:49 ` [PATCH v3 08/15] scsi: sd: " Mike Christie
2022-12-15  8:14   ` Christoph Hellwig
2022-12-14 23:49 ` [PATCH v3 09/15] scsi: zbc: " Mike Christie
2022-12-15  8:14   ` Christoph Hellwig
2022-12-14 23:49 ` [PATCH v3 10/15] scsi: ses: " Mike Christie
2022-12-14 23:49 ` [PATCH v3 11/15] scsi: sr: " Mike Christie
2022-12-15  8:14   ` Christoph Hellwig
2022-12-14 23:49 ` [PATCH v3 12/15] scsi: virtio_scsi: " Mike Christie
2022-12-15  8:15   ` Christoph Hellwig
2022-12-18 21:40     ` Mike Christie
2022-12-23 15:57       ` Christoph Hellwig
2022-12-23 18:43         ` michael.christie [this message]
2022-12-14 23:49 ` [PATCH v3 13/15] scsi: target_core_pscsi: " Mike Christie
2022-12-14 23:50 ` [PATCH v3 14/15] scsi: cxlflash: " Mike Christie
2022-12-14 23:50 ` [PATCH v3 15/15] scsi: Remove scsi_execute_req/scsi_execute functions Mike Christie
2022-12-15  8:13   ` Christoph Hellwig

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=58558cf2-5e2e-4c4c-36d4-461b37f3f563@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=john.g.garry@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mwilck@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.