[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1666693096-180008-9-git-send-email-john.garry@huawei.com>
Date: Tue, 25 Oct 2022 18:18:02 +0800
From: John Garry <john.garry@...wei.com>
To: <axboe@...nel.dk>, <damien.lemoal@...nsource.wdc.com>,
<jejb@...ux.ibm.com>, <martin.petersen@...cle.com>,
<jinpu.wang@...ud.ionos.com>, <hare@...e.de>, <bvanassche@....org>,
<hch@....de>, <ming.lei@...hat.com>, <niklas.cassel@....com>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-ide@...r.kernel.org>, <linux-scsi@...r.kernel.org>,
<linuxarm@...wei.com>, John Garry <john.garry@...wei.com>
Subject: [PATCH RFC v3 08/22] scsi: scsi_transport_sas: Alloc sdev for expander
Allocate a scsi device for an expander for sending SMP commands on the
expander sdev request queue.
Use channel=1 to not conflict with scsi target devices.
Signed-off-by: John Garry <john.garry@...wei.com>
---
drivers/scsi/scsi_transport_sas.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 2f88c61216ee..da075dfc7cd0 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -1548,6 +1548,11 @@ int sas_rphy_add(struct sas_rphy *rphy)
scsi_scan_target(&rphy->dev, 0, rphy->scsi_target_id, lun,
SCSI_SCAN_INITIAL);
+ } else if (identify->device_type == SAS_EDGE_EXPANDER_DEVICE ||
+ identify->device_type == SAS_FANOUT_EXPANDER_DEVICE) {
+
+ if (!scsi_get_dev(&rphy->dev, 1, rphy->scsi_target_id, 0))
+ return -ENODEV;
}
return 0;
@@ -1627,6 +1632,7 @@ sas_rphy_remove(struct sas_rphy *rphy)
case SAS_EDGE_EXPANDER_DEVICE:
case SAS_FANOUT_EXPANDER_DEVICE:
sas_remove_children(dev);
+ scsi_remove_target(dev);
break;
default:
break;
--
2.35.3
Powered by blists - more mailing lists