linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
@ 2011-08-01 19:46 Wey-Yi Guy
  2011-08-02  3:53 ` Daniel Halperin
  0 siblings, 1 reply; 16+ messages in thread
From: Wey-Yi Guy @ 2011-08-01 19:46 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Emmanuel Grumbach, Wey-Yi Guy

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

This bug has been introduced by:
d593411084a56124aa9d80aafa15db8463b2d8f7
Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Date:   Mon Jul 11 10:48:51 2011 +0300

    iwlagn: simplify the bus architecture

Revert part of the buggy patch: dev_get_drvdata will now return
iwl_priv as it did before the patch.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Tested-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-pci.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index fb7e436..69d4ec4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -134,6 +134,7 @@ static void iwl_pci_apm_config(struct iwl_bus *bus)
 static void iwl_pci_set_drv_data(struct iwl_bus *bus, void *drv_data)
 {
 	bus->drv_data = drv_data;
+	pci_set_drvdata(IWL_BUS_GET_PCI_DEV(bus), drv_data);
 }
 
 static void iwl_pci_get_hw_id(struct iwl_bus *bus, char buf[],
@@ -454,8 +455,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		pci_write_config_word(pdev, PCI_COMMAND, pci_cmd);
 	}
 
-	pci_set_drvdata(pdev, bus);
-
 	bus->dev = &pdev->dev;
 	bus->irq = pdev->irq;
 	bus->ops = &pci_ops;
@@ -494,11 +493,12 @@ static void iwl_pci_down(struct iwl_bus *bus)
 
 static void __devexit iwl_pci_remove(struct pci_dev *pdev)
 {
-	struct iwl_bus *bus = pci_get_drvdata(pdev);
+	struct iwl_priv *priv = pci_get_drvdata(pdev);
+	void *bus_specific = priv->bus->bus_specific;
 
-	iwl_remove(bus->drv_data);
+	iwl_remove(priv);
 
-	iwl_pci_down(bus);
+	iwl_pci_down(bus_specific);
 }
 
 #ifdef CONFIG_PM
@@ -506,20 +506,20 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev)
 static int iwl_pci_suspend(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_bus *bus = pci_get_drvdata(pdev);
+	struct iwl_priv *priv = pci_get_drvdata(pdev);
 
 	/* Before you put code here, think about WoWLAN. You cannot check here
 	 * whether WoWLAN is enabled or not, and your code will run even if
 	 * WoWLAN is enabled - don't kill the NIC, someone may need it in Sx.
 	 */
 
-	return iwl_suspend(bus->drv_data);
+	return iwl_suspend(priv);
 }
 
 static int iwl_pci_resume(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
-	struct iwl_bus *bus = pci_get_drvdata(pdev);
+	struct iwl_priv *priv = pci_get_drvdata(pdev);
 
 	/* Before you put code here, think about WoWLAN. You cannot check here
 	 * whether WoWLAN is enabled or not, and your code will run even if
@@ -532,7 +532,7 @@ static int iwl_pci_resume(struct device *device)
 	 */
 	pci_write_config_byte(pdev, PCI_CFG_RETRY_TIMEOUT, 0x00);
 
-	return iwl_resume(bus->drv_data);
+	return iwl_resume(priv);
 }
 
 static SIMPLE_DEV_PM_OPS(iwl_dev_pm_ops, iwl_pci_suspend, iwl_pci_resume);
-- 
1.7.1


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

* Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-01 19:46 [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer Wey-Yi Guy
@ 2011-08-02  3:53 ` Daniel Halperin
  2011-08-02  5:50   ` Grumbach, Emmanuel
  0 siblings, 1 reply; 16+ messages in thread
From: Daniel Halperin @ 2011-08-02  3:53 UTC (permalink / raw)
  To: Wey-Yi Guy; +Cc: linville, linux-wireless, Emmanuel Grumbach

On Mon, Aug 1, 2011 at 12:46 PM, Wey-Yi Guy <wey-yi.w.guy@intel.com> wrote:
> From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>
> This bug has been introduced by:
> d593411084a56124aa9d80aafa15db8463b2d8f7
> Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> Date:   Mon Jul 11 10:48:51 2011 +0300
>
>    iwlagn: simplify the bus architecture
>

Believe this fix needs to go to 3.0-stable too.

Dan

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

* RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-02  3:53 ` Daniel Halperin
@ 2011-08-02  5:50   ` Grumbach, Emmanuel
  2011-08-02  6:39     ` Daniel Halperin
  0 siblings, 1 reply; 16+ messages in thread
From: Grumbach, Emmanuel @ 2011-08-02  5:50 UTC (permalink / raw)
  To: Daniel Halperin, Guy, Wey-Yi W
  Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org

PiAKPiBPbiBNb24sIEF1ZyAxLCAyMDExIGF0IDEyOjQ2IFBNLCBXZXktWWkgR3V5IDx3ZXkteWku
dy5ndXlAaW50ZWwuY29tPiB3cm90ZToKPiA+IEZyb206IEVtbWFudWVsIEdydW1iYWNoIDxlbW1h
bnVlbC5ncnVtYmFjaEBpbnRlbC5jb20+Cj4gPgo+ID4gVGhpcyBidWcgaGFzIGJlZW4gaW50cm9k
dWNlZCBieToKPiA+IGQ1OTM0MTEwODRhNTYxMjRhYTlkODBhYWZhMTVkYjg0NjNiMmQ4ZjcKPiA+
IEF1dGhvcjogRW1tYW51ZWwgR3J1bWJhY2ggPGVtbWFudWVsLmdydW1iYWNoQGludGVsLmNvbT4K
PiA+IERhdGU6IKAgTW9uIEp1bCAxMSAxMDo0ODo1MSAyMDExICswMzAwCj4gPgo+ID4goCCgaXds
YWduOiBzaW1wbGlmeSB0aGUgYnVzIGFyY2hpdGVjdHVyZQo+ID4KPiAKPiBCZWxpZXZlIHRoaXMg
Zml4IG5lZWRzIHRvIGdvIHRvIDMuMC1zdGFibGUgdG9vLgo+IAoKVGhlIGJ1Z2d5IHBhdGNoIGhh
c24ndCBtYWRlIGl0IHRvIDMuMC4gVGhlIGJ1ZyB3YXMgaW50cm9kdWNlZCBpbiAzLjEKLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tCkludGVsIElzcmFlbCAoNzQpIExpbWl0ZWQKClRoaXMgZS1tYWlsIGFuZCBhbnkgYXR0
YWNobWVudHMgbWF5IGNvbnRhaW4gY29uZmlkZW50aWFsIG1hdGVyaWFsIGZvcgp0aGUgc29sZSB1
c2Ugb2YgdGhlIGludGVuZGVkIHJlY2lwaWVudChzKS4gQW55IHJldmlldyBvciBkaXN0cmlidXRp
b24KYnkgb3RoZXJzIGlzIHN0cmljdGx5IHByb2hpYml0ZWQuIElmIHlvdSBhcmUgbm90IHRoZSBp
bnRlbmRlZApyZWNpcGllbnQsIHBsZWFzZSBjb250YWN0IHRoZSBzZW5kZXIgYW5kIGRlbGV0ZSBh
bGwgY29waWVzLgo=


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

* Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-02  5:50   ` Grumbach, Emmanuel
@ 2011-08-02  6:39     ` Daniel Halperin
  2011-08-04 20:55       ` Daniel Halperin
  0 siblings, 1 reply; 16+ messages in thread
From: Daniel Halperin @ 2011-08-02  6:39 UTC (permalink / raw)
  To: Grumbach, Emmanuel
  Cc: Guy, Wey-Yi W, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

ACK, you're right.

2011/8/1 Grumbach, Emmanuel <emmanuel.grumbach@intel.com>:
>>
>> On Mon, Aug 1, 2011 at 12:46 PM, Wey-Yi Guy <wey-yi.w.guy@intel.com> wrote:
>> > From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>> >
>> > This bug has been introduced by:
>> > d593411084a56124aa9d80aafa15db8463b2d8f7
>> > Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
>> > Date:   Mon Jul 11 10:48:51 2011 +0300
>> >
>> >    iwlagn: simplify the bus architecture
>> >
>>
>> Believe this fix needs to go to 3.0-stable too.
>>
>
> The buggy patch hasn't made it to 3.0. The bug was introduced in 3.1
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>

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

* Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-02  6:39     ` Daniel Halperin
@ 2011-08-04 20:55       ` Daniel Halperin
  2011-08-04 23:15         ` Guy, Wey-Yi
  0 siblings, 1 reply; 16+ messages in thread
From: Daniel Halperin @ 2011-08-04 20:55 UTC (permalink / raw)
  To: Grumbach, Emmanuel
  Cc: Guy, Wey-Yi W, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

I may have spoken too soon. I didn't try until today, and I get the
following on remove module:

Aug  4 13:51:42 testbed11 kernel: [   45.321809] iwlwifi: connector
callback deregistered
Aug  4 13:51:42 testbed11 kernel: [   45.550202] *pde = 00000000
Aug  4 13:51:42 testbed11 kernel: [   45.550249] Modules linked in:
arc4 iwlagn(-) mac80211 cfg80211 i915 fbcon tileblit font bitblit
softcursor drm_kms_helper drm i2c_algo_bit cfbcopyarea i2c_core
intel_agp intel_gtt dcdbas loop video cfbimgblt cfbfillrect agpgart
evdev sg sr_mod sd_mod cdrom usbhid hid e1000e ahci libahci uhci_hcd
Aug  4 13:51:42 testbed11 kernel: [   45.550488]
Aug  4 13:51:42 testbed11 kernel: [   45.550501] Pid: 1022, comm:
rmmod Tainted: G        W   3.0.0-csitool+ #46 Dell Inc. Inspiron
530/0RY007
Aug  4 13:51:42 testbed11 kernel: [   45.550558] EIP:
0060:[<c032cf08>] EFLAGS: 00010202 CPU: 0
Aug  4 13:51:42 testbed11 kernel: [   45.550588] EIP is at
pci_disable_msi+0x18/0x40
Aug  4 13:51:42 testbed11 kernel: [   45.550613] EAX: 00000001 EBX:
fddfe000 ECX: 000017db EDX: 000017da
Aug  4 13:51:42 testbed11 kernel: [   45.550647] ESI: f3ec6350 EDI:
f3ec6360 EBP: f4201e98 ESP: f4201e94
Aug  4 13:51:42 testbed11 kernel: [   45.550680]  DS: 007b ES: 007b
FS: 00d8 GS: 0033 SS: 0068
Aug  4 13:51:42 testbed11 kernel: [   45.550760]  f3ec6340 f4201eac
f85036af f4d53460 f4d53400 f4d53518 f4201ecc c0323394
Aug  4 13:51:42 testbed11 kernel: [   45.550824]  f8516010 f8515fe0
f4201ecc f4d53460 f8516010 f4d53494 f4201edc c039281b
Aug  4 13:51:42 testbed11 kernel: [   45.550887]  f4d53460 f8516010
f4201ef0 c03928f7 00000000 f8516010 c06167a0 f4201f04
Aug  4 13:51:42 testbed11 kernel: [   45.550973]  [<f85036af>]
iwl_pci_remove+0x27/0x7f [iwlagn]
Aug  4 13:51:42 testbed11 kernel: [   45.551005]  [<c0323394>]
pci_device_remove+0x44/0x100
Aug  4 13:51:42 testbed11 kernel: [   45.551036]  [<c039281b>]
__device_release_driver+0x5b/0xb0
Aug  4 13:51:42 testbed11 kernel: [   45.551066]  [<c03928f7>]
driver_detach+0x87/0x90
Aug  4 13:51:42 testbed11 kernel: [   45.551093]  [<c0391b43>]
bus_remove_driver+0x63/0xa0
Aug  4 13:51:42 testbed11 kernel: [   45.551121]  [<c0392fa9>]
driver_unregister+0x49/0x80
Aug  4 13:51:42 testbed11 kernel: [   45.551150]  [<c0254a04>] ?
sysfs_remove_file+0x14/0x20
Aug  4 13:51:42 testbed11 kernel: [   45.551179]  [<c0323672>]
pci_unregister_driver+0x32/0x80
Aug  4 13:51:42 testbed11 kernel: [   45.551216]  [<f84f27e2>]
iwl_pci_unregister_driver+0x12/0x20 [iwlagn]
Aug  4 13:51:42 testbed11 kernel: [   45.551257]  [<f8503475>]
iwl_exit+0xd/0x14 [iwlagn]
Aug  4 13:51:42 testbed11 kernel: [   45.551286]  [<c01752d1>]
sys_delete_module+0x121/0x1d0
Aug  4 13:51:42 testbed11 kernel: [   45.551316]  [<c01e2052>] ?
do_munmap+0x212/0x2a0
Aug  4 13:51:42 testbed11 kernel: [   45.551344]  [<c04871cc>]
sysenter_do_call+0x12/0x22
Aug  4 13:51:42 testbed11 kernel: [   45.551726] ---[ end trace
cdd7f97709a5fcfb ]---


On Mon, Aug 1, 2011 at 11:39 PM, Daniel Halperin
<dhalperi@cs.washington.edu> wrote:
>
> ACK, you're right.
>
> 2011/8/1 Grumbach, Emmanuel <emmanuel.grumbach@intel.com>:
> >>
> >> On Mon, Aug 1, 2011 at 12:46 PM, Wey-Yi Guy <wey-yi.w.guy@intel.com> wrote:
> >> > From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> >> >
> >> > This bug has been introduced by:
> >> > d593411084a56124aa9d80aafa15db8463b2d8f7
> >> > Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> >> > Date:   Mon Jul 11 10:48:51 2011 +0300
> >> >
> >> >    iwlagn: simplify the bus architecture
> >> >
> >>
> >> Believe this fix needs to go to 3.0-stable too.
> >>
> >
> > The buggy patch hasn't made it to 3.0. The bug was introduced in 3.1
> > ---------------------------------------------------------------------
> > Intel Israel (74) Limited
> >
> > This e-mail and any attachments may contain confidential material for
> > the sole use of the intended recipient(s). Any review or distribution
> > by others is strictly prohibited. If you are not the intended
> > recipient, please contact the sender and delete all copies.
> >

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

* Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-04 20:55       ` Daniel Halperin
@ 2011-08-04 23:15         ` Guy, Wey-Yi
  2011-08-06  2:50           ` Pavel Roskin
  0 siblings, 1 reply; 16+ messages in thread
From: Guy, Wey-Yi @ 2011-08-04 23:15 UTC (permalink / raw)
  To: Daniel Halperin, emmanuel.grumbach
  Cc: Grumbach, Emmanuel, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

Emmanuel,

On Thu, 2011-08-04 at 13:55 -0700, Daniel Halperin wrote:
> I may have spoken too soon. I didn't try until today, and I get the
> following on remove module:
> 
> Aug  4 13:51:42 testbed11 kernel: [   45.321809] iwlwifi: connector
> callback deregistered
> Aug  4 13:51:42 testbed11 kernel: [   45.550202] *pde = 00000000
> Aug  4 13:51:42 testbed11 kernel: [   45.550249] Modules linked in:
> arc4 iwlagn(-) mac80211 cfg80211 i915 fbcon tileblit font bitblit
> softcursor drm_kms_helper drm i2c_algo_bit cfbcopyarea i2c_core
> intel_agp intel_gtt dcdbas loop video cfbimgblt cfbfillrect agpgart
> evdev sg sr_mod sd_mod cdrom usbhid hid e1000e ahci libahci uhci_hcd
> Aug  4 13:51:42 testbed11 kernel: [   45.550488]
> Aug  4 13:51:42 testbed11 kernel: [   45.550501] Pid: 1022, comm:
> rmmod Tainted: G        W   3.0.0-csitool+ #46 Dell Inc. Inspiron
> 530/0RY007
> Aug  4 13:51:42 testbed11 kernel: [   45.550558] EIP:
> 0060:[<c032cf08>] EFLAGS: 00010202 CPU: 0
> Aug  4 13:51:42 testbed11 kernel: [   45.550588] EIP is at
> pci_disable_msi+0x18/0x40
> Aug  4 13:51:42 testbed11 kernel: [   45.550613] EAX: 00000001 EBX:
> fddfe000 ECX: 000017db EDX: 000017da
> Aug  4 13:51:42 testbed11 kernel: [   45.550647] ESI: f3ec6350 EDI:
> f3ec6360 EBP: f4201e98 ESP: f4201e94
> Aug  4 13:51:42 testbed11 kernel: [   45.550680]  DS: 007b ES: 007b
> FS: 00d8 GS: 0033 SS: 0068
> Aug  4 13:51:42 testbed11 kernel: [   45.550760]  f3ec6340 f4201eac
> f85036af f4d53460 f4d53400 f4d53518 f4201ecc c0323394
> Aug  4 13:51:42 testbed11 kernel: [   45.550824]  f8516010 f8515fe0
> f4201ecc f4d53460 f8516010 f4d53494 f4201edc c039281b
> Aug  4 13:51:42 testbed11 kernel: [   45.550887]  f4d53460 f8516010
> f4201ef0 c03928f7 00000000 f8516010 c06167a0 f4201f04
> Aug  4 13:51:42 testbed11 kernel: [   45.550973]  [<f85036af>]
> iwl_pci_remove+0x27/0x7f [iwlagn]
> Aug  4 13:51:42 testbed11 kernel: [   45.551005]  [<c0323394>]
> pci_device_remove+0x44/0x100
> Aug  4 13:51:42 testbed11 kernel: [   45.551036]  [<c039281b>]
> __device_release_driver+0x5b/0xb0
> Aug  4 13:51:42 testbed11 kernel: [   45.551066]  [<c03928f7>]
> driver_detach+0x87/0x90
> Aug  4 13:51:42 testbed11 kernel: [   45.551093]  [<c0391b43>]
> bus_remove_driver+0x63/0xa0
> Aug  4 13:51:42 testbed11 kernel: [   45.551121]  [<c0392fa9>]
> driver_unregister+0x49/0x80
> Aug  4 13:51:42 testbed11 kernel: [   45.551150]  [<c0254a04>] ?
> sysfs_remove_file+0x14/0x20
> Aug  4 13:51:42 testbed11 kernel: [   45.551179]  [<c0323672>]
> pci_unregister_driver+0x32/0x80
> Aug  4 13:51:42 testbed11 kernel: [   45.551216]  [<f84f27e2>]
> iwl_pci_unregister_driver+0x12/0x20 [iwlagn]
> Aug  4 13:51:42 testbed11 kernel: [   45.551257]  [<f8503475>]
> iwl_exit+0xd/0x14 [iwlagn]
> Aug  4 13:51:42 testbed11 kernel: [   45.551286]  [<c01752d1>]
> sys_delete_module+0x121/0x1d0
> Aug  4 13:51:42 testbed11 kernel: [   45.551316]  [<c01e2052>] ?
> do_munmap+0x212/0x2a0
> Aug  4 13:51:42 testbed11 kernel: [   45.551344]  [<c04871cc>]
> sysenter_do_call+0x12/0x22
> Aug  4 13:51:42 testbed11 kernel: [   45.551726] ---[ end trace
> cdd7f97709a5fcfb ]---
> 
> 
Could you look into this, we need to fix it for 3.1

Thanks
Wey



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

* Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-04 23:15         ` Guy, Wey-Yi
@ 2011-08-06  2:50           ` Pavel Roskin
  2011-08-06 18:17             ` Guy, Wey-Yi W
  0 siblings, 1 reply; 16+ messages in thread
From: Pavel Roskin @ 2011-08-06  2:50 UTC (permalink / raw)
  To: Guy, Wey-Yi
  Cc: Daniel Halperin, emmanuel.grumbach, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

On Thu, 04 Aug 2011 16:15:02 -0700
"Guy, Wey-Yi" <wey-yi.w.guy@intel.com> wrote:

> Could you look into this, we need to fix it for 3.1

The backtrace looked interesting to me, so I checked the code.

It looks like iwl_pci_down() badly needs to be merged with
iwl_pci_remove().  iwl_pci_down() is only called from iwl_pci_remove(),
and is struggles badly to get the data that iwl_pci_remove() already
has.  That may fix everything.  Unfortunately, I have no hardware to
test it.

pci_bus->pci_dev that iwl_pci_down() passes to pci_disable_msi() should
be the same as pdev in iwl_pci_remove().  And pdev should be valid
throughout the function.

Also, the use of the void pointer in iwl_pci_remove() seems
unjustified.  Specific pointers are always better.

-- 
Regards,
Pavel Roskin

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

* RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-06  2:50           ` Pavel Roskin
@ 2011-08-06 18:17             ` Guy, Wey-Yi W
  2011-08-06 19:43               ` Emmanuel Grumbach
  0 siblings, 1 reply; 16+ messages in thread
From: Guy, Wey-Yi W @ 2011-08-06 18:17 UTC (permalink / raw)
  To: Pavel Roskin, Grumbach, Emmanuel
  Cc: Daniel Halperin, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

Emmanuel,

Could you help since I don't have the system for next few weeks.

Thanks
Wey

-----Original Message-----
From: Pavel Roskin [mailto:proski@gnu.org]
Sent: Saturday, August 06, 2011 5:51 AM
To: Guy, Wey-Yi W
Cc: Daniel Halperin; Grumbach, Emmanuel; linville@tuxdriver.com; linux-wireless@vger.kernel.org
Subject: Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer

On Thu, 04 Aug 2011 16:15:02 -0700
"Guy, Wey-Yi" <wey-yi.w.guy@intel.com> wrote:

> Could you look into this, we need to fix it for 3.1

The backtrace looked interesting to me, so I checked the code.

It looks like iwl_pci_down() badly needs to be merged with
iwl_pci_remove().  iwl_pci_down() is only called from iwl_pci_remove(),
and is struggles badly to get the data that iwl_pci_remove() already
has.  That may fix everything.  Unfortunately, I have no hardware to
test it.

pci_bus->pci_dev that iwl_pci_down() passes to pci_disable_msi() should
be the same as pdev in iwl_pci_remove().  And pdev should be valid
throughout the function.

Also, the use of the void pointer in iwl_pci_remove() seems
unjustified.  Specific pointers are always better.

--
Regards,
Pavel Roskin

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

* Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-06 18:17             ` Guy, Wey-Yi W
@ 2011-08-06 19:43               ` Emmanuel Grumbach
  2011-08-06 19:45                 ` Grumbach, Emmanuel
                                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Emmanuel Grumbach @ 2011-08-06 19:43 UTC (permalink / raw)
  To: Guy, Wey-Yi W
  Cc: Pavel Roskin, Grumbach, Emmanuel, Daniel Halperin,
	linville@tuxdriver.com, linux-wireless@vger.kernel.org

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

Can you please try that one ?
I don't have my machine near me, and don't want to crash it remotely,
so I didn't test it. I will test in on Sunday.


diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c
b/drivers/net/wireless/iwlwifi/iwl-pci.c
index 69d4ec4..2fdbffa 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -478,27 +478,22 @@ out_no_pci:
 	return err;
 }

-static void iwl_pci_down(struct iwl_bus *bus)
-{
-	struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus->bus_specific;
-
-	pci_disable_msi(pci_bus->pci_dev);
-	pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base);
-	pci_release_regions(pci_bus->pci_dev);
-	pci_disable_device(pci_bus->pci_dev);
-	pci_set_drvdata(pci_bus->pci_dev, NULL);
-
-	kfree(bus);
-}
-
 static void __devexit iwl_pci_remove(struct pci_dev *pdev)
 {
 	struct iwl_priv *priv = pci_get_drvdata(pdev);
-	void *bus_specific = priv->bus->bus_specific;
+	struct iwl_bus *bus = priv->bus;
+	struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
+	struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);

 	iwl_remove(priv);

-	iwl_pci_down(bus_specific);
+	pci_disable_msi(pci_dev);
+	pci_iounmap(pci_dev, pci_bus->hw_base);
+	pci_release_regions(pci_dev);
+	pci_disable_device(pci_dev);
+	pci_set_drvdata(pci_dev, NULL);
+
+	kfree(bus);
 }

 #ifdef CONFIG_PM

[-- Attachment #2: pci_remove_fix.patch --]
[-- Type: application/octet-stream, Size: 1192 bytes --]

diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c
index 69d4ec4..2fdbffa 100644
--- a/drivers/net/wireless/iwlwifi/iwl-pci.c
+++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
@@ -478,27 +478,22 @@ out_no_pci:
 	return err;
 }
 
-static void iwl_pci_down(struct iwl_bus *bus)
-{
-	struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus->bus_specific;
-
-	pci_disable_msi(pci_bus->pci_dev);
-	pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base);
-	pci_release_regions(pci_bus->pci_dev);
-	pci_disable_device(pci_bus->pci_dev);
-	pci_set_drvdata(pci_bus->pci_dev, NULL);
-
-	kfree(bus);
-}
-
 static void __devexit iwl_pci_remove(struct pci_dev *pdev)
 {
 	struct iwl_priv *priv = pci_get_drvdata(pdev);
-	void *bus_specific = priv->bus->bus_specific;
+	struct iwl_bus *bus = priv->bus;
+	struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
+	struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
 
 	iwl_remove(priv);
 
-	iwl_pci_down(bus_specific);
+	pci_disable_msi(pci_dev);
+	pci_iounmap(pci_dev, pci_bus->hw_base);
+	pci_release_regions(pci_dev);
+	pci_disable_device(pci_dev);
+	pci_set_drvdata(pci_dev, NULL);
+
+	kfree(bus);
 }
 
 #ifdef CONFIG_PM

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

* RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-06 19:43               ` Emmanuel Grumbach
@ 2011-08-06 19:45                 ` Grumbach, Emmanuel
  2011-08-07  5:09                 ` Grumbach, Emmanuel
  2011-08-09 14:38                 ` Mohammed Shafi
  2 siblings, 0 replies; 16+ messages in thread
From: Grumbach, Emmanuel @ 2011-08-06 19:45 UTC (permalink / raw)
  To: Emmanuel Grumbach, Guy, Wey-Yi W
  Cc: Pavel Roskin, Daniel Halperin, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

On top of my previous patch of course (which actually fixed the previous bug, but added the one you are facing now...).

Thanks,
       Emmanuel


> -----Original Message-----
> From: Emmanuel Grumbach [mailto:egrumbach@gmail.com]
> Sent: Saturday, August 06, 2011 10:44 PM
> To: Guy, Wey-Yi W
> Cc: Pavel Roskin; Grumbach, Emmanuel; Daniel Halperin;
> linville@tuxdriver.com; linux-wireless@vger.kernel.org
> Subject: Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv
> pointer
> 
> Can you please try that one ?
> I don't have my machine near me, and don't want to crash it remotely, so I
> didn't test it. I will test in on Sunday.
> 
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c
> b/drivers/net/wireless/iwlwifi/iwl-pci.c
> index 69d4ec4..2fdbffa 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-pci.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
> @@ -478,27 +478,22 @@ out_no_pci:
>  	return err;
>  }
> 
> -static void iwl_pci_down(struct iwl_bus *bus) -{
> -	struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus-
> >bus_specific;
> -
> -	pci_disable_msi(pci_bus->pci_dev);
> -	pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base);
> -	pci_release_regions(pci_bus->pci_dev);
> -	pci_disable_device(pci_bus->pci_dev);
> -	pci_set_drvdata(pci_bus->pci_dev, NULL);
> -
> -	kfree(bus);
> -}
> -
>  static void __devexit iwl_pci_remove(struct pci_dev *pdev)  {
>  	struct iwl_priv *priv = pci_get_drvdata(pdev);
> -	void *bus_specific = priv->bus->bus_specific;
> +	struct iwl_bus *bus = priv->bus;
> +	struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
> +	struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
> 
>  	iwl_remove(priv);
> 
> -	iwl_pci_down(bus_specific);
> +	pci_disable_msi(pci_dev);
> +	pci_iounmap(pci_dev, pci_bus->hw_base);
> +	pci_release_regions(pci_dev);
> +	pci_disable_device(pci_dev);
> +	pci_set_drvdata(pci_dev, NULL);
> +
> +	kfree(bus);
>  }
> 
>  #ifdef CONFIG_PM
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


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

* RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-06 19:43               ` Emmanuel Grumbach
  2011-08-06 19:45                 ` Grumbach, Emmanuel
@ 2011-08-07  5:09                 ` Grumbach, Emmanuel
  2011-08-07  6:21                   ` Guy, Wey-Yi W
  2011-08-09 14:38                 ` Mohammed Shafi
  2 siblings, 1 reply; 16+ messages in thread
From: Grumbach, Emmanuel @ 2011-08-07  5:09 UTC (permalink / raw)
  To: Grumbach, Emmanuel, Emmanuel Grumbach, Guy, Wey-Yi W
  Cc: Pavel Roskin, Daniel Halperin, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

FWIW, the patch below solved the problem on my system.
Dan, please confirm you are happy with it.

The bug was introduced by the patch that fixed the sysfs issue.

Wey, John, do you think it would be better to revert my previous fix and send a combined patch that solves the sysfs issue and doesn't add the bug ? Or another patch on top of the buggy sysfs fix ?

Thanks,
       Emmanuel


> -----Original Message-----
> From: Grumbach, Emmanuel
> Sent: Saturday, August 06, 2011 10:46 PM
> To: Emmanuel Grumbach; Guy, Wey-Yi W
> Cc: Pavel Roskin; Daniel Halperin; linville@tuxdriver.com; linux-
> wireless@vger.kernel.org
> Subject: RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv
> pointer
> 
> On top of my previous patch of course (which actually fixed the previous
> bug, but added the one you are facing now...).
> 
> Thanks,
>        Emmanuel
> 
> 
> > -----Original Message-----
> > From: Emmanuel Grumbach [mailto:egrumbach@gmail.com]
> > Sent: Saturday, August 06, 2011 10:44 PM
> > To: Guy, Wey-Yi W
> > Cc: Pavel Roskin; Grumbach, Emmanuel; Daniel Halperin;
> > linville@tuxdriver.com; linux-wireless@vger.kernel.org
> > Subject: Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv
> > pointer
> >
> > Can you please try that one ?
> > I don't have my machine near me, and don't want to crash it remotely, so
> I
> > didn't test it. I will test in on Sunday.
> >
> >
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c
> > b/drivers/net/wireless/iwlwifi/iwl-pci.c
> > index 69d4ec4..2fdbffa 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-pci.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
> > @@ -478,27 +478,22 @@ out_no_pci:
> >  	return err;
> >  }
> >
> > -static void iwl_pci_down(struct iwl_bus *bus) -{
> > -	struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus-
> > >bus_specific;
> > -
> > -	pci_disable_msi(pci_bus->pci_dev);
> > -	pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base);
> > -	pci_release_regions(pci_bus->pci_dev);
> > -	pci_disable_device(pci_bus->pci_dev);
> > -	pci_set_drvdata(pci_bus->pci_dev, NULL);
> > -
> > -	kfree(bus);
> > -}
> > -
> >  static void __devexit iwl_pci_remove(struct pci_dev *pdev)  {
> >  	struct iwl_priv *priv = pci_get_drvdata(pdev);
> > -	void *bus_specific = priv->bus->bus_specific;
> > +	struct iwl_bus *bus = priv->bus;
> > +	struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
> > +	struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
> >
> >  	iwl_remove(priv);
> >
> > -	iwl_pci_down(bus_specific);
> > +	pci_disable_msi(pci_dev);
> > +	pci_iounmap(pci_dev, pci_bus->hw_base);
> > +	pci_release_regions(pci_dev);
> > +	pci_disable_device(pci_dev);
> > +	pci_set_drvdata(pci_dev, NULL);
> > +
> > +	kfree(bus);
> >  }
> >
> >  #ifdef CONFIG_PM
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


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

* RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-07  5:09                 ` Grumbach, Emmanuel
@ 2011-08-07  6:21                   ` Guy, Wey-Yi W
  2011-08-08 14:27                     ` John W. Linville
  0 siblings, 1 reply; 16+ messages in thread
From: Guy, Wey-Yi W @ 2011-08-07  6:21 UTC (permalink / raw)
  To: Grumbach, Emmanuel, Emmanuel Grumbach
  Cc: Pavel Roskin, Daniel Halperin, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

I will like to combine the patches if it's ok for John.

Wey

-----Original Message-----
From: Grumbach, Emmanuel
Sent: Sunday, August 07, 2011 8:09 AM
To: Grumbach, Emmanuel; Emmanuel Grumbach; Guy, Wey-Yi W
Cc: Pavel Roskin; Daniel Halperin; linville@tuxdriver.com; linux-wireless@vger.kernel.org
Subject: RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer

FWIW, the patch below solved the problem on my system.
Dan, please confirm you are happy with it.

The bug was introduced by the patch that fixed the sysfs issue.

Wey, John, do you think it would be better to revert my previous fix and send a combined patch that solves the sysfs issue and doesn't add the bug ? Or another patch on top of the buggy sysfs fix ?

Thanks,
       Emmanuel


> -----Original Message-----
> From: Grumbach, Emmanuel
> Sent: Saturday, August 06, 2011 10:46 PM
> To: Emmanuel Grumbach; Guy, Wey-Yi W
> Cc: Pavel Roskin; Daniel Halperin; linville@tuxdriver.com; linux-
> wireless@vger.kernel.org
> Subject: RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv
> pointer
>
> On top of my previous patch of course (which actually fixed the previous
> bug, but added the one you are facing now...).
>
> Thanks,
>        Emmanuel
>
>
> > -----Original Message-----
> > From: Emmanuel Grumbach [mailto:egrumbach@gmail.com]
> > Sent: Saturday, August 06, 2011 10:44 PM
> > To: Guy, Wey-Yi W
> > Cc: Pavel Roskin; Grumbach, Emmanuel; Daniel Halperin;
> > linville@tuxdriver.com; linux-wireless@vger.kernel.org
> > Subject: Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv
> > pointer
> >
> > Can you please try that one ?
> > I don't have my machine near me, and don't want to crash it remotely, so
> I
> > didn't test it. I will test in on Sunday.
> >
> >
> > diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c
> > b/drivers/net/wireless/iwlwifi/iwl-pci.c
> > index 69d4ec4..2fdbffa 100644
> > --- a/drivers/net/wireless/iwlwifi/iwl-pci.c
> > +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
> > @@ -478,27 +478,22 @@ out_no_pci:
> >     return err;
> >  }
> >
> > -static void iwl_pci_down(struct iwl_bus *bus) -{
> > -   struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus-
> > >bus_specific;
> > -
> > -   pci_disable_msi(pci_bus->pci_dev);
> > -   pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base);
> > -   pci_release_regions(pci_bus->pci_dev);
> > -   pci_disable_device(pci_bus->pci_dev);
> > -   pci_set_drvdata(pci_bus->pci_dev, NULL);
> > -
> > -   kfree(bus);
> > -}
> > -
> >  static void __devexit iwl_pci_remove(struct pci_dev *pdev)  {
> >     struct iwl_priv *priv = pci_get_drvdata(pdev);
> > -   void *bus_specific = priv->bus->bus_specific;
> > +   struct iwl_bus *bus = priv->bus;
> > +   struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
> > +   struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
> >
> >     iwl_remove(priv);
> >
> > -   iwl_pci_down(bus_specific);
> > +   pci_disable_msi(pci_dev);
> > +   pci_iounmap(pci_dev, pci_bus->hw_base);
> > +   pci_release_regions(pci_dev);
> > +   pci_disable_device(pci_dev);
> > +   pci_set_drvdata(pci_dev, NULL);
> > +
> > +   kfree(bus);
> >  }
> >
> >  #ifdef CONFIG_PM

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

* Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-07  6:21                   ` Guy, Wey-Yi W
@ 2011-08-08 14:27                     ` John W. Linville
  2011-08-08 16:19                       ` Grumbach, Emmanuel
  0 siblings, 1 reply; 16+ messages in thread
From: John W. Linville @ 2011-08-08 14:27 UTC (permalink / raw)
  To: Guy, Wey-Yi W
  Cc: Grumbach, Emmanuel, Emmanuel Grumbach, Pavel Roskin,
	Daniel Halperin, linux-wireless@vger.kernel.org

Sure, that sounds great.

On Sat, Aug 06, 2011 at 11:21:42PM -0700, Guy, Wey-Yi W wrote:
> I will like to combine the patches if it's ok for John.
> 
> Wey
> 
> -----Original Message-----
> From: Grumbach, Emmanuel
> Sent: Sunday, August 07, 2011 8:09 AM
> To: Grumbach, Emmanuel; Emmanuel Grumbach; Guy, Wey-Yi W
> Cc: Pavel Roskin; Daniel Halperin; linville@tuxdriver.com; linux-wireless@vger.kernel.org
> Subject: RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
> 
> FWIW, the patch below solved the problem on my system.
> Dan, please confirm you are happy with it.
> 
> The bug was introduced by the patch that fixed the sysfs issue.
> 
> Wey, John, do you think it would be better to revert my previous fix and send a combined patch that solves the sysfs issue and doesn't add the bug ? Or another patch on top of the buggy sysfs fix ?
> 
> Thanks,
>        Emmanuel
> 
> 
> > -----Original Message-----
> > From: Grumbach, Emmanuel
> > Sent: Saturday, August 06, 2011 10:46 PM
> > To: Emmanuel Grumbach; Guy, Wey-Yi W
> > Cc: Pavel Roskin; Daniel Halperin; linville@tuxdriver.com; linux-
> > wireless@vger.kernel.org
> > Subject: RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv
> > pointer
> >
> > On top of my previous patch of course (which actually fixed the previous
> > bug, but added the one you are facing now...).
> >
> > Thanks,
> >        Emmanuel
> >
> >
> > > -----Original Message-----
> > > From: Emmanuel Grumbach [mailto:egrumbach@gmail.com]
> > > Sent: Saturday, August 06, 2011 10:44 PM
> > > To: Guy, Wey-Yi W
> > > Cc: Pavel Roskin; Grumbach, Emmanuel; Daniel Halperin;
> > > linville@tuxdriver.com; linux-wireless@vger.kernel.org
> > > Subject: Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv
> > > pointer
> > >
> > > Can you please try that one ?
> > > I don't have my machine near me, and don't want to crash it remotely, so
> > I
> > > didn't test it. I will test in on Sunday.
> > >
> > >
> > > diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c
> > > b/drivers/net/wireless/iwlwifi/iwl-pci.c
> > > index 69d4ec4..2fdbffa 100644
> > > --- a/drivers/net/wireless/iwlwifi/iwl-pci.c
> > > +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
> > > @@ -478,27 +478,22 @@ out_no_pci:
> > >     return err;
> > >  }
> > >
> > > -static void iwl_pci_down(struct iwl_bus *bus) -{
> > > -   struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus-
> > > >bus_specific;
> > > -
> > > -   pci_disable_msi(pci_bus->pci_dev);
> > > -   pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base);
> > > -   pci_release_regions(pci_bus->pci_dev);
> > > -   pci_disable_device(pci_bus->pci_dev);
> > > -   pci_set_drvdata(pci_bus->pci_dev, NULL);
> > > -
> > > -   kfree(bus);
> > > -}
> > > -
> > >  static void __devexit iwl_pci_remove(struct pci_dev *pdev)  {
> > >     struct iwl_priv *priv = pci_get_drvdata(pdev);
> > > -   void *bus_specific = priv->bus->bus_specific;
> > > +   struct iwl_bus *bus = priv->bus;
> > > +   struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
> > > +   struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
> > >
> > >     iwl_remove(priv);
> > >
> > > -   iwl_pci_down(bus_specific);
> > > +   pci_disable_msi(pci_dev);
> > > +   pci_iounmap(pci_dev, pci_bus->hw_base);
> > > +   pci_release_regions(pci_dev);
> > > +   pci_disable_device(pci_dev);
> > > +   pci_set_drvdata(pci_dev, NULL);
> > > +
> > > +   kfree(bus);
> > >  }
> > >
> > >  #ifdef CONFIG_PM
> --
> 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
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

* RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-08 14:27                     ` John W. Linville
@ 2011-08-08 16:19                       ` Grumbach, Emmanuel
  0 siblings, 0 replies; 16+ messages in thread
From: Grumbach, Emmanuel @ 2011-08-08 16:19 UTC (permalink / raw)
  To: John W. Linville, Guy, Wey-Yi W
  Cc: Emmanuel Grumbach, Pavel Roskin, Daniel Halperin,
	linux-wireless@vger.kernel.org

> 
> Sure, that sounds great.

Ok, I am OOO tomorrow, so it will wait until Wednesday.


> 
> On Sat, Aug 06, 2011 at 11:21:42PM -0700, Guy, Wey-Yi W wrote:
> > I will like to combine the patches if it's ok for John.
> >
> > Wey
> >
> > -----Original Message-----
> > From: Grumbach, Emmanuel
> > Sent: Sunday, August 07, 2011 8:09 AM
> > To: Grumbach, Emmanuel; Emmanuel Grumbach; Guy, Wey-Yi W
> > Cc: Pavel Roskin; Daniel Halperin; linville@tuxdriver.com; linux-
> wireless@vger.kernel.org
> > Subject: RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv
> pointer
> >
> > FWIW, the patch below solved the problem on my system.
> > Dan, please confirm you are happy with it.
> >
> > The bug was introduced by the patch that fixed the sysfs issue.
> >
> > Wey, John, do you think it would be better to revert my previous fix and
> send a combined patch that solves the sysfs issue and doesn't add the bug ?
> Or another patch on top of the buggy sysfs fix ?
> >
> > Thanks,
> >        Emmanuel
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


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

* Re: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-06 19:43               ` Emmanuel Grumbach
  2011-08-06 19:45                 ` Grumbach, Emmanuel
  2011-08-07  5:09                 ` Grumbach, Emmanuel
@ 2011-08-09 14:38                 ` Mohammed Shafi
  2011-08-09 19:23                   ` Grumbach, Emmanuel
  2 siblings, 1 reply; 16+ messages in thread
From: Mohammed Shafi @ 2011-08-09 14:38 UTC (permalink / raw)
  To: Emmanuel Grumbach
  Cc: Guy, Wey-Yi W, Pavel Roskin, Grumbach, Emmanuel, Daniel Halperin,
	linville@tuxdriver.com, linux-wireless@vger.kernel.org

On Sun, Aug 7, 2011 at 1:13 AM, Emmanuel Grumbach <egrumbach@gmail.com> wrote:
> Can you please try that one ?
> I don't have my machine near me, and don't want to crash it remotely,
> so I didn't test it. I will test in on Sunday.

Hi Emmanuel,

I also got the same kernel panic when unloading the iwlagn module for
my inbuilt laptop card and i tried the attached patch and it seems to
fix it.


>
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c
> b/drivers/net/wireless/iwlwifi/iwl-pci.c
> index 69d4ec4..2fdbffa 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-pci.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c
> @@ -478,27 +478,22 @@ out_no_pci:
>        return err;
>  }
>
> -static void iwl_pci_down(struct iwl_bus *bus)
> -{
> -       struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus->bus_specific;
> -
> -       pci_disable_msi(pci_bus->pci_dev);
> -       pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base);
> -       pci_release_regions(pci_bus->pci_dev);
> -       pci_disable_device(pci_bus->pci_dev);
> -       pci_set_drvdata(pci_bus->pci_dev, NULL);
> -
> -       kfree(bus);
> -}
> -
>  static void __devexit iwl_pci_remove(struct pci_dev *pdev)
>  {
>        struct iwl_priv *priv = pci_get_drvdata(pdev);
> -       void *bus_specific = priv->bus->bus_specific;
> +       struct iwl_bus *bus = priv->bus;
> +       struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus);
> +       struct pci_dev *pci_dev = IWL_BUS_GET_PCI_DEV(bus);
>
>        iwl_remove(priv);
>
> -       iwl_pci_down(bus_specific);
> +       pci_disable_msi(pci_dev);
> +       pci_iounmap(pci_dev, pci_bus->hw_base);
> +       pci_release_regions(pci_dev);
> +       pci_disable_device(pci_dev);
> +       pci_set_drvdata(pci_dev, NULL);
> +
> +       kfree(bus);
>  }
>
>  #ifdef CONFIG_PM
>



-- 
shafi

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

* RE: [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer
  2011-08-09 14:38                 ` Mohammed Shafi
@ 2011-08-09 19:23                   ` Grumbach, Emmanuel
  0 siblings, 0 replies; 16+ messages in thread
From: Grumbach, Emmanuel @ 2011-08-09 19:23 UTC (permalink / raw)
  To: Mohammed Shafi, Emmanuel Grumbach
  Cc: Guy, Wey-Yi W, Pavel Roskin, Daniel Halperin,
	linville@tuxdriver.com, linux-wireless@vger.kernel.org

> 
> On Sun, Aug 7, 2011 at 1:13 AM, Emmanuel Grumbach <egrumbach@gmail.com>
> wrote:
> > Can you please try that one ?
> > I don't have my machine near me, and don't want to crash it remotely,
> > so I didn't test it. I will test in on Sunday.
> 
> Hi Emmanuel,
> 
> I also got the same kernel panic when unloading the iwlagn module for
> my inbuilt laptop card and i tried the attached patch and it seems to
> fix it.
> 
> 
Hi Mohammed,

Thanks for your time testing it.
The final fix will be sent through the regular channel very soon.

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


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

end of thread, other threads:[~2011-08-09 19:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-01 19:46 [PATCH wireless-3.1] iwlagn: sysfs couldn't find the priv pointer Wey-Yi Guy
2011-08-02  3:53 ` Daniel Halperin
2011-08-02  5:50   ` Grumbach, Emmanuel
2011-08-02  6:39     ` Daniel Halperin
2011-08-04 20:55       ` Daniel Halperin
2011-08-04 23:15         ` Guy, Wey-Yi
2011-08-06  2:50           ` Pavel Roskin
2011-08-06 18:17             ` Guy, Wey-Yi W
2011-08-06 19:43               ` Emmanuel Grumbach
2011-08-06 19:45                 ` Grumbach, Emmanuel
2011-08-07  5:09                 ` Grumbach, Emmanuel
2011-08-07  6:21                   ` Guy, Wey-Yi W
2011-08-08 14:27                     ` John W. Linville
2011-08-08 16:19                       ` Grumbach, Emmanuel
2011-08-09 14:38                 ` Mohammed Shafi
2011-08-09 19:23                   ` Grumbach, Emmanuel

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