From: Xingui Yang <yangxingui@huawei.com>
To: <john.g.garry@oracle.com>, <yanaijie@huawei.com>,
<jejb@linux.ibm.com>, <martin.petersen@oracle.com>,
<damien.lemoal@opensource.wdc.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>, <prime.zeng@hisilicon.com>,
<chenxiang66@hisilicon.com>, <kangfenglong@huawei.com>
Subject: [PATCH v6 1/4] scsi: libsas: Add helper for port add ex_phy
Date: Tue, 12 Mar 2024 14:11:00 +0000 [thread overview]
Message-ID: <20240312141103.31358-2-yangxingui@huawei.com> (raw)
In-Reply-To: <20240312141103.31358-1-yangxingui@huawei.com>
This moves the process of adding ex_phy to a port into a new helper.
Signed-off-by: Xingui Yang <yangxingui@huawei.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
---
drivers/scsi/libsas/sas_expander.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index ee3808bfd534..c8d4aef2f567 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -26,6 +26,13 @@ static int sas_configure_phy(struct domain_device *dev, int phy_id,
u8 *sas_addr, int include);
static int sas_disable_routing(struct domain_device *dev, u8 *sas_addr);
+static void sas_port_add_ex_phy(struct sas_port *port, struct ex_phy *ex_phy)
+{
+ sas_port_add_phy(port, ex_phy->phy);
+ ex_phy->port = port;
+ ex_phy->phy_state = PHY_DEVICE_DISCOVERED;
+}
+
/* ---------- SMP task management ---------- */
/* Give it some long enough timeout. In seconds. */
@@ -867,9 +874,7 @@ static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id)
if (!memcmp(phy->attached_sas_addr, ephy->attached_sas_addr,
SAS_ADDR_SIZE) && ephy->port) {
- sas_port_add_phy(ephy->port, phy->phy);
- phy->port = ephy->port;
- phy->phy_state = PHY_DEVICE_DISCOVERED;
+ sas_port_add_ex_phy(ephy->port, phy);
return true;
}
}
--
2.17.1
next prev parent reply other threads:[~2024-03-12 14:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-12 14:10 [PATCH v6 0/4] scsi: libsas: Fix the failure of adding phy with zero-address to port Xingui Yang
2024-03-12 14:11 ` Xingui Yang [this message]
2024-03-12 14:11 ` [PATCH v6 2/4] scsi: libsas: Move sas_add_parent_port() to sas_expander.c Xingui Yang
2024-03-12 14:11 ` [PATCH v6 3/4] scsi: libsas: Set port when ex_phy is added or deleted Xingui Yang
2024-03-12 14:11 ` [PATCH v6 4/4] scsi: libsas: Fix the failure of adding phy with zero-address to port Xingui Yang
2024-04-20 14:44 ` [PATCH v6 0/4] " Martin K. Petersen
2024-05-07 1:59 ` 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=20240312141103.31358-2-yangxingui@huawei.com \
--to=yangxingui@huawei.com \
--cc=chenxiang66@hisilicon.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=jejb@linux.ibm.com \
--cc=john.g.garry@oracle.com \
--cc=kangfenglong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=martin.petersen@oracle.com \
--cc=prime.zeng@hisilicon.com \
--cc=yanaijie@huawei.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
all inboxes | Powered by JetHome®