@@ -33,6 +33,21 @@ static void sas_port_add_ex_phy(struct sas_port *port, struct ex_phy *ex_phy)
33
33
ex_phy -> phy_state = PHY_DEVICE_DISCOVERED ;
34
34
}
35
35
36
+ static void sas_ex_add_parent_port (struct domain_device * dev , int phy_id )
37
+ {
38
+ struct expander_device * ex = & dev -> ex_dev ;
39
+ struct ex_phy * ex_phy = & ex -> ex_phy [phy_id ];
40
+
41
+ if (!ex -> parent_port ) {
42
+ ex -> parent_port = sas_port_alloc (& dev -> rphy -> dev , phy_id );
43
+ /* FIXME: error handling */
44
+ BUG_ON (!ex -> parent_port );
45
+ BUG_ON (sas_port_add (ex -> parent_port ));
46
+ sas_port_mark_backlink (ex -> parent_port );
47
+ }
48
+ sas_port_add_phy (ex -> parent_port , ex_phy -> phy );
49
+ }
50
+
36
51
/* ---------- SMP task management ---------- */
37
52
38
53
/* Give it some long enough timeout. In seconds. */
@@ -968,11 +983,11 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
968
983
969
984
/* Parent and domain coherency */
970
985
if (!dev -> parent && sas_phy_match_port_addr (dev -> port , ex_phy )) {
971
- sas_add_parent_port (dev , phy_id );
986
+ sas_ex_add_parent_port (dev , phy_id );
972
987
return 0 ;
973
988
}
974
989
if (dev -> parent && sas_phy_match_dev_addr (dev -> parent , ex_phy )) {
975
- sas_add_parent_port (dev , phy_id );
990
+ sas_ex_add_parent_port (dev , phy_id );
976
991
if (ex_phy -> routing_attr == TABLE_ROUTING )
977
992
sas_configure_phy (dev , phy_id , dev -> port -> sas_addr , 1 );
978
993
return 0 ;
0 commit comments