Skip to contentSkip to conversation

linux-mainline: Add patches to enable libertas firmware loading asynchronously

PATCH In review Andreas Müller 3 participants 4 messages May 22, 2012 – May 23, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-mainline: Add patches to enable libertas firmware loading asynchronously

When using udev >=177 libertas driver does not load properly the firmware [1]. The patches 0001-0016 were taken from [2] and can be viewed at [3]. Patch 0017 I created to fix compiler complaining for missing symbol is_interrupt when DEBUG set.
The patch series was tested with meta-gumstix on overo with udev-175 and udev-182.

[1] http://www.spinics.net/lists/linux-wireless/msg85541.html
[2] git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git
[3] http://git.kernel.org/?p=linux/kernel/git/linville/wireless-next.git;a=history;f=drivers/net/wireless/libertas;hb=HEAD

---
 ...vert-drivers-net-to-use-module_usb_driver.patch |   80 +++
 ...t-fix-assignment-of-0-1-to-bool-variables.patch |   55 ++
 .../libertas/0003-switch-debugfs-to-umode_t.patch  |   26 +
 ...-Remove-unnecessary-k.alloc-v.alloc-OOM-m.patch |   54 ++
 ...ibertas-remove-dump_survey-implementation.patch |   80 +++
 ...open-automatically-convert-to-simple_open.patch |   93 +++
 ...bertas-remove-redundant-NULL-tests-before.patch |   95 +++
 ...ix-signedness-bug-in-lbs_auth_to_authtype.patch |   48 ++
 ...-wireless-libertas-if_usb.c-add-missing-d.patch |   35 ++
 ...libertas-Firmware-loading-simplifications.patch |  618 ++++++++++++++++++++
 .../0011-libertas-harden-up-exit-paths.patch       |   46 ++
 ...d-asynchronous-firmware-loading-capabilit.patch |  269 +++++++++
 ...IO-convert-to-asynchronous-firmware-loadi.patch |  320 ++++++++++
 ...B-convert-to-asynchronous-firmware-loadin.patch |  201 +++++++
 ...-convert-to-asynchronous-firmware-loading.patch |  154 +++++
 .../0016-libertas-add-missing-include.patch        |   30 +
 ...ve-debug-msgs-due-to-missing-in_interrupt.patch |   36 ++
 recipes-kernel/linux/linux-mainline_3.2.bb         |   20 +-
 18 files changed, 2258 insertions(+), 2 deletions(-)
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0001-USB-convert-drivers-net-to-use-module_usb_driver.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0002-net-fix-assignment-of-0-1-to-bool-variables.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0003-switch-debugfs-to-umode_t.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0004-drivers-net-Remove-unnecessary-k.alloc-v.alloc-OOM-m.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0005-libertas-remove-dump_survey-implementation.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0006-simple_open-automatically-convert-to-simple_open.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0007-wireless-libertas-remove-redundant-NULL-tests-before.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0008-libertas-fix-signedness-bug-in-lbs_auth_to_authtype.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0009-drivers-net-wireless-libertas-if_usb.c-add-missing-d.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0010-libertas-Firmware-loading-simplifications.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0011-libertas-harden-up-exit-paths.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0012-libertas-add-asynchronous-firmware-loading-capabilit.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0013-libertas-SDIO-convert-to-asynchronous-firmware-loadi.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0014-libertas-USB-convert-to-asynchronous-firmware-loadin.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0015-libertas-CS-convert-to-asynchronous-firmware-loading.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0016-libertas-add-missing-include.patch
 create mode 100644 recipes-kernel/linux/linux-mainline-3.2/libertas/0017-remove-debug-msgs-due-to-missing-in_interrupt.patch
recipes-kernel/linux/linux-mainline-3.2/libertas/0001-USB-convert-drivers-net-to-use-module_usb_driver.patch new file +80 -0
new file mode 100644
index 0000000..92c7745
@@ -0,0 +1,80 @@
+From d632eb1bf22e11def74e4e53cc47d790fbdba105 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <[email protected]>
+Date: Fri, 18 Nov 2011 09:44:20 -0800
+Subject: [PATCH 01/17] USB: convert drivers/net/* to use module_usb_driver()
+
+This converts the drivers in drivers/net/* to use the
+module_usb_driver() macro which makes the code smaller and a bit
+simpler.
+
+Added bonus is that it removes some unneeded kernel log messages about
+drivers loading and/or unloading.
+
+Cc: Wolfgang Grandegger <[email protected]>
+Cc: Samuel Ortiz <[email protected]>
+Cc: Oliver Neukum <[email protected]>
+Cc: Peter Korsgaard <[email protected]>
+Cc: Petko Manolov <[email protected]>
+Cc: Steve Glendinning <[email protected]>
+Cc: Christian Lamparter <[email protected]>
+Cc: "John W. Linville" <[email protected]>
+Cc: Dan Williams <[email protected]>
+Cc: Jussi Kivilinna <[email protected]>
+Cc: Ivo van Doorn <[email protected]>
+Cc: Gertjan van Wingerde <[email protected]>
+Cc: Helmut Schaa <[email protected]>
+Cc: Herton Ronaldo Krzesinski <[email protected]>
+Cc: Hin-Tak Leung <[email protected]>
+Cc: Larry Finger <[email protected]>
+Cc: Chaoming Li <[email protected]>
+Cc: Lucas De Marchi <[email protected]>
+Cc: "David S. Miller" <[email protected]>
+Cc: Roel Kluin <[email protected]>
+Cc: Paul Gortmaker <[email protected]>
+Cc: Jiri Pirko <[email protected]>
+Cc: Pavel Roskin <[email protected]>
+Cc: Yoann DI-RUZZA <[email protected]>
+Cc: George <[email protected]>
+Signed-off-by: Greg Kroah-Hartman <[email protected]>
+---
+ drivers/net/wireless/libertas/if_usb.c |   24 +-----------------------
+ 1 files changed, 1 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
+index db879c3..b5fbbc7 100644
+--- a/drivers/net/wireless/libertas/if_usb.c
++++ b/drivers/net/wireless/libertas/if_usb.c
+@@ -1184,29 +1184,7 @@ static struct usb_driver if_usb_driver = {
+ 	.reset_resume = if_usb_resume,
+ };
+ 
+-static int __init if_usb_init_module(void)
+-{
+-	int ret = 0;
+-
+-	lbs_deb_enter(LBS_DEB_MAIN);
+-
+-	ret = usb_register(&if_usb_driver);
+-
+-	lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
+-	return ret;
+-}
+-
+-static void __exit if_usb_exit_module(void)
+-{
+-	lbs_deb_enter(LBS_DEB_MAIN);
+-
+-	usb_deregister(&if_usb_driver);
+-
+-	lbs_deb_leave(LBS_DEB_MAIN);
+-}
+-
+-module_init(if_usb_init_module);
+-module_exit(if_usb_exit_module);
++module_usb_driver(if_usb_driver);
+ 
+ MODULE_DESCRIPTION("8388 USB WLAN Driver");
+ MODULE_AUTHOR("Marvell International Ltd. and Red Hat, Inc.");
+-- 
+1.7.4.4
+
recipes-kernel/linux/linux-mainline-3.2/libertas/0002-net-fix-assignment-of-0-1-to-bool-variables.patch new file +55 -0

55 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0003-switch-debugfs-to-umode_t.patch new file +26 -0
new file mode 100644
index 0000000..896c7b6
@@ -0,0 +1,26 @@
+From f4ae40a6a50a98ac23d4b285f739455e926a473e Mon Sep 17 00:00:00 2001
+From: Al Viro <[email protected]>
+Date: Sun, 24 Jul 2011 04:33:43 -0400
+Subject: [PATCH 03/17] switch debugfs to umode_t
+
+Signed-off-by: Al Viro <[email protected]>
+---
+ drivers/net/wireless/libertas/debugfs.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
+index d8d8f0d..c192671 100644
+--- a/drivers/net/wireless/libertas/debugfs.c
++++ b/drivers/net/wireless/libertas/debugfs.c
+@@ -704,7 +704,7 @@ out_unlock:
+ 
+ struct lbs_debugfs_files {
+ 	const char *name;
+-	int perm;
++	umode_t perm;
+ 	struct file_operations fops;
+ };
+ 
+-- 
+1.7.4.4
+
recipes-kernel/linux/linux-mainline-3.2/libertas/0004-drivers-net-Remove-unnecessary-k.alloc-v.alloc-OOM-m.patch new file +54 -0

54 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0005-libertas-remove-dump_survey-implementation.patch new file +80 -0

80 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0006-simple_open-automatically-convert-to-simple_open.patch new file +93 -0

93 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0007-wireless-libertas-remove-redundant-NULL-tests-before.patch new file +95 -0

95 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0008-libertas-fix-signedness-bug-in-lbs_auth_to_authtype.patch new file +48 -0

48 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0009-drivers-net-wireless-libertas-if_usb.c-add-missing-d.patch new file +35 -0
new file mode 100644
index 0000000..3477814
@@ -0,0 +1,35 @@
+From 1e66eda1d40c9ce3ff38782da066a14e1b88ac50 Mon Sep 17 00:00:00 2001
+From: Julia Lawall <[email protected]>
+Date: Mon, 16 Apr 2012 17:44:00 +0200
+Subject: [PATCH 09/17] drivers/net/wireless/libertas/if_usb.c: add missing
+ debugging code
+
+Add a corresponding leave call on error failure.
+
+Signed-off-by: Julia Lawall <[email protected]>
+Acked-by: Dan Williams <[email protected]>
+Signed-off-by: John W. Linville <[email protected]>
+---
+ drivers/net/wireless/libertas/if_usb.c |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
+index 74da5f1..ce4938d 100644
+--- a/drivers/net/wireless/libertas/if_usb.c
++++ b/drivers/net/wireless/libertas/if_usb.c
+@@ -1128,8 +1128,10 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
+ 
+ 	lbs_deb_enter(LBS_DEB_USB);
+ 
+-	if (priv->psstate != PS_STATE_FULL_POWER)
+-		return -1;
++	if (priv->psstate != PS_STATE_FULL_POWER) {
++		ret = -1;
++		goto out;
++	}
+ 
+ #ifdef CONFIG_OLPC
+ 	if (machine_is_olpc()) {
+-- 
+1.7.4.4
+
recipes-kernel/linux/linux-mainline-3.2/libertas/0010-libertas-Firmware-loading-simplifications.patch new file +618 -0

618 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0011-libertas-harden-up-exit-paths.patch new file +46 -0

46 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0012-libertas-add-asynchronous-firmware-loading-capabilit.patch new file +269 -0

269 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0013-libertas-SDIO-convert-to-asynchronous-firmware-loadi.patch new file +320 -0

320 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0014-libertas-USB-convert-to-asynchronous-firmware-loadin.patch new file +201 -0

201 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0015-libertas-CS-convert-to-asynchronous-firmware-loading.patch new file +154 -0

154 lines not on this page · raw message

recipes-kernel/linux/linux-mainline-3.2/libertas/0016-libertas-add-missing-include.patch new file +30 -0
new file mode 100644
index 0000000..1a89816
@@ -0,0 +1,30 @@
+From 7608f165734eaeb530ba2442c0413e6e9630ad83 Mon Sep 17 00:00:00 2001
+From: Felix Fietkau <[email protected]>
+Date: Thu, 19 Apr 2012 13:54:12 +0200
+Subject: [PATCH 16/17] libertas: add missing include
+
+Without it, I get compile errors due to missing TASK_NORMAL,
+TASK_UNINTERRUPTIBLE and schedule.
+
+Signed-off-by: Felix Fietkau <[email protected]>
+Acked-by: Dan Williams <[email protected]>
+Signed-off-by: John W. Linville <[email protected]>
+---
+ drivers/net/wireless/libertas/firmware.c |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/net/wireless/libertas/firmware.c b/drivers/net/wireless/libertas/firmware.c
+index cd23f1a..77f6504 100644
+--- a/drivers/net/wireless/libertas/firmware.c
++++ b/drivers/net/wireless/libertas/firmware.c
+@@ -5,6 +5,7 @@
+ #include <linux/firmware.h>
+ #include <linux/firmware.h>
+ #include <linux/module.h>
++#include <linux/sched.h>
+ 
+ #include "dev.h"
+ #include "decl.h"
+-- 
+1.7.4.4
+
recipes-kernel/linux/linux-mainline-3.2/libertas/0017-remove-debug-msgs-due-to-missing-in_interrupt.patch new file +36 -0
new file mode 100644
index 0000000..2ad77c2
@@ -0,0 +1,36 @@
+From 94938a2b8b1db241843abfe98168b81bf9273165 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <[email protected]>
+Date: Mon, 21 May 2012 17:01:23 +0200
+Subject: [PATCH] remove debug msgs due to missing in_interrupt
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+
+Signed-off-by: Andreas Müller <[email protected]>
+---
+ drivers/net/wireless/libertas/defs.h |    7 -------
+ 1 files changed, 0 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
+index ab966f0..a80b40e 100644
+--- a/drivers/net/wireless/libertas/defs.h
++++ b/drivers/net/wireless/libertas/defs.h
+@@ -46,14 +46,7 @@
+ 
+ extern unsigned int lbs_debug;
+ 
+-#ifdef DEBUG
+-#define LBS_DEB_LL(grp, grpnam, fmt, args...) \
+-do { if ((lbs_debug & (grp)) == (grp)) \
+-  printk(KERN_DEBUG DRV_NAME grpnam "%s: " fmt, \
+-         in_interrupt() ? " (INT)" : "", ## args); } while (0)
+-#else
+ #define LBS_DEB_LL(grp, grpnam, fmt, args...) do {} while (0)
+-#endif
+ 
+ #define lbs_deb_enter(grp) \
+   LBS_DEB_LL(grp | LBS_DEB_ENTER, " enter", "%s()\n", __func__);
+-- 
+1.7.4.4
+
recipes-kernel/linux/linux-mainline_3.2.bb +18 -2
index 3dda4f8..0ca5c78 100644
@@ -10,7 +10,7 @@ PV = "3.2.16"
 SRCREV_pn-${PN} = "b1be7dd1ec231ae751d0ce3acd0d2e5760704a6f"
 
 # The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
-MACHINE_KERNEL_PR_append = "d"
+MACHINE_KERNEL_PR_append = "e"
 
 FILESPATH =. "${FILE_DIRNAME}/linux-mainline-3.2:${FILE_DIRNAME}/linux-mainline-3.2/${MACHINE}:"
 
@@ -74,7 +74,23 @@ SRC_URI += "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gi
             file://omap_fixes/0006-OMAP-HWMOD-add-es3plus-to-am36xx-am35xx.patch \
             file://sgx/0001-Revert-OMAP-DSS2-remove-update_mode-from-omapdss-v3.2.patch \
             file://led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch \
-            \
+            file://libertas/0001-USB-convert-drivers-net-to-use-module_usb_driver.patch \
+            file://libertas/0002-net-fix-assignment-of-0-1-to-bool-variables.patch \
+            file://libertas/0003-switch-debugfs-to-umode_t.patch \
+            file://libertas/0004-drivers-net-Remove-unnecessary-k.alloc-v.alloc-OOM-m.patch \
+            file://libertas/0005-libertas-remove-dump_survey-implementation.patch \
+            file://libertas/0007-wireless-libertas-remove-redundant-NULL-tests-before.patch \
+            file://libertas/0008-libertas-fix-signedness-bug-in-lbs_auth_to_authtype.patch \
+            file://libertas/0009-drivers-net-wireless-libertas-if_usb.c-add-missing-d.patch \
+            file://libertas/0010-libertas-Firmware-loading-simplifications.patch \
+            file://libertas/0011-libertas-harden-up-exit-paths.patch \
+            file://libertas/0012-libertas-add-asynchronous-firmware-loading-capabilit.patch \
+            file://libertas/0013-libertas-SDIO-convert-to-asynchronous-firmware-loadi.patch \
+            file://libertas/0014-libertas-USB-convert-to-asynchronous-firmware-loadin.patch \
+            file://libertas/0015-libertas-CS-convert-to-asynchronous-firmware-loading.patch \
+            file://libertas/0016-libertas-add-missing-include.patch \
+            file://libertas/0017-remove-debug-msgs-due-to-missing-in_interrupt.patch \
+           \
             file://defconfig"
 
 SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
Signature · 1 line
1.7.4.4
#1 lore raw

Op 22 mei 2012, om 02:12 heeft Andreas Müller het volgende geschreven:

Quoted 7 lines

When using udev >=177 libertas driver does not load properly the firmware [1]. The patches 0001-0016 were taken from [2] and can be viewed at [3]. Patch 0017 I created to fix compiler complaining for missing symbol is_interrupt when DEBUG set.
The patch series was tested with meta-gumstix on overo with udev-175 and udev-182.

Quoted 5 lines

[1] http://www.spinics.net/lists/linux-wireless/msg85541.html
[2] git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git
[3] http://git.kernel.org/?p=linux/kernel/git/linville/wireless-next.git;a=history;f=drivers/net/wireless/libertas;hb=HEAD

Could you please add the patches to the 'upstream' of this recipe instead? https://github.com/beagleboard/kernel/tree/beagleboard-3.2

regards,

Koen

#2 lore raw

Op 22 mei 2012, om 07:43 heeft Koen Kooi het volgende geschreven:

Quoted 10 lines

Op 22 mei 2012, om 02:12 heeft Andreas Müller het volgende geschreven:

Quoted 7 lines

When using udev >=177 libertas driver does not load properly the firmware [1]. The patches 0001-0016 were taken from [2] and can be viewed at [3]. Patch 0017 I created to fix compiler complaining for missing symbol is_interrupt when DEBUG set.
The patch series was tested with meta-gumstix on overo with udev-175 and udev-182.

Quoted 7 lines
Quoted 5 lines

[1] http://www.spinics.net/lists/linux-wireless/msg85541.html
[2] git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git
[3] http://git.kernel.org/?p=linux/kernel/git/linville/wireless-next.git;a=history;f=drivers/net/wireless/libertas;hb=HEAD

Could you please add the patches to the 'upstream' of this recipe instead? https://github.com/beagleboard/kernel/tree/beagleboard-3.2

s/instead/as well/ of course. Time for coffee :)

#3 lore raw
Quoted 17 lines · Koen Kooi

Op 22 mei 2012, om 07:43 heeft Koen Kooi het volgende geschreven:

Quoted 14 lines

Op 22 mei 2012, om 02:12 heeft Andreas Müller het volgende geschreven:

Quoted 11 lines

When using udev >=177 libertas driver does not load properly the firmware [1]. The patches 0001-0016 were taken from [2] and can be viewed at [3]. Patch 0017 I created to fix compiler complaining for missing symbol is_interrupt when DEBUG set.
The patch series was tested with meta-gumstix on overo with udev-175 and udev-182.

[1] http://www.spinics.net/lists/linux-wireless/msg85541.html
[2] git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git
[3] http://git.kernel.org/?p=linux/kernel/git/linville/wireless-next.git;a=history;f=drivers/net/wireless/libertas;hb=HEAD

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Could you please add the patches to the 'upstream' of this recipe instead? https://github.com/beagleboard/kernel/tree/beagleboard-3.2

s/instead/as well/ of course. Time for coffee :)

How about the following deal: You or somebody synchronizes to latest beagleboard.org changes ( 3.2.18 arrived yesterday ) and after that I will rebase/test the patches and resend them here and to beagleboard.org.

What do you think?

Andreas

[1] http://lists.linuxtogo.org/pipermail/angstrom-distro-devel/2012-May/006122.html