Skip to content

Commit 60ab49b

Browse files
sammjdavem330
authored andcommitted
net/ncsi: Don't enable all channels when HWA available
NCSI hardware arbitration allows multiple packages to be enabled at once and share the same wiring. If the NCSI driver recognises that HWA is available it unconditionally enables all packages and channels; but that is a configuration decision rather than something required by HWA. Additionally the current implementation will not failover on link events which can cause connectivity to be lost unless the interface is manually bounced. Retain basic HWA support but remove the separate configuration path to enable all channels, leaving this to be handled by a later implementation. Signed-off-by: Samuel Mendoza-Jonas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2391b00 commit 60ab49b

File tree

2 files changed

+5
-48
lines changed

2 files changed

+5
-48
lines changed

net/ncsi/ncsi-aen.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ static int ncsi_aen_handler_lsc(struct ncsi_dev_priv *ndp,
8686
!(state == NCSI_CHANNEL_ACTIVE && !(data & 0x1)))
8787
return 0;
8888

89-
if (!(ndp->flags & NCSI_DEV_HWA) &&
90-
state == NCSI_CHANNEL_ACTIVE)
89+
if (state == NCSI_CHANNEL_ACTIVE)
9190
ndp->flags |= NCSI_DEV_RESHUFFLE;
9291

9392
ncsi_stop_channel_monitor(nc);

net/ncsi/ncsi-manage.c

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,8 @@ static void ncsi_channel_monitor(struct timer_list *t)
113113
default:
114114
netdev_err(ndp->ndev.dev, "NCSI Channel %d timed out!\n",
115115
nc->id);
116-
if (!(ndp->flags & NCSI_DEV_HWA)) {
117-
ncsi_report_link(ndp, true);
118-
ndp->flags |= NCSI_DEV_RESHUFFLE;
119-
}
116+
ncsi_report_link(ndp, true);
117+
ndp->flags |= NCSI_DEV_RESHUFFLE;
120118

121119
ncsi_stop_channel_monitor(nc);
122120

@@ -1050,35 +1048,6 @@ static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp)
10501048
return false;
10511049
}
10521050

1053-
static int ncsi_enable_hwa(struct ncsi_dev_priv *ndp)
1054-
{
1055-
struct ncsi_package *np;
1056-
struct ncsi_channel *nc;
1057-
unsigned long flags;
1058-
1059-
/* Move all available channels to processing queue */
1060-
spin_lock_irqsave(&ndp->lock, flags);
1061-
NCSI_FOR_EACH_PACKAGE(ndp, np) {
1062-
NCSI_FOR_EACH_CHANNEL(np, nc) {
1063-
WARN_ON_ONCE(nc->state != NCSI_CHANNEL_INACTIVE ||
1064-
!list_empty(&nc->link));
1065-
ncsi_stop_channel_monitor(nc);
1066-
list_add_tail_rcu(&nc->link, &ndp->channel_queue);
1067-
}
1068-
}
1069-
spin_unlock_irqrestore(&ndp->lock, flags);
1070-
1071-
/* We can have no channels in extremely case */
1072-
if (list_empty(&ndp->channel_queue)) {
1073-
netdev_err(ndp->ndev.dev,
1074-
"NCSI: No available channels for HWA\n");
1075-
ncsi_report_link(ndp, false);
1076-
return -ENOENT;
1077-
}
1078-
1079-
return ncsi_process_next_channel(ndp);
1080-
}
1081-
10821051
static void ncsi_probe_channel(struct ncsi_dev_priv *ndp)
10831052
{
10841053
struct ncsi_dev *nd = &ndp->ndev;
@@ -1156,10 +1125,7 @@ static void ncsi_probe_channel(struct ncsi_dev_priv *ndp)
11561125
*/
11571126
if (!ndp->active_package) {
11581127
ndp->flags |= NCSI_DEV_PROBED;
1159-
if (ncsi_check_hwa(ndp))
1160-
ncsi_enable_hwa(ndp);
1161-
else
1162-
ncsi_choose_active_channel(ndp);
1128+
ncsi_choose_active_channel(ndp);
11631129
return;
11641130
}
11651131

@@ -1592,7 +1558,6 @@ EXPORT_SYMBOL_GPL(ncsi_register_dev);
15921558
int ncsi_start_dev(struct ncsi_dev *nd)
15931559
{
15941560
struct ncsi_dev_priv *ndp = TO_NCSI_DEV_PRIV(nd);
1595-
int ret;
15961561

15971562
if (nd->state != ncsi_dev_state_registered &&
15981563
nd->state != ncsi_dev_state_functional)
@@ -1604,14 +1569,7 @@ int ncsi_start_dev(struct ncsi_dev *nd)
16041569
return 0;
16051570
}
16061571

1607-
if (ndp->flags & NCSI_DEV_HWA) {
1608-
netdev_info(ndp->ndev.dev, "NCSI: Enabling HWA mode\n");
1609-
ret = ncsi_enable_hwa(ndp);
1610-
} else {
1611-
ret = ncsi_choose_active_channel(ndp);
1612-
}
1613-
1614-
return ret;
1572+
return ncsi_choose_active_channel(ndp);
16151573
}
16161574
EXPORT_SYMBOL_GPL(ncsi_start_dev);
16171575

0 commit comments

Comments
 (0)