Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread Shengjiu Wang
On Mon, Aug 18, 2014 at 06:52:46PM +0200, Lars-Peter Clausen wrote:
 On 08/18/2014 10:38 AM, Shengjiu Wang wrote:
 Build kernel with SND_SOC_IMC_PCM_DMA=m  SND_IMX_SOC=n leads the following
 error:
 
 sound/built-in.o: In function `fsl_sai_probe':
 fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init'
 sound/built-in.o: In function `fsl_esai_probe':
 fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init'
 
 Most cpu driver in soc/fsl has use the function 'imx_pcm_dma_init' which is
 defined in imx-pcm-dma.c, so need to select SND_SOC_IMX_PCM_DMA, but it 
 depends
 on SND_IMX_SOC, if SND_IMX_SOC=n, then SND_SOC_IMX_PCM_DMA will not be
 selected.
 So remove the dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA.
 
 Reported-by: kbuild test robot fengguang...@intel.com
 Signed-off-by: Shengjiu Wang shengjiu.w...@freescale.com
 
 Those if conditions where just added[1] by Arnd to avoid other build
 failures. So just removing them again makes little sense.
 
 As far as I can see imx_pcm_dma_init() should be stubbed out when
 SND_SOC_IMX_PCM_DMA is not selected. So what's going on here?
 
 [1] 
 http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ff40260f79dc0436604452bccd449bffd25ebafb

Lars-Peter Clausen  Arnd

The purpose of Arnd's patch is same with me, which is to resolve the build
error when SND_SOC_IMX_PCM_DMA=m  SND_SOC_FSL_SSI/SAI/ESAI/SPDIF=y, the
error is undefined reference to `imx_pcm_dma_init'.
But Arnd's patch didn't involve this situation that SND_IMX_SOC=n 
SND_SOC_IMX_PCM_DMA=m. 

Currently I think out a solution for this issue is to change

select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n 

to

depends on SND_SOC_IMX_PCM_DMA != m

How do you think about this?

best regards
Wang shengjiu
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/2] PCI/MSI/PPC: Remove arch_msi_check_device()

2014-08-19 Thread Alexander Gordeev
On Thu, Jul 31, 2014 at 03:53:33PM +0200, Alexander Gordeev wrote:
 Michael, Ben,
 
 Any feedback?

Michael, Ben?

 Thanks!

-- 
Regards,
Alexander Gordeev
agord...@redhat.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread Shengjiu Wang
On Tue, Aug 19, 2014 at 04:13:15PM +0800, Xiubo Li-B47053 wrote:
  Subject: Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove 
  dependence
  of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA
  
  On Mon, Aug 18, 2014 at 06:52:46PM +0200, Lars-Peter Clausen wrote:
   On 08/18/2014 10:38 AM, Shengjiu Wang wrote:
   Build kernel with SND_SOC_IMC_PCM_DMA=m  SND_IMX_SOC=n leads the
  following
   error:
   
   sound/built-in.o: In function `fsl_sai_probe':
   fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init'
   sound/built-in.o: In function `fsl_esai_probe':
   fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init'
   
   Most cpu driver in soc/fsl has use the function 'imx_pcm_dma_init' which 
   is
   defined in imx-pcm-dma.c, so need to select SND_SOC_IMX_PCM_DMA, but it
  depends
   on SND_IMX_SOC, if SND_IMX_SOC=n, then SND_SOC_IMX_PCM_DMA will not be
   selected.
   So remove the dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA.
   
   Reported-by: kbuild test robot fengguang...@intel.com
   Signed-off-by: Shengjiu Wang shengjiu.w...@freescale.com
  
   Those if conditions where just added[1] by Arnd to avoid other build
   failures. So just removing them again makes little sense.
  
   As far as I can see imx_pcm_dma_init() should be stubbed out when
   SND_SOC_IMX_PCM_DMA is not selected. So what's going on here?
  
   [1]
  http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ff40
  260f79dc0436604452bccd449bffd25ebafb
  
  Lars-Peter Clausen  Arnd
  
  The purpose of Arnd's patch is same with me, which is to resolve the build
  error when SND_SOC_IMX_PCM_DMA=m  SND_SOC_FSL_SSI/SAI/ESAI/SPDIF=y, the
  error is undefined reference to `imx_pcm_dma_init'.
  But Arnd's patch didn't involve this situation that SND_IMX_SOC=n 
  SND_SOC_IMX_PCM_DMA=m.
  
  Currently I think out a solution for this issue is to change
  
  select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
  
  to
  
  depends on SND_SOC_IMX_PCM_DMA != m
  
  How do you think about this?
  
 
 What will happen if to build both SAI/ESAI and IMX_PCM_DMA as modules at the 
 same
 time ?
 
 Thanks,
 
 BRs
 Xiubo

I didn't find error/warning when SAI/ESAI and IMX_PCM_DMA are as modules. The 
build is successful.

 
 
  best regards
  Wang shengjiu
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

RE: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread li.xi...@freescale.com
 Subject: Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence
 of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA
 
 On Mon, Aug 18, 2014 at 06:52:46PM +0200, Lars-Peter Clausen wrote:
  On 08/18/2014 10:38 AM, Shengjiu Wang wrote:
  Build kernel with SND_SOC_IMC_PCM_DMA=m  SND_IMX_SOC=n leads the
 following
  error:
  
  sound/built-in.o: In function `fsl_sai_probe':
  fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init'
  sound/built-in.o: In function `fsl_esai_probe':
  fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init'
  
  Most cpu driver in soc/fsl has use the function 'imx_pcm_dma_init' which is
  defined in imx-pcm-dma.c, so need to select SND_SOC_IMX_PCM_DMA, but it
 depends
  on SND_IMX_SOC, if SND_IMX_SOC=n, then SND_SOC_IMX_PCM_DMA will not be
  selected.
  So remove the dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA.
  
  Reported-by: kbuild test robot fengguang...@intel.com
  Signed-off-by: Shengjiu Wang shengjiu.w...@freescale.com
 
  Those if conditions where just added[1] by Arnd to avoid other build
  failures. So just removing them again makes little sense.
 
  As far as I can see imx_pcm_dma_init() should be stubbed out when
  SND_SOC_IMX_PCM_DMA is not selected. So what's going on here?
 
  [1]
 http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ff40
 260f79dc0436604452bccd449bffd25ebafb
 
 Lars-Peter Clausen  Arnd
 
 The purpose of Arnd's patch is same with me, which is to resolve the build
 error when SND_SOC_IMX_PCM_DMA=m  SND_SOC_FSL_SSI/SAI/ESAI/SPDIF=y, the
 error is undefined reference to `imx_pcm_dma_init'.
 But Arnd's patch didn't involve this situation that SND_IMX_SOC=n 
 SND_SOC_IMX_PCM_DMA=m.
 
 Currently I think out a solution for this issue is to change
 
 select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
 
 to
 
 depends on SND_SOC_IMX_PCM_DMA != m
 
 How do you think about this?
 

What will happen if to build both SAI/ESAI and IMX_PCM_DMA as modules at the 
same
time ?

Thanks,

BRs
Xiubo


 best regards
 Wang shengjiu
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

RE: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread li.xi...@freescale.com
   Lars-Peter Clausen  Arnd
  
   The purpose of Arnd's patch is same with me, which is to resolve the build
   error when SND_SOC_IMX_PCM_DMA=m  SND_SOC_FSL_SSI/SAI/ESAI/SPDIF=y, the
   error is undefined reference to `imx_pcm_dma_init'.
   But Arnd's patch didn't involve this situation that SND_IMX_SOC=n 
   SND_SOC_IMX_PCM_DMA=m.
  
   Currently I think out a solution for this issue is to change
  
   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
  
   to
  
   depends on SND_SOC_IMX_PCM_DMA != m
  
   How do you think about this?
  
 
  What will happen if to build both SAI/ESAI and IMX_PCM_DMA as modules at the
 same
  time ?
 
  Thanks,
 
  BRs
  Xiubo
 
 I didn't find error/warning when SAI/ESAI and IMX_PCM_DMA are as modules. The
 build is successful.
 

Yes, but if IMX_PCM_DMA == m, the SAI/ESAI will be invisible in menuconfig
Does it matter here ?

BRs
Xiubo


 
 
   best regards
   Wang shengjiu
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread Lars-Peter Clausen

On 08/19/2014 09:41 AM, Shengjiu Wang wrote:

On Mon, Aug 18, 2014 at 06:52:46PM +0200, Lars-Peter Clausen wrote:

On 08/18/2014 10:38 AM, Shengjiu Wang wrote:

Build kernel with SND_SOC_IMC_PCM_DMA=m  SND_IMX_SOC=n leads the following
error:

sound/built-in.o: In function `fsl_sai_probe':

fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init'

sound/built-in.o: In function `fsl_esai_probe':

fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init'


Most cpu driver in soc/fsl has use the function 'imx_pcm_dma_init' which is
defined in imx-pcm-dma.c, so need to select SND_SOC_IMX_PCM_DMA, but it depends
on SND_IMX_SOC, if SND_IMX_SOC=n, then SND_SOC_IMX_PCM_DMA will not be
selected.
So remove the dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA.

Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: Shengjiu Wang shengjiu.w...@freescale.com


Those if conditions where just added[1] by Arnd to avoid other build
failures. So just removing them again makes little sense.

As far as I can see imx_pcm_dma_init() should be stubbed out when
SND_SOC_IMX_PCM_DMA is not selected. So what's going on here?

[1] 
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ff40260f79dc0436604452bccd449bffd25ebafb


Lars-Peter Clausen  Arnd

The purpose of Arnd's patch is same with me, which is to resolve the build
error when SND_SOC_IMX_PCM_DMA=m  SND_SOC_FSL_SSI/SAI/ESAI/SPDIF=y, the
error is undefined reference to `imx_pcm_dma_init'.
But Arnd's patch didn't involve this situation that SND_IMX_SOC=n 
SND_SOC_IMX_PCM_DMA=m.


Having SND_SOC_IMX_PCM_DMA selected if SND_IMX_SOC is not selected makes no 
sense. I think the proper fix is to find out why it is selected and make 
sure that it is not selected when SND_IMX_SOC is not selected.




Currently I think out a solution for this issue is to change

select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n

to

depends on SND_SOC_IMX_PCM_DMA != m

How do you think about this?


No, that has the dependencies in reverse.

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread Lars-Peter Clausen

On 08/19/2014 10:36 AM, Lars-Peter Clausen wrote:

On 08/19/2014 09:41 AM, Shengjiu Wang wrote:

On Mon, Aug 18, 2014 at 06:52:46PM +0200, Lars-Peter Clausen wrote:

On 08/18/2014 10:38 AM, Shengjiu Wang wrote:

Build kernel with SND_SOC_IMC_PCM_DMA=m  SND_IMX_SOC=n leads the
following
error:

sound/built-in.o: In function `fsl_sai_probe':

fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init'

sound/built-in.o: In function `fsl_esai_probe':

fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init'


Most cpu driver in soc/fsl has use the function 'imx_pcm_dma_init' which is
defined in imx-pcm-dma.c, so need to select SND_SOC_IMX_PCM_DMA, but it
depends
on SND_IMX_SOC, if SND_IMX_SOC=n, then SND_SOC_IMX_PCM_DMA will not be
selected.
So remove the dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA.

Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: Shengjiu Wang shengjiu.w...@freescale.com


Those if conditions where just added[1] by Arnd to avoid other build
failures. So just removing them again makes little sense.

As far as I can see imx_pcm_dma_init() should be stubbed out when
SND_SOC_IMX_PCM_DMA is not selected. So what's going on here?

[1]
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ff40260f79dc0436604452bccd449bffd25ebafb



Lars-Peter Clausen  Arnd

The purpose of Arnd's patch is same with me, which is to resolve the build
error when SND_SOC_IMX_PCM_DMA=m  SND_SOC_FSL_SSI/SAI/ESAI/SPDIF=y, the
error is undefined reference to `imx_pcm_dma_init'.
But Arnd's patch didn't involve this situation that SND_IMX_SOC=n 
SND_SOC_IMX_PCM_DMA=m.


Having SND_SOC_IMX_PCM_DMA selected if SND_IMX_SOC is not selected makes no
sense. I think the proper fix is to find out why it is selected and make
sure that it is not selected when SND_IMX_SOC is not selected.



I guess the issue happens if SND_SOC_FSL_ASOC_CARD=m and 
SND_SOC_FSL_{ESAI,SAI,SSI}=y. In this case the fix is simply to drop the 
select SND_SOC_IMX_PCM_DMA from SND_SOC_FSL_ASOC_CARD.


- Lars

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread Shengjiu Wang
On Tue, Aug 19, 2014 at 10:45:04AM +0200, Lars-Peter Clausen wrote:
 On 08/19/2014 10:36 AM, Lars-Peter Clausen wrote:
 On 08/19/2014 09:41 AM, Shengjiu Wang wrote:
 On Mon, Aug 18, 2014 at 06:52:46PM +0200, Lars-Peter Clausen wrote:
 On 08/18/2014 10:38 AM, Shengjiu Wang wrote:
 Build kernel with SND_SOC_IMC_PCM_DMA=m  SND_IMX_SOC=n leads the
 following
 error:
 
 sound/built-in.o: In function `fsl_sai_probe':
 fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init'
 sound/built-in.o: In function `fsl_esai_probe':
 fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init'
 
 Most cpu driver in soc/fsl has use the function 'imx_pcm_dma_init' which 
 is
 defined in imx-pcm-dma.c, so need to select SND_SOC_IMX_PCM_DMA, but it
 depends
 on SND_IMX_SOC, if SND_IMX_SOC=n, then SND_SOC_IMX_PCM_DMA will not be
 selected.
 So remove the dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA.
 
 Reported-by: kbuild test robot fengguang...@intel.com
 Signed-off-by: Shengjiu Wang shengjiu.w...@freescale.com
 
 Those if conditions where just added[1] by Arnd to avoid other build
 failures. So just removing them again makes little sense.
 
 As far as I can see imx_pcm_dma_init() should be stubbed out when
 SND_SOC_IMX_PCM_DMA is not selected. So what's going on here?
 
 [1]
 http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ff40260f79dc0436604452bccd449bffd25ebafb
 
 
 Lars-Peter Clausen  Arnd
 
 The purpose of Arnd's patch is same with me, which is to resolve the build
 error when SND_SOC_IMX_PCM_DMA=m  SND_SOC_FSL_SSI/SAI/ESAI/SPDIF=y, the
 error is undefined reference to `imx_pcm_dma_init'.
 But Arnd's patch didn't involve this situation that SND_IMX_SOC=n 
 SND_SOC_IMX_PCM_DMA=m.
 
 Having SND_SOC_IMX_PCM_DMA selected if SND_IMX_SOC is not selected makes no
 sense. I think the proper fix is to find out why it is selected and make
 sure that it is not selected when SND_IMX_SOC is not selected.
 
 
 I guess the issue happens if SND_SOC_FSL_ASOC_CARD=m and
 SND_SOC_FSL_{ESAI,SAI,SSI}=y. In this case the fix is simply to drop
 the select SND_SOC_IMX_PCM_DMA from SND_SOC_FSL_ASOC_CARD.
 
 - Lars


Yes, you are right. Thanks. I will send another patch.

best regards
wang shengjiu 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

RE: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread li.xi...@freescale.com
How about the following :


diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 5ae777a..d42f18c 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -15,7 +15,7 @@ config SND_SOC_FSL_ASRC
 config SND_SOC_FSL_SAI
tristate Synchronous Audio Interface (SAI) module support
select REGMAP_MMIO
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
select SND_SOC_GENERIC_DMAENGINE_PCM
help
  Say Y if you want to add Synchronous Audio Interface (SAI)
@@ -25,7 +25,7 @@ config SND_SOC_FSL_SAI

 config SND_SOC_FSL_SSI
tristate Synchronous Serial Interface module support
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n  (MXC_TZIC || MXC_AVIC)
select REGMAP_MMIO
help
@@ -37,7 +37,7 @@ config SND_SOC_FSL_SSI
 config SND_SOC_FSL_SPDIF
tristate Sony/Philips Digital Interface module support
select REGMAP_MMIO
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n  (MXC_TZIC || MXC_AVIC)
help
  Say Y if you want to add Sony/Philips Digital Interface (SPDIF)
@@ -48,7 +48,7 @@ config SND_SOC_FSL_SPDIF
 config SND_SOC_FSL_ESAI
tristate Enhanced Serial Audio Interface (ESAI) module support
select REGMAP_MMIO
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
help
  Say Y if you want to add Enhanced Synchronous Audio Interface
  (ESAI) support for the Freescale CPUs.
@@ -76,6 +76,7 @@ config SND_SOC_FSL_ASOC_CARD

 config SND_SOC_IMX_PCM_DMA
tristate
+   depends on SND_IMX_SOC
select SND_SOC_GENERIC_DMAENGINE_PCM

 config SND_SOC_IMX_AUDMUX

Thanks,


BRs
Xiubo



 -Original Message-
 From: Shengjiu Wang [mailto:shengjiu.w...@freescale.com]
 Sent: Tuesday, August 19, 2014 4:21 PM
 To: Xiubo Li-B47053
 Cc: Lars-Peter Clausen; lgirdw...@gmail.com; broo...@kernel.org;
 pe...@perex.cz; ti...@suse.de; nicoleots...@gmail.com; shc_w...@mail.ru;
 Estevam Fabio-R49496; x...@kosagi.com; a...@arndb.de; s...@canb.auug.org.au;
 ti...@tabi.org; alsa-de...@alsa-project.org; linuxppc-dev@lists.ozlabs.org;
 linux-ker...@vger.kernel.org
 Subject: Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence
 of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA
 
 On Tue, Aug 19, 2014 at 04:13:15PM +0800, Xiubo Li-B47053 wrote:
   Subject: Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove
 dependence
   of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA
  
   On Mon, Aug 18, 2014 at 06:52:46PM +0200, Lars-Peter Clausen wrote:
On 08/18/2014 10:38 AM, Shengjiu Wang wrote:
Build kernel with SND_SOC_IMC_PCM_DMA=m  SND_IMX_SOC=n leads the
   following
error:

sound/built-in.o: In function `fsl_sai_probe':
fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init'
sound/built-in.o: In function `fsl_esai_probe':
fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init'

Most cpu driver in soc/fsl has use the function 'imx_pcm_dma_init'
 which is
defined in imx-pcm-dma.c, so need to select SND_SOC_IMX_PCM_DMA, but it
   depends
on SND_IMX_SOC, if SND_IMX_SOC=n, then SND_SOC_IMX_PCM_DMA will not be
selected.
So remove the dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA.

Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: Shengjiu Wang shengjiu.w...@freescale.com
   
Those if conditions where just added[1] by Arnd to avoid other build
failures. So just removing them again makes little sense.
   
As far as I can see imx_pcm_dma_init() should be stubbed out when
SND_SOC_IMX_PCM_DMA is not selected. So what's going on here?
   
[1]
  
 http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ff40
   260f79dc0436604452bccd449bffd25ebafb
   
   Lars-Peter Clausen  Arnd
  
   The purpose of Arnd's patch is same with me, which is to resolve the build
   error when SND_SOC_IMX_PCM_DMA=m  SND_SOC_FSL_SSI/SAI/ESAI/SPDIF=y, the
   error is undefined reference to `imx_pcm_dma_init'.
   But Arnd's patch didn't involve this situation that SND_IMX_SOC=n 
   SND_SOC_IMX_PCM_DMA=m.
  
   Currently I think out a solution for this issue is to change
  
   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
  
   to
  
   depends on SND_SOC_IMX_PCM_DMA != m
  
   How do you think about this?
  
 
  What will happen if to build both SAI/ESAI and IMX_PCM_DMA as modules at the
 same
  time ?
 
  Thanks,
 
  BRs
  Xiubo
 
 I didn't find error/warning when SAI/ESAI and IMX_PCM_DMA are as modules. The
 build is successful.
 
 
 
   best regards
   Wang shengjiu
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org

RE: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread shengjiu.w...@freescale.com
Hi Xiubo Li

 Lars-Peter has point out the root cause. It is caused by the 
SND_SOC_FSL_ASOC_CARD, which will select SND_SOC_IMX_PCM_DMA.

 Thank you very much anyway.

Best regards
Wang shengjiu

-Original Message-
From: Xiubo Li-B47053 
Sent: Tuesday, August 19, 2014 5:00 PM
To: Wang Shengjiu-B02247
Cc: Lars-Peter Clausen; lgirdw...@gmail.com; broo...@kernel.org; 
pe...@perex.cz; ti...@suse.de; nicoleots...@gmail.com; shc_w...@mail.ru; 
Estevam Fabio-R49496; x...@kosagi.com; a...@arndb.de; s...@canb.auug.org.au; 
ti...@tabi.org; alsa-de...@alsa-project.org; linuxppc-dev@lists.ozlabs.org; 
linux-ker...@vger.kernel.org
Subject: RE: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence 
of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

How about the following :


diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 
5ae777a..d42f18c 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -15,7 +15,7 @@ config SND_SOC_FSL_ASRC  config SND_SOC_FSL_SAI
tristate Synchronous Audio Interface (SAI) module support
select REGMAP_MMIO
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
select SND_SOC_GENERIC_DMAENGINE_PCM
help
  Say Y if you want to add Synchronous Audio Interface (SAI) @@ -25,7 
+25,7 @@ config SND_SOC_FSL_SAI

 config SND_SOC_FSL_SSI
tristate Synchronous Serial Interface module support
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n  (MXC_TZIC || MXC_AVIC)
select REGMAP_MMIO
help
@@ -37,7 +37,7 @@ config SND_SOC_FSL_SSI  config SND_SOC_FSL_SPDIF
tristate Sony/Philips Digital Interface module support
select REGMAP_MMIO
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n  (MXC_TZIC || MXC_AVIC)
help
  Say Y if you want to add Sony/Philips Digital Interface (SPDIF) @@ 
-48,7 +48,7 @@ config SND_SOC_FSL_SPDIF  config SND_SOC_FSL_ESAI
tristate Enhanced Serial Audio Interface (ESAI) module support
select REGMAP_MMIO
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
help
  Say Y if you want to add Enhanced Synchronous Audio Interface
  (ESAI) support for the Freescale CPUs.
@@ -76,6 +76,7 @@ config SND_SOC_FSL_ASOC_CARD

 config SND_SOC_IMX_PCM_DMA
tristate
+   depends on SND_IMX_SOC
select SND_SOC_GENERIC_DMAENGINE_PCM

 config SND_SOC_IMX_AUDMUX

Thanks,


BRs
Xiubo



 -Original Message-
 From: Shengjiu Wang [mailto:shengjiu.w...@freescale.com]
 Sent: Tuesday, August 19, 2014 4:21 PM
 To: Xiubo Li-B47053
 Cc: Lars-Peter Clausen; lgirdw...@gmail.com; broo...@kernel.org; 
 pe...@perex.cz; ti...@suse.de; nicoleots...@gmail.com; 
 shc_w...@mail.ru; Estevam Fabio-R49496; x...@kosagi.com; 
 a...@arndb.de; s...@canb.auug.org.au; ti...@tabi.org; 
 alsa-de...@alsa-project.org; linuxppc-dev@lists.ozlabs.org; 
 linux-ker...@vger.kernel.org
 Subject: Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove 
 dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA
 
 On Tue, Aug 19, 2014 at 04:13:15PM +0800, Xiubo Li-B47053 wrote:
   Subject: Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: 
   remove
 dependence
   of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA
  
   On Mon, Aug 18, 2014 at 06:52:46PM +0200, Lars-Peter Clausen wrote:
On 08/18/2014 10:38 AM, Shengjiu Wang wrote:
Build kernel with SND_SOC_IMC_PCM_DMA=m  SND_IMX_SOC=n leads 
the
   following
error:

sound/built-in.o: In function `fsl_sai_probe':
fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init'
sound/built-in.o: In function `fsl_esai_probe':
fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init'

Most cpu driver in soc/fsl has use the function 'imx_pcm_dma_init'
 which is
defined in imx-pcm-dma.c, so need to select 
SND_SOC_IMX_PCM_DMA, but it
   depends
on SND_IMX_SOC, if SND_IMX_SOC=n, then SND_SOC_IMX_PCM_DMA will 
not be selected.
So remove the dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA.

Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: Shengjiu Wang shengjiu.w...@freescale.com
   
Those if conditions where just added[1] by Arnd to avoid other 
build failures. So just removing them again makes little sense.
   
As far as I can see imx_pcm_dma_init() should be stubbed out 
when SND_SOC_IMX_PCM_DMA is not selected. So what's going on here?
   
[1]
  
 http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/
 ?id=ff40
   260f79dc0436604452bccd449bffd25ebafb
   
   Lars-Peter Clausen  Arnd
  
   The purpose of Arnd's patch is same with me, which is to resolve 
   the build error when SND_SOC_IMX_PCM_DMA=m  
   

Linux 3.16: all my drivers on SPI bus report WARNING: at drivers/base/dd.c:286

2014-08-19 Thread leroy christophe
Since Linux 3.16, for all drivers tied to SPI bus, I get the following 
warning on a PowerPC 8xx.

It doesn't happen with Linux 3.15

What can be the reason / what should I look at ?

[3.086957] device: 'spi32766.1': device_add
[3.087179] bus: 'spi': add device spi32766.1
[3.087653] bus: 'spi': driver_probe_device: matched device 
spi32766.1 with driver lm70
[3.087743] bus: 'spi': really_probe: probing driver lm70 with device 
spi32766.1

[3.088014] [ cut here ]
[3.092348] WARNING: at drivers/base/dd.c:286
[3.096637] Modules linked in:
[3.099697] CPU: 0 PID: 25 Comm: kworker/u2:1 Tainted: G W 
3.16.1-s3k-drv-999-svn5771_knld-999 #158

[3.109610] Workqueue: deferwq deferred_probe_work_func
[3.114736] task: c787f020 ti: c790c000 task.ti: c790c000
[3.120062] NIP: c01df158 LR: c01df144 CTR: 
[3.124983] REGS: c790db30 TRAP: 0700   Tainted: GW 
(3.16.1-s3k-drv-999-svn5771_knld-999)

[3.134162] MSR: 00029032 EE,ME,IR,DR,RI  CR: 22002082 XER: 2000
[3.140703]
[3.140703] GPR00: 0001 c790dbe0 c787f020 0044 0054 
0308 c056da0e 20737069
[3.140703] GPR08: 33323736 000ebfe0 0308 000ebfdf 22002082 
 c046c5a0 c046c608
[3.140703] GPR16: c046c614 c046c620 c046c62c c046c638 c046c648 
c046c654 c046c68c c046c6c4
[3.140703] GPR24:   0003 c0401aa0 c0596638 
c059662c c054e7a8 c7996800

[3.170102] NIP [c01df158] driver_probe_device+0xf8/0x334
[3.175431] LR [c01df144] driver_probe_device+0xe4/0x334
[3.180633] Call Trace:
[3.183093] [c790dbe0] [c01df144] driver_probe_device+0xe4/0x334 
(unreliable)

[3.190147] [c790dc10] [c01dd15c] bus_for_each_drv+0x7c/0xc0
[3.195741] [c790dc40] [c01df5fc] device_attach+0xcc/0xf8
[3.201076] [c790dc60] [c01dd6d4] bus_probe_device+0xb4/0xc4
[3.20] [c790dc80] [c01db9f8] device_add+0x270/0x564
[3.211923] [c790dcc0] [c0219e84] spi_add_device+0xc0/0x190
[3.217427] [c790dce0] [c021a79c] spi_register_master+0x720/0x834
[3.223455] [c790dd40] [c021cb48] of_fsl_spi_probe+0x55c/0x614
[3.229234] [c790dda0] [c01e0d2c] platform_drv_probe+0x30/0x74
[3.234987] [c790ddb0] [c01df18c] driver_probe_device+0x12c/0x334
[3.241008] [c790dde0] [c01dd15c] bus_for_each_drv+0x7c/0xc0
[3.246602] [c790de10] [c01df5fc] device_attach+0xcc/0xf8
[3.251937] [c790de30] [c01dd6d4] bus_probe_device+0xb4/0xc4
[3.257536] [c790de50] [c01de9d8] deferred_probe_work_func+0x98/0xe0
[3.263816] [c790de70] [c00305b8] process_one_work+0x18c/0x440
[3.269577] [c790dea0] [c0030a00] worker_thread+0x194/0x67c
[3.275105] [c790def0] [c0039198] kthread+0xd0/0xe4
[3.279911] [c790df40] [c000c6d0] ret_from_kernel_thread+0x5c/0x64
[3.285970] Instruction dump:
[3.288900] 80de 419e01d0 3b7b0038 3c60c046 7f65db78 38635264 
48211b99 813f00a0
[3.296559] 381f00a0 7d290278 3169 7c0b4910 0f00 93df0044 
7fe3fb78 4bfffd4d

[3.304401] ---[ end trace c75d3461bf9e2961 ]---
[3.309598] device: 'hwmon1': device_add
[3.310246] driver: 'lm70': driver_bound: bound to device 'spi32766.1'
[3.310342] bus: 'spi': really_probe: bound device spi32766.1 to 
driver lm70


Christophe
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH V2] ASoC: fsl-asoc-card: move 'config SND_SOC_FSL_ASOC_CARD' to 'if SND_IMX_SOC'

2014-08-19 Thread Shengjiu Wang
Build kernel with SND_SOC_FSL_ASOC_CARD=m  SND_SOC_FSL_{SSI,SAI,ESAI}=y
leads the following error:

   sound/built-in.o: In function `fsl_sai_probe':
 fsl_sai.c:(.text+0x5f662): undefined reference to `imx_pcm_dma_init'
   sound/built-in.o: In function `fsl_esai_probe':
 fsl_esai.c:(.text+0x6044b): undefined reference to `imx_pcm_dma_init'

The config SND_SOC_FSL_ASOC_CARD is for IMX SOC, So move it under condition
of 'if SND_IMX_SOC'.

Reported-by: kbuild test robot fengguang...@intel.com
Signed-off-by: Shengjiu Wang shengjiu.w...@freescale.com
---
 sound/soc/fsl/Kconfig |   34 +-
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 417ff70..9348fef 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -58,23 +58,6 @@ config SND_SOC_FSL_ESAI
 config SND_SOC_FSL_UTILS
tristate
 
-config SND_SOC_FSL_ASOC_CARD
-   tristate Generic ASoC Sound Card with ASRC support
-   depends on OF  I2C
-   select SND_SOC_IMX_AUDMUX
-   select SND_SOC_IMX_PCM_DMA
-   select SND_SOC_FSL_ESAI
-   select SND_SOC_FSL_SAI
-   select SND_SOC_FSL_SSI
-   select SND_SOC_CS42XX8_I2C
-   select SND_SOC_SGTL5000
-   select SND_SOC_WM8962
-   help
-ALSA SoC Audio support with ASRC feature for Freescale SoCs that have
-ESAI/SAI/SSI and connect with external CODECs such as WM8962, CS42888
-and SGTL5000.
-Say Y if you want to add support for Freescale Generic ASoC Sound Card.
-
 config SND_SOC_IMX_PCM_DMA
tristate
select SND_SOC_GENERIC_DMAENGINE_PCM
@@ -285,6 +268,23 @@ config SND_SOC_IMX_MC13783
select SND_SOC_MC13783
select SND_SOC_IMX_PCM_DMA
 
+config SND_SOC_FSL_ASOC_CARD
+   tristate Generic ASoC Sound Card with ASRC support
+   depends on OF  I2C
+   select SND_SOC_IMX_AUDMUX
+   select SND_SOC_IMX_PCM_DMA
+   select SND_SOC_FSL_ESAI
+   select SND_SOC_FSL_SAI
+   select SND_SOC_FSL_SSI
+   select SND_SOC_CS42XX8_I2C
+   select SND_SOC_SGTL5000
+   select SND_SOC_WM8962
+   help
+ALSA SoC Audio support with ASRC feature for Freescale SoCs that have
+ESAI/SAI/SSI and connect with external CODECs such as WM8962, CS42888
+and SGTL5000.
+Say Y if you want to add support for Freescale Generic ASoC Sound Card.
+
 endif # SND_IMX_SOC
 
 endmenu
-- 
1.7.9.5

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread Takashi Iwai
At Tue, 19 Aug 2014 09:00:06 +,
li.xi...@freescale.com wrote:
 
 How about the following :
 
 
 diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
 index 5ae777a..d42f18c 100644
 --- a/sound/soc/fsl/Kconfig
 +++ b/sound/soc/fsl/Kconfig
 @@ -15,7 +15,7 @@ config SND_SOC_FSL_ASRC
  config SND_SOC_FSL_SAI
 tristate Synchronous Audio Interface (SAI) module support
 select REGMAP_MMIO
 -   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
 +   select SND_SOC_IMX_PCM_DMA
 select SND_SOC_GENERIC_DMAENGINE_PCM
 help
   Say Y if you want to add Synchronous Audio Interface (SAI)
 @@ -25,7 +25,7 @@ config SND_SOC_FSL_SAI
 
  config SND_SOC_FSL_SSI
 tristate Synchronous Serial Interface module support
 -   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
 +   select SND_SOC_IMX_PCM_DMA
 select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n  (MXC_TZIC || 
 MXC_AVIC)
 select REGMAP_MMIO
 help
 @@ -37,7 +37,7 @@ config SND_SOC_FSL_SSI
  config SND_SOC_FSL_SPDIF
 tristate Sony/Philips Digital Interface module support
 select REGMAP_MMIO
 -   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
 +   select SND_SOC_IMX_PCM_DMA
 select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n  (MXC_TZIC || 
 MXC_AVIC)
 help
   Say Y if you want to add Sony/Philips Digital Interface (SPDIF)
 @@ -48,7 +48,7 @@ config SND_SOC_FSL_SPDIF
  config SND_SOC_FSL_ESAI
 tristate Enhanced Serial Audio Interface (ESAI) module support
 select REGMAP_MMIO
 -   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
 +   select SND_SOC_IMX_PCM_DMA
 help
   Say Y if you want to add Enhanced Synchronous Audio Interface
   (ESAI) support for the Freescale CPUs.
 @@ -76,6 +76,7 @@ config SND_SOC_FSL_ASOC_CARD
 
  config SND_SOC_IMX_PCM_DMA
 tristate
 +   depends on SND_IMX_SOC
 select SND_SOC_GENERIC_DMAENGINE_PCM
 
  config SND_SOC_IMX_AUDMUX

I see the problem has been addressed, so JFYI: a reverse selection
doesn't resolve depends on.  It's a known shortcoming.  That is, a
selected item can select further others, but cannot depend on others.


Takashi
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [alsa-devel] [PATCH V1 1/3] ASoC: fsl: Kconfig: remove dependence of SND_IMX_SOC for SND_SOC_IMX_PCM_DMA

2014-08-19 Thread Lars-Peter Clausen

On 08/19/2014 12:35 PM, Takashi Iwai wrote:

At Tue, 19 Aug 2014 09:00:06 +,
li.xi...@freescale.com wrote:


How about the following :


diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig
index 5ae777a..d42f18c 100644
--- a/sound/soc/fsl/Kconfig
+++ b/sound/soc/fsl/Kconfig
@@ -15,7 +15,7 @@ config SND_SOC_FSL_ASRC
  config SND_SOC_FSL_SAI
 tristate Synchronous Audio Interface (SAI) module support
 select REGMAP_MMIO
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
 select SND_SOC_GENERIC_DMAENGINE_PCM
 help
   Say Y if you want to add Synchronous Audio Interface (SAI)
@@ -25,7 +25,7 @@ config SND_SOC_FSL_SAI

  config SND_SOC_FSL_SSI
 tristate Synchronous Serial Interface module support
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
 select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n  (MXC_TZIC || 
MXC_AVIC)
 select REGMAP_MMIO
 help
@@ -37,7 +37,7 @@ config SND_SOC_FSL_SSI
  config SND_SOC_FSL_SPDIF
 tristate Sony/Philips Digital Interface module support
 select REGMAP_MMIO
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
 select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n  (MXC_TZIC || 
MXC_AVIC)
 help
   Say Y if you want to add Sony/Philips Digital Interface (SPDIF)
@@ -48,7 +48,7 @@ config SND_SOC_FSL_SPDIF
  config SND_SOC_FSL_ESAI
 tristate Enhanced Serial Audio Interface (ESAI) module support
 select REGMAP_MMIO
-   select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n
+   select SND_SOC_IMX_PCM_DMA
 help
   Say Y if you want to add Enhanced Synchronous Audio Interface
   (ESAI) support for the Freescale CPUs.
@@ -76,6 +76,7 @@ config SND_SOC_FSL_ASOC_CARD

  config SND_SOC_IMX_PCM_DMA
 tristate
+   depends on SND_IMX_SOC
 select SND_SOC_GENERIC_DMAENGINE_PCM

  config SND_SOC_IMX_AUDMUX


I see the problem has been addressed, so JFYI: a reverse selection
doesn't resolve depends on.  It's a known shortcoming.  That is, a
selected item can select further others, but cannot depend on others.


The item will still be selected regardless of its dependencies, but Kconfig 
will print a warning if one or more of the dependencies are not met along 
with the dependency chain that causes the warning. So you'll have a clue why 
things go wrong.


- Lars

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/4] powerpc/fsl_msi: change the irq handler from chained to normal

2014-08-19 Thread Laurentiu Tudor
As we do for other fsl-mpic related cascaded irqchips
(e.g. error ints, mpic timers), use a normal irq handler
for msi irqs too.
This brings some advantages such as mask/unmask/ack/eoi
and irq state taken care behind the scenes, kstats
updates a.s.o plus access to features provided by mpic,
such as affinity.

Signed-off-by: Laurentiu Tudor laurentiu.tu...@freescale.com
Cc: Scott Wood scottw...@freescale.com
Cc: Mihai Caraman mihai.cara...@freescale.com
---
 arch/powerpc/sysdev/fsl_msi.c | 56 ++-
 1 file changed, 18 insertions(+), 38 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 05a0dd9..0cfc32a 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -18,6 +18,7 @@
 #include linux/pci.h
 #include linux/slab.h
 #include linux/of_platform.h
+#include linux/interrupt.h
 #include sysdev/fsl_soc.h
 #include asm/prom.h
 #include asm/hw_irq.h
@@ -241,40 +242,24 @@ out_free:
return rc;
 }
 
-static void fsl_msi_cascade(unsigned int irq, struct irq_desc *desc)
+static irqreturn_t fsl_msi_cascade(int irq, void *data)
 {
-   struct irq_chip *chip = irq_desc_get_chip(desc);
-   struct irq_data *idata = irq_desc_get_irq_data(desc);
unsigned int cascade_irq;
struct fsl_msi *msi_data;
int msir_index = -1;
u32 msir_value = 0;
u32 intr_index;
u32 have_shift = 0;
-   struct fsl_msi_cascade_data *cascade_data;
+   struct fsl_msi_cascade_data *cascade_data = data;
+   irqreturn_t ret = IRQ_NONE;
 
-   cascade_data = irq_get_handler_data(irq);
msi_data = cascade_data-msi_data;
 
-   raw_spin_lock(desc-lock);
-   if ((msi_data-feature   FSL_PIC_IP_MASK) == FSL_PIC_IP_IPIC) {
-   if (chip-irq_mask_ack)
-   chip-irq_mask_ack(idata);
-   else {
-   chip-irq_mask(idata);
-   chip-irq_ack(idata);
-   }
-   }
-
-   if (unlikely(irqd_irq_inprogress(idata)))
-   goto unlock;
-
msir_index = cascade_data-index;
 
if (msir_index = NR_MSI_REG_MAX)
cascade_irq = NO_IRQ;
 
-   irqd_set_chained_irq_inprogress(idata);
switch (msi_data-feature  FSL_PIC_IP_MASK) {
case FSL_PIC_IP_MPIC:
msir_value = fsl_msi_read(msi_data-msi_regs,
@@ -303,25 +288,15 @@ static void fsl_msi_cascade(unsigned int irq, struct 
irq_desc *desc)
cascade_irq = irq_linear_revmap(msi_data-irqhost,
msi_hwirq(msi_data, msir_index,
  intr_index + have_shift));
-   if (cascade_irq != NO_IRQ)
+   if (cascade_irq != NO_IRQ) {
generic_handle_irq(cascade_irq);
+   ret = IRQ_HANDLED;
+   }
have_shift += intr_index + 1;
msir_value = msir_value  (intr_index + 1);
}
-   irqd_clr_chained_irq_inprogress(idata);
 
-   switch (msi_data-feature  FSL_PIC_IP_MASK) {
-   case FSL_PIC_IP_MPIC:
-   case FSL_PIC_IP_VMPIC:
-   chip-irq_eoi(idata);
-   break;
-   case FSL_PIC_IP_IPIC:
-   if (!irqd_irq_disabled(idata)  chip-irq_unmask)
-   chip-irq_unmask(idata);
-   break;
-   }
-unlock:
-   raw_spin_unlock(desc-lock);
+   return ret;
 }
 
 static int fsl_of_msi_remove(struct platform_device *ofdev)
@@ -336,9 +311,8 @@ static int fsl_of_msi_remove(struct platform_device *ofdev)
virq = msi-cascade_array[i]-virq;
 
BUG_ON(virq == NO_IRQ);
-   BUG_ON(msi-cascade_array[i] !=
-   irq_get_handler_data(virq));
 
+   free_irq(virq, msi-cascade_array[i]);
kfree(msi-cascade_array[i]);
irq_dispose_mapping(virq);
}
@@ -358,7 +332,7 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct 
platform_device *dev,
   int offset, int irq_index)
 {
struct fsl_msi_cascade_data *cascade_data = NULL;
-   int virt_msir, i;
+   int virt_msir, i, ret;
 
virt_msir = irq_of_parse_and_map(dev-dev.of_node, irq_index);
if (virt_msir == NO_IRQ) {
@@ -377,8 +351,14 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct 
platform_device *dev,
cascade_data-msi_data = msi;
cascade_data-virq = virt_msir;
msi-cascade_array[irq_index] = cascade_data;
-   irq_set_handler_data(virt_msir, cascade_data);
-   irq_set_chained_handler(virt_msir, fsl_msi_cascade);
+
+   ret = request_irq(virt_msir, fsl_msi_cascade, 0,
+ fsl-msi-cascade, cascade_data);
+   if (ret) {
+   dev_err(dev-dev, failed to request_irq(%d), ret = %d\n,
+ 

[PATCH 1/4] powerpc/fsl_msi: reorganize structs to improve clarity and flexibility

2014-08-19 Thread Laurentiu Tudor
Store cascade_data in an array inside the driver
data for later use.
Get rid of the msi_virq array since now we can
encapsulate the virqs in the cascade_data
directly and access them through the array
mentioned earlier.

Signed-off-by: Laurentiu Tudor laurentiu.tu...@freescale.com
Cc: Scott Wood scottw...@freescale.com
Cc: Mihai Caraman mihai.cara...@freescale.com
---
 arch/powerpc/sysdev/fsl_msi.c | 17 +++--
 arch/powerpc/sysdev/fsl_msi.h |  4 +++-
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 9fadc6e..05a0dd9 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -50,6 +50,7 @@ struct fsl_msi_feature {
 struct fsl_msi_cascade_data {
struct fsl_msi *msi_data;
int index;
+   int virq;
 };
 
 static inline u32 fsl_msi_read(u32 __iomem *base, unsigned int reg)
@@ -327,15 +328,18 @@ static int fsl_of_msi_remove(struct platform_device 
*ofdev)
 {
struct fsl_msi *msi = platform_get_drvdata(ofdev);
int virq, i;
-   struct fsl_msi_cascade_data *cascade_data;
 
if (msi-list.prev != NULL)
list_del(msi-list);
for (i = 0; i  NR_MSI_REG_MAX; i++) {
-   virq = msi-msi_virqs[i];
-   if (virq != NO_IRQ) {
-   cascade_data = irq_get_handler_data(virq);
-   kfree(cascade_data);
+   if (msi-cascade_array[i]) {
+   virq = msi-cascade_array[i]-virq;
+
+   BUG_ON(virq == NO_IRQ);
+   BUG_ON(msi-cascade_array[i] !=
+   irq_get_handler_data(virq));
+
+   kfree(msi-cascade_array[i]);
irq_dispose_mapping(virq);
}
}
@@ -369,9 +373,10 @@ static int fsl_msi_setup_hwirq(struct fsl_msi *msi, struct 
platform_device *dev,
return -ENOMEM;
}
irq_set_lockdep_class(virt_msir, fsl_msi_irq_class);
-   msi-msi_virqs[irq_index] = virt_msir;
cascade_data-index = offset;
cascade_data-msi_data = msi;
+   cascade_data-virq = virt_msir;
+   msi-cascade_array[irq_index] = cascade_data;
irq_set_handler_data(virt_msir, cascade_data);
irq_set_chained_handler(virt_msir, fsl_msi_cascade);
 
diff --git a/arch/powerpc/sysdev/fsl_msi.h b/arch/powerpc/sysdev/fsl_msi.h
index df9aa9f..420cfcb 100644
--- a/arch/powerpc/sysdev/fsl_msi.h
+++ b/arch/powerpc/sysdev/fsl_msi.h
@@ -27,6 +27,8 @@
 #define FSL_PIC_IP_IPIC   0x0002
 #define FSL_PIC_IP_VMPIC  0x0003
 
+struct fsl_msi_cascade_data;
+
 struct fsl_msi {
struct irq_domain *irqhost;
 
@@ -37,7 +39,7 @@ struct fsl_msi {
u32 srs_shift; /* Shift of the shared interrupt register select */
void __iomem *msi_regs;
u32 feature;
-   int msi_virqs[NR_MSI_REG_MAX];
+   struct fsl_msi_cascade_data *cascade_array[NR_MSI_REG_MAX];
 
struct msi_bitmap bitmap;
 
-- 
1.9.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/4] powerpc/fsl_msi: show more meaningful names in /proc/interrupts

2014-08-19 Thread Laurentiu Tudor
Rename the irq controller associated with a MSI
interrupt to fsl-msi-V, where V is the virq
of the cascade irq backing up this MSI interrupt.
This way, one can set the affinity of a MSI
through the cascade irq associated with said MSI
interrupt.
Given this example /proc/interrupts snippet:

   CPU0   CPU1   CPU2   CPU3
 16:  0  0  0  0   OpenPIC16 Edge  
mpic-error-int
 17:  0  4  0  0  fsl-msi-224   0 Edge  
eth0-rx-0
 18:  0  5  0  0  fsl-msi-225   1 Edge  
eth0-tx-0
 19:  0  2  0  0  fsl-msi-226   2 Edge  eth0
 [...]
224:  0 11  0  0   OpenPIC   224 Edge  
fsl-msi-cascade
225:  0  0  0  0   OpenPIC   225 Edge  
fsl-msi-cascade
226:  0  0  0  0   OpenPIC   226 Edge  
fsl-msi-cascade
 [...]

To change the affinity of MSI interrupt 17
(having the irq controller named fsl-msi-224)
instead of writing /proc/irq/17/smp_affinity, use
the associated MSI cascade irq, in this case,
interrupt 224, e.g.:

   echo 6  /proc/irq/224/smp_affinity

Note that a MSI cascade irq covers several MSI
interrupts, so changing the affinity on the
cascade will impact all of the associated MSI
interrupts.

Signed-off-by: Laurentiu Tudor laurentiu.tu...@freescale.com
Cc: Scott Wood scottw...@freescale.com
Cc: Mihai Caraman mihai.cara...@freescale.com
---
 arch/powerpc/sysdev/fsl_msi.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 0cfc32a..e2ee226 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -19,6 +19,7 @@
 #include linux/slab.h
 #include linux/of_platform.h
 #include linux/interrupt.h
+#include linux/seq_file.h
 #include sysdev/fsl_soc.h
 #include asm/prom.h
 #include asm/hw_irq.h
@@ -67,11 +68,24 @@ static void fsl_msi_end_irq(struct irq_data *d)
 {
 }
 
+static void fsl_msi_print_chip(struct irq_data *irqd, struct seq_file *p)
+{
+   struct fsl_msi *msi_data = irqd-domain-host_data;
+   irq_hw_number_t hwirq = irqd_to_hwirq(irqd);
+   int cascade_virq, srs;
+
+   srs = (hwirq  msi_data-srs_shift)  MSI_SRS_MASK;
+   cascade_virq = msi_data-cascade_array[srs]-virq;
+
+   seq_printf(p,  fsl-msi-%d, cascade_virq);
+}
+
+
 static struct irq_chip fsl_msi_chip = {
.irq_mask   = mask_msi_irq,
.irq_unmask = unmask_msi_irq,
.irq_ack= fsl_msi_end_irq,
-   .name   = FSL-MSI,
+   .irq_print_chip = fsl_msi_print_chip,
 };
 
 static int fsl_msi_host_map(struct irq_domain *h, unsigned int virq,
-- 
1.9.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 4/4] powerpc/fsl_msi: spread msi ints across different MSIRs

2014-08-19 Thread Laurentiu Tudor
Allocate msis such that each time a new
interrupt is requested, the SRS (MSIR
register select) to be used is allocated
in a round-robin fashion.
The end result is that the msi interrupts
will be spread across distinct MSIRs with
the main benefit that now users can set
affinity to each msi int through the mpic
irq backing up the MSIR register.
This is achieved with the help of a newly
introduced msi bitmap api that allows
specifying the starting point when
searching for a free msi interrupt.

Signed-off-by: Laurentiu Tudor laurentiu.tu...@freescale.com
Cc: Scott Wood scottw...@freescale.com
Cc: Mihai Caraman mihai.cara...@freescale.com
---
 arch/powerpc/include/asm/msi_bitmap.h |  2 ++
 arch/powerpc/sysdev/fsl_msi.c | 31 ++-
 arch/powerpc/sysdev/fsl_msi.h |  5 +
 arch/powerpc/sysdev/msi_bitmap.c  | 25 +++--
 4 files changed, 52 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/include/asm/msi_bitmap.h 
b/arch/powerpc/include/asm/msi_bitmap.h
index 97ac3f4..96c2f95 100644
--- a/arch/powerpc/include/asm/msi_bitmap.h
+++ b/arch/powerpc/include/asm/msi_bitmap.h
@@ -25,6 +25,8 @@ int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num);
 void msi_bitmap_free_hwirqs(struct msi_bitmap *bmp, unsigned int offset,
unsigned int num);
 void msi_bitmap_reserve_hwirq(struct msi_bitmap *bmp, unsigned int hwirq);
+int msi_bitmap_alloc_hwirqs_from_offset(struct msi_bitmap *bmp, int offset,
+   int num);
 
 int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp);
 
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index e2ee226..a0682fb 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -213,6 +213,8 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev, int 
nvec, int type)
 * available interrupt.
 */
list_for_each_entry(msi_data, msi_head, list) {
+   int off;
+
/*
 * If the PCI node has an fsl,msi property, then we
 * restrict our search to the corresponding MSI node.
@@ -224,7 +226,28 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev, int 
nvec, int type)
if (phandle  (phandle != msi_data-phandle))
continue;
 
-   hwirq = msi_bitmap_alloc_hwirqs(msi_data-bitmap, 1);
+   /*
+* Allocate the msi message so that it fits on distinct
+* MSIR registers. Obviously, since MSIR registers are
+* limited they will overlap at one point.
+*
+* Due to the format of the newly introduced MSIIR1 in
+* mpic 4.3, consecutive msi message values map to
+* distinct MSIRs, thus distinct msi irq cascades, so
+* nothing special needs to be done in this case.
+* On older mpic versions the chose distinct SRS
+* values by aligning the msi message value to the
+* SRS field shift.
+*/
+   if (msi_data-feature  FSL_PIC_FTR_MPIC_4_3) {
+   off = 0;
+   } else {
+   off = 
(atomic_inc_return(msi_data-msi_alloc_cnt) %
+   msi_data-msir_num);
+   off *= (1  msi_data-srs_shift);
+   }
+   hwirq = msi_bitmap_alloc_hwirqs_from_offset(
+   msi_data-bitmap, off, 1);
if (hwirq = 0)
break;
}
@@ -464,12 +487,17 @@ static int fsl_of_msi_probe(struct platform_device *dev)
goto error_out;
}
 
+   atomic_set(msi-msi_alloc_cnt, -1);
+
p = of_get_property(dev-dev.of_node, msi-available-ranges, len);
 
if (of_device_is_compatible(dev-dev.of_node, fsl,mpic-msi-v4.3) ||
of_device_is_compatible(dev-dev.of_node, fsl,vmpic-msi-v4.3)) {
msi-srs_shift = MSIIR1_SRS_SHIFT;
msi-ibs_shift = MSIIR1_IBS_SHIFT;
+   msi-msir_num = NR_MSI_REG_MSIIR1;
+   msi-feature |= FSL_PIC_FTR_MPIC_4_3;
+
if (p)
dev_warn(dev-dev, %s: dose not support 
msi-available-ranges property\n,
__func__);
@@ -487,6 +515,7 @@ static int fsl_of_msi_probe(struct platform_device *dev)
 
msi-srs_shift = MSIIR_SRS_SHIFT;
msi-ibs_shift = MSIIR_IBS_SHIFT;
+   msi-msir_num = NR_MSI_REG_MSIIR;
 
if (p  len % (2 * sizeof(u32)) != 0) {
  

Re: [PATCH V2] ASoC: fsl-asoc-card: move 'config SND_SOC_FSL_ASOC_CARD' to 'if SND_IMX_SOC'

2014-08-19 Thread Mark Brown
On Tue, Aug 19, 2014 at 05:36:41PM +0800, Shengjiu Wang wrote:
 Build kernel with SND_SOC_FSL_ASOC_CARD=m  SND_SOC_FSL_{SSI,SAI,ESAI}=y
 leads the following error:

Applied, thanks.


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/pseries: Fix endian issues in memory hotplug

2014-08-19 Thread Thomas Falcon
Values acquired from Open Firmware are in 32-bit big endian format
and need to be handled on little endian architectures.  This patch
ensures values are in cpu endian when hotplugging memory.

Signed-off-by: Thomas Falcon tlfal...@linux.vnet.ibm.com
---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 36 +
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c 
b/arch/powerpc/platforms/pseries/hotplug-memory.c
index c904583..17ee193 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -113,7 +113,7 @@ out:
 static int pseries_remove_mem_node(struct device_node *np)
 {
const char *type;
-   const unsigned int *regs;
+   const __be32 *regs;
unsigned long base;
unsigned int lmb_size;
int ret = -EINVAL;
@@ -132,8 +132,8 @@ static int pseries_remove_mem_node(struct device_node *np)
if (!regs)
return ret;
 
-   base = *(unsigned long *)regs;
-   lmb_size = regs[3];
+   base = be64_to_cpu(*(unsigned long *)regs);
+   lmb_size = be32_to_cpu(regs[3]);
 
pseries_remove_memblock(base, lmb_size);
return 0;
@@ -153,7 +153,7 @@ static inline int pseries_remove_mem_node(struct 
device_node *np)
 static int pseries_add_mem_node(struct device_node *np)
 {
const char *type;
-   const unsigned int *regs;
+   const __be32 *regs;
unsigned long base;
unsigned int lmb_size;
int ret = -EINVAL;
@@ -172,8 +172,8 @@ static int pseries_add_mem_node(struct device_node *np)
if (!regs)
return ret;
 
-   base = *(unsigned long *)regs;
-   lmb_size = regs[3];
+   base = be64_to_cpu(*(unsigned long *)regs);
+   lmb_size = be32_to_cpu(regs[3]);
 
/*
 * Update memory region to represent the memory add
@@ -187,14 +187,14 @@ static int pseries_update_drconf_memory(struct 
of_prop_reconfig *pr)
struct of_drconf_cell *new_drmem, *old_drmem;
unsigned long memblock_size;
u32 entries;
-   u32 *p;
+   __be32 *p;
int i, rc = -EINVAL;
 
memblock_size = pseries_memory_block_size();
if (!memblock_size)
return -EINVAL;
 
-   p = (u32 *) pr-old_prop-value;
+   p = (__be32 *) pr-old_prop-value;
if (!p)
return -EINVAL;
 
@@ -203,28 +203,30 @@ static int pseries_update_drconf_memory(struct 
of_prop_reconfig *pr)
 * entries. Get the niumber of entries and skip to the array of
 * of_drconf_cell's.
 */
-   entries = *p++;
+   entries = be32_to_cpu(*p++);
old_drmem = (struct of_drconf_cell *)p;
 
-   p = (u32 *)pr-prop-value;
+   p = (__be32 *)pr-prop-value;
p++;
new_drmem = (struct of_drconf_cell *)p;
 
for (i = 0; i  entries; i++) {
-   if ((old_drmem[i].flags  DRCONF_MEM_ASSIGNED) 
-   (!(new_drmem[i].flags  DRCONF_MEM_ASSIGNED))) {
-   rc = pseries_remove_memblock(old_drmem[i].base_addr,
+   if ((be32_to_cpu(old_drmem[i].flags)  DRCONF_MEM_ASSIGNED) 
+   (!(be32_to_cpu(new_drmem[i].flags)  DRCONF_MEM_ASSIGNED))) 
{
+   rc = pseries_remove_memblock(
+   be64_to_cpu(old_drmem[i].base_addr),
 memblock_size);
break;
-   } else if ((!(old_drmem[i].flags  DRCONF_MEM_ASSIGNED)) 
-  (new_drmem[i].flags  DRCONF_MEM_ASSIGNED)) {
-   rc = memblock_add(old_drmem[i].base_addr,
+   } else if ((!(be32_to_cpu(old_drmem[i].flags) 
+   DRCONF_MEM_ASSIGNED)) 
+   (be32_to_cpu(new_drmem[i].flags) 
+   DRCONF_MEM_ASSIGNED)) {
+   rc = memblock_add(be64_to_cpu(old_drmem[i].base_addr),
  memblock_size);
rc = (rc  0) ? -EINVAL : 0;
break;
}
}
-
return rc;
 }
 
-- 
1.8.5.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: Fix build failure when MEMORY_HOTPLUG=y

2014-08-19 Thread Pranith Kumar
ARCH_ENABLE_MEMORY_HOTPLUG is enabled by default for powerpc. This causes build
failures when SPARSEMEM=n as memory hotplug needs definition which are defined
only when SPARSEMEM=y. The error is as follows:

arch/powerpc/platforms/pseries/hotplug-memory.c:27:31: error: 
'SECTION_SIZE_BITS' undeclared (first use in this function)
arch/powerpc/platforms/pseries/hotplug-memory.c:27:31: note: each undeclared 
identifier is reported only once for each function it appears in
arch/powerpc/platforms/pseries/hotplug-memory.c: In function 
'pseries_remove_memblock':
arch/powerpc/platforms/pseries/hotplug-memory.c:98:34: error: 
'SECTION_SIZE_BITS' undeclared (first use in this function)
make[2]: *** [arch/powerpc/platforms/pseries/hotplug-memory.o] Error 1

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
CC: Andew Morton a...@linux-foundation.org
---
 arch/powerpc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 9c1aa77..da16ffe 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -383,6 +383,7 @@ config ARCH_CPU_PROBE_RELEASE
 
 config ARCH_ENABLE_MEMORY_HOTPLUG
def_bool y
+   depends on SPARSEMEM
 
 config ARCH_HAS_WALK_MEMORY
def_bool y
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RFC PATCH] powerpc: Make SPU_FS depend on SPARSEMEM

2014-08-19 Thread Pranith Kumar
SPU_FS unconditionally enables MEMORY_HOTPLUG, which will fail to build if
SPARSEMEM=n.

Make SPU_FS depend on SPARSEMEM so that hotplug-memory.c does not fail to
compile.

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/powerpc/platforms/cell/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/cell/Kconfig 
b/arch/powerpc/platforms/cell/Kconfig
index 9978f59..832872e 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -60,7 +60,7 @@ menu Cell Broadband Engine options
 config SPU_FS
tristate SPU file system
default m
-   depends on PPC_CELL
+   depends on PPC_CELL  SPARSEMEM
select SPU_BASE
select MEMORY_HOTPLUG
help
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V7 00/17] Enable SRIOV on POWER8

2014-08-19 Thread Bjorn Helgaas
On Thu, Jul 24, 2014 at 02:22:10PM +0800, Wei Yang wrote:
 This patch set enables the SRIOV on POWER8.
 
 The gerneral idea is put each VF into one individual PE and allocate required
 resources like DMA/MSI.
 
 One thing special for VF PE is we use M64BT to cover the IOV BAR. M64BT is one
 hardware on POWER platform to map MMIO address to PE. By using M64BT, we could
 map one individual VF to a VF PE, which introduce more flexiblity to users.
 
 To achieve this effect, we need to do some hack on pci devices's resources.
 1. Expand the IOV BAR properly.
Done by pnv_pci_ioda_fixup_iov_resources().
 2. Shift the IOV BAR properly.
Done by pnv_pci_vf_resource_shift().
 3. IOV BAR alignment is the total size instead of an individual size on
powernv platform.
Done by pnv_pcibios_sriov_resource_alignment().
 4. Take the IOV BAR alignment into consideration in the sizing and assigning.
This is achieved by commit: PCI: Take additional IOV BAR alignment in
sizing and assigning
 
 Test Environment:
The SRIOV device tested is Emulex Lancer and Mellanox ConnectX-3 on
POWER8.
 
 Examples on pass through a VF to guest through vfio:
   1. install necessary modules
  modprobe vfio
  modprobe vfio-pci
   2. retrieve the iommu_group the device belongs to
  readlink /sys/bus/pci/devices/:06:0d.0/iommu_group
  ../../../../kernel/iommu_groups/26
  This means it belongs to group 26
   3. see how many devices under this iommu_group
  ls /sys/kernel/iommu_groups/26/devices/
   4. unbind the original driver and bind to vfio-pci driver
  echo :06:0d.0  /sys/bus/pci/devices/:06:0d.0/driver/unbind
  echo  1102 0002  /sys/bus/pci/drivers/vfio-pci/new_id
  Note: this should be done for each device in the same iommu_group
   5. Start qemu and pass device through vfio
  /home/ywywyang/git/qemu-impreza/ppc64-softmmu/qemu-system-ppc64 \
  -M pseries -m 2048 -enable-kvm -nographic \
  -drive file=/home/ywywyang/kvm/fc19.img \
  -monitor telnet:localhost:5435,server,nowait -boot cd \
  -device 
 spapr-pci-vfio-host-bridge,id=CXGB3,iommu=26,index=6
 
 Verify this is the exact VF response:
   1. ping from a machine in the same subnet(the broadcast domain)
   2. run arp -n on this machine
  9.115.251.20 ether   00:00:c9:df:ed:bf   C eth0
   3. ifconfig in the guest
  # ifconfig eth1
  eth1: flags=4163UP,BROADCAST,RUNNING,MULTICAST  mtu 1500
   inet 9.115.251.20  netmask 255.255.255.0  broadcast 
 9.115.251.255
   inet6 fe80::200:c9ff:fedf:edbf  prefixlen 64  scopeid 0x20link
   ether 00:00:c9:df:ed:bf  txqueuelen 1000 (Ethernet)
   RX packets 175  bytes 13278 (12.9 KiB)
   RX errors 0  dropped 0  overruns 0  frame 0
   TX packets 58  bytes 9276 (9.0 KiB)
   TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
   4. They have the same MAC address
 
   Note: make sure you shutdown other network interfaces in guest.
 
 ---
 v6 - v7:
1. add IORESOURCE_ARCH flag for IOV BAR on powernv platform.
2. when IOV BAR has IORESOURCE_ARCH flag, the size is retrieved from
   hardware directly. If not, calculate as usual.
3. reorder the patch set, group them by subsystem:
   PCI, powerpc, powernv
4. rebase it on 3.16-rc6

This doesn't apply for me on v3.16-rc6:

  02:48:57 ~/linux$ stg rebase v3.16-rc6
  Checking for changes in the working directory ... done
  Rebasing to v3.16-rc6 ... done
  No patches applied
  02:49:14 ~/linux$ stg import -M --sign m/wy
  Checking for changes in the working directory ... done
  Importing patch pci-iov-export-interface-for ... done
  Importing patch pci-iov-get-vf-bar-size-from ... done
  Importing patch pci-add-weak ... done
  Importing patch pci-take-additional-iov-bar ... done
  Importing patch powerpc-pci-don-t-unset-pci ... done
  Importing patch powerpc-pci-define ... done
  Importing patch powrepc-pci-refactor-pci_dn ... done
  Importing patch powerpc-powernv-use-pci_dn-in ... error: patch failed:
  arch/powerpc/platforms/powernv/pci.c:376
  error: arch/powerpc/platforms/powernv/pci.c: patch does not apply
  stg import: Diff does not apply cleanly

What am I missing?

I assume you intend these all to go through my tree just to keep them all
together.  The ideal rebase target for me would be v3.17-rc1.

Given the arch/powerpc parts, I'll want an ack from Ben.  I just chatted
with him about these, so I assume that's not a problem, but we should make
it explicit.

Bjorn
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: Make 256k pages depend on PPC32=n

2014-08-19 Thread Pranith Kumar
256k pages are not tested on PPC32. On a randconfig I got the following error:

arch/powerpc/kernel/misc_32.S:1171: Error: operand out of range 
(0x0001 is not between 0x8000 and 0x7fff)

Disable 256K pages if PPC32=y

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/powerpc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index da16ffe..6cc518f 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -556,7 +556,7 @@ config PPC_64K_PAGES
 
 config PPC_256K_PAGES
bool 256k page size if 44x
-   depends on !STDBINUTILS
+   depends on !PPC32  !STDBINUTILS
help
  Make the page size 256k.
 
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V7 01/17] PCI/IOV: Export interface for retrieve VF's BDF

2014-08-19 Thread Bjorn Helgaas
On Thu, Jul 24, 2014 at 02:22:11PM +0800, Wei Yang wrote:
 When implementing the SR-IOV on PowerNV platform, some resource reservation is
 needed for VFs which don't exist at the bootup stage. To do the match between
 resources and VFs, the code need to get the VF's BDF in advance.

Ben started explaining this whole hardware PE/VF/etc stuff to me, but it
hasn't all sunk in yet.  We need to describe it somewhere (it sounds pretty
involved, so maybe an extended description in Documentation/ would be
appropriate).

What I'm concerned about is that PCI resource assignment is a huge mess,
and this obviously complicates it even more.  That's necessary and OK, but
I want to at least preserve the possibility that somebody could rework it
to make it manageable, and that means we need to know what the special
constraints of PowerNV are.

Code question below.

 In this patch, it exports the interface to retrieve VF's BDF:
* Make the virtfn_bus as an interface
* Make the virtfn_devfn as an interface
* rename them with more specific name
* code cleanup in pci_sriov_resource_alignment()
 
 Signed-off-by: Wei Yang weiy...@linux.vnet.ibm.com
 ---
  drivers/pci/iov.c   |   26 +++---
  drivers/pci/pci.h   |   19 ---
  include/linux/pci.h |   44 
  3 files changed, 51 insertions(+), 38 deletions(-)
 
 diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
 index cb6f247..7566238 100644
 --- a/drivers/pci/iov.c
 +++ b/drivers/pci/iov.c
 @@ -19,18 +19,6 @@
  
  #define VIRTFN_ID_LEN16
  
 -static inline u8 virtfn_bus(struct pci_dev *dev, int id)
 -{
 - return dev-bus-number + ((dev-devfn + dev-sriov-offset +
 - dev-sriov-stride * id)  8);
 -}
 -
 -static inline u8 virtfn_devfn(struct pci_dev *dev, int id)
 -{
 - return (dev-devfn + dev-sriov-offset +
 - dev-sriov-stride * id)  0xff;
 -}
 -
  static struct pci_bus *virtfn_add_bus(struct pci_bus *bus, int busnr)
  {
   struct pci_bus *child;
 @@ -69,7 +57,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int 
 reset)
   struct pci_bus *bus;
  
   mutex_lock(iov-dev-sriov-lock);
 - bus = virtfn_add_bus(dev-bus, virtfn_bus(dev, id));
 + bus = virtfn_add_bus(dev-bus, pci_iov_virtfn_bus(dev, id));
   if (!bus)
   goto failed;
  
 @@ -77,7 +65,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int 
 reset)
   if (!virtfn)
   goto failed0;
  
 - virtfn-devfn = virtfn_devfn(dev, id);
 + virtfn-devfn = pci_iov_virtfn_devfn(dev, id);
   virtfn-vendor = dev-vendor;
   pci_read_config_word(dev, iov-pos + PCI_SRIOV_VF_DID, virtfn-device);
   pci_setup_device(virtfn);
 @@ -140,8 +128,8 @@ static void virtfn_remove(struct pci_dev *dev, int id, 
 int reset)
   struct pci_sriov *iov = dev-sriov;
  
   virtfn = pci_get_domain_bus_and_slot(pci_domain_nr(dev-bus),
 -  virtfn_bus(dev, id),
 -  virtfn_devfn(dev, id));
 +  pci_iov_virtfn_bus(dev, id),
 +  pci_iov_virtfn_devfn(dev, id));
   if (!virtfn)
   return;
  
 @@ -216,7 +204,7 @@ static int sriov_enable(struct pci_dev *dev, int 
 nr_virtfn)
   iov-offset = offset;
   iov-stride = stride;
  
 - if (virtfn_bus(dev, nr_virtfn - 1)  dev-bus-busn_res.end) {
 + if (pci_iov_virtfn_bus(dev, nr_virtfn - 1)  dev-bus-busn_res.end) {
   dev_err(dev-dev, SR-IOV: bus number out of range\n);
   return -ENOMEM;
   }
 @@ -516,7 +504,7 @@ resource_size_t pci_sriov_resource_alignment(struct 
 pci_dev *dev, int resno)
   if (!reg)
   return 0;
  
 -  __pci_read_base(dev, type, tmp, reg);
 + __pci_read_base(dev, type, tmp, reg);
   return resource_alignment(tmp);
  }
  
 @@ -546,7 +534,7 @@ int pci_iov_bus_range(struct pci_bus *bus)
   list_for_each_entry(dev, bus-devices, bus_list) {
   if (!dev-is_physfn)
   continue;
 - busnr = virtfn_bus(dev, dev-sriov-total_VFs - 1);
 + busnr = pci_iov_virtfn_bus(dev, dev-sriov-total_VFs - 1);
   if (busnr  max)
   max = busnr;
   }
 diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
 index 0601890..a3158b2 100644
 --- a/drivers/pci/pci.h
 +++ b/drivers/pci/pci.h
 @@ -221,25 +221,6 @@ static inline int pci_ari_enabled(struct pci_bus *bus)
  void pci_reassigndev_resource_alignment(struct pci_dev *dev);
  void pci_disable_bridge_window(struct pci_dev *dev);
  
 -/* Single Root I/O Virtualization */
 -struct pci_sriov {
 - int pos;/* capability position */
 - int nres;   /* number of resources */
 - u32 cap;/* SR-IOV Capabilities */
 - u16 ctrl;   /* SR-IOV Control */
 - u16 

Re: [PATCH V7 02/17] PCI/IOV: Get VF BAR size from hardware directly when platform needs

2014-08-19 Thread Bjorn Helgaas
On Thu, Jul 24, 2014 at 02:22:12PM +0800, Wei Yang wrote:
 Current implementation calculates VF BAR size from dividing the total size of
 IOV BAR by total VF number. It won't work on PowerNV platform because we're
 going to expand IOV BAR size for finely alignment.
 
 The patch enforces getting IOV BAR size from hardware and then calculate
 the VF BAR size based on that when platform wants so.
 
 Signed-off-by: Wei Yang weiy...@linux.vnet.ibm.com
 ---
  drivers/pci/iov.c  |   28 
  include/linux/ioport.h |1 +
  2 files changed, 25 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
 index 7566238..ef1c546 100644
 --- a/drivers/pci/iov.c
 +++ b/drivers/pci/iov.c
 @@ -55,6 +55,9 @@ static int virtfn_add(struct pci_dev *dev, int id, int 
 reset)
   struct resource *res;
   struct pci_sriov *iov = dev-sriov;
   struct pci_bus *bus;
 + struct resource tmp;
 + enum pci_bar_type type;
 + int reg;
  
   mutex_lock(iov-dev-sriov-lock);
   bus = virtfn_add_bus(dev-bus, pci_iov_virtfn_bus(dev, id));
 @@ -80,12 +83,29 @@ static int virtfn_add(struct pci_dev *dev, int id, int 
 reset)
   continue;
   virtfn-resource[i].name = pci_name(virtfn);
   virtfn-resource[i].flags = res-flags;
 - size = resource_size(res);
 - do_div(size, iov-total_VFs);
 + /* When res has IORESOURCE_ARCH, retrieve the IOV BAR size
 +  * from hardware directly.
 +  */
 + if (res-flags  IORESOURCE_ARCH) {
 + reg = pci_iov_resource_bar(dev, i + PCI_IOV_RESOURCES, 
 type);
 + __pci_read_base(dev, type, tmp, reg);
 + size = resource_size(tmp);
 + /* When __pci_read_base fails, flags is set to 0.
 +  * In this case, reset size to 0, which means the VF
 +  * will not be enabled.
 +  */
 + if (!tmp.flags)
 + size = 0;

I don't like the IORESOURCE_ARCH flag because it really doesn't have any
specific meaning.  You're using it to enable some arch-specific code here
for this specific case.  But there are any number of other places that
could do something similar, and there's no way to coordinate them all.

I'd rather have some sort of pcibios_*() hook here where powerpc could
override the default implementation.

 + } else {
 + size = resource_size(res);
 + do_div(size, iov-total_VFs);
 + }
   virtfn-resource[i].start = res-start + size * id;
   virtfn-resource[i].end = virtfn-resource[i].start + size - 1;
 - rc = request_resource(res, virtfn-resource[i]);
 - BUG_ON(rc);
 + if (resource_size(virtfn-resource[i])) {
 + rc = request_resource(res, virtfn-resource[i]);
 + BUG_ON(rc);
 + }
   }
  
   if (reset)
 diff --git a/include/linux/ioport.h b/include/linux/ioport.h
 index 5e3a906..de8b57c 100644
 --- a/include/linux/ioport.h
 +++ b/include/linux/ioport.h
 @@ -48,6 +48,7 @@ struct resource {
  #define IORESOURCE_MEM_640x0010
  #define IORESOURCE_WINDOW0x0020  /* forwarded by bridge */
  #define IORESOURCE_MUXED 0x0040  /* Resource is software muxed */
 +#define IORESOURCE_ARCH  0x0080  /* Resource arch tagged 
 */

  #define IORESOURCE_EXCLUSIVE 0x0800  /* Userland may not map this 
 resource */
  #define IORESOURCE_DISABLED  0x1000
 -- 
 1.7.9.5
 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/6] powerpc: Move adb symbol exports next to function definitions

2014-08-19 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/ppc_ksyms.c | 7 ---
 drivers/macintosh/adb.c | 5 +
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 48d17d6f..351f447 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -128,13 +128,6 @@ EXPORT_SYMBOL(smp_hw_index);
 #endif
 #endif
 
-#ifdef CONFIG_ADB
-EXPORT_SYMBOL(adb_request);
-EXPORT_SYMBOL(adb_register);
-EXPORT_SYMBOL(adb_unregister);
-EXPORT_SYMBOL(adb_poll);
-EXPORT_SYMBOL(adb_try_handler_change);
-#endif /* CONFIG_ADB */
 #ifdef CONFIG_ADB_CUDA
 EXPORT_SYMBOL(cuda_request);
 EXPORT_SYMBOL(cuda_poll);
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 9e9c567..226179b 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -411,6 +411,7 @@ adb_poll(void)
return;
adb_controller-poll();
 }
+EXPORT_SYMBOL(adb_poll);
 
 static void adb_sync_req_done(struct adb_request *req)
 {
@@ -460,6 +461,7 @@ adb_request(struct adb_request *req, void (*done)(struct 
adb_request *),
 
return rc;
 }
+EXPORT_SYMBOL(adb_request);
 
  /* Ultimately this should return the number of devices with
 the given default id.
@@ -495,6 +497,7 @@ adb_register(int default_id, int handler_id, struct adb_ids 
*ids,
mutex_unlock(adb_handler_mutex);
return ids-nids;
 }
+EXPORT_SYMBOL(adb_register);
 
 int
 adb_unregister(int index)
@@ -516,6 +519,7 @@ adb_unregister(int index)
mutex_unlock(adb_handler_mutex);
return ret;
 }
+EXPORT_SYMBOL(adb_unregister);
 
 void
 adb_input(unsigned char *buf, int nb, int autopoll)
@@ -582,6 +586,7 @@ adb_try_handler_change(int address, int new_id)
mutex_unlock(adb_handler_mutex);
return ret;
 }
+EXPORT_SYMBOL(adb_try_handler_change);
 
 int
 adb_get_infos(int address, int *original_address, int *handler_id)
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/6] powerpc: Move via-cuda symbol exports next to function definitions

2014-08-19 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/ppc_ksyms.c | 4 
 drivers/macintosh/via-cuda.c| 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 351f447..521291d 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -128,10 +128,6 @@ EXPORT_SYMBOL(smp_hw_index);
 #endif
 #endif
 
-#ifdef CONFIG_ADB_CUDA
-EXPORT_SYMBOL(cuda_request);
-EXPORT_SYMBOL(cuda_poll);
-#endif /* CONFIG_ADB_CUDA */
 EXPORT_SYMBOL(to_tm);
 
 #ifdef CONFIG_PPC32
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index d61f271..bad1813 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -379,6 +379,7 @@ cuda_request(struct adb_request *req, void (*done)(struct 
adb_request *),
 req-reply_expected = 1;
 return cuda_write(req);
 }
+EXPORT_SYMBOL(cuda_request);
 
 static int
 cuda_write(struct adb_request *req)
@@ -441,6 +442,7 @@ cuda_poll(void)
 if (cuda_irq)
enable_irq(cuda_irq);
 }
+EXPORT_SYMBOL(cuda_poll);
 
 static irqreturn_t
 cuda_interrupt(int irq, void *arg)
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/6] powerpc: Move more symbol exports next to function definitions

2014-08-19 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/ppc_ksyms.c| 14 --
 arch/powerpc/kernel/process.c  |  2 ++
 arch/powerpc/kernel/setup-common.c |  3 +++
 arch/powerpc/kernel/time.c |  1 +
 arch/powerpc/mm/hash_utils_64.c|  1 +
 5 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 521291d..4a42a1f 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -5,7 +5,6 @@
 #include linux/elfcore.h
 #include linux/string.h
 #include linux/interrupt.h
-#include linux/screen_info.h
 #include linux/vt_kern.h
 #include linux/nvram.h
 #include linux/irq.h
@@ -96,8 +95,6 @@ EXPORT_SYMBOL(isa_mem_base);
 EXPORT_SYMBOL(pci_dram_offset);
 #endif /* CONFIG_PCI */
 
-EXPORT_SYMBOL(start_thread);
-
 #ifdef CONFIG_PPC_FPU
 EXPORT_SYMBOL(giveup_fpu);
 EXPORT_SYMBOL(load_fp_state);
@@ -109,7 +106,6 @@ EXPORT_SYMBOL(load_vr_state);
 EXPORT_SYMBOL(store_vr_state);
 #endif /* CONFIG_ALTIVEC */
 #ifdef CONFIG_VSX
-EXPORT_SYMBOL(giveup_vsx);
 EXPORT_SYMBOL_GPL(__giveup_vsx);
 #endif /* CONFIG_VSX */
 #ifdef CONFIG_SPE
@@ -128,8 +124,6 @@ EXPORT_SYMBOL(smp_hw_index);
 #endif
 #endif
 
-EXPORT_SYMBOL(to_tm);
-
 #ifdef CONFIG_PPC32
 long long __ashrdi3(long long, int);
 long long __ashldi3(long long, int);
@@ -150,10 +144,6 @@ EXPORT_SYMBOL(memmove);
 EXPORT_SYMBOL(memcmp);
 EXPORT_SYMBOL(memchr);
 
-#if defined(CONFIG_FB_VGA16_MODULE)
-EXPORT_SYMBOL(screen_info);
-#endif
-
 #ifdef CONFIG_PPC32
 EXPORT_SYMBOL(timer_interrupt);
 EXPORT_SYMBOL(tb_ticks_per_jiffy);
@@ -189,10 +179,6 @@ EXPORT_SYMBOL(__arch_hweight32);
 EXPORT_SYMBOL(__arch_hweight64);
 #endif
 
-#ifdef CONFIG_PPC_BOOK3S_64
-EXPORT_SYMBOL_GPL(mmu_psize_defs);
-#endif
-
 #ifdef CONFIG_EPAPR_PARAVIRT
 EXPORT_SYMBOL(epapr_hypercall_start);
 #endif
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index bf44ae9..aa1df89 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -228,6 +228,7 @@ void giveup_vsx(struct task_struct *tsk)
giveup_altivec_maybe_transactional(tsk);
__giveup_vsx(tsk);
 }
+EXPORT_SYMBOL(giveup_vsx);
 
 void flush_vsx_to_thread(struct task_struct *tsk)
 {
@@ -1316,6 +1317,7 @@ void start_thread(struct pt_regs *regs, unsigned long 
start, unsigned long sp)
current-thread.tm_tfiar = 0;
 #endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
 }
+EXPORT_SYMBOL(start_thread);
 
 #define PR_FP_ALL_EXCEPT (PR_FP_EXC_DIV | PR_FP_EXC_OVF | PR_FP_EXC_UND \
| PR_FP_EXC_RES | PR_FP_EXC_INV)
diff --git a/arch/powerpc/kernel/setup-common.c 
b/arch/powerpc/kernel/setup-common.c
index 1b0e260..c933acd 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -94,6 +94,9 @@ struct screen_info screen_info = {
.orig_video_isVGA = 1,
.orig_video_points = 16
 };
+#if defined(CONFIG_FB_VGA16_MODULE)
+EXPORT_SYMBOL(screen_info);
+#endif
 
 /* Variables required to store legacy IO irq routing */
 int of_i8042_kbd_irq;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 368ab37..08b 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1024,6 +1024,7 @@ void to_tm(int tim, struct rtc_time * tm)
 */
GregorianDay(tm);
 }
+EXPORT_SYMBOL(to_tm);
 
 /*
  * Divide a 128-bit dividend by a 32-bit divisor, leaving a 128 bit
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index daee7f4..bc6cc2a 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -92,6 +92,7 @@ extern unsigned long dart_tablebase;
 
 static unsigned long _SDR1;
 struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
+EXPORT_SYMBOL_GPL(mmu_psize_defs);
 
 struct hash_pte *htab_address;
 unsigned long htab_size_bytes;
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 4/6] powerpc: Remove unused 32bit symbol exports

2014-08-19 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/ppc_ksyms.c | 16 
 1 file changed, 16 deletions(-)

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 4a42a1f..ab4f0bc 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -45,26 +45,10 @@
 #include asm/epapr_hcalls.h
 
 #ifdef CONFIG_PPC32
-extern void transfer_to_handler(void);
-extern void do_IRQ(struct pt_regs *regs);
-extern void machine_check_exception(struct pt_regs *regs);
-extern void alignment_exception(struct pt_regs *regs);
-extern void program_check_exception(struct pt_regs *regs);
-extern void single_step_exception(struct pt_regs *regs);
-extern int sys_sigreturn(struct pt_regs *regs);
-
 EXPORT_SYMBOL(clear_pages);
 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
 EXPORT_SYMBOL(DMA_MODE_READ);
 EXPORT_SYMBOL(DMA_MODE_WRITE);
-
-EXPORT_SYMBOL(transfer_to_handler);
-EXPORT_SYMBOL(do_IRQ);
-EXPORT_SYMBOL(machine_check_exception);
-EXPORT_SYMBOL(alignment_exception);
-EXPORT_SYMBOL(program_check_exception);
-EXPORT_SYMBOL(single_step_exception);
-EXPORT_SYMBOL(sys_sigreturn);
 #endif
 
 #ifdef CONFIG_FUNCTION_TRACER
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 5/6] powerpc: Move lib symbol exports into arch/powerpc/lib/ppc_ksyms.c

2014-08-19 Thread Anton Blanchard
Move the lib symbol exports closer to their function definitions

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/ppc_ksyms.c | 32 
 arch/powerpc/lib/Makefile   |  2 +-
 arch/powerpc/lib/ppc_ksyms.c| 39 +++
 3 files changed, 40 insertions(+), 33 deletions(-)
 create mode 100644 arch/powerpc/lib/ppc_ksyms.c

diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index ab4f0bc..aba41f3 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -55,24 +55,6 @@ EXPORT_SYMBOL(DMA_MODE_WRITE);
 EXPORT_SYMBOL(_mcount);
 #endif
 
-EXPORT_SYMBOL(strcpy);
-EXPORT_SYMBOL(strncpy);
-EXPORT_SYMBOL(strcat);
-EXPORT_SYMBOL(strlen);
-EXPORT_SYMBOL(strcmp);
-EXPORT_SYMBOL(strncmp);
-
-#ifndef CONFIG_GENERIC_CSUM
-EXPORT_SYMBOL(csum_partial);
-EXPORT_SYMBOL(csum_partial_copy_generic);
-EXPORT_SYMBOL(ip_fast_csum);
-EXPORT_SYMBOL(csum_tcpudp_magic);
-#endif
-
-EXPORT_SYMBOL(__copy_tofrom_user);
-EXPORT_SYMBOL(__clear_user);
-EXPORT_SYMBOL(copy_page);
-
 #if defined(CONFIG_PCI)  defined(CONFIG_PPC32)
 EXPORT_SYMBOL(isa_io_base);
 EXPORT_SYMBOL(isa_mem_base);
@@ -122,17 +104,10 @@ EXPORT_SYMBOL(__cmpdi2);
 #endif
 long long __bswapdi2(long long);
 EXPORT_SYMBOL(__bswapdi2);
-EXPORT_SYMBOL(memcpy);
-EXPORT_SYMBOL(memset);
-EXPORT_SYMBOL(memmove);
-EXPORT_SYMBOL(memcmp);
-EXPORT_SYMBOL(memchr);
 
 #ifdef CONFIG_PPC32
 EXPORT_SYMBOL(timer_interrupt);
 EXPORT_SYMBOL(tb_ticks_per_jiffy);
-EXPORT_SYMBOL(cacheable_memcpy);
-EXPORT_SYMBOL(cacheable_memzero);
 #endif
 
 #ifdef CONFIG_PPC32
@@ -156,13 +131,6 @@ EXPORT_SYMBOL(__mfdcr);
 #endif
 EXPORT_SYMBOL(empty_zero_page);
 
-#ifdef CONFIG_PPC64
-EXPORT_SYMBOL(__arch_hweight8);
-EXPORT_SYMBOL(__arch_hweight16);
-EXPORT_SYMBOL(__arch_hweight32);
-EXPORT_SYMBOL(__arch_hweight64);
-#endif
-
 #ifdef CONFIG_EPAPR_PARAVIRT
 EXPORT_SYMBOL(epapr_hypercall_start);
 #endif
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 59fa2de..9f342f1 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -10,7 +10,7 @@ CFLAGS_REMOVE_code-patching.o = -pg
 CFLAGS_REMOVE_feature-fixups.o = -pg
 
 obj-y  := string.o alloc.o \
-  crtsavres.o
+  crtsavres.o ppc_ksyms.o
 obj-$(CONFIG_PPC32)+= div64.o copy_32.o
 obj-$(CONFIG_HAS_IOMEM)+= devres.o
 
diff --git a/arch/powerpc/lib/ppc_ksyms.c b/arch/powerpc/lib/ppc_ksyms.c
new file mode 100644
index 000..f993959
--- /dev/null
+++ b/arch/powerpc/lib/ppc_ksyms.c
@@ -0,0 +1,39 @@
+#include linux/string.h
+#include linux/uaccess.h
+#include linux/bitops.h
+#include net/checksum.h
+
+EXPORT_SYMBOL(memcpy);
+EXPORT_SYMBOL(memset);
+EXPORT_SYMBOL(memmove);
+EXPORT_SYMBOL(memcmp);
+EXPORT_SYMBOL(memchr);
+#ifdef CONFIG_PPC32
+EXPORT_SYMBOL(cacheable_memcpy);
+EXPORT_SYMBOL(cacheable_memzero);
+#endif
+
+EXPORT_SYMBOL(strcpy);
+EXPORT_SYMBOL(strncpy);
+EXPORT_SYMBOL(strcat);
+EXPORT_SYMBOL(strlen);
+EXPORT_SYMBOL(strcmp);
+EXPORT_SYMBOL(strncmp);
+
+#ifndef CONFIG_GENERIC_CSUM
+EXPORT_SYMBOL(csum_partial);
+EXPORT_SYMBOL(csum_partial_copy_generic);
+EXPORT_SYMBOL(ip_fast_csum);
+EXPORT_SYMBOL(csum_tcpudp_magic);
+#endif
+
+EXPORT_SYMBOL(__copy_tofrom_user);
+EXPORT_SYMBOL(__clear_user);
+EXPORT_SYMBOL(copy_page);
+
+#ifdef CONFIG_PPC64
+EXPORT_SYMBOL(__arch_hweight8);
+EXPORT_SYMBOL(__arch_hweight16);
+EXPORT_SYMBOL(__arch_hweight32);
+EXPORT_SYMBOL(__arch_hweight64);
+#endif
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 6/6] powerpc: Separate ppc32 symbol exports into ppc_ksyms_32.c

2014-08-19 Thread Anton Blanchard
Simplify things considerably by moving all the ppc32 specific
symbol exports into its own file.

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/Makefile   |   3 +
 arch/powerpc/kernel/ppc_ksyms.c| 123 +
 arch/powerpc/kernel/ppc_ksyms_32.c |  61 ++
 3 files changed, 79 insertions(+), 108 deletions(-)
 create mode 100644 arch/powerpc/kernel/ppc_ksyms_32.c

diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 670c312..502cf69 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -93,6 +93,9 @@ obj-$(CONFIG_PPC32)   += entry_32.o setup_32.o
 obj-$(CONFIG_PPC64)+= dma-iommu.o iommu.o
 obj-$(CONFIG_KGDB) += kgdb.o
 obj-$(CONFIG_MODULES)  += ppc_ksyms.o
+ifeq ($(CONFIG_PPC32),y)
+obj-$(CONFIG_MODULES)  += ppc_ksyms_32.o
+endif
 obj-$(CONFIG_BOOTX_TEXT)   += btext.o
 obj-$(CONFIG_SMP)  += smp.o
 obj-$(CONFIG_KPROBES)  += kprobes.o
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index aba41f3..c4dfff6 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -1,135 +1,42 @@
-#include linux/export.h
-#include linux/threads.h
-#include linux/smp.h
-#include linux/sched.h
-#include linux/elfcore.h
-#include linux/string.h
-#include linux/interrupt.h
-#include linux/vt_kern.h
-#include linux/nvram.h
-#include linux/irq.h
-#include linux/pci.h
-#include linux/delay.h
-#include linux/bitops.h
+#include linux/ftrace.h
+#include linux/mm.h
 
-#include asm/page.h
 #include asm/processor.h
-#include asm/cacheflush.h
-#include asm/uaccess.h
-#include asm/io.h
-#include linux/atomic.h
-#include asm/checksum.h
-#include asm/pgtable.h
-#include asm/tlbflush.h
-#include linux/adb.h
-#include linux/cuda.h
-#include linux/pmu.h
-#include asm/prom.h
-#include asm/pci-bridge.h
-#include asm/irq.h
-#include asm/pmac_feature.h
-#include asm/dma.h
-#include asm/machdep.h
-#include asm/hw_irq.h
-#include asm/nvram.h
-#include asm/mmu_context.h
-#include asm/backlight.h
-#include asm/time.h
-#include asm/cputable.h
-#include asm/btext.h
-#include asm/div64.h
-#include asm/signal.h
-#include asm/dcr.h
-#include asm/ftrace.h
 #include asm/switch_to.h
+#include asm/cacheflush.h
 #include asm/epapr_hcalls.h
 
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(clear_pages);
-EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
-EXPORT_SYMBOL(DMA_MODE_READ);
-EXPORT_SYMBOL(DMA_MODE_WRITE);
-#endif
+EXPORT_SYMBOL(flush_dcache_range);
+EXPORT_SYMBOL(flush_icache_range);
+
+EXPORT_SYMBOL(empty_zero_page);
+
+long long __bswapdi2(long long);
+EXPORT_SYMBOL(__bswapdi2);
 
 #ifdef CONFIG_FUNCTION_TRACER
 EXPORT_SYMBOL(_mcount);
 #endif
 
-#if defined(CONFIG_PCI)  defined(CONFIG_PPC32)
-EXPORT_SYMBOL(isa_io_base);
-EXPORT_SYMBOL(isa_mem_base);
-EXPORT_SYMBOL(pci_dram_offset);
-#endif /* CONFIG_PCI */
-
 #ifdef CONFIG_PPC_FPU
 EXPORT_SYMBOL(giveup_fpu);
 EXPORT_SYMBOL(load_fp_state);
 EXPORT_SYMBOL(store_fp_state);
 #endif
+
 #ifdef CONFIG_ALTIVEC
 EXPORT_SYMBOL(giveup_altivec);
 EXPORT_SYMBOL(load_vr_state);
 EXPORT_SYMBOL(store_vr_state);
-#endif /* CONFIG_ALTIVEC */
-#ifdef CONFIG_VSX
-EXPORT_SYMBOL_GPL(__giveup_vsx);
-#endif /* CONFIG_VSX */
-#ifdef CONFIG_SPE
-EXPORT_SYMBOL(giveup_spe);
-#endif /* CONFIG_SPE */
-
-#ifndef CONFIG_PPC64
-EXPORT_SYMBOL(flush_instruction_cache);
-#endif
-EXPORT_SYMBOL(flush_dcache_range);
-EXPORT_SYMBOL(flush_icache_range);
-
-#ifdef CONFIG_SMP
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(smp_hw_index);
-#endif
-#endif
-
-#ifdef CONFIG_PPC32
-long long __ashrdi3(long long, int);
-long long __ashldi3(long long, int);
-long long __lshrdi3(long long, int);
-EXPORT_SYMBOL(__ashrdi3);
-EXPORT_SYMBOL(__ashldi3);
-EXPORT_SYMBOL(__lshrdi3);
-int __ucmpdi2(unsigned long long, unsigned long long);
-EXPORT_SYMBOL(__ucmpdi2);
-int __cmpdi2(long long, long long);
-EXPORT_SYMBOL(__cmpdi2);
-#endif
-long long __bswapdi2(long long);
-EXPORT_SYMBOL(__bswapdi2);
-
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(timer_interrupt);
-EXPORT_SYMBOL(tb_ticks_per_jiffy);
 #endif
 
-#ifdef CONFIG_PPC32
-EXPORT_SYMBOL(switch_mmu_context);
+#ifdef CONFIG_VSX
+EXPORT_SYMBOL_GPL(__giveup_vsx);
 #endif
 
-#ifdef CONFIG_PPC_STD_MMU_32
-extern long mol_trampoline;
-EXPORT_SYMBOL(mol_trampoline); /* For MOL */
-EXPORT_SYMBOL(flush_hash_pages); /* For MOL */
-#ifdef CONFIG_SMP
-extern int mmu_hash_lock;
-EXPORT_SYMBOL(mmu_hash_lock); /* For MOL */
-#endif /* CONFIG_SMP */
-extern long *intercept_table;
-EXPORT_SYMBOL(intercept_table);
-#endif /* CONFIG_PPC_STD_MMU_32 */
-#ifdef CONFIG_PPC_DCR_NATIVE
-EXPORT_SYMBOL(__mtdcr);
-EXPORT_SYMBOL(__mfdcr);
+#ifdef CONFIG_SPE
+EXPORT_SYMBOL(giveup_spe);
 #endif
-EXPORT_SYMBOL(empty_zero_page);
 
 #ifdef CONFIG_EPAPR_PARAVIRT
 EXPORT_SYMBOL(epapr_hypercall_start);
diff --git a/arch/powerpc/kernel/ppc_ksyms_32.c 
b/arch/powerpc/kernel/ppc_ksyms_32.c
new file mode 100644
index 000..30ddd8a
--- 

Re: [PATCH] powerpc: Make 256k pages depend on PPC32=n

2014-08-19 Thread Scott Wood
On Tue, 2014-08-19 at 17:36 -0400, Pranith Kumar wrote:
 256k pages are not tested on PPC32. On a randconfig I got the following error:
 
 arch/powerpc/kernel/misc_32.S:1171: Error: operand out of range 
 (0x0001 is not between 0x8000 and 0x7fff)
 
 Disable 256K pages if PPC32=y
 
 Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
 ---
  arch/powerpc/Kconfig | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
 index da16ffe..6cc518f 100644
 --- a/arch/powerpc/Kconfig
 +++ b/arch/powerpc/Kconfig
 @@ -556,7 +556,7 @@ config PPC_64K_PAGES
  
  config PPC_256K_PAGES
   bool 256k page size if 44x
 - depends on !STDBINUTILS
 + depends on !PPC32  !STDBINUTILS
   help
 Make the page size 256k.
  

How will this ever be selected then?  44x is 32-bit only.

-Scott


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc: Make 256k pages depend on PPC32=n

2014-08-19 Thread Pranith Kumar
On Tue, Aug 19, 2014 at 6:19 PM, Scott Wood scottw...@freescale.com wrote:

  config PPC_256K_PAGES
   bool 256k page size if 44x
 - depends on !STDBINUTILS
 + depends on !PPC32  !STDBINUTILS
   help
 Make the page size 256k.


 How will this ever be selected then?  44x is 32-bit only.

Indeed. I am actually confused about the error which is being thrown
here. The operand (65536) is actually within the range. Any suggestions
on how to fix this?


-- 
Pranith
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc: Make 256k pages depend on PPC32=n

2014-08-19 Thread Scott Wood
On Tue, 2014-08-19 at 18:23 -0400, Pranith Kumar wrote:
 On Tue, Aug 19, 2014 at 6:19 PM, Scott Wood scottw...@freescale.com wrote:
 
   config PPC_256K_PAGES
bool 256k page size if 44x
  - depends on !STDBINUTILS
  + depends on !PPC32  !STDBINUTILS
help
  Make the page size 256k.
 
 
  How will this ever be selected then?  44x is 32-bit only.
 
 Indeed. I am actually confused about the error which is being thrown
 here. The operand (65536) is actually within the range. Any suggestions
 on how to fix this?

It's not within range of li.  I wonder if whatever non-STD binutils
this is supposed to be used with is rewriting it into an lis
instruction.  This sort of external dependency is a poor fit for the
randconfig concept (plus, shouldn't the symbol be indicating what
binutils you're supposed to have rather than anything that isn't
standard?).

In any case, you could use something like LOAD_REG_IMMEDIATE().

-Scott


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/4] powerpc: Make a bunch of things static

2014-08-19 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/hw_breakpoint.c   |  2 +-
 arch/powerpc/kernel/nvram_64.c|  2 +-
 arch/powerpc/kernel/pci-common.c  |  2 +-
 arch/powerpc/kernel/pci_of_scan.c |  2 +-
 arch/powerpc/kernel/prom.c|  5 +++--
 arch/powerpc/kernel/ptrace.c  |  2 +-
 arch/powerpc/kernel/rtasd.c   |  2 +-
 arch/powerpc/kernel/time.c|  4 ++--
 arch/powerpc/lib/feature-fixups.c |  2 +-
 arch/powerpc/mm/hash_utils_64.c   |  2 +-
 arch/powerpc/mm/pgtable.c |  2 +-
 arch/powerpc/perf/core-book3s.c   | 18 +-
 arch/powerpc/platforms/powernv/eeh-ioda.c |  4 ++--
 arch/powerpc/platforms/powernv/pci-ioda.c |  6 +++---
 arch/powerpc/platforms/powernv/setup.c|  2 +-
 arch/powerpc/platforms/powernv/smp.c  |  2 +-
 arch/powerpc/platforms/pseries/dlpar.c|  4 ++--
 arch/powerpc/platforms/pseries/nvram.c| 12 +++-
 arch/powerpc/platforms/pseries/ras.c  |  2 +-
 arch/powerpc/platforms/pseries/setup.c|  2 +-
 arch/powerpc/sysdev/mpic.c|  2 +-
 arch/powerpc/sysdev/msi_bitmap.c  |  6 +++---
 22 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/arch/powerpc/kernel/hw_breakpoint.c 
b/arch/powerpc/kernel/hw_breakpoint.c
index 0bb5918..1f7d84e 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -293,7 +293,7 @@ out:
 /*
  * Handle single-step exceptions following a DABR hit.
  */
-int __kprobes single_step_dabr_instruction(struct die_args *args)
+static int __kprobes single_step_dabr_instruction(struct die_args *args)
 {
struct pt_regs *regs = args-regs;
struct perf_event *bp = NULL;
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 28b898e..34f7c9b 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -567,7 +567,7 @@ static int __init nvram_init(void)
return rc;
 }
 
-void __exit nvram_cleanup(void)
+static void __exit nvram_cleanup(void)
 {
 misc_deregister( nvram_dev );
 }
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index b2814e2..bd84771 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1140,7 +1140,7 @@ static int reparent_resources(struct resource *parent,
  * as well.
  */
 
-void pcibios_allocate_bus_resources(struct pci_bus *bus)
+static void pcibios_allocate_bus_resources(struct pci_bus *bus)
 {
struct pci_bus *b;
int i;
diff --git a/arch/powerpc/kernel/pci_of_scan.c 
b/arch/powerpc/kernel/pci_of_scan.c
index 44562aa..e6245e9 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -38,7 +38,7 @@ static u32 get_int_prop(struct device_node *np, const char 
*name, u32 def)
  * @addr0: value of 1st cell of a device tree PCI address.
  * @bridge: Set this flag if the address is from a bridge 'ranges' property
  */
-unsigned int pci_parse_of_flags(u32 addr0, int bridge)
+static unsigned int pci_parse_of_flags(u32 addr0, int bridge)
 {
unsigned int flags = 0;
 
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 1a3b105..6d8c4cb 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -386,8 +386,9 @@ static int __init early_init_dt_scan_cpus(unsigned long 
node,
return 0;
 }
 
-int __init early_init_dt_scan_chosen_ppc(unsigned long node, const char *uname,
-int depth, void *data)
+static int __init early_init_dt_scan_chosen_ppc(unsigned long node,
+   const char *uname,
+   int depth, void *data)
 {
const unsigned long *lprop; /* All these set by kernel, so no need to 
convert endian */
 
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 2e3d2bf..cdb404e 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -932,7 +932,7 @@ void ptrace_triggered(struct perf_event *bp,
 }
 #endif /* CONFIG_HAVE_HW_BREAKPOINT */
 
-int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
+static int ptrace_set_debugreg(struct task_struct *task, unsigned long addr,
   unsigned long data)
 {
 #ifdef CONFIG_HAVE_HW_BREAKPOINT
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index e736387..5a2c049 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -286,7 +286,7 @@ static void prrn_work_fn(struct work_struct *work)
 
 static DECLARE_WORK(prrn_work, prrn_work_fn);
 
-void prrn_schedule_update(u32 scope)
+static void prrn_schedule_update(u32 scope)
 {
flush_work(prrn_work);
prrn_update_scope = scope;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 368ab37..f6b3430 100644

[PATCH 2/4] powerpc: Ensure global functions include their prototype

2014-08-19 Thread Anton Blanchard
Fix a number of places where global functions were not including
their prototype. This ensures the prototype and the function match.

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/smp.c   | 1 +
 arch/powerpc/mm/slice.c | 2 ++
 arch/powerpc/oprofile/backtrace.c   | 1 +
 arch/powerpc/platforms/powernv/subcore.c| 1 +
 arch/powerpc/platforms/pseries/dlpar.c  | 1 +
 arch/powerpc/platforms/pseries/hotplug-memory.c | 1 +
 arch/powerpc/platforms/pseries/pci.c| 1 +
 7 files changed, 8 insertions(+)

diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index a0738af..4866d5d 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -52,6 +52,7 @@
 #endif
 #include asm/vdso.h
 #include asm/debug.h
+#include asm/kexec.h
 
 #ifdef DEBUG
 #include asm/udbg.h
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index b0c75cc..86f6a75 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -30,9 +30,11 @@
 #include linux/err.h
 #include linux/spinlock.h
 #include linux/export.h
+#include linux/hugetlb.h
 #include asm/mman.h
 #include asm/mmu.h
 #include asm/spu.h
+#include asm/hugetlb.h
 
 /* some sanity checks */
 #if (PGTABLE_RANGE  43)  SLICE_MASK_SIZE
diff --git a/arch/powerpc/oprofile/backtrace.c 
b/arch/powerpc/oprofile/backtrace.c
index f75301f..6adf55f 100644
--- a/arch/powerpc/oprofile/backtrace.c
+++ b/arch/powerpc/oprofile/backtrace.c
@@ -12,6 +12,7 @@
 #include asm/processor.h
 #include asm/uaccess.h
 #include asm/compat.h
+#include asm/oprofile_impl.h
 
 #define STACK_SP(STACK)*(STACK)
 
diff --git a/arch/powerpc/platforms/powernv/subcore.c 
b/arch/powerpc/platforms/powernv/subcore.c
index 894ecb3..c87f96b 100644
--- a/arch/powerpc/platforms/powernv/subcore.c
+++ b/arch/powerpc/platforms/powernv/subcore.c
@@ -24,6 +24,7 @@
 #include asm/smp.h
 
 #include subcore.h
+#include powernv.h
 
 
 /*
diff --git a/arch/powerpc/platforms/pseries/dlpar.c 
b/arch/powerpc/platforms/pseries/dlpar.c
index d37ba4f..86f3136 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -17,6 +17,7 @@
 #include linux/slab.h
 #include linux/of.h
 #include offline_states.h
+#include pseries.h
 
 #include asm/prom.h
 #include asm/machdep.h
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c 
b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 24abc5c..6169497 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -20,6 +20,7 @@
 #include asm/machdep.h
 #include asm/prom.h
 #include asm/sparsemem.h
+#include pseries.h
 
 unsigned long pseries_memory_block_size(void)
 {
diff --git a/arch/powerpc/platforms/pseries/pci.c 
b/arch/powerpc/platforms/pseries/pci.c
index c413ec1..67e4859 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -29,6 +29,7 @@
 #include asm/pci-bridge.h
 #include asm/prom.h
 #include asm/ppc-pci.h
+#include pseries.h
 
 #if 0
 void pcibios_name_device(struct pci_dev *dev)
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 4/4] powerpc: Move htab_remove_mapping function prototype into header file

2014-08-19 Thread Anton Blanchard
A recent patch added a function prototype for htab_remove_mapping in
c code. Fix it.

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/include/asm/mmu-hash64.h | 2 ++
 arch/powerpc/mm/init_64.c | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/mmu-hash64.h 
b/arch/powerpc/include/asm/mmu-hash64.h
index d765144..92bc3a6 100644
--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -342,6 +342,8 @@ extern void hash_failure_debug(unsigned long ea, unsigned 
long access,
 extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
 unsigned long pstart, unsigned long prot,
 int psize, int ssize);
+int htab_remove_mapping(unsigned long vstart, unsigned long vend,
+   int psize, int ssize);
 extern void add_gpage(u64 addr, u64 page_size, unsigned long number_of_pages);
 extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr);
 
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 253b4b9..3481556 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -233,9 +233,6 @@ static void __meminit vmemmap_create_mapping(unsigned long 
start,
 }
 
 #ifdef CONFIG_MEMORY_HOTPLUG
-extern int htab_remove_mapping(unsigned long vstart, unsigned long vend,
-   int psize, int ssize);
-
 static void vmemmap_remove_mapping(unsigned long start,
   unsigned long page_size)
 {
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/4] powerpc: Remove stale function prototypes

2014-08-19 Thread Anton Blanchard
There were a number of prototypes for functions that no longer
exist. Remove them.

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/include/asm/bug.h   | 1 -
 arch/powerpc/include/asm/hydra.h | 1 -
 arch/powerpc/include/asm/irq.h   | 5 -
 arch/powerpc/include/asm/kexec.h | 1 -
 arch/powerpc/include/asm/page_64.h   | 1 -
 arch/powerpc/include/asm/pgtable-ppc32.h | 2 --
 arch/powerpc/include/asm/prom.h  | 2 --
 arch/powerpc/include/asm/rio.h   | 1 -
 arch/powerpc/include/asm/tsi108.h| 4 
 arch/powerpc/include/asm/udbg.h  | 1 -
 arch/powerpc/platforms/pseries/lpar.c| 2 --
 11 files changed, 21 deletions(-)

diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h
index 3eb53d7..3a39283 100644
--- a/arch/powerpc/include/asm/bug.h
+++ b/arch/powerpc/include/asm/bug.h
@@ -133,7 +133,6 @@ extern int do_page_fault(struct pt_regs *, unsigned long, 
unsigned long);
 extern void bad_page_fault(struct pt_regs *, unsigned long, int);
 extern void _exception(int, struct pt_regs *, int, unsigned long);
 extern void die(const char *, struct pt_regs *, long);
-extern void print_backtrace(unsigned long *);
 
 #endif /* !__ASSEMBLY__ */
 
diff --git a/arch/powerpc/include/asm/hydra.h b/arch/powerpc/include/asm/hydra.h
index 5b0c98bd..1cb39c9 100644
--- a/arch/powerpc/include/asm/hydra.h
+++ b/arch/powerpc/include/asm/hydra.h
@@ -95,7 +95,6 @@ extern volatile struct Hydra __iomem *Hydra;
 #define HYDRA_INT_SPARE19
 
 extern int hydra_init(void);
-extern void macio_adb_init(void);
 
 #endif /* __KERNEL__ */
 
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index 41f13ce..e8e3a0a 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -31,11 +31,6 @@ extern atomic_t ppc_n_lost_interrupts;
 
 extern irq_hw_number_t virq_to_hw(unsigned int virq);
 
-/**
- * irq_early_init - Init irq remapping subsystem
- */
-extern void irq_early_init(void);
-
 static __inline__ int irq_canonicalize(int irq)
 {
return irq;
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index 16d7e33..19c36cb 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -81,7 +81,6 @@ extern void default_machine_crash_shutdown(struct pt_regs 
*regs);
 extern int crash_shutdown_register(crash_shutdown_t handler);
 extern int crash_shutdown_unregister(crash_shutdown_t handler);
 
-extern void machine_kexec_simple(struct kimage *image);
 extern void crash_kexec_secondary(struct pt_regs *regs);
 extern int overlaps_crashkernel(unsigned long start, unsigned long size);
 extern void reserve_crashkernel(void);
diff --git a/arch/powerpc/include/asm/page_64.h 
b/arch/powerpc/include/asm/page_64.h
index 88693ce..d0d6afb 100644
--- a/arch/powerpc/include/asm/page_64.h
+++ b/arch/powerpc/include/asm/page_64.h
@@ -104,7 +104,6 @@ extern unsigned long slice_get_unmapped_area(unsigned long 
addr,
 extern unsigned int get_slice_psize(struct mm_struct *mm,
unsigned long addr);
 
-extern void slice_init_context(struct mm_struct *mm, unsigned int psize);
 extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize);
 extern void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
  unsigned long len, unsigned int psize);
diff --git a/arch/powerpc/include/asm/pgtable-ppc32.h 
b/arch/powerpc/include/asm/pgtable-ppc32.h
index 47edde8..622672f 100644
--- a/arch/powerpc/include/asm/pgtable-ppc32.h
+++ b/arch/powerpc/include/asm/pgtable-ppc32.h
@@ -8,8 +8,6 @@
 #include linux/threads.h
 #include asm/io.h/* For sub-arch specific PPC_PIN_SIZE */
 
-extern unsigned long va_to_phys(unsigned long address);
-extern pte_t *va_to_pte(unsigned long address);
 extern unsigned long ioremap_bot;
 
 #ifdef CONFIG_44x
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 74b79f0..7f436ba 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -76,8 +76,6 @@ void of_parse_dma_window(struct device_node *dn, const __be32 
*dma_window,
 unsigned long *busno, unsigned long *phys,
 unsigned long *size);
 
-extern void kdump_move_device_tree(void);
-
 extern void of_instantiate_rtc(void);
 
 extern int of_get_ibm_chip_id(struct device_node *np);
diff --git a/arch/powerpc/include/asm/rio.h b/arch/powerpc/include/asm/rio.h
index b1d2dec..ec800f2 100644
--- a/arch/powerpc/include/asm/rio.h
+++ b/arch/powerpc/include/asm/rio.h
@@ -13,7 +13,6 @@
 #ifndef ASM_PPC_RIO_H
 #define ASM_PPC_RIO_H
 
-extern void platform_rio_init(void);
 #ifdef CONFIG_FSL_RIO
 extern int fsl_rio_mcheck_exception(struct pt_regs *);
 #else
diff --git a/arch/powerpc/include/asm/tsi108.h 
b/arch/powerpc/include/asm/tsi108.h
index f8b6079..d531d9e 100644
--- 

Re: PCIe driver not working properly after upgrading to linux 3.8.13

2014-08-19 Thread Scott Wood
On Tue, 2014-08-19 at 20:13 +0530, Gokul C G wrote:
 HI,
 
  
 
 I am facing problem with PCIE driver in new Linux kernel compiled for
 powerpc architecture (Big endian) ,freescales P2040 processor.I was
 using old kernel Linux version 3.0.48 previously and now updated to
 Linux version 3.8.13-rt9.After updating to the new kernel, 

3.8.13-rt9 is also an old kernel. :-)

It is also presumably a Freescale SDK kernel (not even the most recent
one), so it would be best to stick with community.freescale.com (you
didn't follow up to my response there) or, in the case of problems with
third party code you've added on to the SDK kernel, the support channels
of whoever provided you with the software.

 PCIe device drivers not working properly and i am getting some error
 messages in the boot-up .My intention is to use   EXAR PCIe Multiport
 serial driver and add 8 serial ports in addition to 4 built in serial
 ports provided by P2040 processor. The PCIe driver form EXAR is
 compiled and  loaded as kernel module . The same was working with
 linux kernel 3.0.48 and following prints observed while loading kernel
 module.
 
 
 linux 3.0.48 ,working insmod log
 
 
 
  
 
 
 
 Exar PCIe (XR17V35x) serial driver Revision: 1.2

I don't see this driver in the kernel tree.  We can't help you with code
we can't see.  Are you sure that the driver is expected to work with
3.8?  Have you tried debugging it and/or contacting Exar for support
with their driver?


 PCI: Probing PCI hardware
 
 fsl-pci ffe201000.pcie: PCI host bridge to bus :00
 
 pci_bus :00: root bus resource [io  0x-0x]
 
 pci_bus :00: root bus resource [mem 0xc2000-0xc3fff] (bus
 address [0xe000-0x])
 
 pci_bus :00: root bus resource [bus 00-ff]
 
 PCIE error(s) detected
 
 PCIE ERR_DR register: 0x8002
 
 PCIE ERR_CAP_STAT register: 0x8001
 
 PCIE ERR_CAP_R0 register: 0x0800
 
 pci :00:00.0: PCI bridge to [bus 01-ff]
 
 PCIE ERR_CAP_R1 register: 0x
 
 PCIE ERR_CAP_R2 register: 0x
 
 PCIE ERR_CAP_R3 register: 0x
 
 PCI: Cannot allocate resource region 0 of device :00:00.0, will
 remap
 
 pci :00:00.0: BAR 0: can't assign mem (size 0x100)
 
 pci :00:00.0: BAR 9: can't assign mem pref (size 0x20)
 
 pci :00:00.0: PCI bridge to [bus 01]
 
 pci :00:00.0:   bridge window [io  0x-0x]
 
 pci :00:00.0:   bridge window [mem 0xc2000-0xc3fff]
 
  
 
I get very similar errors on Freescale's SDK 1.5 kernel (based on
v3.8.13-rt9), and it doesn't stop a PCIe network card from working.  So
I wouldn't focus too much on these errors.

-Scott


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/2] fsl_ifc: Support all 8 IFC chip selects

2014-08-19 Thread Scott Wood
On Fri, 2014-08-15 at 16:07 -0500, Aaron Sierra wrote:
 Freescale's QorIQ T Series processors support 8 IFC chip selects
 within a memory map backward compatible with previous P Series
 processors which supported only 4 chip selects.
 
 Signed-off-by: Aaron Sierra asie...@xes-inc.com
 ---
  include/linux/fsl_ifc.h | 10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)
 
 diff --git a/include/linux/fsl_ifc.h b/include/linux/fsl_ifc.h
 index 84d60cb..62762ff 100644
 --- a/include/linux/fsl_ifc.h
 +++ b/include/linux/fsl_ifc.h
 @@ -29,7 +29,7 @@
  #include linux/of_platform.h
  #include linux/interrupt.h
  
 -#define FSL_IFC_BANK_COUNT 4
 +#define FSL_IFC_BANK_COUNT 8

First please modify fsl_ifc_nand.c to limit itself to the number of
banks it dynamically determines are present based on the IFC version.

-Scott


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 4/4] powerpc/fsl_msi: spread msi ints across different MSIRs

2014-08-19 Thread Scott Wood
A couple nits that don't necessarily warrant a respin:

On Tue, 2014-08-19 at 14:25 +0300, Laurentiu Tudor wrote:
 Allocate msis such that each time a new
 interrupt is requested, the SRS (MSIR
 register select) to be used is allocated
 in a round-robin fashion.
 The end result is that the msi interrupts
 will be spread across distinct MSIRs with
 the main benefit that now users can set
 affinity to each msi int through the mpic
 irq backing up the MSIR register.
 This is achieved with the help of a newly
 introduced msi bitmap api that allows
 specifying the starting point when
 searching for a free msi interrupt.

Please wrap at around 60-70 columns.

 + } else {
 + off = 
 (atomic_inc_return(msi_data-msi_alloc_cnt) %
 + msi_data-msir_num);
 + off *= (1  msi_data-srs_shift);

This is an unusual way to write off = msi-data-srs_shift...

-Scott


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc/eeh: fix crashing when passing VF

2014-08-19 Thread Gavin Shan
On Tue, Aug 19, 2014 at 10:27:09AM +0800, Wei Yang wrote:

The subject would be powerpc/eeh: Fix kernel crash when passing through VF.

When doing vfio passthrough a VF, the kernel will crash with following
message:

[  442.656459] Unable to handle kernel paging request for data at address 
0x0060
[  442.656593] Faulting instruction address: 0xc0038b88
[  442.656706] Oops: Kernel access of bad area, sig: 11 [#1]
[  442.656798] SMP NR_CPUS=1024 NUMA PowerNV
[  442.656890] Modules linked in: vfio_pci mlx4_core nf_conntrack_netbios_ns 
nf_conntrack_broadcast ipt_MASQUERADE ip6t_REJECT xt_conntrack bnep bluetooth 
rfkill ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables 
ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle 
ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat 
nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack 
iptable_mangle iptable_security iptable_raw tg3 nfsd be2net nfs_acl ses lockd 
ptp enclosure pps_core kvm_hv kvm_pr shpchp binfmt_misc kvm sunrpc uinput lpfc 
scsi_transport_fc ipr scsi_tgt [last unloaded: mlx4_core]
[  442.658152] CPU: 40 PID: 14948 Comm: qemu-system-ppc Not tainted 
3.10.42yw-pkvm+ #37
[  442.658219] task: c00f7e2a9a00 ti: c00f6dc3c000 task.ti: 
c00f6dc3c000
[  442.658287] NIP: c0038b88 LR: c04435a8 CTR: c0455bc0
[  442.658352] REGS: c00f6dc3f580 TRAP: 0300   Not tainted  
(3.10.42yw-pkvm+)
[  442.658419] MSR: 90009032 SF,HV,EE,ME,IR,DR,RI  CR: 28004882  
XER: 2000
[  442.658577] CFAR: c000908c DAR: 0060 DSISR: 4000 
SOFTE: 1
GPR00: c04435a8 c00f6dc3f800 c12b1c10 cda24000
GPR04: 0003 1004 15b3 
GPR08: c127f5d8   
GPR12: c0068078 cfdd6800 01003c320c80 01003c3607f0
GPR16: 0001 105480c8 1055aaa8 01003c31ab18
GPR20: 01003c10fb40 01003c360ae8 1063bcf0 1063bdb0
GPR24: 01003c15ed70 10548f40 c01fe5514c88 c01fe5514cb0
GPR28: cda24000  cda24000 0003
[  442.659471] NIP [c0038b88] .pcibios_set_pcie_reset_state+0x28/0x130
[  442.659530] LR [c04435a8] .pci_set_pcie_reset_state+0x28/0x40
[  442.659585] Call Trace:
[  442.659610] [c00f6dc3f800] [000719e0] 0x719e0 (unreliable)
[  442.659677] [c00f6dc3f880] [c04435a8] 
.pci_set_pcie_reset_state+0x28/0x40
[  442.659757] [c00f6dc3f900] [c0455bf8] 
.reset_fundamental+0x38/0x80
[  442.659835] [c00f6dc3f980] [c04562a8] 
.pci_dev_specific_reset+0xa8/0xf0
[  442.659913] [c00f6dc3fa00] [c04448c4] 
.__pci_dev_reset+0x44/0x430
[  442.659980] [c00f6dc3fab0] [c0444d5c] 
.pci_reset_function+0x7c/0xc0
[  442.660059] [c00f6dc3fb30] [d0001c141ab8] .vfio_pci_open+0xe8/0x2b0 
[vfio_pci]
[  442.660139] [c00f6dc3fbd0] [c0586c30] 
.vfio_group_fops_unl_ioctl+0x3a0/0x630
[  442.660219] [c00f6dc3fc90] [c0255fbc] .do_vfs_ioctl+0x4ec/0x7c0
[  442.660286] [c00f6dc3fd80] [c0256364] .SyS_ioctl+0xd4/0xf0
[  442.660354] [c00f6dc3fe30] [c0009e54] syscall_exit+0x0/0x98
[  442.660420] Instruction dump:
[  442.660454] 4bfffce9 4bfffee4 7c0802a6 fbc1fff0 fbe1fff8 f8010010 f821ff81 
7c7e1b78
[  442.660566] 7c9f2378 6000 6000 e93e02c8 e8690060 2fa3 
41de00c4 2b9f0002
[  442.660679] ---[ end trace a64ac9546bcf0328 ]---
[  442.660724]

The reason is current VF is not EEH enabled.

This patch is a quick fix for this problem.

Signed-off-by: Wei Yang weiy...@linux.vnet.ibm.com

With all minor comments fixed:

Acked-by: Gavin Shan gws...@linux.vnet.ibm.com

---
 arch/powerpc/kernel/eeh.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
index 0ba4392..d2d2130 100644
--- a/arch/powerpc/kernel/eeh.c
+++ b/arch/powerpc/kernel/eeh.c
@@ -630,7 +630,7 @@ int eeh_pci_enable(struct eeh_pe *pe, int function)
 int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state 
 state)
 {
   struct eeh_dev *edev = pci_dev_to_eeh_dev(dev);
-  struct eeh_pe *pe = edev-pe;
+  struct eeh_pe *pe = edev ? edev-pe:NULL;

It would be:

struct eeh_pe *pe = edev ? edev-pe : NULL;


   if (!pe) {
   pr_err(%s: No PE found on PCI device %s\n,

Thanks,
Gavin

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V7 01/17] PCI/IOV: Export interface for retrieve VF's BDF

2014-08-19 Thread Wei Yang
On Tue, Aug 19, 2014 at 03:37:26PM -0600, Bjorn Helgaas wrote:
On Thu, Jul 24, 2014 at 02:22:11PM +0800, Wei Yang wrote:
 When implementing the SR-IOV on PowerNV platform, some resource reservation 
 is
 needed for VFs which don't exist at the bootup stage. To do the match between
 resources and VFs, the code need to get the VF's BDF in advance.

Ben started explaining this whole hardware PE/VF/etc stuff to me, but it
hasn't all sunk in yet.  We need to describe it somewhere (it sounds pretty
involved, so maybe an extended description in Documentation/ would be
appropriate).

Yes, this is not that easy to understand the whole stuff. I'd like to write a
file in Documentation/. By scaning the directory, I am not sure which one
would be proper, the Documentation/powerpc/ would be fine?


What I'm concerned about is that PCI resource assignment is a huge mess,
and this obviously complicates it even more.  That's necessary and OK, but
I want to at least preserve the possibility that somebody could rework it
to make it manageable, and that means we need to know what the special
constraints of PowerNV are.

Sure, let me try my best to explain it, my English is not that good, hope it
is understandable. :-)


Code question below.

 In this patch, it exports the interface to retrieve VF's BDF:
* Make the virtfn_bus as an interface
* Make the virtfn_devfn as an interface
* rename them with more specific name
* code cleanup in pci_sriov_resource_alignment()
 
 Signed-off-by: Wei Yang weiy...@linux.vnet.ibm.com
 ---
  drivers/pci/iov.c   |   26 +++---
  drivers/pci/pci.h   |   19 ---
  include/linux/pci.h |   44 
  3 files changed, 51 insertions(+), 38 deletions(-)
 
 diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
 index cb6f247..7566238 100644
 --- a/drivers/pci/iov.c
 +++ b/drivers/pci/iov.c
 @@ -19,18 +19,6 @@
  
  #define VIRTFN_ID_LEN   16
  
 -static inline u8 virtfn_bus(struct pci_dev *dev, int id)
 -{
 -return dev-bus-number + ((dev-devfn + dev-sriov-offset +
 -dev-sriov-stride * id)  8);
 -}
 -
 -static inline u8 virtfn_devfn(struct pci_dev *dev, int id)
 -{
 -return (dev-devfn + dev-sriov-offset +
 -dev-sriov-stride * id)  0xff;
 -}
 -
  static struct pci_bus *virtfn_add_bus(struct pci_bus *bus, int busnr)
  {
  struct pci_bus *child;
 @@ -69,7 +57,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int 
 reset)
  struct pci_bus *bus;
  
  mutex_lock(iov-dev-sriov-lock);
 -bus = virtfn_add_bus(dev-bus, virtfn_bus(dev, id));
 +bus = virtfn_add_bus(dev-bus, pci_iov_virtfn_bus(dev, id));
  if (!bus)
  goto failed;
  
 @@ -77,7 +65,7 @@ static int virtfn_add(struct pci_dev *dev, int id, int 
 reset)
  if (!virtfn)
  goto failed0;
  
 -virtfn-devfn = virtfn_devfn(dev, id);
 +virtfn-devfn = pci_iov_virtfn_devfn(dev, id);
  virtfn-vendor = dev-vendor;
  pci_read_config_word(dev, iov-pos + PCI_SRIOV_VF_DID, virtfn-device);
  pci_setup_device(virtfn);
 @@ -140,8 +128,8 @@ static void virtfn_remove(struct pci_dev *dev, int id, 
 int reset)
  struct pci_sriov *iov = dev-sriov;
  
  virtfn = pci_get_domain_bus_and_slot(pci_domain_nr(dev-bus),
 - virtfn_bus(dev, id),
 - virtfn_devfn(dev, id));
 + pci_iov_virtfn_bus(dev, id),
 + pci_iov_virtfn_devfn(dev, id));
  if (!virtfn)
  return;
  
 @@ -216,7 +204,7 @@ static int sriov_enable(struct pci_dev *dev, int 
 nr_virtfn)
  iov-offset = offset;
  iov-stride = stride;
  
 -if (virtfn_bus(dev, nr_virtfn - 1)  dev-bus-busn_res.end) {
 +if (pci_iov_virtfn_bus(dev, nr_virtfn - 1)  dev-bus-busn_res.end) {
  dev_err(dev-dev, SR-IOV: bus number out of range\n);
  return -ENOMEM;
  }
 @@ -516,7 +504,7 @@ resource_size_t pci_sriov_resource_alignment(struct 
 pci_dev *dev, int resno)
  if (!reg)
  return 0;
  
 - __pci_read_base(dev, type, tmp, reg);
 +__pci_read_base(dev, type, tmp, reg);
  return resource_alignment(tmp);
  }
  
 @@ -546,7 +534,7 @@ int pci_iov_bus_range(struct pci_bus *bus)
  list_for_each_entry(dev, bus-devices, bus_list) {
  if (!dev-is_physfn)
  continue;
 -busnr = virtfn_bus(dev, dev-sriov-total_VFs - 1);
 +busnr = pci_iov_virtfn_bus(dev, dev-sriov-total_VFs - 1);
  if (busnr  max)
  max = busnr;
  }
 diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
 index 0601890..a3158b2 100644
 --- a/drivers/pci/pci.h
 +++ b/drivers/pci/pci.h
 @@ -221,25 +221,6 @@ static inline int pci_ari_enabled(struct pci_bus *bus)
  void pci_reassigndev_resource_alignment(struct pci_dev *dev);
  void 

Re: [PATCH V7 02/17] PCI/IOV: Get VF BAR size from hardware directly when platform needs

2014-08-19 Thread Wei Yang
On Tue, Aug 19, 2014 at 03:44:59PM -0600, Bjorn Helgaas wrote:
On Thu, Jul 24, 2014 at 02:22:12PM +0800, Wei Yang wrote:
 Current implementation calculates VF BAR size from dividing the total size of
 IOV BAR by total VF number. It won't work on PowerNV platform because we're
 going to expand IOV BAR size for finely alignment.
 
 The patch enforces getting IOV BAR size from hardware and then calculate
 the VF BAR size based on that when platform wants so.
 
 Signed-off-by: Wei Yang weiy...@linux.vnet.ibm.com
 ---
  drivers/pci/iov.c  |   28 
  include/linux/ioport.h |1 +
  2 files changed, 25 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
 index 7566238..ef1c546 100644
 --- a/drivers/pci/iov.c
 +++ b/drivers/pci/iov.c
 @@ -55,6 +55,9 @@ static int virtfn_add(struct pci_dev *dev, int id, int 
 reset)
  struct resource *res;
  struct pci_sriov *iov = dev-sriov;
  struct pci_bus *bus;
 +struct resource tmp;
 +enum pci_bar_type type;
 +int reg;
  
  mutex_lock(iov-dev-sriov-lock);
  bus = virtfn_add_bus(dev-bus, pci_iov_virtfn_bus(dev, id));
 @@ -80,12 +83,29 @@ static int virtfn_add(struct pci_dev *dev, int id, int 
 reset)
  continue;
  virtfn-resource[i].name = pci_name(virtfn);
  virtfn-resource[i].flags = res-flags;
 -size = resource_size(res);
 -do_div(size, iov-total_VFs);
 +/* When res has IORESOURCE_ARCH, retrieve the IOV BAR size
 + * from hardware directly.
 + */
 +if (res-flags  IORESOURCE_ARCH) {
 +reg = pci_iov_resource_bar(dev, i + PCI_IOV_RESOURCES, 
 type);
 +__pci_read_base(dev, type, tmp, reg);
 +size = resource_size(tmp);
 +/* When __pci_read_base fails, flags is set to 0.
 + * In this case, reset size to 0, which means the VF
 + * will not be enabled.
 + */
 +if (!tmp.flags)
 +size = 0;

I don't like the IORESOURCE_ARCH flag because it really doesn't have any
specific meaning.  You're using it to enable some arch-specific code here
for this specific case.  But there are any number of other places that
could do something similar, and there's no way to coordinate them all.

I'd rather have some sort of pcibios_*() hook here where powerpc could
override the default implementation.

Yep, got it. I will write a pcibios_sriov_resource_size() and override it in
powerpc arch.


 +} else {
 +size = resource_size(res);
 +do_div(size, iov-total_VFs);
 +}
  virtfn-resource[i].start = res-start + size * id;
  virtfn-resource[i].end = virtfn-resource[i].start + size - 1;
 -rc = request_resource(res, virtfn-resource[i]);
 -BUG_ON(rc);
 +if (resource_size(virtfn-resource[i])) {
 +rc = request_resource(res, virtfn-resource[i]);
 +BUG_ON(rc);
 +}
  }
  
  if (reset)
 diff --git a/include/linux/ioport.h b/include/linux/ioport.h
 index 5e3a906..de8b57c 100644
 --- a/include/linux/ioport.h
 +++ b/include/linux/ioport.h
 @@ -48,6 +48,7 @@ struct resource {
  #define IORESOURCE_MEM_64   0x0010
  #define IORESOURCE_WINDOW   0x0020  /* forwarded by bridge */
  #define IORESOURCE_MUXED0x0040  /* Resource is software muxed */
 +#define IORESOURCE_ARCH 0x0080  /* Resource arch tagged 
 */

  #define IORESOURCE_EXCLUSIVE0x0800  /* Userland may not map 
 this resource */
  #define IORESOURCE_DISABLED 0x1000
 -- 
 1.7.9.5
 

-- 
Richard Yang
Help you, Help me

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V7 00/17] Enable SRIOV on POWER8

2014-08-19 Thread Wei Yang
On Tue, Aug 19, 2014 at 03:19:42PM -0600, Bjorn Helgaas wrote:
On Thu, Jul 24, 2014 at 02:22:10PM +0800, Wei Yang wrote:
 This patch set enables the SRIOV on POWER8.
 
 The gerneral idea is put each VF into one individual PE and allocate required
 resources like DMA/MSI.
 
 One thing special for VF PE is we use M64BT to cover the IOV BAR. M64BT is 
 one
 hardware on POWER platform to map MMIO address to PE. By using M64BT, we 
 could
 map one individual VF to a VF PE, which introduce more flexiblity to users.
 
 To achieve this effect, we need to do some hack on pci devices's resources.
 1. Expand the IOV BAR properly.
Done by pnv_pci_ioda_fixup_iov_resources().
 2. Shift the IOV BAR properly.
Done by pnv_pci_vf_resource_shift().
 3. IOV BAR alignment is the total size instead of an individual size on
powernv platform.
Done by pnv_pcibios_sriov_resource_alignment().
 4. Take the IOV BAR alignment into consideration in the sizing and assigning.
This is achieved by commit: PCI: Take additional IOV BAR alignment in
sizing and assigning
 
 Test Environment:
The SRIOV device tested is Emulex Lancer and Mellanox ConnectX-3 on
POWER8.
 
 Examples on pass through a VF to guest through vfio:
  1. install necessary modules
 modprobe vfio
 modprobe vfio-pci
  2. retrieve the iommu_group the device belongs to
 readlink /sys/bus/pci/devices/:06:0d.0/iommu_group
 ../../../../kernel/iommu_groups/26
 This means it belongs to group 26
  3. see how many devices under this iommu_group
 ls /sys/kernel/iommu_groups/26/devices/
  4. unbind the original driver and bind to vfio-pci driver
 echo :06:0d.0  /sys/bus/pci/devices/:06:0d.0/driver/unbind
 echo  1102 0002  /sys/bus/pci/drivers/vfio-pci/new_id
 Note: this should be done for each device in the same iommu_group
  5. Start qemu and pass device through vfio
 /home/ywywyang/git/qemu-impreza/ppc64-softmmu/qemu-system-ppc64 \
 -M pseries -m 2048 -enable-kvm -nographic \
 -drive file=/home/ywywyang/kvm/fc19.img \
 -monitor telnet:localhost:5435,server,nowait -boot cd \
 -device 
 spapr-pci-vfio-host-bridge,id=CXGB3,iommu=26,index=6
 
 Verify this is the exact VF response:
  1. ping from a machine in the same subnet(the broadcast domain)
  2. run arp -n on this machine
 9.115.251.20 ether   00:00:c9:df:ed:bf   C eth0
  3. ifconfig in the guest
 # ifconfig eth1
 eth1: flags=4163UP,BROADCAST,RUNNING,MULTICAST  mtu 1500
  inet 9.115.251.20  netmask 255.255.255.0  broadcast 
 9.115.251.255
  inet6 fe80::200:c9ff:fedf:edbf  prefixlen 64  scopeid 0x20link
  ether 00:00:c9:df:ed:bf  txqueuelen 1000 (Ethernet)
  RX packets 175  bytes 13278 (12.9 KiB)
  RX errors 0  dropped 0  overruns 0  frame 0
  TX packets 58  bytes 9276 (9.0 KiB)
  TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  4. They have the same MAC address
 
  Note: make sure you shutdown other network interfaces in guest.
 
 ---
 v6 - v7:
1. add IORESOURCE_ARCH flag for IOV BAR on powernv platform.
2. when IOV BAR has IORESOURCE_ARCH flag, the size is retrieved from
   hardware directly. If not, calculate as usual.
3. reorder the patch set, group them by subsystem:
   PCI, powerpc, powernv
4. rebase it on 3.16-rc6

This doesn't apply for me on v3.16-rc6:

  02:48:57 ~/linux$ stg rebase v3.16-rc6
  Checking for changes in the working directory ... done
  Rebasing to v3.16-rc6 ... done
  No patches applied
  02:49:14 ~/linux$ stg import -M --sign m/wy
  Checking for changes in the working directory ... done
  Importing patch pci-iov-export-interface-for ... done
  Importing patch pci-iov-get-vf-bar-size-from ... done
  Importing patch pci-add-weak ... done
  Importing patch pci-take-additional-iov-bar ... done
  Importing patch powerpc-pci-don-t-unset-pci ... done
  Importing patch powerpc-pci-define ... done
  Importing patch powrepc-pci-refactor-pci_dn ... done
  Importing patch powerpc-powernv-use-pci_dn-in ... error: patch failed:
  arch/powerpc/platforms/powernv/pci.c:376
  error: arch/powerpc/platforms/powernv/pci.c: patch does not apply
  stg import: Diff does not apply cleanly

What am I missing?

I assume you intend these all to go through my tree just to keep them all
together.  The ideal rebase target for me would be v3.17-rc1.

Ok, I will rebase it on v3.17-rc1 upstream. While I guess the conflict is due
to some patches from Gavin, which is not merged at that moment. I will make
sure it applies to v3.17-rc1.


Given the arch/powerpc parts, I'll want an ack from Ben.  I just chatted
with him about these, so I assume that's not a problem, but we should make
it explicit.

Bjorn

-- 
Richard Yang
Help you, Help me


Re: [PATCH v2] PC, KVM, CMA: Fix regression caused by wrong get_order() use

2014-08-19 Thread Joonsoo Kim
On Thu, Aug 14, 2014 at 03:03:07PM +1000, Alexey Kardashevskiy wrote:
 fc95ca7284bc54953165cba76c3228bd2cdb9591 claims that there is no
 functional change but this is not true as it calls get_order() (which
 takes bytes) where it should have called ilog2() and the kernel stops
 on VM_BUG_ON().
 
 This replaces get_order() with order_base_2() (round-up version of ilog2).
 
 Suggested-by: Paul Mackerras pau...@samba.org
 Cc: Alexander Graf ag...@suse.de
 Cc: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
 Cc: Joonsoo Kim iamjoonsoo@lge.com
 Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
 Signed-off-by: Alexey Kardashevskiy a...@ozlabs.ru

Sorry for my fault. :(

Acked-by: Joonsoo Kim iamjoonsoo@lge.com

Thanks.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V7 04/17] PCI: Take additional IOV BAR alignment in sizing and assigning

2014-08-19 Thread Bjorn Helgaas
On Thu, Jul 24, 2014 at 02:22:14PM +0800, Wei Yang wrote:
 At resource sizing/assigning stage, resources are divided into two lists,
 requested list and additional list, while the alignement of the additional
 IOV BAR is not taken into the sizeing and assigning procedure.
 
 This is reasonable in the original implementation, since IOV BAR's alignment 
 is
 mostly the size of a PF BAR alignemt. This means the alignment is already 
 taken
 into consideration. While this rule may be violated on some platform.
 
 This patch take the additional IOV BAR alignment in sizing and assigning stage
 explicitly.
 
 Signed-off-by: Wei Yang weiy...@linux.vnet.ibm.com
 ---
  drivers/pci/setup-bus.c |   68 
 +--
  1 file changed, 60 insertions(+), 8 deletions(-)
 
 diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
 index a5a63ec..d83681f 100644
 --- a/drivers/pci/setup-bus.c
 +++ b/drivers/pci/setup-bus.c
 @@ -120,6 +120,28 @@ static resource_size_t get_res_add_size(struct list_head 
 *head,
   return 0;
  }
  
 +static resource_size_t get_res_add_align(struct list_head *head,
 + struct resource *res)
 +{
 + struct pci_dev_resource *dev_res;
 +
 + list_for_each_entry(dev_res, head, list) {
 + if (dev_res-res == res) {
 + int idx = res - dev_res-dev-resource[0];
 +
 + dev_printk(KERN_DEBUG, dev_res-dev-dev,
 +res[%d]=%pR get_res_add_align min_align 
 %llx\n,
 +idx, dev_res-res,
 +(unsigned long long)dev_res-min_align);
 +
 + return dev_res-min_align;
 + }
 + }
 +
 + return 0;
 +}

I see that you copied the structure of the existing get_res_add_size()
here.  But I don't understand *that* function.  It looks basically like
this:

  resource_size_t get_res_add_size(list, res)
  {
list_for_each_entry(dev_res, head, list) {
  if (dev_res-res == res)
return dev_res-add_size;
}
return 0;
  }

and we call it like this:

  dev_res-res-end += get_res_add_size(realloc_head, dev_res-res);

So we start out with dev_res, pass in dev_res-res, search the
realloc_head list to find dev_res again, and return dev_res-add_size.
That looks equivalent to just:

  dev_res-res-end += dev_res-add_size;

It looks like get_res_add_size() merely adds a printk and some complexity.
Am I missing something?

I do see that there are other callers where we don't actually start with
dev_res, which makes it a little more complicated.  But I think you should
either add something like this:

  struct pci_dev_resource *res_to_dev_res(list, res)
  {
list_for_each_entry(dev_res, head, list) {
  if (dev_res-res == res)
return dev_res;
}
return NULL;
  }

which can be used to replace get_res_add_size() and get_res_add_align(), OR
figure out whether the dev_res of interest is always one we've just added.
If it is, maybe you can just make add_to_list() return the dev_res pointer
instead of an errno, and hang onto the pointer.  I'd like that much better
if that's possible.

 +
 +
  /* Sort resources by alignment */
  static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
  {
 @@ -368,8 +390,9 @@ static void __assign_resources_sorted(struct list_head 
 *head,
   LIST_HEAD(save_head);
   LIST_HEAD(local_fail_head);
   struct pci_dev_resource *save_res;
 - struct pci_dev_resource *dev_res, *tmp_res;
 + struct pci_dev_resource *dev_res, *tmp_res, *dev_res2;
   unsigned long fail_type;
 + resource_size_t add_align, align;
  
   /* Check if optional add_size is there */
   if (!realloc_head || list_empty(realloc_head))
 @@ -384,10 +407,31 @@ static void __assign_resources_sorted(struct list_head 
 *head,
   }
  
   /* Update res in head list with add_size in realloc_head list */
 - list_for_each_entry(dev_res, head, list)
 + list_for_each_entry_safe(dev_res, tmp_res, head, list) {
   dev_res-res-end += get_res_add_size(realloc_head,
   dev_res-res);
  
 + if (!(dev_res-res-flags  IORESOURCE_STARTALIGN))
 + continue;
 +
 + add_align = get_res_add_align(realloc_head, dev_res-res);
 +
 + if (add_align  dev_res-res-start) {
 + dev_res-res-start = add_align;
 + dev_res-res-end = add_align +
 + resource_size(dev_res-res);
 +
 + list_for_each_entry(dev_res2, head, list) {
 + align = pci_resource_alignment(dev_res2-dev,
 +dev_res2-res);
 + if (add_align  align)
 + list_move_tail(dev_res-list,
 + 

Re: [PATCH V7 00/17] Enable SRIOV on POWER8

2014-08-19 Thread Bjorn Helgaas
On Tue, Aug 19, 2014 at 9:34 PM, Wei Yang weiy...@linux.vnet.ibm.com wrote:
 On Tue, Aug 19, 2014 at 03:19:42PM -0600, Bjorn Helgaas wrote:
On Thu, Jul 24, 2014 at 02:22:10PM +0800, Wei Yang wrote:
 This patch set enables the SRIOV on POWER8.

 The gerneral idea is put each VF into one individual PE and allocate 
 required
 resources like DMA/MSI.

 One thing special for VF PE is we use M64BT to cover the IOV BAR. M64BT is 
 one
 hardware on POWER platform to map MMIO address to PE. By using M64BT, we 
 could
 map one individual VF to a VF PE, which introduce more flexiblity to users.

 To achieve this effect, we need to do some hack on pci devices's resources.
 1. Expand the IOV BAR properly.
Done by pnv_pci_ioda_fixup_iov_resources().
 2. Shift the IOV BAR properly.
Done by pnv_pci_vf_resource_shift().
 3. IOV BAR alignment is the total size instead of an individual size on
powernv platform.
Done by pnv_pcibios_sriov_resource_alignment().
 4. Take the IOV BAR alignment into consideration in the sizing and 
 assigning.
This is achieved by commit: PCI: Take additional IOV BAR alignment in
sizing and assigning

 Test Environment:
The SRIOV device tested is Emulex Lancer and Mellanox ConnectX-3 on
POWER8.

 Examples on pass through a VF to guest through vfio:
  1. install necessary modules
 modprobe vfio
 modprobe vfio-pci
  2. retrieve the iommu_group the device belongs to
 readlink /sys/bus/pci/devices/:06:0d.0/iommu_group
 ../../../../kernel/iommu_groups/26
 This means it belongs to group 26
  3. see how many devices under this iommu_group
 ls /sys/kernel/iommu_groups/26/devices/
  4. unbind the original driver and bind to vfio-pci driver
 echo :06:0d.0  /sys/bus/pci/devices/:06:0d.0/driver/unbind
 echo  1102 0002  /sys/bus/pci/drivers/vfio-pci/new_id
 Note: this should be done for each device in the same iommu_group
  5. Start qemu and pass device through vfio
 /home/ywywyang/git/qemu-impreza/ppc64-softmmu/qemu-system-ppc64 \
 -M pseries -m 2048 -enable-kvm -nographic \
 -drive file=/home/ywywyang/kvm/fc19.img \
 -monitor telnet:localhost:5435,server,nowait -boot cd \
 -device 
 spapr-pci-vfio-host-bridge,id=CXGB3,iommu=26,index=6

 Verify this is the exact VF response:
  1. ping from a machine in the same subnet(the broadcast domain)
  2. run arp -n on this machine
 9.115.251.20 ether   00:00:c9:df:ed:bf   C eth0
  3. ifconfig in the guest
 # ifconfig eth1
 eth1: flags=4163UP,BROADCAST,RUNNING,MULTICAST  mtu 1500
  inet 9.115.251.20  netmask 255.255.255.0  broadcast 
 9.115.251.255
  inet6 fe80::200:c9ff:fedf:edbf  prefixlen 64  scopeid 
 0x20link
  ether 00:00:c9:df:ed:bf  txqueuelen 1000 (Ethernet)
  RX packets 175  bytes 13278 (12.9 KiB)
  RX errors 0  dropped 0  overruns 0  frame 0
  TX packets 58  bytes 9276 (9.0 KiB)
  TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  4. They have the same MAC address

  Note: make sure you shutdown other network interfaces in guest.

 ---
 v6 - v7:
1. add IORESOURCE_ARCH flag for IOV BAR on powernv platform.
2. when IOV BAR has IORESOURCE_ARCH flag, the size is retrieved from
   hardware directly. If not, calculate as usual.
3. reorder the patch set, group them by subsystem:
   PCI, powerpc, powernv
4. rebase it on 3.16-rc6

This doesn't apply for me on v3.16-rc6:

  02:48:57 ~/linux$ stg rebase v3.16-rc6
  Checking for changes in the working directory ... done
  Rebasing to v3.16-rc6 ... done
  No patches applied
  02:49:14 ~/linux$ stg import -M --sign m/wy
  Checking for changes in the working directory ... done
  Importing patch pci-iov-export-interface-for ... done
  Importing patch pci-iov-get-vf-bar-size-from ... done
  Importing patch pci-add-weak ... done
  Importing patch pci-take-additional-iov-bar ... done
  Importing patch powerpc-pci-don-t-unset-pci ... done
  Importing patch powerpc-pci-define ... done
  Importing patch powrepc-pci-refactor-pci_dn ... done
  Importing patch powerpc-powernv-use-pci_dn-in ... error: patch failed:
  arch/powerpc/platforms/powernv/pci.c:376
  error: arch/powerpc/platforms/powernv/pci.c: patch does not apply
  stg import: Diff does not apply cleanly

What am I missing?

I assume you intend these all to go through my tree just to keep them all
together.  The ideal rebase target for me would be v3.17-rc1.

 Ok, I will rebase it on v3.17-rc1 upstream. While I guess the conflict is due
 to some patches from Gavin, which is not merged at that moment. I will make
 sure it applies to v3.17-rc1.

I tried applying them on v3.16-rc6 as well as on every change to
arch/powerpc/platforms/powernv/pci.c between v3.16-rc6 and v3.17-rc1,
and none 

[PATCH] powerpc: Export dcr_ind_lock to fix build error

2014-08-19 Thread Pranith Kumar
Fix build error caused by missing export:

ERROR: dcr_ind_lock [drivers/net/ethernet/ibm/emac/ibm_emac.ko] undefined!

Signed-off-by: Pranith Kumar bobby.pr...@gmail.com
---
 arch/powerpc/sysdev/dcr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/sysdev/dcr.c b/arch/powerpc/sysdev/dcr.c
index e9056e4..2d8a101 100644
--- a/arch/powerpc/sysdev/dcr.c
+++ b/arch/powerpc/sysdev/dcr.c
@@ -230,5 +230,6 @@ EXPORT_SYMBOL_GPL(dcr_unmap_mmio);
 
 #ifdef CONFIG_PPC_DCR_NATIVE
 DEFINE_SPINLOCK(dcr_ind_lock);
+EXPORT_SYMBOL_GPL(dcr_ind_lock);
 #endif /* defined(CONFIG_PPC_DCR_NATIVE) */
 
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V7 00/17] Enable SRIOV on POWER8

2014-08-19 Thread Wei Yang
On Tue, Aug 19, 2014 at 10:12:27PM -0500, Bjorn Helgaas wrote:
On Tue, Aug 19, 2014 at 9:34 PM, Wei Yang weiy...@linux.vnet.ibm.com wrote:
 On Tue, Aug 19, 2014 at 03:19:42PM -0600, Bjorn Helgaas wrote:
On Thu, Jul 24, 2014 at 02:22:10PM +0800, Wei Yang wrote:
 This patch set enables the SRIOV on POWER8.

 The gerneral idea is put each VF into one individual PE and allocate 
 required
 resources like DMA/MSI.

 One thing special for VF PE is we use M64BT to cover the IOV BAR. M64BT is 
 one
 hardware on POWER platform to map MMIO address to PE. By using M64BT, we 
 could
 map one individual VF to a VF PE, which introduce more flexiblity to users.

 To achieve this effect, we need to do some hack on pci devices's resources.
 1. Expand the IOV BAR properly.
Done by pnv_pci_ioda_fixup_iov_resources().
 2. Shift the IOV BAR properly.
Done by pnv_pci_vf_resource_shift().
 3. IOV BAR alignment is the total size instead of an individual size on
powernv platform.
Done by pnv_pcibios_sriov_resource_alignment().
 4. Take the IOV BAR alignment into consideration in the sizing and 
 assigning.
This is achieved by commit: PCI: Take additional IOV BAR alignment in
sizing and assigning

 Test Environment:
The SRIOV device tested is Emulex Lancer and Mellanox ConnectX-3 on
POWER8.

 Examples on pass through a VF to guest through vfio:
  1. install necessary modules
 modprobe vfio
 modprobe vfio-pci
  2. retrieve the iommu_group the device belongs to
 readlink /sys/bus/pci/devices/:06:0d.0/iommu_group
 ../../../../kernel/iommu_groups/26
 This means it belongs to group 26
  3. see how many devices under this iommu_group
 ls /sys/kernel/iommu_groups/26/devices/
  4. unbind the original driver and bind to vfio-pci driver
 echo :06:0d.0  /sys/bus/pci/devices/:06:0d.0/driver/unbind
 echo  1102 0002  /sys/bus/pci/drivers/vfio-pci/new_id
 Note: this should be done for each device in the same iommu_group
  5. Start qemu and pass device through vfio
 /home/ywywyang/git/qemu-impreza/ppc64-softmmu/qemu-system-ppc64 \
 -M pseries -m 2048 -enable-kvm -nographic \
 -drive file=/home/ywywyang/kvm/fc19.img \
 -monitor telnet:localhost:5435,server,nowait -boot cd \
 -device 
 spapr-pci-vfio-host-bridge,id=CXGB3,iommu=26,index=6

 Verify this is the exact VF response:
  1. ping from a machine in the same subnet(the broadcast domain)
  2. run arp -n on this machine
 9.115.251.20 ether   00:00:c9:df:ed:bf   C eth0
  3. ifconfig in the guest
 # ifconfig eth1
 eth1: flags=4163UP,BROADCAST,RUNNING,MULTICAST  mtu 1500
  inet 9.115.251.20  netmask 255.255.255.0  broadcast 
 9.115.251.255
  inet6 fe80::200:c9ff:fedf:edbf  prefixlen 64  scopeid 
 0x20link
  ether 00:00:c9:df:ed:bf  txqueuelen 1000 (Ethernet)
  RX packets 175  bytes 13278 (12.9 KiB)
  RX errors 0  dropped 0  overruns 0  frame 0
  TX packets 58  bytes 9276 (9.0 KiB)
  TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
  4. They have the same MAC address

  Note: make sure you shutdown other network interfaces in guest.

 ---
 v6 - v7:
1. add IORESOURCE_ARCH flag for IOV BAR on powernv platform.
2. when IOV BAR has IORESOURCE_ARCH flag, the size is retrieved from
   hardware directly. If not, calculate as usual.
3. reorder the patch set, group them by subsystem:
   PCI, powerpc, powernv
4. rebase it on 3.16-rc6

This doesn't apply for me on v3.16-rc6:

  02:48:57 ~/linux$ stg rebase v3.16-rc6
  Checking for changes in the working directory ... done
  Rebasing to v3.16-rc6 ... done
  No patches applied
  02:49:14 ~/linux$ stg import -M --sign m/wy
  Checking for changes in the working directory ... done
  Importing patch pci-iov-export-interface-for ... done
  Importing patch pci-iov-get-vf-bar-size-from ... done
  Importing patch pci-add-weak ... done
  Importing patch pci-take-additional-iov-bar ... done
  Importing patch powerpc-pci-don-t-unset-pci ... done
  Importing patch powerpc-pci-define ... done
  Importing patch powrepc-pci-refactor-pci_dn ... done
  Importing patch powerpc-powernv-use-pci_dn-in ... error: patch failed:
  arch/powerpc/platforms/powernv/pci.c:376
  error: arch/powerpc/platforms/powernv/pci.c: patch does not apply
  stg import: Diff does not apply cleanly

What am I missing?

I assume you intend these all to go through my tree just to keep them all
together.  The ideal rebase target for me would be v3.17-rc1.

 Ok, I will rebase it on v3.17-rc1 upstream. While I guess the conflict is due
 to some patches from Gavin, which is not merged at that moment. I will make
 sure it applies to v3.17-rc1.

I tried applying them on v3.16-rc6 as well as on every change to

Re: [PATCH 2/2] fsl_ifc: Support all 8 IFC chip selects

2014-08-19 Thread Prabhakar Kushwaha


On 8/20/2014 5:38 AM, Scott Wood wrote:

On Fri, 2014-08-15 at 16:07 -0500, Aaron Sierra wrote:

Freescale's QorIQ T Series processors support 8 IFC chip selects
within a memory map backward compatible with previous P Series
processors which supported only 4 chip selects.

Signed-off-by: Aaron Sierra asie...@xes-inc.com
---
  include/linux/fsl_ifc.h | 10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/fsl_ifc.h b/include/linux/fsl_ifc.h
index 84d60cb..62762ff 100644
--- a/include/linux/fsl_ifc.h
+++ b/include/linux/fsl_ifc.h
@@ -29,7 +29,7 @@
  #include linux/of_platform.h
  #include linux/interrupt.h
  
-#define FSL_IFC_BANK_COUNT 4

+#define FSL_IFC_BANK_COUNT 8

First please modify fsl_ifc_nand.c to limit itself to the number of
banks it dynamically determines are present based on the IFC version.




Number of available bank/chip select are defined by SoC and it is 
independent of SoC.

It should be fix in following way

Option 1:
u-boot:  fix device tree with number of available chip select. It may 
require IFC binding change

Linux: Read device tree and determine the Chip Selects

or

Option 2:
Make it static because any way IFC NAND driver polls to 
FSL_IFC_BANK_COUNT to know NAND flash chip select. This patch is doing same.


Regards,
Prabhakar


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v4] powerpc/kvm: support to handle sw breakpoint

2014-08-19 Thread Madhavan Srinivasan
This patch adds kernel side support for software breakpoint.
Design is that, by using an illegal instruction, we trap to hypervisor
via Emulation Assistance interrupt, where we check for the illegal instruction
and accordingly we return to Host or Guest. Patch also adds support for
software breakpoint in PR KVM.

Changes v3-v4:
 Made changes to code comments and removed #define of zero opcode
 Added a new function to handle the debug instruction emulation in book3s_hv
 Rebased the code to latest upstream source.

Changes v2-v3:
 Changed the debug instructions. Using the all zero opcode in the instruction 
word
  as illegal instruction as mentioned in Power ISA instead of ABS
 Removed reg updated in emulation assist and added a call to
  kvmppc_emulate_instruction for reg update.

Changes v1-v2:

 Moved the debug instruction #def to kvm_book3s.h. This way PR_KVM can also 
share it.
 Added code to use KVM get one reg infrastructure to get debug opcode.
 Updated emulate.c to include emulation of debug instruction incase of PR_KVM.
 Made changes to commit message.

Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 arch/powerpc/include/asm/kvm_book3s.h |  7 +++
 arch/powerpc/kvm/book3s.c |  3 ++-
 arch/powerpc/kvm/book3s_hv.c  | 32 ++--
 arch/powerpc/kvm/book3s_pr.c  |  3 +++
 arch/powerpc/kvm/emulate.c| 11 +++
 5 files changed, 53 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_book3s.h 
b/arch/powerpc/include/asm/kvm_book3s.h
index 6acf0c2..a1944f8 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -24,6 +24,13 @@
 #include linux/kvm_host.h
 #include asm/kvm_book3s_asm.h
 
+/*
+ * KVMPPC_INST_BOOK3S_DEBUG is debug Instruction for supporting Software 
Breakpoint.
+ * Based on PowerISA v2.07, Instruction with primary opcode 0 will be treated 
as illegal
+ * instruction.
+ */
+#define KVMPPC_INST_BOOK3S_DEBUG   0x0000
+
 struct kvmppc_bat {
u64 raw;
u32 bepi;
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index dd03f6b..00e9c9f 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -778,7 +778,8 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
 int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
struct kvm_guest_debug *dbg)
 {
-   return -EINVAL;
+   vcpu-guest_debug = dbg-control;
+   return 0;
 }
 
 void kvmppc_decrementer_func(unsigned long data)
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 27cced9..0a92e45 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -725,6 +725,14 @@ static int kvmppc_hcall_impl_hv(unsigned long cmd)
return kvmppc_hcall_impl_hv_realmode(cmd);
 }
 
+static int kvmppc_emulate_debug_instruction_hv(struct kvm_run *run,
+   struct kvm_vcpu *vcpu)
+{
+   run-exit_reason = KVM_EXIT_DEBUG;
+   run-debug.arch.address = kvmppc_get_pc(vcpu);
+   return 0;
+}
+
 static int kvmppc_handle_exit_hv(struct kvm_run *run, struct kvm_vcpu *vcpu,
 struct task_struct *tsk)
 {
@@ -811,9 +819,26 @@ static int kvmppc_handle_exit_hv(struct kvm_run *run, 
struct kvm_vcpu *vcpu,
 * we don't emulate any guest instructions at this stage.
 */
case BOOK3S_INTERRUPT_H_EMUL_ASSIST:
-   kvmppc_core_queue_program(vcpu, SRR1_PROGILL);
-   r = RESUME_GUEST;
+   {
+   u32 last_inst;
+   if(kvmppc_get_last_inst(vcpu, INST_GENERIC, last_inst) !=
+   EMULATE_DONE) {
+   /*
+* Fetch failed, so return to guest and
+* try executing it again.
+*/
+   r = RESUME_GUEST;
+   } else {
+   if (last_inst == KVMPPC_INST_BOOK3S_DEBUG) {
+   kvmppc_emulate_debug_instruction_hv(run, vcpu);
+   r = RESUME_HOST;
+   } else {
+   kvmppc_core_queue_program(vcpu, SRR1_PROGILL);
+   r = RESUME_GUEST;
+   }
+   }
break;
+   }
/*
 * This occurs if the guest (kernel or userspace), does something that
 * is prohibited by HFSCR.  We just generate a program interrupt to
@@ -922,6 +947,9 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 
id,
long int i;
 
switch (id) {
+   case KVM_REG_PPC_DEBUG_INST:
+   *val = get_reg_val(id, KVMPPC_INST_BOOK3S_DEBUG);
+   break;
case KVM_REG_PPC_HIOR:
*val = get_reg_val(id, 0);
break;
diff --git