From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mga01.intel.com ([192.55.52.88]:40742 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751477Ab1GZN7D (ORCPT ); Tue, 26 Jul 2011 09:59:03 -0400 Subject: Re: [PATCH] iwlagn: check for !priv->txq in iwlagn_wait_tx_queue_empty From: "Guy, Wey-Yi" To: Keith Packard Cc: Intel Linux Wireless , "linux-wireless@vger.kernel.org" , "linux-kernel@vger.kernel.org" In-Reply-To: References: <1311622702-4807-1-git-send-email-keithp@keithp.com> <1311621715.5579.138.camel@wwguy-huron> <1311627547.13973.2.camel@wwguy-ubuntu> Content-Type: text/plain; charset="UTF-8" Date: Tue, 26 Jul 2011 06:22:08 -0700 Message-ID: <1311686528.5579.145.camel@wwguy-huron> (sfid-20110726_155907_384370_6BECBC6F) Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Mon, 2011-07-25 at 23:45 -0700, Keith Packard wrote: > On Mon, 25 Jul 2011 13:59:07 -0700, wwguy wrote: > > On Mon, 2011-07-25 at 13:03 -0700, Keith Packard wrote: > > > On Mon, 25 Jul 2011 12:21:55 -0700, "Guy, Wey-Yi" wrote: > > > > > > > but why you need it?, "start device" call will fail if can not allocate > > > > priv->txq > > > > > > The device is down, so start_device was never called. At least, that's > > > my assumption -- I've got the wireless device 'disabled' in > > > NetworkManager. > > > > > > the iwlagn_wait_tx_queue_empty() function only can be call from either > > "flush" operation or from debugfs. I agree it is a problem if call from > > debugfs. did you actually see the problem when it is not from > > debugfs(). > > Yes. Here's the stack trace, which is from a suspend operation: > > [ 503.649555] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 > [ 503.649713] IP: [] iwlagn_wait_tx_queue_empty+0x4b/0xe0 [iwlagn] > [ 503.649824] PGD 21ded3067 PUD 223bc9067 PMD 0 > [ 503.649906] Oops: 0000 [#1] SMP > [ 503.649969] CPU 0 > [ 503.649997] Modules linked in: netconsole configfs cpufreq_stats rfcomm bnep binfmt_misc decnet uinput fuse nfsd expo > rtfs nfs lockd fscache auth_rpcgss nfs_acl sunrpc firewire_sbp2 firewire_core crc_itu_t loop acpi_cpufreq mperf usbhid h > id snd_hda_codec_hdmi snd_hda_codec_conexant btusb bluetooth snd_hda_intel snd_hda_codec snd_hwdep arc4 snd_pcm_oss snd_ > mixer_oss snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event battery snd_seq thinkpad_acpi nvram ac snd_timer power_sup > ply snd_seq_device tpm_tis tpm tpm_bios iwlagn psmouse snd evdev i915 mac80211 serio_raw i2c_i801 cfg80211 drm_kms_helpe > r drm rfkill ehci_hcd sdhci_pci sdhci i2c_algo_bit soundcore i2c_core usbcore mmc_core snd_page_alloc e1000e button vide > o thermal processor thermal_sys > [ 503.651329] > [ 503.651357] Pid: 3122, comm: bash Not tainted 3.0.0-00141-g2bb84e0 #110 LENOVO 4286CTO/4286CTO > [ 503.651478] RIP: 0010:[] [] iwlagn_wait_tx_queue_empty+0x4b/0xe0 [iwlagn] > [ 503.651603] RSP: 0018:ffff88022388dce8 EFLAGS: 00010202 > [ 503.651666] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 > [ 503.651744] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88022f741ce0 > [ 503.651823] RBP: 0000000100031d64 R08: dead000000200200 R09: 0000000000000001 > [ 503.651900] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 > [ 503.651977] R13: ffff88022f741ce0 R14: 0000000000000000 R15: ffff88022f740768 > [ 503.652056] FS: 0000000000000000(0000) GS:ffff88023e200000(0063) knlGS:00000000f757c6c0 > [ 503.652144] CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 > [ 503.652208] CR2: 0000000000000004 CR3: 000000021ddf0000 CR4: 00000000000406f0 > [ 503.652285] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 > [ 503.652362] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 > [ 503.652441] Process bash (pid: 3122, threadinfo ffff88022388c000, task ffff88021ddae770) > [ 503.652526] Stack: > [ 503.652557] ffffffff81885740 ffff88022f741ce0 ffff88022f742718 0000000000000000 > [ 503.652671] ffff88022f740798 ffffffffa0250772 ffff88022f740798 ffff88022f740520 > [ 503.652784] 0000000000000000 ffffffffa0230521 ffffffff81983e40 ffff88022f740288 > [ 503.652895] Call Trace: > [ 503.652941] [] ? iwlagn_mac_flush+0x72/0xb0 [iwlagn] > [ 503.653028] [] ? __ieee80211_suspend+0x51/0x300 [mac80211] > [ 503.653119] [] ? wiphy_suspend+0x48/0x60 [cfg80211] > [ 503.653198] [] ? device_pm_wait_for_dev+0x30/0x30 > [ 503.653278] [] ? index_show+0x30/0x30 [cfg80211] > [ 503.653351] [] ? legacy_suspend+0x31/0x70 > [ 503.653419] [] ? __device_suspend+0x12f/0x170 > [ 503.653489] [] ? dpm_suspend+0x48/0x1b0 > [ 503.653559] [] ? suspend_devices_and_enter+0x7f/0x2c0 > [ 503.653636] [] ? enter_state+0x11d/0x150 > [ 503.656541] [] ? state_store+0xc2/0x100 > [ 503.659454] [] ? sysfs_write_file+0xe1/0x170 > [ 503.662310] [] ? vfs_write+0xae/0x180 > [ 503.665125] [] ? sys_write+0x47/0x90 > [ 503.667903] [] ? page_fault+0x25/0x30 > [ 503.671084] [] ? sysenter_dispatch+0x7/0x2e > [ 503.673924] Code: 31 e4 66 0f 1f 44 00 00 41 0f b6 85 69 0a 00 00 44 39 e0 74 56 49 8b b5 08 3f 00 00 49 63 c4 48 8d > 14 80 48 8d 1c 50 48 8d 1c de <8b> 43 04 39 43 08 75 17 eb 36 0f 1f 00 bf 01 00 00 00 e8 be 1e > [ 503.680651] RIP [] iwlagn_wait_tx_queue_empty+0x4b/0xe0 [iwlagn] > [ 503.683809] RSP > [ 503.686906] CR2: 0000000000000004 > [ 503.690267] ---[ end trace 513210ed9b54a44b ]--- > > > there is a recent patch in mac80211 to make sure do not call "flush" is > > not needed. > > If that avoids calling iwlagn_mac_flush when the interface isn't > running, that should work. I'd appreciate a pointer to the patch so I > can test it. please apply this patch in wireless-next-2.6 commit 94f9b97be5b3bf67392e43fb7f567721b09142c2 Author: Johannes Berg Date: Thu Jul 14 16:48:54 2011 +0200 mac80211: be more careful in suspend/resume Thanks Wey >