From: john.p.donnelly@oracle.com
To: Don Brace <don.brace@microchip.com>,
hch@infradead.org, martin.petersen@oracle.com,
jejb@linux.vnet.ibm.com, linux-scsi@vger.kernel.org
Cc: Kevin.Barnett@microchip.com, scott.teel@microchip.com,
Justin.Lindley@microchip.com, scott.benesh@microchip.com,
gerry.morong@microchip.com, mahesh.rajashekhara@microchip.com,
mike.mcgowen@microchip.com, murthy.bhat@microchip.com,
balsundar.p@microchip.com, joseph.szczypek@hpe.com,
jeff@canonical.com, POSWALD@suse.com, mwilck@suse.com,
pmenzel@molgen.mpg.de, linux-kernel@vger.kernel.org
Subject: Re: [smartpqi updates PATCH V2 09/11] smartpqi: fix duplicate device nodes for tape changers
Date: Thu, 30 Sep 2021 13:24:31 -0500 [thread overview]
Message-ID: <30179417-5aef-5055-c6ee-6aca0d5985c3@oracle.com> (raw)
In-Reply-To: <20210928235442.201875-10-don.brace@microchip.com>
On 9/28/21 6:54 PM, Don Brace wrote:
> From: Kevin Barnett <kevin.barnett@microchip.com>
>
> Stop the OS from re-discovering multiple LUNs for
> tape drive and medium changer.
>
> Duplicate device nodes for Ultrium tape drive and
> medium changer are being created.
>
> The Ultrium tape drive is a multi-LUN SCSI target.
> It presents a LUN for the tape drive and a 2nd
> LUN for the medium changer.
> Our controller FW lists both LUNs in the RPL
> results.
>
> As a result, the smartpqi driver exposes both
> devices to the OS. Then the OS does its normal
> device discovery via the SCSI REPORT LUNS command,
> which causes it to re-discover both devices a 2nd time,
> which results in the duplicate device nodes.
>
> Reviewed-by: Scott Benesh <scott.benesh@microchip.com>
> Reviewed-by: Scott Teel <scott.teel@microchip.com>
> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com>
> Signed-off-by: Kevin Barnett <kevin.barnett@microchip.com>
> Signed-off-by: Don Brace <don.brace@microchip.com>
Acked-by: John Donnelly <john.p.donnelly@oracle.com>
> ---
> drivers/scsi/smartpqi/smartpqi.h | 1 +
> drivers/scsi/smartpqi/smartpqi_init.c | 23 +++++++++++++++++++----
> 2 files changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h
> index c439583a4ca5..aac88ac0a0b7 100644
> --- a/drivers/scsi/smartpqi/smartpqi.h
> +++ b/drivers/scsi/smartpqi/smartpqi.h
> @@ -1106,6 +1106,7 @@ struct pqi_scsi_dev {
> u8 keep_device : 1;
> u8 volume_offline : 1;
> u8 rescan : 1;
> + u8 ignore_device : 1;
> bool aio_enabled; /* only valid for physical disks */
> bool in_remove;
> bool device_offline;
> diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
> index c28eb7ea4a24..8be116992cb0 100644
> --- a/drivers/scsi/smartpqi/smartpqi_init.c
> +++ b/drivers/scsi/smartpqi/smartpqi_init.c
> @@ -6297,9 +6297,13 @@ static int pqi_slave_alloc(struct scsi_device *sdev)
> rphy = target_to_rphy(starget);
> device = pqi_find_device_by_sas_rphy(ctrl_info, rphy);
> if (device) {
> - device->target = sdev_id(sdev);
> - device->lun = sdev->lun;
> - device->target_lun_valid = true;
> + if (device->target_lun_valid) {
> + device->ignore_device = true;
> + } else {
> + device->target = sdev_id(sdev);
> + device->lun = sdev->lun;
> + device->target_lun_valid = true;
> + }
> }
> } else {
> device = pqi_find_scsi_dev(ctrl_info, sdev_channel(sdev),
> @@ -6336,14 +6340,25 @@ static int pqi_map_queues(struct Scsi_Host *shost)
> ctrl_info->pci_dev, 0);
> }
>
> +static inline bool pqi_is_tape_changer_device(struct pqi_scsi_dev *device)
> +{
> + return device->devtype == TYPE_TAPE || device->devtype == TYPE_MEDIUM_CHANGER;
> +}
> +
> static int pqi_slave_configure(struct scsi_device *sdev)
> {
> + int rc = 0;
> struct pqi_scsi_dev *device;
>
> device = sdev->hostdata;
> device->devtype = sdev->type;
>
> - return 0;
> + if (pqi_is_tape_changer_device(device) && device->ignore_device) {
> + rc = -ENXIO;
> + device->ignore_device = false;
> + }
> +
> + return rc;
> }
>
> static int pqi_getpciinfo_ioctl(struct pqi_ctrl_info *ctrl_info, void __user *arg)
>
next prev parent reply other threads:[~2021-09-30 18:25 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 23:54 [smartpqi updates PATCH V2 00/11] smartpqi updates Don Brace
2021-09-28 23:54 ` [smartpqi updates PATCH V2 01/11] smartpqi: update device removal management Don Brace
2021-09-30 18:21 ` john.p.donnelly
2021-09-28 23:54 ` [smartpqi updates PATCH V2 02/11] smartpqi: add controller handshake during kdump Don Brace
2021-09-30 18:21 ` john.p.donnelly
2021-09-28 23:54 ` [smartpqi updates PATCH V2 03/11] smartpqi: capture controller reason codes Don Brace
2021-09-30 18:22 ` john.p.donnelly
2021-09-28 23:54 ` [smartpqi updates PATCH V2 04/11] smartpqi: update LUN reset handler Don Brace
2021-09-30 18:22 ` john.p.donnelly
2021-09-28 23:54 ` [smartpqi updates PATCH V2 05/11] smartpqi: add tur check for sanitize operation Don Brace
2021-09-29 7:56 ` Paul Menzel
2021-09-30 18:23 ` john.p.donnelly
2021-09-28 23:54 ` [smartpqi updates PATCH V2 06/11] smartpqi: avoid failing ios for offline devices Don Brace
2021-09-30 18:23 ` john.p.donnelly
2021-09-28 23:54 ` [smartpqi updates PATCH V2 07/11] smartpqi: add extended report physical luns Don Brace
2021-09-30 18:23 ` john.p.donnelly
2021-09-28 23:54 ` [smartpqi updates PATCH V2 08/11] smartpqi: fix boot failure during lun rebuild Don Brace
2021-09-30 18:24 ` john.p.donnelly
2021-09-28 23:54 ` [smartpqi updates PATCH V2 09/11] smartpqi: fix duplicate device nodes for tape changers Don Brace
2021-09-30 18:24 ` john.p.donnelly [this message]
2021-10-01 8:26 ` Paul Menzel
2021-10-05 20:23 ` Don.Brace
2021-10-06 2:37 ` Martin K. Petersen
2021-10-06 14:28 ` Don.Brace
2021-10-07 9:38 ` Paul Menzel
2021-09-28 23:54 ` [smartpqi updates PATCH V2 10/11] smartpqi: add 3252-8i pci id Don Brace
2021-09-30 18:24 ` john.p.donnelly
2021-09-28 23:54 ` [smartpqi updates PATCH V2 11/11] smartpqi: update version to 2.1.12-055 Don Brace
2021-09-30 18:25 ` john.p.donnelly
2021-09-29 9:34 ` [smartpqi updates PATCH V2 00/11] smartpqi updates Paul Menzel
2021-09-29 14:08 ` Don.Brace
2021-09-29 14:12 ` Paul Menzel
2021-10-12 20:35 ` 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=30179417-5aef-5055-c6ee-6aca0d5985c3@oracle.com \
--to=john.p.donnelly@oracle.com \
--cc=Justin.Lindley@microchip.com \
--cc=Kevin.Barnett@microchip.com \
--cc=POSWALD@suse.com \
--cc=balsundar.p@microchip.com \
--cc=don.brace@microchip.com \
--cc=gerry.morong@microchip.com \
--cc=hch@infradead.org \
--cc=jeff@canonical.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=joseph.szczypek@hpe.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mahesh.rajashekhara@microchip.com \
--cc=martin.petersen@oracle.com \
--cc=mike.mcgowen@microchip.com \
--cc=murthy.bhat@microchip.com \
--cc=mwilck@suse.com \
--cc=pmenzel@molgen.mpg.de \
--cc=scott.benesh@microchip.com \
--cc=scott.teel@microchip.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).