LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] i2c-cpm: Fix build by adding of_address.h and of_irq.h
From: Wolfram Sang @ 2014-03-24 13:49 UTC (permalink / raw)
  To: Scott Wood
  Cc: Richard Weinberger, Geert Uytterhoeven, linux-i2c, linuxppc-dev,
	stable
In-Reply-To: <1395177024-5178-1-git-send-email-scottwood@freescale.com>

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

On Tue, Mar 18, 2014 at 04:10:24PM -0500, Scott Wood wrote:
> Fixes a build break due to the undeclared use of irq_of_parse_and_map()
> and of_iomap().  This build break was apparently introduced while the
> driver was unbuildable due to the bug fixed by
> 62c19c9d29e65086e5ae76df371ed2e6b23f00cd ("i2c: Remove usage of
> orphaned symbol OF_I2C").  When 62c19c was added in v3.14-rc7,
> the driver was enabled again, breaking the powerpc mpc85xx_defconfig
> and mpc85xx_smp_defconfig.
> 
> 62c19c is marked for stable, so this should go there as well.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Richard Weinberger <richard@nod.at>
> Cc: stable@kernel.org

Applied to for-current, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* [PATCH] powerpc/boot: fix global entry point for pseries
From: Cédric Le Goater @ 2014-03-24 10:22 UTC (permalink / raw)
  To: benh; +Cc: Cédric Le Goater, linuxppc-dev
In-Reply-To: <1395651884.30488.10.camel@pasglop>

Patch 15/18 "powerpc/boot: add a global entry point for pseries"
introduced a pseries-head.S file to fix the endian order when
entering the boot wrapper. This patch is a fix for some platforms
which also generate the zImage.pseries boot wrapper.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
---
Ben,

You can probably merge that one with patch 15. I can also
resend the whole patchset and merge the three last patches
as you did. As you wish.

Cheers,


 arch/powerpc/boot/Makefile |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 35189540b699..0d65b83e4af3 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -106,6 +106,10 @@ src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c
 src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c
 src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c
 src-plat-$(CONFIG_PPC_PSERIES) += pseries-head.S
+src-plat-$(CONFIG_PPC_POWERNV) += pseries-head.S
+src-plat-$(CONFIG_PPC_IBM_CELL_BLADE) += pseries-head.S
+src-plat-$(CONFIG_PPC_CELLEB) += pseries-head.S
+src-plat-$(CONFIG_PPC_CELL_QPACE) += pseries-head.S
 
 
 src-wlib := $(sort $(src-wlib-y))
-- 
1.7.10.4

^ permalink raw reply related

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Russell King - ARM Linux @ 2014-03-24 10:45 UTC (permalink / raw)
  To: James Bottomley
  Cc: Fenghua Yu, linux-ia64, Tony Luck, Laura Abbott, linux-scsi,
	linux-s390, x86, Heiko Carstens, linux-kernel, David S. Miller,
	Martin Schwidefsky, Ingo Molnar, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux390, Andrew Morton, linuxppc-dev,
	Thomas Gleixner, linux-arm-kernel
In-Reply-To: <1395529151.2143.64.camel@dabdike.int.hansenpartnership.com>

On Sat, Mar 22, 2014 at 03:59:11PM -0700, James Bottomley wrote:
> On Sat, 2014-03-22 at 22:52 +0000, Russell King - ARM Linux wrote:
> > And I'm disagreeing with that statement which implies that it's something
> > that is an architecture wide property for any particular architecture.
> > 
> > Right now in mainline, if ARM has IOMMU support enabled, then SG_CHAIN
> > support will also be enabled.  I've a patch out of tree which I've been
> > using for years which enables SG_CHAIN for a particular SoC (Dove).
> > Otherwise, it doesn't have support for SG_CHAIN.
> > 
> > PARISC on the other hand (as you list) has no support to enable SG_CHAIN
> > under any circumstances.
> > 
> > Where we're disagreeing is whether this is something that is always-on or
> > always-off for any particular architecture.
> 
> Actually, I don't disagree with that.  PA used to share sb_iommu with
> ia64 (it's the same chipset for the HP versions), but we can't now
> because ia64 is chained and we're not and there's no way to say chained
> for this platform but not for these other more legacy ones.  If you have
> a proposal for this, I'd be interested, so I don't have to do an all or
> nothing conversion, but the config option isn't it because our platform
> configuration is runtime determined (we usually select every driver and
> let the actual one be chosen at runtime from the config table).

At runtime, it's obviously a lot harder to resolve.  However, that's not
what we're trying to do with this patch.

The main issue is that Laura is trying to add SG chain support to ARM64.
At the moment, ARM64 uses the asm-generic version of scatterlist.h
directly.

Her first spin of the patch involved creating
arch/arm64/include/asm/scatterlist.h, which was nothing more than an
include of the asm-generic header file of the same name, and the
definition of ARCH_HAS_SG_CHAIN.  That seemed to be extremely wasteful
and sub-optimal way to handle this.

Moving this symbol into the Kconfig means that ARM64 no longer has to
have this additional file (and probably a bunch of other architectures
fall into that same camp) and the ARM specific CONFIG_ARM_HAS_SG_CHAIN
can be eliminated in favour of the now generic cross-arch config symbol.

We have plenty of other Kconfig symbols which control similar features
throughout the kernel source, there is no reason that this one should
not be the same.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

^ permalink raw reply

* Re: [PATCH 18/18] powerpc/boot: add PPC64_BOOT_WRAPPER config option
From: Benjamin Herrenschmidt @ 2014-03-24  9:04 UTC (permalink / raw)
  To: Cedric Le Goater; +Cc: linuxppc-dev
In-Reply-To: <532FEEF0.40607@fr.ibm.com>

On Mon, 2014-03-24 at 09:38 +0100, Cedric Le Goater wrote:
> Hi Benjamin,
> 
> > So I originally applied all 3 last patches of the series as one
> > (collapsed them in git) in order to not break bisection.
> > 
> > However, I had to take the series out in the end due to it
> > causing this error on some of my test configs:
> > 
> > powerpc64-linux-ld: cannot find arch/powerpc/boot/pseries-head.o: No such file or directory
> >
> > I haven't had a chance to investigate yet, but sadly it looks like
> > this series might have to wait for the next round.
> 
> OK. I will take a look. 

Specifically it was my cell and bimini configs, I'll get you the actual
config files (they are not defconfigs) separately.

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 18/18] powerpc/boot: add PPC64_BOOT_WRAPPER config option
From: Cedric Le Goater @ 2014-03-24  8:38 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1395632548.3460.135.camel@pasglop>

Hi Benjamin,

> So I originally applied all 3 last patches of the series as one
> (collapsed them in git) in order to not break bisection.
> 
> However, I had to take the series out in the end due to it
> causing this error on some of my test configs:
> 
> powerpc64-linux-ld: cannot find arch/powerpc/boot/pseries-head.o: No such file or directory
>
> I haven't had a chance to investigate yet, but sadly it looks like
> this series might have to wait for the next round.

OK. I will take a look. 

Thanks,

C.

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Heiko Carstens @ 2014-03-24  5:47 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Fenghua Yu, Tony Luck, Russell King, Andrew Morton, linux-scsi,
	linux-s390, x86, linux-kernel, James E.J. Bottomley, linux390,
	sparclinux, Ingo Molnar, Paul Mackerras, H. Peter Anvin,
	Martin Schwidefsky, linux-ia64, Thomas Gleixner, linuxppc-dev,
	David S. Miller, linux-arm-kernel
In-Reply-To: <1395512032-20575-2-git-send-email-lauraa@codeaurora.org>

On Sat, Mar 22, 2014 at 11:13:51AM -0700, Laura Abbott wrote:
> Rather than have architectures #define ARCH_HAS_SG_CHAIN in an architecture
> specific scatterlist.h, make it a proper Kconfig option and use that
> instead. At same time, remove the header files are are now mostly
> useless and just include asm-generic/scatterlist.h.
> 

[...]

> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> index 65a0775..d6c2059 100644
> --- a/arch/s390/Kconfig
> +++ b/arch/s390/Kconfig
> @@ -142,6 +142,7 @@ config S390
>  	select SYSCTL_EXCEPTION_TRACE
>  	select VIRT_CPU_ACCOUNTING
>  	select VIRT_TO_BUS
> +	select ARCH_HAS_SG_CHAIN
> 

Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>

FWIW, it would have been nice to keep the list of selected configs sorted.
However no need to resend.

^ permalink raw reply

* Re: [PATCH 18/18] powerpc/boot: add PPC64_BOOT_WRAPPER config option
From: Benjamin Herrenschmidt @ 2014-03-24  3:42 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: linuxppc-dev
In-Reply-To: <1395328213-19206-19-git-send-email-clg@fr.ibm.com>

On Thu, 2014-03-20 at 16:10 +0100, Cédric Le Goater wrote:
> The previous patch broke compatibility for 64bit big endian kernel.
> 
> This patch adds a config option to compile the boot wrapper in 64bit
> only when CPU_LITTLE_ENDIAN is selected. It restores 32bit compilation
> and linking for the big endian kernel.

So I originally applied all 3 last patches of the series as one
(collapsed them in git) in order to not break bisection.

However, I had to take the series out in the end due to it
causing this error on some of my test configs:

powerpc64-linux-ld: cannot find arch/powerpc/boot/pseries-head.o: No such file or directory

I haven't had a chance to investigate yet, but sadly it looks like
this series might have to wait for the next round.

Ben.


> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
> ---
>  arch/powerpc/boot/Makefile             |    2 +-
>  arch/powerpc/boot/wrapper              |    2 +-
>  arch/powerpc/boot/zImage.lds.S         |    8 ++++----
>  arch/powerpc/platforms/Kconfig.cputype |    5 +++++
>  4 files changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index b7e640028711..35189540b699 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -23,7 +23,7 @@ BOOTCFLAGS    := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
>  		 -fno-strict-aliasing -Os -msoft-float -pipe \
>  		 -fomit-frame-pointer -fno-builtin -fPIC -nostdinc \
>  		 -isystem $(shell $(CROSS32CC) -print-file-name=include)
> -ifdef CONFIG_PPC64
> +ifdef CONFIG_PPC64_BOOT_WRAPPER
>  BOOTCFLAGS	+= -m64
>  endif
>  ifdef CONFIG_CPU_BIG_ENDIAN
> diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
> index 3270e2a5c901..1948cf8b8a40 100755
> --- a/arch/powerpc/boot/wrapper
> +++ b/arch/powerpc/boot/wrapper
> @@ -140,7 +140,7 @@ fi
>  elfformat="`${CROSS}objdump -p "$kernel" | grep 'file format' | awk '{print $4}'`"
>  case "$elfformat" in
>      elf64-powerpcle)	format=elf64lppc	;;
> -    elf64-powerpc)	format=elf64ppc	;;
> +    elf64-powerpc)	format=elf32ppc	;;
>      elf32-powerpc)	format=elf32ppc	;;
>  esac
>  
> diff --git a/arch/powerpc/boot/zImage.lds.S b/arch/powerpc/boot/zImage.lds.S
> index afecab0aff5c..861e72109df2 100644
> --- a/arch/powerpc/boot/zImage.lds.S
> +++ b/arch/powerpc/boot/zImage.lds.S
> @@ -1,6 +1,6 @@
>  #include <asm-generic/vmlinux.lds.h>
>  
> -#ifdef CONFIG_PPC64
> +#ifdef CONFIG_PPC64_BOOT_WRAPPER
>  OUTPUT_ARCH(powerpc:common64)
>  #else
>  OUTPUT_ARCH(powerpc:common)
> @@ -22,7 +22,7 @@ SECTIONS
>      *(.rodata*)
>      *(.data*)
>      *(.sdata*)
> -#ifdef CONFIG_PPC32
> +#ifndef CONFIG_PPC64_BOOT_WRAPPER
>      *(.got2)
>  #endif
>    }
> @@ -37,7 +37,7 @@ SECTIONS
>    .interp : { *(.interp) }
>    .rela.dyn :
>    {
> -#ifdef CONFIG_PPC64
> +#ifdef CONFIG_PPC64_BOOT_WRAPPER
>      __rela_dyn_start = .;
>  #endif
>      *(.rela*)
> @@ -67,7 +67,7 @@ SECTIONS
>      _initrd_end =  .;
>    }
>  
> -#ifdef CONFIG_PPC64
> +#ifdef CONFIG_PPC64_BOOT_WRAPPER
>    .got :
>    {
>      __toc_start = .;
> diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
> index 434fda39bf8b..a4aadb091a1e 100644
> --- a/arch/powerpc/platforms/Kconfig.cputype
> +++ b/arch/powerpc/platforms/Kconfig.cputype
> @@ -421,6 +421,7 @@ config CPU_BIG_ENDIAN
>  
>  config CPU_LITTLE_ENDIAN
>  	bool "Build little endian kernel"
> +	select PPC64_BOOT_WRAPPER
>  	help
>  	  Build a little endian kernel.
>  
> @@ -429,3 +430,7 @@ config CPU_LITTLE_ENDIAN
>  	  little endian powerpc.
>  
>  endchoice
> +
> +config PPC64_BOOT_WRAPPER
> +	def_bool n
> +	depends on CPU_LITTLE_ENDIAN

^ permalink raw reply

* Re: Pull request: scottwood/linux.git next
From: Benjamin Herrenschmidt @ 2014-03-23 23:33 UTC (permalink / raw)
  To: Scott Wood; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <1395616617.3460.109.camel@pasglop>

On Mon, 2014-03-24 at 10:16 +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2014-03-19 at 23:25 -0500, Scott Wood wrote:
> > The following changes since commit c7e64b9ce04aa2e3fad7396d92b5cb92056d16ac:
> > 
> >   powerpc/powernv Platform dump interface (2014-03-07 16:19:10 +1100)
> > 
> > are available in the git repository at:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git next
> > 
> > for you to fetch changes up to 48b16180d0d91324e5d2423c6d53d97bbe3dcc14:
> > 
> >   fsl/pci: The new pci suspend/resume implementation (2014-03-19 22:37:44 -0500)
> 
> Stephen just informed me that your tree wasn't in -next ... Kumar's
> still is.
> 
> Can you guys fix that up ? I somewhat rely on the FSL stuff to simmer
> in -next on its own.

Oh and where is my little summary to put in the merge commit ?

I made one up for this time around.

Cheers,
Ben.

^ permalink raw reply

* Re: Pull request: scottwood/linux.git next
From: Benjamin Herrenschmidt @ 2014-03-23 23:16 UTC (permalink / raw)
  To: Scott Wood; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <20140320042527.GA23206@home.buserror.net>

On Wed, 2014-03-19 at 23:25 -0500, Scott Wood wrote:
> The following changes since commit c7e64b9ce04aa2e3fad7396d92b5cb92056d16ac:
> 
>   powerpc/powernv Platform dump interface (2014-03-07 16:19:10 +1100)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git next
> 
> for you to fetch changes up to 48b16180d0d91324e5d2423c6d53d97bbe3dcc14:
> 
>   fsl/pci: The new pci suspend/resume implementation (2014-03-19 22:37:44 -0500)

Stephen just informed me that your tree wasn't in -next ... Kumar's
still is.

Can you guys fix that up ? I somewhat rely on the FSL stuff to simmer
in -next on its own.

Cheers,
Ben.


> ----------------------------------------------------------------
> Luis Henriques (1):
>       powerpc/kconfig: Remove TSI108_BRIDGE duplicates
> 
> Minghuan Lian (1):
>       powerpc/pci: Fix IMMRBAR address
> 
> Prabhakar Kushwaha (1):
>       powerpc/config: Remove unnecssary CONFIG_FSL_IFC
> 
> Scott Wood (8):
>       powerpc/booke64: Fix exception numbers
>       powerpc/e6500: Make TLB lock recursive
>       powerpc/booke64: Use SPRG7 for VDSO
>       powerpc/booke64: Use SPRG_TLB_EXFRAME on bolted handlers
>       powerpc/booke64: Remove ints from EXCEPTION_COMMON
>       powerpc/booke64: Add crit/mc/debug support to EXCEPTION_COMMON
>       powerpc/booke64: Critical and machine check exception support
>       Revert "powerpc/watchdog: Don't enable interrupt on PPC64 BookE"
> 
> Sebastian Siewior (1):
>       powerpc: 85xx rdb: move np pointer to avoid builderror
> 
> Tang Yuantian (2):
>       powerpc/mpc85xx: Update clock nodes in device tree
>       powerpc: T4240: Add ina220 node in dts
> 
> Tiejun Chen (2):
>       powerpc/book3e: initialize crit/mc/dbg kernel stack pointers
>       powerpc/book3e: store crit/mc/dbg exception thread info
> 
> Wang Dongsheng (2):
>       powerpc/fsl: add PVR definition for E500MC and E5500
>       fsl/pci: The new pci suspend/resume implementation
> 
> Zhao Qiang (2):
>       QE: split function mpc85xx_qe_init() into two functions.
>       Corenet: Add QE platform support for Corenet
> 
> harninder rai (1):
>       powerpc/fsl: Add/update miscellaneous missing binding
> 
>  .../devicetree/bindings/powerpc/fsl/l2cache.txt    |  23 ++
>  .../devicetree/bindings/powerpc/fsl/mem-ctrlr.txt  |  27 ++
>  Documentation/devicetree/bindings/usb/fsl-usb.txt  |   4 +-
>  arch/powerpc/boot/dts/fsl/b4420si-post.dtsi        |  36 ++
>  arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi         |   2 +
>  arch/powerpc/boot/dts/fsl/b4860si-post.dtsi        |  36 ++
>  arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi         |   4 +
>  arch/powerpc/boot/dts/fsl/p2041si-post.dtsi        |  60 +++
>  arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi         |   4 +
>  arch/powerpc/boot/dts/fsl/p3041si-post.dtsi        |  61 +++
>  arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi         |   4 +
>  arch/powerpc/boot/dts/fsl/p4080si-post.dtsi        | 113 ++++++
>  arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi         |   8 +
>  arch/powerpc/boot/dts/fsl/p5020si-post.dtsi        |  43 ++
>  arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi         |   2 +
>  arch/powerpc/boot/dts/fsl/p5040si-post.dtsi        |  61 +++
>  arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi         |   4 +
>  arch/powerpc/boot/dts/fsl/t4240si-post.dtsi        |  86 ++++
>  arch/powerpc/boot/dts/fsl/t4240si-pre.dtsi         |  12 +
>  arch/powerpc/boot/dts/t4240qds.dts                 |  42 ++
>  arch/powerpc/configs/corenet64_smp_defconfig       |   1 -
>  arch/powerpc/configs/mpc85xx_defconfig             |   1 -
>  arch/powerpc/configs/mpc85xx_smp_defconfig         |   1 -
>  arch/powerpc/include/asm/exception-64e.h           |  15 +-
>  arch/powerpc/include/asm/kvm_booke_hv_asm.h        |  17 +-
>  arch/powerpc/include/asm/mmu-book3e.h              |   9 +-
>  arch/powerpc/include/asm/paca.h                    |   9 +-
>  arch/powerpc/include/asm/reg.h                     |  15 +-
>  arch/powerpc/kernel/asm-offsets.c                  |   2 +-
>  arch/powerpc/kernel/exceptions-64e.S               | 435 ++++++++++++++++-----
>  arch/powerpc/kernel/setup_64.c                     |  20 +-
>  arch/powerpc/kernel/vdso.c                         |   8 +-
>  arch/powerpc/kernel/vdso32/getcpu.S                |   2 +-
>  arch/powerpc/kernel/vdso64/getcpu.S                |   2 +-
>  arch/powerpc/kvm/book3s_hv_rmhandlers.S            |   4 +-
>  arch/powerpc/kvm/book3s_interrupts.S               |   4 +-
>  arch/powerpc/kvm/bookehv_interrupts.S              |  21 +-
>  arch/powerpc/mm/tlb_low_64e.S                      |  63 +--
>  arch/powerpc/mm/tlb_nohash.c                       |  11 +
>  arch/powerpc/platforms/85xx/c293pcie.c             |   1 +
>  arch/powerpc/platforms/85xx/common.c               |   6 +
>  arch/powerpc/platforms/85xx/corenet_generic.c      |  17 +
>  arch/powerpc/platforms/85xx/ge_imp3a.c             |   1 +
>  arch/powerpc/platforms/85xx/mpc8536_ds.c           |   1 +
>  arch/powerpc/platforms/85xx/mpc85xx.h              |   2 +
>  arch/powerpc/platforms/85xx/mpc85xx_cds.c          |   1 +
>  arch/powerpc/platforms/85xx/mpc85xx_ds.c           |   3 +
>  arch/powerpc/platforms/85xx/mpc85xx_mds.c          |   4 +
>  arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |  16 +-
>  arch/powerpc/platforms/85xx/p1010rdb.c             |   1 +
>  arch/powerpc/platforms/85xx/p1022_ds.c             |   1 +
>  arch/powerpc/platforms/85xx/p1022_rdk.c            |   1 +
>  arch/powerpc/platforms/85xx/p1023_rds.c            |   2 +
>  arch/powerpc/platforms/85xx/qemu_e500.c            |   1 +
>  arch/powerpc/platforms/85xx/sbc8548.c              |   1 +
>  arch/powerpc/platforms/85xx/twr_p102x.c            |   1 +
>  arch/powerpc/platforms/85xx/xes_mpc85xx.c          |   3 +
>  arch/powerpc/platforms/embedded6xx/Kconfig         |   2 -
>  arch/powerpc/sysdev/fsl_pci.c                      | 178 +++++++--
>  arch/powerpc/sysdev/fsl_pci.h                      |   8 +
>  drivers/watchdog/booke_wdt.c                       |   8 -
>  61 files changed, 1312 insertions(+), 219 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/l2cache.txt
>  create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Benjamin Herrenschmidt @ 2014-03-23  8:58 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-ia64, Heiko Carstens, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux-s390, Russell King, linux-scsi, x86,
	Ingo Molnar, Fenghua Yu, Laura Abbott, Thomas Gleixner,
	linux-arm-kernel, Tony Luck, linux-kernel, James E.J. Bottomley,
	Martin Schwidefsky, linux390, Andrew Morton, linuxppc-dev,
	David S. Miller
In-Reply-To: <20140323070343.GA17945@infradead.org>

On Sun, 2014-03-23 at 00:03 -0700, Christoph Hellwig wrote:
> On Sun, Mar 23, 2014 at 02:04:46PM +1100, Benjamin Herrenschmidt wrote:
> > 
> > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > > index 1594945..8122294 100644
> > > --- a/arch/arm/Kconfig
> > > +++ b/arch/arm/Kconfig
> > > @@ -82,6 +82,7 @@ config ARM
> > >  	  <http://www.arm.linux.org.uk/>.
> > >  
> > >  config ARM_HAS_SG_CHAIN
> > > +	select ARCH_HAS_SG_CHAIN
> > >  	bool
> > >  
> > 
> > Heh, a self-selecting config option... I didn't know that trick !
> 
> ARM vs ARCH.  However the arm variant of the variable should probably be
> consolidated into the ARCH one as a follow up.

Oh right... sorry for the noise.

Ben.

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Christoph Hellwig @ 2014-03-23  7:03 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linux-ia64, Heiko Carstens, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux-s390, Russell King, linux-scsi, x86,
	Ingo Molnar, Fenghua Yu, Laura Abbott, Thomas Gleixner,
	linux-arm-kernel, Tony Luck, linux-kernel, James E.J. Bottomley,
	Martin Schwidefsky, linux390, Andrew Morton, linuxppc-dev,
	David S. Miller
In-Reply-To: <1395543886.3460.95.camel@pasglop>

On Sun, Mar 23, 2014 at 02:04:46PM +1100, Benjamin Herrenschmidt wrote:
> 
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 1594945..8122294 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -82,6 +82,7 @@ config ARM
> >  	  <http://www.arm.linux.org.uk/>.
> >  
> >  config ARM_HAS_SG_CHAIN
> > +	select ARCH_HAS_SG_CHAIN
> >  	bool
> >  
> 
> Heh, a self-selecting config option... I didn't know that trick !

ARM vs ARCH.  However the arm variant of the variable should probably be
consolidated into the ARCH one as a follow up.

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Benjamin Herrenschmidt @ 2014-03-23  3:06 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Fenghua Yu, Tony Luck, Russell King, Andrew Morton, linux-scsi,
	linux-s390, x86, Heiko Carstens, linux-kernel,
	James E.J. Bottomley, linux390, sparclinux, Ingo Molnar,
	Paul Mackerras, H. Peter Anvin, Martin Schwidefsky, linux-ia64,
	Thomas Gleixner, linuxppc-dev, David S. Miller, linux-arm-kernel
In-Reply-To: <1395512032-20575-2-git-send-email-lauraa@codeaurora.org>

On Sat, 2014-03-22 at 11:13 -0700, Laura Abbott wrote:
> Rather than have architectures #define ARCH_HAS_SG_CHAIN in an architecture
> specific scatterlist.h, make it a proper Kconfig option and use that
> instead. At same time, remove the header files are are now mostly
> useless and just include asm-generic/scatterlist.h.
> 
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>

For powerpc

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Benjamin Herrenschmidt @ 2014-03-23  3:04 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Fenghua Yu, Tony Luck, Russell King, Andrew Morton, linux-scsi,
	linux-s390, x86, Heiko Carstens, linux-kernel,
	James E.J. Bottomley, linux390, sparclinux, Ingo Molnar,
	Paul Mackerras, H. Peter Anvin, Martin Schwidefsky, linux-ia64,
	Thomas Gleixner, linuxppc-dev, David S. Miller, linux-arm-kernel
In-Reply-To: <1395512032-20575-2-git-send-email-lauraa@codeaurora.org>


> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 1594945..8122294 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -82,6 +82,7 @@ config ARM
>  	  <http://www.arm.linux.org.uk/>.
>  
>  config ARM_HAS_SG_CHAIN
> +	select ARCH_HAS_SG_CHAIN
>  	bool
>  

Heh, a self-selecting config option... I didn't know that trick !

Ben.

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: James Bottomley @ 2014-03-22 22:59 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Fenghua Yu, linux-ia64, Tony Luck, Laura Abbott, linux-scsi,
	linux-s390, x86, Heiko Carstens, linux-kernel, David S. Miller,
	Martin Schwidefsky, Ingo Molnar, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux390, Andrew Morton, linuxppc-dev,
	Thomas Gleixner, linux-arm-kernel
In-Reply-To: <20140322225201.GN7528@n2100.arm.linux.org.uk>

On Sat, 2014-03-22 at 22:52 +0000, Russell King - ARM Linux wrote:
> On Sat, Mar 22, 2014 at 03:37:40PM -0700, James Bottomley wrote:
> > On Sat, 2014-03-22 at 22:23 +0000, Russell King - ARM Linux wrote:
> > > On Sat, Mar 22, 2014 at 02:31:21PM -0700, James Bottomley wrote:
> > > > Perhaps now might be the time to ask which are the remaining
> > > > architectures that cannot do SG chaining and then we can fix them and
> > > > pull the whole thing out.
> > > 
> > > Not quite.  You're making the assumption that we can be sure that all
> > > the scatterlist users on an architecture have been converted - that's
> > > simply not true on ARM.
> > 
> > No I'm not, I said "now might be the time to ask which are the remaining
> > architectures that cannot do SG chaining"
> 
> And I'm disagreeing with that statement which implies that it's something
> that is an architecture wide property for any particular architecture.
> 
> Right now in mainline, if ARM has IOMMU support enabled, then SG_CHAIN
> support will also be enabled.  I've a patch out of tree which I've been
> using for years which enables SG_CHAIN for a particular SoC (Dove).
> Otherwise, it doesn't have support for SG_CHAIN.
> 
> PARISC on the other hand (as you list) has no support to enable SG_CHAIN
> under any circumstances.
> 
> Where we're disagreeing is whether this is something that is always-on or
> always-off for any particular architecture.

Actually, I don't disagree with that.  PA used to share sb_iommu with
ia64 (it's the same chipset for the HP versions), but we can't now
because ia64 is chained and we're not and there's no way to say chained
for this platform but not for these other more legacy ones.  If you have
a proposal for this, I'd be interested, so I don't have to do an all or
nothing conversion, but the config option isn't it because our platform
configuration is runtime determined (we usually select every driver and
let the actual one be chosen at runtime from the config table).

James

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Russell King - ARM Linux @ 2014-03-22 22:52 UTC (permalink / raw)
  To: James Bottomley
  Cc: Fenghua Yu, linux-ia64, Tony Luck, Laura Abbott, linux-scsi,
	linux-s390, x86, Heiko Carstens, linux-kernel, David S. Miller,
	Martin Schwidefsky, Ingo Molnar, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux390, Andrew Morton, linuxppc-dev,
	Thomas Gleixner, linux-arm-kernel
In-Reply-To: <1395527860.2143.61.camel@dabdike.int.hansenpartnership.com>

On Sat, Mar 22, 2014 at 03:37:40PM -0700, James Bottomley wrote:
> On Sat, 2014-03-22 at 22:23 +0000, Russell King - ARM Linux wrote:
> > On Sat, Mar 22, 2014 at 02:31:21PM -0700, James Bottomley wrote:
> > > Perhaps now might be the time to ask which are the remaining
> > > architectures that cannot do SG chaining and then we can fix them and
> > > pull the whole thing out.
> > 
> > Not quite.  You're making the assumption that we can be sure that all
> > the scatterlist users on an architecture have been converted - that's
> > simply not true on ARM.
> 
> No I'm not, I said "now might be the time to ask which are the remaining
> architectures that cannot do SG chaining"

And I'm disagreeing with that statement which implies that it's something
that is an architecture wide property for any particular architecture.

Right now in mainline, if ARM has IOMMU support enabled, then SG_CHAIN
support will also be enabled.  I've a patch out of tree which I've been
using for years which enables SG_CHAIN for a particular SoC (Dove).
Otherwise, it doesn't have support for SG_CHAIN.

PARISC on the other hand (as you list) has no support to enable SG_CHAIN
under any circumstances.

Where we're disagreeing is whether this is something that is always-on or
always-off for any particular architecture.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: James Bottomley @ 2014-03-22 22:37 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Fenghua Yu, linux-ia64, Tony Luck, Laura Abbott, linux-scsi,
	linux-s390, x86, Heiko Carstens, linux-kernel, David S. Miller,
	Martin Schwidefsky, Ingo Molnar, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux390, Andrew Morton, linuxppc-dev,
	Thomas Gleixner, linux-arm-kernel
In-Reply-To: <20140322222306.GM7528@n2100.arm.linux.org.uk>

On Sat, 2014-03-22 at 22:23 +0000, Russell King - ARM Linux wrote:
> On Sat, Mar 22, 2014 at 02:31:21PM -0700, James Bottomley wrote:
> > Perhaps now might be the time to ask which are the remaining
> > architectures that cannot do SG chaining and then we can fix them and
> > pull the whole thing out.
> 
> Not quite.  You're making the assumption that we can be sure that all
> the scatterlist users on an architecture have been converted - that's
> simply not true on ARM.

No I'm not, I said "now might be the time to ask which are the remaining
architectures that cannot do SG chaining" I think it's time to list them
so we know what work remains.  I know we've got a bunch in parisc (all
of our iommu code in driver/parisc - about 5 different ones - are
unconverted).  However, the conversion is pretty simple; it's mostly
replacing sglist++ with sglist=sg_next(sglist)

>   We have some which have, and some which still
> have not been audited.
> 
> The cases that get us here would be old platform DMA code which walks
> scatterlists handed to it from drivers - stuff like
> arch/arm/mach-rpc/dma.c (which probably can cope), and drivers/scsi/arm/*
> (which definitely can't because of their SCSI pointers save/restore
> handling message.)  I know that's one case where SG_CHAIN definitely
> isn't supported on ARM.
> 
> So, we had decided not to enable it, but this means that new stuff
> isn't benefitting from this.  I've recently asked arm-soc to enable
> it for the modern multi-platform builds, because modern stuff really
> be written with correct SG chaining in mind.

OK, so lets see what the actual effort is.

James

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Russell King - ARM Linux @ 2014-03-22 22:23 UTC (permalink / raw)
  To: James Bottomley
  Cc: Fenghua Yu, linux-ia64, Tony Luck, Laura Abbott, linux-scsi,
	linux-s390, x86, Heiko Carstens, linux-kernel, David S. Miller,
	Martin Schwidefsky, Ingo Molnar, Paul Mackerras, H. Peter Anvin,
	sparclinux, linux390, Andrew Morton, linuxppc-dev,
	Thomas Gleixner, linux-arm-kernel
In-Reply-To: <1395523881.2143.58.camel@dabdike.int.hansenpartnership.com>

On Sat, Mar 22, 2014 at 02:31:21PM -0700, James Bottomley wrote:
> Perhaps now might be the time to ask which are the remaining
> architectures that cannot do SG chaining and then we can fix them and
> pull the whole thing out.

Not quite.  You're making the assumption that we can be sure that all
the scatterlist users on an architecture have been converted - that's
simply not true on ARM.  We have some which have, and some which still
have not been audited.

The cases that get us here would be old platform DMA code which walks
scatterlists handed to it from drivers - stuff like
arch/arm/mach-rpc/dma.c (which probably can cope), and drivers/scsi/arm/*
(which definitely can't because of their SCSI pointers save/restore
handling message.)  I know that's one case where SG_CHAIN definitely
isn't supported on ARM.

So, we had decided not to enable it, but this means that new stuff
isn't benefitting from this.  I've recently asked arm-soc to enable
it for the modern multi-platform builds, because modern stuff really
be written with correct SG chaining in mind.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Thomas Gleixner @ 2014-03-22 22:03 UTC (permalink / raw)
  To: James Bottomley
  Cc: Fenghua Yu, linux-ia64, Tony Luck, Russell King, linux-scsi,
	linux-s390, x86, Heiko Carstens, linux-kernel, linux390,
	sparclinux, Ingo Molnar, Paul Mackerras, H. Peter Anvin,
	Martin Schwidefsky, Laura Abbott, Andrew Morton, linuxppc-dev,
	David S. Miller, linux-arm-kernel
In-Reply-To: <1395523881.2143.58.camel@dabdike.int.hansenpartnership.com>

On Sat, 22 Mar 2014, James Bottomley wrote:

> On Sat, 2014-03-22 at 11:13 -0700, Laura Abbott wrote:
> > Rather than have architectures #define ARCH_HAS_SG_CHAIN in an architecture
> > specific scatterlist.h, make it a proper Kconfig option and use that
> > instead. At same time, remove the header files are are now mostly
> > useless and just include asm-generic/scatterlist.h.
> 
> Well, the transformation looks fine.  Perhaps part of the reason for the
> lack of response is that there's no compelling reason in the change log
> above for doing this.  The usual reason for eliminating ARCH_HAS is that
> it's hiding something that would be better expressed a different way
> (that's actually intuitive to grep) or that it's expressing something
> that should be configurable.  Neither of these reasons apply in this
> case, because SG_CHAIN definitely is a property of the architecture not
> the config space and it's not really hiding anything.

Getting rid of pointless copied code is definitely a good enough
reason and the patch removes quite some of that.
 
Thanks,

	tglx

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: James Bottomley @ 2014-03-22 21:31 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Fenghua Yu, Tony Luck, Russell King, Andrew Morton, linux-scsi,
	linux-s390, x86, Heiko Carstens, linux-kernel, linux390,
	sparclinux, Ingo Molnar, Paul Mackerras, H. Peter Anvin,
	Martin Schwidefsky, linux-ia64, Thomas Gleixner, linuxppc-dev,
	David S. Miller, linux-arm-kernel
In-Reply-To: <1395512032-20575-2-git-send-email-lauraa@codeaurora.org>

On Sat, 2014-03-22 at 11:13 -0700, Laura Abbott wrote:
> Rather than have architectures #define ARCH_HAS_SG_CHAIN in an architecture
> specific scatterlist.h, make it a proper Kconfig option and use that
> instead. At same time, remove the header files are are now mostly
> useless and just include asm-generic/scatterlist.h.

Well, the transformation looks fine.  Perhaps part of the reason for the
lack of response is that there's no compelling reason in the change log
above for doing this.  The usual reason for eliminating ARCH_HAS is that
it's hiding something that would be better expressed a different way
(that's actually intuitive to grep) or that it's expressing something
that should be configurable.  Neither of these reasons apply in this
case, because SG_CHAIN definitely is a property of the architecture not
the config space and it's not really hiding anything.

Perhaps now might be the time to ask which are the remaining
architectures that cannot do SG chaining and then we can fix them and
pull the whole thing out.

James

^ permalink raw reply

* Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Thomas Gleixner @ 2014-03-22 20:44 UTC (permalink / raw)
  To: Laura Abbott
  Cc: Fenghua Yu, Tony Luck, Russell King, linux-scsi, linux-s390, x86,
	Heiko Carstens, linux-kernel, James E.J. Bottomley, linux390,
	sparclinux, Ingo Molnar, Paul Mackerras, H. Peter Anvin,
	Martin Schwidefsky, linux-ia64, Andrew Morton, linuxppc-dev,
	David S. Miller, linux-arm-kernel
In-Reply-To: <1395512032-20575-2-git-send-email-lauraa@codeaurora.org>

On Sat, 22 Mar 2014, Laura Abbott wrote:

> Rather than have architectures #define ARCH_HAS_SG_CHAIN in an architecture
> specific scatterlist.h, make it a proper Kconfig option and use that
> instead. At same time, remove the header files are are now mostly
> useless and just include asm-generic/scatterlist.h.
> 
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: "H. Peter Anvin" <hpa@zytor.com>
> Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: Tony Luck <tony.luck@intel.com>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

For the x86 part:

Acked-by: Thomas Gleixner <tglx@linutronix.de>

^ permalink raw reply

* [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
From: Laura Abbott @ 2014-03-22 18:13 UTC (permalink / raw)
  To: Russell King, David S. Miller, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, James E.J. Bottomley, Fenghua Yu, Tony Luck,
	Benjamin Herrenschmidt, Paul Mackerras, Martin Schwidefsky,
	Heiko Carstens, Andrew Morton
  Cc: linux-s390, Laura Abbott, linux-scsi, linux-kernel, linux390,
	sparclinux, linux-ia64, linuxppc-dev, linux-arm-kernel
In-Reply-To: <1395512032-20575-1-git-send-email-lauraa@codeaurora.org>

Rather than have architectures #define ARCH_HAS_SG_CHAIN in an architecture
specific scatterlist.h, make it a proper Kconfig option and use that
instead. At same time, remove the header files are are now mostly
useless and just include asm-generic/scatterlist.h.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
 arch/arm/Kconfig                       |  1 +
 arch/arm/include/asm/Kbuild            |  1 +
 arch/arm/include/asm/scatterlist.h     | 12 ------------
 arch/arm64/Kconfig                     |  1 +
 arch/ia64/Kconfig                      |  1 +
 arch/ia64/include/asm/Kbuild           |  1 +
 arch/ia64/include/asm/scatterlist.h    |  7 -------
 arch/powerpc/Kconfig                   |  1 +
 arch/powerpc/include/asm/Kbuild        |  1 +
 arch/powerpc/include/asm/scatterlist.h | 17 -----------------
 arch/s390/Kconfig                      |  1 +
 arch/s390/include/asm/Kbuild           |  1 +
 arch/s390/include/asm/scatterlist.h    |  3 ---
 arch/sparc/Kconfig                     |  1 +
 arch/sparc/include/asm/Kbuild          |  1 +
 arch/sparc/include/asm/scatterlist.h   |  8 --------
 arch/x86/Kconfig                       |  1 +
 arch/x86/include/asm/Kbuild            |  1 +
 arch/x86/include/asm/scatterlist.h     |  8 --------
 include/linux/scatterlist.h            |  2 +-
 include/scsi/scsi.h                    |  2 +-
 lib/Kconfig                            |  7 +++++++
 lib/scatterlist.c                      |  4 ++--
 23 files changed, 24 insertions(+), 59 deletions(-)
 delete mode 100644 arch/arm/include/asm/scatterlist.h
 delete mode 100644 arch/ia64/include/asm/scatterlist.h
 delete mode 100644 arch/powerpc/include/asm/scatterlist.h
 delete mode 100644 arch/s390/include/asm/scatterlist.h
 delete mode 100644 arch/sparc/include/asm/scatterlist.h
 delete mode 100644 arch/x86/include/asm/scatterlist.h

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1594945..8122294 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -82,6 +82,7 @@ config ARM
 	  <http://www.arm.linux.org.uk/>.
 
 config ARM_HAS_SG_CHAIN
+	select ARCH_HAS_SG_CHAIN
 	bool
 
 config NEED_SG_DMA_LENGTH
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 3278afe..2357ed6 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -18,6 +18,7 @@ generic-y += param.h
 generic-y += parport.h
 generic-y += poll.h
 generic-y += resource.h
+generic-y += scatterlist.h
 generic-y += sections.h
 generic-y += segment.h
 generic-y += sembuf.h
diff --git a/arch/arm/include/asm/scatterlist.h b/arch/arm/include/asm/scatterlist.h
deleted file mode 100644
index cefdb8f..0000000
--- a/arch/arm/include/asm/scatterlist.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _ASMARM_SCATTERLIST_H
-#define _ASMARM_SCATTERLIST_H
-
-#ifdef CONFIG_ARM_HAS_SG_CHAIN
-#define ARCH_HAS_SG_CHAIN
-#endif
-
-#include <asm/memory.h>
-#include <asm/types.h>
-#include <asm-generic/scatterlist.h>
-
-#endif /* _ASMARM_SCATTERLIST_H */
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 27bbcfc..f2f95f4 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2,6 +2,7 @@ config ARM64
 	def_bool y
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
 	select ARCH_USE_CMPXCHG_LOCKREF
+	select ARCH_HAS_SG_CHAIN
 	select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 0c8e553..13e2e8b 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -44,6 +44,7 @@ config IA64
 	select HAVE_MOD_ARCH_SPECIFIC
 	select MODULES_USE_ELF_RELA
 	select ARCH_USE_CMPXCHG_LOCKREF
+	select ARCH_HAS_SG_CHAIN
 	default y
 	help
 	  The Itanium Processor Family is Intel's 64-bit successor to
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
index 283a831..3906865 100644
--- a/arch/ia64/include/asm/Kbuild
+++ b/arch/ia64/include/asm/Kbuild
@@ -2,6 +2,7 @@
 generic-y += clkdev.h
 generic-y += exec.h
 generic-y += kvm_para.h
+generic-y += scatterlist.h
 generic-y += trace_clock.h
 generic-y += preempt.h
 generic-y += vtime.h
diff --git a/arch/ia64/include/asm/scatterlist.h b/arch/ia64/include/asm/scatterlist.h
deleted file mode 100644
index 08fd93b..0000000
--- a/arch/ia64/include/asm/scatterlist.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _ASM_IA64_SCATTERLIST_H
-#define _ASM_IA64_SCATTERLIST_H
-
-#include <asm-generic/scatterlist.h>
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* _ASM_IA64_SCATTERLIST_H */
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 957bf34..659aee2 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -141,6 +141,7 @@ config PPC
 	select HAVE_DEBUG_STACKOVERFLOW
 	select HAVE_IRQ_EXIT_ON_IRQ_STACK
 	select ARCH_USE_CMPXCHG_LOCKREF if PPC64
+	select ARCH_HAS_SG_CHAIN
 
 config GENERIC_CSUM
 	def_bool CPU_LITTLE_ENDIAN
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 6c0a955..ca596ec 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -1,6 +1,7 @@
 
 generic-y += clkdev.h
 generic-y += rwsem.h
+generic-y += scatterlist.h
 generic-y += trace_clock.h
 generic-y += preempt.h
 generic-y += vtime.h
diff --git a/arch/powerpc/include/asm/scatterlist.h b/arch/powerpc/include/asm/scatterlist.h
deleted file mode 100644
index de1f620..0000000
--- a/arch/powerpc/include/asm/scatterlist.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef _ASM_POWERPC_SCATTERLIST_H
-#define _ASM_POWERPC_SCATTERLIST_H
-/*
- * Copyright (C) 2001 PPC64 Team, IBM Corp
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <asm/dma.h>
-#include <asm-generic/scatterlist.h>
-
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* _ASM_POWERPC_SCATTERLIST_H */
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 65a0775..d6c2059 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -142,6 +142,7 @@ config S390
 	select SYSCTL_EXCEPTION_TRACE
 	select VIRT_CPU_ACCOUNTING
 	select VIRT_TO_BUS
+	select ARCH_HAS_SG_CHAIN
 
 config SCHED_OMIT_FRAME_POINTER
 	def_bool y
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild
index 8386a4a..14be6d0 100644
--- a/arch/s390/include/asm/Kbuild
+++ b/arch/s390/include/asm/Kbuild
@@ -4,3 +4,4 @@ generic-y += clkdev.h
 generic-y += trace_clock.h
 generic-y += preempt.h
 generic-y += hash.h
+generic-y += scatterlist.h
diff --git a/arch/s390/include/asm/scatterlist.h b/arch/s390/include/asm/scatterlist.h
deleted file mode 100644
index 6d45ef6..0000000
--- a/arch/s390/include/asm/scatterlist.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <asm-generic/scatterlist.h>
-
-#define ARCH_HAS_SG_CHAIN
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 7d8b7e9..7a179fe 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -42,6 +42,7 @@ config SPARC
 	select MODULES_USE_ELF_RELA
 	select ODD_RT_SIGACTION
 	select OLD_SIGSUSPEND
+	select ARCH_HAS_SG_CHAIN
 
 config SPARC32
 	def_bool !64BIT
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index 4b60a0c..437f0c6 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -18,3 +18,4 @@ generic-y += types.h
 generic-y += word-at-a-time.h
 generic-y += preempt.h
 generic-y += hash.h
+generic-y += scatterlist.h
diff --git a/arch/sparc/include/asm/scatterlist.h b/arch/sparc/include/asm/scatterlist.h
deleted file mode 100644
index 92bb638..0000000
--- a/arch/sparc/include/asm/scatterlist.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _SPARC_SCATTERLIST_H
-#define _SPARC_SCATTERLIST_H
-
-#include <asm-generic/scatterlist.h>
-
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* !(_SPARC_SCATTERLIST_H) */
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0af5250..76997dc 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -127,6 +127,7 @@ config X86
 	select HAVE_DEBUG_STACKOVERFLOW
 	select HAVE_IRQ_EXIT_ON_IRQ_STACK if X86_64
 	select HAVE_CC_STACKPROTECTOR
+	select ARCH_HAS_SG_CHAIN
 
 config INSTRUCTION_DECODER
 	def_bool y
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 7f66985..9b3d749 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -5,3 +5,4 @@ genhdr-y += unistd_64.h
 genhdr-y += unistd_x32.h
 
 generic-y += clkdev.h
+generic-y += scatterlist.h
diff --git a/arch/x86/include/asm/scatterlist.h b/arch/x86/include/asm/scatterlist.h
deleted file mode 100644
index 4240878..0000000
--- a/arch/x86/include/asm/scatterlist.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _ASM_X86_SCATTERLIST_H
-#define _ASM_X86_SCATTERLIST_H
-
-#include <asm-generic/scatterlist.h>
-
-#define ARCH_HAS_SG_CHAIN
-
-#endif /* _ASM_X86_SCATTERLIST_H */
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index a964f72..4b152c8 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -136,7 +136,7 @@ static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
 static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
 			    struct scatterlist *sgl)
 {
-#ifndef ARCH_HAS_SG_CHAIN
+#ifndef CONFIG_ARCH_HAS_SG_CHAIN
 	BUG();
 #endif
 
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 0a4edfe..d34cf2d 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -31,7 +31,7 @@ enum scsi_timeouts {
  * Like SCSI_MAX_SG_SEGMENTS, but for archs that have sg chaining. This limit
  * is totally arbitrary, a setting of 2048 will get you at least 8mb ios.
  */
-#ifdef ARCH_HAS_SG_CHAIN
+#ifdef CONFIG_ARCH_HAS_SG_CHAIN
 #define SCSI_MAX_SG_CHAIN_SEGMENTS	2048
 #else
 #define SCSI_MAX_SG_CHAIN_SEGMENTS	SCSI_MAX_SG_SEGMENTS
diff --git a/lib/Kconfig b/lib/Kconfig
index 991c98b..32c68d3 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -451,4 +451,11 @@ config UCS2_STRING
 
 source "lib/fonts/Kconfig"
 
+#
+# sg chaining option
+#
+
+config ARCH_HAS_SG_CHAIN
+	def_bool n
+
 endmenu
diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 3a8e8e8..4251cbd 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -73,7 +73,7 @@ EXPORT_SYMBOL(sg_nents);
  **/
 struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents)
 {
-#ifndef ARCH_HAS_SG_CHAIN
+#ifndef CONFIG_ARCH_HAS_SG_CHAIN
 	struct scatterlist *ret = &sgl[nents - 1];
 #else
 	struct scatterlist *sg, *ret = NULL;
@@ -251,7 +251,7 @@ int __sg_alloc_table(struct sg_table *table, unsigned int nents,
 
 	if (nents == 0)
 		return -EINVAL;
-#ifndef ARCH_HAS_SG_CHAIN
+#ifndef CONFIG_ARCH_HAS_SG_CHAIN
 	if (WARN_ON_ONCE(nents > max_ents))
 		return -EINVAL;
 #endif
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply related

* [RESEND][PATCH 0/2] Cleanup asm/scatterlist.h
From: Laura Abbott @ 2014-03-22 18:13 UTC (permalink / raw)
  To: Russell King, David S. Miller, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, James E.J. Bottomley, Fenghua Yu, Tony Luck,
	Benjamin Herrenschmidt, Paul Mackerras, Martin Schwidefsky,
	Heiko Carstens, Andrew Morton, Mikael Starvik, Jesper Nilsson,
	Hirokazu Takata, Koichi Yasutake, David Howells, Michal Simek,
	Chen Liqin, Lennox Wu
  Cc: linux-s390, linux-m32r, Laura Abbott, linux-cris-kernel,
	linux-scsi, microblaze-uclinux, linux-alpha, linux-kernel,
	linux-am33-list, linux390, sparclinux, linux-ia64, linuxppc-dev,
	linux-arm-kernel



I haven't gotten many responses so I'm going to try sending again
(this time with a cover letter which I probably should have done in
the first place...)

ARCH_HAS_SG_CHAIN is currently defined as needed in asm/scatterlist.h.
It was suggested[1] that this should probably be a proper Kconfig.
At the same time, we can clean up most of the asm/scatterlist.h files
to reduce redundancy. This makes parisc the only architecture that still
has an asm/scatterlist.h file due to the #define sg_virt_addr (which
could probably be cleaned up further still)

Andrew, once we get a few more Acked-bys can we take this through your tree
as suggested by Will?

Thanks,
Laura

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2014-March/240435.html

Laura Abbott (2):
  lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig
  Cleanup useless architecture versions of scatterlist.h

 arch/alpha/include/asm/Kbuild             |  1 +
 arch/alpha/include/asm/scatterlist.h      |  6 ------
 arch/arm/Kconfig                          |  1 +
 arch/arm/include/asm/Kbuild               |  1 +
 arch/arm/include/asm/scatterlist.h        | 12 ------------
 arch/arm64/Kconfig                        |  1 +
 arch/cris/include/asm/Kbuild              |  1 +
 arch/cris/include/asm/scatterlist.h       |  6 ------
 arch/frv/include/asm/Kbuild               |  1 +
 arch/frv/include/asm/scatterlist.h        |  6 ------
 arch/ia64/Kconfig                         |  1 +
 arch/ia64/include/asm/Kbuild              |  1 +
 arch/ia64/include/asm/scatterlist.h       |  7 -------
 arch/m32r/include/asm/Kbuild              |  1 +
 arch/m32r/include/asm/scatterlist.h       |  6 ------
 arch/microblaze/include/asm/Kbuild        |  1 +
 arch/microblaze/include/asm/scatterlist.h |  1 -
 arch/mn10300/include/asm/Kbuild           |  1 +
 arch/mn10300/include/asm/scatterlist.h    | 16 ----------------
 arch/powerpc/Kconfig                      |  1 +
 arch/powerpc/include/asm/Kbuild           |  1 +
 arch/powerpc/include/asm/scatterlist.h    | 17 -----------------
 arch/s390/Kconfig                         |  1 +
 arch/s390/include/asm/Kbuild              |  1 +
 arch/s390/include/asm/scatterlist.h       |  3 ---
 arch/score/include/asm/Kbuild             |  2 +-
 arch/score/include/asm/scatterlist.h      |  6 ------
 arch/sparc/Kconfig                        |  1 +
 arch/sparc/include/asm/Kbuild             |  1 +
 arch/sparc/include/asm/scatterlist.h      |  8 --------
 arch/x86/Kconfig                          |  1 +
 arch/x86/include/asm/Kbuild               |  1 +
 arch/x86/include/asm/scatterlist.h        |  8 --------
 include/linux/scatterlist.h               |  2 +-
 include/scsi/scsi.h                       |  2 +-
 lib/Kconfig                               |  7 +++++++
 lib/scatterlist.c                         |  4 ++--
 37 files changed, 31 insertions(+), 107 deletions(-)
 delete mode 100644 arch/alpha/include/asm/scatterlist.h
 delete mode 100644 arch/arm/include/asm/scatterlist.h
 delete mode 100644 arch/cris/include/asm/scatterlist.h
 delete mode 100644 arch/frv/include/asm/scatterlist.h
 delete mode 100644 arch/ia64/include/asm/scatterlist.h
 delete mode 100644 arch/m32r/include/asm/scatterlist.h
 delete mode 100644 arch/microblaze/include/asm/scatterlist.h
 delete mode 100644 arch/mn10300/include/asm/scatterlist.h
 delete mode 100644 arch/powerpc/include/asm/scatterlist.h
 delete mode 100644 arch/s390/include/asm/scatterlist.h
 delete mode 100644 arch/score/include/asm/scatterlist.h
 delete mode 100644 arch/sparc/include/asm/scatterlist.h
 delete mode 100644 arch/x86/include/asm/scatterlist.h

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

^ permalink raw reply

* [v3] mtd: m25p80: Modify the name of mtd_info
From: Hou Zhiqiang @ 2014-03-22  8:55 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev; +Cc: scottwood, mingkai.hu, Hou Zhiqiang, dwmw2

To specify spi flash layouts by "mtdparts=..." in cmdline, we must
give mtd_info a fixed name,because the cmdlinepart's parser will
match the name of mtd_info given in cmdline.
Now, if use DT, the mtd_info's name will be spi->dev->name. It
consists of spi_master->bus_num, and the spi_master->bus_num maybe
dynamically fetched. So, in this case, replace the component bus_num
with thei physical address of spi master.

Signed-off-by: Hou Zhiqiang <B48286@freescale.com>
---
v3:
	Fix a bug, matching unsigned long long with "%llx".
v2:
	1. Fix some code style issue.
	2. Cast physical address to unsigned long long.

 drivers/mtd/devices/m25p80.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 7eda71d..695890e 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -30,6 +30,7 @@
 #include <linux/mtd/cfi.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 
 #include <linux/spi/spi.h>
@@ -934,9 +935,11 @@ static int m25p_probe(struct spi_device *spi)
 	struct flash_platform_data	*data;
 	struct m25p			*flash;
 	struct flash_info		*info;
-	unsigned			i;
+	unsigned			i, ret;
 	struct mtd_part_parser_data	ppdata;
 	struct device_node *np = spi->dev.of_node;
+	struct resource res;
+	struct device_node *mnp = spi->master->dev.of_node;
 
 	/* Platform data helps sort out which chip type we have, as
 	 * well as how this board partitions it.  If we don't have
@@ -1009,8 +1012,18 @@ static int m25p_probe(struct spi_device *spi)
 
 	if (data && data->name)
 		flash->mtd.name = data->name;
-	else
-		flash->mtd.name = dev_name(&spi->dev);
+	else {
+		ret = of_address_to_resource(mnp, 0, &res);
+		if (ret) {
+			dev_err(&spi->dev, "failed to get spi master resource\n");
+			return ret;
+		}
+		flash->mtd.name = kasprintf(GFP_KERNEL, "spi%llx.%d",
+				(unsigned long long)res.start,
+				spi->chip_select);
+		if (!flash->mtd.name)
+			return -ENOMEM;
+	}
 
 	flash->mtd.type = MTD_NORFLASH;
 	flash->mtd.writesize = 1;
-- 
1.8.5

^ permalink raw reply related

* [v2] mtd: m25p80: Modify the name of mtd_info
From: Hou Zhiqiang @ 2014-03-22  7:58 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev; +Cc: scottwood, mingkai.hu, Hou Zhiqiang, dwmw2

To specify spi flash layouts by "mtdparts=..." in cmdline, we must
give mtd_info a fixed name,because the cmdlinepart's parser will
match the name of mtd_info given in cmdline.
Now, if use DT, the mtd_info's name will be spi->dev->name. It
consists of spi_master->bus_num, and the spi_master->bus_num maybe
dynamically fetched. So, in this case, replace the component bus_num
with thei physical address of spi master.

Signed-off-by: Hou Zhiqiang <B48286@freescale.com>
---
v2:
	1. Fix some code style issue.
	2. Cast physical address to unsigned long long.

 drivers/mtd/devices/m25p80.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 7eda71d..cbb04aa 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -30,6 +30,7 @@
 #include <linux/mtd/cfi.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <linux/of_address.h>
 #include <linux/of_platform.h>
 
 #include <linux/spi/spi.h>
@@ -934,9 +935,11 @@ static int m25p_probe(struct spi_device *spi)
 	struct flash_platform_data	*data;
 	struct m25p			*flash;
 	struct flash_info		*info;
-	unsigned			i;
+	unsigned			i, ret;
 	struct mtd_part_parser_data	ppdata;
 	struct device_node *np = spi->dev.of_node;
+	struct resource res;
+	struct device_node *mnp = spi->master->dev.of_node;
 
 	/* Platform data helps sort out which chip type we have, as
 	 * well as how this board partitions it.  If we don't have
@@ -1009,8 +1012,18 @@ static int m25p_probe(struct spi_device *spi)
 
 	if (data && data->name)
 		flash->mtd.name = data->name;
-	else
-		flash->mtd.name = dev_name(&spi->dev);
+	else {
+		ret = of_address_to_resource(mnp, 0, &res);
+		if (ret) {
+			dev_err(&spi->dev, "failed to get spi master resource\n");
+			return ret;
+		}
+		flash->mtd.name = kasprintf(GFP_KERNEL, "spi%x.%d",
+				(unsigned long long)res.start,
+				spi->chip_select);
+		if (!flash->mtd.name)
+			return -ENOMEM;
+	}
 
 	flash->mtd.type = MTD_NORFLASH;
 	flash->mtd.writesize = 1;
-- 
1.8.5

^ permalink raw reply related

* Re: [PATCH v3 5/5] powernv:cpufreq: Implement the driver->get() method
From: Gautham R Shenoy @ 2014-03-22  7:53 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, ego, Linux PM list, Viresh Kumar
In-Reply-To: <1395442590.3460.85.camel@pasglop>

Hi Ben,

On Sat, Mar 22, 2014 at 09:56:30AM +1100, Benjamin Herrenschmidt wrote:
> On Fri, 2014-03-21 at 16:34 +0530, Gautham R Shenoy wrote:
> 
> > > >
> > > > +/*
> > > > + * Computes the current frequency on this cpu
> > > > + * and stores the result in *ret_freq.
> > > > + */
> > > > +static void powernv_read_cpu_freq(void *ret_freq)
> > > > +{
> > > > +       unsigned long pmspr_val;
> > > > +       s8 local_pstate_id;
> > > > +       int *cur_freq, freq, pstate_id;
> > > > +
> > > > +       cur_freq = (int *)ret_freq;
> > > 
> > > You don't need cur_freq variable at all..
> > 
> > I don't like it either. But the compiler complains without this hack
> > :-(
> 
> Casting integers into void * is a recipe for disaster... what is that
> supposed to be about ?

Like I mentioned elsewhere on this thread, we're calling
powernv_read_cpu_freq via an smp_call_function(). We use this to
obtain the frequency on the cpu where powernv_read_cpu_freq
executes and return it to the caller of smp_call_function.

> We lose all type checking and get exposed
> to endian issues etc... the day somebody uses a different type on both
> sides.
> 
Yes, I understand the problem now. I'll think of a safer way to pass
the return value.

> Also is "freq" a frequency ? In this case an int isn't big enough.

freq is the frequency stored in the cpufreq_table. The value is in
kHz. So, int should be big enough.

> Cheers,
> Ben.
> 
>

--
Thanks and Regards
gautham. 

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox