linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend@broadcom.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
	<linux-wireless@vger.kernel.org>,
	Brett Rudley <brudley@broadcom.com>,
	"Franky (Zhenhui) Lin" <frankyl@broadcom.com>,
	Hante Meuleman <meuleman@broadcom.com>,
	<brcm80211-dev-list@broadcom.com>
Subject: Re: [PATCH 2/2] brcmfmac: fix debugging info for received hw messages with errors
Date: Fri, 8 May 2015 12:29:13 +0200	[thread overview]
Message-ID: <554C8FF9.60501@broadcom.com> (raw)
In-Reply-To: <1431025661-8879-2-git-send-email-zajec5@gmail.com>

On 05/07/15 21:07, Rafał Miłecki wrote:
> Code in function setting/querying device was treating every error as
> Broadcom protocol specific one. It wasn't right thing to do as most of
> subcalls return "normal" errors (errno-base.h). This resulted in e.g.:
> brcmf_usb_rx_ctlpkt: rxctl wait timed out
> brcmfmac: brcmf_fil_cmd_data Failed: BCME_NOTDOWN (-5)
> which was misleading because of interpreting -EIO as BCME_NOTDOWN.

So this is the reason for putting the error map in debug.c, but you are 
only addressing devices using bcdc protocol, ie. SDIO and USB. Also need 
to address PCIE. I would prefer to extend the query and set callbacks in 
struct brcmf_proto (proto.h) to pass firmware error code up so fwil can 
keep doing the mapping to string representation and have the callbacks 
return -EPROTO if firmware error code is not BCME_OK. Need to assure it 
can not get -EPROTO for other reasons.

Regards,
Arend

> Signed-off-by: Rafał Miłecki<zajec5@gmail.com>
> ---
>   drivers/net/wireless/brcm80211/brcmfmac/bcdc.c | 5 ++++-
>   drivers/net/wireless/brcm80211/brcmfmac/fwil.c | 3 +--
>   2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c
> index 8e0e91c..47941ab 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcdc.c
> @@ -203,8 +203,11 @@ retry:
>   	}
>
>   	/* Check the ERROR flag */
> -	if (flags&  BCDC_DCMD_ERROR)
> +	if (flags&  BCDC_DCMD_ERROR) {
>   		ret = le32_to_cpu(msg->status);
> +		brcmf_dbg(BCDC, "received message with error %s (%d)\n",
> +			  brcmf_get_errstr((u32)(-ret)), ret);
> +	}
>
>   done:
>   	return ret;
> diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c
> index bdbdc9e..c86a522 100644
> --- a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c
> +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c
> @@ -53,8 +53,7 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set)
>   	if (err>= 0)
>   		return 0;
>
> -	brcmf_dbg(FIL, "Failed: %s (%d)\n",
> -		  brcmf_get_errstr((u32)(-err)), err);
> +	brcmf_dbg(FIL, "Failed: %d\n", err);
>   	return -EBADE;
>   }
>


  reply	other threads:[~2015-05-08 10:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-07 19:07 [PATCH 1/2] brcmfmac: move strings debugging Broadcom errors to debug.c Rafał Miłecki
2015-05-07 19:07 ` [PATCH 2/2] brcmfmac: fix debugging info for received hw messages with errors Rafał Miłecki
2015-05-08 10:29   ` Arend van Spriel [this message]
2015-05-08 10:08 ` [PATCH 1/2] brcmfmac: move strings debugging Broadcom errors to debug.c Arend van Spriel
2015-05-08 10:24   ` Rafał Miłecki

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=554C8FF9.60501@broadcom.com \
    --to=arend@broadcom.com \
    --cc=brcm80211-dev-list@broadcom.com \
    --cc=brudley@broadcom.com \
    --cc=frankyl@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=meuleman@broadcom.com \
    --cc=zajec5@gmail.com \
    /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).