diff options
author | Gavin Shan <gwshan@linux.vnet.ibm.com> | 2016-10-21 11:47:46 +1100 |
---|---|---|
committer | Joel Stanley <joel@jms.id.au> | 2016-10-21 12:08:37 +1030 |
commit | 5509e6ee766f6b910c3b81c02bae291fc1d9a806 (patch) | |
tree | 7d3652c23bfcb608d84f627345f7cd40d4e7b4fe | |
parent | 572e07fe62177e183e9ca68987adb372fe229ba2 (diff) | |
download | talos-obmc-linux-openbmc-4.4-20161021-1.tar.gz talos-obmc-linux-openbmc-4.4-20161021-1.zip |
net/ncsi: Improve HNCDSC AEN handleropenbmc-4.4-20161021-1
This improves AEN handler for Host Network Controller Driver Status
Change (HNCDSC):
* The channel's lock should be hold when accessing its state.
* Do failover when host driver isn't ready.
* Configure channel when host driver becomes ready.
NOTE: The first one isn't applied to the code in dev-4.4.
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
-rw-r--r-- | net/ncsi/ncsi-aen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ncsi/ncsi-aen.c b/net/ncsi/ncsi-aen.c index 5bc087314510..26ac93dde60d 100644 --- a/net/ncsi/ncsi-aen.c +++ b/net/ncsi/ncsi-aen.c @@ -142,8 +142,7 @@ static int ncsi_aen_handler_hncdsc(struct ncsi_dev_priv *ndp, ncm = &nc->nc_modes[NCSI_MODE_LINK]; hncdsc = (struct ncsi_aen_hncdsc_pkt *)h; ncm->ncm_data[3] = ntohl(hncdsc->status); - if (ndp->ndp_active_channel != nc || - ncm->ncm_data[3] & 0x1) + if (ndp->ndp_active_channel != nc) return 0; /* If this channel is the active one and the link doesn't @@ -151,7 +150,8 @@ static int ncsi_aen_handler_hncdsc(struct ncsi_dev_priv *ndp, * The logic here is exactly similar to what we do when link * is down on the active channel. */ - ndp->ndp_flags |= NCSI_DEV_PRIV_FLAG_CHANGE_ACTIVE; + if (!(ncm->ncm_data[3] & 0x1)) + ndp->ndp_flags |= NCSI_DEV_PRIV_FLAG_CHANGE_ACTIVE; ncsi_suspend_dev(nd); return 0; |