All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] logfs: clarify MTD dependency
@ 2016-01-13 13:25 ` Arnd Bergmann
  0 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2016-01-13 13:25 UTC (permalink / raw)
  To: akpm
  Cc: mmarek, Peter Chen, Randy Dunlap, Joern Engel, Prasad Joshi,
	linux-kbuild, linux-kernel, linux-arm-kernel

After a change to the way that composite modules work, we get
a logfs build error:

fs/built-in.o: In function `logfs_mount':
:(.text+0x139d34): undefined reference to `logfs_get_sb_mtd'
fs/built-in.o: In function `logfs_get_sb_bdev':
:(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of
logfs in a way that we can no longer configure logfs as built-in
when the MTD core is a loadable module, while leaving the
dependency to require at least one of MTD or BLOCK to be
enabled.

Another patch tried to work around the problem, but accidentally
dropped the dependency on 'BLOCK || MTD', allowing the file
system to be built if neither is selected.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
Fixes: e6be296f680c ("logfs: fix logfs build errors and dependencies")
---
I originally sent the patch November 27, but the discussion did not
conclude, see https://lkml.org/lkml/2015/11/27/299

This version is rebased on the patch that got applied yesterday.

diff --git a/fs/logfs/Kconfig b/fs/logfs/Kconfig
index 2b1485a5c086..2b4503163930 100644
--- a/fs/logfs/Kconfig
+++ b/fs/logfs/Kconfig
@@ -1,7 +1,6 @@
 config LOGFS
 	tristate "LogFS file system"
-	depends on BLOCK || BLOCK=n
-	depends on MTD || MTD=n
+	depends on MTD || (!MTD && BLOCK)
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE
 	select CRC32

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

* [PATCH] logfs: clarify MTD dependency
@ 2016-01-13 13:25 ` Arnd Bergmann
  0 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2016-01-13 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

After a change to the way that composite modules work, we get
a logfs build error:

fs/built-in.o: In function `logfs_mount':
:(.text+0x139d34): undefined reference to `logfs_get_sb_mtd'
fs/built-in.o: In function `logfs_get_sb_bdev':
:(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of
logfs in a way that we can no longer configure logfs as built-in
when the MTD core is a loadable module, while leaving the
dependency to require at least one of MTD or BLOCK to be
enabled.

Another patch tried to work around the problem, but accidentally
dropped the dependency on 'BLOCK || MTD', allowing the file
system to be built if neither is selected.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
Fixes: e6be296f680c ("logfs: fix logfs build errors and dependencies")
---
I originally sent the patch November 27, but the discussion did not
conclude, see https://lkml.org/lkml/2015/11/27/299

This version is rebased on the patch that got applied yesterday.

diff --git a/fs/logfs/Kconfig b/fs/logfs/Kconfig
index 2b1485a5c086..2b4503163930 100644
--- a/fs/logfs/Kconfig
+++ b/fs/logfs/Kconfig
@@ -1,7 +1,6 @@
 config LOGFS
 	tristate "LogFS file system"
-	depends on BLOCK || BLOCK=n
-	depends on MTD || MTD=n
+	depends on MTD || (!MTD && BLOCK)
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE
 	select CRC32

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

* Re: [PATCH] logfs: clarify MTD dependency
  2016-01-13 13:25 ` Arnd Bergmann
@ 2016-01-13 20:39   ` Andrew Morton
  -1 siblings, 0 replies; 17+ messages in thread
From: Andrew Morton @ 2016-01-13 20:39 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: mmarek, Peter Chen, Randy Dunlap, Joern Engel, Prasad Joshi,
	linux-kbuild, linux-kernel, linux-arm-kernel

On Wed, 13 Jan 2016 14:25:55 +0100 Arnd Bergmann <arnd@arndb.de> wrote:

> After a change to the way that composite modules work, we get
> a logfs build error:
> 
> fs/built-in.o: In function `logfs_mount':
> :(.text+0x139d34): undefined reference to `logfs_get_sb_mtd'
> fs/built-in.o: In function `logfs_get_sb_bdev':
> :(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'
> 
> This patch avoids the error by changing the dependencies of
> logfs in a way that we can no longer configure logfs as built-in
> when the MTD core is a loadable module, while leaving the
> dependency to require at least one of MTD or BLOCK to be
> enabled.
> 
> Another patch tried to work around the problem, but accidentally
> dropped the dependency on 'BLOCK || MTD', allowing the file
> system to be built if neither is selected.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
> Fixes: e6be296f680c ("logfs: fix logfs build errors and dependencies")

Randy's "logfs: fix logfs build errors and dependencies" is an
only-in-mm thing.  So it would make sense to combine the two patches
into a single one and to give that an appropriate changelog.

How does this look? (Primary author was chosen randomly)


From: Arnd Bergmann <arnd@arndb.de>
Subject: logfs: fix logfs build errors and dependencies

Fix build errors that happen when CONFIG_LOGFS=y and CONFIG_MTD=m:

fs/built-in.o: In function `logfs_mount':
super.c:(.text+0x92a6f): undefined reference to `logfs_get_sb_mtd'
fs/built-in.o: In function `logfs_get_sb_bdev':
(.text+0x93530): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of
logfs in a way that we can no longer configure logfs as built-in
when the MTD core is a loadable module, while leaving the
dependency to require at least one of MTD or BLOCK to be
enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Peter Chen <peter.chen@freescale.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Joern Engel <joern@logfs.org>
Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/logfs/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/logfs/Kconfig~logfs-fix-logfs-build-errors-and-dependencies fs/logfs/Kconfig
--- a/fs/logfs/Kconfig~logfs-fix-logfs-build-errors-and-dependencies
+++ a/fs/logfs/Kconfig
@@ -1,6 +1,6 @@
 config LOGFS
 	tristate "LogFS file system"
-	depends on (MTD || BLOCK)
+	depends on MTD || (!MTD && BLOCK)
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE
 	select CRC32
_

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

* [PATCH] logfs: clarify MTD dependency
@ 2016-01-13 20:39   ` Andrew Morton
  0 siblings, 0 replies; 17+ messages in thread
From: Andrew Morton @ 2016-01-13 20:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 13 Jan 2016 14:25:55 +0100 Arnd Bergmann <arnd@arndb.de> wrote:

> After a change to the way that composite modules work, we get
> a logfs build error:
> 
> fs/built-in.o: In function `logfs_mount':
> :(.text+0x139d34): undefined reference to `logfs_get_sb_mtd'
> fs/built-in.o: In function `logfs_get_sb_bdev':
> :(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'
> 
> This patch avoids the error by changing the dependencies of
> logfs in a way that we can no longer configure logfs as built-in
> when the MTD core is a loadable module, while leaving the
> dependency to require at least one of MTD or BLOCK to be
> enabled.
> 
> Another patch tried to work around the problem, but accidentally
> dropped the dependency on 'BLOCK || MTD', allowing the file
> system to be built if neither is selected.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
> Fixes: e6be296f680c ("logfs: fix logfs build errors and dependencies")

Randy's "logfs: fix logfs build errors and dependencies" is an
only-in-mm thing.  So it would make sense to combine the two patches
into a single one and to give that an appropriate changelog.

How does this look? (Primary author was chosen randomly)


From: Arnd Bergmann <arnd@arndb.de>
Subject: logfs: fix logfs build errors and dependencies

Fix build errors that happen when CONFIG_LOGFS=y and CONFIG_MTD=m:

fs/built-in.o: In function `logfs_mount':
super.c:(.text+0x92a6f): undefined reference to `logfs_get_sb_mtd'
fs/built-in.o: In function `logfs_get_sb_bdev':
(.text+0x93530): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of
logfs in a way that we can no longer configure logfs as built-in
when the MTD core is a loadable module, while leaving the
dependency to require at least one of MTD or BLOCK to be
enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Peter Chen <peter.chen@freescale.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Joern Engel <joern@logfs.org>
Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/logfs/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/logfs/Kconfig~logfs-fix-logfs-build-errors-and-dependencies fs/logfs/Kconfig
--- a/fs/logfs/Kconfig~logfs-fix-logfs-build-errors-and-dependencies
+++ a/fs/logfs/Kconfig
@@ -1,6 +1,6 @@
 config LOGFS
 	tristate "LogFS file system"
-	depends on (MTD || BLOCK)
+	depends on MTD || (!MTD && BLOCK)
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE
 	select CRC32
_

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

* Re: [PATCH] logfs: clarify MTD dependency
  2016-01-13 20:39   ` Andrew Morton
@ 2016-01-13 20:45     ` Arnd Bergmann
  -1 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2016-01-13 20:45 UTC (permalink / raw)
  To: Andrew Morton
  Cc: mmarek, Peter Chen, Randy Dunlap, Joern Engel, Prasad Joshi,
	linux-kbuild, linux-kernel, linux-arm-kernel

On Wednesday 13 January 2016 12:39:18 Andrew Morton wrote:
> 
> Randy's "logfs: fix logfs build errors and dependencies" is an
> only-in-mm thing.  So it would make sense to combine the two patches
> into a single one and to give that an appropriate changelog.
> 
> How does this look? (Primary author was chosen randomly)
> 
> 
> From: Arnd Bergmann <arnd@arndb.de>
> Subject: logfs: fix logfs build errors and dependencies
> 
> Fix build errors that happen when CONFIG_LOGFS=y and CONFIG_MTD=m:
> 
> fs/built-in.o: In function `logfs_mount':
> super.c:(.text+0x92a6f): undefined reference to `logfs_get_sb_mtd'
> fs/built-in.o: In function `logfs_get_sb_bdev':
> (.text+0x93530): undefined reference to `logfs_get_sb_mtd'
> 
> This patch avoids the error by changing the dependencies of
> logfs in a way that we can no longer configure logfs as built-in
> when the MTD core is a loadable module, while leaving the
> dependency to require at least one of MTD or BLOCK to be
> enabled.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Michal Marek <mmarek@suse.cz>
> Cc: Peter Chen <peter.chen@freescale.com>
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Cc: Joern Engel <joern@logfs.org>
> Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 

Looks good, thanks!

	Arnd

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

* [PATCH] logfs: clarify MTD dependency
@ 2016-01-13 20:45     ` Arnd Bergmann
  0 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2016-01-13 20:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 13 January 2016 12:39:18 Andrew Morton wrote:
> 
> Randy's "logfs: fix logfs build errors and dependencies" is an
> only-in-mm thing.  So it would make sense to combine the two patches
> into a single one and to give that an appropriate changelog.
> 
> How does this look? (Primary author was chosen randomly)
> 
> 
> From: Arnd Bergmann <arnd@arndb.de>
> Subject: logfs: fix logfs build errors and dependencies
> 
> Fix build errors that happen when CONFIG_LOGFS=y and CONFIG_MTD=m:
> 
> fs/built-in.o: In function `logfs_mount':
> super.c:(.text+0x92a6f): undefined reference to `logfs_get_sb_mtd'
> fs/built-in.o: In function `logfs_get_sb_bdev':
> (.text+0x93530): undefined reference to `logfs_get_sb_mtd'
> 
> This patch avoids the error by changing the dependencies of
> logfs in a way that we can no longer configure logfs as built-in
> when the MTD core is a loadable module, while leaving the
> dependency to require at least one of MTD or BLOCK to be
> enabled.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Michal Marek <mmarek@suse.cz>
> Cc: Peter Chen <peter.chen@freescale.com>
> Cc: Randy Dunlap <rdunlap@infradead.org>
> Cc: Joern Engel <joern@logfs.org>
> Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 

Looks good, thanks!

	Arnd

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

* Re: [PATCH] logfs: clarify MTD dependency
  2016-01-13 20:45     ` Arnd Bergmann
@ 2016-01-13 21:31       ` Randy Dunlap
  -1 siblings, 0 replies; 17+ messages in thread
From: Randy Dunlap @ 2016-01-13 21:31 UTC (permalink / raw)
  To: Arnd Bergmann, Andrew Morton
  Cc: mmarek, Peter Chen, Joern Engel, Prasad Joshi, linux-kbuild,
	linux-kernel, linux-arm-kernel

On 01/13/16 12:45, Arnd Bergmann wrote:
> On Wednesday 13 January 2016 12:39:18 Andrew Morton wrote:
>>
>> Randy's "logfs: fix logfs build errors and dependencies" is an
>> only-in-mm thing.  So it would make sense to combine the two patches
>> into a single one and to give that an appropriate changelog.
>>
>> How does this look? (Primary author was chosen randomly)
>>
>>
>> From: Arnd Bergmann <arnd@arndb.de>
>> Subject: logfs: fix logfs build errors and dependencies
>>
>> Fix build errors that happen when CONFIG_LOGFS=y and CONFIG_MTD=m:
>>
>> fs/built-in.o: In function `logfs_mount':
>> super.c:(.text+0x92a6f): undefined reference to `logfs_get_sb_mtd'
>> fs/built-in.o: In function `logfs_get_sb_bdev':
>> (.text+0x93530): undefined reference to `logfs_get_sb_mtd'
>>
>> This patch avoids the error by changing the dependencies of
>> logfs in a way that we can no longer configure logfs as built-in
>> when the MTD core is a loadable module, while leaving the
>> dependency to require at least one of MTD or BLOCK to be
>> enabled.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Michal Marek <mmarek@suse.cz>
>> Cc: Peter Chen <peter.chen@freescale.com>
>> Cc: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Joern Engel <joern@logfs.org>
>> Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>>
> 
> Looks good, thanks!
> 
> 	Arnd
> 

Thanks also.

-- 
~Randy

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

* [PATCH] logfs: clarify MTD dependency
@ 2016-01-13 21:31       ` Randy Dunlap
  0 siblings, 0 replies; 17+ messages in thread
From: Randy Dunlap @ 2016-01-13 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

On 01/13/16 12:45, Arnd Bergmann wrote:
> On Wednesday 13 January 2016 12:39:18 Andrew Morton wrote:
>>
>> Randy's "logfs: fix logfs build errors and dependencies" is an
>> only-in-mm thing.  So it would make sense to combine the two patches
>> into a single one and to give that an appropriate changelog.
>>
>> How does this look? (Primary author was chosen randomly)
>>
>>
>> From: Arnd Bergmann <arnd@arndb.de>
>> Subject: logfs: fix logfs build errors and dependencies
>>
>> Fix build errors that happen when CONFIG_LOGFS=y and CONFIG_MTD=m:
>>
>> fs/built-in.o: In function `logfs_mount':
>> super.c:(.text+0x92a6f): undefined reference to `logfs_get_sb_mtd'
>> fs/built-in.o: In function `logfs_get_sb_bdev':
>> (.text+0x93530): undefined reference to `logfs_get_sb_mtd'
>>
>> This patch avoids the error by changing the dependencies of
>> logfs in a way that we can no longer configure logfs as built-in
>> when the MTD core is a loadable module, while leaving the
>> dependency to require at least one of MTD or BLOCK to be
>> enabled.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Michal Marek <mmarek@suse.cz>
>> Cc: Peter Chen <peter.chen@freescale.com>
>> Cc: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Joern Engel <joern@logfs.org>
>> Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>>
> 
> Looks good, thanks!
> 
> 	Arnd
> 

Thanks also.

-- 
~Randy

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

* Re: [PATCH] logfs: clarify MTD dependency
  2015-11-27 14:30     ` Arnd Bergmann
@ 2015-11-27 14:50       ` Michal Marek
  -1 siblings, 0 replies; 17+ messages in thread
From: Michal Marek @ 2015-11-27 14:50 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-kbuild, Jörn Engel, Prasad Joshi, linux-kernel,
	linux-arm-kernel

On 2015-11-27 15:30, Arnd Bergmann wrote:
> On Friday 27 November 2015 15:14:06 Michal Marek wrote:
>>
>> Hi Arnd,
>>
>> I hit this as well and was about to submit a slightly different fix. Can
>> you try the logfs portion of the below patch? Proper changelog is to be
>> done, but the gist of the patch is that IS_REACHABLE(CONFIG_FOO) 
>> evaluates to 1 if CONFIG_FOO=y or we are building a module and
>> CONFIG_FOO=m.
>>
> 
> I thought about doing it that way, and I'm sure that also worked.
> The possible behaviors are basically:
> 
> a) before your original patch, building logfs with CONFIG_MTD=m would
>    silently leave out MTD support, which was rather confusing.
> 
> b) with my patch, it becomes impossible to have logfs as the built-in
>    root file system on a block device while also using CONFIG_MTD=m,
>    and that may be slightly annoying
> 
> c) your patch restores a), but makes it work in the case where both
>    logfs and mtd are loadable modules, which is an improvement but
>    may still confuse users.
> 
> My preference is still version b) as I sent, but I don't really mind
> your version either.

I used the IS_REACHABLE macro because it hides the boolean expressions
nicely :). But I also do not insist on a particular solution. Jörn, what
would be your preference?

Thanks,
Michal

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

* [PATCH] logfs: clarify MTD dependency
@ 2015-11-27 14:50       ` Michal Marek
  0 siblings, 0 replies; 17+ messages in thread
From: Michal Marek @ 2015-11-27 14:50 UTC (permalink / raw)
  To: linux-arm-kernel

On 2015-11-27 15:30, Arnd Bergmann wrote:
> On Friday 27 November 2015 15:14:06 Michal Marek wrote:
>>
>> Hi Arnd,
>>
>> I hit this as well and was about to submit a slightly different fix. Can
>> you try the logfs portion of the below patch? Proper changelog is to be
>> done, but the gist of the patch is that IS_REACHABLE(CONFIG_FOO) 
>> evaluates to 1 if CONFIG_FOO=y or we are building a module and
>> CONFIG_FOO=m.
>>
> 
> I thought about doing it that way, and I'm sure that also worked.
> The possible behaviors are basically:
> 
> a) before your original patch, building logfs with CONFIG_MTD=m would
>    silently leave out MTD support, which was rather confusing.
> 
> b) with my patch, it becomes impossible to have logfs as the built-in
>    root file system on a block device while also using CONFIG_MTD=m,
>    and that may be slightly annoying
> 
> c) your patch restores a), but makes it work in the case where both
>    logfs and mtd are loadable modules, which is an improvement but
>    may still confuse users.
> 
> My preference is still version b) as I sent, but I don't really mind
> your version either.

I used the IS_REACHABLE macro because it hides the boolean expressions
nicely :). But I also do not insist on a particular solution. J?rn, what
would be your preference?

Thanks,
Michal

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

* Re: [PATCH] logfs: clarify MTD dependency
  2015-11-27 14:14   ` Michal Marek
@ 2015-11-27 14:30     ` Arnd Bergmann
  -1 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2015-11-27 14:30 UTC (permalink / raw)
  To: Michal Marek
  Cc: linux-kbuild, Jörn Engel, Prasad Joshi, linux-kernel,
	linux-arm-kernel

On Friday 27 November 2015 15:14:06 Michal Marek wrote:
> 
> Hi Arnd,
> 
> I hit this as well and was about to submit a slightly different fix. Can
> you try the logfs portion of the below patch? Proper changelog is to be
> done, but the gist of the patch is that IS_REACHABLE(CONFIG_FOO) 
> evaluates to 1 if CONFIG_FOO=y or we are building a module and
> CONFIG_FOO=m.
> 

I thought about doing it that way, and I'm sure that also worked.
The possible behaviors are basically:

a) before your original patch, building logfs with CONFIG_MTD=m would
   silently leave out MTD support, which was rather confusing.

b) with my patch, it becomes impossible to have logfs as the built-in
   root file system on a block device while also using CONFIG_MTD=m,
   and that may be slightly annoying

c) your patch restores a), but makes it work in the case where both
   logfs and mtd are loadable modules, which is an improvement but
   may still confuse users.

My preference is still version b) as I sent, but I don't really mind
your version either.

	Arnd

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

* [PATCH] logfs: clarify MTD dependency
@ 2015-11-27 14:30     ` Arnd Bergmann
  0 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2015-11-27 14:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 27 November 2015 15:14:06 Michal Marek wrote:
> 
> Hi Arnd,
> 
> I hit this as well and was about to submit a slightly different fix. Can
> you try the logfs portion of the below patch? Proper changelog is to be
> done, but the gist of the patch is that IS_REACHABLE(CONFIG_FOO) 
> evaluates to 1 if CONFIG_FOO=y or we are building a module and
> CONFIG_FOO=m.
> 

I thought about doing it that way, and I'm sure that also worked.
The possible behaviors are basically:

a) before your original patch, building logfs with CONFIG_MTD=m would
   silently leave out MTD support, which was rather confusing.

b) with my patch, it becomes impossible to have logfs as the built-in
   root file system on a block device while also using CONFIG_MTD=m,
   and that may be slightly annoying

c) your patch restores a), but makes it work in the case where both
   logfs and mtd are loadable modules, which is an improvement but
   may still confuse users.

My preference is still version b) as I sent, but I don't really mind
your version either.

	Arnd

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

* Re: [PATCH] logfs: clarify MTD dependency
  2015-11-27 13:54 ` Arnd Bergmann
  (?)
@ 2015-11-27 14:14   ` Michal Marek
  -1 siblings, 0 replies; 17+ messages in thread
From: Michal Marek @ 2015-11-27 14:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-kbuild, Jörn Engel, Prasad Joshi, linux-kernel,
	linux-arm-kernel

On Fri, Nov 27, 2015 at 02:54:53PM +0100, Arnd Bergmann wrote:
> After a change to the way that composite modules work, we get
> a logfs build error:
> 
> fs/built-in.o: In function `logfs_mount':
> :(.text+0x139d34): undefined reference to `logfs_get_sb_mtd'
> fs/built-in.o: In function `logfs_get_sb_bdev':
> :(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'
> 
> This patch avoids the error by changing the dependencies of
> logfs in a way that we can no longer configure logfs as built-in
> when the MTD core is a loadable module, while leaving the
> dependency to require at least one of MTD or BLOCK to be
> enabled.

Hi Arnd,

I hit this as well and was about to submit a slightly different fix. Can
you try the logfs portion of the below patch? Proper changelog is to be
done, but the gist of the patch is that IS_REACHABLE(CONFIG_FOO) 
evaluates to 1 if CONFIG_FOO=y or we are building a module and
CONFIG_FOO=m.

Michal

>From 63e7ab41e3958e753277728acbe15faf35a5374e Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.com>
Date: Fri, 27 Nov 2015 15:08:29 +0100
Subject: [PATCH] kbuild: Use IS_REACHABLE to handle objname-m composite
 objects

Fixes: cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
Signed-off-by: Michal Marek <mmarek@suse.com>
---
 drivers/misc/ibmasm/ibmasm.h   | 2 +-
 drivers/usb/chipidea/otg_fsm.h | 2 +-
 fs/logfs/logfs.h               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 5bd127727d8e..0f4c43a8543e 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -211,7 +211,7 @@ void ibmasmfs_unregister(void);
 void ibmasmfs_add_sp(struct service_processor *sp);
 
 /* uart */
-#if IS_ENABLED(CONFIG_SERIAL_8250)
+#if IS_REACHABLE(CONFIG_SERIAL_8250)
 void ibmasm_register_uart(struct service_processor *sp);
 void ibmasm_unregister_uart(struct service_processor *sp);
 #else
diff --git a/drivers/usb/chipidea/otg_fsm.h b/drivers/usb/chipidea/otg_fsm.h
index 262d6ef8df7c..44506e4aa11f 100644
--- a/drivers/usb/chipidea/otg_fsm.h
+++ b/drivers/usb/chipidea/otg_fsm.h
@@ -62,7 +62,7 @@
 /* SSEND time before SRP */
 #define TB_SSEND_SRP         (1500)	/* minimum 1.5 sec, section:5.1.2 */
 
-#if IS_ENABLED(CONFIG_USB_OTG_FSM)
+#if IS_REACHABLE(CONFIG_USB_OTG_FSM)
 
 int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci);
 int ci_otg_fsm_work(struct ci_hdrc *ci);
diff --git a/fs/logfs/logfs.h b/fs/logfs/logfs.h
index 23f961a8fb92..2fcd487a4ab2 100644
--- a/fs/logfs/logfs.h
+++ b/fs/logfs/logfs.h
@@ -485,7 +485,7 @@ static inline int logfs_get_sb_bdev(struct logfs_super *s,
 #endif
 
 /* dev_mtd.c */
-#if IS_ENABLED(CONFIG_MTD)
+#if IS_REACHABLE(CONFIG_MTD)
 int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr);
 #else
 static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
-- 
2.1.4


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

* Re: [PATCH] logfs: clarify MTD dependency
@ 2015-11-27 14:14   ` Michal Marek
  0 siblings, 0 replies; 17+ messages in thread
From: Michal Marek @ 2015-11-27 14:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-kbuild, Jörn Engel, Prasad Joshi, linux-kernel,
	linux-arm-kernel

On Fri, Nov 27, 2015 at 02:54:53PM +0100, Arnd Bergmann wrote:
> After a change to the way that composite modules work, we get
> a logfs build error:
> 
> fs/built-in.o: In function `logfs_mount':
> :(.text+0x139d34): undefined reference to `logfs_get_sb_mtd'
> fs/built-in.o: In function `logfs_get_sb_bdev':
> :(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'
> 
> This patch avoids the error by changing the dependencies of
> logfs in a way that we can no longer configure logfs as built-in
> when the MTD core is a loadable module, while leaving the
> dependency to require at least one of MTD or BLOCK to be
> enabled.

Hi Arnd,

I hit this as well and was about to submit a slightly different fix. Can
you try the logfs portion of the below patch? Proper changelog is to be
done, but the gist of the patch is that IS_REACHABLE(CONFIG_FOO) 
evaluates to 1 if CONFIG_FOO=y or we are building a module and
CONFIG_FOO=m.

Michal

From 63e7ab41e3958e753277728acbe15faf35a5374e Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.com>
Date: Fri, 27 Nov 2015 15:08:29 +0100
Subject: [PATCH] kbuild: Use IS_REACHABLE to handle objname-m composite
 objects

Fixes: cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
Signed-off-by: Michal Marek <mmarek@suse.com>
---
 drivers/misc/ibmasm/ibmasm.h   | 2 +-
 drivers/usb/chipidea/otg_fsm.h | 2 +-
 fs/logfs/logfs.h               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 5bd127727d8e..0f4c43a8543e 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -211,7 +211,7 @@ void ibmasmfs_unregister(void);
 void ibmasmfs_add_sp(struct service_processor *sp);
 
 /* uart */
-#if IS_ENABLED(CONFIG_SERIAL_8250)
+#if IS_REACHABLE(CONFIG_SERIAL_8250)
 void ibmasm_register_uart(struct service_processor *sp);
 void ibmasm_unregister_uart(struct service_processor *sp);
 #else
diff --git a/drivers/usb/chipidea/otg_fsm.h b/drivers/usb/chipidea/otg_fsm.h
index 262d6ef8df7c..44506e4aa11f 100644
--- a/drivers/usb/chipidea/otg_fsm.h
+++ b/drivers/usb/chipidea/otg_fsm.h
@@ -62,7 +62,7 @@
 /* SSEND time before SRP */
 #define TB_SSEND_SRP         (1500)	/* minimum 1.5 sec, section:5.1.2 */
 
-#if IS_ENABLED(CONFIG_USB_OTG_FSM)
+#if IS_REACHABLE(CONFIG_USB_OTG_FSM)
 
 int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci);
 int ci_otg_fsm_work(struct ci_hdrc *ci);
diff --git a/fs/logfs/logfs.h b/fs/logfs/logfs.h
index 23f961a8fb92..2fcd487a4ab2 100644
--- a/fs/logfs/logfs.h
+++ b/fs/logfs/logfs.h
@@ -485,7 +485,7 @@ static inline int logfs_get_sb_bdev(struct logfs_super *s,
 #endif
 
 /* dev_mtd.c */
-#if IS_ENABLED(CONFIG_MTD)
+#if IS_REACHABLE(CONFIG_MTD)
 int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr);
 #else
 static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
-- 
2.1.4


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

* [PATCH] logfs: clarify MTD dependency
@ 2015-11-27 14:14   ` Michal Marek
  0 siblings, 0 replies; 17+ messages in thread
From: Michal Marek @ 2015-11-27 14:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Nov 27, 2015 at 02:54:53PM +0100, Arnd Bergmann wrote:
> After a change to the way that composite modules work, we get
> a logfs build error:
> 
> fs/built-in.o: In function `logfs_mount':
> :(.text+0x139d34): undefined reference to `logfs_get_sb_mtd'
> fs/built-in.o: In function `logfs_get_sb_bdev':
> :(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'
> 
> This patch avoids the error by changing the dependencies of
> logfs in a way that we can no longer configure logfs as built-in
> when the MTD core is a loadable module, while leaving the
> dependency to require at least one of MTD or BLOCK to be
> enabled.

Hi Arnd,

I hit this as well and was about to submit a slightly different fix. Can
you try the logfs portion of the below patch? Proper changelog is to be
done, but the gist of the patch is that IS_REACHABLE(CONFIG_FOO) 
evaluates to 1 if CONFIG_FOO=y or we are building a module and
CONFIG_FOO=m.

Michal

>From 63e7ab41e3958e753277728acbe15faf35a5374e Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.com>
Date: Fri, 27 Nov 2015 15:08:29 +0100
Subject: [PATCH] kbuild: Use IS_REACHABLE to handle objname-m composite
 objects

Fixes: cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
Signed-off-by: Michal Marek <mmarek@suse.com>
---
 drivers/misc/ibmasm/ibmasm.h   | 2 +-
 drivers/usb/chipidea/otg_fsm.h | 2 +-
 fs/logfs/logfs.h               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h
index 5bd127727d8e..0f4c43a8543e 100644
--- a/drivers/misc/ibmasm/ibmasm.h
+++ b/drivers/misc/ibmasm/ibmasm.h
@@ -211,7 +211,7 @@ void ibmasmfs_unregister(void);
 void ibmasmfs_add_sp(struct service_processor *sp);
 
 /* uart */
-#if IS_ENABLED(CONFIG_SERIAL_8250)
+#if IS_REACHABLE(CONFIG_SERIAL_8250)
 void ibmasm_register_uart(struct service_processor *sp);
 void ibmasm_unregister_uart(struct service_processor *sp);
 #else
diff --git a/drivers/usb/chipidea/otg_fsm.h b/drivers/usb/chipidea/otg_fsm.h
index 262d6ef8df7c..44506e4aa11f 100644
--- a/drivers/usb/chipidea/otg_fsm.h
+++ b/drivers/usb/chipidea/otg_fsm.h
@@ -62,7 +62,7 @@
 /* SSEND time before SRP */
 #define TB_SSEND_SRP         (1500)	/* minimum 1.5 sec, section:5.1.2 */
 
-#if IS_ENABLED(CONFIG_USB_OTG_FSM)
+#if IS_REACHABLE(CONFIG_USB_OTG_FSM)
 
 int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci);
 int ci_otg_fsm_work(struct ci_hdrc *ci);
diff --git a/fs/logfs/logfs.h b/fs/logfs/logfs.h
index 23f961a8fb92..2fcd487a4ab2 100644
--- a/fs/logfs/logfs.h
+++ b/fs/logfs/logfs.h
@@ -485,7 +485,7 @@ static inline int logfs_get_sb_bdev(struct logfs_super *s,
 #endif
 
 /* dev_mtd.c */
-#if IS_ENABLED(CONFIG_MTD)
+#if IS_REACHABLE(CONFIG_MTD)
 int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr);
 #else
 static inline int logfs_get_sb_mtd(struct logfs_super *s, int mtdnr)
-- 
2.1.4

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

* [PATCH] logfs: clarify MTD dependency
@ 2015-11-27 13:54 ` Arnd Bergmann
  0 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2015-11-27 13:54 UTC (permalink / raw)
  To: Michal Marek, linux-kbuild
  Cc: Jörn Engel, Prasad Joshi, linux-kernel, linux-arm-kernel

After a change to the way that composite modules work, we get
a logfs build error:

fs/built-in.o: In function `logfs_mount':
:(.text+0x139d34): undefined reference to `logfs_get_sb_mtd'
fs/built-in.o: In function `logfs_get_sb_bdev':
:(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of
logfs in a way that we can no longer configure logfs as built-in
when the MTD core is a loadable module, while leaving the
dependency to require at least one of MTD or BLOCK to be
enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
---
Found on today's linux-next. The commit that broke it is currently
in the kbuild for-next tree, so please apply my fix on top, or fold
it into the original patch.

diff --git a/fs/logfs/Kconfig b/fs/logfs/Kconfig
index 09ed066c0221..2b4503163930 100644
--- a/fs/logfs/Kconfig
+++ b/fs/logfs/Kconfig
@@ -1,6 +1,6 @@
 config LOGFS
 	tristate "LogFS file system"
-	depends on (MTD || BLOCK)
+	depends on MTD || (!MTD && BLOCK)
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE
 	select CRC32


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

* [PATCH] logfs: clarify MTD dependency
@ 2015-11-27 13:54 ` Arnd Bergmann
  0 siblings, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2015-11-27 13:54 UTC (permalink / raw)
  To: linux-arm-kernel

After a change to the way that composite modules work, we get
a logfs build error:

fs/built-in.o: In function `logfs_mount':
:(.text+0x139d34): undefined reference to `logfs_get_sb_mtd'
fs/built-in.o: In function `logfs_get_sb_bdev':
:(.text+0x13aa08): undefined reference to `logfs_get_sb_mtd'

This patch avoids the error by changing the dependencies of
logfs in a way that we can no longer configure logfs as built-in
when the MTD core is a loadable module, while leaving the
dependency to require at least one of MTD or BLOCK to be
enabled.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: cf4f21938e13 ("kbuild: Allow to specify composite modules with modname-m")
---
Found on today's linux-next. The commit that broke it is currently
in the kbuild for-next tree, so please apply my fix on top, or fold
it into the original patch.

diff --git a/fs/logfs/Kconfig b/fs/logfs/Kconfig
index 09ed066c0221..2b4503163930 100644
--- a/fs/logfs/Kconfig
+++ b/fs/logfs/Kconfig
@@ -1,6 +1,6 @@
 config LOGFS
 	tristate "LogFS file system"
-	depends on (MTD || BLOCK)
+	depends on MTD || (!MTD && BLOCK)
 	select ZLIB_INFLATE
 	select ZLIB_DEFLATE
 	select CRC32

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

end of thread, other threads:[~2016-01-13 21:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-13 13:25 [PATCH] logfs: clarify MTD dependency Arnd Bergmann
2016-01-13 13:25 ` Arnd Bergmann
2016-01-13 20:39 ` Andrew Morton
2016-01-13 20:39   ` Andrew Morton
2016-01-13 20:45   ` Arnd Bergmann
2016-01-13 20:45     ` Arnd Bergmann
2016-01-13 21:31     ` Randy Dunlap
2016-01-13 21:31       ` Randy Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2015-11-27 13:54 Arnd Bergmann
2015-11-27 13:54 ` Arnd Bergmann
2015-11-27 14:14 ` Michal Marek
2015-11-27 14:14   ` Michal Marek
2015-11-27 14:14   ` Michal Marek
2015-11-27 14:30   ` Arnd Bergmann
2015-11-27 14:30     ` Arnd Bergmann
2015-11-27 14:50     ` Michal Marek
2015-11-27 14:50       ` Michal Marek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.