Author: rmilecki
Date: 2016-01-04 13:22:24 +0100 (Mon, 04 Jan 2016)
New Revision: 48111

Added:
   trunk/target/linux/generic/patches-4.1/024-bcma-from-4.5.patch
   trunk/target/linux/generic/patches-4.3/021-bcma-from-4.5.patch
   trunk/target/linux/generic/patches-4.4/020-bcma-from-4.5.patch
Removed:
   
trunk/target/linux/bcm53xx/patches-4.1/800-bcma-use-two-different-initcalls-if-built-in.patch
   
trunk/target/linux/bcm53xx/patches-4.3/800-bcma-use-two-different-initcalls-if-built-in.patch
   
trunk/target/linux/bcm53xx/patches-4.4/800-bcma-use-two-different-initcalls-if-built-in.patch
Modified:
   trunk/target/linux/generic/patches-4.3/020-bcma-from-4.4.patch
Log:
kernel: update bcma by backporting 4.4 and 4.5 patches

Signed-off-by: Rafa?\197?\130 Mi?\197?\130ecki <[email protected]>

Deleted: 
trunk/target/linux/bcm53xx/patches-4.1/800-bcma-use-two-different-initcalls-if-built-in.patch
===================================================================
--- 
trunk/target/linux/bcm53xx/patches-4.1/800-bcma-use-two-different-initcalls-if-built-in.patch
       2016-01-04 01:33:32 UTC (rev 48110)
+++ 
trunk/target/linux/bcm53xx/patches-4.1/800-bcma-use-two-different-initcalls-if-built-in.patch
       2016-01-04 12:22:24 UTC (rev 48111)
@@ -1,65 +0,0 @@
-From 666bdfc027cde41a171862dc698987a378c8b66a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Mon, 9 Feb 2015 18:00:42 +0100
-Subject: [PATCH RFC] bcma: use two different initcalls if built-in
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This is needed as we can't initialize bus during fs_initcall.
-Initialization requires SPROM which depends on NVRAM which depends on
-mtd. Since mtd, spi, nand, spi-nor use standard module_init, we have to
-do the same in bcma.
-Without this we'll try to initialize SPROM without having a ready SPROM
-proviver registered using bcma_arch_register_fallback_sprom.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
----
-While this patch seems to work and I can compile bcma as built-in and
-module, I'm not too proud of it. I don't really like these #if(n)def
-tricks and I'm afraid bcma_modinit may be called even if
-bcma_modinit_early failed.
-
-Do you see any better idea of solving this?
----
- drivers/bcma/main.c | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
-
---- a/drivers/bcma/main.c
-+++ b/drivers/bcma/main.c
-@@ -637,13 +637,25 @@ static int bcma_device_uevent(struct dev
-                             core->id.rev, core->id.class);
- }
- 
-+/* Bus has to be registered early, before any bcma driver */
-+static int __init bcma_modinit_early(void)
-+{
-+      return bus_register(&bcma_bus_type);
-+}
-+#ifndef MODULE
-+fs_initcall(bcma_modinit_early);
-+#endif
-+
-+/* Initialization has to be done later with SPI/mtd/NAND/SPROM available */
- static int __init bcma_modinit(void)
- {
-       int err;
- 
--      err = bus_register(&bcma_bus_type);
-+#ifdef MODULE
-+      err = bcma_modinit_early();
-       if (err)
-               return err;
-+#endif
- 
-       err = bcma_host_soc_register_driver();
-       if (err) {
-@@ -660,7 +672,7 @@ static int __init bcma_modinit(void)
- 
-       return err;
- }
--fs_initcall(bcma_modinit);
-+module_init(bcma_modinit);
- 
- static void __exit bcma_modexit(void)
- {

Deleted: 
trunk/target/linux/bcm53xx/patches-4.3/800-bcma-use-two-different-initcalls-if-built-in.patch
===================================================================
--- 
trunk/target/linux/bcm53xx/patches-4.3/800-bcma-use-two-different-initcalls-if-built-in.patch
       2016-01-04 01:33:32 UTC (rev 48110)
+++ 
trunk/target/linux/bcm53xx/patches-4.3/800-bcma-use-two-different-initcalls-if-built-in.patch
       2016-01-04 12:22:24 UTC (rev 48111)
@@ -1,65 +0,0 @@
-From 666bdfc027cde41a171862dc698987a378c8b66a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Mon, 9 Feb 2015 18:00:42 +0100
-Subject: [PATCH RFC] bcma: use two different initcalls if built-in
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This is needed as we can't initialize bus during fs_initcall.
-Initialization requires SPROM which depends on NVRAM which depends on
-mtd. Since mtd, spi, nand, spi-nor use standard module_init, we have to
-do the same in bcma.
-Without this we'll try to initialize SPROM without having a ready SPROM
-proviver registered using bcma_arch_register_fallback_sprom.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
----
-While this patch seems to work and I can compile bcma as built-in and
-module, I'm not too proud of it. I don't really like these #if(n)def
-tricks and I'm afraid bcma_modinit may be called even if
-bcma_modinit_early failed.
-
-Do you see any better idea of solving this?
----
- drivers/bcma/main.c | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
-
---- a/drivers/bcma/main.c
-+++ b/drivers/bcma/main.c
-@@ -673,13 +673,25 @@ static int bcma_device_uevent(struct dev
-                             core->id.rev, core->id.class);
- }
- 
-+/* Bus has to be registered early, before any bcma driver */
-+static int __init bcma_modinit_early(void)
-+{
-+      return bus_register(&bcma_bus_type);
-+}
-+#ifndef MODULE
-+fs_initcall(bcma_modinit_early);
-+#endif
-+
-+/* Initialization has to be done later with SPI/mtd/NAND/SPROM available */
- static int __init bcma_modinit(void)
- {
-       int err;
- 
--      err = bus_register(&bcma_bus_type);
-+#ifdef MODULE
-+      err = bcma_modinit_early();
-       if (err)
-               return err;
-+#endif
- 
-       err = bcma_host_soc_register_driver();
-       if (err) {
-@@ -696,7 +708,7 @@ static int __init bcma_modinit(void)
- 
-       return err;
- }
--fs_initcall(bcma_modinit);
-+module_init(bcma_modinit);
- 
- static void __exit bcma_modexit(void)
- {

Deleted: 
trunk/target/linux/bcm53xx/patches-4.4/800-bcma-use-two-different-initcalls-if-built-in.patch
===================================================================
--- 
trunk/target/linux/bcm53xx/patches-4.4/800-bcma-use-two-different-initcalls-if-built-in.patch
       2016-01-04 01:33:32 UTC (rev 48110)
+++ 
trunk/target/linux/bcm53xx/patches-4.4/800-bcma-use-two-different-initcalls-if-built-in.patch
       2016-01-04 12:22:24 UTC (rev 48111)
@@ -1,65 +0,0 @@
-From 666bdfc027cde41a171862dc698987a378c8b66a Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <[email protected]>
-Date: Mon, 9 Feb 2015 18:00:42 +0100
-Subject: [PATCH RFC] bcma: use two different initcalls if built-in
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This is needed as we can't initialize bus during fs_initcall.
-Initialization requires SPROM which depends on NVRAM which depends on
-mtd. Since mtd, spi, nand, spi-nor use standard module_init, we have to
-do the same in bcma.
-Without this we'll try to initialize SPROM without having a ready SPROM
-proviver registered using bcma_arch_register_fallback_sprom.
-
-Signed-off-by: Rafał Miłecki <[email protected]>
----
-While this patch seems to work and I can compile bcma as built-in and
-module, I'm not too proud of it. I don't really like these #if(n)def
-tricks and I'm afraid bcma_modinit may be called even if
-bcma_modinit_early failed.
-
-Do you see any better idea of solving this?
----
- drivers/bcma/main.c | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
-
---- a/drivers/bcma/main.c
-+++ b/drivers/bcma/main.c
-@@ -668,13 +668,25 @@ static int bcma_device_uevent(struct dev
-                             core->id.rev, core->id.class);
- }
- 
-+/* Bus has to be registered early, before any bcma driver */
-+static int __init bcma_modinit_early(void)
-+{
-+      return bus_register(&bcma_bus_type);
-+}
-+#ifndef MODULE
-+fs_initcall(bcma_modinit_early);
-+#endif
-+
-+/* Initialization has to be done later with SPI/mtd/NAND/SPROM available */
- static int __init bcma_modinit(void)
- {
-       int err;
- 
--      err = bus_register(&bcma_bus_type);
-+#ifdef MODULE
-+      err = bcma_modinit_early();
-       if (err)
-               return err;
-+#endif
- 
-       err = bcma_host_soc_register_driver();
-       if (err) {
-@@ -691,7 +703,7 @@ static int __init bcma_modinit(void)
- 
-       return err;
- }
--fs_initcall(bcma_modinit);
-+module_init(bcma_modinit);
- 
- static void __exit bcma_modexit(void)
- {

Added: trunk/target/linux/generic/patches-4.1/024-bcma-from-4.5.patch
===================================================================
--- trunk/target/linux/generic/patches-4.1/024-bcma-from-4.5.patch              
                (rev 0)
+++ trunk/target/linux/generic/patches-4.1/024-bcma-from-4.5.patch      
2016-01-04 12:22:24 UTC (rev 48111)
@@ -0,0 +1,49 @@
+--- a/drivers/bcma/main.c
++++ b/drivers/bcma/main.c
+@@ -637,11 +637,36 @@ static int bcma_device_uevent(struct dev
+                             core->id.rev, core->id.class);
+ }
+ 
+-static int __init bcma_modinit(void)
++static unsigned int bcma_bus_registered;
++
++/*
++ * If built-in, bus has to be registered early, before any driver calls
++ * bcma_driver_register.
++ * Otherwise registering driver would trigger BUG in driver_register.
++ */
++static int __init bcma_init_bus_register(void)
+ {
+       int err;
+ 
++      if (bcma_bus_registered)
++              return 0;
++
+       err = bus_register(&bcma_bus_type);
++      if (!err)
++              bcma_bus_registered = 1;
++
++      return err;
++}
++#ifndef MODULE
++fs_initcall(bcma_init_bus_register);
++#endif
++
++/* Main initialization has to be done with SPI/mtd/NAND/SPROM available */
++static int __init bcma_modinit(void)
++{
++      int err;
++
++      err = bcma_init_bus_register();
+       if (err)
+               return err;
+ 
+@@ -660,7 +685,7 @@ static int __init bcma_modinit(void)
+ 
+       return err;
+ }
+-fs_initcall(bcma_modinit);
++module_init(bcma_modinit);
+ 
+ static void __exit bcma_modexit(void)
+ {

Modified: trunk/target/linux/generic/patches-4.3/020-bcma-from-4.4.patch
===================================================================
--- trunk/target/linux/generic/patches-4.3/020-bcma-from-4.4.patch      
2016-01-04 01:33:32 UTC (rev 48110)
+++ trunk/target/linux/generic/patches-4.3/020-bcma-from-4.4.patch      
2016-01-04 12:22:24 UTC (rev 48111)
@@ -24,3 +24,21 @@
  #define BCMA_CORE_DEFAULT             0xFFF
  
  #define BCMA_MAX_NR_CORES             16
+--- a/drivers/bcma/main.c
++++ b/drivers/bcma/main.c
+@@ -436,13 +436,8 @@ int bcma_bus_register(struct bcma_bus *b
+       }
+ 
+       dev = bcma_bus_get_host_dev(bus);
+-      /* TODO: remove check for IS_BUILTIN(CONFIG_BCMA) check when
+-       * of_default_bus_match_table is exported or in some other way
+-       * accessible. This is just a temporary workaround.
+-       */
+-      if (IS_BUILTIN(CONFIG_BCMA) && dev) {
+-              of_platform_populate(dev->of_node, of_default_bus_match_table,
+-                                   NULL, dev);
++      if (dev) {
++              of_platform_default_populate(dev->of_node, NULL, dev);
+       }
+ 
+       /* Cores providing flash access go before SPROM init */

Added: trunk/target/linux/generic/patches-4.3/021-bcma-from-4.5.patch
===================================================================
--- trunk/target/linux/generic/patches-4.3/021-bcma-from-4.5.patch              
                (rev 0)
+++ trunk/target/linux/generic/patches-4.3/021-bcma-from-4.5.patch      
2016-01-04 12:22:24 UTC (rev 48111)
@@ -0,0 +1,49 @@
+--- a/drivers/bcma/main.c
++++ b/drivers/bcma/main.c
+@@ -668,11 +668,36 @@ static int bcma_device_uevent(struct dev
+                             core->id.rev, core->id.class);
+ }
+ 
+-static int __init bcma_modinit(void)
++static unsigned int bcma_bus_registered;
++
++/*
++ * If built-in, bus has to be registered early, before any driver calls
++ * bcma_driver_register.
++ * Otherwise registering driver would trigger BUG in driver_register.
++ */
++static int __init bcma_init_bus_register(void)
+ {
+       int err;
+ 
++      if (bcma_bus_registered)
++              return 0;
++
+       err = bus_register(&bcma_bus_type);
++      if (!err)
++              bcma_bus_registered = 1;
++
++      return err;
++}
++#ifndef MODULE
++fs_initcall(bcma_init_bus_register);
++#endif
++
++/* Main initialization has to be done with SPI/mtd/NAND/SPROM available */
++static int __init bcma_modinit(void)
++{
++      int err;
++
++      err = bcma_init_bus_register();
+       if (err)
+               return err;
+ 
+@@ -691,7 +716,7 @@ static int __init bcma_modinit(void)
+ 
+       return err;
+ }
+-fs_initcall(bcma_modinit);
++module_init(bcma_modinit);
+ 
+ static void __exit bcma_modexit(void)
+ {

Added: trunk/target/linux/generic/patches-4.4/020-bcma-from-4.5.patch
===================================================================
--- trunk/target/linux/generic/patches-4.4/020-bcma-from-4.5.patch              
                (rev 0)
+++ trunk/target/linux/generic/patches-4.4/020-bcma-from-4.5.patch      
2016-01-04 12:22:24 UTC (rev 48111)
@@ -0,0 +1,49 @@
+--- a/drivers/bcma/main.c
++++ b/drivers/bcma/main.c
+@@ -668,11 +668,36 @@ static int bcma_device_uevent(struct dev
+                             core->id.rev, core->id.class);
+ }
+ 
+-static int __init bcma_modinit(void)
++static unsigned int bcma_bus_registered;
++
++/*
++ * If built-in, bus has to be registered early, before any driver calls
++ * bcma_driver_register.
++ * Otherwise registering driver would trigger BUG in driver_register.
++ */
++static int __init bcma_init_bus_register(void)
+ {
+       int err;
+ 
++      if (bcma_bus_registered)
++              return 0;
++
+       err = bus_register(&bcma_bus_type);
++      if (!err)
++              bcma_bus_registered = 1;
++
++      return err;
++}
++#ifndef MODULE
++fs_initcall(bcma_init_bus_register);
++#endif
++
++/* Main initialization has to be done with SPI/mtd/NAND/SPROM available */
++static int __init bcma_modinit(void)
++{
++      int err;
++
++      err = bcma_init_bus_register();
+       if (err)
+               return err;
+ 
+@@ -691,7 +716,7 @@ static int __init bcma_modinit(void)
+ 
+       return err;
+ }
+-fs_initcall(bcma_modinit);
++module_init(bcma_modinit);
+ 
+ static void __exit bcma_modexit(void)
+ {
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to