linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix handling of failure to create debugfs directory
@ 2007-08-08  5:17 Pavel Roskin
  2007-08-08  5:52 ` Larry Finger
  2007-08-08  9:04 ` Michael Buesch
  0 siblings, 2 replies; 7+ messages in thread
From: Pavel Roskin @ 2007-08-08  5:17 UTC (permalink / raw)
  To: bcm43xx-dev, linux-wireless

This can happen if CONFIG_BCM43XX_MAC80211_DEBUG is enabled, but
CONFIG_DEBUG_FS is not.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 .../wireless/bcm43xx-mac80211/bcm43xx_debugfs.c    |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_debugfs.c b/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_debugfs.c
index 9ca4625..aded2b3 100644
--- a/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_debugfs.c
+++ b/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_debugfs.c
@@ -408,7 +408,7 @@ static struct file_operations restart_fops = {
 
 int bcm43xx_debug(struct bcm43xx_wldev *dev, enum bcm43xx_dyndbg feature)
 {
-	return !!(dev->dfsentry->dyn_debug[feature]);
+	return !!(dev->dfsentry && dev->dfsentry->dyn_debug[feature]);
 }
 
 static void bcm43xx_remove_dynamic_debug(struct bcm43xx_wldev *dev)
@@ -472,7 +472,9 @@ void bcm43xx_debugfs_add_device(struct bcm43xx_wldev *dev)
 	snprintf(devdir, sizeof(devdir), "%s", wiphy_name(dev->wl->hw->wiphy));
 	e->subdir = debugfs_create_dir(devdir, fs.root);
 	if (!e->subdir || IS_ERR(e->subdir)) {
-		e->subdir = NULL;
+		bcmerr(dev->wl, "debugfs: cannot create %s directory\n",
+		       devdir);
+		dev->dfsentry = NULL;
 		kfree(log->log);
 		kfree(e);
 		return;
@@ -525,6 +527,8 @@ void bcm43xx_debugfs_log_txstat(struct bcm43xx_wldev *dev,
 	struct bcm43xx_txstatus *cur;
 	int i;
 
+	if (!e)
+		return;
 	log = &e->txstatlog;
 	assert(irqs_disabled());
 	spin_lock(&log->lock);

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

* Re: [PATCH] Fix handling of failure to create debugfs directory
  2007-08-08  5:17 [PATCH] Fix handling of failure to create debugfs directory Pavel Roskin
@ 2007-08-08  5:52 ` Larry Finger
  2007-08-08  6:02   ` Larry Finger
  2007-08-08 10:38   ` Michael Buesch
  2007-08-08  9:04 ` Michael Buesch
  1 sibling, 2 replies; 7+ messages in thread
From: Larry Finger @ 2007-08-08  5:52 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: bcm43xx-dev, linux-wireless

Pavel Roskin wrote:
> This can happen if CONFIG_BCM43XX_MAC80211_DEBUG is enabled, but
> CONFIG_DEBUG_FS is not.
> 
> Signed-off-by: Pavel Roskin <proski@gnu.org>
> ---
> 
With this patch installed, and the DEBUG configuration set as above, I get a kernel panic on an 
x86_64 SMP system. The reason for the panic scrolled off the screen, but the complete stack dump 
(hand copied) is as follows:

lock_acquire+0x85/0x31
bcm43xx_mac80211: bcm43xx_debugfs_log_txstat+0x5a/099
_spin_lock+0x25/0x31
bcm43xx_mac80211: bcm43xx_interrupt_tasklet+0x21/0x723
bcm43xx_mac80211: bcm43xx_debugfs_log_txstat+0x5a/0x99
bcm43xx_mac80211: bcm43xx_handle_txstatsus+0x12/0x72
bcm43xx_mac80211: bcm43xx_interrupt_tasklet+0x699/0x723
__lock_acquire+0xca2/0xcf0
bcm43xx_mac80211: bcm43xx_interrupt_handler+0x296/0x723
tasklet_action+0x5e/0xb2
__do_softirq+0x5f/0xe3
call_softirq+0x1c/0x28
do_softirq+0x39/0x9f
irq_exit+0x4e/0x50
do_IRQ+0xba/0xd8
default_idle+0x35/0x51
cpu_idle+0xce/0xf1
start_secondary+0x2e0/0x2f2

Larry



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

* Re: [PATCH] Fix handling of failure to create debugfs directory
  2007-08-08  5:52 ` Larry Finger
@ 2007-08-08  6:02   ` Larry Finger
  2007-08-08 11:16     ` Michael Buesch
  2007-08-08 10:38   ` Michael Buesch
  1 sibling, 1 reply; 7+ messages in thread
From: Larry Finger @ 2007-08-08  6:02 UTC (permalink / raw)
  To: Larry Finger; +Cc: Pavel Roskin, linux-wireless, bcm43xx-dev

Larry Finger wrote:
> Pavel Roskin wrote:
>> This can happen if CONFIG_BCM43XX_MAC80211_DEBUG is enabled, but
>> CONFIG_DEBUG_FS is not.
>>
>> Signed-off-by: Pavel Roskin <proski@gnu.org>
>> ---
>>
> With this patch installed, and the DEBUG configuration set as above, I get a kernel panic on an 
> x86_64 SMP system. The reason for the panic scrolled off the screen, but the complete stack dump 
> (hand copied) is as follows:
> 
> lock_acquire+0x85/0x31
> bcm43xx_mac80211: bcm43xx_debugfs_log_txstat+0x5a/099
> _spin_lock+0x25/0x31

Ignore the noise above. I had failed to get the right patch. The crash confirms the problem 
_without_ the patch. Getting it in properly fixes the problem

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry


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

* Re: [PATCH] Fix handling of failure to create debugfs directory
  2007-08-08  5:17 [PATCH] Fix handling of failure to create debugfs directory Pavel Roskin
  2007-08-08  5:52 ` Larry Finger
@ 2007-08-08  9:04 ` Michael Buesch
  2007-08-08 12:04   ` Larry Finger
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Buesch @ 2007-08-08  9:04 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: bcm43xx-dev, linux-wireless, Larry Finger

On Wednesday 08 August 2007 07:17:10 Pavel Roskin wrote:
> This can happen if CONFIG_BCM43XX_MAC80211_DEBUG is enabled, but
> CONFIG_DEBUG_FS is not.
> 
> Signed-off-by: Pavel Roskin <proski@gnu.org>
> ---

Thanks, queued.
Larry, this might also apply to bcm4301.

>  .../wireless/bcm43xx-mac80211/bcm43xx_debugfs.c    |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_debugfs.c b/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_debugfs.c
> index 9ca4625..aded2b3 100644
> --- a/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_debugfs.c
> +++ b/drivers/net/wireless/bcm43xx-mac80211/bcm43xx_debugfs.c
> @@ -408,7 +408,7 @@ static struct file_operations restart_fops = {
>  
>  int bcm43xx_debug(struct bcm43xx_wldev *dev, enum bcm43xx_dyndbg feature)
>  {
> -	return !!(dev->dfsentry->dyn_debug[feature]);
> +	return !!(dev->dfsentry && dev->dfsentry->dyn_debug[feature]);
>  }
>  
>  static void bcm43xx_remove_dynamic_debug(struct bcm43xx_wldev *dev)
> @@ -472,7 +472,9 @@ void bcm43xx_debugfs_add_device(struct bcm43xx_wldev *dev)
>  	snprintf(devdir, sizeof(devdir), "%s", wiphy_name(dev->wl->hw->wiphy));
>  	e->subdir = debugfs_create_dir(devdir, fs.root);
>  	if (!e->subdir || IS_ERR(e->subdir)) {
> -		e->subdir = NULL;
> +		bcmerr(dev->wl, "debugfs: cannot create %s directory\n",
> +		       devdir);
> +		dev->dfsentry = NULL;
>  		kfree(log->log);
>  		kfree(e);
>  		return;
> @@ -525,6 +527,8 @@ void bcm43xx_debugfs_log_txstat(struct bcm43xx_wldev *dev,
>  	struct bcm43xx_txstatus *cur;
>  	int i;
>  
> +	if (!e)
> +		return;
>  	log = &e->txstatlog;
>  	assert(irqs_disabled());
>  	spin_lock(&log->lock);

-- 
Greetings Michael.

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

* Re: [PATCH] Fix handling of failure to create debugfs directory
  2007-08-08  5:52 ` Larry Finger
  2007-08-08  6:02   ` Larry Finger
@ 2007-08-08 10:38   ` Michael Buesch
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Buesch @ 2007-08-08 10:38 UTC (permalink / raw)
  To: bcm43xx-dev; +Cc: Larry Finger, Pavel Roskin, linux-wireless

On Wednesday 08 August 2007 07:52:21 Larry Finger wrote:
> Pavel Roskin wrote:
> > This can happen if CONFIG_BCM43XX_MAC80211_DEBUG is enabled, but
> > CONFIG_DEBUG_FS is not.
> > 
> > Signed-off-by: Pavel Roskin <proski@gnu.org>
> > ---
> > 
> With this patch installed, and the DEBUG configuration set as above, I get a kernel panic on an 
> x86_64 SMP system. The reason for the panic scrolled off the screen, but the complete stack dump 
> (hand copied) is as follows:
> 
> lock_acquire+0x85/0x31
> bcm43xx_mac80211: bcm43xx_debugfs_log_txstat+0x5a/099
> _spin_lock+0x25/0x31
> bcm43xx_mac80211: bcm43xx_interrupt_tasklet+0x21/0x723
> bcm43xx_mac80211: bcm43xx_debugfs_log_txstat+0x5a/0x99
> bcm43xx_mac80211: bcm43xx_handle_txstatsus+0x12/0x72
> bcm43xx_mac80211: bcm43xx_interrupt_tasklet+0x699/0x723
> __lock_acquire+0xca2/0xcf0
> bcm43xx_mac80211: bcm43xx_interrupt_handler+0x296/0x723
> tasklet_action+0x5e/0xb2
> __do_softirq+0x5f/0xe3
> call_softirq+0x1c/0x28
> do_softirq+0x39/0x9f
> irq_exit+0x4e/0x50
> do_IRQ+0xba/0xd8
> default_idle+0x35/0x51
> cpu_idle+0xce/0xf1
> start_secondary+0x2e0/0x2f2

Ah crap. I missed this. I'll do a patch.
But first some lunch :)

-- 
Greetings Michael.

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

* Re: [PATCH] Fix handling of failure to create debugfs directory
  2007-08-08  6:02   ` Larry Finger
@ 2007-08-08 11:16     ` Michael Buesch
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Buesch @ 2007-08-08 11:16 UTC (permalink / raw)
  To: bcm43xx-dev; +Cc: Larry Finger, linux-wireless

On Wednesday 08 August 2007 08:02:29 Larry Finger wrote:
> Larry Finger wrote:
> > Pavel Roskin wrote:
> >> This can happen if CONFIG_BCM43XX_MAC80211_DEBUG is enabled, but
> >> CONFIG_DEBUG_FS is not.
> >>
> >> Signed-off-by: Pavel Roskin <proski@gnu.org>
> >> ---
> >>
> > With this patch installed, and the DEBUG configuration set as above, I get a kernel panic on an 
> > x86_64 SMP system. The reason for the panic scrolled off the screen, but the complete stack dump 
> > (hand copied) is as follows:
> > 
> > lock_acquire+0x85/0x31
> > bcm43xx_mac80211: bcm43xx_debugfs_log_txstat+0x5a/099
> > _spin_lock+0x25/0x31
> 
> Ignore the noise above. I had failed to get the right patch. The crash confirms the problem 
> _without_ the patch. Getting it in properly fixes the problem
> 
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Yeah, I just noticed that, too :)
So, I applied it to my queue and it will soon go upstream.
http://bu3sch.de/patches/wireless-dev/LATEST/patches/

-- 
Greetings Michael.

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

* Re: [PATCH] Fix handling of failure to create debugfs directory
  2007-08-08  9:04 ` Michael Buesch
@ 2007-08-08 12:04   ` Larry Finger
  0 siblings, 0 replies; 7+ messages in thread
From: Larry Finger @ 2007-08-08 12:04 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Pavel Roskin, bcm43xx-dev, linux-wireless

Michael Buesch wrote:
> On Wednesday 08 August 2007 07:17:10 Pavel Roskin wrote:
>> This can happen if CONFIG_BCM43XX_MAC80211_DEBUG is enabled, but
>> CONFIG_DEBUG_FS is not.
>>
>> Signed-off-by: Pavel Roskin <proski@gnu.org>
>> ---
> 
> Thanks, queued.
> Larry, this might also apply to bcm4301.

Yes it will. Thanks,

Larry


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

end of thread, other threads:[~2007-08-08 12:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-08  5:17 [PATCH] Fix handling of failure to create debugfs directory Pavel Roskin
2007-08-08  5:52 ` Larry Finger
2007-08-08  6:02   ` Larry Finger
2007-08-08 11:16     ` Michael Buesch
2007-08-08 10:38   ` Michael Buesch
2007-08-08  9:04 ` Michael Buesch
2007-08-08 12:04   ` Larry Finger

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).