* [PATCH 1/2] brcmfmac: check brcmf_bus_get_memdump result for error
@ 2017-01-30 15:09 Rafał Miłecki
2017-01-30 15:09 ` [PATCH 2/2] brcmfmac: be more verbose when PSM's watchdog fires Rafał Miłecki
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Rafał Miłecki @ 2017-01-30 15:09 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, Franky Lin, Hante Meuleman,
Pieter-Paul Giesberts, Franky Lin, linux-wireless,
brcm80211-dev-list.pdl, Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
This method may be unsupported (see: USB bus) or may just fail (see:
SDIO bus).
While at it rework logic in brcmf_sdio_bus_get_memdump function to avoid
too many conditional code nesting levels.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
.../wireless/broadcom/brcm80211/brcmfmac/debug.c | 23 +++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
index e64557c35553..6f8a4b074c31 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
@@ -32,16 +32,25 @@ static int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
{
void *dump;
size_t ramsize;
+ int err;
ramsize = brcmf_bus_get_ramsize(bus);
- if (ramsize) {
- dump = vzalloc(len + ramsize);
- if (!dump)
- return -ENOMEM;
- memcpy(dump, data, len);
- brcmf_bus_get_memdump(bus, dump + len, ramsize);
- dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL);
+ if (!ramsize)
+ return -ENOTSUPP;
+
+ dump = vzalloc(len + ramsize);
+ if (!dump)
+ return -ENOMEM;
+
+ memcpy(dump, data, len);
+ err = brcmf_bus_get_memdump(bus, dump + len, ramsize);
+ if (err) {
+ vfree(dump);
+ return err;
}
+
+ dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL);
+
return 0;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] brcmfmac: be more verbose when PSM's watchdog fires
2017-01-30 15:09 [PATCH 1/2] brcmfmac: check brcmf_bus_get_memdump result for error Rafał Miłecki
@ 2017-01-30 15:09 ` Rafał Miłecki
2017-01-31 11:58 ` Arend Van Spriel
2017-01-31 11:56 ` [PATCH 1/2] brcmfmac: check brcmf_bus_get_memdump result for error Arend Van Spriel
2017-02-02 6:16 ` [1/2] " Kalle Valo
2 siblings, 1 reply; 5+ messages in thread
From: Rafał Miłecki @ 2017-01-30 15:09 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, Franky Lin, Hante Meuleman,
Pieter-Paul Giesberts, Franky Lin, linux-wireless,
brcm80211-dev-list.pdl, Rafał Miłecki
From: Rafał Miłecki <rafal@milecki.pl>
It's important to inform user so he knows things went wrong. He may also
want to get memory dump for further debugging purposes.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
index 6f8a4b074c31..f4644cf371c7 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
@@ -58,10 +58,18 @@ static int brcmf_debug_psm_watchdog_notify(struct brcmf_if *ifp,
const struct brcmf_event_msg *evtmsg,
void *data)
{
+ int err;
+
brcmf_dbg(TRACE, "enter: bsscfgidx=%d\n", ifp->bsscfgidx);
- return brcmf_debug_create_memdump(ifp->drvr->bus_if, data,
- evtmsg->datalen);
+ brcmf_err("PSM's watchdog has fired!\n");
+
+ err = brcmf_debug_create_memdump(ifp->drvr->bus_if, data,
+ evtmsg->datalen);
+ if (err)
+ brcmf_err("Failed to get memory dump, %d\n", err);
+
+ return err;
}
void brcmf_debugfs_init(void)
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] brcmfmac: check brcmf_bus_get_memdump result for error
2017-01-30 15:09 [PATCH 1/2] brcmfmac: check brcmf_bus_get_memdump result for error Rafał Miłecki
2017-01-30 15:09 ` [PATCH 2/2] brcmfmac: be more verbose when PSM's watchdog fires Rafał Miłecki
@ 2017-01-31 11:56 ` Arend Van Spriel
2017-02-02 6:16 ` [1/2] " Kalle Valo
2 siblings, 0 replies; 5+ messages in thread
From: Arend Van Spriel @ 2017-01-31 11:56 UTC (permalink / raw)
To: Rafał Miłecki, Kalle Valo
Cc: Franky Lin, Hante Meuleman, Pieter-Paul Giesberts, Franky Lin,
linux-wireless, brcm80211-dev-list.pdl, Rafał Miłecki
On 30-1-2017 16:09, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> This method may be unsupported (see: USB bus) or may just fail (see:
> SDIO bus).
> While at it rework logic in brcmf_sdio_bus_get_memdump function to avoid
> too many conditional code nesting levels.
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> .../wireless/broadcom/brcm80211/brcmfmac/debug.c | 23 +++++++++++++++-------
> 1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
> index e64557c35553..6f8a4b074c31 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
> @@ -32,16 +32,25 @@ static int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
> {
> void *dump;
> size_t ramsize;
> + int err;
>
> ramsize = brcmf_bus_get_ramsize(bus);
> - if (ramsize) {
> - dump = vzalloc(len + ramsize);
> - if (!dump)
> - return -ENOMEM;
> - memcpy(dump, data, len);
> - brcmf_bus_get_memdump(bus, dump + len, ramsize);
> - dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL);
> + if (!ramsize)
> + return -ENOTSUPP;
> +
> + dump = vzalloc(len + ramsize);
> + if (!dump)
> + return -ENOMEM;
> +
> + memcpy(dump, data, len);
> + err = brcmf_bus_get_memdump(bus, dump + len, ramsize);
> + if (err) {
> + vfree(dump);
> + return err;
> }
> +
> + dev_coredumpv(bus->dev, dump, len + ramsize, GFP_KERNEL);
> +
> return 0;
> }
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] brcmfmac: be more verbose when PSM's watchdog fires
2017-01-30 15:09 ` [PATCH 2/2] brcmfmac: be more verbose when PSM's watchdog fires Rafał Miłecki
@ 2017-01-31 11:58 ` Arend Van Spriel
0 siblings, 0 replies; 5+ messages in thread
From: Arend Van Spriel @ 2017-01-31 11:58 UTC (permalink / raw)
To: Rafał Miłecki, Kalle Valo
Cc: Franky Lin, Hante Meuleman, Pieter-Paul Giesberts, Franky Lin,
linux-wireless, brcm80211-dev-list.pdl, Rafał Miłecki
On 30-1-2017 16:09, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> It's important to inform user so he knows things went wrong. He may also
> want to get memory dump for further debugging purposes.
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
> index 6f8a4b074c31..f4644cf371c7 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
> @@ -58,10 +58,18 @@ static int brcmf_debug_psm_watchdog_notify(struct brcmf_if *ifp,
> const struct brcmf_event_msg *evtmsg,
> void *data)
> {
> + int err;
> +
> brcmf_dbg(TRACE, "enter: bsscfgidx=%d\n", ifp->bsscfgidx);
>
> - return brcmf_debug_create_memdump(ifp->drvr->bus_if, data,
> - evtmsg->datalen);
> + brcmf_err("PSM's watchdog has fired!\n");
> +
> + err = brcmf_debug_create_memdump(ifp->drvr->bus_if, data,
> + evtmsg->datalen);
> + if (err)
> + brcmf_err("Failed to get memory dump, %d\n", err);
> +
> + return err;
> }
>
> void brcmf_debugfs_init(void)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [1/2] brcmfmac: check brcmf_bus_get_memdump result for error
2017-01-30 15:09 [PATCH 1/2] brcmfmac: check brcmf_bus_get_memdump result for error Rafał Miłecki
2017-01-30 15:09 ` [PATCH 2/2] brcmfmac: be more verbose when PSM's watchdog fires Rafał Miłecki
2017-01-31 11:56 ` [PATCH 1/2] brcmfmac: check brcmf_bus_get_memdump result for error Arend Van Spriel
@ 2017-02-02 6:16 ` Kalle Valo
2 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2017-02-02 6:16 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Arend van Spriel, Franky Lin, Hante Meuleman,
Pieter-Paul Giesberts, Franky Lin, linux-wireless,
brcm80211-dev-list.pdl, Rafał Miłecki
Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> This method may be unsupported (see: USB bus) or may just fail (see:
> SDIO bus).
> While at it rework logic in brcmf_sdio_bus_get_memdump function to avoid
> too many conditional code nesting levels.
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
2 patches applied to wireless-drivers-next.git, thanks.
f4737a62033d brcmfmac: check brcmf_bus_get_memdump result for error
36401cb7ffae brcmfmac: be more verbose when PSM's watchdog fires
--
https://patchwork.kernel.org/patch/9545583/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-02-02 6:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-30 15:09 [PATCH 1/2] brcmfmac: check brcmf_bus_get_memdump result for error Rafał Miłecki
2017-01-30 15:09 ` [PATCH 2/2] brcmfmac: be more verbose when PSM's watchdog fires Rafał Miłecki
2017-01-31 11:58 ` Arend Van Spriel
2017-01-31 11:56 ` [PATCH 1/2] brcmfmac: check brcmf_bus_get_memdump result for error Arend Van Spriel
2017-02-02 6:16 ` [1/2] " Kalle Valo
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.