All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Joel Stanley <joel@jms.id.au>
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>,
	OpenBMC Maillist <openbmc@lists.ozlabs.org>
Subject: Re: [PATCH 4.4 9/9] net/ncsi: Improve HNCDSC AEN handler
Date: Fri, 21 Oct 2016 13:41:28 +1100	[thread overview]
Message-ID: <20161021024128.GA8915@gwshan> (raw)
In-Reply-To: <CACPK8XdSn5CZQWGs-CFjcM4Hi2MmO5tbQ52AE6deAy5xnZG17A@mail.gmail.com>

On Fri, Oct 21, 2016 at 12:09:37PM +1030, Joel Stanley wrote:
>Hi Gavin,
>
>On Fri, Oct 21, 2016 at 11:17 AM, Gavin Shan <gwshan@linux.vnet.ibm.com> wrote:
>> 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.
>
>Can you clarify what you mean here?
>

Joel, dev-4.4 is using old NCSI old where we don't have a spinlock
for NCSI channel. dev-4.7 and upstream code has one to ensure the
consistent read/update on NCSI channel'state. The commit log was
picked from the patch merged to linux.net (branch: "net"), meaning
the commit log corresponds to the code changes for upstream code.

This piece of changes isn't applied to dev-4.4. So I put a note
to clarify it. I'm too lazy and it could be more meaningful actually :)

Thanks,
Gavin

>Cheers,
>
>Joel
>
>>
>> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>> ---
>>  net/ncsi/ncsi-aen.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/ncsi/ncsi-aen.c b/net/ncsi/ncsi-aen.c
>> index 5bc0873..26ac93d 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;
>> --
>> 2.1.0
>>
>

  reply	other threads:[~2016-10-21  2:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21  0:47 [PATCH 4.4 0/9] net/ncsi: Backport fixes to dev-4.4 Gavin Shan
2016-10-21  0:47 ` [PATCH 4.4 1/9] net/ncsi: Remove unused parameters for ncsi_free_req() Gavin Shan
2016-10-21  0:47 ` [PATCH 4.4 2/9] net/ncsi: Introduce NCSI_RESERVED_CHANNEL Gavin Shan
2016-10-21  0:47 ` [PATCH 4.4 3/9] net/ncsi: Don't probe on the reserved channel ID (0x1f) Gavin Shan
2016-10-21  0:47 ` [PATCH 4.4 4/9] net/ncsi: Rework request index allocation Gavin Shan
2016-10-21  0:47 ` [PATCH 4.4 5/9] net/ncsi: Allow to extend NCSI request properties Gavin Shan
2016-10-21  0:47 ` [PATCH 4.4 6/9] net/ncsi: Avoid if statements in ncsi_suspend_dev() Gavin Shan
2016-10-21  0:47 ` [PATCH 4.4 7/9] net/ncsi: Fix stale link state of inactive channels on failover Gavin Shan
2016-10-21  0:47 ` [PATCH 4.4 8/9] net/ncsi: Choose hot channel as active one if necessary Gavin Shan
2016-10-21  0:47 ` [PATCH 4.4 9/9] net/ncsi: Improve HNCDSC AEN handler Gavin Shan
2016-10-21  1:39   ` Joel Stanley
2016-10-21  2:41     ` Gavin Shan [this message]
2016-10-21  3:31       ` Joel Stanley

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=20161021024128.GA8915@gwshan \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=joel@jms.id.au \
    --cc=openbmc@lists.ozlabs.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.