* [patch 2.6.30] WiMAX pull request
@ 2009-05-15 19:07 Inaky Perez-Gonzalez
2009-05-18 4:14 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Inaky Perez-Gonzalez @ 2009-05-15 19:07 UTC (permalink / raw)
To: netdev, wimax
This patch fixes a device crash due to a bad optimization. It won't
crash the system, but just render the WiMAX device unusable on bad
radio link conditions.
The following changes since commit e1cc1c578055d20d36e084e324001fb5e0355a71:
David S. Miller (1):
Merge branch 'net-fixes' of git://git.kernel.org/.../chris/linux-2.6
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/inaky/wimax.git linux-2.6.30.y
Patches follow for reviewing convenience.
Inaky Perez-Gonzalez (1):
wimax/i2400m: fix device crash: fix optimization in _roq_queue_update_ws
drivers/net/wimax/i2400m/rx.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch 2.6.30] WiMAX pull request
2009-05-15 19:07 Inaky Perez-Gonzalez
@ 2009-05-18 4:14 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2009-05-18 4:14 UTC (permalink / raw)
To: inaky; +Cc: netdev, wimax
From: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Date: Fri, 15 May 2009 12:07:32 -0700
> This patch fixes a device crash due to a bad optimization. It won't
> crash the system, but just render the WiMAX device unusable on bad
> radio link conditions.
>
> The following changes since commit e1cc1c578055d20d36e084e324001fb5e0355a71:
> David S. Miller (1):
> Merge branch 'net-fixes' of git://git.kernel.org/.../chris/linux-2.6
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/inaky/wimax.git linux-2.6.30.y
>
> Patches follow for reviewing convenience.
Pulled, thanks!
^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch 2.6.30] WiMAX pull request
@ 2009-05-22 8:29 Inaky Perez-Gonzalez
2009-05-22 8:29 ` [patch 2.6.30] wimax/i2400m: usb: fix device reset on autosuspend while not yet idle Inaky Perez-Gonzalez
2009-05-26 5:56 ` [patch 2.6.30] WiMAX pull request David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Inaky Perez-Gonzalez @ 2009-05-22 8:29 UTC (permalink / raw)
To: netdev, wimax
This pull contains a single patch (bigger than I'd like) that fixes a
device reset, breaking the connection.
This caused by asking the device to auto-suspend (go into USB power
saving) in a bad moment. System suspend/hibernate are not affected.
--
The following changes since commit 4f72427998b105392e60bae7a6798a0c96fe4f0a:
Jean-Mickael Guerin (1):
IPv6: set RTPROT_KERNEL to initial route
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/inaky/wimax.git linux-2.6.30.y
Patches follow for reviewing convenience.
Inaky Perez-Gonzalez (1):
wimax/i2400m: usb: fix device reset on autosuspend while not yet idle
drivers/net/wimax/i2400m/usb.c | 35 ++++++++++++++++++++++++++++++-----
1 files changed, 30 insertions(+), 5 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [patch 2.6.30] wimax/i2400m: usb: fix device reset on autosuspend while not yet idle
2009-05-22 8:29 [patch 2.6.30] WiMAX pull request Inaky Perez-Gonzalez
@ 2009-05-22 8:29 ` Inaky Perez-Gonzalez
2009-05-26 5:56 ` [patch 2.6.30] WiMAX pull request David Miller
1 sibling, 0 replies; 5+ messages in thread
From: Inaky Perez-Gonzalez @ 2009-05-22 8:29 UTC (permalink / raw)
To: netdev, wimax
When the i2400m is connected to a network, the host interface (USB)
cannot be suspended. For that to happen, the device has to have
negotiated with the basestation to put the link on IDLE state.
If the host tries to put the device in standby while it is connected
but not idle, the device resets, as the driver should not do that.
To avoid triggering that, when the USB susbsytem requires the driver
to autosuspend the device, the driver checks if the device is not yet
idle. If it is not, the request is rejected (will be retried again
later on after the autosuspend timeout). At some point the device will
enter idle and the request will succeed (unless of course, there is
network traffic, but at that point, there is no idle neither in the
link or the host interface).
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
---
drivers/net/wimax/i2400m/usb.c | 35 ++++++++++++++++++++++++++++++-----
1 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c
index ca4151a..1785132 100644
--- a/drivers/net/wimax/i2400m/usb.c
+++ b/drivers/net/wimax/i2400m/usb.c
@@ -505,27 +505,52 @@ int i2400mu_suspend(struct usb_interface *iface, pm_message_t pm_msg)
#ifdef CONFIG_PM
struct usb_device *usb_dev = i2400mu->usb_dev;
#endif
+ unsigned is_autosuspend = 0;
struct i2400m *i2400m = &i2400mu->i2400m;
+#ifdef CONFIG_PM
+ if (usb_dev->auto_pm > 0)
+ is_autosuspend = 1;
+#endif
+
d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event);
if (i2400m->updown == 0)
goto no_firmware;
- d_printf(1, dev, "fw up, requesting standby\n");
+ if (i2400m->state == I2400M_SS_DATA_PATH_CONNECTED && is_autosuspend) {
+ /* ugh -- the device is connected and this suspend
+ * request is an autosuspend one (not a system standby
+ * / hibernate).
+ *
+ * The only way the device can go to standby is if the
+ * link with the base station is in IDLE mode; that
+ * were the case, we'd be in status
+ * I2400M_SS_CONNECTED_IDLE. But we are not.
+ *
+ * If we *tell* him to go power save now, it'll reset
+ * as a precautionary measure, so if this is an
+ * autosuspend thing, say no and it'll come back
+ * later, when the link is IDLE
+ */
+ result = -EBADF;
+ d_printf(1, dev, "fw up, link up, not-idle, autosuspend: "
+ "not entering powersave\n");
+ goto error_not_now;
+ }
+ d_printf(1, dev, "fw up: entering powersave\n");
atomic_dec(&i2400mu->do_autopm);
result = i2400m_cmd_enter_powersave(i2400m);
atomic_inc(&i2400mu->do_autopm);
-#ifdef CONFIG_PM
- if (result < 0 && usb_dev->auto_pm == 0) {
+ if (result < 0 && !is_autosuspend) {
/* System suspend, can't fail */
dev_err(dev, "failed to suspend, will reset on resume\n");
result = 0;
}
-#endif
if (result < 0)
goto error_enter_powersave;
i2400mu_notification_release(i2400mu);
- d_printf(1, dev, "fw up, got standby\n");
+ d_printf(1, dev, "powersave requested\n");
error_enter_powersave:
+error_not_now:
no_firmware:
d_fnend(3, dev, "(iface %p pm_msg %u) = %d\n",
iface, pm_msg.event, result);
--
1.6.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [patch 2.6.30] WiMAX pull request
2009-05-22 8:29 [patch 2.6.30] WiMAX pull request Inaky Perez-Gonzalez
2009-05-22 8:29 ` [patch 2.6.30] wimax/i2400m: usb: fix device reset on autosuspend while not yet idle Inaky Perez-Gonzalez
@ 2009-05-26 5:56 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2009-05-26 5:56 UTC (permalink / raw)
To: inaky; +Cc: netdev, wimax
From: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Date: Fri, 22 May 2009 01:29:40 -0700
> This pull contains a single patch (bigger than I'd like) that fixes a
> device reset, breaking the connection.
>
> This caused by asking the device to auto-suspend (go into USB power
> saving) in a bad moment. System suspend/hibernate are not affected.
Pulled, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-05-26 5:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-22 8:29 [patch 2.6.30] WiMAX pull request Inaky Perez-Gonzalez
2009-05-22 8:29 ` [patch 2.6.30] wimax/i2400m: usb: fix device reset on autosuspend while not yet idle Inaky Perez-Gonzalez
2009-05-26 5:56 ` [patch 2.6.30] WiMAX pull request David Miller
-- strict thread matches above, loose matches on Subject: below --
2009-05-15 19:07 Inaky Perez-Gonzalez
2009-05-18 4:14 ` David Miller
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).