public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] mac80211: do not print WARN if config interface fails during reconfigure
  2009-04-20 22:36 [PATCH] mac80211: do not print WARN if config interface fails during reconfigure Reinette Chatre
@ 2009-04-20 22:33 ` Johannes Berg
  2009-04-20 22:50   ` reinette chatre
  2009-04-20 22:36 ` [PATCH v2.6.30] mac80211: do not print WARN if config interface Reinette Chatre
  1 sibling, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2009-04-20 22:33 UTC (permalink / raw)
  To: Reinette Chatre; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1802 bytes --]

On Mon, 2009-04-20 at 15:36 -0700, Reinette Chatre wrote:
> It is expected that config interface will always succeed as mac80211
> will only request what driver supports. The exception here is when a
> device has rfkill enabled. At this time the rfkill state is unknown to
> mac80211 and config interface can fail. When this happens we deal with
> this error instead of printing a WARN.

Thanks. Just to make sure -- this really is just papering over the
warning, not actually fixing it. I hope we can fix it soon by making
mac80211 aware of rfkill.

johannes

> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
> ---
>  net/mac80211/util.c |   15 +++++++++++++--
>  1 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/net/mac80211/util.c b/net/mac80211/util.c
> index 52ef8d4..0ee74e8 100644
> --- a/net/mac80211/util.c
> +++ b/net/mac80211/util.c
> @@ -1047,8 +1047,19 @@ int ieee80211_reconfig(struct ieee80211_local *local)
>  		case NL80211_IFTYPE_ADHOC:
>  		case NL80211_IFTYPE_AP:
>  		case NL80211_IFTYPE_MESH_POINT:
> -			WARN_ON(ieee80211_if_config(sdata, changed));
> -			ieee80211_bss_info_change_notify(sdata, ~0);
> +			/*
> +			 * Driver's config_interface can fail if rfkill is
> +			 * enabled. Accommodate this return code.
> +			 * FIXME: When mac80211 has knowledge of rfkill
> +			 * state the code below can change back to:
> +			 *   WARN(ieee80211_if_config(sdata, changed));
> +			 *   ieee80211_bss_info_change_notify(sdata, ~0);
> +			 */
> +			if (ieee80211_if_config(sdata, changed))
> +				printk(KERN_DEBUG "%s: failed to reconfigure interface\n",
> +				       sdata->dev->name);
> +			else
> +				ieee80211_bss_info_change_notify(sdata, ~0);
>  			break;
>  		case NL80211_IFTYPE_WDS:
>  			break;

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [PATCH] mac80211: do not print WARN if config interface fails during reconfigure
@ 2009-04-20 22:36 Reinette Chatre
  2009-04-20 22:33 ` Johannes Berg
  2009-04-20 22:36 ` [PATCH v2.6.30] mac80211: do not print WARN if config interface Reinette Chatre
  0 siblings, 2 replies; 4+ messages in thread
From: Reinette Chatre @ 2009-04-20 22:36 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, Reinette Chatre

It is expected that config interface will always succeed as mac80211
will only request what driver supports. The exception here is when a
device has rfkill enabled. At this time the rfkill state is unknown to
mac80211 and config interface can fail. When this happens we deal with
this error instead of printing a WARN.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 net/mac80211/util.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 52ef8d4..0ee74e8 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1047,8 +1047,19 @@ int ieee80211_reconfig(struct ieee80211_local *local)
 		case NL80211_IFTYPE_ADHOC:
 		case NL80211_IFTYPE_AP:
 		case NL80211_IFTYPE_MESH_POINT:
-			WARN_ON(ieee80211_if_config(sdata, changed));
-			ieee80211_bss_info_change_notify(sdata, ~0);
+			/*
+			 * Driver's config_interface can fail if rfkill is
+			 * enabled. Accommodate this return code.
+			 * FIXME: When mac80211 has knowledge of rfkill
+			 * state the code below can change back to:
+			 *   WARN(ieee80211_if_config(sdata, changed));
+			 *   ieee80211_bss_info_change_notify(sdata, ~0);
+			 */
+			if (ieee80211_if_config(sdata, changed))
+				printk(KERN_DEBUG "%s: failed to reconfigure interface\n",
+				       sdata->dev->name);
+			else
+				ieee80211_bss_info_change_notify(sdata, ~0);
 			break;
 		case NL80211_IFTYPE_WDS:
 			break;
-- 
1.5.6.3


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

* [PATCH v2.6.30] mac80211: do not print WARN if config interface
  2009-04-20 22:36 [PATCH] mac80211: do not print WARN if config interface fails during reconfigure Reinette Chatre
  2009-04-20 22:33 ` Johannes Berg
@ 2009-04-20 22:36 ` Reinette Chatre
  1 sibling, 0 replies; 4+ messages in thread
From: Reinette Chatre @ 2009-04-20 22:36 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, Reinette Chatre

It is expected that config interface will always succeed as mac80211
will only request what driver supports. The exception here is when a
device has rfkill enabled. At this time the rfkill state is unknown to
mac80211 and config interface can fail. When this happens we deal with
this error instead of printing a WARN.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 net/mac80211/pm.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 0273023..aa5f959 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -156,8 +156,19 @@ int __ieee80211_resume(struct ieee80211_hw *hw)
 		case NL80211_IFTYPE_ADHOC:
 		case NL80211_IFTYPE_AP:
 		case NL80211_IFTYPE_MESH_POINT:
-			WARN_ON(ieee80211_if_config(sdata, changed));
-			ieee80211_bss_info_change_notify(sdata, ~0);
+			/*
+			 * Driver's config_interface can fail if rfkill is
+			 * enabled. Accommodate this return code.
+			 * FIXME: When mac80211 has knowledge of rfkill
+			 * state the code below can change back to:
+			 *   WARN(ieee80211_if_config(sdata, changed));
+			 *   ieee80211_bss_info_change_notify(sdata, ~0);
+			 */
+			if (ieee80211_if_config(sdata, changed))
+				printk(KERN_DEBUG "%s: failed to configure interface during resume\n",
+				       sdata->dev->name);
+			else
+				ieee80211_bss_info_change_notify(sdata, ~0);
 			break;
 		case NL80211_IFTYPE_WDS:
 			break;
-- 
1.5.6.3


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

* Re: [PATCH] mac80211: do not print WARN if config interface fails during reconfigure
  2009-04-20 22:33 ` Johannes Berg
@ 2009-04-20 22:50   ` reinette chatre
  0 siblings, 0 replies; 4+ messages in thread
From: reinette chatre @ 2009-04-20 22:50 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org

On Mon, 2009-04-20 at 15:33 -0700, Johannes Berg wrote:
> On Mon, 2009-04-20 at 15:36 -0700, Reinette Chatre wrote:
> > It is expected that config interface will always succeed as mac80211
> > will only request what driver supports. The exception here is when a
> > device has rfkill enabled. At this time the rfkill state is unknown to
> > mac80211 and config interface can fail. When this happens we deal with
> > this error instead of printing a WARN.
> 
> Thanks. Just to make sure -- this really is just papering over the
> warning, not actually fixing it. I hope we can fix it soon by making
> mac80211 aware of rfkill.

Yes it is ... I did this because kerneloops.org exists.

Reinette



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

end of thread, other threads:[~2009-04-20 22:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 22:36 [PATCH] mac80211: do not print WARN if config interface fails during reconfigure Reinette Chatre
2009-04-20 22:33 ` Johannes Berg
2009-04-20 22:50   ` reinette chatre
2009-04-20 22:36 ` [PATCH v2.6.30] mac80211: do not print WARN if config interface Reinette Chatre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox