Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Brian Bunker <brian@purestorage.com>, linux-scsi@vger.kernel.org
Cc: James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, bvanassche@acm.org,
	krishna.kant@purestorage.com
Subject: Re: [PATCH v5 3/5] scsi: core: Refactor scsi_add_lun() to use scsi_update_inquiry_data()
Date: Fri, 19 Jun 2026 08:00:30 +0200	[thread overview]
Message-ID: <94839d90-805d-413c-890f-bcbdff89af8e@suse.de> (raw)
In-Reply-To: <20260618233508.97960-4-brian@purestorage.com>

On 6/19/26 01:35, Brian Bunker wrote:
> Refactor scsi_add_lun() to use the new scsi_update_inquiry_data()
> function instead of inline INQUIRY parsing code. This consolidates
> INQUIRY data handling in one place and ensures consistent behavior
> between initial device setup and device rescan operations.
> 
> The following fields are now set by scsi_update_inquiry_data():
> - inquiry buffer, vendor, model, rev pointers
> - type, removable, lockable
> - inq_periph_qual
> - soft_reset, ppr, wdtr, sdtr
> - tagged_supported, simple_tags
> - is_ata, allow_restart
> 
> Also update scsi_probe_lun() to compute scsi_level into a local
> variable rather than writing directly to sdev->scsi_level.
> scsi_update_inquiry_data() is now the authoritative setter of
> sdev->scsi_level under inquiry_mutex; scsi_probe_lun() needs the
> level early for lun_in_cdb and sdev_target->scsi_level before
> scsi_update_inquiry_data() is called.
> 
> scsi_add_lun() is only ever called for freshly allocated sdev instances
> where sdev->inquiry is NULL, so the redundant !sdev->inquiry guard is
> dropped along with the now-unreachable sanity check that followed it.
> 
> This patch maintains identical behavior to the previous code.
> scsi_add_lun() continues to handle the remaining BLIST flags and
> device-specific setup that doesn't come directly from INQUIRY data.
> 
> Co-developed-by: Krishna Kant <krishna.kant@purestorage.com>
> Signed-off-by: Krishna Kant <krishna.kant@purestorage.com>
> Signed-off-by: Brian Bunker <brian@purestorage.com>
> ---
>   drivers/scsi/scsi_scan.c | 127 +++++++++------------------------------
>   1 file changed, 29 insertions(+), 98 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@kernel.org>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich

  reply	other threads:[~2026-06-19  6:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 23:34 [PATCH v5 0/5] scsi: Refresh INQUIRY data and reprobe on rescan Brian Bunker
2026-06-18 23:35 ` [PATCH v5 1/5] scsi: core: Protect INQUIRY sysfs attributes with mutex Brian Bunker
2026-06-18 23:35 ` [PATCH v5 2/5] scsi: core: Add scsi_update_inquiry_data() for updating INQUIRY data Brian Bunker
2026-06-18 23:35 ` [PATCH v5 3/5] scsi: core: Refactor scsi_add_lun() to use scsi_update_inquiry_data() Brian Bunker
2026-06-19  6:00   ` Hannes Reinecke [this message]
2026-06-18 23:35 ` [PATCH v5 4/5] scsi: core: Add device reprobe support to scsi_rescan_device() Brian Bunker
2026-06-19  6:01   ` Hannes Reinecke
2026-06-18 23:35 ` [PATCH v5 5/5] scsi: core: Handle reprobe for existing devices during SCSI scan Brian Bunker
2026-06-19  6:01   ` Hannes Reinecke
2026-07-12 21:31 ` [PATCH v5 0/5] scsi: Refresh INQUIRY data and reprobe on rescan Martin K. Petersen

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=94839d90-805d-413c-890f-bcbdff89af8e@suse.de \
    --to=hare@suse.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=brian@purestorage.com \
    --cc=bvanassche@acm.org \
    --cc=krishna.kant@purestorage.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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