All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V6] brcmfmac: print errors if creating interface fails
@ 2016-05-27  8:54 Arend van Spriel
  2016-05-30  5:44 ` Julian Calaby
  2016-06-16 15:03 ` [V6] " Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Arend van Spriel @ 2016-05-27  8:54 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, Rafał Miłecki, Arend van Spriel

From: Rafał Miłecki <zajec5@gmail.com>

This is helpful for debugging. Without this all I was getting from "iw"
command on failed creating of P2P interface was:
> command failed: Too many open files in system (-23)

Signed-off-by: Rafal Milecki <zajec5@gmail.com>
[arend@broadcom.com: reduce error prints upon iface creation]
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
V2: s/in/if/ in commit message
V3: Add one more error message as suggested by Arend
V4: Also update brcmf_cfg80211_add_iface & print error for AP
V5: remove error prints from p2p.c
V6: fix compiler warning and remove duplicate calls
---
 .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c  | 16 ++++++++++------
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c   |  2 --
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index d0631b6..2248e8e 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -669,20 +669,24 @@ static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
 		return ERR_PTR(-EOPNOTSUPP);
 	case NL80211_IFTYPE_AP:
 		wdev = brcmf_ap_add_vif(wiphy, name, flags, params);
-		if (!IS_ERR(wdev))
-			brcmf_cfg80211_update_proto_addr_mode(wdev);
-		return wdev;
+		break;
 	case NL80211_IFTYPE_P2P_CLIENT:
 	case NL80211_IFTYPE_P2P_GO:
 	case NL80211_IFTYPE_P2P_DEVICE:
 		wdev = brcmf_p2p_add_vif(wiphy, name, name_assign_type, type, flags, params);
-		if (!IS_ERR(wdev))
-			brcmf_cfg80211_update_proto_addr_mode(wdev);
-		return wdev;
+		break;
 	case NL80211_IFTYPE_UNSPECIFIED:
 	default:
 		return ERR_PTR(-EINVAL);
 	}
+
+	if (IS_ERR(wdev))
+		brcmf_err("add iface %s type %d failed: err=%d\n",
+			  name, type, (int)PTR_ERR(wdev));
+	else
+		brcmf_cfg80211_update_proto_addr_mode(wdev);
+
+	return wdev;
 }
 
 static void brcmf_scan_config_mpc(struct brcmf_if *ifp, int mpc)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index a70cda6..a812381 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -2030,8 +2030,6 @@ static int brcmf_p2p_request_p2p_if(struct brcmf_p2p_info *p2p,
 
 	err = brcmf_fil_iovar_data_set(ifp, "p2p_ifadd", &if_request,
 				       sizeof(if_request));
-	if (err)
-		return err;
 
 	return err;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH V6] brcmfmac: print errors if creating interface fails
  2016-05-27  8:54 [PATCH V6] brcmfmac: print errors if creating interface fails Arend van Spriel
@ 2016-05-30  5:44 ` Julian Calaby
  2016-06-16 15:03 ` [V6] " Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Julian Calaby @ 2016-05-30  5:44 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: Kalle Valo, linux-wireless, Rafał Miłecki

Hi All,

On Fri, May 27, 2016 at 6:54 PM, Arend van Spriel <arend@broadcom.com> wrote:
> From: Rafał Miłecki <zajec5@gmail.com>
>
> This is helpful for debugging. Without this all I was getting from "iw"
> command on failed creating of P2P interface was:
>> command failed: Too many open files in system (-23)
>
> Signed-off-by: Rafal Milecki <zajec5@gmail.com>
> [arend@broadcom.com: reduce error prints upon iface creation]
> Signed-off-by: Arend van Spriel <arend@broadcom.com>

FWIW, this is:

Reviewed-by: Julian Calaby <julian.calaby@gmail.com>

Thanks,

Julian Calaby


> ---
> V2: s/in/if/ in commit message
> V3: Add one more error message as suggested by Arend
> V4: Also update brcmf_cfg80211_add_iface & print error for AP
> V5: remove error prints from p2p.c
> V6: fix compiler warning and remove duplicate calls
> ---
>  .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c  | 16 ++++++++++------
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c   |  2 --
>  2 files changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> index d0631b6..2248e8e 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
> @@ -669,20 +669,24 @@ static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
>                 return ERR_PTR(-EOPNOTSUPP);
>         case NL80211_IFTYPE_AP:
>                 wdev = brcmf_ap_add_vif(wiphy, name, flags, params);
> -               if (!IS_ERR(wdev))
> -                       brcmf_cfg80211_update_proto_addr_mode(wdev);
> -               return wdev;
> +               break;
>         case NL80211_IFTYPE_P2P_CLIENT:
>         case NL80211_IFTYPE_P2P_GO:
>         case NL80211_IFTYPE_P2P_DEVICE:
>                 wdev = brcmf_p2p_add_vif(wiphy, name, name_assign_type, type, flags, params);
> -               if (!IS_ERR(wdev))
> -                       brcmf_cfg80211_update_proto_addr_mode(wdev);
> -               return wdev;
> +               break;
>         case NL80211_IFTYPE_UNSPECIFIED:
>         default:
>                 return ERR_PTR(-EINVAL);
>         }
> +
> +       if (IS_ERR(wdev))
> +               brcmf_err("add iface %s type %d failed: err=%d\n",
> +                         name, type, (int)PTR_ERR(wdev));
> +       else
> +               brcmf_cfg80211_update_proto_addr_mode(wdev);
> +
> +       return wdev;
>  }
>
>  static void brcmf_scan_config_mpc(struct brcmf_if *ifp, int mpc)
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
> index a70cda6..a812381 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
> @@ -2030,8 +2030,6 @@ static int brcmf_p2p_request_p2p_if(struct brcmf_p2p_info *p2p,
>
>         err = brcmf_fil_iovar_data_set(ifp, "p2p_ifadd", &if_request,
>                                        sizeof(if_request));
> -       if (err)
> -               return err;
>
>         return err;
>  }
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [V6] brcmfmac: print errors if creating interface fails
  2016-05-27  8:54 [PATCH V6] brcmfmac: print errors if creating interface fails Arend van Spriel
  2016-05-30  5:44 ` Julian Calaby
@ 2016-06-16 15:03 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2016-06-16 15:03 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: linux-wireless, Rafał Miłecki, Arend van Spriel

Arend van Spriel <arend@broadcom.com> wrote:
> From: Rafał Miłecki <zajec5@gmail.com>
> 
> This is helpful for debugging. Without this all I was getting from "iw"
> command on failed creating of P2P interface was:
> > command failed: Too many open files in system (-23)
> 
> Signed-off-by: Rafal Milecki <zajec5@gmail.com>
> [arend@broadcom.com: reduce error prints upon iface creation]
> Signed-off-by: Arend van Spriel <arend@broadcom.com>
> Reviewed-by: Julian Calaby <julian.calaby@gmail.com>

Thanks, 1 patch applied to wireless-drivers-next.git:

0cd33c204b98 brcmfmac: print errors if creating interface fails

-- 
Sent by pwcli
https://patchwork.kernel.org/patch/9137911/


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-16 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-27  8:54 [PATCH V6] brcmfmac: print errors if creating interface fails Arend van Spriel
2016-05-30  5:44 ` Julian Calaby
2016-06-16 15:03 ` [V6] " 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.