Re: [PATCH v2 04/10] crypto/compress: add asynchronous compression support

2016-01-26 Thread Li, Weigang

On 1/27/2016 3:41 PM, Herbert Xu wrote:

On Tue, Jan 26, 2016 at 05:15:06PM +0900, Joonsoo Kim wrote:

From: Weigang Li 

Now, asynchronous compression APIs are supported. There is no asynchronous
compression driver now but this APIs can be used as front-end to
synchronous compression algorithm. In this case, scatterlist would be
linearlized when needed so it would cause some overhead.

Signed-off-by: Weigang Li 
Signed-off-by: Joonsoo Kim 


I think we should be able to use this for the synchronous case
too, like we do with skcipher and ahash.

The main difference that I can see right now is that acomp always
allocates a context through the request object while scomp does not.

This difference is entirely artificial as we could also make the
context conditional for acomp.

The reason we had the shash/ahash division is because the shash
interface offers a direct pointer interface while ahash is SG-based.
Otherwise ahash is just as able as shash to handle synchronous
requests.

At this point in time I don't see such a fundamental distinction
between acomp and scomp.

Cheers,


The acomp is also SG-based, while scomp only accepts flat buffer.


Re: [PATCH 04/15] arc: use of_platform_default_populate() to populate default bus

2016-01-26 Thread Vineet Gupta
On Wednesday 27 January 2016 09:56 AM, Kefeng Wang wrote:
> Use helper of_platform_default_populate() in linux/of_platform
> when possible, instead of calling of_platform_populate() with
> the default match table.
>
> Cc: Vineet Gupta 
> Signed-off-by: Kefeng Wang 
> ---

Acked-by: Vineet Gupta 

Thx,
-Vineet


Re: [PATCH 01/15] arm: use of_platform_default_populate() to populate default bus

2016-01-26 Thread Kefeng Wang


On 2016/1/27 15:08, kbuild test robot wrote:
> Hi Kefeng,
> 
> [auto build test ERROR on v4.5-rc1]
> [cannot apply to arm-soc/for-next next-20160127]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improving the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Kefeng-Wang/use-of_platform_default_populate-to-populate-default-bus/20160127-123512
> config: arm-at91_dt_defconfig (attached as .config)
> reproduce:
> wget 
> https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>  -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=arm 
> 
> All errors (new ones prefixed by >>):
> 
>arch/arm/mach-at91/at91rm9200.c: In function 'at91rm9200_dt_device_init':
>>> arch/arm/mach-at91/at91rm9200.c:34:2: error: implicit declaration of 
>>> function 'of_platform__default_populate' 
>>> [-Werror=implicit-function-declaration]
>  of_platform__default_populate(NULL, NULL, soc_dev);

sorry for the typo, fix in v2.

>  ^
>cc1: some warnings being treated as errors
> 
> vim +/of_platform__default_populate +34 arch/arm/mach-at91/at91rm9200.c
> 
> 28struct device *soc_dev = NULL;
> 29
> 30soc = at91_soc_init(rm9200_socs);
> 31if (soc != NULL)
> 32soc_dev = soc_device_to_device(soc);
> 33
>   > 34of_platform__default_populate(NULL, NULL, soc_dev);
> 35
> 36arm_pm_idle = at91rm9200_idle;
> 37at91rm9200_pm_init();
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation
> 



[PATCH v2 01/15] arm: use of_platform_default_populate() to populate default bus

2016-01-26 Thread Kefeng Wang
Use helper of_platform_default_populate() in linux/of_platform
when possible, instead of calling of_platform_populate() with
the default match table.

Cc: Nicolas Ferre 
Cc: Ray Jui 
Cc: Lee Jones 
Cc: Krzysztof Halasa 
Cc: Kukjin Kim 
Cc: Rob Herring 
Cc: Shawn Guo 
Cc: Santosh Shilimkar 
Cc: Roland Stigge 
Cc: Jason Cooper 
Cc: Haojian Zhuang 
Cc: Heiko Stuebner 
Cc: Viresh Kumar 
Cc: Shiraz Hashim 
Cc: Tony Prisk 
Cc: Arnd Bergmann 
Cc: Russell King 
Signed-off-by: Kefeng Wang 
---
 arch/arm/kernel/setup.c  | 3 +--
 arch/arm/mach-at91/at91rm9200.c  | 2 +-
 arch/arm/mach-at91/at91sam9.c| 2 +-
 arch/arm/mach-at91/sama5.c   | 2 +-
 arch/arm/mach-bcm/board_bcm21664.c   | 2 +-
 arch/arm/mach-bcm/board_bcm281xx.c   | 2 +-
 arch/arm/mach-bcm/board_bcm2835.c| 5 ++---
 arch/arm/mach-cns3xxx/core.c | 3 +--
 arch/arm/mach-davinci/da8xx-dt.c | 3 +--
 arch/arm/mach-exynos/exynos.c| 2 +-
 arch/arm/mach-highbank/highbank.c| 2 +-
 arch/arm/mach-imx/imx27-dt.c | 2 +-
 arch/arm/mach-imx/mach-imx51.c   | 2 +-
 arch/arm/mach-imx/mach-imx53.c   | 2 +-
 arch/arm/mach-imx/mach-imx6q.c   | 2 +-
 arch/arm/mach-imx/mach-imx6sl.c  | 2 +-
 arch/arm/mach-imx/mach-imx6sx.c  | 2 +-
 arch/arm/mach-imx/mach-imx6ul.c  | 2 +-
 arch/arm/mach-imx/mach-imx7d.c   | 2 +-
 arch/arm/mach-integrator/integrator_ap.c | 3 +--
 arch/arm/mach-integrator/integrator_cp.c | 3 +--
 arch/arm/mach-keystone/keystone.c| 2 +-
 arch/arm/mach-lpc32xx/phy3250.c  | 3 +--
 arch/arm/mach-mvebu/board-v7.c   | 2 +-
 arch/arm/mach-mvebu/dove.c   | 2 +-
 arch/arm/mach-mvebu/kirkwood.c   | 2 +-
 arch/arm/mach-mxs/mach-mxs.c | 3 +--
 arch/arm/mach-nspire/nspire.c| 3 +--
 arch/arm/mach-orion5x/board-dt.c | 3 +--
 arch/arm/mach-picoxcell/common.c | 2 +-
 arch/arm/mach-pxa/pxa-dt.c   | 3 +--
 arch/arm/mach-rockchip/rockchip.c| 2 +-
 arch/arm/mach-s3c24xx/mach-s3c2416-dt.c  | 2 +-
 arch/arm/mach-s3c64xx/mach-s3c64xx-dt.c  | 2 +-
 arch/arm/mach-shmobile/setup-r8a7740.c   | 2 +-
 arch/arm/mach-shmobile/setup-sh73a0.c| 2 +-
 arch/arm/mach-spear/spear1310.c  | 2 +-
 arch/arm/mach-spear/spear1340.c  | 2 +-
 arch/arm/mach-spear/spear300.c   | 3 +--
 arch/arm/mach-spear/spear310.c   | 3 +--
 arch/arm/mach-spear/spear320.c   | 3 +--
 arch/arm/mach-spear/spear6xx.c   | 3 +--
 arch/arm/mach-tegra/tegra.c  | 2 +-
 arch/arm/mach-u300/core.c| 3 +--
 arch/arm/mach-versatile/versatile_dt.c   | 3 +--
 arch/arm/mach-vt8500/vt8500.c| 2 +-
 arch/arm/mach-zynq/common.c  | 2 +-
 47 files changed, 48 insertions(+), 65 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 7d0cba6f..bdbafe9 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -905,8 +905,7 @@ static int __init customize_machine(void)
machine_desc->init_machine();
 #ifdef CONFIG_OF
else
-   of_platform_populate(NULL, of_default_bus_match_table,
-   NULL, NULL);
+   of_platform_default_populate(NULL, NULL, NULL);
 #endif
return 0;
 }
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index c1a7c6c..1904bc7 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -31,7 +31,7 @@ static void __init at91rm9200_dt_device_init(void)
if (soc != NULL)
soc_dev = soc_device_to_device(soc);
 
-   of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev);
+   of_platform_default_populate(NULL, NULL, soc_dev);
 
arm_pm_idle = at91rm9200_idle;
at91rm9200_pm_init();
diff --git a/arch/arm/mach-at91/at91sam9.c b/arch/arm/mach-at91/at91sam9.c
index 7eb64f7..d495620 100644
--- a/arch/arm/mach-at91/at91sam9.c
+++ b/arch/arm/mach-at91/at91sam9.c
@@ -61,7 +61,7 @@ static void __init at91sam9_common_init(void)
if (soc != NULL)
soc_dev = soc_device_to_device(soc);
 
-   of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev);
+   of_platform_default_populate(NULL, NULL, soc_dev);
 
arm_pm_idle = at91sam9_idle;
 }
diff --git a/arch/arm/mach-at91/sama5.c b/arch/arm/mach-at91/sama5.c
index d9cf679..6db395e 100644
--- a/arch/arm/mach-at91/sama5.c
+++ b/arch/arm/mach-at91/sama5.c
@@ -50,7 +50,7 @@ static void __init sama5_dt_device_init(void)
if (soc != NULL)
soc_dev = soc_device_to_device(soc);
 
-   of_platform_populate(NULL, of_default_bus_match_table, NULL, soc_dev);
+   of_platform_default_populate(NULL, NULL, soc_dev);
at91sam9x5_pm_init();
 }
 
diff --git a/arch/arm/mach-bcm/board_bcm21664.c 
b/arch/arm/mach-bcm/board_bcm21664.c
index 

Re: [v3,11/41] mips: reuse asm-generic/barrier.h

2016-01-26 Thread Peter Zijlstra
On Tue, Jan 26, 2016 at 02:33:40PM -0800, Linus Torvalds wrote:

> If it turns out that some architecture does actually need a barrier
> between a read and a dependent write, then that will mean that
> 
>  (a) we'll have to make up a _new_ barrier, because
> "smp_read_barrier_depends()" is not that barrier. We'll presumably
> then have to make that new barrier part of "rcu_derefence()" and
> friends.
> 
>  (b) we will have found an architecture with even worse memory
> ordering semantics than alpha, and we'll have to stop castigating
> alpha for being the worst memory ordering ever.
> 
> but I sincerely hope that we'll never find that kind of broken architecture.

So for a moment it looked like MIPS wanted to equal or surpass Alpha in
this respect.

And Paul made the point that smp_read_barrier_depends() really should
be smp_aquire_barrier_depends() in that we rely on both dependent reads
and writes to be ordered against the initial pointer load.

Now, as you've made abundantly clear, Alpha does this, although it needs
the little extra help in the dependent read department.

The 'problem' is that someone seemed to have used our
Documentation/memory-barriers.txt as a specification for what hardware
is permitted and we require. And in that light Paul noted that
read_barrier_depends really should be considered an
acquire_barrier_depends and order both dependent reads and writes
against the (prior) read (if nothing else already does).

Now clearly, any sane architecture doesn't need anything like this, but
again our document doesn't seem to judge. That is, from reading the
document one can get the impression is a perfectly fine thing to do.
Nowhere does our disdain for this thing show.



Re: [RFC PATCH] mm: support CONFIG_ZONE_DEVICE + CONFIG_ZONE_DMA

2016-01-26 Thread Mel Gorman
On Tue, Jan 26, 2016 at 05:37:38PM -0800, Dan Williams wrote:
> >> Will do, especially since other efforts are feeling the pinch on the
> >> MAX_NR_ZONES limitation.
> >
> > Please refer my previous attempt to add a new zone, ZONE_CMA.
> >
> > https://lkml.org/lkml/2015/2/12/84
> >
> > It salvages a bit from SECTION_WIDTH by increasing section size.
> > Similarly, I guess we can reduce NODE_WIDTH if needed although
> > it could cause to reduce maximum node size.
> 
> Dave pointed out to me that LAST__PID_SHIFT might be a better
> candidate to reduce to 7 bits.  That field is for storing pids which
> are already bigger than 8 bits.  If it is relying on the fact that
> pids don't rollover very often then likely the impact of 7-bits
> instead of 8 will be minimal.

It's not relying on the fact pids don't roll over very often. The
information is used by automatic NUMA balancing to detect if multiple
accesses to data are from the same task or not. Reducing the number of
bits it uses increases the chance that two tasks will both think they are
the data owner and keep migrating it.

-- 
Mel Gorman
SUSE Labs


Re: [PATCH v2 04/10] crypto/compress: add asynchronous compression support

2016-01-26 Thread Herbert Xu
On Tue, Jan 26, 2016 at 05:15:06PM +0900, Joonsoo Kim wrote:
> From: Weigang Li 
> 
> Now, asynchronous compression APIs are supported. There is no asynchronous
> compression driver now but this APIs can be used as front-end to
> synchronous compression algorithm. In this case, scatterlist would be
> linearlized when needed so it would cause some overhead.
> 
> Signed-off-by: Weigang Li 
> Signed-off-by: Joonsoo Kim 

I think we should be able to use this for the synchronous case
too, like we do with skcipher and ahash.

The main difference that I can see right now is that acomp always
allocates a context through the request object while scomp does not.

This difference is entirely artificial as we could also make the
context conditional for acomp.

The reason we had the shash/ahash division is because the shash
interface offers a direct pointer interface while ahash is SG-based.
Otherwise ahash is just as able as shash to handle synchronous
requests.

At this point in time I don't see such a fundamental distinction
between acomp and scomp.

Cheers,
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


How you tested this patch(8c7f010)

2016-01-26 Thread Zhizhou Tian
hi, Karam:
   I back ported "zram: implement rw_page operation of zram"(8c7f010)
to linux3.10 on Spreadtrum tshark board.
   I test this patch with following code:
 mm/page_io.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/mm/page_io.c b/mm/page_io.c
index 4e1c1c8..1556fc4 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -232,6 +232,7 @@ bad_bmap:
 int swap_writepage(struct page *page, struct writeback_control *wbc)
 {
int ret = 0;
+   ktime_t stime, etime;

if (try_to_free_swap(page)) {
unlock_page(page);
@@ -243,7 +244,12 @@ int swap_writepage(struct page *page, struct
writeback_control *wbc)
end_page_writeback(page);
goto out;
}
+   stime = ktime_get();
ret = __swap_writepage(page, wbc, end_swap_bio_write);
+   etime = ktime_get();
+
+   pr_err("zhizhou.tian: execute swap time with page_io : %lld nsec.\n",
+   etime.tv64 - stime.tv64);
 out:
return ret;
 }

But I am not sure the result means something.
Can you share your method?
thanks;)


Re: [PATCH 3/3] thermal: allow u8500-thermal driver to be a module

2016-01-26 Thread Lee Jones
On Mon, 25 Jan 2016, Arnd Bergmann wrote:

> When the thermal subsystem is a loadable module, the u8500 driver
> fails to build:
> 
> drivers/thermal/built-in.o: In function `db8500_thermal_probe':
> db8500_thermal.c:(.text+0x96c): undefined reference to 
> `thermal_zone_device_register'
> drivers/thermal/built-in.o: In function `db8500_thermal_work':
> db8500_thermal.c:(.text+0xab4): undefined reference to 
> `thermal_zone_device_update'
> 
> This changes the symbol to a tristate, so Kconfig can track the
> dependency correctly.
> 
> Signed-off-by: Arnd Bergmann 
> ---
>  drivers/mfd/db8500-prcmu.c | 3 +++
>  drivers/thermal/Kconfig| 4 ++--
>  2 files changed, 5 insertions(+), 2 deletions(-)

As this touches a core Thermal file, I think it's better off going in
via that tree.  If that's a problem, I can take it with the relevant
Acks.

Acked-by: Lee Jones 

> diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
> index 2f4a1279b094..c0a86aeb1733 100644
> --- a/drivers/mfd/db8500-prcmu.c
> +++ b/drivers/mfd/db8500-prcmu.c
> @@ -2045,6 +2045,7 @@ int db8500_prcmu_config_hotmon(u8 low, u8 high)
>  
>   return 0;
>  }
> +EXPORT_SYMBOL_GPL(db8500_prcmu_config_hotmon);
>  
>  static int config_hot_period(u16 val)
>  {
> @@ -2071,11 +2072,13 @@ int db8500_prcmu_start_temp_sense(u16 cycles32k)
>  
>   return config_hot_period(cycles32k);
>  }
> +EXPORT_SYMBOL_GPL(db8500_prcmu_start_temp_sense);
>  
>  int db8500_prcmu_stop_temp_sense(void)
>  {
>   return config_hot_period(0x);
>  }
> +EXPORT_SYMBOL_GPL(db8500_prcmu_stop_temp_sense);
>  
>  static int prcmu_a9wdog(u8 cmd, u8 d0, u8 d1, u8 d2, u8 d3)
>  {
> diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
> index 0852fd028dc9..7c92c09be213 100644
> --- a/drivers/thermal/Kconfig
> +++ b/drivers/thermal/Kconfig
> @@ -237,8 +237,8 @@ config DOVE_THERMAL
> framework.
>  
>  config DB8500_THERMAL
> - bool "DB8500 thermal management"
> - depends on ARCH_U8500
> + tristate "DB8500 thermal management"
> + depends on MFD_DB8500_PRCMU
>   default y
>   help
> Adds DB8500 thermal management implementation according to the thermal

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


RE: [PATCH v8 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC MFD driver

2016-01-26 Thread Yang, Wenyou
Hi Lee,

> -Original Message-
> From: Lee Jones [mailto:lee.jo...@linaro.org]
> Sent: 2016年1月27日 15:28
> To: Yang, Wenyou 
> Cc: Rob Herring ; Pawel Moll ;
> Mark Rutland ; Ian Campbell
> ; Kumar Gala ; Javier
> Martinez Canillas ; Krzysztof Kozlowski
> ; Peter Korsgaard ; Ferre,
> Nicolas ; linux-arm-ker...@lists.infradead.org;
> linux-kernel@vger.kernel.org; devicet...@vger.kernel.org
> Subject: Re: [PATCH v8 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC
> MFD driver
> 
> On Wed, 27 Jan 2016, Wenyou Yang wrote:
> 
> > This patch adds support for the Active-semi ACT8945A PMIC.
> > It is a Multi Function Device with the following subdevices:
> >  - Regulator
> >  - Charger
> >
> > It is interfaced to the host controller using I2C interface, ACT8945A
> > is a child device of the I2C.
> >
> > Signed-off-by: Wenyou Yang 
> > Reviewed-by: Krzysztof Kozlowski 
> 
> Can I take the MFD patches in separately?

Yes, you can, I think.

> 
> For my own reference:
>   Acked-by: Lee Jones 

Thank you for your Acked.

> 
> > ---
> >
> > Changes in v8:
> >  - change the subdevice's name "act8945a-pmic" to "act8945a-regulator".
> >
> > Changes in v7:
> >  - remove struct act8945a_dev to .c file.
> >  - remove unused .h file.
> >
> > Changes in v6:
> >  - change MFD_ACT8945A type from bool to tristate.
> >  - revert depends on to 'I2C'.
> >
> > Changes in v5:
> >  - change depends on to 'I2C=y'.
> >
> > Changes in v4:
> >  - add a space before .compatible.
> >  - collect Reviewed-by from Krzysztof Kozlowski.
> >
> > Changes in v3: None
> > Changes in v2:
> >  - add more help information in Kconfig.
> >  - update the file header with short version license and author line.
> >  - remove unused structure members (dev, i2c_client) of stuct act8945a_dev.
> >  - use define "PLATFORM_DEVID_NONE" for mfd_add_devices(), instead of '-1'.
> >  - use more explicit info to indicate the failure to add sub devices.
> >  - remove the unnecessary print out.
> >  - substitute MODULE_LICENSE("GPL") for MODULE_LICENSE("GPL v2").
> >
> >  drivers/mfd/Kconfig|   11 +
> >  drivers/mfd/Makefile   |1 +
> >  drivers/mfd/act8945a.c |  112
> > 
> >  3 files changed, 124 insertions(+)
> >  create mode 100644 drivers/mfd/act8945a.c
> >
> > diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index
> > 6c4ebd9..38994bb 100644
> > --- a/drivers/mfd/Kconfig
> > +++ b/drivers/mfd/Kconfig
> > @@ -18,6 +18,17 @@ config MFD_CS5535
> >   This is the core driver for CS5535/CS5536 MFD functions.  This is
> >necessary for using the board's GPIO and MFGPT functionality.
> >
> > +config MFD_ACT8945A
> > +   tristate "Active-semi ACT8945A"
> > +   select MFD_CORE
> > +   select REGMAP_I2C
> > +   depends on I2C && OF
> > +   help
> > + Support for the ACT8945A PMIC from Active-semi. This device
> > + features three step-down DC/DC converters and four low-dropout
> > + linear regulators, along with a complete ActivePath battery
> > + charger.
> > +
> >  config MFD_AS3711
> > bool "AMS AS3711"
> > select MFD_CORE
> > diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index
> > 0f230a6..2f1ca82 100644
> > --- a/drivers/mfd/Makefile
> > +++ b/drivers/mfd/Makefile
> > @@ -6,6 +6,7 @@
> >  obj-$(CONFIG_MFD_88PM860X) += 88pm860x.o
> >  obj-$(CONFIG_MFD_88PM800)  += 88pm800.o 88pm80x.o
> >  obj-$(CONFIG_MFD_88PM805)  += 88pm805.o 88pm80x.o
> > +obj-$(CONFIG_MFD_ACT8945A) += act8945a.o
> >  obj-$(CONFIG_MFD_SM501)+= sm501.o
> >  obj-$(CONFIG_MFD_ASIC3)+= asic3.o tmio_core.o
> >  obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o
> > diff --git a/drivers/mfd/act8945a.c b/drivers/mfd/act8945a.c new file
> > mode 100644 index 000..3a37611
> > --- /dev/null
> > +++ b/drivers/mfd/act8945a.c
> > @@ -0,0 +1,112 @@
> > +/*
> > + * MFD driver for Active-semi ACT8945a PMIC
> > + *
> > + * Copyright (C) 2015 Atmel Corporation.
> > + *
> > + * Author: Wenyou Yang 
> > + *
> > + * This program is free software; you can redistribute it and/or
> > +modify it
> > + * under  the terms of the GNU General  Public License as published
> > +by the
> > + * Free Software Foundation;  either version 2 of the License, or (at
> > +your
> > + * option) any later version.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +struct act8945a_dev {
> > +   struct regmap *regmap;
> > +};
> > +
> > +static const struct mfd_cell act8945a_devs[] = {
> > +   {
> > +   .name = "act8945a-regulator",
> > +   .of_compatible = "active-semi,act8945a-regulator",
> > +   },
> > +   {
> > +   .name = "act8945a-charger",
> > +   .of_compatible = "active-semi,act8945a-charger",
> > +   },
> > +};
> > +
> > +static const struct regmap_config act8945a_regmap_config = {
> > +   .reg_bits = 8,
> > +   .val_bits = 8,
> > +};
> > +
> > +static int act8945a_i2c_probe(struct i2c_client *i2c,
> > +  

Re: [PATCH v5 0/7] remoteproc: Add driver for STMicroelectronics platforms

2016-01-26 Thread Lee Jones
Apologies for ping (I hate doing that), but I haven't heard anything
from you.  Do you want me to re-submit this set, or are you willing to
take this and apply the relevant Acks?

> ST's platforms often have multiple co-processors (usually ST40s or ST231s)
> on-board.  This provides the Linux-side infrastructure to flash and boot
> them successfully.
>   
> This set has been tested on an STiH410-B2120.
> 
> v4 => v5:
>  - Check for invalid 'count' (command read length) in write fn()s
>   
> v3 => v4:
>  Suggested-by: Suman Anna 
>  - Move to using 'reserved-memory' API
>- New 'reserved-memory' nodes
>- Remove memory locations from RemoteProc's DT node's reg properties
>- Remove C code obtaining/allocating DMA memory
>  - Re-order .start() and .stop() ops
>  - Add protection around Reset API in error path
>  - Explicitly set .has_iommu to false
>   
> v2 => v3:
>  - Generify syscon property (st,syscfg-boot => st,syscfg)
>  - Rename IP in DT bindings doc (Remote Processor => Co-Processor)
>  - Remove superfluous 'clock-names' property
>  - Remove superfluous 'reg-names' property
>  - Populate MAINTAINERS
>  - Clean-up DTS formatting
>  - Use strings in debugfs to control procs ('1|0' => 'start|stop')
>  - Align copyright statement with MODULE() macros
>  - Rename driver data structure ('st_rproc' => 'ddata')
>  - Addition of a full error path in .start()
> 
> v1 => v2:
>  - Remove Linux implementation specific comment from binding document
>  - Force debugfs '0' to shutdown co-processor - rather than !1
>  - Supply more detailed commit message
>  - Propagate errors back from .stop()
>  - Review GPL wording
>  - Supply original author's SoBs
> 
> Lee Jones (7):
>   remoteproc: debugfs: Check of invalid 'count' value
>   remoteproc: dt: Provide bindings for ST's Remote Processor Controller
> driver
>   remoteproc: debugfs: Add ability to boot remote processor using
> debugfs
>   remoteproc: Supply controller driver for ST's Remote Processors
>   MAINTAINERS: Add ST's Remote Processor Driver to ARM/STI ARCHITECTURE
>   ARM: STiH407: Add nodes for RemoteProc
>   ARM: STiH407: Move over to using the 'reserved-memory' API for
> obtaining DMA memory
> 
>  .../devicetree/bindings/remoteproc/st-rproc.txt|  41 +++
>  MAINTAINERS|   1 +
>  arch/arm/boot/dts/stih407-family.dtsi  |  70 +
>  drivers/remoteproc/Kconfig |   9 +
>  drivers/remoteproc/Makefile|   1 +
>  drivers/remoteproc/remoteproc_debugfs.c|  38 ++-
>  drivers/remoteproc/st_remoteproc.c | 297 
> +
>  7 files changed, 455 insertions(+), 2 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/remoteproc/st-rproc.txt
>  create mode 100644 drivers/remoteproc/st_remoteproc.c
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


[RESEND][PATCH] PM / Domains: Fix typo in comment

2016-01-26 Thread Moritz Fischer
Acked-by: Kevin Hilman 
Signed-off-by: Moritz Fischer 
---
 drivers/base/power/domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 167418e..f23c036 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -160,7 +160,7 @@ static int genpd_power_off(struct generic_pm_domain *genpd, 
bool timed)
 
 /**
  * genpd_queue_power_off_work - Queue up the execution of genpd_poweroff().
- * @genpd: PM domait to power off.
+ * @genpd: PM domain to power off.
  *
  * Queue up the execution of genpd_poweroff() unless it's already been done
  * before.
-- 
2.7.0



Re: [PATCH v6 3/3] gpio: tps65086: Add GPO driver for the TPS65086 PMIC

2016-01-26 Thread Lee Jones
On Tue, 26 Jan 2016, Andrew F. Davis wrote:

> On 01/26/2016 08:03 AM, Lee Jones wrote:
> >On Mon, 25 Jan 2016, Andrew F. Davis wrote:
> >
> >>Add support for the TPS65086 PMIC GPOs.
> >>
> >>TPS65086 has four configurable GPOs that can be used for several
> >>purposes. These are output only.
> >>
> >>Signed-off-by: Andrew F. Davis 
> >>---
> >>  drivers/gpio/Kconfig |   6 ++
> >>  drivers/gpio/Makefile|   1 +
> >>  drivers/gpio/gpio-tps65086.c | 144 
> >> +++
> >>  3 files changed, 151 insertions(+)
> >>  create mode 100644 drivers/gpio/gpio-tps65086.c
> >
> >Is this patch orthogonal to the other two in the set, or do they all
> >need to go in together?
> 
> These can all go in separately, in fact Mark has already taken the regulator
> component from a previous push of this series. It is only the TPS65912
> driver I'm pushing that will need to go all at once due to conflicts with
> the driver it is replacing.

Very well.  MFD patches taken.

Linus should take this through his tree.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


Re: [PATCH v6 2/3] mfd: tps65086: Add driver for the TPS65086 PMIC

2016-01-26 Thread Lee Jones
On Mon, 25 Jan 2016, Andrew F. Davis wrote:

> Add support for the TPS65912 device. It provides communication
> through I2C and contains the following components:
> 
>  - Regulators
>  - Load switches
>  - GPO controller
> 
> Signed-off-by: Andrew F. Davis 
> Acked-by: Lee Jones 
> ---
>  drivers/mfd/Kconfig  |  13 
>  drivers/mfd/Makefile |   1 +
>  drivers/mfd/tps65086.c   | 149 
> +++
>  include/linux/mfd/tps65086.h | 117 +
>  4 files changed, 280 insertions(+)
>  create mode 100644 drivers/mfd/tps65086.c
>  create mode 100644 include/linux/mfd/tps65086.h

Applied, thanks.

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 9ca66de..fe6d62b 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -1106,6 +1106,19 @@ config TPS6507X
> This driver can also be built as a module.  If so, the module
> will be called tps6507x.
>  
> +config MFD_TPS65086
> + tristate "TI TPS65086 Power Management Integrated Chips (PMICs)"
> + select REGMAP
> + select REGMAP_IRQ
> + select REGMAP_I2C
> + depends on I2C
> + help
> +   If you say yes here you get support for the TPS65086 series of
> +   Power Management chips.
> +   This driver provides common support for accessing the device,
> +   additional drivers must be enabled in order to use the
> +   functionality of the device.
> +
>  config TPS65911_COMPARATOR
>   tristate
>  
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 0f230a6..06801aa 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -70,6 +70,7 @@ obj-$(CONFIG_MFD_WM8994)+= wm8994.o
>  obj-$(CONFIG_TPS6105X)   += tps6105x.o
>  obj-$(CONFIG_TPS65010)   += tps65010.o
>  obj-$(CONFIG_TPS6507X)   += tps6507x.o
> +obj-$(CONFIG_MFD_TPS65086)   += tps65086.o
>  obj-$(CONFIG_MFD_TPS65217)   += tps65217.o
>  obj-$(CONFIG_MFD_TPS65218)   += tps65218.o
>  obj-$(CONFIG_MFD_TPS65910)   += tps65910.o
> diff --git a/drivers/mfd/tps65086.c b/drivers/mfd/tps65086.c
> new file mode 100644
> index 000..43119a6
> --- /dev/null
> +++ b/drivers/mfd/tps65086.c
> @@ -0,0 +1,149 @@
> +/*
> + * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
> + *   Andrew F. Davis 
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + * This program is distributed "as is" WITHOUT ANY WARRANTY of any
> + * kind, whether expressed or implied; without even the implied warranty
> + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License version 2 for more details.
> + *
> + * Based on the TPS65912 driver
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +static const struct mfd_cell tps65086_cells[] = {
> + { .name = "tps65086-regulator", },
> + { .name = "tps65086-gpio", },
> +};
> +
> +static const struct regmap_range tps65086_yes_ranges[] = {
> + regmap_reg_range(TPS65086_IRQ, TPS65086_IRQ),
> + regmap_reg_range(TPS65086_PMICSTAT, TPS65086_SHUTDNSRC),
> + regmap_reg_range(TPS65086_GPOCTRL, TPS65086_GPOCTRL),
> + regmap_reg_range(TPS65086_PG_STATUS1, TPS65086_OC_STATUS),
> +};
> +
> +static const struct regmap_access_table tps65086_volatile_table = {
> + .yes_ranges = tps65086_yes_ranges,
> + .n_yes_ranges = ARRAY_SIZE(tps65086_yes_ranges),
> +};
> +
> +static const struct regmap_config tps65086_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> + .cache_type = REGCACHE_RBTREE,
> + .volatile_table = _volatile_table,
> +};
> +
> +static const struct regmap_irq tps65086_irqs[] = {
> + REGMAP_IRQ_REG(TPS65086_IRQ_DIETEMP, 0, TPS65086_IRQ_DIETEMP_MASK),
> + REGMAP_IRQ_REG(TPS65086_IRQ_SHUTDN, 0, TPS65086_IRQ_SHUTDN_MASK),
> + REGMAP_IRQ_REG(TPS65086_IRQ_FAULT, 0, TPS65086_IRQ_FAULT_MASK),
> +};
> +
> +static struct regmap_irq_chip tps65086_irq_chip = {
> + .name = "tps65086",
> + .status_base = TPS65086_IRQ,
> + .mask_base = TPS65086_IRQ_MASK,
> + .ack_base = TPS65086_IRQ,
> + .init_ack_masked = true,
> + .num_regs = 1,
> + .irqs = tps65086_irqs,
> + .num_irqs = ARRAY_SIZE(tps65086_irqs),
> +};
> +
> +static const struct of_device_id tps65086_of_match_table[] = {
> + { .compatible = "ti,tps65086", },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, tps65086_of_match_table);
> +
> +static int tps65086_probe(struct i2c_client *client,
> +   const struct i2c_device_id *ids)
> +{
> + struct tps65086 *tps;
> + unsigned int version;
> + int ret;
> +
> + tps = devm_kzalloc(>dev, sizeof(*tps), GFP_KERNEL);
> + if (!tps)
> + return -ENOMEM;
> +
> + i2c_set_clientdata(client, tps);

Re: [PATCH v6 1/3] Documentation: tps65086: Add DT bindings for the TPS65086 PMIC

2016-01-26 Thread Lee Jones
On Mon, 25 Jan 2016, Andrew F. Davis wrote:

> The TPS65086 PMIC contains several regulators and a GPO controller.
> Add bindings for the TPS65086 PMIC.
> 
> Signed-off-by: Andrew F. Davis 
> Acked-by: Rob Herring 
> ---
>  Documentation/devicetree/bindings/mfd/tps65086.txt | 55 
> ++
>  1 file changed, 55 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/tps65086.txt

Applied, thanks.

> diff --git a/Documentation/devicetree/bindings/mfd/tps65086.txt 
> b/Documentation/devicetree/bindings/mfd/tps65086.txt
> new file mode 100644
> index 000..d370561
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/tps65086.txt
> @@ -0,0 +1,55 @@
> +* TPS65086 Power Management Integrated Circuit (PMIC) bindings
> +
> +Required properties:
> + - compatible: Should be "ti,tps65086".
> + - reg   : I2C slave address.
> + - interrupt-parent  : Phandle to the parent interrupt controller.
> + - interrupts: The interrupt line the device is connected to.
> + - interrupt-controller  : Marks the device node as an interrupt 
> controller.
> + - #interrupt-cells  : The number of cells to describe an IRQ, should be 2.
> + The first cell is the IRQ number.
> + The second cell is the flags, encoded as trigger
> + masks from ../interrupt-controller/interrupts.txt.
> + - gpio-controller  : Marks the device node as a GPIO Controller.
> + - #gpio-cells  : Should be two.  The first cell is the pin number 
> and
> +the second cell is used to specify flags.
> +See ../gpio/gpio.txt for more information.
> + - regulators:  : List of child nodes that specify the regulator
> +initialization data. Child nodes must be named
> +after their hardware counterparts: buck[1-6],
> +ldoa[1-3], swa1, swb[1-2], and vtt. Each child
> +node is defined using the standard binding for
> +regulators and the optional regulator properties
> +defined below.
> +
> +Optional regulator properties:
> + - ti,regulator-step-size-25mv   : This is applicable for buck[1,2,6], 
> set this
> + if the regulator is factory set with a 25mv
> + step voltage mapping.
> + - ti,regulator-decay: This is applicable for buck[1-6], set 
> this if
> + the output needs to decay, default is for
> + the output to slew down.
> +
> +Example:
> +
> + pmic: tps65086@5e {
> + compatible = "ti,tps65086";
> + reg = <0x5e>;
> + interrupt-parent = <>;
> + interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> + gpio-controller;
> + #gpio-cells = <2>;
> +
> + regulators {
> + buck1 {
> + regulator-name = "vcc1";
> + regulator-min-microvolt = <160>;
> + regulator-max-microvolt = <160>;
> + regulator-boot-on;
> + ti,regulator-decay;
> + ti,regulator-step-size-25mv;
> + };
> + };
> + };

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


Re: [PATCH v8 1/2] mfd: act8945a: add Active-semi ACT8945A PMIC MFD driver

2016-01-26 Thread Lee Jones
On Wed, 27 Jan 2016, Wenyou Yang wrote:

> This patch adds support for the Active-semi ACT8945A PMIC.
> It is a Multi Function Device with the following subdevices:
>  - Regulator
>  - Charger
> 
> It is interfaced to the host controller using I2C interface,
> ACT8945A is a child device of the I2C.
> 
> Signed-off-by: Wenyou Yang 
> Reviewed-by: Krzysztof Kozlowski 

Can I take the MFD patches in separately?

For my own reference:
  Acked-by: Lee Jones 

> ---
> 
> Changes in v8:
>  - change the subdevice's name "act8945a-pmic" to "act8945a-regulator".
> 
> Changes in v7:
>  - remove struct act8945a_dev to .c file.
>  - remove unused .h file.
> 
> Changes in v6:
>  - change MFD_ACT8945A type from bool to tristate.
>  - revert depends on to 'I2C'.
> 
> Changes in v5:
>  - change depends on to 'I2C=y'.
> 
> Changes in v4:
>  - add a space before .compatible.
>  - collect Reviewed-by from Krzysztof Kozlowski.
> 
> Changes in v3: None
> Changes in v2:
>  - add more help information in Kconfig.
>  - update the file header with short version license and author line.
>  - remove unused structure members (dev, i2c_client) of stuct act8945a_dev.
>  - use define "PLATFORM_DEVID_NONE" for mfd_add_devices(), instead of '-1'.
>  - use more explicit info to indicate the failure to add sub devices.
>  - remove the unnecessary print out.
>  - substitute MODULE_LICENSE("GPL") for MODULE_LICENSE("GPL v2").
> 
>  drivers/mfd/Kconfig|   11 +
>  drivers/mfd/Makefile   |1 +
>  drivers/mfd/act8945a.c |  112 
> 
>  3 files changed, 124 insertions(+)
>  create mode 100644 drivers/mfd/act8945a.c
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 6c4ebd9..38994bb 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -18,6 +18,17 @@ config MFD_CS5535
> This is the core driver for CS5535/CS5536 MFD functions.  This is
>necessary for using the board's GPIO and MFGPT functionality.
>  
> +config MFD_ACT8945A
> + tristate "Active-semi ACT8945A"
> + select MFD_CORE
> + select REGMAP_I2C
> + depends on I2C && OF
> + help
> +   Support for the ACT8945A PMIC from Active-semi. This device
> +   features three step-down DC/DC converters and four low-dropout
> +   linear regulators, along with a complete ActivePath battery
> +   charger.
> +
>  config MFD_AS3711
>   bool "AMS AS3711"
>   select MFD_CORE
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 0f230a6..2f1ca82 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -6,6 +6,7 @@
>  obj-$(CONFIG_MFD_88PM860X)   += 88pm860x.o
>  obj-$(CONFIG_MFD_88PM800)+= 88pm800.o 88pm80x.o
>  obj-$(CONFIG_MFD_88PM805)+= 88pm805.o 88pm80x.o
> +obj-$(CONFIG_MFD_ACT8945A)   += act8945a.o
>  obj-$(CONFIG_MFD_SM501)  += sm501.o
>  obj-$(CONFIG_MFD_ASIC3)  += asic3.o tmio_core.o
>  obj-$(CONFIG_MFD_BCM590XX)   += bcm590xx.o
> diff --git a/drivers/mfd/act8945a.c b/drivers/mfd/act8945a.c
> new file mode 100644
> index 000..3a37611
> --- /dev/null
> +++ b/drivers/mfd/act8945a.c
> @@ -0,0 +1,112 @@
> +/*
> + * MFD driver for Active-semi ACT8945a PMIC
> + *
> + * Copyright (C) 2015 Atmel Corporation.
> + *
> + * Author: Wenyou Yang 
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under  the terms of the GNU General  Public License as published by the
> + * Free Software Foundation;  either version 2 of the License, or (at your
> + * option) any later version.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +struct act8945a_dev {
> + struct regmap *regmap;
> +};
> +
> +static const struct mfd_cell act8945a_devs[] = {
> + {
> + .name = "act8945a-regulator",
> + .of_compatible = "active-semi,act8945a-regulator",
> + },
> + {
> + .name = "act8945a-charger",
> + .of_compatible = "active-semi,act8945a-charger",
> + },
> +};
> +
> +static const struct regmap_config act8945a_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> +};
> +
> +static int act8945a_i2c_probe(struct i2c_client *i2c,
> +   const struct i2c_device_id *id)
> +{
> + struct act8945a_dev *act8945a;
> + int ret;
> +
> + act8945a = devm_kzalloc(>dev, sizeof(*act8945a), GFP_KERNEL);
> + if (!act8945a)
> + return -ENOMEM;
> +
> + i2c_set_clientdata(i2c, act8945a);
> +
> + act8945a->regmap = devm_regmap_init_i2c(i2c, _regmap_config);
> + if (IS_ERR(act8945a->regmap)) {
> + ret = PTR_ERR(act8945a->regmap);
> + dev_err(>dev, "regmap init failed: %d\n", ret);
> + return ret;
> + }
> +
> + ret = mfd_add_devices(>dev, PLATFORM_DEVID_NONE, act8945a_devs,
> +   ARRAY_SIZE(act8945a_devs), NULL, 0, NULL);
> + if (ret) {
> + dev_err(>dev, "Failed to 

[PATCH] clk: Move vendor's Kconfig into CCF menu section

2016-01-26 Thread James Liao
Move all vendor's Kconfig into CCF menu section to prevent
new drivers putting their Kconfig files in a wrong place.

Signed-off-by: James Liao 
---
 drivers/clk/Kconfig | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index eca8e01..de707b2 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -202,11 +202,9 @@ config COMMON_CLK_CDCE706
 
 source "drivers/clk/bcm/Kconfig"
 source "drivers/clk/hisilicon/Kconfig"
-source "drivers/clk/qcom/Kconfig"
-
-endmenu
-
 source "drivers/clk/mvebu/Kconfig"
-
+source "drivers/clk/qcom/Kconfig"
 source "drivers/clk/samsung/Kconfig"
 source "drivers/clk/tegra/Kconfig"
+
+endmenu
-- 
1.9.1



Re: [PATCH V4 1/5] DT: mfd: add device-tree binding doc fro PMIC max77620/max20024

2016-01-26 Thread Lee Jones
On Tue, 26 Jan 2016, Laxman Dewangan wrote:

> 
> On Tuesday 26 January 2016 08:28 PM, Lee Jones wrote:
> >On Mon, 25 Jan 2016, Laxman Dewangan wrote:
> >
> >>Hmm. I describe the boolean and tristate only. Do I need to define
> >>type for integer,string also?
> >I wouldn't describe any of them.  It's normally pretty obvious which
> >properties are boolean by the lack of required cell description.
> >
> 
> Rob suggested to use the type also for Boolean and tristate. I think
> it is good to have for all places that what type of values are
> valid.

It's fine, and some people do describe them.  I've just never seen the
point, especially if you have a nice example of their use in the
document.  But if you insist, please ensure you are consistent, so
*all* bools need to be described.  That is not currently the case.

> +The property for fps child nodes as:
> +Required properties:
> + -reg: FPS number like 0, 1, 2 for FPS0, FPS1 and FPS2 respectively.
> >>>I'm surprised Rob Acked this.  We don't usually do device numbers in DT.
> >>What is best way to make the child node for FPS and differentiate FPS0,1, 2?
> >>What is your suggestion here?
> >There are lots of ways you can solve this and so many examples of
> >others doing so.  I suggest you have a look at some DTS files and
> >figure it out.  One possible solution is to use different compatible
> >strings.
> Here, I think I can go similar to regulators where child node name
> identifies the regulators.
> 
> fps-config {
> fps0 {
> maxim,fps-time-period-us = <1280>;
> maxim,fps-enable-input = ;
> };
> 
> fps1 {
> maxim,fps-time-period-us = <2560>;
> maxim,fps-enable-input = ;
> };
> 
> fps2 {
> maxim,fps-time-period-us = <640>;
> maxim,fps-enable-input = ;
> };
> };
> 
> So node name gives the FPS name.

That is also an acceptable means to solve the issue.

As I said, there are many ways to skin a cat.

> >>>+Pinmux and GPIO:
> >>>+===
> >>>I think this whole section needs moving to ../pinctrl and needs to be
> >>>reviewed by Linus W.
> >>Is this mean I need to create DT binding doc for the each subsystem
> >>differently?
> >>Actually during AS3722, I had different understanding to have single file.
> >Yes, that way you have each of the the subsystem experts review your
> >documentation.  You can then link to them from this document.
> OK, I will add different dt binding doc in respective driver and
> squash that with respected submodule drivers.
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


[PATCH] kexec: Add compound_order/compound_dtor to VMCOREINFO

2016-01-26 Thread Atsushi Kumagai
makedumpfile refers to page.lru.next to get the order of compound pages
for page filtering. However, now the order is stored in page.compound_order,
hence VMCOREINFO should be updated to export the offset of page.compound_order.

The fact is, page.compound_order was introduced already in kernel 4.0,
but the offset of it was the same as page.lru.next until kernel 4.3,
so this was not actual problem.

The above can be said also for page.lru.prev, it contained the address of
destructor for compound pages but it was moved to page.compound_dtor.
It's necessary to detect hugetlbfs pages. Further, the content of
page.compound_dtor was changed from direct address of destructor to the
ID of it.

Signed-off-by: Atsushi Kumagai 
---
 kernel/kexec_core.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 11b64a6..8c7a6e8 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -1388,6 +1388,8 @@ static int __init crash_save_vmcoreinfo_init(void)
VMCOREINFO_OFFSET(page, lru);
VMCOREINFO_OFFSET(page, _mapcount);
VMCOREINFO_OFFSET(page, private);
+   VMCOREINFO_OFFSET(page, compound_dtor);
+   VMCOREINFO_OFFSET(page, compound_order);
VMCOREINFO_OFFSET(pglist_data, node_zones);
VMCOREINFO_OFFSET(pglist_data, nr_zones);
 #ifdef CONFIG_FLAT_NODE_MEM_MAP
@@ -1420,8 +1422,8 @@ static int __init crash_save_vmcoreinfo_init(void)
 #ifdef CONFIG_X86
VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE);
 #endif
-#ifdef CONFIG_HUGETLBFS
-   VMCOREINFO_SYMBOL(free_huge_page);
+#ifdef CONFIG_HUGETLB_PAGE
+   VMCOREINFO_NUMBER(HUGETLB_PAGE_DTOR);
 #endif
 
arch_crash_save_vmcoreinfo();
-- 
1.9.0


[PATCH v5 2/6] dt-bindings: ARM: Mediatek: Document bindings for MT2701

2016-01-26 Thread James Liao
This patch adds the binding documentation for apmixedsys, bdpsys,
ethsys, hifsys, imgsys, infracfg, mmsys, pericfg, topckgen and
vdecsys for Mediatek MT2701.

Signed-off-by: James Liao 
Tested-by: John Crispin 
---
 .../bindings/arm/mediatek/mediatek,apmixedsys.txt  |  1 +
 .../bindings/arm/mediatek/mediatek,bdpsys.txt  | 22 ++
 .../bindings/arm/mediatek/mediatek,ethsys.txt  | 22 ++
 .../bindings/arm/mediatek/mediatek,hifsys.txt  | 22 ++
 .../bindings/arm/mediatek/mediatek,imgsys.txt  |  1 +
 .../bindings/arm/mediatek/mediatek,infracfg.txt|  1 +
 .../bindings/arm/mediatek/mediatek,mmsys.txt   |  1 +
 .../bindings/arm/mediatek/mediatek,pericfg.txt |  1 +
 .../bindings/arm/mediatek/mediatek,topckgen.txt|  1 +
 .../bindings/arm/mediatek/mediatek,vdecsys.txt |  1 +
 10 files changed, 73 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,bdpsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt

diff --git 
a/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt
index 936166f..a701e19 100644
--- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt
@@ -6,6 +6,7 @@ The Mediatek apmixedsys controller provides the PLLs to the 
system.
 Required Properties:
 
 - compatible: Should be:
+   - "mediatek,mt2701-apmixedsys"
- "mediatek,mt8135-apmixedsys"
- "mediatek,mt8173-apmixedsys"
 - #clock-cells: Must be 1
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,bdpsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,bdpsys.txt
new file mode 100644
index 000..4137196
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,bdpsys.txt
@@ -0,0 +1,22 @@
+Mediatek bdpsys controller
+
+
+The Mediatek bdpsys controller provides various clocks to the system.
+
+Required Properties:
+
+- compatible: Should be:
+   - "mediatek,mt2701-bdpsys", "syscon"
+- #clock-cells: Must be 1
+
+The bdpsys controller uses the common clk binding from
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+The available clocks are defined in dt-bindings/clock/mt*-clk.h.
+
+Example:
+
+bdpsys: clock-controller@1c00 {
+   compatible = "mediatek,mt2701-bdpsys", "syscon";
+   reg = <0 0x1c00 0 0x1000>;
+   #clock-cells = <1>;
+};
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt
new file mode 100644
index 000..768f3a5
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt
@@ -0,0 +1,22 @@
+Mediatek ethsys controller
+
+
+The Mediatek ethsys controller provides various clocks to the system.
+
+Required Properties:
+
+- compatible: Should be:
+   - "mediatek,mt2701-ethsys", "syscon"
+- #clock-cells: Must be 1
+
+The ethsys controller uses the common clk binding from
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+The available clocks are defined in dt-bindings/clock/mt*-clk.h.
+
+Example:
+
+ethsys: clock-controller@1b00 {
+   compatible = "mediatek,mt2701-ethsys", "syscon";
+   reg = <0 0x1b00 0 0x1000>;
+   #clock-cells = <1>;
+};
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt
new file mode 100644
index 000..b7a39b6
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt
@@ -0,0 +1,22 @@
+Mediatek hifsys controller
+
+
+The Mediatek hifsys controller provides various clocks to the system.
+
+Required Properties:
+
+- compatible: Should be:
+   - "mediatek,mt2701-hifsys", "syscon"
+- #clock-cells: Must be 1
+
+The hifsys controller uses the common clk binding from
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+The available clocks are defined in dt-bindings/clock/mt*-clk.h.
+
+Example:
+
+hifsys: clock-controller@1a00 {
+   compatible = "mediatek,mt2701-hifsys", "syscon";
+   reg = <0 0x1a00 0 0x1000>;
+   #clock-cells = <1>;
+};
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt
index b1f2ce1..9bda7f7 100644
--- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt
@@ -6,6 +6,7 @@ The Mediatek imgsys controller provides various clocks to the 
system.
 Required Properties:
 
 - compatible: Should 

[PATCH v5 1/6] clk: mediatek: Refine the makefile to support multiple clock drivers

2016-01-26 Thread James Liao
Add a Kconfig to define clock configuration for each SoC, and
modify the Makefile to build drivers that only selected in config.

Signed-off-by: Shunli Wang 
Signed-off-by: James Liao 
Tested-by: John Crispin 
---
 drivers/clk/Kconfig   |  1 +
 drivers/clk/mediatek/Kconfig  | 23 +++
 drivers/clk/mediatek/Makefile |  6 +++---
 3 files changed, 27 insertions(+), 3 deletions(-)
 create mode 100644 drivers/clk/mediatek/Kconfig

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index eca8e01..57cfcae7 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -202,6 +202,7 @@ config COMMON_CLK_CDCE706
 
 source "drivers/clk/bcm/Kconfig"
 source "drivers/clk/hisilicon/Kconfig"
+source "drivers/clk/mediatek/Kconfig"
 source "drivers/clk/qcom/Kconfig"
 
 endmenu
diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
new file mode 100644
index 000..dc224e6
--- /dev/null
+++ b/drivers/clk/mediatek/Kconfig
@@ -0,0 +1,23 @@
+#
+# MediaTek SoC drivers
+#
+config COMMON_CLK_MEDIATEK
+   bool
+   ---help---
+ Mediatek SoCs' clock support.
+
+config COMMON_CLK_MT8135
+   bool "Clock driver for Mediatek MT8135"
+   depends on COMMON_CLK
+   select COMMON_CLK_MEDIATEK
+   default ARCH_MEDIATEK
+   ---help---
+ This driver supports Mediatek MT8135 clocks.
+
+config COMMON_CLK_MT8173
+   bool "Clock driver for Mediatek MT8173"
+   depends on COMMON_CLK
+   select COMMON_CLK_MEDIATEK
+   default ARCH_MEDIATEK
+   ---help---
+ This driver supports Mediatek MT8173 clocks.
diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile
index 95fdfac..32e7222 100644
--- a/drivers/clk/mediatek/Makefile
+++ b/drivers/clk/mediatek/Makefile
@@ -1,4 +1,4 @@
-obj-y += clk-mtk.o clk-pll.o clk-gate.o clk-apmixed.o
+obj-$(CONFIG_COMMON_CLK_MEDIATEK) += clk-mtk.o clk-pll.o clk-gate.o 
clk-apmixed.o
 obj-$(CONFIG_RESET_CONTROLLER) += reset.o
-obj-y += clk-mt8135.o
-obj-y += clk-mt8173.o
+obj-$(CONFIG_COMMON_CLK_MT8135) += clk-mt8135.o
+obj-$(CONFIG_COMMON_CLK_MT8173) += clk-mt8173.o
-- 
1.9.1



[PATCH v5 5/6] reset: mediatek: Add MT2701 reset controller dt-binding file

2016-01-26 Thread James Liao
From: Shunli Wang 

Dt-binding file about reset controller is used to provide
kinds of definition, which is referenced by dts file and
IC-specified reset controller driver code.

Signed-off-by: Shunli Wang 
Signed-off-by: James Liao 
Tested-by: John Crispin 
---
 include/dt-bindings/reset/mt2701-resets.h | 83 +++
 1 file changed, 83 insertions(+)
 create mode 100644 include/dt-bindings/reset/mt2701-resets.h

diff --git a/include/dt-bindings/reset/mt2701-resets.h 
b/include/dt-bindings/reset/mt2701-resets.h
new file mode 100644
index 000..aaf0305
--- /dev/null
+++ b/include/dt-bindings/reset/mt2701-resets.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2015 MediaTek, Shunli Wang 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _DT_BINDINGS_RESET_CONTROLLER_MT2701
+#define _DT_BINDINGS_RESET_CONTROLLER_MT2701
+
+/* INFRACFG resets */
+#define MT2701_INFRA_EMI_REG_RST   0
+#define MT2701_INFRA_DRAMC0_A0_RST 1
+#define MT2701_INFRA_FHCTL_RST 2
+#define MT2701_INFRA_APCIRQ_EINT_RST   3
+#define MT2701_INFRA_APXGPT_RST4
+#define MT2701_INFRA_SCPSYS_RST5
+#define MT2701_INFRA_KP_RST6
+#define MT2701_INFRA_PMIC_WRAP_RST 7
+#define MT2701_INFRA_MIPI_RST  8
+#define MT2701_INFRA_IRRX_RST  9
+#define MT2701_INFRA_CEC_RST   10
+#define MT2701_INFRA_EMI_RST   32
+#define MT2701_INFRA_DRAMC0_RST34
+#define MT2701_INFRA_TRNG_RST  37
+#define MT2701_INFRA_SYSIRQ_RST38
+
+/*  PERICFG resets */
+#define MT2701_PERI_UART0_SW_RST   0
+#define MT2701_PERI_UART1_SW_RST   1
+#define MT2701_PERI_UART2_SW_RST   2
+#define MT2701_PERI_UART3_SW_RST   3
+#define MT2701_PERI_GCPU_SW_RST5
+#define MT2701_PERI_BTIF_SW_RST6
+#define MT2701_PERI_PWM_SW_RST 8
+#define MT2701_PERI_AUXADC_SW_RST  10
+#define MT2701_PERI_DMA_SW_RST 11
+#define MT2701_PERI_NFI_SW_RST 14
+#define MT2701_PERI_NLI_SW_RST 15
+#define MT2701_PERI_THERM_SW_RST   16
+#define MT2701_PERI_MSDC2_SW_RST   17
+#define MT2701_PERI_MSDC0_SW_RST   19
+#define MT2701_PERI_MSDC1_SW_RST   20
+#define MT2701_PERI_I2C0_SW_RST22
+#define MT2701_PERI_I2C1_SW_RST23
+#define MT2701_PERI_I2C2_SW_RST24
+#define MT2701_PERI_I2C3_SW_RST25
+#define MT2701_PERI_USB_SW_RST 28
+#define MT2701_PERI_ETH_SW_RST 29
+#define MT2701_PERI_SPI0_SW_RST33
+
+/* TOPRGU resets */
+#define MT2701_TOPRGU_INFRA_RST0
+#define MT2701_TOPRGU_MM_RST   1
+#define MT2701_TOPRGU_MFG_RST  2
+#define MT2701_TOPRGU_ETHDMA_RST   3
+#define MT2701_TOPRGU_VDEC_RST 4
+#define MT2701_TOPRGU_VENC_IMG_RST 5
+#define MT2701_TOPRGU_DDRPHY_RST   6
+#define MT2701_TOPRGU_MD_RST   7
+#define MT2701_TOPRGU_INFRA_AO_RST 8
+#define MT2701_TOPRGU_CONN_RST 9
+#define MT2701_TOPRGU_APMIXED_RST  10
+#define MT2701_TOPRGU_HIFSYS_RST   11
+#define MT2701_TOPRGU_CONN_MCU_RST 12
+#define MT2701_TOPRGU_BDP_DISP_RST 13
+
+/* HIFSYS resets */
+#define MT2701_HIFSYS_UHOST0_RST   3
+#define MT2701_HIFSYS_UHOST1_RST   4
+#define MT2701_HIFSYS_UPHY0_RST21
+#define MT2701_HIFSYS_UPHY1_RST22
+#define MT2701_HIFSYS_PCIE0_RST24
+#define MT2701_HIFSYS_PCIE1_RST25
+#define MT2701_HIFSYS_PCIE2_RST26
+
+#endif  /* _DT_BINDINGS_RESET_CONTROLLER_MT2701 */
-- 
1.9.1



[PATCH v5 0/6] Add clock support for Mediatek MT2701

2016-01-26 Thread James Liao
This series is based on 4.5-rc1, add clock and reset controller
support for Mediatek MT2701.

This series also refined makefile and Kconfig to support configurable
multiple SoC clock support.

changes since v4:
- Rebase to v4.5-rc1.
- Remove CLK_SET_RATE_PARENT from divider flags.
- Add img_jpgdec_smi clock.
- Move clk/mediatek/Kconfig into menu section in clk/Kconfig.

changes since v3:
- Change the parent of mm_mdp_bls_26m from clk26m to pwm_sel.

changes since v2:
- Fix ethsys definition.
- Replace read-modify-write with regmap_update_bits() in clock operations.
- Move mt2701-resets.h to include/dt-bindings/reset/.
- Add hifsys reset patch from John Crispin.

changes since v1:
- Document MT2701 compatible strings.

James Liao (2):
  clk: mediatek: Refine the makefile to support multiple clock drivers
  dt-bindings: ARM: Mediatek: Document bindings for MT2701

Shunli Wang (4):
  clk: mediatek: Add dt-bindings for MT2701 clocks
  clk: mediatek: Add MT2701 clock support
  reset: mediatek: Add MT2701 reset controller dt-binding file
  reset: mediatek: Add MT2701 reset driver

 .../bindings/arm/mediatek/mediatek,apmixedsys.txt  |1 +
 .../bindings/arm/mediatek/mediatek,bdpsys.txt  |   22 +
 .../bindings/arm/mediatek/mediatek,ethsys.txt  |   22 +
 .../bindings/arm/mediatek/mediatek,hifsys.txt  |   22 +
 .../bindings/arm/mediatek/mediatek,imgsys.txt  |1 +
 .../bindings/arm/mediatek/mediatek,infracfg.txt|1 +
 .../bindings/arm/mediatek/mediatek,mmsys.txt   |1 +
 .../bindings/arm/mediatek/mediatek,pericfg.txt |1 +
 .../bindings/arm/mediatek/mediatek,topckgen.txt|1 +
 .../bindings/arm/mediatek/mediatek,vdecsys.txt |1 +
 drivers/clk/Kconfig|1 +
 drivers/clk/mediatek/Kconfig   |   31 +
 drivers/clk/mediatek/Makefile  |7 +-
 drivers/clk/mediatek/clk-gate.c|   52 +
 drivers/clk/mediatek/clk-gate.h|2 +
 drivers/clk/mediatek/clk-mt2701.c  | 1217 
 drivers/clk/mediatek/clk-mtk.c |   25 +
 drivers/clk/mediatek/clk-mtk.h |   34 +-
 include/dt-bindings/clock/mt2701-clk.h |  482 
 include/dt-bindings/reset/mt2701-resets.h  |   83 ++
 20 files changed, 2001 insertions(+), 6 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,bdpsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt
 create mode 100644 drivers/clk/mediatek/Kconfig
 create mode 100644 drivers/clk/mediatek/clk-mt2701.c
 create mode 100644 include/dt-bindings/clock/mt2701-clk.h
 create mode 100644 include/dt-bindings/reset/mt2701-resets.h

--
1.9.1



[PATCH v5 4/6] clk: mediatek: Add MT2701 clock support

2016-01-26 Thread James Liao
From: Shunli Wang 

Add MT2701 clock support, include topckgen, apmixedsys,
infracfg, pericfg and subsystem clocks.

Signed-off-by: Shunli Wang 
Signed-off-by: James Liao 
Tested-by: John Crispin 
---
 drivers/clk/mediatek/Kconfig  |8 +
 drivers/clk/mediatek/Makefile |1 +
 drivers/clk/mediatek/clk-gate.c   |   52 ++
 drivers/clk/mediatek/clk-gate.h   |2 +
 drivers/clk/mediatek/clk-mt2701.c | 1211 +
 drivers/clk/mediatek/clk-mtk.c|   25 +
 drivers/clk/mediatek/clk-mtk.h|   34 +-
 7 files changed, 1330 insertions(+), 3 deletions(-)
 create mode 100644 drivers/clk/mediatek/clk-mt2701.c

diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
index dc224e6..1e56000 100644
--- a/drivers/clk/mediatek/Kconfig
+++ b/drivers/clk/mediatek/Kconfig
@@ -6,6 +6,14 @@ config COMMON_CLK_MEDIATEK
---help---
  Mediatek SoCs' clock support.
 
+config COMMON_CLK_MT2701
+   bool "Clock driver for Mediatek MT2701"
+   depends on COMMON_CLK
+   select COMMON_CLK_MEDIATEK
+   default ARCH_MEDIATEK
+   ---help---
+ This driver supports Mediatek MT2701 clocks.
+
 config COMMON_CLK_MT8135
bool "Clock driver for Mediatek MT8135"
depends on COMMON_CLK
diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile
index 32e7222..5b2b91b 100644
--- a/drivers/clk/mediatek/Makefile
+++ b/drivers/clk/mediatek/Makefile
@@ -1,4 +1,5 @@
 obj-$(CONFIG_COMMON_CLK_MEDIATEK) += clk-mtk.o clk-pll.o clk-gate.o 
clk-apmixed.o
 obj-$(CONFIG_RESET_CONTROLLER) += reset.o
+obj-$(CONFIG_COMMON_CLK_MT2701) += clk-mt2701.o
 obj-$(CONFIG_COMMON_CLK_MT8135) += clk-mt8135.o
 obj-$(CONFIG_COMMON_CLK_MT8173) += clk-mt8173.o
diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gate.c
index 576bdb7..6a68058 100644
--- a/drivers/clk/mediatek/clk-gate.c
+++ b/drivers/clk/mediatek/clk-gate.c
@@ -61,6 +61,22 @@ static void mtk_cg_clr_bit(struct clk_hw *hw)
regmap_write(cg->regmap, cg->clr_ofs, BIT(cg->bit));
 }
 
+static void mtk_cg_set_bit_no_setclr(struct clk_hw *hw)
+{
+   struct mtk_clk_gate *cg = to_clk_gate(hw);
+   u32 cgbit = BIT(cg->bit);
+
+   regmap_update_bits(cg->regmap, cg->sta_ofs, cgbit, cgbit);
+}
+
+static void mtk_cg_clr_bit_no_setclr(struct clk_hw *hw)
+{
+   struct mtk_clk_gate *cg = to_clk_gate(hw);
+   u32 cgbit = BIT(cg->bit);
+
+   regmap_update_bits(cg->regmap, cg->sta_ofs, cgbit, 0);
+}
+
 static int mtk_cg_enable(struct clk_hw *hw)
 {
mtk_cg_clr_bit(hw);
@@ -85,6 +101,30 @@ static void mtk_cg_disable_inv(struct clk_hw *hw)
mtk_cg_clr_bit(hw);
 }
 
+static int mtk_cg_enable_no_setclr(struct clk_hw *hw)
+{
+   mtk_cg_clr_bit_no_setclr(hw);
+
+   return 0;
+}
+
+static void mtk_cg_disable_no_setclr(struct clk_hw *hw)
+{
+   mtk_cg_set_bit_no_setclr(hw);
+}
+
+static int mtk_cg_enable_inv_no_setclr(struct clk_hw *hw)
+{
+   mtk_cg_set_bit_no_setclr(hw);
+
+   return 0;
+}
+
+static void mtk_cg_disable_inv_no_setclr(struct clk_hw *hw)
+{
+   mtk_cg_clr_bit_no_setclr(hw);
+}
+
 const struct clk_ops mtk_clk_gate_ops_setclr = {
.is_enabled = mtk_cg_bit_is_cleared,
.enable = mtk_cg_enable,
@@ -97,6 +137,18 @@ const struct clk_ops mtk_clk_gate_ops_setclr_inv = {
.disable= mtk_cg_disable_inv,
 };
 
+const struct clk_ops mtk_clk_gate_ops_no_setclr = {
+   .is_enabled = mtk_cg_bit_is_cleared,
+   .enable = mtk_cg_enable_no_setclr,
+   .disable= mtk_cg_disable_no_setclr,
+};
+
+const struct clk_ops mtk_clk_gate_ops_no_setclr_inv = {
+   .is_enabled = mtk_cg_bit_is_set,
+   .enable = mtk_cg_enable_inv_no_setclr,
+   .disable= mtk_cg_disable_inv_no_setclr,
+};
+
 struct clk * __init mtk_clk_register_gate(
const char *name,
const char *parent_name,
diff --git a/drivers/clk/mediatek/clk-gate.h b/drivers/clk/mediatek/clk-gate.h
index 11e25c9..7f7ef34 100644
--- a/drivers/clk/mediatek/clk-gate.h
+++ b/drivers/clk/mediatek/clk-gate.h
@@ -36,6 +36,8 @@ static inline struct mtk_clk_gate *to_clk_gate(struct clk_hw 
*hw)
 
 extern const struct clk_ops mtk_clk_gate_ops_setclr;
 extern const struct clk_ops mtk_clk_gate_ops_setclr_inv;
+extern const struct clk_ops mtk_clk_gate_ops_no_setclr;
+extern const struct clk_ops mtk_clk_gate_ops_no_setclr_inv;
 
 struct clk *mtk_clk_register_gate(
const char *name,
diff --git a/drivers/clk/mediatek/clk-mt2701.c 
b/drivers/clk/mediatek/clk-mt2701.c
new file mode 100644
index 000..0ac45fc
--- /dev/null
+++ b/drivers/clk/mediatek/clk-mt2701.c
@@ -0,0 +1,1211 @@
+/*
+ * Copyright (c) 2014 MediaTek Inc.
+ * Author: Shunli Wang 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This 

[PATCH v5 6/6] reset: mediatek: Add MT2701 reset driver

2016-01-26 Thread James Liao
From: Shunli Wang 

In infrasys and perifsys, there are many reset
control bits for kinds of modules. These bits are
used as actual reset controllers to be registered
into kernel's generic reset controller framework.

Signed-off-by: Shunli Wang 
Signed-off-by: James Liao 
Tested-by: John Crispin 
---
 drivers/clk/mediatek/clk-mt2701.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/clk/mediatek/clk-mt2701.c 
b/drivers/clk/mediatek/clk-mt2701.c
index 0ac45fc..01722e0 100644
--- a/drivers/clk/mediatek/clk-mt2701.c
+++ b/drivers/clk/mediatek/clk-mt2701.c
@@ -665,6 +665,8 @@ static void __init mtk_infrasys_init(struct device_node 
*node)
if (r)
pr_err("%s(): could not register clock provider: %d\n",
__func__, r);
+
+   mtk_register_reset_controller(node, 2, 0x30);
 }
 CLK_OF_DECLARE(mtk_infrasys, "mediatek,mt2701-infracfg", mtk_infrasys_init);
 
@@ -782,6 +784,8 @@ static void __init mtk_pericfg_init(struct device_node 
*node)
if (r)
pr_err("%s(): could not register clock provider: %d\n",
__func__, r);
+
+   mtk_register_reset_controller(node, 2, 0x0);
 }
 CLK_OF_DECLARE(mtk_pericfg, "mediatek,mt2701-pericfg", mtk_pericfg_init);
 
@@ -997,6 +1001,8 @@ static void __init mtk_hifsys_init(struct device_node 
*node)
if (r)
pr_err("%s(): could not register clock provider: %d\n",
__func__, r);
+
+   mtk_register_reset_controller(node, 1, 0x34);
 }
 CLK_OF_DECLARE(mtk_hifsys, "mediatek,mt2701-hifsys", mtk_hifsys_init);
 
-- 
1.9.1



[PATCH v5 3/6] clk: mediatek: Add dt-bindings for MT2701 clocks

2016-01-26 Thread James Liao
From: Shunli Wang 

Add MT2701 clock dt-bindings, include topckgen, apmixedsys,
infracfg, pericfg and subsystem clocks.

Signed-off-by: Shunli Wang 
Signed-off-by: James Liao 
Tested-by: John Crispin 
---
 include/dt-bindings/clock/mt2701-clk.h | 482 +
 1 file changed, 482 insertions(+)
 create mode 100644 include/dt-bindings/clock/mt2701-clk.h

diff --git a/include/dt-bindings/clock/mt2701-clk.h 
b/include/dt-bindings/clock/mt2701-clk.h
new file mode 100644
index 000..d9a97d8
--- /dev/null
+++ b/include/dt-bindings/clock/mt2701-clk.h
@@ -0,0 +1,482 @@
+/*
+ * Copyright (c) 2014 MediaTek Inc.
+ * Author: Shunli Wang 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef _DT_BINDINGS_CLK_MT2701_H
+#define _DT_BINDINGS_CLK_MT2701_H
+
+/* TOPCKGEN */
+#define CLK_TOP_SYSPLL 1
+#define CLK_TOP_SYSPLL_D2  2
+#define CLK_TOP_SYSPLL_D3  3
+#define CLK_TOP_SYSPLL_D5  4
+#define CLK_TOP_SYSPLL_D7  5
+#define CLK_TOP_SYSPLL1_D2 6
+#define CLK_TOP_SYSPLL1_D4 7
+#define CLK_TOP_SYSPLL1_D8 8
+#define CLK_TOP_SYSPLL1_D169
+#define CLK_TOP_SYSPLL2_D2 10
+#define CLK_TOP_SYSPLL2_D4 11
+#define CLK_TOP_SYSPLL2_D8 12
+#define CLK_TOP_SYSPLL3_D2 13
+#define CLK_TOP_SYSPLL3_D4 14
+#define CLK_TOP_SYSPLL4_D2 15
+#define CLK_TOP_SYSPLL4_D4 16
+#define CLK_TOP_UNIVPLL17
+#define CLK_TOP_UNIVPLL_D2 18
+#define CLK_TOP_UNIVPLL_D3 19
+#define CLK_TOP_UNIVPLL_D5 20
+#define CLK_TOP_UNIVPLL_D7 21
+#define CLK_TOP_UNIVPLL_D2622
+#define CLK_TOP_UNIVPLL_D5223
+#define CLK_TOP_UNIVPLL_D108   24
+#define CLK_TOP_USB_PHY48M 25
+#define CLK_TOP_UNIVPLL1_D226
+#define CLK_TOP_UNIVPLL1_D427
+#define CLK_TOP_UNIVPLL1_D828
+#define CLK_TOP_UNIVPLL2_D229
+#define CLK_TOP_UNIVPLL2_D430
+#define CLK_TOP_UNIVPLL2_D831
+#define CLK_TOP_UNIVPLL2_D16   32
+#define CLK_TOP_UNIVPLL2_D32   33
+#define CLK_TOP_UNIVPLL3_D234
+#define CLK_TOP_UNIVPLL3_D435
+#define CLK_TOP_UNIVPLL3_D836
+#define CLK_TOP_MSDCPLL37
+#define CLK_TOP_MSDCPLL_D2 38
+#define CLK_TOP_MSDCPLL_D4 39
+#define CLK_TOP_MSDCPLL_D8 40
+#define CLK_TOP_MMPLL  41
+#define CLK_TOP_MMPLL_D2   42
+#define CLK_TOP_DMPLL  43
+#define CLK_TOP_DMPLL_D2   44
+#define CLK_TOP_DMPLL_D4   45
+#define CLK_TOP_DMPLL_X2   46
+#define CLK_TOP_TVDPLL 47
+#define CLK_TOP_TVDPLL_D2  48
+#define CLK_TOP_TVDPLL_D4  49
+#define CLK_TOP_TVD2PLL50
+#define CLK_TOP_TVD2PLL_D2 51
+#define CLK_TOP_HADDS2PLL_98M  52
+#define CLK_TOP_HADDS2PLL_294M 53
+#define CLK_TOP_HADDS2_FB  54
+#define CLK_TOP_MIPIPLL_D2 55
+#define CLK_TOP_MIPIPLL_D4 56
+#define CLK_TOP_HDMIPLL57
+#define CLK_TOP_HDMIPLL_D2 58
+#define CLK_TOP_HDMIPLL_D3 59
+#define CLK_TOP_HDMI_SCL_RX60
+#define CLK_TOP_HDMI_0_PIX340M 61
+#define CLK_TOP_HDMI_0_DEEP340M62
+#define CLK_TOP_HDMI_0_PLL340M 63
+#define CLK_TOP_AUD1PLL_98M64
+#define CLK_TOP_AUD2PLL_90M65
+#define CLK_TOP_AUDPLL 66
+#define CLK_TOP_AUDPLL_D4  67
+#define CLK_TOP_AUDPLL_D8  68
+#define CLK_TOP_AUDPLL_D16 69
+#define CLK_TOP_AUDPLL_D24 70
+#define CLK_TOP_ETHPLL_500M71
+#define CLK_TOP_VDECPLL72
+#define CLK_TOP_VENCPLL73
+#define CLK_TOP_MIPIPLL 

Re: [RFC PATCH 10/21] mmc: sdhci: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin

On 2016/1/27 15:11, Haibo Chen wrote:



Hi Shawn,




[...]


@@ -1618,7 +1618,8 @@ static int sdhci_do_get_cd(struct sdhci_host *host)
return 0;

/* If nonremovable, assume that the card is always present. */
-   if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
+   if (host->mmc->caps & MMC_CAP_NONREMOVABLE ||
+   host->mmc->caps & MMC_CAP_NEEDS_POLL)
return 1;

/*
@@ -1628,10 +1629,6 @@ static int sdhci_do_get_cd(struct sdhci_host *host)
if (!IS_ERR_VALUE(gpio_cd))
return !!gpio_cd;

-   /* If polling, assume that the card is always present. */
-   if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
-   return 1;


Why simply  remove these code rather than use this:
If(host->mmc->caps & MMC_CAP_NEEDS_POLL)
Return 1;

According to the comment, if polling, need to return 1,
But if you just simply remove this code, it will read the sdhci register 
SDHCI_PRESENT_STATE


Hi Haibo

I have combine this check with "host->mmc->caps & MMC_CAP_NONREMOVABLE" 
above. :)


Thanks




Best Regards

Haibo Chen


-
/* Host native card detect */
return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) &
SDHCI_CARD_PRESENT);  } @@ -2658,7 +2655,7 @@ void
sdhci_enable_irq_wakeups(struct sdhci_host *host)
val = sdhci_readb(host, SDHCI_WAKE_UP_CONTROL);
val |= mask ;
/* Avoid fake wake up */
-   if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
+   if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
val &= ~(SDHCI_WAKE_ON_INSERT |
SDHCI_WAKE_ON_REMOVE);
sdhci_writeb(host, val, SDHCI_WAKE_UP_CONTROL);  } @@ -3112,8
+3109,7 @@ int sdhci_add_host(struct sdhci_host *host)
if (caps[0] & SDHCI_CAN_DO_HISPD)
mmc->caps |= MMC_CAP_SD_HIGHSPEED |
MMC_CAP_MMC_HIGHSPEED;

-   if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
-   !(mmc->caps & MMC_CAP_NONREMOVABLE) &&
+   if (!(mmc->caps & MMC_CAP_NONREMOVABLE) &&
IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc)))
mmc->caps |= MMC_CAP_NEEDS_POLL;

--
2.3.7


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html







--
Best Regards
Shawn Lin



Re: [PATCH v3 05/12] arm64, acpi, numa: NUMA support based on SRAT and SLIT

2016-01-26 Thread Hanjun Guo
On 2016/1/25 18:21, Robert Richter wrote:
> On 23.01.16 17:39:20, Hanjun Guo wrote:
>> diff --git a/arch/arm64/kernel/acpi_numa.c b/arch/arm64/kernel/acpi_numa.c
>> new file mode 100644
>> index 000..f7f7533
>> --- /dev/null
>> +++ b/arch/arm64/kernel/acpi_numa.c
>> +/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
>> +int __init acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
>> +{
>> +u64 start, end;
>> +int node, pxm;
>> +
>> +if (srat_disabled())
>> +return -EINVAL;
>> +
>> +if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
> Must be:
>
>   ma->header.length < sizeof(struct acpi_srat_mem_affinity)) {
>
> Allow extensions to struct acpi_srat_mem_affinity in newer versions.

Hmm, I think we need to remove the check here now.

There are three cases:

 - firmware ACPI version is consistent with the ACPICA one, then
   ma->header.length == sizeof(struct acpi_srat_mem_affinity )

 - firmware ACPI version is not consistent with the ACPICA one,
   for example, struct acpi_srat_mem_affinity is extended in
   new ACI version, but the formware is using the older one,
  then it's ok to use
  ma->header.length < sizeof(struct acpi_srat_mem_affinity )

 - but if we use the older kernel + updated new firmware,
   then
   ma->header.length > sizeof(struct acpi_srat_mem_affinity )
  will be the case, right?

>
>> +bad_srat();
>> +return -EINVAL;
> We need a pr_err() here to avoid that numa setup fails silently due to
> bad fw. This applies to all error paths.
>
> See my delta patch below. You can merge it with your patch.

Thanks! I wil merge it into next version.

Hanjun




RE: [RFC PATCH 10/21] mmc: sdhci: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Haibo Chen


Hi Shawn,


> -Original Message-
> From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc-
> ow...@vger.kernel.org] On Behalf Of Shawn Lin
> Sent: Wednesday, January 27, 2016 1:08 PM
> To: Ulf Hansson 
> Cc: bcm-kernel-feedback-l...@broadcom.com; linux-rpi-
> ker...@lists.infradead.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Shawn Lin 
> Subject: [RFC PATCH 10/21] mmc: sdhci: remove
> SDHCI_QUIRK_BROKEN_CARD_DETECTION
> 
> SDHCI_QUIRK_BROKEN_CARD_DETECTION is for "broken-cd".
> If we add MMC_CAP_NONREMOVABLE("non-removeble"), we shoud not add
> "broken-cd" together according to mmc.txt for dt-bingdings. Also, "broken-cd"
> can obtain from mmc_of_parse, which will add MMC_CAP_NEEDS_POLL into
> mmc->caps.
> 
> Signed-off-by: Shawn Lin 
> ---
> 
>  drivers/mmc/host/sdhci.c | 14 +-
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index
> d622435..b208cb7 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -145,7 +145,7 @@ static void sdhci_set_card_detection(struct sdhci_host
> *host, bool enable)  {
>   u32 present;
> 
> - if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
> + if ((host->mmc->caps & MMC_CAP_NEEDS_POLL) ||
>   (host->mmc->caps & MMC_CAP_NONREMOVABLE))
>   return;
> 
> @@ -1618,7 +1618,8 @@ static int sdhci_do_get_cd(struct sdhci_host *host)
>   return 0;
> 
>   /* If nonremovable, assume that the card is always present. */
> - if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
> + if (host->mmc->caps & MMC_CAP_NONREMOVABLE ||
> + host->mmc->caps & MMC_CAP_NEEDS_POLL)
>   return 1;
> 
>   /*
> @@ -1628,10 +1629,6 @@ static int sdhci_do_get_cd(struct sdhci_host *host)
>   if (!IS_ERR_VALUE(gpio_cd))
>   return !!gpio_cd;
> 
> - /* If polling, assume that the card is always present. */
> - if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
> - return 1;

Why simply  remove these code rather than use this:
If(host->mmc->caps & MMC_CAP_NEEDS_POLL)
   Return 1;

According to the comment, if polling, need to return 1,
But if you just simply remove this code, it will read the sdhci register 
SDHCI_PRESENT_STATE


Best Regards

Haibo Chen

> -
>   /* Host native card detect */
>   return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) &
> SDHCI_CARD_PRESENT);  } @@ -2658,7 +2655,7 @@ void
> sdhci_enable_irq_wakeups(struct sdhci_host *host)
>   val = sdhci_readb(host, SDHCI_WAKE_UP_CONTROL);
>   val |= mask ;
>   /* Avoid fake wake up */
> - if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
> + if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
>   val &= ~(SDHCI_WAKE_ON_INSERT |
> SDHCI_WAKE_ON_REMOVE);
>   sdhci_writeb(host, val, SDHCI_WAKE_UP_CONTROL);  } @@ -3112,8
> +3109,7 @@ int sdhci_add_host(struct sdhci_host *host)
>   if (caps[0] & SDHCI_CAN_DO_HISPD)
>   mmc->caps |= MMC_CAP_SD_HIGHSPEED |
> MMC_CAP_MMC_HIGHSPEED;
> 
> - if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
> - !(mmc->caps & MMC_CAP_NONREMOVABLE) &&
> + if (!(mmc->caps & MMC_CAP_NONREMOVABLE) &&
>   IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc)))
>   mmc->caps |= MMC_CAP_NEEDS_POLL;
> 
> --
> 2.3.7
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC PATCH 14/21] mmc: sdhci-esdhc-imx: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Haibo Chen
Hi Shawn, 

Comments below.



> -Original Message-
> From: Shawn Lin [mailto:shawn@rock-chips.com]
> Sent: Wednesday, January 27, 2016 1:09 PM
> To: Ulf Hansson 
> Cc: bcm-kernel-feedback-l...@broadcom.com; linux-rpi-
> ker...@lists.infradead.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Shawn Lin ; Dong
> Aisheng ; Haibo Chen
> 
> Subject: [RFC PATCH 14/21] mmc: sdhci-esdhc-imx: remove
> SDHCI_QUIRK_BROKEN_CARD_DETECTION
> 
> sdhci_esdhc_imx_pdata need SDHCI_QUIRK_BROKEN_CARD_DETECTION,
> so we replace it with MMC_CAP_NEEDS_POLL while probing. For other cases,
> we directly remove SDHCI_QUIRK_BROKEN_CARD_DETECTION.
> 
> Cc: Dong Aisheng 
> Cc: Haibo Chen 
> Signed-off-by: Shawn Lin 
> ---
> 
>  drivers/mmc/host/sdhci-esdhc-imx.c | 9 +
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-
> esdhc-imx.c
> index f25f292..5705be1 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -952,8 +952,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {  static const
> struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
>   .quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_HISPD_BIT
>   | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
> - | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC
> - | SDHCI_QUIRK_BROKEN_CARD_DETECTION,
> + | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC,
>   .ops = _esdhc_ops,
>  };
> 
> @@ -1012,7 +1011,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device
> *pdev,
>   return ret;
> 
>   if (!IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc)))
> - host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
> + host->mmc->caps &= MMC_CAP_NEEDS_POLL;

You miss ' ~', seems you need to change to:
host->mmc->caps &=~ MMC_CAP_NEEDS_POLL;

> 
>   return 0;
>  }
> @@ -1064,7 +1063,7 @@ static int sdhci_esdhc_imx_probe_nondt(struct
> platform_device *pdev,
> 
>   case ESDHC_CD_CONTROLLER:
>   /* we have a working card_detect back */
> - host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
> + host->mmc->caps &= MMC_CAP_NEEDS_POLL;

The same issue.

>   break;
> 
>   case ESDHC_CD_PERMANENT:
> @@ -1104,6 +1103,8 @@ static int sdhci_esdhc_imx_probe(struct
> platform_device *pdev)
>   if (IS_ERR(host))
>   return PTR_ERR(host);
> 
> + host->mmc->caps |= MMC_CAP_NEEDS_POLL;
> +
>   pltfm_host = sdhci_priv(host);
> 
>   imx_data = devm_kzalloc(>dev, sizeof(*imx_data),
> GFP_KERNEL);
> --
> 2.3.7
> 



Re: [PATCH] mm: fix pfn_t to page conversion in vm_insert_mixed

2016-01-26 Thread Tomi Valkeinen

On 26/01/16 20:37, Dan Williams wrote:
> pfn_t_to_page() honors the flags in the pfn_t value to determine if a
> pfn is backed by a page.  However, vm_insert_mixed() was originally
> written to use pfn_valid() to make this determination.  To restore the
> old/correct behavior, ignore the pfn_t flags in the !pfn_t_devmap() case
> and fallback to trusting pfn_valid().
> 
> Fixes: 01c8f1c44b83 ("mm, dax, gpu: convert vm_insert_mixed to pfn_t")

Thanks, this fixes the crash with omapdrm.

Tested-by: Tomi Valkeinen 

 Tomi



signature.asc
Description: OpenPGP digital signature


Re: [PATCH 01/15] arm: use of_platform_default_populate() to populate default bus

2016-01-26 Thread kbuild test robot
Hi Kefeng,

[auto build test ERROR on v4.5-rc1]
[cannot apply to arm-soc/for-next next-20160127]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/Kefeng-Wang/use-of_platform_default_populate-to-populate-default-bus/20160127-123512
config: arm-at91_dt_defconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   arch/arm/mach-at91/at91rm9200.c: In function 'at91rm9200_dt_device_init':
>> arch/arm/mach-at91/at91rm9200.c:34:2: error: implicit declaration of 
>> function 'of_platform__default_populate' 
>> [-Werror=implicit-function-declaration]
 of_platform__default_populate(NULL, NULL, soc_dev);
 ^
   cc1: some warnings being treated as errors

vim +/of_platform__default_populate +34 arch/arm/mach-at91/at91rm9200.c

28  struct device *soc_dev = NULL;
29  
30  soc = at91_soc_init(rm9200_socs);
31  if (soc != NULL)
32  soc_dev = soc_device_to_device(soc);
33  
  > 34  of_platform__default_populate(NULL, NULL, soc_dev);
35  
36  arm_pm_idle = at91rm9200_idle;
37  at91rm9200_pm_init();

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [RFC PATCH 14/21] mmc: sdhci-esdhc-imx: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin

On 2016/1/27 14:54, Haibo Chen wrote:

Hi Shawn,

Comments below.



[...]


return ret;

if (!IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc)))
-   host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   host->mmc->caps &= MMC_CAP_NEEDS_POLL;


You miss ' ~', seems you need to change to:
host->mmc->caps &=~ MMC_CAP_NEEDS_POLL;



Thanks for pointing out. I will fix this for the next version.



return 0;
  }
@@ -1064,7 +1063,7 @@ static int sdhci_esdhc_imx_probe_nondt(struct
platform_device *pdev,

case ESDHC_CD_CONTROLLER:
/* we have a working card_detect back */
-   host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   host->mmc->caps &= MMC_CAP_NEEDS_POLL;


The same issue.


break;

case ESDHC_CD_PERMANENT:
@@ -1104,6 +1103,8 @@ static int sdhci_esdhc_imx_probe(struct
platform_device *pdev)
if (IS_ERR(host))
return PTR_ERR(host);

+   host->mmc->caps |= MMC_CAP_NEEDS_POLL;
+
pltfm_host = sdhci_priv(host);

imx_data = devm_kzalloc(>dev, sizeof(*imx_data),
GFP_KERNEL);
--
2.3.7









--
Best Regards
Shawn Lin



[PATCH] rtc: max77686: Cleanup and reduce dmesg output

2016-01-26 Thread Krzysztof Kozlowski
Cleanup of entire driver of its dmesg output:
1. Remove printing of the function name, because printing device name is
   sufficient. This also makes the dev_err()-like functions more compact
   and readable (not need of line break).
2. Lower from info to debug printing of each RTC interrupt (no need to
   make noise on each alarm).
3. Remove dev_info() at beginning of probe because a message is already
   always printed by either probe failure or from registering the RTC
   device as /dev/rtcX.

Signed-off-by: Krzysztof Kozlowski 

---

Patch rebased on top of Javier's v4:
[PATCH v4 00/10] rtc: max77686: Extend driver and add max77802 support
http://www.spinics.net/lists/arm-kernel/msg477194.html

Feel free to join with these series.
---
 drivers/rtc/rtc-max77686.c | 39 ++-
 1 file changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c
index da47b1d85793..5a03e1ecad83 100644
--- a/drivers/rtc/rtc-max77686.c
+++ b/drivers/rtc/rtc-max77686.c
@@ -271,8 +271,8 @@ static int max77686_rtc_update(struct max77686_rtc_info 
*info,
 info->drv_data->map[REG_RTC_UPDATE0],
 data, data);
if (ret < 0)
-   dev_err(info->dev, "%s: fail to write update reg(ret=%d, 
data=0x%x)\n",
-   __func__, ret, data);
+   dev_err(info->dev, "Fail to write update reg(ret=%d, 
data=0x%x)\n",
+   ret, data);
else {
/* Minimum delay required before RTC update. */
usleep_range(delay, delay * 2);
@@ -297,7 +297,7 @@ static int max77686_rtc_read_time(struct device *dev, 
struct rtc_time *tm)
   info->drv_data->map[REG_RTC_SEC],
   data, ARRAY_SIZE(data));
if (ret < 0) {
-   dev_err(info->dev, "%s: fail to read time reg(%d)\n", __func__, 
ret);
+   dev_err(info->dev, "Fail to read time reg(%d)\n", ret);
goto out;
}
 
@@ -326,8 +326,7 @@ static int max77686_rtc_set_time(struct device *dev, struct 
rtc_time *tm)
info->drv_data->map[REG_RTC_SEC],
data, ARRAY_SIZE(data));
if (ret < 0) {
-   dev_err(info->dev, "%s: fail to write time reg(%d)\n", __func__,
-   ret);
+   dev_err(info->dev, "Fail to write time reg(%d)\n", ret);
goto out;
}
 
@@ -355,8 +354,7 @@ static int max77686_rtc_read_alarm(struct device *dev, 
struct rtc_wkalrm *alrm)
ret = regmap_bulk_read(info->max77686->rtc_regmap,
   map[REG_ALARM1_SEC], data, ARRAY_SIZE(data));
if (ret < 0) {
-   dev_err(info->dev, "%s:%d fail to read alarm reg(%d)\n",
-   __func__, __LINE__, ret);
+   dev_err(info->dev, "Fail to read alarm reg(%d)\n", ret);
goto out;
}
 
@@ -394,8 +392,7 @@ static int max77686_rtc_read_alarm(struct device *dev, 
struct rtc_wkalrm *alrm)
alrm->pending = 0;
ret = regmap_read(info->max77686->regmap, MAX77686_REG_STATUS2, );
if (ret < 0) {
-   dev_err(info->dev, "%s:%d fail to read status2 reg(%d)\n",
-   __func__, __LINE__, ret);
+   dev_err(info->dev, "Fail to read status2 reg(%d)\n", ret);
goto out;
}
 
@@ -426,8 +423,7 @@ static int max77686_rtc_stop_alarm(struct max77686_rtc_info 
*info)
   map[REG_ALARM1_SEC], data,
   ARRAY_SIZE(data));
if (ret < 0) {
-   dev_err(info->dev, "%s: fail to read alarm reg(%d)\n",
-   __func__, ret);
+   dev_err(info->dev, "Fail to read alarm reg(%d)\n", ret);
goto out;
}
 
@@ -452,8 +448,7 @@ static int max77686_rtc_stop_alarm(struct max77686_rtc_info 
*info)
}
 
if (ret < 0) {
-   dev_err(info->dev, "%s: fail to write alarm reg(%d)\n",
-   __func__, ret);
+   dev_err(info->dev, "Fail to write alarm reg(%d)\n", ret);
goto out;
}
 
@@ -481,8 +476,7 @@ static int max77686_rtc_start_alarm(struct 
max77686_rtc_info *info)
   map[REG_ALARM1_SEC], data,
   ARRAY_SIZE(data));
if (ret < 0) {
-   dev_err(info->dev, "%s: fail to read alarm reg(%d)\n",
-   __func__, ret);
+   dev_err(info->dev, "Fail to read alarm reg(%d)\n", ret);
goto out;
}
 
@@ -508,8 +502,7 @@ static int max77686_rtc_start_alarm(struct 
max77686_rtc_info *info)

Re: [RFC] hwmon: (fam15h_power) Add bit masking for tdp_limit

2016-01-26 Thread Huang Rui
On Tue, Jan 26, 2016 at 11:57:35AM +0100, Gi-Oh Kim wrote:
> 
> 
> On 26.01.2016 03:25, Huang Rui wrote:
> >On Mon, Jan 25, 2016 at 07:41:07PM +0800, Gioh Kim wrote:

> Thanks for your reply.
> I'm not completely sure that the reserved bits are always zero.
> Are they always zero?
> Or do we need bit-masking like following?
> 

Reserved bits aren't always zero. But here they are reserved for
ApmTdpLimit expansion.

Yes, we would better add bit-masking here. :-)

> -- 8< -
> Subject: [PATCH] hwmon: (fam15h_power) Add bit masking for tdp_limit
> 
> Add bit masking to read ApmTdpLimit precisely
> 
> Signed-off-by: Gioh Kim 
> ---
>  drivers/hwmon/fam15h_power.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c
> index f77eb97..edbcf6c 100644
> --- a/drivers/hwmon/fam15h_power.c
> +++ b/drivers/hwmon/fam15h_power.c
> @@ -90,7 +90,11 @@ static ssize_t show_power(struct device *dev,
>  pci_bus_read_config_dword(f4->bus, PCI_DEVFN(PCI_SLOT(f4->devfn), 5),
>REG_TDP_LIMIT3, );
> 
> -tdp_limit = val >> 16;
> +if (boot_cpu_data.x86_model >= 0x60)
> +tdp_limit = val >> 16;

You need add CPU family check and a comment to mention bit field
change. This updates since family 15h and model 60h.

if (boot_cpu_data.x86 == 0x15 && boot_cpu_data.x86_model >= 0x60)

Thanks,
Rui


Re: [LKP] [lkp] [kallsyms] 06862f34f6: BUG: unable to handle kernel NULL pointer dereference at (null)

2016-01-26 Thread Ard Biesheuvel
On 27 January 2016 at 01:45, Huang, Ying  wrote:
> Ard Biesheuvel  writes:
>
>> On 22 January 2016 at 03:20, kernel test robot
>>  wrote:
>>> FYI, we noticed the below changes on
>>>
>>> https://git.linaro.org/people/ard.biesheuvel/linux-arm 
>>> kallsyms-text-relative
>>> commit 06862f34f614bb6ff6a9fc9c4b0d849e2ee2018d ("kallsyms: add
>>> support for relative offsets in kallsyms address table")
>>>
>>>
>>> +---+++
>>> |   | 30f05309bd | 
>>> 06862f34f6 |
>>> +---+++
>>> | boot_successes| 0  | 
>>> 0  |
>>> | boot_failures | 6  | 
>>> 8  |
>>> | Kernel_panic-not_syncing:Attempted_to_kill_init!exitcode= | 4  |  
>>>   |
>>> | BUG:kernel_test_oversize  | 2  |  
>>>   |
>>> | BUG:unable_to_handle_kernel   | 0  | 
>>> 8  |
>>> +---+++
>>>
>>>
>>>
>>> [0.568228] Last level iTLB entries: 4KB 0, 2MB 0, 4MB 0
>>> [0.568971] Last level dTLB entries: 4KB 0, 2MB 0, 4MB 0, 1GB 0
>>> [0.569835] CPU: Intel Xeon E312xx (Sandy Bridge) (family: 0x6, model: 
>>> 0x2a, stepping: 0x1)
>>> [0.598441] BUG: unable to handle kernel NULL pointer dereference at 
>>>   (null)
>>> [0.599646] IP:
>>> [0.599884] BUG: unable to handle kernel NULL pointer dereference at 
>>>   (null)
>>> [0.610184] IP:
>>> Elapsed time: 10
>>> qemu-system-x86_64 -enable-kvm -cpu SandyBridge -kernel
>>> /pkg/linux/x86_64-randconfig-s4-01220217/gcc-5/06862f34f614bb6ff6a9fc9c4b0d849e2ee2018d/vmlinuz-4.4.0-10063-g06862f34
>>> -append 'root=/dev/ram0 user=lkp
>>> job=/lkp/scheduled/vm-kbuild-yocto-x86_64-62/bisect_boot-1-yocto-minimal-x86_64.cgz-x86_64-randconfig-s4-01220217-06862f34f614bb6ff6a9fc9c4b0d849e2ee2018d-20160122-39812-uowsx2-0.yaml
>>> ARCH=x86_64 kconfig=x86_64-randconfig-s4-01220217
>>> branch=linux-devel/devel-spot-201601220143
>>> commit=06862f34f614bb6ff6a9fc9c4b0d849e2ee2018d
>>> BOOT_IMAGE=/pkg/linux/x86_64-randconfig-s4-01220217/gcc-5/06862f34f614bb6ff6a9fc9c4b0d849e2ee2018d/vmlinuz-4.4.0-10063-g06862f34
>>> max_uptime=600
>>> RESULT_ROOT=/result/boot/1/vm-kbuild-yocto-x86_64/yocto-minimal-x86_64.cgz/x86_64-randconfig-s4-01220217/gcc-5/06862f34f614bb6ff6a9fc9c4b0d849e2ee2018d/0
>>> LKP_SERVER=inn earlyprintk=ttyS0,115200 systemd.log_level=err debug
>>> apic=debug sysrq_always_enabled rcupdate.rcu_cpu_stall_timeout=100
>>> panic=-1 softlockup_panic=1 nmi
>>  _watchdog=panic oops=panic load_ramdisk=2 prompt_ramdisk=0
>> console=ttyS0,115200 console=tty0 vga=normal rw
>> ip=vm-kbuild-yocto-x86_64-62::dhcp drbd.minor_count=8' -initrd
>> /fs/sdg1/initrd-vm-kbuild-yocto-x86_64-62 -m 320 -smp 1 -device
>> e1000,netdev=net0 -netdev user,id=net0 -boot order=nc -no-reboot
>> -watchdog i6300esb -rtc base=localtime -drive
>> file=/fs/sdg1/disk0-vm-kbuild-yocto-x86_64-62,media=disk,if=virtio
>> -pidfile /dev/shm/kboot/pid-vm-kbuild-yocto-x86_64-62 -serial
>> file:/dev/shm/kboot/serial-vm-kbuild-yocto-x86_64-62 -daemonize
>> -display none -monitor null
>>>
>>
>> Hello Ying,
>>
>> Thanks for the report. Is this a clean build?
>
> It's not clean build.
>
>> I cannot reproduce the
>> issue with the attached config. Do you have the vmlinux file available
>> for inspection?
>
> Sorry, we have no vmlinux file available.
>
> BTW, we use gcc-5 to compile kernel.  Do you use gcc-5 or gcc-4?
>

Thank you Ying

The problem has already been found and fixed: it had to do with the
fact that this is a x86_64 non-SMP build.

Thanks,
Ard.


Re: [PATCH RESEND] cpufreq: Use list_is_last() to check last entry of the policy list

2016-01-26 Thread Viresh Kumar
On 27-01-16, 12:02, Gautham R. Shenoy wrote:
> Currently next_policy() explicitly checks if a policy is the last
> policy in the cpufreq_policy_list. Use the standard list_is_last
> primitive instead.
> 
> Cc: Viresh Kumar 
> Signed-off-by: Gautham R. Shenoy 
> ---
> The earlier version one was based on an Juri's experimental branch. 
> I have based this one on linux-pm.git linux-next branch.
> 
>  drivers/cpufreq/cpufreq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index c35e7da..e979ec7 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -48,11 +48,11 @@ static struct cpufreq_policy *next_policy(struct 
> cpufreq_policy *policy,
> bool active)
>  {
>   do {
> - policy = list_next_entry(policy, policy_list);
> -
>   /* No more policies in the list */
> - if (>policy_list == _policy_list)
> + if (list_is_last(>policy_list, _policy_list))
>   return NULL;
> +
> + policy = list_next_entry(policy, policy_list);
>   } while (!suitable_policy(policy, active));
>  
>   return policy;

Acked-by: Viresh Kumar 

-- 
viresh


[PATCH RESEND] cpufreq: Use list_is_last() to check last entry of the policy list

2016-01-26 Thread Gautham R. Shenoy
Currently next_policy() explicitly checks if a policy is the last
policy in the cpufreq_policy_list. Use the standard list_is_last
primitive instead.

Cc: Viresh Kumar 
Signed-off-by: Gautham R. Shenoy 
---
The earlier version one was based on an Juri's experimental branch. 
I have based this one on linux-pm.git linux-next branch.

 drivers/cpufreq/cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index c35e7da..e979ec7 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -48,11 +48,11 @@ static struct cpufreq_policy *next_policy(struct 
cpufreq_policy *policy,
  bool active)
 {
do {
-   policy = list_next_entry(policy, policy_list);
-
/* No more policies in the list */
-   if (>policy_list == _policy_list)
+   if (list_is_last(>policy_list, _policy_list))
return NULL;
+
+   policy = list_next_entry(policy, policy_list);
} while (!suitable_policy(policy, active));
 
return policy;
-- 
1.9.3



Re: [ANNOUNCE] 2015-Q4 release of KVMGT (Was Re: KVMGT - the implementation of ...)

2016-01-26 Thread Jike Song
Hi all,

We are pleased to announce another update of Intel GVT-g for KVM.

Intel GVT-g for KVM (a.k.a. KVMGT) is a full GPU virtualization solution with 
mediated pass-through, starting from 4th generation Intel Core(TM) processors 
with Intel Graphics processors.  A virtual GPU instance is maintained for each 
VM, with part of performance critical resources directly assigned. The 
capability of running native graphics driver inside a VM, without hypervisor 
intervention in performance critical paths, achieves a good balance among 
performance, feature, and sharing capability.

Repositories:

Kernel: https://github.com/01org/igvtg-kernel (2015q4-4.2.0 branch)
Qemu: https://github.com/01org/igvtg-qemu (kvmgt_public2015q4 branch)

This update consists of:

- KVMGT now has better support for 5th generation (Broadwell) Intel 
Core(TM) processors, 2D/3D/Media workloads can be run simultaneously in 
multiple guests.
- Host Linux kernel has been upgraded from 3.18.0 to 4.2.0 (based on 
drm-intel)

Next update will be around early April, 2016.

Known issues:

- At least 2GB memory is suggested for VM to run most 3D workloads.
- Using VLC to play .ogg file may cause mosaic or slow response.
- Running heavy 3D workloads in multiple guests for couple of hours may 
cause stability issue.

Official iGVT-g portal: https://01.org/igvt-g
Please subscribe the mailing list: https://lists.01.org/mailman/listinfo/igvt-g

More information about background, architecture and others about Intel GVT-g, 
can be found at:

http://www.linux-kvm.org/images/f/f3/01x08b-KVMGT-a.pdf

https://www.usenix.org/conference/atc14/technical-sessions/presentation/tian


Note: The KVMGT project should be considered a work in progress. As such it is 
not a complete product nor should it be considered one. Extra care should be 
taken when testing and configuring a system to use the KVMGT project.


--
Thanks,
Jike

On 10/27/2015 05:36 PM, Jike Song wrote:
> Hi all,
> 
> We are pleased to announce another update of Intel GVT-g for KVM.
> 
> Intel GVT-g is a full GPU virtualization solution with mediated pass-through, 
> starting from 4th generation Intel Core(TM) processors with Intel Graphics 
> processors. A virtual GPU instance is maintained for each VM, with part of 
> performance critical resources directly assigned. The capability of running 
> native graphics driver inside a VM, without hypervisor intervention in 
> performance critical paths, achieves a good balance among performance, 
> feature, and sharing capability. KVM is supported by Intel GVT-g(a.k.a. 
> KVMGT).
> 
> 
> Repositories
> 
>  Kernel: https://github.com/01org/igvtg-kernel (2015q3-3.18.0 branch)
>  Qemu: https://github.com/01org/igvtg-qemu (kvmgt_public2015q3 branch)
> 
> 
> This update consists of:
> 
>  - KVMGT is now merged with XenGT in unified repositories(kernel and 
> qemu), but currently
>different branches for qemu.  KVMGT and XenGT share same iGVT-g core 
> logic.
>  - PPGTT supported, hence the Windows guest support
>  - KVMGT now supports both 4th generation (Haswell) and 5th generation 
> (Broadwell) Intel Core(TM) processors
>  - 2D/3D/Media decoding have been validated on Ubuntu 14.04 and 
> Windows7/Windows 8.1
> 
> Next update will be around early Jan, 2016.
> 
> Known issues:
> 
>  - At least 2GB memory is suggested for VM to run most 3D workloads.
>  - 3Dmark06 running in Windows VM may have some stability issue.
>  - Using VLC to play .ogg file may cause mosaic or slow response.
> 
> 
> Please subscribe the mailing list to report BUGs, discuss, and/or contribute:
> 
>  https://lists.01.org/mailman/listinfo/igvt-g
> 
> More information about Intel GVT-g background, architecture, etc can be found 
> at(may not be up-to-date):
> 
>  https://01.org/igvt-g
>  http://www.linux-kvm.org/images/f/f3/01x08b-KVMGT-a.pdf
>  
> https://www.usenix.org/conference/atc14/technical-sessions/presentation/tian
> 
> 
> Note:
> 
> The KVMGT project should be considered a work in progress. As such it is not 
> a complete product nor should it be considered one. Extra care should be 
> taken when testing and configuring a system to use the KVMGT project.
> 
> 
> --
> Thanks,
> Jike
> 
> On 12/04/2014 10:24 AM, Jike Song wrote:
>> Hi all,
>>
>>We are pleased to announce the first release of KVMGT project. KVMGT is 
>> the implementation of Intel GVT-g technology, a full GPU virtualization 
>> solution. Under Intel GVT-g, a virtual GPU instance is maintained for each 
>> VM, with part of performance critical resources directly assigned. The 
>> capability of running native graphics driver inside a VM, without hypervisor 
>> intervention in performance critical paths, achieves a good balance of 
>> performance, feature, and sharing capability.
>>
>>
>>KVMGT is still in the early stage:
>>
>> - Basic functions of full GPU virtualization 

RE: [f2fs-dev] [PATCH 4/6] f2fs: avoid multiple node page writes due to inline_data

2016-01-26 Thread Chao Yu
Hi Jaegeuk,

> -Original Message-
> From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> Sent: Wednesday, January 27, 2016 2:48 AM
> To: Chao Yu
> Cc: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> linux-f2fs-de...@lists.sourceforge.net
> Subject: Re: [f2fs-dev] [PATCH 4/6] f2fs: avoid multiple node page writes due 
> to inline_data
> 
> Hi Chao,
> 
> On Tue, Jan 26, 2016 at 01:41:05PM +0800, Chao Yu wrote:
> > Hi Jaegeuk,
> >
> > > -Original Message-
> > > From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> > > Sent: Tuesday, January 26, 2016 6:05 AM
> > > To: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> > > linux-f2fs-de...@lists.sourceforge.net
> > > Cc: Jaegeuk Kim
> > > Subject: [f2fs-dev] [PATCH 4/6] f2fs: avoid multiple node page writes due 
> > > to inline_data
> > >
> > > The sceanrio is:
> > > 1. create fully node blocks
> > > 2. flush node blocks
> > > 3. write inline_data for all the node blocks again
> > > 4. flush node blocks redundantly
> > >
> > > So, this patch tries to flush inline_data when flushing node blocks.
> > >
> > > Signed-off-by: Jaegeuk Kim 
> > > ---
> > >  fs/f2fs/data.c   |  1 +
> > >  fs/f2fs/inline.c |  2 ++
> > >  fs/f2fs/node.c   | 39 +++
> > >  fs/f2fs/node.h   | 15 +++
> > >  4 files changed, 57 insertions(+)
> > >
> > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> > > index 89a37ba..260c0eb 100644
> > > --- a/fs/f2fs/data.c
> > > +++ b/fs/f2fs/data.c
> > > @@ -1463,6 +1463,7 @@ restart:
> > >   if (pos + len <= MAX_INLINE_DATA) {
> > >   read_inline_data(page, ipage);
> > >   set_inode_flag(F2FS_I(inode), FI_DATA_EXIST);
> > > + set_inline_node(ipage);
> > >   sync_inode_page();
> > >   } else {
> > >   err = f2fs_convert_inline_page(, page);
> > > diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
> > > index 8df13e5..fc4d298 100644
> > > --- a/fs/f2fs/inline.c
> > > +++ b/fs/f2fs/inline.c
> > > @@ -159,6 +159,7 @@ no_update:
> > >
> > >   /* clear inline data and flag after data writeback */
> > >   truncate_inline_inode(dn->inode_page, 0);
> > > + clear_inline_node(dn->inode_page);
> > >  clear_out:
> > >   stat_dec_inline_inode(dn->inode);
> > >   f2fs_clear_inline_inode(dn->inode);
> > > @@ -233,6 +234,7 @@ int f2fs_write_inline_data(struct inode *inode, 
> > > struct page *page)
> > >   set_inode_flag(F2FS_I(inode), FI_DATA_EXIST);
> > >
> > >   sync_inode_page();
> > > + clear_inline_node(dn.inode_page);
> > >   f2fs_put_dnode();
> > >   return 0;
> > >  }
> > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> > > index 23b800d..94a6755 100644
> > > --- a/fs/f2fs/node.c
> > > +++ b/fs/f2fs/node.c
> > > @@ -1154,6 +1154,37 @@ void sync_inode_page(struct dnode_of_data *dn)
> > >   dn->node_changed = ret ? true: false;
> > >  }
> > >
> > > +static void flush_inline_data(struct f2fs_sb_info *sbi, nid_t ino)
> > > +{
> > > + struct inode *inode;
> > > + struct page *page;
> > > +
> > > + /* should flush inline_data before evict_inode */
> > > + inode = ilookup(sbi->sb, ino);
> > > + if (!inode)
> > > + return;
> > > +
> > > + page = pagecache_get_page(inode->i_mapping, 0, FGP_LOCK|FGP_NOWAIT, 0);
> > > + if (!page)
> > > + goto iput_out;
> > > +
> > > + if (!PageUptodate(page))
> > > + goto page_out;
> > > +
> > > + if (!PageDirty(page))
> > > + goto page_out;
> > > +
> > > + if (!clear_page_dirty_for_io(page))
> > > + goto page_out;
> > > +
> > > + if (!f2fs_write_inline_data(inode, page))
> >
> > better to redirty the page when fail except -EAGAIN?
> 
> Agreed.
> 
> >
> > > + inode_dec_dirty_pages(inode);
> > > +page_out:
> > > + f2fs_put_page(page, 1);
> > > +iput_out:
> > > + iput(inode);
> > > +}
> > > +
> > >  int sync_node_pages(struct f2fs_sb_info *sbi, nid_t ino,
> > >   struct writeback_control *wbc)
> > >  {
> > > @@ -1221,6 +1252,14 @@ continue_unlock:
> > >   goto continue_unlock;
> > >   }
> > >
> > > + /* flush inline_data */
> > > + if (!ino && is_inline_node(page)) {
> > > + clear_inline_node(page);
> >
> > Should clear after flushed inline data? otherwise if we failed to flush
> > inline data, we will lose the change to flush it before node flush.
> 
> My intention was just letting it go and flush by ->writepage later.

Hmm.. since it's rare scenario, so it's OK to me.

> So, the above set_page_dirty() would handle this, right?

Yes.

Please add
Reviewed-by: Chao Yu 

Thanks,

> 
> Thanks,
> 
> >
> > Thanks,
> >
> > > + unlock_page(page);
> > > + flush_inline_data(sbi, ino_of_node(page));
> > > + continue;
> > > + }
> > > +
> > >   if (!clear_page_dirty_for_io(page))
> > >  

Re: [Y2038] [RFC 02/15] vfs: Change all structures to support 64 bit time

2016-01-26 Thread Deepa Dinamani
Arnd and I had a discussion about how to proceed here.

We don't think anybody really is wanting a big patch touching 50 fs here.

We are evaluating a couple of approaches that don't do this.

I will post an update next week

On Wed, Jan 20, 2016 at 3:17 PM, Arnd Bergmann  wrote:
> On Thursday 21 January 2016 10:06:32 Dave Chinner wrote:
>>
>> IOWs, you're now finally suggesting doing the *simple conversion*
>> I've been suggesting needs to be made *since the start* of this
>> long, frustrating thread, except you *still want to abstract the
>> timestamp unnecessarily*.
>>
>> For the last time: use timespec64 directly, do not abstract it
>> in any way.
>
> No, in an earlier mail you said
>
> "Nobody is suggesting one huge patch here. This can all be done with
> small steps."
>
> Changing 45 files in 20 file systems along with the VFS core in
> one patch is what I consider a huge patch, it's the opposite
> of small steps.
>
> Arnd



RE: undefined reference to `snd_timer_interrupt'

2016-01-26 Thread Jie, Yang
>-Original Message-
>From: Takashi Iwai [mailto:ti...@suse.de]
>Sent: Wednesday, January 27, 2016 2:14 PM
>To: Wu, Fengguang
>Cc: Jie, Yang; kbuild-...@01.org; linux-kernel@vger.kernel.org
>Subject: Re: undefined reference to `snd_timer_interrupt'
>
>On Tue, 26 Jan 2016 23:16:55 +0100,
>kbuild test robot wrote:
>>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>master
>> head:   92e963f50fc74041b5e9e744c330dca48e04f08d
>> commit: 90bbaf66ee7b946952f1e82a0069639dea5fd893 ALSA: timer: add
>config item to export PCM timer disabling for expert
>> date:   3 months ago
>> config: x86_64-randconfig-s0-01270516 (attached as .config)
>> reproduce:
>> git checkout 90bbaf66ee7b946952f1e82a0069639dea5fd893
>> # save the attached .config to linux build tree
>> make ARCH=x86_64
>>
>> All errors (new ones prefixed by >>):
>>
>>sound/built-in.o: In function `snd_emu10k1_interrupt':
>> >> (.text+0x604c7): undefined reference to `snd_timer_interrupt'
>>sound/built-in.o: In function `snd_emu10k1_timer':
>> >> (.text+0x70d5d): undefined reference to `snd_timer_new'
>
>Fixed by the patch below.
 
Thanks, I also just worked out the exactly same patch and planning
to submit.  So now I can enjoy a cup of tea :-

thanks,
~Keyon
>
>
>thanks,
>
>Takashi
>
>-- 8< --
>From: Takashi Iwai 
>Subject: [PATCH] ALSA: Add missing dependency on CONFIG_SND_TIMER
>
>Since the build of PCM timer may be disabled via Kconfig now, each
>driver that provides a timer interface needs to set CONFIG_SND_TIMER
>explicitly.  Otherwise it may get a build error due to missing
>symbol.
>
>Fixes: 90bbaf66ee7b ('ALSA: timer: add config item to export PCM timer
>disabling for expert')
>Reported-by: kbuild test robot 
>Cc:  # v4.4+
>Signed-off-by: Takashi Iwai 
>---
> sound/isa/Kconfig   | 4 
> sound/pci/Kconfig   | 3 +++
> sound/sparc/Kconfig | 1 +
> 3 files changed, 8 insertions(+)
>
>diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
>index 0216475fc759..37adcc6cbe6b 100644
>--- a/sound/isa/Kconfig
>+++ b/sound/isa/Kconfig
>@@ -3,6 +3,7 @@
> config SND_WSS_LIB
> tristate
> select SND_PCM
>+  select SND_TIMER
>
> config SND_SB_COMMON
> tristate
>@@ -42,6 +43,7 @@ config SND_AD1816A
>   select SND_OPL3_LIB
>   select SND_MPU401_UART
>   select SND_PCM
>+  select SND_TIMER
>   help
> Say Y here to include support for Analog Devices SoundPort
> AD1816A or compatible sound chips.
>@@ -209,6 +211,7 @@ config SND_GUSCLASSIC
>   tristate "Gravis UltraSound Classic"
>   select SND_RAWMIDI
>   select SND_PCM
>+  select SND_TIMER
>   help
> Say Y here to include support for Gravis UltraSound Classic
> soundcards.
>@@ -221,6 +224,7 @@ config SND_GUSEXTREME
>   select SND_OPL3_LIB
>   select SND_MPU401_UART
>   select SND_PCM
>+  select SND_TIMER
>   help
> Say Y here to include support for Gravis UltraSound Extreme
> soundcards.
>diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
>index 656ce39bddbc..8f6594a7d37f 100644
>--- a/sound/pci/Kconfig
>+++ b/sound/pci/Kconfig
>@@ -155,6 +155,7 @@ config SND_AZT3328
>   select SND_PCM
>   select SND_RAWMIDI
>   select SND_AC97_CODEC
>+  select SND_TIMER
>   depends on ZONE_DMA
>   help
> Say Y here to include support for Aztech AZF3328 (PCI168)
>@@ -463,6 +464,7 @@ config SND_EMU10K1
>   select SND_HWDEP
>   select SND_RAWMIDI
>   select SND_AC97_CODEC
>+  select SND_TIMER
>   depends on ZONE_DMA
>   help
> Say Y to include support for Sound Blaster PCI 512, Live!,
>@@ -889,6 +891,7 @@ config SND_YMFPCI
>   select SND_OPL3_LIB
>   select SND_MPU401_UART
>   select SND_AC97_CODEC
>+  select SND_TIMER
>   help
> Say Y here to include support for Yamaha PCI audio chips -
> YMF724, YMF724F, YMF740, YMF740C, YMF744, YMF754.
>diff --git a/sound/sparc/Kconfig b/sound/sparc/Kconfig
>index d75deba5617d..dfcd38647606 100644
>--- a/sound/sparc/Kconfig
>+++ b/sound/sparc/Kconfig
>@@ -22,6 +22,7 @@ config SND_SUN_AMD7930
> config SND_SUN_CS4231
>   tristate "Sun CS4231"
>   select SND_PCM
>+  select SND_TIMER
>   help
> Say Y here to include support for CS4231 sound device on Sun.
>
>--
>2.7.0



Re: [PATCH v3 08/12] arm64, numa: rework numa_add_memblk()

2016-01-26 Thread Hanjun Guo
On 2016/1/25 17:34, Robert Richter wrote:
> On 23.01.16 17:39:23, Hanjun Guo wrote:
>> Rework numa_add_memblk() to update the parameter "u64 size"
>> to "u64 end", this will make it consistent with x86 and
>> can simplify the code later.
>> --- a/arch/arm64/kernel/of_numa.c
>> +++ b/arch/arm64/kernel/of_numa.c
>> @@ -168,7 +168,7 @@ static int __init early_init_parse_memory_node(unsigned 
>> long node)
>>  pr_debug("NUMA-DT:  base = %llx , node = %u\n",
>>  base, nid);
>>  
>> -if (numa_add_memblk(nid, base, size) < 0)
>> +if (numa_add_memblk(nid, base, base + size) < 0)
> The overall function usage looks more like as it should use size
> instead of end. Even in the x86 implementation end is calculated from
> base + size. So better change x86 code to use size instead.
>
> Though this might involve to change the interface for
> numa_add_memblk_to() for unifcation too.
>

This should be a minor one, I'm fine with both directions, I will
stay for a few days to get more review comments, if no objections,
I will update.

Thanks
Hanjun



Re: make samples/bpf/ using gcc instead of clang/llvm

2016-01-26 Thread Joel Fernandes
Hi Alexei,

Ok, I take that back. I see how it works now. Thanks for sharing that.

On Tue, Jan 26, 2016 at 10:18 PM, Joel Fernandes  wrote:
> Alexei,
>
> Thanks for the quick reply.
>
> But, the bpf sample programs like tracex1_kern.c are marked with
> hostprogs-y in the Makefile as well, just like test_verifier.c. How
> does Kbuild/Make know when to use gcc and when to use clang?
>
> Best,
>
> On Tue, Jan 26, 2016 at 10:08 PM, Alexei Starovoitov
>  wrote:
>> On Tue, Jan 26, 2016 at 09:51:54PM -0800, Joel Fernandes wrote:
>>> Hi Brendan, Alexei,
>>>
>>> I noticed your patch fixing the $subject issue.
>>>
>>> https://patchwork.ozlabs.org/patch/471118/
>>>
>>> However, I still see make samples/bpf/ using gcc instead of clang.
>>>
>>> Here's a verbose kbuild output of make samples/bpf/. My kernel version
>>> is 4.4. It looks to me like Kbuild is ignoring the Makefile in
>>> samples/bpf/. Let me know if you spot anything of the ordinary?
>>> Thanks.
>>>
>>>  make  KBUILD_VERBOSE=1 samples/bpf/
>>> [..]
>>> make KBUILD_MODULES=1 \
>>> -f /home/joel/data/repo/linux-4.4/scripts/Makefile.build obj=samples/bpf
>>> (cat /dev/null; ) > samples/bpf/modules.order
>>>   gcc -Wp,-MD,samples/bpf/.test_verifier.o.d -Isamples/bpf -Wall
>>> -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
>>> -std=gnu89  -I/home/joel/data/repo/linux-4.4/./usr/include
>>> -I./usr/include -c -o samples/bpf/test_verifier.o
>>> /home/joel/data/repo/linux-4.4/samples/bpf/test_verifier.c
>>> /home/joel/data/repo/linux-4.4/samples/bpf/test_verifier.c:12:23:
>>> fatal error: linux/bpf.h: No such file or directory
>>>  #include 
>>>^
>>> compilation terminated.
>>
>> test_verifier.c should be built with gcc.
>> *_kern.c are built with clang.
>> In this case likely 'make headers_install' is missing.
>>


Re: [PATCH v3] lib/spinlock_debug.c: prevent an infinite recursive cycle in spin_dump()

2016-01-26 Thread Byungchul Park
A better solution struck me now. Please hold on a minute. Sorry for sending
many spam-email-like stuffs. :(


Re: [Intel-gfx] [Announcement] 2015-Q4 release of XenGT - a Mediated Graphics Passthrough Solution from Intel

2016-01-26 Thread Jike Song
Hi all,

We are pleased to announce another update of Intel GVT-g for Xen.

Intel GVT-g is a full GPU virtualization solution with mediated pass-through, 
starting from 4th generation Intel Core(TM) processors with Intel Graphics 
processors. A virtual GPU instance is maintained for each VM, with part of 
performance critical resources directly assigned. The capability of running 
native graphics driver inside a VM, without hypervisor intervention in 
performance critical paths, achieves a good balance among performance, feature, 
and sharing capability. Xen is currently supported on Intel Processor Graphics 
(a.k.a. XenGT).

Repositories
-

Kernel: https://github.com/01org/igvtg-kernel (2015q4-4.2.0 branch)
Xen: https://github.com/01org/igvtg-xen (2015q4-4.5 branch)
Qemu: https://github.com/01org/igvtg-qemu (xengt_public2015q4 branch)

This update consists of:

- 6th generation Intel Core Processor (code name: Skylake) is 
preliminarily supported in this release. Users could start run multiple Windows 
/ Linux virtual machines simultaneously, and switch display among them.
- Backward compatibility support 4th generation Intel Core Processor 
(code name: Haswell) and 5th generation Intel Core Processor (code name: 
Broadwell).
- Kernel update from drm-intel 3.18.0 to drm-intel 4.2.0.

Known issues:
   - At least 2GB memory is suggested for a VM to run most 3D workloads.
   - Keymap might be incorrect in guest. Config file may need to explicitly 
specify "keymap='en-us'". Although it looks like the default value, earlier we 
saw the problem of wrong keymap code if it is not explicitly set.
   - Cannot move mouse pointer smoothly in guest by default launched by VNC 
mode. Configuration file need to explicitly specify "usb=1" to enable a USB 
bus, and "usbdevice='tablet'" to add pointer device using absolute coordinates.
   - Running heavy 3D workloads in multiple guests for couple of hours may 
cause stability issue.
   - There are still stability issues on Skylake


Next update will be around early April, 2016.

GVT-g project portal: https://01.org/igvt-g
Please subscribe mailing list: https://lists.01.org/mailman/listinfo/igvt-g


More information about background, architecture and others about Intel GVT-g, 
can be found at:

https://01.org/igvt-g
https://www.usenix.org/conference/atc14/technical-sessions/presentation/tian

http://events.linuxfoundation.org/sites/events/files/slides/XenGT-Xen%20Summit-v7_0.pdf

http://events.linuxfoundation.org/sites/events/files/slides/XenGT-Xen%20Summit-REWRITE%203RD%20v4.pdf
https://01.org/xen/blogs/srclarkx/2013/graphics-virtualization-xengt


Note: The XenGT project should be considered a work in progress. As such it is 
not a complete product nor should it be considered one. Extra care should be 
taken when testing and configuring a system to use the XenGT project.


--
Thanks,
Jike

On 10/27/2015 05:25 PM, Jike Song wrote:
> Hi all,
> 
> We are pleased to announce another update of Intel GVT-g for Xen.
> 
> Intel GVT-g is a full GPU virtualization solution with mediated pass-through, 
> starting from 4th generation Intel Core(TM) processors with Intel Graphics 
> processors. A virtual GPU instance is maintained for each VM, with part of 
> performance critical resources directly assigned. The capability of running 
> native graphics driver inside a VM, without hypervisor intervention in 
> performance critical paths, achieves a good balance among performance, 
> feature, and sharing capability. Xen is currently supported on Intel 
> Processor Graphics (a.k.a. XenGT); and the core logic can be easily ported to 
> other hypervisors.
> 
> 
> Repositories
> 
>  Kernel: https://github.com/01org/igvtg-kernel (2015q3-3.18.0 branch)
>  Xen: https://github.com/01org/igvtg-xen (2015q3-4.5 branch)
>  Qemu: https://github.com/01org/igvtg-qemu (xengt_public2015q3 branch)
> 
> 
> This update consists of:
> 
>  - XenGT is now merged with KVMGT in unified repositories(kernel and 
> qemu), but currently
>different branches for qemu.  XenGT and KVMGT share same iGVT-g core 
> logic.
>  - fix sysfs/debugfs access seldom crash issue
>  - fix a BUG in XenGT I/O emulation logic
>  - improve 3d workload stability
> 
> Next update will be around early Jan, 2016.
> 
> 
> Known issues:
> 
>  - At least 2GB memory is suggested for VM to run most 3D workloads.
>  - Keymap might be incorrect in guest. Config file may need to explicitly 
> specify "keymap='en-us'". Although it looks like the default value, earlier 
> we saw the problem of wrong keymap code if it is not explicitly set.
>  - When using three monitors, doing hotplug between Guest pause/unpause 
> may not be able to lightup all monitors automatically. Some specific monitor 
> issues.
>  - Cannot move mouse pointer smoothly in guest by default launched by VNC 
> mode. Configuration file need to explicitly specify 

Re: [RFC PATCH 07/21] mmc: sdhci-pxav3: consolidate parsing path

2016-01-26 Thread Shawn Lin

Hi Jisheng,

On 2016/1/27 13:44, Jisheng Zhang wrote:

Hi Shawn,

On Wed, 27 Jan 2016 13:07:36 +0800 Shawn Lin wrote:


This patch remove mmc_of_parse and check return value
of sdhci_get_of_property.

Cc: Jisheng Zhang 
Cc: Gregory CLEMENT 
Signed-off-by: Shawn Lin 


Reviewed-by: Jisheng Zhang 


But I have some comments to your patch10:


SDHCI_QUIRK_BROKEN_CARD_DETECTION is for "broken-cd".
If we add MMC_CAP_NONREMOVABLE("non-removeble"), we shoud
not add "broken-cd" together according to mmc.txt for
dt-bingdings. Also, "broken-cd" can obtain from mmc_of_parse,
which will add MMC_CAP_NEEDS_POLL into mmc->caps.


The problem is non-dt platforms which need the broken cd quirk don't have
chance to set MMC_CAP_NEEDS_POLL in driver, unless we explicitly do so
in driver. But then, the driver only need to do so on some platforms but
not always.



Thanks for sharing your thought. That is indeed a historical baggage
to improve sdhci. So, it needs to check each platform case by case.
Let's wait more feedback untile I decide how to respin the patchset. :)


Thanks,
Jisheng



---

  drivers/mmc/host/sdhci-pxav3.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index f5edf9d..06eda25 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -410,10 +410,8 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)

match = of_match_device(of_match_ptr(sdhci_pxav3_of_match), >dev);
if (match) {
-   ret = mmc_of_parse(host->mmc);
-   if (ret)
+   ret = sdhci_get_of_property(pdev);
goto err_of_parse;
-   sdhci_get_of_property(pdev);
pdata = pxav3_get_mmc_pdata(dev);
pdev->dev.platform_data = pdata;
} else if (pdata) {








--
Best Regards
Shawn Lin



Re: make samples/bpf/ using gcc instead of clang/llvm

2016-01-26 Thread Joel Fernandes
Alexei,

Thanks for the quick reply.

But, the bpf sample programs like tracex1_kern.c are marked with
hostprogs-y in the Makefile as well, just like test_verifier.c. How
does Kbuild/Make know when to use gcc and when to use clang?

Best,

On Tue, Jan 26, 2016 at 10:08 PM, Alexei Starovoitov
 wrote:
> On Tue, Jan 26, 2016 at 09:51:54PM -0800, Joel Fernandes wrote:
>> Hi Brendan, Alexei,
>>
>> I noticed your patch fixing the $subject issue.
>>
>> https://patchwork.ozlabs.org/patch/471118/
>>
>> However, I still see make samples/bpf/ using gcc instead of clang.
>>
>> Here's a verbose kbuild output of make samples/bpf/. My kernel version
>> is 4.4. It looks to me like Kbuild is ignoring the Makefile in
>> samples/bpf/. Let me know if you spot anything of the ordinary?
>> Thanks.
>>
>>  make  KBUILD_VERBOSE=1 samples/bpf/
>> [..]
>> make KBUILD_MODULES=1 \
>> -f /home/joel/data/repo/linux-4.4/scripts/Makefile.build obj=samples/bpf
>> (cat /dev/null; ) > samples/bpf/modules.order
>>   gcc -Wp,-MD,samples/bpf/.test_verifier.o.d -Isamples/bpf -Wall
>> -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
>> -std=gnu89  -I/home/joel/data/repo/linux-4.4/./usr/include
>> -I./usr/include -c -o samples/bpf/test_verifier.o
>> /home/joel/data/repo/linux-4.4/samples/bpf/test_verifier.c
>> /home/joel/data/repo/linux-4.4/samples/bpf/test_verifier.c:12:23:
>> fatal error: linux/bpf.h: No such file or directory
>>  #include 
>>^
>> compilation terminated.
>
> test_verifier.c should be built with gcc.
> *_kern.c are built with clang.
> In this case likely 'make headers_install' is missing.
>


Re: [PATCH v3 12/12] acpi, numa: reuse acpi_numa_memory_affinity_init()

2016-01-26 Thread Hanjun Guo
Hi Robert,

On 2016/1/25 18:26, Robert Richter wrote:
> On 23.01.16 17:39:27, Hanjun Guo wrote:
>> From: Hanjun Guo 
>>
>> After the cleanup for acpi_numa_memory_affinity_init(),
>> it can be used for architetures both x86 and arm64, since
>> CONFIG_MEMORY_HOTPLUG is not enabled for arm64, so no
>> worry about that.
>>
>> Signed-off-by: Hanjun Guo 
>> ---
>>  arch/arm64/kernel/acpi_numa.c | 42 ---
>>  arch/x86/mm/srat.c| 54 
>>  drivers/acpi/numa.c   | 57 
>> +++
>>  3 files changed, 57 insertions(+), 96 deletions(-)
> This one reverts acpi_numa_memory_affinity_init() to the x86 version.
> I rather would prefer the arm64 version for the generic code. We could
> keep the x86 implementation until x86 maintainers agree to remove them
> and use the generic one (implemented in a separate patch).
>
> Doing so we can move acpi_numa_memory_affinity_init() from the
> beginning to generic code (used for arm64) and have this last patch to
> remove the x86 version.

I think the x86 version is the generic one, all the flags 
(ACPI_SRAT_MEM_HOT_PLUGGABLE and
etc) are defined in the ACPI spec, x86 just use all the flags because it 
support such features.
For ARM64, firmware should be careful and represent the true platform 
configuration to
OS, such as on ARM64, we can't set hotpluggable flag as the ARM64 arch don't 
support
memory hot-plug yet (also the firmware don't support it too), if firmware do 
things right,
it will be not worries for the kernel.

Thanks
Hanjun



Re: undefined reference to `snd_timer_interrupt'

2016-01-26 Thread Takashi Iwai
On Tue, 26 Jan 2016 23:16:55 +0100,
kbuild test robot wrote:
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> master
> head:   92e963f50fc74041b5e9e744c330dca48e04f08d
> commit: 90bbaf66ee7b946952f1e82a0069639dea5fd893 ALSA: timer: add config item 
> to export PCM timer disabling for expert
> date:   3 months ago
> config: x86_64-randconfig-s0-01270516 (attached as .config)
> reproduce:
> git checkout 90bbaf66ee7b946952f1e82a0069639dea5fd893
> # save the attached .config to linux build tree
> make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
>sound/built-in.o: In function `snd_emu10k1_interrupt':
> >> (.text+0x604c7): undefined reference to `snd_timer_interrupt'
>sound/built-in.o: In function `snd_emu10k1_timer':
> >> (.text+0x70d5d): undefined reference to `snd_timer_new'

Fixed by the patch below.


thanks,

Takashi

-- 8< --
From: Takashi Iwai 
Subject: [PATCH] ALSA: Add missing dependency on CONFIG_SND_TIMER

Since the build of PCM timer may be disabled via Kconfig now, each
driver that provides a timer interface needs to set CONFIG_SND_TIMER
explicitly.  Otherwise it may get a build error due to missing
symbol.

Fixes: 90bbaf66ee7b ('ALSA: timer: add config item to export PCM timer 
disabling for expert')
Reported-by: kbuild test robot 
Cc:  # v4.4+
Signed-off-by: Takashi Iwai 
---
 sound/isa/Kconfig   | 4 
 sound/pci/Kconfig   | 3 +++
 sound/sparc/Kconfig | 1 +
 3 files changed, 8 insertions(+)

diff --git a/sound/isa/Kconfig b/sound/isa/Kconfig
index 0216475fc759..37adcc6cbe6b 100644
--- a/sound/isa/Kconfig
+++ b/sound/isa/Kconfig
@@ -3,6 +3,7 @@
 config SND_WSS_LIB
 tristate
 select SND_PCM
+   select SND_TIMER
 
 config SND_SB_COMMON
 tristate
@@ -42,6 +43,7 @@ config SND_AD1816A
select SND_OPL3_LIB
select SND_MPU401_UART
select SND_PCM
+   select SND_TIMER
help
  Say Y here to include support for Analog Devices SoundPort
  AD1816A or compatible sound chips.
@@ -209,6 +211,7 @@ config SND_GUSCLASSIC
tristate "Gravis UltraSound Classic"
select SND_RAWMIDI
select SND_PCM
+   select SND_TIMER
help
  Say Y here to include support for Gravis UltraSound Classic
  soundcards.
@@ -221,6 +224,7 @@ config SND_GUSEXTREME
select SND_OPL3_LIB
select SND_MPU401_UART
select SND_PCM
+   select SND_TIMER
help
  Say Y here to include support for Gravis UltraSound Extreme
  soundcards.
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 656ce39bddbc..8f6594a7d37f 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -155,6 +155,7 @@ config SND_AZT3328
select SND_PCM
select SND_RAWMIDI
select SND_AC97_CODEC
+   select SND_TIMER
depends on ZONE_DMA
help
  Say Y here to include support for Aztech AZF3328 (PCI168)
@@ -463,6 +464,7 @@ config SND_EMU10K1
select SND_HWDEP
select SND_RAWMIDI
select SND_AC97_CODEC
+   select SND_TIMER
depends on ZONE_DMA
help
  Say Y to include support for Sound Blaster PCI 512, Live!,
@@ -889,6 +891,7 @@ config SND_YMFPCI
select SND_OPL3_LIB
select SND_MPU401_UART
select SND_AC97_CODEC
+   select SND_TIMER
help
  Say Y here to include support for Yamaha PCI audio chips -
  YMF724, YMF724F, YMF740, YMF740C, YMF744, YMF754.
diff --git a/sound/sparc/Kconfig b/sound/sparc/Kconfig
index d75deba5617d..dfcd38647606 100644
--- a/sound/sparc/Kconfig
+++ b/sound/sparc/Kconfig
@@ -22,6 +22,7 @@ config SND_SUN_AMD7930
 config SND_SUN_CS4231
tristate "Sun CS4231"
select SND_PCM
+   select SND_TIMER
help
  Say Y here to include support for CS4231 sound device on Sun.
 
-- 
2.7.0



Re: + lib-spinlock_debugc-prevent-an-infinite-recursive-cycle-in-spin_dump.patch added to -mm tree

2016-01-26 Thread Byungchul Park
On Wed, Jan 27, 2016 at 10:14:54AM +0900, Sergey Senozhatsky wrote:
> On (01/26/16 16:12), a...@linux-foundation.org wrote:
> [..]
> > There is an infinite recursive cycle when using CONFIG_DEBUG_SPINLOCK, in
> > spin_dump().  Backtrace prints printk() -> console_trylock() ->
> > do_raw_spin_lock() -> spin_bug() -> spin_dump() -> printk()... 
> > infinitely.
> 
> is it even possible to lockup on a semaphore's spin_lock?
> 
> int down_trylock(struct semaphore *sem)
> {
>   unsigned long flags;
>   int count;
> 
>   raw_spin_lock_irqsave(>lock, flags);
>    here?

Yes.

> under what circumstances and why it should be silenced? a memory corruption?
> or is it the 'logbuf_lock' spin_lock that was meant to be in the report?

Backtracing said it's console_sem.lock. But as you said, logbuf_lock can
cause same lockup when trying printk() in printk().

> so if the CPU that owns the spin_lock somehow managed to keep it forever
> (due to a memory corruption... or something has powered off the cpu
> core???) -- then _this is_ the problem, not the fact that other CPUs will
> not lock the spin_lock anymore.
> 
> so I don't think this patch does the right thing, sorry.

I agree with you.

thanks,
byungchul



[PATCH v3 2/2] i801_smbus: fix unavailable irq number 255 reported by BIOS

2016-01-26 Thread Chen Fan
In our environment, when enable Secure boot, we found an abnormal
phenomenon as following call trace shows. after investigation, we
found the firmware assigned an irq number 255 which means unknown
or no connection in PCI local spec for i801_smbus, meanwhile the
ACPI didn't configure the pci irq routing. and the 255 irq number
was assigned for megasa msix without IRQF_SHARED. then in this case
during i801_smbus probe, the i801_smbus driver would request irq with
bad irq number 255. but the 255 irq number was assigned for memgasa
with MSIX enable. which will cause request_irq fails and result in
the call trace below, here we add check the irq_invalid flag to identify
the smbus whether support IRQ-driven.

i801_smbus :00:1f.3: enabling device (0140 -> 0143)
i801_smbus :00:1f.3: can't derive routing for PCI INT C
i801_smbus :00:1f.3: PCI INT C: no GSI
genirq: Flags mismatch irq 255. 0080 (i801_smbus) vs.  (megasa)
CPU: 0 PID: 2487 Comm: kworker/0:1 Not tainted 3.10.0-229.el7.x86_64 #1
Hardware name: FUJITSU PRIMEQUEST 2800E2/D3736, BIOS PRIMEQUEST 2000 Serie5

Call Trace:
  dump_stack+0x19/0x1b
  __setup_irq+0x54a/0x570
  request_threaded_irq+0xcc/0x170
  i801_probe+0x32f/0x508 [i2c_i801]
  local_pci_probe+0x45/0xa0
i801_smbus :00:1f.3: Failed to allocate irq 255: -16
i801_smbus: probe of :00:1f.3 failed with error -16

Signed-off-by: Chen Fan 
---
 drivers/i2c/busses/i2c-i801.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index f62d697..22f9aea 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1380,6 +1380,11 @@ static int i801_probe(struct pci_dev *dev, const struct 
pci_device_id *id)
}
}
 
+   if ((priv->features & FEATURE_IRQ) && dev->irq_invalid) {
+   dev_warn(>dev, "Interrupt line is invalid!\n");
+   priv->features &= ~FEATURE_IRQ;
+   }
+
if (priv->features & FEATURE_IRQ) {
init_waitqueue_head(>waitq);
 
-- 
1.9.3





[PATCH v3 0/2] pci: fix unavailable irq number 255 reported by BIOS

2016-01-26 Thread Chen Fan
see each patch comments.

Chen Fan (2):
  pci: add an irq_invalid flag to specify the IRQ is not connected
  i801_smbus: fix unavailable irq number 255 reported by BIOS

 drivers/acpi/pci_irq.c| 10 ++
 drivers/i2c/busses/i2c-i801.c |  5 +
 include/linux/pci.h   |  1 +
 3 files changed, 16 insertions(+)

-- 
1.9.3





[PATCH v3 1/2] pci: add an irq_invalid flag to specify the IRQ is not connected

2016-01-26 Thread Chen Fan
Quoting the PCI3.0 SPEC on page 223:
"For x86 based PCs, the values in this register correspond
to IRQ numbers (0-15) of the standard dual 8259 configuration.
The value 255 is defined as meaning "unknown" or "no connection"
to the interrupt controller. Values between 15 and 254 are reserved."

So we add an irq_invalid flag to tell driver that the device wire
is not connected. then the driver could know whether it should call
request_irq().

Signed-off-by: Chen Fan 
---
 drivers/acpi/pci_irq.c | 10 ++
 include/linux/pci.h|  1 +
 2 files changed, 11 insertions(+)

diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index d30184c..bb78376 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -436,6 +436,16 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
 * driver reported one, then use it. Exit in any case.
 */
if (gsi < 0) {
+#ifdef CONFIG_X86
+   /*
+* For X86 architecture, The Interrupt Line value of 0xff is
+* defined to mean "unknown" or "no connection" (PCI 3.0,
+* Section 6.2.4, footnote on page 223). we flag the IRQ
+* as INVALID.
+*/
+   if (dev->irq == 0xff)
+   dev->irq_invalid = 1;
+#endif
if (acpi_isa_register_gsi(dev))
dev_warn(>dev, "PCI INT %c: no GSI\n",
 pin_name(pin));
diff --git a/include/linux/pci.h b/include/linux/pci.h
index d86378c..06f137e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -359,6 +359,7 @@ struct pci_dev {
unsigned intio_window_1k:1; /* Intel P2P bridge 1K I/O windows */
unsigned intirq_managed:1;
unsigned inthas_secondary_link:1;
+   unsigned intirq_invalid:1;
pci_dev_flags_t dev_flags;
atomic_tenable_cnt; /* pci_enable_device has been called */
 
-- 
1.9.3





Re: [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list

2016-01-26 Thread Gautham R Shenoy
On Mon, Jan 25, 2016 at 11:18:24AM +, Juri Lelli wrote:
> Hi,
> 
> On 25/01/16 15:20, Viresh Kumar wrote:
> > On 25-01-16, 15:16, Gautham R. Shenoy wrote:
> > > Currently next_policy() explicitly checks if a policy is the last
> > > policy in the cpufreq_policy_list. Use the standard list_is_last
> > > primitive instead.
> > > 
> > > Cc: Viresh Kumar 
> > > Signed-off-by: Gautham R. Shenoy 
> > > ---
> > >  drivers/cpufreq/cpufreq.c | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > > index 78b1e2f..b3059a3 100644
> > > --- a/drivers/cpufreq/cpufreq.c
> > > +++ b/drivers/cpufreq/cpufreq.c
> > > @@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct 
> > > cpufreq_policy *policy,
> > >  {
> > >   lockdep_assert_held(_driver_lock);
> 
> Which branch is this patch based on?

My bad! This is based on your branch  git://linux-arm.org/linux-jl.git
upstream/cpufreq_cleanups. I found this issue while reviewing your
cleanup patches.


> 
> Thanks,
> 
> - Juri

--
Thanks and Regards
gautham.



Re: [PATCH v4 02/10] rtc: max77686: Use ARRAY_SIZE() instead of current array length

2016-01-26 Thread Laxman Dewangan


On Wednesday 27 January 2016 09:06 AM, Javier Martinez Canillas wrote:

It is better to use the ARRAY_SIZE() macro instead of the array length
to avoid bugs if the array is later changed and the length not updated.

Signed-off-by: Javier Martinez Canillas 
Reviewed-by: Krzysztof Kozlowski 
Tested-by: Krzysztof Kozlowski 
Reviewed-by: Andi Shyti 



Acked-by: Laxman Dewangan 


Re: make samples/bpf/ using gcc instead of clang/llvm

2016-01-26 Thread Alexei Starovoitov
On Tue, Jan 26, 2016 at 09:51:54PM -0800, Joel Fernandes wrote:
> Hi Brendan, Alexei,
> 
> I noticed your patch fixing the $subject issue.
> 
> https://patchwork.ozlabs.org/patch/471118/
> 
> However, I still see make samples/bpf/ using gcc instead of clang.
> 
> Here's a verbose kbuild output of make samples/bpf/. My kernel version
> is 4.4. It looks to me like Kbuild is ignoring the Makefile in
> samples/bpf/. Let me know if you spot anything of the ordinary?
> Thanks.
> 
>  make  KBUILD_VERBOSE=1 samples/bpf/
> [..]
> make KBUILD_MODULES=1 \
> -f /home/joel/data/repo/linux-4.4/scripts/Makefile.build obj=samples/bpf
> (cat /dev/null; ) > samples/bpf/modules.order
>   gcc -Wp,-MD,samples/bpf/.test_verifier.o.d -Isamples/bpf -Wall
> -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
> -std=gnu89  -I/home/joel/data/repo/linux-4.4/./usr/include
> -I./usr/include -c -o samples/bpf/test_verifier.o
> /home/joel/data/repo/linux-4.4/samples/bpf/test_verifier.c
> /home/joel/data/repo/linux-4.4/samples/bpf/test_verifier.c:12:23:
> fatal error: linux/bpf.h: No such file or directory
>  #include 
>^
> compilation terminated.

test_verifier.c should be built with gcc.
*_kern.c are built with clang.
In this case likely 'make headers_install' is missing.



Re: [PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-26 Thread Wenwei Tao
Thanks.

2016-01-27 13:52 GMT+08:00 Matias Bjørling :
> On 01/27/2016 03:21 AM, Wenwei Tao wrote:
>>
>> Yes, It's a spelling mistake, will correct it in next version.
>
>
> I can fix it in the version I apply. No problem.


Re: [PATCH 3/3] dax: Handle write faults more efficiently

2016-01-26 Thread Andy Lutomirski
On Tue, Jan 26, 2016 at 8:17 PM, Matthew Wilcox  wrote:
> On Mon, Jan 25, 2016 at 09:38:19AM -0800, Andy Lutomirski wrote:
>> On Mon, Jan 25, 2016 at 9:25 AM, Matthew Wilcox
>>  wrote:
>> > From: Matthew Wilcox 
>> >
>> > When we handle a write-fault on a DAX mapping, we currently insert a
>> > read-only mapping and then take the page fault again to convert it to
>> > a writable mapping.  This is necessary for the case where we cover a
>> > hole with a read-only zero page, but when we have a data block already
>> > allocated, it is inefficient.
>> >
>> > Use the recently added vmf_insert_pfn_prot() to insert a writable mapping,
>> > even though the default VM flags say to use a read-only mapping.
>>
>> Conceptually, I like this.  Do you need to make sure to do all the
>> do_wp_page work, though?  (E.g. we currently update mtime in there.
>> Some day I'll fix that, but it'll be replaced with a set_bit to force
>> a deferred mtime update.)
>
> We update mtime in the ->fault handler of filesystems which support DAX
> like this:
>
> if (vmf->flags & FAULT_FLAG_WRITE) {
> sb_start_pagefault(inode->i_sb);
> file_update_time(vma->vm_file);
> }
>
> so I think we're covered.

A question that came up on IRC: if the page is a reflinked page on XFS
(whenever that feature lands), then presumably XFS has real work to do
in page_mkwrite.  If so, what ensures that page_mkwrite gets called?

As a half-baked alternative to this patch, there's a generic
optimization for this case.  do_shared_fault normally calls
do_page_mkwrite and installs the resulting page with the writable bit
set.  But if __do_fault returns VM_FAULT_NOPAGE, then this
optimization is skipped.  Could be add VM_FAULT_NOPAGE_READONLY (or
VM_FAULT_NOPAGE | VM_FAULT_READONLY) as a hint that a page was
installed but that it was installed readonly?  If we did that, then
do_shared_fault could check that bit and go through the wp_page logic
rather than returning to userspace.

--Andy


Re: [PATCH] cpufreq: Use list_is_last() to check last entry of the policy list

2016-01-26 Thread Gautham R Shenoy
On Mon, Jan 25, 2016 at 04:52:15PM +0530, Viresh Kumar wrote:
> On 25-01-16, 11:18, Juri Lelli wrote:
> > Hi,
> > 
> > On 25/01/16 15:20, Viresh Kumar wrote:
> > > On 25-01-16, 15:16, Gautham R. Shenoy wrote:
> > > > Currently next_policy() explicitly checks if a policy is the last
> > > > policy in the cpufreq_policy_list. Use the standard list_is_last
> > > > primitive instead.
> > > > 
> > > > Cc: Viresh Kumar 
> > > > Signed-off-by: Gautham R. Shenoy 
> > > > ---
> > > >  drivers/cpufreq/cpufreq.c | 6 +++---
> > > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > > > index 78b1e2f..b3059a3 100644
> > > > --- a/drivers/cpufreq/cpufreq.c
> > > > +++ b/drivers/cpufreq/cpufreq.c
> > > > @@ -67,11 +67,11 @@ static struct cpufreq_policy *next_policy(struct 
> > > > cpufreq_policy *policy,
> > > >  {
> > > > lockdep_assert_held(_driver_lock);
> > 
> > Which branch is this patch based on?
> 
> Dude, what's going on here? How come you rebased on Juri's patches ?
> :)

Ah right! I found this issue while reviewing Juri's patches from the
cpufreq-cleanups branch and didn't switch back to pm-next before
making this change. Shall resend the patch.

> 
> -- 
> viresh
> 

--
Thanks and Regards
gautham.



Re: [PATCH v2 1/2] lightnvm: specify target's logical address area

2016-01-26 Thread Matias Bjørling

On 01/27/2016 03:21 AM, Wenwei Tao wrote:

Yes, It's a spelling mistake, will correct it in next version.


I can fix it in the version I apply. No problem.


Re: [RFC PATCH] mm: support CONFIG_ZONE_DEVICE + CONFIG_ZONE_DMA

2016-01-26 Thread Joonsoo Kim
On Tue, Jan 26, 2016 at 08:26:24PM -0800, Dan Williams wrote:
> On Tue, Jan 26, 2016 at 7:52 PM, Joonsoo Kim  wrote:
> > On Tue, Jan 26, 2016 at 07:23:59PM -0800, Dan Williams wrote:
> >> On Tue, Jan 26, 2016 at 6:15 PM, Joonsoo Kim  
> >> wrote:
> >> > On Tue, Jan 26, 2016 at 05:37:38PM -0800, Dan Williams wrote:
> >> >> On Tue, Jan 26, 2016 at 5:18 PM, Joonsoo Kim  
> >> >> wrote:
> >> [..]
> >> >> > Please refer my previous attempt to add a new zone, ZONE_CMA.
> >> >> >
> >> >> > https://lkml.org/lkml/2015/2/12/84
> >> >> >
> >> >> > It salvages a bit from SECTION_WIDTH by increasing section size.
> >> >> > Similarly, I guess we can reduce NODE_WIDTH if needed although
> >> >> > it could cause to reduce maximum node size.
> >> >>
> >> >> Dave pointed out to me that LAST__PID_SHIFT might be a better
> >> >> candidate to reduce to 7 bits.  That field is for storing pids which
> >> >> are already bigger than 8 bits.  If it is relying on the fact that
> >> >> pids don't rollover very often then likely the impact of 7-bits
> >> >> instead of 8 will be minimal.
> >> >
> >> > Hmm... I'm not sure it's possible or not, but, it looks not a general
> >> > solution. It will solve your problem because you are using 64 bit arch
> >> > but other 32 bit archs can't get the benefit.
> >>
> >> This is where the ZONE_CMA and ZONE_DEVICE efforts diverge.
> >> ZONE_DEVICE is meant to enable DMA access to hundreds of gigagbytes of
> >> persistent memory.  A 64-bit-only limitation for ZONE_DEVICE is
> >> reasonable.
> >
> > Yes, but, my point is that if someone need another zone like as
> > ZONE_CMA, they couldn't get the benefit from this change. They need to
> > re-investigate what bits they can reduce and need to re-do all things.
> >
> > If it is implemented more generally at this time, it can relieve their
> > burden and less churn the code. It would be helpful for maintainability.
> 
> I agree in principle that finding a 32-bit compatible solution is
> desirable, but it simply may not be feasible.

Okay.

> 
> For now, I'll help with auditing the existing bits so we can enumerate
> the tradeoffs.

Thanks! :)

> Hmm, one tradeoff that comes to mind for 32-bit is sacrificing
> ZONE_HIGHMEM, for ZONE_CMA.  Are there configurations that need both
> enabled?  If a platform needs highmem it really should be using a
> 64-bit kernel (if possible), desire for ZONE_CMA might be a nice
> encouragement to lessen the prevalence of highmem.

I guess that it's not possible. There are many systems that need
both.

I don't think deeply, but, there is another option for ZONE_CMA.
It can share ZONE_MOVABLE because their chracteristic is roughly
same in view of MM. I will think more.

Thanks.


make samples/bpf/ using gcc instead of clang/llvm

2016-01-26 Thread Joel Fernandes
Hi Brendan, Alexei,

I noticed your patch fixing the $subject issue.

https://patchwork.ozlabs.org/patch/471118/

However, I still see make samples/bpf/ using gcc instead of clang.

Here's a verbose kbuild output of make samples/bpf/. My kernel version
is 4.4. It looks to me like Kbuild is ignoring the Makefile in
samples/bpf/. Let me know if you spot anything of the ordinary?
Thanks.

 make  KBUILD_VERBOSE=1 samples/bpf/
[..]
make KBUILD_MODULES=1 \
-f /home/joel/data/repo/linux-4.4/scripts/Makefile.build obj=samples/bpf
(cat /dev/null; ) > samples/bpf/modules.order
  gcc -Wp,-MD,samples/bpf/.test_verifier.o.d -Isamples/bpf -Wall
-Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
-std=gnu89  -I/home/joel/data/repo/linux-4.4/./usr/include
-I./usr/include -c -o samples/bpf/test_verifier.o
/home/joel/data/repo/linux-4.4/samples/bpf/test_verifier.c
/home/joel/data/repo/linux-4.4/samples/bpf/test_verifier.c:12:23:
fatal error: linux/bpf.h: No such file or directory
 #include 
   ^
compilation terminated.
make[2]: *** [samples/bpf/test_verifier.o] Error 1


Re: [RFC PATCH 07/21] mmc: sdhci-pxav3: consolidate parsing path

2016-01-26 Thread Jisheng Zhang
Hi Shawn,

On Wed, 27 Jan 2016 13:07:36 +0800 Shawn Lin wrote:

> This patch remove mmc_of_parse and check return value
> of sdhci_get_of_property.
> 
> Cc: Jisheng Zhang 
> Cc: Gregory CLEMENT 
> Signed-off-by: Shawn Lin 

Reviewed-by: Jisheng Zhang 


But I have some comments to your patch10:

> SDHCI_QUIRK_BROKEN_CARD_DETECTION is for "broken-cd".
> If we add MMC_CAP_NONREMOVABLE("non-removeble"), we shoud
> not add "broken-cd" together according to mmc.txt for
> dt-bingdings. Also, "broken-cd" can obtain from mmc_of_parse,
> which will add MMC_CAP_NEEDS_POLL into mmc->caps.

The problem is non-dt platforms which need the broken cd quirk don't have
chance to set MMC_CAP_NEEDS_POLL in driver, unless we explicitly do so
in driver. But then, the driver only need to do so on some platforms but
not always.

Thanks,
Jisheng


> ---
> 
>  drivers/mmc/host/sdhci-pxav3.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index f5edf9d..06eda25 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -410,10 +410,8 @@ static int sdhci_pxav3_probe(struct platform_device 
> *pdev)
>  
>   match = of_match_device(of_match_ptr(sdhci_pxav3_of_match), >dev);
>   if (match) {
> - ret = mmc_of_parse(host->mmc);
> - if (ret)
> + ret = sdhci_get_of_property(pdev);
>   goto err_of_parse;
> - sdhci_get_of_property(pdev);
>   pdata = pxav3_get_mmc_pdata(dev);
>   pdev->dev.platform_data = pdata;
>   } else if (pdata) {



[PATCH v3] lib/spinlock_debug.c: prevent an infinite recursive cycle in spin_dump()

2016-01-26 Thread Byungchul Park
changes from v2 to v3
- avoid printk() only in case of lockup suspected, not real lockup in
  which case it does not help at all.
- consider not only console_sem.lock but also logbuf_lock which is used
  by printk().

changes from v1 to v2
- only change comment and commit message esp. replacing "deadlock" with
  "infinite recursive cycle", since it is not an actual deadlock.

thanks,
byungchul

-8<-
>From 92c84ea45ac18010804aa09eeb9e03f797a4b2b0 Mon Sep 17 00:00:00 2001
From: Byungchul Park 
Date: Wed, 27 Jan 2016 13:33:24 +0900
Subject: [PATCH v3] lib/spinlock_debug.c: prevent an infinite recursive cycle
 in spin_dump()

It causes an infinite recursive cycle when using CONFIG_DEBUG_SPINLOCK,
in the spin_dump(). Backtrace prints printk() -> console_trylock() ->
do_raw_spin_lock() -> spin_dump() -> printk()... infinitely.

When the spin_dump() is called from printk(), we should prevent the
debug spinlock code from calling printk() again in that context. It's
reasonable to avoid printing "lockup suspected" which is just a warning
message but it would cause a real lockup definitely.

However, this patch does not deal with spin_bug(), since avoiding it in
the spin_bug() does not help it at all. Calling spin_bug() nearly means a
real lockup happened!. In that case, it's not helpful.

Signed-off-by: Byungchul Park 
---
 kernel/locking/spinlock_debug.c | 16 +---
 kernel/printk/printk.c  |  6 ++
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/kernel/locking/spinlock_debug.c b/kernel/locking/spinlock_debug.c
index 0374a59..fefc76c 100644
--- a/kernel/locking/spinlock_debug.c
+++ b/kernel/locking/spinlock_debug.c
@@ -103,6 +103,8 @@ static inline void debug_spin_unlock(raw_spinlock_t *lock)
lock->owner_cpu = -1;
 }
 
+extern int is_printk_lock(raw_spinlock_t *lock);
+
 static void __spin_lock_debug(raw_spinlock_t *lock)
 {
u64 i;
@@ -113,11 +115,19 @@ static void __spin_lock_debug(raw_spinlock_t *lock)
return;
__delay(1);
}
-   /* lockup suspected: */
-   spin_dump(lock, "lockup suspected");
+
+   /*
+* If this function is called from printk(), then we should
+* not call printk() more. Or it will cause an infinite
+* recursive cycle!
+*/
+   if (likely(!is_printk_lock(lock))) {
+   /* lockup suspected: */
+   spin_dump(lock, "lockup suspected");
 #ifdef CONFIG_SMP
-   trigger_all_cpu_backtrace();
+   trigger_all_cpu_backtrace();
 #endif
+   }
 
/*
 * The trylock above was causing a livelock.  Give the lower level arch
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 2ce8826..657f8dd 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1981,6 +1981,12 @@ asmlinkage __visible void early_printk(const char *fmt, 
...)
 }
 #endif
 
+int is_printk_lock(raw_spinlock_t *lock)
+{
+   return  (lock == _sem.lock) ||
+   (lock == _lock)  ;
+}
+
 static int __add_preferred_console(char *name, int idx, char *options,
   char *brl_options)
 {
-- 
1.9.1



Re: [PATCH 1/3] x86: Honour passed pgprot in track_pfn_insert() and track_pfn_remap()

2016-01-26 Thread Andy Lutomirski
On Tue, Jan 26, 2016 at 8:40 PM, Matthew Wilcox  wrote:
> On Mon, Jan 25, 2016 at 09:33:35AM -0800, Andy Lutomirski wrote:
>> On Mon, Jan 25, 2016 at 9:25 AM, Matthew Wilcox
>>  wrote:
>> > From: Matthew Wilcox 
>> >
>> > track_pfn_insert() overwrites the pgprot that is passed in with a value
>> > based on the VMA's page_prot.  This is a problem for people trying to
>> > do clever things with the new vm_insert_pfn_prot() as it will simply
>> > overwrite the passed protection flags.  If we use the current value of
>> > the pgprot as the base, then it will behave as people are expecting.
>> >
>> > Also fix track_pfn_remap() in the same way.
>>
>> Well that's embarrassing.  Presumably it worked for me because I only
>> overrode the cacheability bits and lookup_memtype did the right thing.
>>
>> But shouldn't the PAT code change the memtype if vm_insert_pfn_prot
>> requests it?  Or are there no callers that actually need that?  (HPET
>> doesn't, because there's a plain old ioremapped mapping.)
>
> I'm confused.  Here's what I understand:
>
>  - on x86, the bits in pgprot can be considered as two sets of bits;
>the 'cacheability bits' -- those in _PAGE_CACHE_MASK and the
>'protection bits' -- PRESENT, RW, USER, ACCESSED, NX
>  - The purpose of track_pfn_insert() is to ensure that the cacheability bits
>are the same on all mappings of a given page, as strongly advised by the
>Intel manuals [1].  So track_pfn_insert() is really only supposed to
>modify _PAGE_CACHE_MASK of the passed pgprot, but in fact it ends up
>modifying the protection bits as well, due to the bug.
>
> I don't think you overrode the cacheability bits at all.  It looks to
> me like your patch ends up mapping the HPET into userspace writable.

I sure hope not.  If vm_page_prot was writable, something was already
broken, because this is the vvar mapping, and the vvar mapping is
VM_READ (and not even VM_MAYREAD).

>
> I don't think the vm_insert_pfn_prot() call gets to change the memtype.
> For one, that page may already be mapped into a differet userspace using
> the pre-existing memtype, and [1] continues to bite you.  Then there
> may be outstanding kernel users of the page that's being mapped in.

So why was remap_pfn_range different?  I'm sure there was a reason.

I don't think that whatever_pfn_prot should ever map a page
inconsistently, but I find it surprising that some of the variants
call reserve_memtype to change the memtype and others don't.

Anyway, this is in no way an objection to your patches.

--Andy


RE: [PATCH v3] mptlan: add checks for dma mapping errors

2016-01-26 Thread Sathya Prakash
There is no fusion based network card and resources exists today in
Avago(LSI) to test this patch so we prefer to leave it as is. We would
like to prevent any new changes on MPT (FC/SCSI/SAS/LAN) drivers as we
don't have support for those cards anymore,  is there a way we could
remove those drivers from newer kernels or mark them as unmaintained?.

Thanks
Sathya

-Original Message-
From: mpt-fusionlinux@avagotech.com
[mailto:mpt-fusionlinux@avagotech.com] On Behalf Of Martin K. Petersen
Sent: Tuesday, January 26, 2016 7:23 PM
To: Tomas Henzl
Cc: Alexey Khoroshilov; Sreekanth Reddy;
mpt-fusionlinux@avagotech.com; linux-s...@vger.kernel.org;
linux-kernel@vger.kernel.org; ldv-proj...@linuxtesting.org
Subject: Re: [PATCH v3] mptlan: add checks for dma mapping errors

> "Tomas" == Tomas Henzl  writes:

Tomas> Other than that - previous patch for this driver came in in 2010
Tomas> - six years ago and the driver seems unmaintained now.  I'm not
Tomas> sure if we should fix hw we can't test and when there is not an
Tomas> user bug report. This example nicely shows how easy it is to add
Tomas> new bugs even when a fix looks trivial.

Yeah, I'm inclined to leave it as is.

If somebody provides a Tested-by: I'll reconsider.

-- 
Martin K. Petersen  Oracle Linux Engineering


Re: [PATCH v2] pci: fix unavailable irq number 255 reported by BIOS

2016-01-26 Thread Cao jin



On 01/27/2016 08:25 AM, Bjorn Helgaas wrote:

On Tue, Jan 26, 2016 at 04:48:25PM +0100, Thomas Gleixner wrote:

On Tue, 26 Jan 2016, Bjorn Helgaas wrote:





Right. So we could certainly do something like this INVALID_IRQ thingy, but
that looks a bit weird. What would request_irq() return?

If it returns success, then drivers might make the wrong decision. If it
returns an error code, then the i801 one works, but we might have to fix
others anyway.


I was thinking request_irq() could return -EINVAL if the caller passed
INVALID_IRQ.  That should tell drivers that this interrupt won't work.

We'd be making request_irq() return -EINVAL in some cases where it
currently returns success.  But even though it returns success today,
I don't think the driver is getting interrupts, because the wire isn't
connected.


I think it's better to have a software flag in pci_dev to indicate that there
is no irq line and fix up the (probably few) affected drivers so they avoid
calling request_irq() and take the right action.


We could add an "irq_valid" flag in struct pci_dev and make a new
rule that drivers should check dev->irq_valid before using dev->irq.
But realistically, i801 is the only place that will check irq_valid
because that's the only driver where we know about a problem, so that
seems like sort of a point solution.

Bjorn



How about using IRQ_BITMAP_BITS as that "irq_valid" flag? because it is 
the ceiling of struct irq_desc irq_desc[], and request_irq() will return 
-EINVAL in case of the ceiling.


#ifdef CONFIG_SPARSE_IRQ
# define IRQ_BITMAP_BITS(NR_IRQS + 8196)
#else
# define IRQ_BITMAP_BITSNR_IRQS
#endif


.



--
Yours Sincerely,

Cao jin




Re: [PATCH v4 6/6] drm/dsi: Get DSI host by DT device node

2016-01-26 Thread Archit Taneja



On 01/21/2016 09:46 PM, Thierry Reding wrote:

On Thu, Dec 10, 2015 at 06:11:40PM +0530, Archit Taneja wrote:

mipi_dsi_devices are inherently aware of their host because they
share a parent-child hierarchy in the device tree.

non-dsi drivers that create dsi device don't have this data. In order to
get this information, they require to a phandle to the dsi host in the
device tree.

Maintain a list of all the hosts DSI that are currently registered.

This list will be used to find the mipi_dsi_host corresponding to the
device_node passed in of_find_mipi_dsi_host_by_node.

Reviewed-by: Andrzej Hajda 
Signed-off-by: Archit Taneja 
---
  drivers/gpu/drm/drm_mipi_dsi.c | 38 ++
  include/drm/drm_mipi_dsi.h |  3 +++
  2 files changed, 41 insertions(+)


Please be more consistent with the spelling. Abbreviations should be all
capitals. Also s/mipi_dsi_devices/MIPI DSI devices/, and so on.


I'll ensure the abbreviations are consistent in the next revision.



Otherwise I guess this makes sense.


Thanks for the review.

Thanks,
Archit

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


[RFC PATCH 3/6] of: iommu: Increment DT node refcount in of_iommu_set_ops()

2016-01-26 Thread Anup Patel
We are saving pointer to iommu DT node in of_iommu_set_ops()
hence we should increment DT node ref count.

Signed-off-by: Anup Patel 
Reviewed-by: Ray Jui 
Reviewed-by: Scott Branden 
---
 drivers/iommu/of_iommu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index 60ba238..5fea665 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -110,6 +110,7 @@ void of_iommu_set_ops(struct device_node *np, struct 
iommu_ops *ops)
if (WARN_ON(!iommu))
return;
 
+   of_node_get(np);
INIT_LIST_HEAD(>list);
iommu->np = np;
iommu->ops = ops;
-- 
1.9.1



Re: [PATCH 3/3] dax: Handle write faults more efficiently

2016-01-26 Thread Andy Lutomirski
On Tue, Jan 26, 2016 at 8:17 PM, Matthew Wilcox  wrote:
> On Mon, Jan 25, 2016 at 09:38:19AM -0800, Andy Lutomirski wrote:
>> On Mon, Jan 25, 2016 at 9:25 AM, Matthew Wilcox
>>  wrote:
>> > From: Matthew Wilcox 
>> >
>> > When we handle a write-fault on a DAX mapping, we currently insert a
>> > read-only mapping and then take the page fault again to convert it to
>> > a writable mapping.  This is necessary for the case where we cover a
>> > hole with a read-only zero page, but when we have a data block already
>> > allocated, it is inefficient.
>> >
>> > Use the recently added vmf_insert_pfn_prot() to insert a writable mapping,
>> > even though the default VM flags say to use a read-only mapping.
>>
>> Conceptually, I like this.  Do you need to make sure to do all the
>> do_wp_page work, though?  (E.g. we currently update mtime in there.
>> Some day I'll fix that, but it'll be replaced with a set_bit to force
>> a deferred mtime update.)
>
> We update mtime in the ->fault handler of filesystems which support DAX
> like this:
>
> if (vmf->flags & FAULT_FLAG_WRITE) {
> sb_start_pagefault(inode->i_sb);
> file_update_time(vma->vm_file);
> }
>
> so I think we're covered.

Sounds good.

On second reading, though, what ensures that the vm is
VM_WRITE|VM_SHARED?  If nothing else, some nice comments might help.

A WARN_ON_ONCE that the pgprot you're starting with is RO would be
nice if there's a generic way to do that.  Actually, having a generic
pgprot_writable could make this less ugly.

Also, this optimization could be generalized, albeit a bit slower, by
having handle_pte_fault check if the inserted pte is read-only for a
write fault and continuing down the function to the wp_page logic.
After all, returning back to the arch entry code and retrying the
fault the old fashioned way is both very slow and has an outcome
that's known in advance.

--Andy


Need direction to understand mac80211

2016-01-26 Thread Sunil Shahu
Hi,

I am currently working on an project that aims to provide multiple 802.11ac 
radio support on a single node for mesh network. In this both the radios will 
operate in different channel and will talk to different nodes in mesh network.

I need to work with kernel mac80211 driver subsystem for the same. I went 
through different documentation to understand the theories of 802.11s which can 
help during working on mac80211 driver. However I am not able to understand the 
source code properly. 

Can you please provide some guidance to understand mac80211 and related 
networking stack in Linux kernel.

I am looking for 
1) How to create bridge bridge for two Phy radios during initialization/packet 
forwarding?
2) Also, need some idea about how packets will be routed in mesh_hwmp.
3) How the path request and response should behave in this case?
4) Will there be any changes for mesh path table entries?

Any suggestion for document/book/blog will be great help.

I already went through following materials.
http://kernelnewbies.org/Documents/Kernel-Docbooks?action=AttachFile=get=mac80211_2.6.29.pdf
http://www.campsmur.cat/files/mac80211_intro.pdf
https://www.cwnp.com/uploads/802-11s_mesh_networking_v1-0.pdf
http://www.ieee802.org/802_tutorials/06-November/802.11s_Tutorial_r5.pdf

Any suggestion and directions will be great help.

Thanks,
Sunil Shahu.



[RFC PATCH 5/6] iommu/arm-smmu: Option to treat instruction fetch as data read for SMMUv2

2016-01-26 Thread Anup Patel
Currently, the SMMU driver by default provides unprivilege read-write
permission in page table entries of stage1 page table. For SMMUv2 with
aarch64 long descriptor format, a privilege instruction fetch will
generate context fault. To allow privilege instruction fetch from a
MMU master we need to treat instruction fetch as data read.

This patch adds an optional DT attribute 'smmu-inst-as-data' to treat
privilege/unprivilege instruction fetch as data read for SMMUv2.

Signed-off-by: Anup Patel 
Reviewed-by: Ray Jui 
Reviewed-by: Vikram Prakash 
Reviewed-by: Scott Branden 
---
 drivers/iommu/arm-smmu.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 43424fe..a14850b 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -169,6 +169,9 @@
 #define S2CR_TYPE_TRANS(0 << S2CR_TYPE_SHIFT)
 #define S2CR_TYPE_BYPASS   (1 << S2CR_TYPE_SHIFT)
 #define S2CR_TYPE_FAULT(2 << S2CR_TYPE_SHIFT)
+#define S2CR_INSTCFG_SHIFT 26
+#define S2CR_INSTCFG_MASK  0x3
+#define S2CR_INSTCFG_DATA  (0x2 << S2CR_INSTCFG_SHIFT)
 
 /* Context bank attribute registers */
 #define ARM_SMMU_GR1_CBAR(n)   (0x0 + ((n) << 2))
@@ -305,6 +308,7 @@ struct arm_smmu_device {
u32 features;
 
 #define ARM_SMMU_OPT_SECURE_CFG_ACCESS (1 << 0)
+#define ARM_SMMU_OPT_INST_AS_DATA  (1 << 1)
u32 options;
enum arm_smmu_arch_version  version;
 
@@ -366,6 +370,7 @@ struct arm_smmu_option_prop {
 
 static struct arm_smmu_option_prop arm_smmu_options[] = {
{ ARM_SMMU_OPT_SECURE_CFG_ACCESS, "calxeda,smmu-secure-config-access" },
+   { ARM_SMMU_OPT_INST_AS_DATA, "smmu-inst-as-data" },
{ 0, NULL},
 };
 
@@ -1097,6 +1102,9 @@ static int arm_smmu_domain_add_master(struct 
arm_smmu_domain *smmu_domain,
idx = cfg->smrs ? cfg->smrs[i].idx : cfg->streamids[i];
s2cr = S2CR_TYPE_TRANS |
   (smmu_domain->cfg.cbndx << S2CR_CBNDX_SHIFT);
+   if ((smmu->version == ARM_SMMU_V2) &&
+   (smmu->options & ARM_SMMU_OPT_INST_AS_DATA))
+   s2cr |= S2CR_INSTCFG_DATA;
writel_relaxed(s2cr, gr0_base + ARM_SMMU_GR0_S2CR(idx));
}
 
-- 
1.9.1



[RFC PATCH 6/6] iommu/arm-smmu: Update bindings document for smmu-inst-as-data DT option

2016-01-26 Thread Anup Patel
This patch adds info about 'smmu-inst-as-data' DT option in ARM
SMMUv1/SMMUv2 driver bindings document.

Signed-off-by: Anup Patel 
Reviewed-by: Ray Jui 
Reviewed-by: Vikram Prakash 
Reviewed-by: Scott Branden 
---
 Documentation/devicetree/bindings/iommu/arm,smmu.txt | 8 
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.txt 
b/Documentation/devicetree/bindings/iommu/arm,smmu.txt
index 7180745..4c4d03e 100644
--- a/Documentation/devicetree/bindings/iommu/arm,smmu.txt
+++ b/Documentation/devicetree/bindings/iommu/arm,smmu.txt
@@ -49,6 +49,14 @@ conditions.
   NOTE: this only applies to the SMMU itself, not
   masters connected upstream of the SMMU.
 
+- smmu-inst-as-data : Treat privilege/unprivilege instruction fetch as
+  data read for SMMUv2. The SMMU driver by default provides
+  unprivilege read-write permission in page table entries.
+  For SMMUv2, privilege instruction fetch from MMU masters
+  will cause a context fault for unprivilege read-write
+  pages. To allow both privilege and unprivilege instruction
+  fetch, we have to forcefully treat it as data read.
+
 - calxeda,smmu-secure-config-access : Enable proper handling of buggy
   implementations that always use secure access to
   SMMU configuration registers. In this case non-secure
-- 
1.9.1



[RFC PATCH 1/6] iommu/arm-smmu: Init driver using IOMMU_OF_DECLARE

2016-01-26 Thread Anup Patel
From: Sricharan R 

This patch uses IOMMU_OF_DECLARE to register the driver
and the iommu_ops. So when master devices of the iommu are
registered, of_xlate callback can be used to add the master
configurations to the smmu driver.

Signed-off-by: Sricharan R 
Signed-off-by: Anup Patel 
Tested-by: Anup Patel 
---
 drivers/iommu/arm-smmu.c | 35 ++-
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 59ee4b8..22b9668 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -257,6 +258,8 @@
 #define FSYNR0_WNR (1 << 4)
 
 static int force_stage;
+static bool init_done;
+
 module_param_named(force_stage, force_stage, int, S_IRUGO);
 MODULE_PARM_DESC(force_stage,
"Force SMMU mappings to be installed at a particular stage of 
translation. A value of '1' or '2' forces the corresponding stage. All other 
values are ignored (i.e. no stage is forced). Note that selecting a specific 
stage will disable support for nested translation.");
@@ -1885,20 +1888,8 @@ static struct platform_driver arm_smmu_driver = {
 
 static int __init arm_smmu_init(void)
 {
-   struct device_node *np;
int ret;
 
-   /*
-* Play nice with systems that don't have an ARM SMMU by checking that
-* an ARM SMMU exists in the system before proceeding with the driver
-* and IOMMU bus operation registration.
-*/
-   np = of_find_matching_node(NULL, arm_smmu_of_match);
-   if (!np)
-   return 0;
-
-   of_node_put(np);
-
ret = platform_driver_register(_smmu_driver);
if (ret)
return ret;
@@ -1917,15 +1908,33 @@ static int __init arm_smmu_init(void)
bus_set_iommu(_bus_type, _smmu_ops);
 #endif
 
+   init_done = true;
+
return 0;
 }
 
+static int __init arm_smmu_of_setup(struct device_node *np)
+{
+
+   if (!init_done)
+   arm_smmu_init();
+
+   of_iommu_set_ops(np, _smmu_ops);
+
+   return 0;
+}
+
+IOMMU_OF_DECLARE(arm_smmu_v1, "arm,smmu-v1", arm_smmu_of_setup);
+IOMMU_OF_DECLARE(arm_smmu_v2, "arm,smmu-v2", arm_smmu_of_setup);
+IOMMU_OF_DECLARE(arm_smmu_400, "arm,mmu-400", arm_smmu_of_setup);
+IOMMU_OF_DECLARE(arm_smmu_401, "arm,mmu-401", arm_smmu_of_setup);
+IOMMU_OF_DECLARE(arm_smmu_500, "arm,mmu-500", arm_smmu_of_setup);
+
 static void __exit arm_smmu_exit(void)
 {
return platform_driver_unregister(_smmu_driver);
 }
 
-subsys_initcall(arm_smmu_init);
 module_exit(arm_smmu_exit);
 
 MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
-- 
1.9.1



[RFC PATCH 4/6] iommu/arm-smmu: Add support for IOMMU_DOMAIN_DMA in SMMUv1/SMMUv2 driver

2016-01-26 Thread Anup Patel
To allow use of large memory (> 4Gb) with 32bit devices we need to use
some kind of iommu for such 32bit devices.

This patch extends SMMUv1/SMMUv2 driver to support DMA domains which
in-turn will allows us to use iommu based DMA mappings for 32bit devices.

Signed-off-by: Anup Patel 
Reviewed-by: Ray Jui 
Reviewed-by: Scott Branden 
---
 drivers/iommu/arm-smmu.c | 21 -
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 9bdf6b2..43424fe 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -29,6 +29,7 @@
 #define pr_fmt(fmt) "arm-smmu: " fmt
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -967,7 +968,7 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned 
type)
 {
struct arm_smmu_domain *smmu_domain;
 
-   if (type != IOMMU_DOMAIN_UNMANAGED)
+   if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA)
return NULL;
/*
 * Allocate the domain and initialise some of its data structures.
@@ -978,6 +979,12 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned 
type)
if (!smmu_domain)
return NULL;
 
+   if (type == IOMMU_DOMAIN_DMA &&
+   iommu_get_dma_cookie(_domain->domain)) {
+   kfree(smmu_domain);
+   return NULL;
+   }
+
mutex_init(_domain->init_mutex);
spin_lock_init(_domain->pgtbl_lock);
 
@@ -992,6 +999,7 @@ static void arm_smmu_domain_free(struct iommu_domain 
*domain)
 * Free the domain resources. We assume that all devices have
 * already been detached.
 */
+   iommu_put_dma_cookie(domain);
arm_smmu_destroy_domain_context(domain);
kfree(smmu_domain);
 }
@@ -1361,6 +1369,16 @@ static int arm_smmu_init_platform_device(struct device 
*dev,
return 0;
 }
 
+int arm_smmu_of_xlate(struct device *dev, struct of_phandle_args *args)
+{
+   /*
+* Nothing to do here because SMMU is already aware of all
+* MMU masters and their stream IDs using mmu-master attibute
+* SMMU DT node.
+*/
+   return 0;
+}
+
 static int arm_smmu_add_device(struct device *dev)
 {
struct iommu_group *group;
@@ -1458,6 +1476,7 @@ static struct iommu_ops arm_smmu_ops = {
.unmap  = arm_smmu_unmap,
.map_sg = default_iommu_map_sg,
.iova_to_phys   = arm_smmu_iova_to_phys,
+   .of_xlate   = arm_smmu_of_xlate,
.add_device = arm_smmu_add_device,
.remove_device  = arm_smmu_remove_device,
.device_group   = arm_smmu_device_group,
-- 
1.9.1



[RFC PATCH 0/6] iommu/arm-smmu: Add support for DMA domains and instruction fetch

2016-01-26 Thread Anup Patel
This patchset adds following to SMMUv1/SMMUv2 driver:
1. Support for domain type IOMMU_DOMAIN_DMA
2. Allow privilege instruction fetchs from MMU masters by having
a DT option to treat instruction fetch as data read

The patchset is based on '4.5-rc1' tag of linux mainline tree
and is available in smmu_v1 branch of
https://github.com/Broadcom/arm64-linux.git

All patches have been tested on Broadcom SoCs having SMMU-500.

Anup Patel (5):
  iommu/arm-smmu: Invoke DT probe from arm_smmu_of_setup()
  of: iommu: Increment DT node refcount in of_iommu_set_ops()
  iommu/arm-smmu: Add support for IOMMU_DOMAIN_DMA in SMMUv1/SMMUv2
driver
  iommu/arm-smmu: Option to treat instruction fetch as data read for
SMMUv2
  iommu/arm-smmu: Update bindings document for smmu-inst-as-data DT
option

Sricharan R (1):
  iommu/arm-smmu: Init driver using IOMMU_OF_DECLARE

 .../devicetree/bindings/iommu/arm,smmu.txt |  8 +++
 drivers/iommu/arm-smmu.c   | 70 +-
 drivers/iommu/of_iommu.c   |  1 +
 3 files changed, 65 insertions(+), 14 deletions(-)

-- 
1.9.1



[RFC PATCH 2/6] iommu/arm-smmu: Invoke DT probe from arm_smmu_of_setup()

2016-01-26 Thread Anup Patel
The SMMUv1/SMMUv2 driver is initialized very early using the
IOMMU_OF_DECLARE() but the actual platform device is probed
via normal DT probing.

This patch uses of_platform_device_create() from arm_smmu_of_setup()
to ensure that SMMU platform device is probed immediately.

Signed-off-by: Anup Patel 
---
 drivers/iommu/arm-smmu.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c
index 22b9668..9bdf6b2 100644
--- a/drivers/iommu/arm-smmu.c
+++ b/drivers/iommu/arm-smmu.c
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1915,10 +1916,15 @@ static int __init arm_smmu_init(void)
 
 static int __init arm_smmu_of_setup(struct device_node *np)
 {
+   struct platform_device *pdev;
 
if (!init_done)
arm_smmu_init();
 
+   pdev = of_platform_device_create(np, NULL, NULL);
+   if (IS_ERR(pdev))
+   return PTR_ERR(pdev);
+
of_iommu_set_ops(np, _smmu_ops);
 
return 0;
-- 
1.9.1



Re: [PATCH v4 5/6] drm/dsi: Add routine to unregister dsi device

2016-01-26 Thread Archit Taneja



On 01/21/2016 09:42 PM, Thierry Reding wrote:

On Thu, Dec 10, 2015 at 06:11:39PM +0530, Archit Taneja wrote:

A driver calling mipi_dsi_device_new might want to unregister the device
once it's done. It might also require it in an error handling path in
case something didn't go right.

Reviewed-by: Andrzej Hajda 
Signed-off-by: Archit Taneja 
---
  include/drm/drm_mipi_dsi.h | 5 +
  1 file changed, 5 insertions(+)

diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index cb084af..410d8b5 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -195,6 +195,11 @@ ssize_t mipi_dsi_generic_read(struct mipi_dsi_device *dsi, 
const void *params,

  struct mipi_dsi_device *mipi_dsi_device_new(struct mipi_dsi_host *host,
struct mipi_dsi_device_info *info);
+static inline void mipi_dsi_device_unregister(struct mipi_dsi_device *dsi)
+{
+   device_unregister(>dev);
+}


This is the same, essentially, as mipi_dsi_remove_device_fn(). I think
this should move into drm_mipi_dsi.c and mipi_dsi_remove_device_fn()
should call this new function so that both OF and !OF share the same
code for this.


I can do this.

Thanks,
Archit


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


Re: [PATCH] KEYS: Only apply KEY_FLAG_KEEP to a key if a parent keyring has it set

2016-01-26 Thread James Morris
On Wed, 27 Jan 2016, David Howells wrote:

> Hi James,
> 
> Can you pass this onto Linus asap?  The thing it fixes breaks kerberos and
> sssd.
> 

I'd like to see some acks on this.


-- 
James Morris




Re: [PATCH v4 4/6] drm/dsi: Check for used channels

2016-01-26 Thread Archit Taneja



On 01/21/2016 09:41 PM, Thierry Reding wrote:

On Thu, Dec 10, 2015 at 06:11:38PM +0530, Archit Taneja wrote:

We don't check whether a previously registered mipi_dsi_device under the
same host shares the same virtual channel.

Before registering, check if any of the registered devices doesn't
already have the same virtual channel.

This wasn't crucial when all the devices under a host were populated via
DT. Now that we also support creating devices manually, we could end up
in a situation where a driver tries to create a device with a virtual
channel already taken by a device populated in DT.

Reviewed-by: Andrzej Hajda 
Signed-off-by: Archit Taneja 
---
  drivers/gpu/drm/drm_mipi_dsi.c | 26 --
  1 file changed, 24 insertions(+), 2 deletions(-)


I don't think this is necessary. The device name will be composed of the
host's name, a '.' and the virtual channel ID, and the device core will
refuse to create two devices with the same name.


That's a good point. I'll drop this patch.

Archit



Thierry



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


[RFC PATCH 18/21] mmc: sdhci-pltfm: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
We already call mmc_of_parse to get "broken-cd", so just
remove it here.

Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-pltfm.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 8b0fa73..dae5d0ba9 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -91,9 +91,6 @@ int sdhci_get_of_property(struct platform_device *pdev)
if (sdhci_of_wp_inverted(np))
host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
 
-   if (of_get_property(np, "broken-cd", NULL))
-   host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
-
if (of_get_property(np, "no-1-8-v", NULL))
host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
 
-- 
2.3.7




[RFC PATCH 19/21] mmc: sdhci-pxav2: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
It already claims MMC_CAP_NONREMOVABLE, so we just remove the
quirk here since we don't need non-removeble and broken-cd together.

Cc: Jisheng Zhang 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-pxav2.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pxav2.c b/drivers/mmc/host/sdhci-pxav2.c
index beffd86..8aa2c31 100644
--- a/drivers/mmc/host/sdhci-pxav2.c
+++ b/drivers/mmc/host/sdhci-pxav2.c
@@ -199,7 +199,6 @@ static int sdhci_pxav2_probe(struct platform_device *pdev)
if (pdata) {
if (pdata->flags & PXA_FLAG_CARD_PERMANENT) {
/* on-chip device */
-   host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
host->mmc->caps |= MMC_CAP_NONREMOVABLE;
}
 
-- 
2.3.7




[RFC PATCH 20/21] mmc: sdhci-s3c: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
This patch remove SDHCI_QUIRK_BROKEN_CARD_DETECTION and use
MMC_CAP_NEEDS_POLL to claim "broken-cd".

Cc: Jaehoon Chung 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-s3c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 70c724b..dd25767 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -571,7 +571,7 @@ static int sdhci_s3c_probe(struct platform_device *pdev)
 
if (pdata->cd_type == S3C_SDHCI_CD_NONE ||
pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
-   host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   host->mmc->caps |= MMC_CAP_NEEDS_POLL;
 
if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
host->mmc->caps = MMC_CAP_NONREMOVABLE;
-- 
2.3.7




[RFC PATCH 21/21] mmc: sdhci.h: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
We remove SDHCI_QUIRK_BROKEN_CARD_DETECTION since now
sdhci core and variant drivers will not use it. And we
also move up the quirk number one-by-one.

Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci.h | 30 ++
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 7654ae5..41988ef 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -356,36 +356,34 @@ struct sdhci_host {
 #define SDHCI_QUIRK_BROKEN_SMALL_PIO   (1<<13)
 /* Controller does not provide transfer-complete interrupt when not busy */
 #define SDHCI_QUIRK_NO_BUSY_IRQ(1<<14)
-/* Controller has unreliable card detection */
-#define SDHCI_QUIRK_BROKEN_CARD_DETECTION  (1<<15)
 /* Controller reports inverted write-protect state */
-#define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16)
+#define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<15)
 /* Controller does not like fast PIO transfers */
-#define SDHCI_QUIRK_PIO_NEEDS_DELAY(1<<18)
+#define SDHCI_QUIRK_PIO_NEEDS_DELAY(1<<16)
 /* Controller has to be forced to use block size of 2048 bytes */
-#define SDHCI_QUIRK_FORCE_BLK_SZ_2048  (1<<20)
+#define SDHCI_QUIRK_FORCE_BLK_SZ_2048  (1<<17)
 /* Controller cannot do multi-block transfers */
-#define SDHCI_QUIRK_NO_MULTIBLOCK  (1<<21)
+#define SDHCI_QUIRK_NO_MULTIBLOCK  (1<<18)
 /* Controller can only handle 1-bit data transfers */
-#define SDHCI_QUIRK_FORCE_1_BIT_DATA   (1<<22)
+#define SDHCI_QUIRK_FORCE_1_BIT_DATA   (1<<19)
 /* Controller needs 10ms delay between applying power and clock */
-#define SDHCI_QUIRK_DELAY_AFTER_POWER  (1<<23)
+#define SDHCI_QUIRK_DELAY_AFTER_POWER  (1<<20)
 /* Controller uses SDCLK instead of TMCLK for data timeouts */
-#define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK(1<<24)
+#define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK(1<<21)
 /* Controller reports wrong base clock capability */
-#define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN  (1<<25)
+#define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN  (1<<22)
 /* Controller cannot support End Attribute in NOP ADMA descriptor */
-#define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC  (1<<26)
+#define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC  (1<<23)
 /* Controller is missing device caps. Use caps provided by host */
-#define SDHCI_QUIRK_MISSING_CAPS   (1<<27)
+#define SDHCI_QUIRK_MISSING_CAPS   (1<<24)
 /* Controller uses Auto CMD12 command to stop the transfer */
-#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28)
+#define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<25)
 /* Controller doesn't have HISPD bit field in HI-SPEED SD card */
-#define SDHCI_QUIRK_NO_HISPD_BIT   (1<<29)
+#define SDHCI_QUIRK_NO_HISPD_BIT   (1<<26)
 /* Controller treats ADMA descriptors with length h incorrectly */
-#define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC   (1<<30)
+#define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC   (1<<27)
 /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */
-#define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31)
+#define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<28)
 
unsigned int quirks2;   /* More deviations from spec. */
 
-- 
2.3.7




[RFC PATCH 15/21] mmc: sdhci-msm: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
We just replcae SDHCI_QUIRK_BROKEN_CARD_DETECTION with
MMC_CAP_NEEDS_POLL.

Cc: Georgi Djakov 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-msm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index dfc6016..3274871 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -520,7 +520,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
/* Set HC_MODE_EN bit in HC_MODE register */
writel_relaxed(HC_MODE_EN, (msm_host->core_mem + CORE_HC_MODE));
 
-   host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   host->mmc->caps |= MMC_CAP_NEEDS_POLL;
host->quirks |= SDHCI_QUIRK_SINGLE_POWER_WRITE;
 
host_version = readw_relaxed((host->ioaddr + SDHCI_HOST_VERSION));
-- 
2.3.7




[RFC PATCH 14/21] mmc: sdhci-esdhc-imx: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
sdhci_esdhc_imx_pdata need SDHCI_QUIRK_BROKEN_CARD_DETECTION,
so we replace it with MMC_CAP_NEEDS_POLL while probing. For other
cases, we directly remove SDHCI_QUIRK_BROKEN_CARD_DETECTION.

Cc: Dong Aisheng 
Cc: Haibo Chen 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-esdhc-imx.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c 
b/drivers/mmc/host/sdhci-esdhc-imx.c
index f25f292..5705be1 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -952,8 +952,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
 static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_HISPD_BIT
| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
-   | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC
-   | SDHCI_QUIRK_BROKEN_CARD_DETECTION,
+   | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC,
.ops = _esdhc_ops,
 };
 
@@ -1012,7 +1011,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
return ret;
 
if (!IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc)))
-   host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   host->mmc->caps &= MMC_CAP_NEEDS_POLL;
 
return 0;
 }
@@ -1064,7 +1063,7 @@ static int sdhci_esdhc_imx_probe_nondt(struct 
platform_device *pdev,
 
case ESDHC_CD_CONTROLLER:
/* we have a working card_detect back */
-   host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   host->mmc->caps &= MMC_CAP_NEEDS_POLL;
break;
 
case ESDHC_CD_PERMANENT:
@@ -1104,6 +1103,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device 
*pdev)
if (IS_ERR(host))
return PTR_ERR(host);
 
+   host->mmc->caps |= MMC_CAP_NEEDS_POLL;
+
pltfm_host = sdhci_priv(host);
 
imx_data = devm_kzalloc(>dev, sizeof(*imx_data), GFP_KERNEL);
-- 
2.3.7




[RFC PATCH 16/21] mmc: sdhci-of-esdhc: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
This patch just remove SDHCI_QUIRK_BROKEN_CARD_DETECTION, and
use MMC_CAP_NEEDS_POLL if needed.

Cc: yangbo lu 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-of-esdhc.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c 
b/drivers/mmc/host/sdhci-of-esdhc.c
index 7fc0edc..df4fa8b 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -549,16 +549,16 @@ static const struct sdhci_ops sdhci_esdhc_le_ops = {
 };
 
 static const struct sdhci_pltfm_data sdhci_esdhc_be_pdata = {
-   .quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_CARD_DETECTION
-   | SDHCI_QUIRK_NO_CARD_NO_RESET
-   | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
+   .quirks = ESDHC_DEFAULT_QUIRKS |
+ SDHCI_QUIRK_NO_CARD_NO_RESET |
+ SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
.ops = _esdhc_be_ops,
 };
 
 static const struct sdhci_pltfm_data sdhci_esdhc_le_pdata = {
-   .quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_BROKEN_CARD_DETECTION
-   | SDHCI_QUIRK_NO_CARD_NO_RESET
-   | SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
+   .quirks = ESDHC_DEFAULT_QUIRKS |
+ SDHCI_QUIRK_NO_CARD_NO_RESET |
+ SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
.ops = _esdhc_le_ops,
 };
 
@@ -595,6 +595,8 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)
else
host = sdhci_pltfm_init(pdev, _esdhc_be_pdata, 0);
 
+   host->mmc->caps |= MMC_CAP_NEEDS_POLL;
+
if (IS_ERR(host))
return PTR_ERR(host);
 
@@ -618,7 +620,7 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)
of_device_is_compatible(np, "fsl,p1020-esdhc") ||
of_device_is_compatible(np, "fsl,t1040-esdhc") ||
of_device_is_compatible(np, "fsl,ls1021a-esdhc"))
-   host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+   host->caps &= ~MMC_CAP_NEEDS_POLL;
 
if (of_device_is_compatible(np, "fsl,ls1021a-esdhc"))
host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
-- 
2.3.7




[RFC PATCH 17/21] mmc: sdhci-pci-core: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
This patch remove SDHCI_QUIRK_BROKEN_CARD_DETECTION and add
MMC_CAP_NEEDS_POLL for PCI_DEVICE_ID_MARVELL_88ALP01_SD

Cc: Adrian Hunter 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-pci-core.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-pci-core.c 
b/drivers/mmc/host/sdhci-pci-core.c
index cc851b0..1f6d3f6 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -101,7 +101,6 @@ static const struct sdhci_pci_fixes sdhci_ene_714 = {
 static const struct sdhci_pci_fixes sdhci_cafe = {
.quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER |
  SDHCI_QUIRK_NO_BUSY_IRQ |
- SDHCI_QUIRK_BROKEN_CARD_DETECTION |
  SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
 };
 
@@ -1612,6 +1611,10 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot(
host->quirks = chip->quirks;
host->quirks2 = chip->quirks2;
 
+   if ((chip->pdev->vendor == PCI_VENDOR_ID_MARVELL) &&
+   (chip->pdev->device == PCI_DEVICE_ID_MARVELL_88ALP01_SD))
+   host->mmc->caps |= MMC_CAP_NEEDS_POLL;
+
host->irq = pdev->irq;
 
ret = pci_request_region(pdev, bar, mmc_hostname(host->mmc));
-- 
2.3.7




[RFC PATCH 11/21] mmc: sdhci-acpi: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
sdhci-acpi already add MMC_CAP_NONREMOVABLE for caps, so
there is no need to add SDHCI_QUIRK_BROKEN_CARD_DETECTION.

Cc: Adrian Hunter 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-acpi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index f6047fc..cb43098 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -214,8 +214,7 @@ static const struct sdhci_acpi_slot 
sdhci_acpi_slot_int_emmc = {
 };
 
 static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = {
-   .quirks  = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
-  SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
+   .quirks  = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
.quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON,
.caps= MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD |
   MMC_CAP_BUS_WIDTH_TEST | MMC_CAP_WAIT_WHILE_BUSY,
-- 
2.3.7




[RFC PATCH 12/21] mmc: sdhci-bcm-kona: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
If MMC_CAP_NONREMOVABLE is provided, SDHCI_QUIRK_BROKEN_CARD_DETECTION
is redunant.

Cc: Ray Jui 
Cc: Florian Fainelli 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-bcm-kona.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-bcm-kona.c 
b/drivers/mmc/host/sdhci-bcm-kona.c
index 00a8a40..2bd541f0 100644
--- a/drivers/mmc/host/sdhci-bcm-kona.c
+++ b/drivers/mmc/host/sdhci-bcm-kona.c
@@ -269,9 +269,6 @@ static int sdhci_bcm_kona_probe(struct platform_device 
*pdev)
(mmc_gpio_get_cd(host->mmc) != -ENOSYS) ? 'Y' : 'N',
(mmc_gpio_get_ro(host->mmc) != -ENOSYS) ? 'Y' : 'N');
 
-   if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
-   host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
-
dev_dbg(dev, "is_8bit=%c\n",
(host->mmc->caps & MMC_CAP_8_BIT_DATA) ? 'Y' : 'N');
 
-- 
2.3.7




[RFC PATCH 13/21] mmc: sdhci-bcm2835: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
It seems SDHCI_QUIRK_BROKEN_CARD_DETECTION is a must quirk for
this driver, so we remove SDHCI_QUIRK_BROKEN_CARD_DETECTION and
add MMC_CAP_NEEDS_POLL for it.

Cc: Florian Fainelli 
Cc: Ray Jui 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-bcm2835.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-bcm2835.c b/drivers/mmc/host/sdhci-bcm2835.c
index 1c65d46..b34115c 100644
--- a/drivers/mmc/host/sdhci-bcm2835.c
+++ b/drivers/mmc/host/sdhci-bcm2835.c
@@ -140,8 +140,7 @@ static const struct sdhci_ops bcm2835_sdhci_ops = {
 };
 
 static const struct sdhci_pltfm_data bcm2835_sdhci_pdata = {
-   .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
- SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK,
+   .quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK,
.ops = _sdhci_ops,
 };
 
@@ -156,6 +155,8 @@ static int bcm2835_sdhci_probe(struct platform_device *pdev)
if (IS_ERR(host))
return PTR_ERR(host);
 
+   host->mmc->caps |= MMC_CAP_NEEDS_POLL;
+
bcm2835_host = devm_kzalloc(>dev, sizeof(*bcm2835_host),
GFP_KERNEL);
if (!bcm2835_host) {
-- 
2.3.7




[RFC PATCH 09/21] mmc: sdhci_f_sdh30: check sdhci_get_of_property return value

2016-01-26 Thread Shawn Lin
sdhci_get_of_property may failed while probing, so we check
the return value here.

Cc: Vincent Yang 
Cc: Andy Green 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci_f_sdh30.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
index 983b8b3..405e765 100644
--- a/drivers/mmc/host/sdhci_f_sdh30.c
+++ b/drivers/mmc/host/sdhci_f_sdh30.c
@@ -132,7 +132,10 @@ static int sdhci_f_sdh30_probe(struct platform_device 
*pdev)
 
platform_set_drvdata(pdev, host);
 
-   sdhci_get_of_property(pdev);
+   ret = sdhci_get_of_property(pdev);
+   if (ret)
+   goto err;
+
host->hw_name = "f_sdh30";
host->ops = _f_sdh30_ops;
host->irq = irq;
-- 
2.3.7




[RFC PATCH 10/21] mmc: sdhci: remove SDHCI_QUIRK_BROKEN_CARD_DETECTION

2016-01-26 Thread Shawn Lin
SDHCI_QUIRK_BROKEN_CARD_DETECTION is for "broken-cd".
If we add MMC_CAP_NONREMOVABLE("non-removeble"), we shoud
not add "broken-cd" together according to mmc.txt for
dt-bingdings. Also, "broken-cd" can obtain from mmc_of_parse,
which will add MMC_CAP_NEEDS_POLL into mmc->caps.

Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci.c | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index d622435..b208cb7 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -145,7 +145,7 @@ static void sdhci_set_card_detection(struct sdhci_host 
*host, bool enable)
 {
u32 present;
 
-   if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) ||
+   if ((host->mmc->caps & MMC_CAP_NEEDS_POLL) ||
(host->mmc->caps & MMC_CAP_NONREMOVABLE))
return;
 
@@ -1618,7 +1618,8 @@ static int sdhci_do_get_cd(struct sdhci_host *host)
return 0;
 
/* If nonremovable, assume that the card is always present. */
-   if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
+   if (host->mmc->caps & MMC_CAP_NONREMOVABLE ||
+   host->mmc->caps & MMC_CAP_NEEDS_POLL)
return 1;
 
/*
@@ -1628,10 +1629,6 @@ static int sdhci_do_get_cd(struct sdhci_host *host)
if (!IS_ERR_VALUE(gpio_cd))
return !!gpio_cd;
 
-   /* If polling, assume that the card is always present. */
-   if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
-   return 1;
-
/* Host native card detect */
return !!(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT);
 }
@@ -2658,7 +2655,7 @@ void sdhci_enable_irq_wakeups(struct sdhci_host *host)
val = sdhci_readb(host, SDHCI_WAKE_UP_CONTROL);
val |= mask ;
/* Avoid fake wake up */
-   if (host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION)
+   if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
val &= ~(SDHCI_WAKE_ON_INSERT | SDHCI_WAKE_ON_REMOVE);
sdhci_writeb(host, val, SDHCI_WAKE_UP_CONTROL);
 }
@@ -3112,8 +3109,7 @@ int sdhci_add_host(struct sdhci_host *host)
if (caps[0] & SDHCI_CAN_DO_HISPD)
mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
 
-   if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
-   !(mmc->caps & MMC_CAP_NONREMOVABLE) &&
+   if (!(mmc->caps & MMC_CAP_NONREMOVABLE) &&
IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc)))
mmc->caps |= MMC_CAP_NEEDS_POLL;
 
-- 
2.3.7




[RFC PATCH 07/21] mmc: sdhci-pxav3: consolidate parsing path

2016-01-26 Thread Shawn Lin
This patch remove mmc_of_parse and check return value
of sdhci_get_of_property.

Cc: Jisheng Zhang 
Cc: Gregory CLEMENT 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-pxav3.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index f5edf9d..06eda25 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -410,10 +410,8 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 
match = of_match_device(of_match_ptr(sdhci_pxav3_of_match), >dev);
if (match) {
-   ret = mmc_of_parse(host->mmc);
-   if (ret)
+   ret = sdhci_get_of_property(pdev);
goto err_of_parse;
-   sdhci_get_of_property(pdev);
pdata = pxav3_get_mmc_pdata(dev);
pdev->dev.platform_data = pdata;
} else if (pdata) {
-- 
2.3.7




[RFC PATCH 08/21] mmc: sdhci-sirf: check sdhci_get_of_property return value

2016-01-26 Thread Shawn Lin
sdhci_get_of_property may failed while probing, so we check
the return value here.

Cc: Barry Song 
Cc: Weijun Yang 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-sirf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c
index 34866f6..3f8499f 100644
--- a/drivers/mmc/host/sdhci-sirf.c
+++ b/drivers/mmc/host/sdhci-sirf.c
@@ -195,7 +195,9 @@ static int sdhci_sirf_probe(struct platform_device *pdev)
priv = sdhci_pltfm_priv(pltfm_host);
priv->gpio_cd = gpio_cd;
 
-   sdhci_get_of_property(pdev);
+   ret = sdhci_get_of_property(pdev);
+   if (ret)
+   return ret;
 
ret = clk_prepare_enable(pltfm_host->clk);
if (ret)
-- 
2.3.7




[RFC PATCH 02/21] mmc: sdhci-iproc: consolidate parsing path

2016-01-26 Thread Shawn Lin
This patch remove mmc_of_parse and check return value
of sdhci_get_of_property.

Cc: Scott Branden 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-iproc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c
index 3b423b0..18cfe2c 100644
--- a/drivers/mmc/host/sdhci-iproc.c
+++ b/drivers/mmc/host/sdhci-iproc.c
@@ -196,8 +196,9 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
 
iproc_host->data = iproc_data;
 
-   mmc_of_parse(host->mmc);
-   sdhci_get_of_property(pdev);
+   ret = sdhci_get_of_property(pdev);
+   if (ret)
+   return ret;
 
/* Enable EMMC 1/8V DDR capable */
host->mmc->caps |= MMC_CAP_1_8V_DDR;
-- 
2.3.7




[RFC PATCH 06/21] mmc: sdhci-of-esdhc: consolidate parsing path

2016-01-26 Thread Shawn Lin
This patch remove mmc_of_parse and check return value
of sdhci_get_of_property.

Cc: yangbo lu 
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-of-esdhc.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c 
b/drivers/mmc/host/sdhci-of-esdhc.c
index 83b1226..7fc0edc 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -600,7 +600,9 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)
 
esdhc_init(pdev, host);
 
-   sdhci_get_of_property(pdev);
+   ret = sdhci_get_of_property(pdev);
+   if (ret)
+   goto err;
 
pltfm_host = sdhci_priv(host);
esdhc = pltfm_host->priv;
@@ -629,11 +631,6 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)
host->quirks2 |= SDHCI_QUIRK2_BROKEN_HOST_CONTROL;
}
 
-   /* call to generic mmc_of_parse to support additional capabilities */
-   ret = mmc_of_parse(host->mmc);
-   if (ret)
-   goto err;
-
mmc_of_parse_voltage(np, >ocr_mask);
 
ret = sdhci_add_host(host);
-- 
2.3.7




[RFC PATCH 01/21] mmc: sdhci-pltfm: consolidate parsing path

2016-01-26 Thread Shawn Lin
This patch wrapper mmc_of_parse into sdhci_get_of_property,
and change the return value for variant drivers to check it.

Signed-off-by: Shawn Lin 

---

 drivers/mmc/host/sdhci-pltfm.c | 23 +++
 drivers/mmc/host/sdhci-pltfm.h |  2 +-
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 072bb27..8b0fa73 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -66,12 +66,19 @@ static bool sdhci_of_wp_inverted(struct device_node *np)
 #endif /* CONFIG_PPC */
 }
 
-void sdhci_get_of_property(struct platform_device *pdev)
+int sdhci_get_of_property(struct platform_device *pdev)
 {
struct device_node *np = pdev->dev.of_node;
struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
u32 bus_width;
+   int ret;
+
+   ret = mmc_of_parse(host->mmc);
+   if (ret) {
+   dev_err(>dev, "mmc_of_parse failed!\n");
+   return ret;
+   }
 
if (of_get_property(np, "sdhci,auto-cmd12", NULL))
host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
@@ -107,9 +114,11 @@ void sdhci_get_of_property(struct platform_device *pdev)
if (of_property_read_bool(np, "wakeup-source") ||
of_property_read_bool(np, "enable-sdio-wakeup")) /* legacy */
host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
+
+   return 0;
 }
 #else
-void sdhci_get_of_property(struct platform_device *pdev) {}
+int sdhci_get_of_property(struct platform_device *pdev) {}
 #endif /* CONFIG_OF */
 EXPORT_SYMBOL_GPL(sdhci_get_of_property);
 
@@ -207,12 +216,18 @@ int sdhci_pltfm_register(struct platform_device *pdev,
if (IS_ERR(host))
return PTR_ERR(host);
 
-   sdhci_get_of_property(pdev);
+   ret = sdhci_get_of_property(pdev);
+   if (ret)
+   goto err_register;
 
ret = sdhci_add_host(host);
if (ret)
-   sdhci_pltfm_free(pdev);
+   goto err_register;
+
+   return 0;
 
+err_register:
+   sdhci_pltfm_free(pdev);
return ret;
 }
 EXPORT_SYMBOL_GPL(sdhci_pltfm_register);
diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
index 04bc248..2da8065 100644
--- a/drivers/mmc/host/sdhci-pltfm.h
+++ b/drivers/mmc/host/sdhci-pltfm.h
@@ -91,7 +91,7 @@ static inline void sdhci_be32bs_writeb(struct sdhci_host 
*host, u8 val, int reg)
 }
 #endif /* CONFIG_MMC_SDHCI_BIG_ENDIAN_32BIT_BYTE_SWAPPER */
 
-extern void sdhci_get_of_property(struct platform_device *pdev);
+extern int sdhci_get_of_property(struct platform_device *pdev);
 
 extern struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
  const struct sdhci_pltfm_data *pdata,
-- 
2.3.7




[RFC PATCH 04/21] mmc: sdhci-of-arasan: consolidate parsing path

2016-01-26 Thread Shawn Lin
This patch remove mmc_of_parse and check return value
of sdhci_get_of_property.

Cc: Michal Simek 
Cc: soren.brinkm...@xilinx.com
Signed-off-by: Shawn Lin 
---

 drivers/mmc/host/sdhci-of-arasan.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-arasan.c 
b/drivers/mmc/host/sdhci-of-arasan.c
index 75379cb..b653ec7 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -177,17 +177,14 @@ static int sdhci_arasan_probe(struct platform_device 
*pdev)
host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
}
 
-   sdhci_get_of_property(pdev);
+   ret = sdhci_get_of_property(pdev);
+   if (ret)
+   goto clk_disable_all;
+
pltfm_host = sdhci_priv(host);
pltfm_host->priv = sdhci_arasan;
pltfm_host->clk = clk_xin;
 
-   ret = mmc_of_parse(host->mmc);
-   if (ret) {
-   dev_err(>dev, "parsing dt failed (%u)\n", ret);
-   goto clk_disable_all;
-   }
-
ret = sdhci_add_host(host);
if (ret)
goto err_pltfm_free;
-- 
2.3.7




  1   2   3   4   5   6   7   8   9   10   >