linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wright Feng <Wright.Feng@cypress.com>
To: Arend van Spriel <arend.vanspriel@broadcom.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "franky.lin@broadcom.com" <franky.lin@broadcom.com>,
	"hante.meuleman@broadcom.com" <hante.meuleman@broadcom.com>,
	"kvalo@codeaurora.org" <kvalo@codeaurora.org>,
	Chi-Hsien Lin <Chi-Hsien.Lin@cypress.com>,
	"brcm80211-dev-list.pdl@broadcom.com" 
	<brcm80211-dev-list.pdl@broadcom.com>
Subject: Re: [PATCH 2/3] brcmfmac: add credit numbers updating support
Date: Fri, 2 Nov 2018 07:54:03 +0000	[thread overview]
Message-ID: <ed8d5509-5486-5638-9175-7f3297b78b63@cypress.com> (raw)
In-Reply-To: <aa65d65d-f610-3136-2e7d-45d150ec183d@broadcom.com>



On 2018/10/30 下午 07:04, Arend van Spriel wrote:
> On 10/29/2018 11:27 AM, Wright Feng wrote:
>> The credit numbers are static and tunable per chip in firmware side.
>> However the credit number may be changed that is based on packet pool
>> length and will send BRCMF_E_FIFO_CREDIT_MAP event to notify host driver
>> updates the credit numbers during interface up.
>> The purpose of this patch is making host driver has ability of updating
>> the credit numbers when receiving the BRCMF_E_FIFO_CREDIT_MAP event.
> 
> Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
>> Signed-off-by: Wright Feng <wright.feng@cypress.com>
>> ---
>>  .../broadcom/brcm80211/brcmfmac/fwsignal.c         | 23 
>> ++++++++++++++--------
>>  1 file changed, 15 insertions(+), 8 deletions(-)
>>
>> diff --git 
>> a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c 
>> b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
>> index f3cbf78..e0910c5 100644
>> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
>> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
> 
> [...]
> 
>> @@ -1595,19 +1599,21 @@ static int brcmf_fws_notify_credit_map(struct 
>> brcmf_if *ifp,
>>          brcmf_err("event payload too small (%d)\n", e->datalen);
>>          return -EINVAL;
>>      }
>> -    if (fws->creditmap_received)
>> -        return 0;
>>
>>      fws->creditmap_received = true;
> 
> I think the creditmap_received struct member is no longer needed.
I will keep this because we still need it for checking whether flow
control is active or not.
> 
>>      brcmf_dbg(TRACE, "enter: credits %pM\n", credits);
>>      brcmf_fws_lock(fws);
>>      for (i = 0; i < ARRAY_SIZE(fws->fifo_credit); i++) {
>> -        if (*credits)
>> +        fws->fifo_credit[i] += credits[i] - fws->init_fifo_credit[i];
>> +        fws->init_fifo_credit[i] = credits[i];
>> +        if (fws->fifo_credit[i] > 0)
>>              fws->fifo_credit_map |= 1 << i;
>>          else
>>              fws->fifo_credit_map &= ~(1 << i);
>> -        fws->fifo_credit[i] = *credits++;
>> +        if (fws->fifo_credit[i] < 0)
>> +            brcmf_err("fifo_credit[%d] value is negative(%d)\n",
>> +                  i, fws->fifo_credit[i]);
> 
> This looks like it should not happen so maybe warrants a WARN or WARN_ONCE?
I will replace those 2 lines with WARN_ONCE.
Thanks for the suggestion.

-Wright
> 
>>      }
>>      brcmf_fws_schedule_deq(fws);
>>      brcmf_fws_unlock(fws);
> 

  reply	other threads:[~2018-11-02  7:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 10:27 [PATCH 0/3] brcmfmac: throughput enhancement for SDIO and flow control mode Wright Feng
2018-10-29 10:27 ` [PATCH 1/3] brcmfmac: calling skb_orphan before sending skb to SDIO bus Wright Feng
2018-10-29 18:50   ` Franky Lin
2018-11-02  3:08     ` Wright Feng
2018-11-02 19:51       ` Franky Lin
2018-11-03  1:36         ` Wright Feng
2018-10-29 10:27 ` [PATCH 2/3] brcmfmac: add credit numbers updating support Wright Feng
2018-10-30 11:04   ` Arend van Spriel
2018-11-02  7:54     ` Wright Feng [this message]
2018-10-29 10:27 ` [PATCH 3/3] brcmfmac: make firmware frameburst mode a module parameter Wright Feng
2018-10-30 11:33   ` Arend van Spriel
2018-11-02  3:22     ` Wright Feng

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=ed8d5509-5486-5638-9175-7f3297b78b63@cypress.com \
    --to=wright.feng@cypress.com \
    --cc=Chi-Hsien.Lin@cypress.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=franky.lin@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).