All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: select CONFIG_NLS
@ 2016-03-17 12:29 Arnd Bergmann
  2016-03-18 19:35 ` Martin K. Petersen
  2016-03-22 11:43 ` James Bottomley
  0 siblings, 2 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-03-17 12:29 UTC (permalink / raw)
  To: Vinayak Holikatti, James E.J. Bottomley, Martin K. Petersen
  Cc: Arnd Bergmann, Yaniv Gardi, Stephen Boyd, James Bottomley,
	Hannes Reinecke, linux-scsi, linux-kernel

A recent change to ufshcd introduced a call to utf16s_to_utf8s,
a function that is provided by the NLS module, so we get a link
error when that is not present:

drivers/scsi/built-in.o: In function `ufshcd_read_string_desc':
:(.text+0x124d0): undefined reference to `utf16s_to_utf8s'

This adds a Kconfig 'select' statement to avoid the build error.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b573d484e4ff ("scsi: ufs: add support to read device and string descriptors")
---
 drivers/scsi/ufs/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig
index 5f4530744e0a..097894a1fab5 100644
--- a/drivers/scsi/ufs/Kconfig
+++ b/drivers/scsi/ufs/Kconfig
@@ -37,6 +37,7 @@ config SCSI_UFSHCD
 	depends on SCSI && SCSI_DMA
 	select PM_DEVFREQ
 	select DEVFREQ_GOV_SIMPLE_ONDEMAND
+	select NLS
 	---help---
 	This selects the support for UFS devices in Linux, say Y and make
 	  sure that you know the name of your UFS host adapter (the card
-- 
2.7.0

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

* Re: [PATCH] scsi: ufs: select CONFIG_NLS
  2016-03-17 12:29 [PATCH] scsi: ufs: select CONFIG_NLS Arnd Bergmann
@ 2016-03-18 19:35 ` Martin K. Petersen
  2016-03-22 11:43 ` James Bottomley
  1 sibling, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2016-03-18 19:35 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Vinayak Holikatti, James E.J. Bottomley, Martin K. Petersen,
	Yaniv Gardi, Stephen Boyd, James Bottomley, Hannes Reinecke,
	linux-scsi, linux-kernel

>>>>> "Arnd" == Arnd Bergmann <arnd@arndb.de> writes:

Arnd> A recent change to ufshcd introduced a call to utf16s_to_utf8s, a
Arnd> function that is provided by the NLS module, so we get a link
Arnd> error when that is not present:

Applied to 4.6/scsi-fixes.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] scsi: ufs: select CONFIG_NLS
  2016-03-17 12:29 [PATCH] scsi: ufs: select CONFIG_NLS Arnd Bergmann
  2016-03-18 19:35 ` Martin K. Petersen
@ 2016-03-22 11:43 ` James Bottomley
  2016-03-22 14:18   ` Arnd Bergmann
  1 sibling, 1 reply; 4+ messages in thread
From: James Bottomley @ 2016-03-22 11:43 UTC (permalink / raw)
  To: Arnd Bergmann, Vinayak Holikatti, Martin K. Petersen
  Cc: Yaniv Gardi, Stephen Boyd, Hannes Reinecke, linux-scsi, linux-kernel

On Thu, 2016-03-17 at 13:29 +0100, Arnd Bergmann wrote:
> A recent change to ufshcd introduced a call to utf16s_to_utf8s,
> a function that is provided by the NLS module, so we get a link
> error when that is not present:
> 
> drivers/scsi/built-in.o: In function `ufshcd_read_string_desc':
> :(.text+0x124d0): undefined reference to `utf16s_to_utf8s'
> 
> This adds a Kconfig 'select' statement to avoid the build error.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: b573d484e4ff ("scsi: ufs: add support to read device and
> string descriptors")
> ---
>  drivers/scsi/ufs/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig
> index 5f4530744e0a..097894a1fab5 100644
> --- a/drivers/scsi/ufs/Kconfig
> +++ b/drivers/scsi/ufs/Kconfig
> @@ -37,6 +37,7 @@ config SCSI_UFSHCD
>  	depends on SCSI && SCSI_DMA
>  	select PM_DEVFREQ
>  	select DEVFREQ_GOV_SIMPLE_ONDEMAND
> +	select NLS

This looks like a bad solution: CONFIG_NLS is nothing more than a menu
selector for the NLS subsystem.  The problem is that selecting it will
allow a kernel to be build with NLS and without NLS_DEFAULT which is
going to cause all sorts of interesting problems on boot.  I think you
really mean depends on NLS here.

James

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

* Re: [PATCH] scsi: ufs: select CONFIG_NLS
  2016-03-22 11:43 ` James Bottomley
@ 2016-03-22 14:18   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2016-03-22 14:18 UTC (permalink / raw)
  To: James Bottomley
  Cc: Vinayak Holikatti, Martin K. Petersen, Yaniv Gardi, Stephen Boyd,
	Hannes Reinecke, linux-scsi, linux-kernel

On Tuesday 22 March 2016 07:43:19 James Bottomley wrote:
> > diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig
> > index 5f4530744e0a..097894a1fab5 100644
> > --- a/drivers/scsi/ufs/Kconfig
> > +++ b/drivers/scsi/ufs/Kconfig
> > @@ -37,6 +37,7 @@ config SCSI_UFSHCD
> >       depends on SCSI && SCSI_DMA
> >       select PM_DEVFREQ
> >       select DEVFREQ_GOV_SIMPLE_ONDEMAND
> > +     select NLS
> 
> This looks like a bad solution: CONFIG_NLS is nothing more than a menu
> selector for the NLS subsystem.

It's a bit of both: CONFIG_NLS by itself controls the compilation of
the fs/nls/nls_base.c file, which has the definition of the utf16s_to_utf8s
function called by this driver. The same file also contains the
NLS subsystem with the register_nls/unregister_nls/unload_nls/load_nls
APIs that are used by the other files.

>  The problem is that selecting it will
> allow a kernel to be build with NLS and without NLS_DEFAULT which is
> going to cause all sorts of interesting problems on boot.  I think you
> really mean depends on NLS here.

I agree that 'depends on NLS' makes more sense here, however I was
just following what all other users of the API are doing. Mixing
'select' and 'depends on' can easily lead to circular dependencies,
and I was trying to avoid that.

A cleaner solution is probably to split out the utf16 access functions
from the NLS subsystem, and have all these files that currently
'select NLS' pick that other interface (or both, if necessary) instead:

drivers/acpi/device_sysfs.c
drivers/hid/hid-cp2112.c
drivers/hv/hv_fcopy.c
drivers/hv/hv_kvp.c
drivers/net/fjes/fjes_main.c
drivers/net/hyperv/rndis_filter.c
drivers/pci/pci-label.c
drivers/scsi/ufs/ufshcd.c
drivers/usb/core/message.c
drivers/usb/gadget/configfs.c
drivers/usb/gadget/u_os_desc.h
drivers/usb/gadget/usbstring.c
fs/cifs/cifs_unicode.c
fs/fat/dir.c
fs/fat/namei_vfat.c
fs/isofs/joliet.c

Not sure if that's worth the work though.

	Arnd

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

end of thread, other threads:[~2016-03-22 14:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-17 12:29 [PATCH] scsi: ufs: select CONFIG_NLS Arnd Bergmann
2016-03-18 19:35 ` Martin K. Petersen
2016-03-22 11:43 ` James Bottomley
2016-03-22 14:18   ` Arnd Bergmann

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.