Re: [PATCH] checkpatch: Add a --strict test for macro argument reuse and precedence

2016-09-04 Thread Joe Perches
On Sat, 2016-09-03 at 15:20 -0700, Joe Perches wrote:
> Add a test for reuse of macro arguments to highlight any possible
> side-effects from this reuse.
> 
> Avoid this check on token name pasting and when the
> argument is used in a typeof or a __builtin.
> 
> Add a test for macro arguents that have leading or trailing operators
> where the argument isn't parenthesized to avoid possible precedence
> issues.
> 
> These tests are noisy so make them --strict.

This should have been RFC.  Please do not apply this.

These tests are not just noisy, some false positives it
reports are just silly.




Re: [PATCH] checkpatch: Add a --strict test for macro argument reuse and precedence

2016-09-04 Thread Joe Perches
On Sat, 2016-09-03 at 15:20 -0700, Joe Perches wrote:
> Add a test for reuse of macro arguments to highlight any possible
> side-effects from this reuse.
> 
> Avoid this check on token name pasting and when the
> argument is used in a typeof or a __builtin.
> 
> Add a test for macro arguents that have leading or trailing operators
> where the argument isn't parenthesized to avoid possible precedence
> issues.
> 
> These tests are noisy so make them --strict.

This should have been RFC.  Please do not apply this.

These tests are not just noisy, some false positives it
reports are just silly.




Re: [PATCH v4 2/3] mfd: add support for Allwinner SoCs ADC

2016-09-04 Thread Jonathan Cameron
On 01/09/16 15:05, Quentin Schulz wrote:
> The Allwinner SoCs all have an ADC that can also act as a touchscreen
> controller and a thermal sensor. For now, only the ADC and the thermal
> sensor drivers are probed by the MFD, the touchscreen controller support
> will be added later.
> 
> Signed-off-by: Quentin Schulz 
Other than the patch 1 revertion to the earlier approach, I'm happy with this.
I will need an Ack from Lee though given it's an mfd driver.

Makes sense to take this on through IIO I think.

Thanks,

Jonathan
> ---
> 
> v4:
>  - rename files and variables from sunxi* to sun4i*,
>  - rename defines from SUNXI_* to SUN4I_* or SUN6I_*,
>  - remove TP in defines name,
>  - rename SUNXI_IRQ_* to SUN4I_GPADC_IRQ_* for consistency,
>  - use devm functions for regmap_add_irq_chip and mfd_add_devices,
>  - remove remove functions (now empty thanks to devm functions),
> 
> v3:
>  - use defines in regmap_irq instead of hard coded BITs,
>  - use of_device_id data field to chose which MFD cells to add considering
>the compatible responsible of the MFD probe,
>  - remove useless initializations,
>  - disable all interrupts before adding them to regmap_irqchip,
>  - add goto error label in probe,
>  - correct wrapping in header license,
>  - move defines from IIO driver to header,
>  - use GENMASK to limit the size of the variable passed to a macro,
>  - prefix register BIT defines with the name of the register,
>  - reorder defines,
> 
> v2:
>  - add license headers,
>  - reorder alphabetically includes,
>  - add SUNXI_GPADC_ prefixes for defines,
> 
>  drivers/mfd/Kconfig |  15 
>  drivers/mfd/Makefile|   2 +
>  drivers/mfd/sun4i-gpadc-mfd.c   | 174 
> 
>  include/linux/mfd/sun4i-gpadc-mfd.h |  94 +++
>  4 files changed, 285 insertions(+)
>  create mode 100644 drivers/mfd/sun4i-gpadc-mfd.c
>  create mode 100644 include/linux/mfd/sun4i-gpadc-mfd.h
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 1bcf601..95b3c3e 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -29,6 +29,21 @@ config MFD_ACT8945A
> linear regulators, along with a complete ActivePath battery
> charger.
>  
> +config MFD_SUN4I_GPADC
> + tristate "Allwinner sunxi platforms' GPADC MFD driver"
> + select MFD_CORE
> + select REGMAP_MMIO
> + depends on ARCH_SUNXI || COMPILE_TEST
> + help
> +   Select this to get support for Allwinner SoCs (A10, A13 and A31) ADC.
> +   This driver will only map the hardware interrupt and registers, you
> +   have to select individual drivers based on this MFD to be able to use
> +   the ADC or the thermal sensor. This will try to probe the ADC driver
> +   sun4i-gpadc-iio and the hwmon driver iio_hwmon.
> +
> +   To compile this driver as a module, choose M here: the module will be
> +   called sun4i-gpadc-mfd.
> +
>  config MFD_AS3711
>   bool "AMS AS3711"
>   select MFD_CORE
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 42a66e1..3b964d7 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -205,3 +205,5 @@ intel-soc-pmic-objs   := 
> intel_soc_pmic_core.o intel_soc_pmic_crc.o
>  intel-soc-pmic-$(CONFIG_INTEL_PMC_IPC)   += intel_soc_pmic_bxtwc.o
>  obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o
>  obj-$(CONFIG_MFD_MT6397) += mt6397-core.o
> +
> +obj-$(CONFIG_MFD_SUN4I_GPADC)+= sun4i-gpadc-mfd.o
> diff --git a/drivers/mfd/sun4i-gpadc-mfd.c b/drivers/mfd/sun4i-gpadc-mfd.c
> new file mode 100644
> index 000..75aa7a8
> --- /dev/null
> +++ b/drivers/mfd/sun4i-gpadc-mfd.c
> @@ -0,0 +1,174 @@
> +/* ADC MFD core driver for sunxi platforms
> + *
> + * Copyright (c) 2016 Quentin Schulz 
> + *
> + * 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.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +static struct resource adc_resources[] = {
> + {
> + .name   = "FIFO_DATA_PENDING",
> + .start  = SUN4I_GPADC_IRQ_FIFO_DATA,
> + .end= SUN4I_GPADC_IRQ_FIFO_DATA,
> + .flags  = IORESOURCE_IRQ,
> + }, {
> + .name   = "TEMP_DATA_PENDING",
> + .start  = SUN4I_GPADC_IRQ_TEMP_DATA,
> + .end= SUN4I_GPADC_IRQ_TEMP_DATA,
> + .flags  = IORESOURCE_IRQ,
> + },
> +};
> +
> +static const struct regmap_irq sun4i_gpadc_mfd_regmap_irq[] = {
> + REGMAP_IRQ_REG(SUN4I_GPADC_IRQ_FIFO_DATA, 0,
> +SUN4I_GPADC_INT_FIFOC_TP_DATA_IRQ_EN),
> + REGMAP_IRQ_REG(SUN4I_GPADC_IRQ_TEMP_DATA, 0,
> +SUN4I_GPADC_INT_FIFOC_TEMP_IRQ_EN),
> +};
> +
> +static 

Re: [PATCH v4 2/3] mfd: add support for Allwinner SoCs ADC

2016-09-04 Thread Jonathan Cameron
On 01/09/16 15:05, Quentin Schulz wrote:
> The Allwinner SoCs all have an ADC that can also act as a touchscreen
> controller and a thermal sensor. For now, only the ADC and the thermal
> sensor drivers are probed by the MFD, the touchscreen controller support
> will be added later.
> 
> Signed-off-by: Quentin Schulz 
Other than the patch 1 revertion to the earlier approach, I'm happy with this.
I will need an Ack from Lee though given it's an mfd driver.

Makes sense to take this on through IIO I think.

Thanks,

Jonathan
> ---
> 
> v4:
>  - rename files and variables from sunxi* to sun4i*,
>  - rename defines from SUNXI_* to SUN4I_* or SUN6I_*,
>  - remove TP in defines name,
>  - rename SUNXI_IRQ_* to SUN4I_GPADC_IRQ_* for consistency,
>  - use devm functions for regmap_add_irq_chip and mfd_add_devices,
>  - remove remove functions (now empty thanks to devm functions),
> 
> v3:
>  - use defines in regmap_irq instead of hard coded BITs,
>  - use of_device_id data field to chose which MFD cells to add considering
>the compatible responsible of the MFD probe,
>  - remove useless initializations,
>  - disable all interrupts before adding them to regmap_irqchip,
>  - add goto error label in probe,
>  - correct wrapping in header license,
>  - move defines from IIO driver to header,
>  - use GENMASK to limit the size of the variable passed to a macro,
>  - prefix register BIT defines with the name of the register,
>  - reorder defines,
> 
> v2:
>  - add license headers,
>  - reorder alphabetically includes,
>  - add SUNXI_GPADC_ prefixes for defines,
> 
>  drivers/mfd/Kconfig |  15 
>  drivers/mfd/Makefile|   2 +
>  drivers/mfd/sun4i-gpadc-mfd.c   | 174 
> 
>  include/linux/mfd/sun4i-gpadc-mfd.h |  94 +++
>  4 files changed, 285 insertions(+)
>  create mode 100644 drivers/mfd/sun4i-gpadc-mfd.c
>  create mode 100644 include/linux/mfd/sun4i-gpadc-mfd.h
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 1bcf601..95b3c3e 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -29,6 +29,21 @@ config MFD_ACT8945A
> linear regulators, along with a complete ActivePath battery
> charger.
>  
> +config MFD_SUN4I_GPADC
> + tristate "Allwinner sunxi platforms' GPADC MFD driver"
> + select MFD_CORE
> + select REGMAP_MMIO
> + depends on ARCH_SUNXI || COMPILE_TEST
> + help
> +   Select this to get support for Allwinner SoCs (A10, A13 and A31) ADC.
> +   This driver will only map the hardware interrupt and registers, you
> +   have to select individual drivers based on this MFD to be able to use
> +   the ADC or the thermal sensor. This will try to probe the ADC driver
> +   sun4i-gpadc-iio and the hwmon driver iio_hwmon.
> +
> +   To compile this driver as a module, choose M here: the module will be
> +   called sun4i-gpadc-mfd.
> +
>  config MFD_AS3711
>   bool "AMS AS3711"
>   select MFD_CORE
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 42a66e1..3b964d7 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -205,3 +205,5 @@ intel-soc-pmic-objs   := 
> intel_soc_pmic_core.o intel_soc_pmic_crc.o
>  intel-soc-pmic-$(CONFIG_INTEL_PMC_IPC)   += intel_soc_pmic_bxtwc.o
>  obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o
>  obj-$(CONFIG_MFD_MT6397) += mt6397-core.o
> +
> +obj-$(CONFIG_MFD_SUN4I_GPADC)+= sun4i-gpadc-mfd.o
> diff --git a/drivers/mfd/sun4i-gpadc-mfd.c b/drivers/mfd/sun4i-gpadc-mfd.c
> new file mode 100644
> index 000..75aa7a8
> --- /dev/null
> +++ b/drivers/mfd/sun4i-gpadc-mfd.c
> @@ -0,0 +1,174 @@
> +/* ADC MFD core driver for sunxi platforms
> + *
> + * Copyright (c) 2016 Quentin Schulz 
> + *
> + * 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.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +static struct resource adc_resources[] = {
> + {
> + .name   = "FIFO_DATA_PENDING",
> + .start  = SUN4I_GPADC_IRQ_FIFO_DATA,
> + .end= SUN4I_GPADC_IRQ_FIFO_DATA,
> + .flags  = IORESOURCE_IRQ,
> + }, {
> + .name   = "TEMP_DATA_PENDING",
> + .start  = SUN4I_GPADC_IRQ_TEMP_DATA,
> + .end= SUN4I_GPADC_IRQ_TEMP_DATA,
> + .flags  = IORESOURCE_IRQ,
> + },
> +};
> +
> +static const struct regmap_irq sun4i_gpadc_mfd_regmap_irq[] = {
> + REGMAP_IRQ_REG(SUN4I_GPADC_IRQ_FIFO_DATA, 0,
> +SUN4I_GPADC_INT_FIFOC_TP_DATA_IRQ_EN),
> + REGMAP_IRQ_REG(SUN4I_GPADC_IRQ_TEMP_DATA, 0,
> +SUN4I_GPADC_INT_FIFOC_TEMP_IRQ_EN),
> +};
> +
> +static const struct regmap_irq_chip sun4i_gpadc_mfd_regmap_irq_chip = {

Re: [PATCH v4 3/3] iio: adc: add support for Allwinner SoCs ADC

2016-09-04 Thread Jonathan Cameron
On 01/09/16 15:05, Quentin Schulz wrote:
> The Allwinner SoCs all have an ADC that can also act as a touchscreen
> controller and a thermal sensor. This patch adds the ADC driver which is
> based on the MFD for the same SoCs ADC.
> 
> This also registers the thermal adc channel in the iio map array so
> iio_hwmon could use it without modifying the Device Tree. This registers
> the driver in the thermal framework.
> 
> This driver probes on three different platform_device_id to take into
> account slight differences (registers bit and temperature computation)
> between Allwinner SoCs ADCs.
> 
> Signed-off-by: Quentin Schulz 
One utterly trivial point about unrolling code ordering inline.

Other than the bit about patch 1 I'm basically happy with this..
However I would like some input (i.e. an Ack) from thermal given this
sets up a thermal zone.

Zhang or Eduardo, could you take a quick look at this and confirm you
are happy with it?

Thanks,

Jonathan
> ---
> 
> v4:
>  - rename files and variables from sunxi* to sun4i*,
>  - shorten sunxi_gpadc_soc_specific structure to soc_specific,
>  - factorize sysfs ADC and temp read_raws,
>  - use cached values when read_raw times out (except before a first value
>is gotten),
>  - remove mutex locks and unlocks from runtime_pm functions,
>  - factorize irq initializations,
>  - initialize temp_data and fifo_data values to -1 (error value),
>  - "impersonate" MFD to register in thermal framework,
>  - deactivate hardware interrupts one by one when probe fails or when
>removing driver instead of blindly deactivating all hardware interrupts,
>  - selects THERMAL_OF in Kconfig,
> 
> v3:
>  - correct wrapping,
>  - add comment about thermal sensor inner working,
>  - move defines in mfd header,
>  - use structure to define SoC specific registers or behaviour,
>  - attach this structure to the device according to of_device_id of the
>platform device,
>  - use new mutex instead of iio_dev mutex,
>  - use atomic flags to avoid race between request_irq and disable_irq in
>probe,
>  - switch from processed value to raw, offset and scale values for
>temperature ADC channel,
>  - remove faulty sentinel in iio_chan_spec array,
>  - add pm_runtime support,
>  - register thermal sensor in thermal framework (forgotten since the
>beginning whereas it is present in current sun4i-ts driver),
>  - remove useless ret variables to store return value of regmap_reads,
>  - move comments on thermal sensor acquisition period in code instead of
>header,
>  - adding goto label to unregister iio_map_array when failing to register
>iio_dev,
> 
> v2:
>  - add SUNXI_GPADC_ prefixes for defines,
>  - correct typo in Kconfig,
>  - reorder alphabetically includes, makefile,
>  - add license header,
>  - fix architecture variations not being handled in interrupt handlers or
>read raw functions,
>  - fix unability to return negative values from thermal sensor,
>  - add gotos to reduce code repetition,
>  - fix irq variable being unsigned int instead of int,
>  - remove useless dev_err and dev_info,
>  - deactivate all interrupts if probe fails,
>  - fix iio_device_register on NULL variable,
>  - deactivate ADC in the IP when probe fails or when removing driver,
> 
>  drivers/iio/adc/Kconfig   |  13 +
>  drivers/iio/adc/Makefile  |   1 +
>  drivers/iio/adc/sun4i-gpadc-iio.c | 525 
> ++
>  3 files changed, 539 insertions(+)
>  create mode 100644 drivers/iio/adc/sun4i-gpadc-iio.c
> 
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index 25378c5..ea36a4f 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -384,6 +384,19 @@ config ROCKCHIP_SARADC
> To compile this driver as a module, choose M here: the
> module will be called rockchip_saradc.
>  
> +config SUN4I_GPADC
> + tristate "Support for the Allwinner SoCs GPADC"
> + depends on IIO
> + depends on MFD_SUN4I_GPADC
> + select THERMAL_OF
> + help
> +   Say yes here to build support for Allwinner (A10, A13 and A31) SoCs
> +   GPADC. This ADC provides 4 channels which can be used as an ADC or as
> +   a touchscreen input and one channel for thermal sensor.
> +
> +   To compile this driver as a module, choose M here: the module will be
> +   called sun4i-gpadc-iio.
> +
>  config TI_ADC081C
>   tristate "Texas Instruments ADC081C/ADC101C/ADC121C family"
>   depends on I2C
> diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
> index 38638d4..204372d 100644
> --- a/drivers/iio/adc/Makefile
> +++ b/drivers/iio/adc/Makefile
> @@ -37,6 +37,7 @@ obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
>  obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o
>  obj-$(CONFIG_QCOM_SPMI_VADC) += qcom-spmi-vadc.o
>  obj-$(CONFIG_ROCKCHIP_SARADC) += rockchip_saradc.o
> +obj-$(CONFIG_SUN4I_GPADC) += sun4i-gpadc-iio.o
>  obj-$(CONFIG_TI_ADC081C) += 

Re: [PATCH v4 3/3] iio: adc: add support for Allwinner SoCs ADC

2016-09-04 Thread Jonathan Cameron
On 01/09/16 15:05, Quentin Schulz wrote:
> The Allwinner SoCs all have an ADC that can also act as a touchscreen
> controller and a thermal sensor. This patch adds the ADC driver which is
> based on the MFD for the same SoCs ADC.
> 
> This also registers the thermal adc channel in the iio map array so
> iio_hwmon could use it without modifying the Device Tree. This registers
> the driver in the thermal framework.
> 
> This driver probes on three different platform_device_id to take into
> account slight differences (registers bit and temperature computation)
> between Allwinner SoCs ADCs.
> 
> Signed-off-by: Quentin Schulz 
One utterly trivial point about unrolling code ordering inline.

Other than the bit about patch 1 I'm basically happy with this..
However I would like some input (i.e. an Ack) from thermal given this
sets up a thermal zone.

Zhang or Eduardo, could you take a quick look at this and confirm you
are happy with it?

Thanks,

Jonathan
> ---
> 
> v4:
>  - rename files and variables from sunxi* to sun4i*,
>  - shorten sunxi_gpadc_soc_specific structure to soc_specific,
>  - factorize sysfs ADC and temp read_raws,
>  - use cached values when read_raw times out (except before a first value
>is gotten),
>  - remove mutex locks and unlocks from runtime_pm functions,
>  - factorize irq initializations,
>  - initialize temp_data and fifo_data values to -1 (error value),
>  - "impersonate" MFD to register in thermal framework,
>  - deactivate hardware interrupts one by one when probe fails or when
>removing driver instead of blindly deactivating all hardware interrupts,
>  - selects THERMAL_OF in Kconfig,
> 
> v3:
>  - correct wrapping,
>  - add comment about thermal sensor inner working,
>  - move defines in mfd header,
>  - use structure to define SoC specific registers or behaviour,
>  - attach this structure to the device according to of_device_id of the
>platform device,
>  - use new mutex instead of iio_dev mutex,
>  - use atomic flags to avoid race between request_irq and disable_irq in
>probe,
>  - switch from processed value to raw, offset and scale values for
>temperature ADC channel,
>  - remove faulty sentinel in iio_chan_spec array,
>  - add pm_runtime support,
>  - register thermal sensor in thermal framework (forgotten since the
>beginning whereas it is present in current sun4i-ts driver),
>  - remove useless ret variables to store return value of regmap_reads,
>  - move comments on thermal sensor acquisition period in code instead of
>header,
>  - adding goto label to unregister iio_map_array when failing to register
>iio_dev,
> 
> v2:
>  - add SUNXI_GPADC_ prefixes for defines,
>  - correct typo in Kconfig,
>  - reorder alphabetically includes, makefile,
>  - add license header,
>  - fix architecture variations not being handled in interrupt handlers or
>read raw functions,
>  - fix unability to return negative values from thermal sensor,
>  - add gotos to reduce code repetition,
>  - fix irq variable being unsigned int instead of int,
>  - remove useless dev_err and dev_info,
>  - deactivate all interrupts if probe fails,
>  - fix iio_device_register on NULL variable,
>  - deactivate ADC in the IP when probe fails or when removing driver,
> 
>  drivers/iio/adc/Kconfig   |  13 +
>  drivers/iio/adc/Makefile  |   1 +
>  drivers/iio/adc/sun4i-gpadc-iio.c | 525 
> ++
>  3 files changed, 539 insertions(+)
>  create mode 100644 drivers/iio/adc/sun4i-gpadc-iio.c
> 
> diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig
> index 25378c5..ea36a4f 100644
> --- a/drivers/iio/adc/Kconfig
> +++ b/drivers/iio/adc/Kconfig
> @@ -384,6 +384,19 @@ config ROCKCHIP_SARADC
> To compile this driver as a module, choose M here: the
> module will be called rockchip_saradc.
>  
> +config SUN4I_GPADC
> + tristate "Support for the Allwinner SoCs GPADC"
> + depends on IIO
> + depends on MFD_SUN4I_GPADC
> + select THERMAL_OF
> + help
> +   Say yes here to build support for Allwinner (A10, A13 and A31) SoCs
> +   GPADC. This ADC provides 4 channels which can be used as an ADC or as
> +   a touchscreen input and one channel for thermal sensor.
> +
> +   To compile this driver as a module, choose M here: the module will be
> +   called sun4i-gpadc-iio.
> +
>  config TI_ADC081C
>   tristate "Texas Instruments ADC081C/ADC101C/ADC121C family"
>   depends on I2C
> diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile
> index 38638d4..204372d 100644
> --- a/drivers/iio/adc/Makefile
> +++ b/drivers/iio/adc/Makefile
> @@ -37,6 +37,7 @@ obj-$(CONFIG_PALMAS_GPADC) += palmas_gpadc.o
>  obj-$(CONFIG_QCOM_SPMI_IADC) += qcom-spmi-iadc.o
>  obj-$(CONFIG_QCOM_SPMI_VADC) += qcom-spmi-vadc.o
>  obj-$(CONFIG_ROCKCHIP_SARADC) += rockchip_saradc.o
> +obj-$(CONFIG_SUN4I_GPADC) += sun4i-gpadc-iio.o
>  obj-$(CONFIG_TI_ADC081C) += ti-adc081c.o
>  

Re: fs: GPF in bd_mount

2016-09-04 Thread Al Viro
On Sun, Sep 04, 2016 at 03:06:06PM +0100, Al Viro wrote:

> Said that, I'm not sure why mount_pseudo() would be returning any errors;
> rejection should happen in the caller (due to MS_NOUSER in the flags), but
> I don't understand what would trigger it on mount_pseudo() level...

I see what's going on, but I wonder if sget() is the right place for userns
checks...


Re: fs: GPF in bd_mount

2016-09-04 Thread Al Viro
On Sun, Sep 04, 2016 at 03:06:06PM +0100, Al Viro wrote:

> Said that, I'm not sure why mount_pseudo() would be returning any errors;
> rejection should happen in the caller (due to MS_NOUSER in the flags), but
> I don't understand what would trigger it on mount_pseudo() level...

I see what's going on, but I wonder if sget() is the right place for userns
checks...


Re: [PATCH] vxlan: Update tx_errors statistics if vxlan_build_skb return err.

2016-09-04 Thread Jiri Benc
On Sun,  4 Sep 2016 18:52:51 +0800, Haishuang Yan wrote:
> If vxlan_build_skb return err < 0, tx_errors should be also increased.
> 
> Signed-off-by: Haishuang Yan 
> ---
>  drivers/net/vxlan.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index f605a36..2c72dcd 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -2103,6 +2103,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct 
> net_device *dev,
> vni, md, flags, udp_sum);
>   if (err < 0) {
>   dst_release(ndst);
> + dev->stats.tx_errors++;
>   return;
>   }
>   udp_tunnel6_xmit_skb(ndst, sk, skb, dev,

Acked-by: Jiri Benc 

The error path in vxlan_xmit_one deserves complete rework, though.

 Jiri


Re: [PATCH] vxlan: Update tx_errors statistics if vxlan_build_skb return err.

2016-09-04 Thread Jiri Benc
On Sun,  4 Sep 2016 18:52:51 +0800, Haishuang Yan wrote:
> If vxlan_build_skb return err < 0, tx_errors should be also increased.
> 
> Signed-off-by: Haishuang Yan 
> ---
>  drivers/net/vxlan.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index f605a36..2c72dcd 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -2103,6 +2103,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct 
> net_device *dev,
> vni, md, flags, udp_sum);
>   if (err < 0) {
>   dst_release(ndst);
> + dev->stats.tx_errors++;
>   return;
>   }
>   udp_tunnel6_xmit_skb(ndst, sk, skb, dev,

Acked-by: Jiri Benc 

The error path in vxlan_xmit_one deserves complete rework, though.

 Jiri


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread kbuild test robot
Hi Amit,

[auto build test WARNING on v4.8-rc4]
[cannot apply to staging/staging-testing next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/compiler.h:230:8: sparse: attribute 'no_sanitize_address': 
unknown attribute
   drivers/staging/comedi/range.c:35:49: sparse: undefined identifier 'RANGE_mA'
>> drivers/staging/comedi/range.c:35:57: sparse: not a function 
   drivers/staging/comedi/range.c:37:49: sparse: undefined identifier 'RANGE_mA'
   drivers/staging/comedi/range.c:37:57: sparse: not a function 
   drivers/staging/comedi/range.c:39:49: sparse: undefined identifier 'RANGE_mA'
   drivers/staging/comedi/range.c:39:57: sparse: not a function 
   drivers/staging/comedi/range.c:35:49: error: implicit declaration of 
function 'RANGE_mA' [-Werror=implicit-function-declaration]
const struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} };
^~~~
   drivers/staging/comedi/range.c:35:49: error: initializer element is not 
constant
   drivers/staging/comedi/range.c:35:49: note: (near initialization for 
'range_0_20mA.range[0].min')
   drivers/staging/comedi/range.c:37:49: error: initializer element is not 
constant
const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} };
^~~~
   drivers/staging/comedi/range.c:37:49: note: (near initialization for 
'range_4_20mA.range[0].min')
   drivers/staging/comedi/range.c:39:49: error: initializer element is not 
constant
const struct comedi_lrange range_0_32mA = { 1, {RANGE_mA(0, 32)} };
^~~~
   drivers/staging/comedi/range.c:39:49: note: (near initialization for 
'range_0_32mA.range[0].min')
   cc1: some warnings being treated as errors
--
   include/linux/compiler.h:230:8: sparse: attribute 'no_sanitize_address': 
unknown attribute
   drivers/staging/comedi/drivers/dac02.c:66:17: sparse: undefined identifier 
'RANGE_mA'
>> drivers/staging/comedi/drivers/dac02.c:66:25: sparse: not a function 
>> 
   drivers/staging/comedi/drivers/dac02.c:66:3: error: implicit declaration of 
function 'RANGE_mA' [-Werror=implicit-function-declaration]
  RANGE_mA(4, 20),
  ^~~~
   drivers/staging/comedi/drivers/dac02.c:66:3: error: initializer element is 
not constant
   drivers/staging/comedi/drivers/dac02.c:66:3: note: (near initialization for 
'das02_ao_ranges.range[4].min')
   drivers/staging/comedi/drivers/dac02.c:67:3: warning: braces around scalar 
initializer
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: (near initialization for 
'das02_ao_ranges.range[4].max')
   In file included from drivers/staging/comedi/drivers/dac02.c:38:0:
   drivers/staging/comedi/drivers/../comedidev.h:584:38: warning: excess 
elements in scalar initializer
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
 ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/../comedidev.h:584:38: note: (near 
initialization for 'das02_ao_ranges.range[4].max')
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
 ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   In file included from drivers/staging/comedi/drivers/../comedidev.h:28:0,
from drivers/staging/comedi/drivers/dac02.c:38:
   drivers/staging/comedi/drivers/../comedi.h:897:22: warning: excess elements 
in scalar initializer
#define RF_EXTERNAL  0x100
 ^
   drivers/staging/comedi/drivers/../comedidev.h:584:49: note: in expansion of 
macro 'RF_EXTERNAL'
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
^~~
   drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/../comedi.h:897:22: note: (near 
initialization for 'das02_ao_ranges.range[4].max')
#define RF_EXTERNAL  0x100
 ^
   drivers/staging/comedi/drivers/../comedidev.h

Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread kbuild test robot
Hi Amit,

[auto build test WARNING on v4.8-rc4]
[cannot apply to staging/staging-testing next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/compiler.h:230:8: sparse: attribute 'no_sanitize_address': 
unknown attribute
   drivers/staging/comedi/range.c:35:49: sparse: undefined identifier 'RANGE_mA'
>> drivers/staging/comedi/range.c:35:57: sparse: not a function 
   drivers/staging/comedi/range.c:37:49: sparse: undefined identifier 'RANGE_mA'
   drivers/staging/comedi/range.c:37:57: sparse: not a function 
   drivers/staging/comedi/range.c:39:49: sparse: undefined identifier 'RANGE_mA'
   drivers/staging/comedi/range.c:39:57: sparse: not a function 
   drivers/staging/comedi/range.c:35:49: error: implicit declaration of 
function 'RANGE_mA' [-Werror=implicit-function-declaration]
const struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} };
^~~~
   drivers/staging/comedi/range.c:35:49: error: initializer element is not 
constant
   drivers/staging/comedi/range.c:35:49: note: (near initialization for 
'range_0_20mA.range[0].min')
   drivers/staging/comedi/range.c:37:49: error: initializer element is not 
constant
const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} };
^~~~
   drivers/staging/comedi/range.c:37:49: note: (near initialization for 
'range_4_20mA.range[0].min')
   drivers/staging/comedi/range.c:39:49: error: initializer element is not 
constant
const struct comedi_lrange range_0_32mA = { 1, {RANGE_mA(0, 32)} };
^~~~
   drivers/staging/comedi/range.c:39:49: note: (near initialization for 
'range_0_32mA.range[0].min')
   cc1: some warnings being treated as errors
--
   include/linux/compiler.h:230:8: sparse: attribute 'no_sanitize_address': 
unknown attribute
   drivers/staging/comedi/drivers/dac02.c:66:17: sparse: undefined identifier 
'RANGE_mA'
>> drivers/staging/comedi/drivers/dac02.c:66:25: sparse: not a function 
>> 
   drivers/staging/comedi/drivers/dac02.c:66:3: error: implicit declaration of 
function 'RANGE_mA' [-Werror=implicit-function-declaration]
  RANGE_mA(4, 20),
  ^~~~
   drivers/staging/comedi/drivers/dac02.c:66:3: error: initializer element is 
not constant
   drivers/staging/comedi/drivers/dac02.c:66:3: note: (near initialization for 
'das02_ao_ranges.range[4].min')
   drivers/staging/comedi/drivers/dac02.c:67:3: warning: braces around scalar 
initializer
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: (near initialization for 
'das02_ao_ranges.range[4].max')
   In file included from drivers/staging/comedi/drivers/dac02.c:38:0:
   drivers/staging/comedi/drivers/../comedidev.h:584:38: warning: excess 
elements in scalar initializer
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
 ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/../comedidev.h:584:38: note: (near 
initialization for 'das02_ao_ranges.range[4].max')
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
 ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   In file included from drivers/staging/comedi/drivers/../comedidev.h:28:0,
from drivers/staging/comedi/drivers/dac02.c:38:
   drivers/staging/comedi/drivers/../comedi.h:897:22: warning: excess elements 
in scalar initializer
#define RF_EXTERNAL  0x100
 ^
   drivers/staging/comedi/drivers/../comedidev.h:584:49: note: in expansion of 
macro 'RF_EXTERNAL'
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
^~~
   drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/../comedi.h:897:22: note: (near 
initialization for 'das02_ao_ranges.range[4].max')
#define RF_EXTERNAL  0x100
 ^
   drivers/staging/comedi/drivers/../comedidev.h

Re: fs: GPF in bd_mount

2016-09-04 Thread Mateusz Guzik
On Sun, Sep 04, 2016 at 12:43:28PM +0200, Dmitry Vyukov wrote:
> Hello,
> 
> The following program triggers GPF in bd_mount:
> 
> 
> // autogenerated by syzkaller (http://github.com/google/syzkaller)
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> 
> int main()
> {
>   int fd;
> 
>   unshare(CLONE_NEWUSER);
>   unshare(CLONE_NEWNS);
>   mkdir("./bus", 0662515705056234013740);
>   mount("./bus/bus", "./bus", "bdev", 0,
>   "\xa9\x95\xbd\x88\x07\x6a\x39\xe8\xf4\xef\xf2\x6b\x88\x53\x1d\xdb"
>   "\xd2\x83\xf9\x5f\x4f\x44\x71\xf2\x08\x84\x2b\xae\x94\x87\xb7\xa6"
>   "\xf8\x9d\xc9\x96\xc7\x17\x2e\x22\xc4\xd2\xcc\xf9\x04\x0b\xd2\xaf"
>   "\xf3\x0b\xec\xeb\x2b\x75\xf2\x93\xa2\xd4\x00\xd8\x69\x47\x48\xf5"
>   "\xaf\x2b\xb8\x7c\x06\x04\x69\x8b\x46\x0d\x44\x79\x8c\x86\x68\xfd"
>   "\xd3\xb4\x1c\x8e\x9e\x6c\x58\x0c\xa5\xdf\x55\x4d\x59\x65\xc9\x70"
>   "\x7c\x8a\x44\x26\x7d\xba\xf0\x3d\x46\x9e\x3c\xbe\x22\xc3");
>   return 0;
> }
> 
> 
> general protection fault:  [#1] SMP DEBUG_PAGEALLOC KASAN
> Modules linked in:
> CPU: 2 PID: 4052 Comm: a.out Not tainted 4.8.0-rc3-next-20160825+ #11
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
> task: 88006b37a380 task.stack: 880066dc
> RIP: 0010:[]  []
> bd_mount+0x52/0xa0 fs/block_dev.c:650
> RSP: 0018:880066dc7ca0  EFLAGS: 00010207
> RAX: dc00 RBX:  RCX: 0001
> RDX: 0018 RSI: 886fd6c0 RDI: 00c7
> RBP: 880066dc7cb0 R08: 88006b642cb8 R09: 
> R10:  R11:  R12: 8880d440
> R13: 88006a4ac1c0 R14: 88006b64b000 R15: 
> FS:  012b2880() GS:88006d20() knlGS:
> CS:  0010 DS:  ES:  CR0: 80050033
> CR2: 004b2160 CR3: 6cc72000 CR4: 06e0
> Stack:
>  880068e2c840 8880d440 880066dc7cf0 8186e73b
>  0004 88006659c600 8880d440 88006a4ac1c0
>   880068e2c840 880066dc7d40 818ce44a
> Call Trace:
>  [] mount_fs+0x9b/0x2f0 fs/super.c:1177
>  [] vfs_kern_mount+0x7a/0x3e0 fs/namespace.c:948
>  [< inline >] do_new_mount fs/namespace.c:2393
>  [] do_mount+0x3d5/0x26b0 fs/namespace.c:2715
>  [< inline >] SYSC_mount fs/namespace.c:2907
>  [] SyS_mount+0xab/0x120 fs/namespace.c:2884
>  [] do_syscall_64+0x1df/0x640 arch/x86/entry/common.c:288
>  [] entry_SYSCALL64_slow_path+0x25/0x25
> arch/x86/entry/entry_64.S:249
> Code: 87 e8 f3 ca fb ff 48 85 c0 48 89 c3 74 4c e8 a6 47 ca ff 48 8d
> bb c8 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80>
> 3c 02 00 75 36 4c 8b a3 c8 00 00 00 48 b8 00 00 00 00 00 fc
> RIP  [] bd_mount+0x52/0xa0 fs/block_dev.c:650
>  RSP 
> ---[ end trace 0e5d909159d79633 ]---
> 
> 
> On commit 0f98f121e1670eaa2a2fbb675e07d6ba7f0e146f of linux-next.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


I think this is fixed with:
commit e9e5e3fae8da7e237049e00e0bfc9e32fd808fe8
Author: Vegard Nossum 
Date:   Mon Aug 22 12:47:43 2016 +0200

bdev: fix NULL pointer dereference

in mainline. The commit is absent in linux-next.

-- 
Mateusz Guzik


Re: fs: GPF in bd_mount

2016-09-04 Thread Mateusz Guzik
On Sun, Sep 04, 2016 at 12:43:28PM +0200, Dmitry Vyukov wrote:
> Hello,
> 
> The following program triggers GPF in bd_mount:
> 
> 
> // autogenerated by syzkaller (http://github.com/google/syzkaller)
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> 
> int main()
> {
>   int fd;
> 
>   unshare(CLONE_NEWUSER);
>   unshare(CLONE_NEWNS);
>   mkdir("./bus", 0662515705056234013740);
>   mount("./bus/bus", "./bus", "bdev", 0,
>   "\xa9\x95\xbd\x88\x07\x6a\x39\xe8\xf4\xef\xf2\x6b\x88\x53\x1d\xdb"
>   "\xd2\x83\xf9\x5f\x4f\x44\x71\xf2\x08\x84\x2b\xae\x94\x87\xb7\xa6"
>   "\xf8\x9d\xc9\x96\xc7\x17\x2e\x22\xc4\xd2\xcc\xf9\x04\x0b\xd2\xaf"
>   "\xf3\x0b\xec\xeb\x2b\x75\xf2\x93\xa2\xd4\x00\xd8\x69\x47\x48\xf5"
>   "\xaf\x2b\xb8\x7c\x06\x04\x69\x8b\x46\x0d\x44\x79\x8c\x86\x68\xfd"
>   "\xd3\xb4\x1c\x8e\x9e\x6c\x58\x0c\xa5\xdf\x55\x4d\x59\x65\xc9\x70"
>   "\x7c\x8a\x44\x26\x7d\xba\xf0\x3d\x46\x9e\x3c\xbe\x22\xc3");
>   return 0;
> }
> 
> 
> general protection fault:  [#1] SMP DEBUG_PAGEALLOC KASAN
> Modules linked in:
> CPU: 2 PID: 4052 Comm: a.out Not tainted 4.8.0-rc3-next-20160825+ #11
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
> task: 88006b37a380 task.stack: 880066dc
> RIP: 0010:[]  []
> bd_mount+0x52/0xa0 fs/block_dev.c:650
> RSP: 0018:880066dc7ca0  EFLAGS: 00010207
> RAX: dc00 RBX:  RCX: 0001
> RDX: 0018 RSI: 886fd6c0 RDI: 00c7
> RBP: 880066dc7cb0 R08: 88006b642cb8 R09: 
> R10:  R11:  R12: 8880d440
> R13: 88006a4ac1c0 R14: 88006b64b000 R15: 
> FS:  012b2880() GS:88006d20() knlGS:
> CS:  0010 DS:  ES:  CR0: 80050033
> CR2: 004b2160 CR3: 6cc72000 CR4: 06e0
> Stack:
>  880068e2c840 8880d440 880066dc7cf0 8186e73b
>  0004 88006659c600 8880d440 88006a4ac1c0
>   880068e2c840 880066dc7d40 818ce44a
> Call Trace:
>  [] mount_fs+0x9b/0x2f0 fs/super.c:1177
>  [] vfs_kern_mount+0x7a/0x3e0 fs/namespace.c:948
>  [< inline >] do_new_mount fs/namespace.c:2393
>  [] do_mount+0x3d5/0x26b0 fs/namespace.c:2715
>  [< inline >] SYSC_mount fs/namespace.c:2907
>  [] SyS_mount+0xab/0x120 fs/namespace.c:2884
>  [] do_syscall_64+0x1df/0x640 arch/x86/entry/common.c:288
>  [] entry_SYSCALL64_slow_path+0x25/0x25
> arch/x86/entry/entry_64.S:249
> Code: 87 e8 f3 ca fb ff 48 85 c0 48 89 c3 74 4c e8 a6 47 ca ff 48 8d
> bb c8 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80>
> 3c 02 00 75 36 4c 8b a3 c8 00 00 00 48 b8 00 00 00 00 00 fc
> RIP  [] bd_mount+0x52/0xa0 fs/block_dev.c:650
>  RSP 
> ---[ end trace 0e5d909159d79633 ]---
> 
> 
> On commit 0f98f121e1670eaa2a2fbb675e07d6ba7f0e146f of linux-next.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


I think this is fixed with:
commit e9e5e3fae8da7e237049e00e0bfc9e32fd808fe8
Author: Vegard Nossum 
Date:   Mon Aug 22 12:47:43 2016 +0200

bdev: fix NULL pointer dereference

in mainline. The commit is absent in linux-next.

-- 
Mateusz Guzik


Re: Clarification for source code formatting around jump labels

2016-09-04 Thread SF Markus Elfring
>> I am just curious on how much further software development "fun" the recent 
>> update
>> by a topic like "CodingStyle: Clarify and complete chapter 7" will trigger.
> 
> I don't want to drag this thread onwards for (way) too long, but clearly "it 
> is
> advised to indent labels with a single space (not tab)" (from diff in above 
> commit)

How do you think about the reason (which you omitted from your quotation) for 
this advice?

“…,
so that "diff -p" does not confuse labels with functions.
…”


> doesn't really reflect the majority of kernel practice we have in-tree today 
> and
> actually rather adds more confusion than any clarification whatsoever:
> 
>   $ git grep -n "^\ [a-z_]*:" -- '*.[ch]' | wc -l
>   4919
>   $ git grep -n "^[a-z_]*:" -- '*.[ch]' | wc -l
>   54686

So there is a mixture already.


> A CodingStyle document should document what's regarded as a general consensus 
> of
> kernel coding practices, and thus should represent the /majority/ of coding 
> style,
> which (if I didn't screw up my git-grep line completely)

1. Is the used character class specification complete in the shown regular 
expression?

2. I guess that you should use the regex operator "plus" (instead of the 
asterisk).

3. Would you like to try another source code analysis out which can be a bit 
safer
   with the usage of the semantic patch language?


> above 9% does not really reflect at all.

How tolerant are you for using an extra space character before the identifier 
for
a jump label?


> So, new folks starting with kernel hacking reading this are rather misguided,
> and code-wise it just adds up to have more inconsistencies from new patches,
> or worse, have noisy patches (like this one) flying around that try to
> brute-force everything into this advice.

In which ways would you prefer that the style specifications should be
clarified further?

Where should source code become more consistent?

Regards,
Markus


Re: Clarification for source code formatting around jump labels

2016-09-04 Thread SF Markus Elfring
>> I am just curious on how much further software development "fun" the recent 
>> update
>> by a topic like "CodingStyle: Clarify and complete chapter 7" will trigger.
> 
> I don't want to drag this thread onwards for (way) too long, but clearly "it 
> is
> advised to indent labels with a single space (not tab)" (from diff in above 
> commit)

How do you think about the reason (which you omitted from your quotation) for 
this advice?

“…,
so that "diff -p" does not confuse labels with functions.
…”


> doesn't really reflect the majority of kernel practice we have in-tree today 
> and
> actually rather adds more confusion than any clarification whatsoever:
> 
>   $ git grep -n "^\ [a-z_]*:" -- '*.[ch]' | wc -l
>   4919
>   $ git grep -n "^[a-z_]*:" -- '*.[ch]' | wc -l
>   54686

So there is a mixture already.


> A CodingStyle document should document what's regarded as a general consensus 
> of
> kernel coding practices, and thus should represent the /majority/ of coding 
> style,
> which (if I didn't screw up my git-grep line completely)

1. Is the used character class specification complete in the shown regular 
expression?

2. I guess that you should use the regex operator "plus" (instead of the 
asterisk).

3. Would you like to try another source code analysis out which can be a bit 
safer
   with the usage of the semantic patch language?


> above 9% does not really reflect at all.

How tolerant are you for using an extra space character before the identifier 
for
a jump label?


> So, new folks starting with kernel hacking reading this are rather misguided,
> and code-wise it just adds up to have more inconsistencies from new patches,
> or worse, have noisy patches (like this one) flying around that try to
> brute-force everything into this advice.

In which ways would you prefer that the style specifications should be
clarified further?

Where should source code become more consistent?

Regards,
Markus


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread Amit Ghadge
On Sep 4, 2016 5:19 PM, "kbuild test robot" <l...@intel.com> wrote:
>
> Hi Amit,
>
> [auto build test ERROR on v4.8-rc4]
> [cannot apply to staging/staging-testing next-20160825]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
> convenience) to record what (public, well-known) commit your patch series was 
> built on]
> [Check https://git-scm.com/docs/git-format-patch for more information]
>
> url:
> https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All error/warnings (new ones prefixed by >>):
>
> >> drivers/staging/comedi/range.c:35:49: error: implicit declaration of 
> >> function 'RANGE_mA' [-Werror=implicit-function-declaration]
> const struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} };
> ^~~~
> >> drivers/staging/comedi/range.c:35:49: error: initializer element is not 
> >> constant
>drivers/staging/comedi/range.c:35:49: note: (near initialization for 
> 'range_0_20mA.range[0].min')
>drivers/staging/comedi/range.c:37:49: error: initializer element is not 
> constant
> const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} };
> ^~~~
>drivers/staging/comedi/range.c:37:49: note: (near initialization for 
> 'range_4_20mA.range[0].min')
>drivers/staging/comedi/range.c:39:49: error: initializer element is not 
> constant
> const struct comedi_lrange range_0_32mA = { 1, {RANGE_mA(0, 32)} };
> ^~~~
>drivers/staging/comedi/range.c:39:49: note: (near initialization for 
> 'range_0_32mA.range[0].min')
>cc1: some warnings being treated as errors
> --
> >> drivers/staging/comedi/drivers/pcl726.c:82:3: error: 'range_4_20mA' 
> >> undeclared here (not in a function)
>  _4_20mA,
>   ^~~~
> >> drivers/staging/comedi/drivers/pcl726.c:90:2: error: initializer element 
> >> is not constant
>  _4_20mA
>  ^
>drivers/staging/comedi/drivers/pcl726.c:90:2: note: (near initialization 
> for 'rangelist_727[3]')
>drivers/staging/comedi/drivers/pcl726.c:98:2: error: initializer element 
> is not constant
>  _4_20mA,
>  ^
>drivers/staging/comedi/drivers/pcl726.c:98:2: note: (near initialization 
> for 'rangelist_728[4]')
> >> drivers/staging/comedi/drivers/pcl726.c:99:3: error: 'range_0_20mA' 
> >> undeclared here (not in a function)
>  _0_20mA
>   ^~~~
>drivers/staging/comedi/drivers/pcl726.c:99:2: error: initializer element 
> is not constant
>  _0_20mA
>  ^
>drivers/staging/comedi/drivers/pcl726.c:99:2: note: (near initialization 
> for 'rangelist_728[5]')
> --
> >> drivers/staging/comedi/drivers/dac02.c:66:3: error: implicit declaration 
> >> of function 'RANGE_mA' [-Werror=implicit-function-declaration]
>   RANGE_mA(4, 20),
>   ^~~~
> >> drivers/staging/comedi/drivers/dac02.c:66:3: error: initializer element is 
> >> not constant
>drivers/staging/comedi/drivers/dac02.c:66:3: note: (near initialization 
> for 'das02_ao_ranges.range[4].min')
> >> drivers/staging/comedi/drivers/dac02.c:67:3: warning: braces around scalar 
> >> initializer
>   RANGE_ext(0, 1)
>   ^
>drivers/staging/comedi/drivers/dac02.c:67:3: note: (near initialization 
> for 'das02_ao_ranges.range[4].max')
>In file included from drivers/staging/comedi/drivers/dac02.c:38:0:
> >> drivers/staging/comedi/drivers/../comedidev.h:584:38: warning: excess 
> >> elements in scalar initializer
> #define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
>  ^
> >> drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
> >> 'RANGE_ext'
>   RANGE_ext(0, 1)
>   ^
>drivers/staging/comedi/drivers/../comedidev.h:584:38: note: (near 
> initialization for 'das02_ao_ranges.range[4].max')
> #define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
>  ^
> >> drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
> >> 'RANGE_ex

Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread Amit Ghadge
On Sep 4, 2016 5:19 PM, "kbuild test robot"  wrote:
>
> Hi Amit,
>
> [auto build test ERROR on v4.8-rc4]
> [cannot apply to staging/staging-testing next-20160825]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
> convenience) to record what (public, well-known) commit your patch series was 
> built on]
> [Check https://git-scm.com/docs/git-format-patch for more information]
>
> url:
> https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
> config: i386-allmodconfig (attached as .config)
> compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> All error/warnings (new ones prefixed by >>):
>
> >> drivers/staging/comedi/range.c:35:49: error: implicit declaration of 
> >> function 'RANGE_mA' [-Werror=implicit-function-declaration]
> const struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} };
> ^~~~
> >> drivers/staging/comedi/range.c:35:49: error: initializer element is not 
> >> constant
>drivers/staging/comedi/range.c:35:49: note: (near initialization for 
> 'range_0_20mA.range[0].min')
>drivers/staging/comedi/range.c:37:49: error: initializer element is not 
> constant
> const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} };
> ^~~~
>drivers/staging/comedi/range.c:37:49: note: (near initialization for 
> 'range_4_20mA.range[0].min')
>drivers/staging/comedi/range.c:39:49: error: initializer element is not 
> constant
> const struct comedi_lrange range_0_32mA = { 1, {RANGE_mA(0, 32)} };
> ^~~~
>drivers/staging/comedi/range.c:39:49: note: (near initialization for 
> 'range_0_32mA.range[0].min')
>cc1: some warnings being treated as errors
> --
> >> drivers/staging/comedi/drivers/pcl726.c:82:3: error: 'range_4_20mA' 
> >> undeclared here (not in a function)
>  _4_20mA,
>   ^~~~
> >> drivers/staging/comedi/drivers/pcl726.c:90:2: error: initializer element 
> >> is not constant
>  _4_20mA
>  ^
>drivers/staging/comedi/drivers/pcl726.c:90:2: note: (near initialization 
> for 'rangelist_727[3]')
>drivers/staging/comedi/drivers/pcl726.c:98:2: error: initializer element 
> is not constant
>  _4_20mA,
>  ^
>drivers/staging/comedi/drivers/pcl726.c:98:2: note: (near initialization 
> for 'rangelist_728[4]')
> >> drivers/staging/comedi/drivers/pcl726.c:99:3: error: 'range_0_20mA' 
> >> undeclared here (not in a function)
>  _0_20mA
>   ^~~~
>drivers/staging/comedi/drivers/pcl726.c:99:2: error: initializer element 
> is not constant
>  _0_20mA
>  ^
>drivers/staging/comedi/drivers/pcl726.c:99:2: note: (near initialization 
> for 'rangelist_728[5]')
> --
> >> drivers/staging/comedi/drivers/dac02.c:66:3: error: implicit declaration 
> >> of function 'RANGE_mA' [-Werror=implicit-function-declaration]
>   RANGE_mA(4, 20),
>   ^~~~
> >> drivers/staging/comedi/drivers/dac02.c:66:3: error: initializer element is 
> >> not constant
>drivers/staging/comedi/drivers/dac02.c:66:3: note: (near initialization 
> for 'das02_ao_ranges.range[4].min')
> >> drivers/staging/comedi/drivers/dac02.c:67:3: warning: braces around scalar 
> >> initializer
>   RANGE_ext(0, 1)
>   ^
>drivers/staging/comedi/drivers/dac02.c:67:3: note: (near initialization 
> for 'das02_ao_ranges.range[4].max')
>In file included from drivers/staging/comedi/drivers/dac02.c:38:0:
> >> drivers/staging/comedi/drivers/../comedidev.h:584:38: warning: excess 
> >> elements in scalar initializer
> #define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
>  ^
> >> drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
> >> 'RANGE_ext'
>   RANGE_ext(0, 1)
>   ^
>drivers/staging/comedi/drivers/../comedidev.h:584:38: note: (near 
> initialization for 'das02_ao_ranges.range[4].max')
> #define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
>  ^
> >> drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
> >> 'RANGE_ext'
>   RANGE

Re: [PATCH] RDS: Simplify code

2016-09-04 Thread Leon Romanovsky
On Sat, Sep 03, 2016 at 07:33:29AM +0200, Christophe JAILLET wrote:
> Calling 'list_splice' followed by 'INIT_LIST_HEAD' is equivalent to
> 'list_splice_init'.

It is not 100% accurate

list_splice(y, z)
INIT_LIST_HEAD(y)

==>

if (!list_empty(y))
 __list_splice(y, z, z>next);
INIT_LIST_HEAD(y)

and not

if (!list_empty(y)) {
 __list_splice(y, z, z>next);
 INIT_LIST_HEAD(y)
}

as list_splice_init will do.


>
> This has been spotted with the following coccinelle script:
> /
> @@
> expression y,z;
> @@
>
> -   list_splice(y,z);
> -   INIT_LIST_HEAD(y);
> +   list_splice_init(y,z);
>
> Signed-off-by: Christophe JAILLET 
> ---
>  net/rds/loop.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/rds/loop.c b/net/rds/loop.c
> index f2bf78de5688..c3e6da4fdf97 100644
> --- a/net/rds/loop.c
> +++ b/net/rds/loop.c
> @@ -167,8 +167,7 @@ void rds_loop_exit(void)
>
>   /* avoid calling conn_destroy with irqs off */
>   spin_lock_irq(_conns_lock);
> - list_splice(_conns, _list);
> - INIT_LIST_HEAD(_conns);
> + list_splice_init(_conns, _list);
>   spin_unlock_irq(_conns_lock);
>
>   list_for_each_entry_safe(lc, _lc, _list, loop_node) {
> --
> 2.7.4
>


signature.asc
Description: PGP signature


Re: [PATCH] RDS: Simplify code

2016-09-04 Thread Leon Romanovsky
On Sat, Sep 03, 2016 at 07:33:29AM +0200, Christophe JAILLET wrote:
> Calling 'list_splice' followed by 'INIT_LIST_HEAD' is equivalent to
> 'list_splice_init'.

It is not 100% accurate

list_splice(y, z)
INIT_LIST_HEAD(y)

==>

if (!list_empty(y))
 __list_splice(y, z, z>next);
INIT_LIST_HEAD(y)

and not

if (!list_empty(y)) {
 __list_splice(y, z, z>next);
 INIT_LIST_HEAD(y)
}

as list_splice_init will do.


>
> This has been spotted with the following coccinelle script:
> /
> @@
> expression y,z;
> @@
>
> -   list_splice(y,z);
> -   INIT_LIST_HEAD(y);
> +   list_splice_init(y,z);
>
> Signed-off-by: Christophe JAILLET 
> ---
>  net/rds/loop.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/rds/loop.c b/net/rds/loop.c
> index f2bf78de5688..c3e6da4fdf97 100644
> --- a/net/rds/loop.c
> +++ b/net/rds/loop.c
> @@ -167,8 +167,7 @@ void rds_loop_exit(void)
>
>   /* avoid calling conn_destroy with irqs off */
>   spin_lock_irq(_conns_lock);
> - list_splice(_conns, _list);
> - INIT_LIST_HEAD(_conns);
> + list_splice_init(_conns, _list);
>   spin_unlock_irq(_conns_lock);
>
>   list_for_each_entry_safe(lc, _lc, _list, loop_node) {
> --
> 2.7.4
>


signature.asc
Description: PGP signature


fs/xfs/xfs_ondisk.h:96:2: error: call to '__compiletime_assert_96' declared with attribute error: XFS: sizeof(xfs_dir2_sf_entry_t) is wrong, expected 3

2016-09-04 Thread kbuild test robot
Hi Dave,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   28e68154c5e2793123b248d38cf17b34dcb16d87
commit: ab9d1e4f7b0217948a3b35a64178602ab30ff45d Merge branch 
'xfs-misc-fixes-4.6-3' into for-next
date:   6 months ago
config: openrisc-allmodconfig (attached as .config)
compiler: or32-linux-gcc (GCC) 4.5.1-or32-1.0rc1
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
git checkout ab9d1e4f7b0217948a3b35a64178602ab30ff45d
# save the attached .config to linux build tree
make.cross ARCH=openrisc 

All errors (new ones prefixed by >>):

   In file included from fs/xfs/xfs_super.c:48:0:
   In function 'xfs_check_ondisk_structs',
   inlined from 'init_xfs_fs' at fs/xfs/xfs_super.c:1862:26:
   fs/xfs/xfs_ondisk.h:86:2: error: call to '__compiletime_assert_86' declared 
with attribute error: XFS: sizeof(xfs_dir2_data_unused_t) is wrong, expected 6
>> fs/xfs/xfs_ondisk.h:96:2: error: call to '__compiletime_assert_96' declared 
>> with attribute error: XFS: sizeof(xfs_dir2_sf_entry_t) is wrong, expected 3
   fs/xfs/xfs_ondisk.h:97:2: error: call to '__compiletime_assert_97' declared 
with attribute error: XFS: sizeof(xfs_dir2_sf_hdr_t) is wrong, expected 10

vim +/__compiletime_assert_96 +96 fs/xfs/xfs_ondisk.h

30cbc591 Darrick J. Wong 2016-03-09  80 
XFS_CHECK_STRUCT_SIZE(xfs_da_blkinfo_t, 12);
30cbc591 Darrick J. Wong 2016-03-09  81 
XFS_CHECK_STRUCT_SIZE(xfs_da_intnode_t, 16);
30cbc591 Darrick J. Wong 2016-03-09  82 
XFS_CHECK_STRUCT_SIZE(xfs_da_node_entry_t,  8);
30cbc591 Darrick J. Wong 2016-03-09  83 
XFS_CHECK_STRUCT_SIZE(xfs_da_node_hdr_t,16);
30cbc591 Darrick J. Wong 2016-03-09  84 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_free_t, 4);
30cbc591 Darrick J. Wong 2016-03-09  85 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_hdr_t,  16);
30cbc591 Darrick J. Wong 2016-03-09 @86 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_unused_t,   6);
30cbc591 Darrick J. Wong 2016-03-09  87 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_free_hdr_t,  16);
30cbc591 Darrick J. Wong 2016-03-09  88 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_free_t,  16);
30cbc591 Darrick J. Wong 2016-03-09  89 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_ino4_t,  4);
30cbc591 Darrick J. Wong 2016-03-09  90 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_ino8_t,  8);
30cbc591 Darrick J. Wong 2016-03-09  91 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_inou_t,  8);
30cbc591 Darrick J. Wong 2016-03-09  92 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_entry_t,8);
30cbc591 Darrick J. Wong 2016-03-09  93 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_hdr_t,  16);
30cbc591 Darrick J. Wong 2016-03-09  94 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_t,  16);
30cbc591 Darrick J. Wong 2016-03-09  95 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_tail_t, 4);
30cbc591 Darrick J. Wong 2016-03-09 @96 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_entry_t,  3);
30cbc591 Darrick J. Wong 2016-03-09  97 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_hdr_t,10);
30cbc591 Darrick J. Wong 2016-03-09  98 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_off_t,2);
30cbc591 Darrick J. Wong 2016-03-09  99  

:: The code at line 96 was first introduced by commit
:: 30cbc591c34e680e8b5d6d675ea49effe42a0570 xfs: check sizes of XFS on-disk 
structures at compile time

:: TO: Darrick J. Wong 
:: CC: Dave Chinner 

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


.config.gz
Description: Binary data


fs/xfs/xfs_ondisk.h:96:2: error: call to '__compiletime_assert_96' declared with attribute error: XFS: sizeof(xfs_dir2_sf_entry_t) is wrong, expected 3

2016-09-04 Thread kbuild test robot
Hi Dave,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   28e68154c5e2793123b248d38cf17b34dcb16d87
commit: ab9d1e4f7b0217948a3b35a64178602ab30ff45d Merge branch 
'xfs-misc-fixes-4.6-3' into for-next
date:   6 months ago
config: openrisc-allmodconfig (attached as .config)
compiler: or32-linux-gcc (GCC) 4.5.1-or32-1.0rc1
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
git checkout ab9d1e4f7b0217948a3b35a64178602ab30ff45d
# save the attached .config to linux build tree
make.cross ARCH=openrisc 

All errors (new ones prefixed by >>):

   In file included from fs/xfs/xfs_super.c:48:0:
   In function 'xfs_check_ondisk_structs',
   inlined from 'init_xfs_fs' at fs/xfs/xfs_super.c:1862:26:
   fs/xfs/xfs_ondisk.h:86:2: error: call to '__compiletime_assert_86' declared 
with attribute error: XFS: sizeof(xfs_dir2_data_unused_t) is wrong, expected 6
>> fs/xfs/xfs_ondisk.h:96:2: error: call to '__compiletime_assert_96' declared 
>> with attribute error: XFS: sizeof(xfs_dir2_sf_entry_t) is wrong, expected 3
   fs/xfs/xfs_ondisk.h:97:2: error: call to '__compiletime_assert_97' declared 
with attribute error: XFS: sizeof(xfs_dir2_sf_hdr_t) is wrong, expected 10

vim +/__compiletime_assert_96 +96 fs/xfs/xfs_ondisk.h

30cbc591 Darrick J. Wong 2016-03-09  80 
XFS_CHECK_STRUCT_SIZE(xfs_da_blkinfo_t, 12);
30cbc591 Darrick J. Wong 2016-03-09  81 
XFS_CHECK_STRUCT_SIZE(xfs_da_intnode_t, 16);
30cbc591 Darrick J. Wong 2016-03-09  82 
XFS_CHECK_STRUCT_SIZE(xfs_da_node_entry_t,  8);
30cbc591 Darrick J. Wong 2016-03-09  83 
XFS_CHECK_STRUCT_SIZE(xfs_da_node_hdr_t,16);
30cbc591 Darrick J. Wong 2016-03-09  84 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_free_t, 4);
30cbc591 Darrick J. Wong 2016-03-09  85 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_hdr_t,  16);
30cbc591 Darrick J. Wong 2016-03-09 @86 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_data_unused_t,   6);
30cbc591 Darrick J. Wong 2016-03-09  87 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_free_hdr_t,  16);
30cbc591 Darrick J. Wong 2016-03-09  88 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_free_t,  16);
30cbc591 Darrick J. Wong 2016-03-09  89 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_ino4_t,  4);
30cbc591 Darrick J. Wong 2016-03-09  90 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_ino8_t,  8);
30cbc591 Darrick J. Wong 2016-03-09  91 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_inou_t,  8);
30cbc591 Darrick J. Wong 2016-03-09  92 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_entry_t,8);
30cbc591 Darrick J. Wong 2016-03-09  93 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_hdr_t,  16);
30cbc591 Darrick J. Wong 2016-03-09  94 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_t,  16);
30cbc591 Darrick J. Wong 2016-03-09  95 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_leaf_tail_t, 4);
30cbc591 Darrick J. Wong 2016-03-09 @96 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_entry_t,  3);
30cbc591 Darrick J. Wong 2016-03-09  97 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_hdr_t,10);
30cbc591 Darrick J. Wong 2016-03-09  98 
XFS_CHECK_STRUCT_SIZE(xfs_dir2_sf_off_t,2);
30cbc591 Darrick J. Wong 2016-03-09  99  

:: The code at line 96 was first introduced by commit
:: 30cbc591c34e680e8b5d6d675ea49effe42a0570 xfs: check sizes of XFS on-disk 
structures at compile time

:: TO: Darrick J. Wong 
:: CC: Dave Chinner 

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


.config.gz
Description: Binary data


Re: [PATCH 4/4] ARM: dts: use definition in rockchip pinctrl header to describe gpios on Popmetal-RK3288

2016-09-04 Thread kbuild test robot
Hi Andy,

[auto build test ERROR on rockchip/for-next]
[also build test ERROR on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Andy-Yan/One-fix-and-some-improvements-for-RK3288-Popmetal-board/20160904-164007
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git 
for-next
config: arm-aspeed_g4_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 5.4.0-6) 5.4.0 20160609
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 >>):

>> Error: arch/arm/boot/dts/rk3288-popmetal.dts:131.18-19 syntax error
>> FATAL ERROR: Unable to parse input tree

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


.config.gz
Description: Binary data


Re: [PATCH 4/4] ARM: dts: use definition in rockchip pinctrl header to describe gpios on Popmetal-RK3288

2016-09-04 Thread kbuild test robot
Hi Andy,

[auto build test ERROR on rockchip/for-next]
[also build test ERROR on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Andy-Yan/One-fix-and-some-improvements-for-RK3288-Popmetal-board/20160904-164007
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git 
for-next
config: arm-aspeed_g4_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 5.4.0-6) 5.4.0 20160609
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 >>):

>> Error: arch/arm/boot/dts/rk3288-popmetal.dts:131.18-19 syntax error
>> FATAL ERROR: Unable to parse input tree

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


.config.gz
Description: Binary data


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread kbuild test robot
Hi Amit,

[auto build test ERROR on v4.8-rc4]
[cannot apply to staging/staging-testing next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All error/warnings (new ones prefixed by >>):

>> drivers/staging/comedi/range.c:35:49: error: implicit declaration of 
>> function 'RANGE_mA' [-Werror=implicit-function-declaration]
const struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} };
^~~~
>> drivers/staging/comedi/range.c:35:49: error: initializer element is not 
>> constant
   drivers/staging/comedi/range.c:35:49: note: (near initialization for 
'range_0_20mA.range[0].min')
   drivers/staging/comedi/range.c:37:49: error: initializer element is not 
constant
const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} };
^~~~
   drivers/staging/comedi/range.c:37:49: note: (near initialization for 
'range_4_20mA.range[0].min')
   drivers/staging/comedi/range.c:39:49: error: initializer element is not 
constant
const struct comedi_lrange range_0_32mA = { 1, {RANGE_mA(0, 32)} };
^~~~
   drivers/staging/comedi/range.c:39:49: note: (near initialization for 
'range_0_32mA.range[0].min')
   cc1: some warnings being treated as errors
--
>> drivers/staging/comedi/drivers/pcl726.c:82:3: error: 'range_4_20mA' 
>> undeclared here (not in a function)
 _4_20mA,
  ^~~~
>> drivers/staging/comedi/drivers/pcl726.c:90:2: error: initializer element is 
>> not constant
 _4_20mA
 ^
   drivers/staging/comedi/drivers/pcl726.c:90:2: note: (near initialization for 
'rangelist_727[3]')
   drivers/staging/comedi/drivers/pcl726.c:98:2: error: initializer element is 
not constant
 _4_20mA,
 ^
   drivers/staging/comedi/drivers/pcl726.c:98:2: note: (near initialization for 
'rangelist_728[4]')
>> drivers/staging/comedi/drivers/pcl726.c:99:3: error: 'range_0_20mA' 
>> undeclared here (not in a function)
 _0_20mA
  ^~~~
   drivers/staging/comedi/drivers/pcl726.c:99:2: error: initializer element is 
not constant
 _0_20mA
 ^
   drivers/staging/comedi/drivers/pcl726.c:99:2: note: (near initialization for 
'rangelist_728[5]')
--
>> drivers/staging/comedi/drivers/dac02.c:66:3: error: implicit declaration of 
>> function 'RANGE_mA' [-Werror=implicit-function-declaration]
  RANGE_mA(4, 20),
  ^~~~
>> drivers/staging/comedi/drivers/dac02.c:66:3: error: initializer element is 
>> not constant
   drivers/staging/comedi/drivers/dac02.c:66:3: note: (near initialization for 
'das02_ao_ranges.range[4].min')
>> drivers/staging/comedi/drivers/dac02.c:67:3: warning: braces around scalar 
>> initializer
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: (near initialization for 
'das02_ao_ranges.range[4].max')
   In file included from drivers/staging/comedi/drivers/dac02.c:38:0:
>> drivers/staging/comedi/drivers/../comedidev.h:584:38: warning: excess 
>> elements in scalar initializer
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
 ^
>> drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
>> 'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/../comedidev.h:584:38: note: (near 
initialization for 'das02_ao_ranges.range[4].max')
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
 ^
>> drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
>> 'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   In file included from drivers/staging/comedi/drivers/../comedidev.h:28:0,
from drivers/staging/comedi/drivers/dac02.c:38:
>> drivers/staging/comedi/drivers/../comedi.h:897:22: warning: excess elements 
>> in scalar initializer
#define RF_EXTERNAL  0x100
 ^
>> drivers/staging/comedi/drivers/../comedidev.h:584:49: note: in expansion of 
>> macro 'RF_EXTERNAL'
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
   

Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread kbuild test robot
Hi Amit,

[auto build test ERROR on v4.8-rc4]
[cannot apply to staging/staging-testing next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All error/warnings (new ones prefixed by >>):

>> drivers/staging/comedi/range.c:35:49: error: implicit declaration of 
>> function 'RANGE_mA' [-Werror=implicit-function-declaration]
const struct comedi_lrange range_0_20mA = { 1, {RANGE_mA(0, 20)} };
^~~~
>> drivers/staging/comedi/range.c:35:49: error: initializer element is not 
>> constant
   drivers/staging/comedi/range.c:35:49: note: (near initialization for 
'range_0_20mA.range[0].min')
   drivers/staging/comedi/range.c:37:49: error: initializer element is not 
constant
const struct comedi_lrange range_4_20mA = { 1, {RANGE_mA(4, 20)} };
^~~~
   drivers/staging/comedi/range.c:37:49: note: (near initialization for 
'range_4_20mA.range[0].min')
   drivers/staging/comedi/range.c:39:49: error: initializer element is not 
constant
const struct comedi_lrange range_0_32mA = { 1, {RANGE_mA(0, 32)} };
^~~~
   drivers/staging/comedi/range.c:39:49: note: (near initialization for 
'range_0_32mA.range[0].min')
   cc1: some warnings being treated as errors
--
>> drivers/staging/comedi/drivers/pcl726.c:82:3: error: 'range_4_20mA' 
>> undeclared here (not in a function)
 _4_20mA,
  ^~~~
>> drivers/staging/comedi/drivers/pcl726.c:90:2: error: initializer element is 
>> not constant
 _4_20mA
 ^
   drivers/staging/comedi/drivers/pcl726.c:90:2: note: (near initialization for 
'rangelist_727[3]')
   drivers/staging/comedi/drivers/pcl726.c:98:2: error: initializer element is 
not constant
 _4_20mA,
 ^
   drivers/staging/comedi/drivers/pcl726.c:98:2: note: (near initialization for 
'rangelist_728[4]')
>> drivers/staging/comedi/drivers/pcl726.c:99:3: error: 'range_0_20mA' 
>> undeclared here (not in a function)
 _0_20mA
  ^~~~
   drivers/staging/comedi/drivers/pcl726.c:99:2: error: initializer element is 
not constant
 _0_20mA
 ^
   drivers/staging/comedi/drivers/pcl726.c:99:2: note: (near initialization for 
'rangelist_728[5]')
--
>> drivers/staging/comedi/drivers/dac02.c:66:3: error: implicit declaration of 
>> function 'RANGE_mA' [-Werror=implicit-function-declaration]
  RANGE_mA(4, 20),
  ^~~~
>> drivers/staging/comedi/drivers/dac02.c:66:3: error: initializer element is 
>> not constant
   drivers/staging/comedi/drivers/dac02.c:66:3: note: (near initialization for 
'das02_ao_ranges.range[4].min')
>> drivers/staging/comedi/drivers/dac02.c:67:3: warning: braces around scalar 
>> initializer
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: (near initialization for 
'das02_ao_ranges.range[4].max')
   In file included from drivers/staging/comedi/drivers/dac02.c:38:0:
>> drivers/staging/comedi/drivers/../comedidev.h:584:38: warning: excess 
>> elements in scalar initializer
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
 ^
>> drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
>> 'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/../comedidev.h:584:38: note: (near 
initialization for 'das02_ao_ranges.range[4].max')
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
 ^
>> drivers/staging/comedi/drivers/dac02.c:67:3: note: in expansion of macro 
>> 'RANGE_ext'
  RANGE_ext(0, 1)
  ^
   In file included from drivers/staging/comedi/drivers/../comedidev.h:28:0,
from drivers/staging/comedi/drivers/dac02.c:38:
>> drivers/staging/comedi/drivers/../comedi.h:897:22: warning: excess elements 
>> in scalar initializer
#define RF_EXTERNAL  0x100
 ^
>> drivers/staging/comedi/drivers/../comedidev.h:584:49: note: in expansion of 
>> macro 'RF_EXTERNAL'
#define RANGE_ext(a, b)  {(a) * 1e6, (b) * 1e6, RF_EXTERNAL}
   

RE: [PATCH v5 4/8] char: rpmb: provide a user space interface

2016-09-04 Thread Winkler, Tomas

> On Thu, Sep 01, 2016 at 08:05:26PM +, Winkler, Tomas wrote:
> >
> > >
> > > On Sun, Aug 07, 2016 at 09:44:03AM +, Winkler, Tomas wrote:
> > > > >
> > > > > On Mon 2016-07-18 23:27:49, Tomas Winkler wrote:
> > > > > > The user space API is achieved via two synchronous IOCTL.
> > > > >
> > > > > IOCTLs?
> > > >
> > > > Will fix
> > > >
> > > > > > Simplified one, RPMB_IOC_REQ_CMD, were read result cycles is
> > > > > performed
> > > > > > by the framework on behalf the user and second,
> > > > > > RPMB_IOC_SEQ_CMD
> > > > > where
> > > > > > the whole RPMB sequence including RESULT_READ is supplied by
> > > > > > the
> > > caller.
> > > > > > The latter is intended for  easier adjusting  of the
> > > > > > applications that use MMC_IOC_MULTI_CMD ioctl.
> > > > >
> > > > > Why "  "?
> > > > Not sure I there is enough clue in your question.
> > > > >
> > > > > >
> > > > > > Signed-off-by: Tomas Winkler 
> > > > >
> > > > > > +
> > > > > > +static long rpmb_ioctl(struct file *fp, unsigned int cmd,
> > > > > > +unsigned long arg) {
> > > > > > +   return __rpmb_ioctl(fp, cmd, (void __user *)arg); }
> > > > > > +
> > > > > > +#ifdef CONFIG_COMPAT
> > > > > > +static long rpmb_compat_ioctl(struct file *fp, unsigned int cmd,
> > > > > > + unsigned long arg)
> > > > > > +{
> > > > > > +   return  __rpmb_ioctl(fp, cmd, compat_ptr(arg));
> > > > > > +}
> > > > > > +#endif /* CONFIG_COMPAT */
> > > > >
> > > > > Description of the ioctl is missing,
> > > > Will add.
> > > >
> > > > and it should certainly be designed in a way
> > > > > that it does not need compat support.
> > > >
> > > > The compat_ioctl handler just casts the compat_ptr, I believe this
> > > > should be done unless the ioctl is globaly registered in
> > > > fs/compat_ioctl.c, but I might be wrong.
> > >
> > > You shouldn't need a compat ioctl for anything new that is added,
> > > unless your api is really messed up.  Please test to be sure, and
> > > not use a compat ioctl at all, it isn't that hard to do.
> >
> > compat_ioctl is called anyhow when CONFIG_COMPAT is set, there is no
> > way around it, or I'm missing something?  Actually there is no more
> > than that for the COMPAT support in this code.
> 
> If you don't provide a compat_ioctl() all should be fine, right?

No,  this doesn't work the driver has to provide compat_ioctl

You would expect something like
if (!f.file->f_op->compat_ioctl) {
error = f_op->f.file->f_op->unlocked_ioctl((f.file, 
cmd, compat_ptr(arg))
}
But there is no such code under  fs/compat_ioctl.c 

The translation has to implemented by the device driver or registered  directly 
in fs/compat_ioct.c in do_ioctl_trans or ioctl_pointer[]

If compat_ioct is not provided the application is receiving
: ioctl failure -1: Inappropriate ioctl for device

Thanks
Tomas



RE: [PATCH v5 4/8] char: rpmb: provide a user space interface

2016-09-04 Thread Winkler, Tomas

> On Thu, Sep 01, 2016 at 08:05:26PM +, Winkler, Tomas wrote:
> >
> > >
> > > On Sun, Aug 07, 2016 at 09:44:03AM +, Winkler, Tomas wrote:
> > > > >
> > > > > On Mon 2016-07-18 23:27:49, Tomas Winkler wrote:
> > > > > > The user space API is achieved via two synchronous IOCTL.
> > > > >
> > > > > IOCTLs?
> > > >
> > > > Will fix
> > > >
> > > > > > Simplified one, RPMB_IOC_REQ_CMD, were read result cycles is
> > > > > performed
> > > > > > by the framework on behalf the user and second,
> > > > > > RPMB_IOC_SEQ_CMD
> > > > > where
> > > > > > the whole RPMB sequence including RESULT_READ is supplied by
> > > > > > the
> > > caller.
> > > > > > The latter is intended for  easier adjusting  of the
> > > > > > applications that use MMC_IOC_MULTI_CMD ioctl.
> > > > >
> > > > > Why "  "?
> > > > Not sure I there is enough clue in your question.
> > > > >
> > > > > >
> > > > > > Signed-off-by: Tomas Winkler 
> > > > >
> > > > > > +
> > > > > > +static long rpmb_ioctl(struct file *fp, unsigned int cmd,
> > > > > > +unsigned long arg) {
> > > > > > +   return __rpmb_ioctl(fp, cmd, (void __user *)arg); }
> > > > > > +
> > > > > > +#ifdef CONFIG_COMPAT
> > > > > > +static long rpmb_compat_ioctl(struct file *fp, unsigned int cmd,
> > > > > > + unsigned long arg)
> > > > > > +{
> > > > > > +   return  __rpmb_ioctl(fp, cmd, compat_ptr(arg));
> > > > > > +}
> > > > > > +#endif /* CONFIG_COMPAT */
> > > > >
> > > > > Description of the ioctl is missing,
> > > > Will add.
> > > >
> > > > and it should certainly be designed in a way
> > > > > that it does not need compat support.
> > > >
> > > > The compat_ioctl handler just casts the compat_ptr, I believe this
> > > > should be done unless the ioctl is globaly registered in
> > > > fs/compat_ioctl.c, but I might be wrong.
> > >
> > > You shouldn't need a compat ioctl for anything new that is added,
> > > unless your api is really messed up.  Please test to be sure, and
> > > not use a compat ioctl at all, it isn't that hard to do.
> >
> > compat_ioctl is called anyhow when CONFIG_COMPAT is set, there is no
> > way around it, or I'm missing something?  Actually there is no more
> > than that for the COMPAT support in this code.
> 
> If you don't provide a compat_ioctl() all should be fine, right?

No,  this doesn't work the driver has to provide compat_ioctl

You would expect something like
if (!f.file->f_op->compat_ioctl) {
error = f_op->f.file->f_op->unlocked_ioctl((f.file, 
cmd, compat_ptr(arg))
}
But there is no such code under  fs/compat_ioctl.c 

The translation has to implemented by the device driver or registered  directly 
in fs/compat_ioct.c in do_ioctl_trans or ioctl_pointer[]

If compat_ioct is not provided the application is receiving
: ioctl failure -1: Inappropriate ioctl for device

Thanks
Tomas



Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread kbuild test robot
Hi Amit,

[auto build test WARNING on v4.8-rc4]
[cannot apply to staging/staging-testing next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
config: i386-randconfig-i0-201636 (attached as .config)
compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: error: implicit 
declaration of function 'RANGE_mA' [-Werror=implicit-function-declaration]
  RANGE_mA(0, 20),
  ^
   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: warning: missing braces 
around initializer [-Wmissing-braces]
   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: warning: (near 
initialization for 'adv_pci1724_ao_ranges.range[1]') [-Wmissing-braces]
   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: error: initializer 
element is not constant
   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: error: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].min')
   drivers/staging/comedi/drivers/adv_pci1724.c:77:3: error: initializer 
element is not constant
  RANGE_mA(4, 20),
  ^
   drivers/staging/comedi/drivers/adv_pci1724.c:77:3: error: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].max')
   drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: braces around 
scalar initializer [enabled by default]
  RANGE_unitless(0, 1)
  ^
   drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].flags') [enabled by default]
>> drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: excess elements 
>> in scalar initializer [enabled by default]
   drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].flags') [enabled by default]
>> drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: excess elements 
>> in scalar initializer [enabled by default]
   drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].flags') [enabled by default]
   cc1: some warnings being treated as errors

vim +78 drivers/staging/comedi/drivers/adv_pci1724.c

c2edc021 H Hartley Sweeten 2014-11-20  70  #define PCI1724_BOARD_ID_REG 
0x10
70adf763 H Hartley Sweeten 2014-11-20  71  #define PCI1724_BOARD_ID_MASK
(0xf << 0)
f165d815 Frank Mori Hess   2013-03-12  72  
474bfe5f H Hartley Sweeten 2014-11-20  73  static const struct comedi_lrange 
adv_pci1724_ao_ranges = {
348dc03e H Hartley Sweeten 2013-12-09  74   4, {
f165d815 Frank Mori Hess   2013-03-12  75   BIP_RANGE(10),
f165d815 Frank Mori Hess   2013-03-12 @76   RANGE_mA(0, 20),
f165d815 Frank Mori Hess   2013-03-12  77   RANGE_mA(4, 20),
f165d815 Frank Mori Hess   2013-03-12 @78   RANGE_unitless(0, 1)
f165d815 Frank Mori Hess   2013-03-12  79   }
f165d815 Frank Mori Hess   2013-03-12  80  };
f165d815 Frank Mori Hess   2013-03-12  81  

:: The code at line 78 was first introduced by commit
:: f165d815d50f158be43aa12c5c800fd27bbecad3 staging: comedi: adv_pci1724: 
new driver

:: TO: Frank Mori Hess <fmh...@gmail.com>
:: CC: Greg Kroah-Hartman <gre...@linuxfoundation.org>

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


.config.gz
Description: Binary data


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread kbuild test robot
Hi Amit,

[auto build test WARNING on v4.8-rc4]
[cannot apply to staging/staging-testing next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
config: i386-randconfig-i0-201636 (attached as .config)
compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: error: implicit 
declaration of function 'RANGE_mA' [-Werror=implicit-function-declaration]
  RANGE_mA(0, 20),
  ^
   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: warning: missing braces 
around initializer [-Wmissing-braces]
   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: warning: (near 
initialization for 'adv_pci1724_ao_ranges.range[1]') [-Wmissing-braces]
   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: error: initializer 
element is not constant
   drivers/staging/comedi/drivers/adv_pci1724.c:76:3: error: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].min')
   drivers/staging/comedi/drivers/adv_pci1724.c:77:3: error: initializer 
element is not constant
  RANGE_mA(4, 20),
  ^
   drivers/staging/comedi/drivers/adv_pci1724.c:77:3: error: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].max')
   drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: braces around 
scalar initializer [enabled by default]
  RANGE_unitless(0, 1)
  ^
   drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].flags') [enabled by default]
>> drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: excess elements 
>> in scalar initializer [enabled by default]
   drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].flags') [enabled by default]
>> drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: excess elements 
>> in scalar initializer [enabled by default]
   drivers/staging/comedi/drivers/adv_pci1724.c:78:3: warning: (near 
initialization for 'adv_pci1724_ao_ranges.range[1].flags') [enabled by default]
   cc1: some warnings being treated as errors

vim +78 drivers/staging/comedi/drivers/adv_pci1724.c

c2edc021 H Hartley Sweeten 2014-11-20  70  #define PCI1724_BOARD_ID_REG 
0x10
70adf763 H Hartley Sweeten 2014-11-20  71  #define PCI1724_BOARD_ID_MASK
(0xf << 0)
f165d815 Frank Mori Hess   2013-03-12  72  
474bfe5f H Hartley Sweeten 2014-11-20  73  static const struct comedi_lrange 
adv_pci1724_ao_ranges = {
348dc03e H Hartley Sweeten 2013-12-09  74   4, {
f165d815 Frank Mori Hess   2013-03-12  75   BIP_RANGE(10),
f165d815 Frank Mori Hess   2013-03-12 @76   RANGE_mA(0, 20),
f165d815 Frank Mori Hess   2013-03-12  77   RANGE_mA(4, 20),
f165d815 Frank Mori Hess   2013-03-12 @78   RANGE_unitless(0, 1)
f165d815 Frank Mori Hess   2013-03-12  79   }
f165d815 Frank Mori Hess   2013-03-12  80  };
f165d815 Frank Mori Hess   2013-03-12  81  

:: The code at line 78 was first introduced by commit
:: f165d815d50f158be43aa12c5c800fd27bbecad3 staging: comedi: adv_pci1724: 
new driver

:: TO: Frank Mori Hess 
:: CC: Greg Kroah-Hartman 

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


.config.gz
Description: Binary data


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread kbuild test robot
Hi Amit,

[auto build test WARNING on v4.8-rc4]
[cannot apply to staging/staging-testing next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
config: i386-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/staging/comedi/drivers/dac02.c:66:3: error: implicit declaration of 
function 'RANGE_mA' [-Werror=implicit-function-declaration]
  RANGE_mA(4, 20),
  ^~~~
   drivers/staging/comedi/drivers/dac02.c:66:3: error: initializer element is 
not constant
   drivers/staging/comedi/drivers/dac02.c:66:3: note: (near initialization for 
'das02_ao_ranges.range[4].min')
   drivers/staging/comedi/drivers/dac02.c:67:3: warning: braces around scalar 
initializer
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: (near initialization for 
'das02_ao_ranges.range[4].max')
>> drivers/staging/comedi/drivers/dac02.c:67:15: warning: excess elements in 
>> scalar initializer
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/dac02.c:67:15: note: (near initialization for 
'das02_ao_ranges.range[4].max')
   drivers/staging/comedi/drivers/dac02.c:67:26: warning: excess elements in 
scalar initializer
  RANGE_ext(0, 1)
 ^
   drivers/staging/comedi/drivers/dac02.c:67:26: note: (near initialization for 
'das02_ao_ranges.range[4].max')
   drivers/staging/comedi/drivers/dac02.c:61:5: warning: missing braces around 
initializer [-Wmissing-braces]
 6, {
^
   drivers/staging/comedi/drivers/dac02.c:61:5: note: (near initialization for 
'das02_ao_ranges.range')
   drivers/staging/comedi/drivers/dac02.c:60:53: warning: missing braces around 
initializer [-Wmissing-braces]
static const struct comedi_lrange das02_ao_ranges = {
^
   drivers/staging/comedi/drivers/dac02.c:60:53: note: (near initialization for 
'das02_ao_ranges')
   cc1: some warnings being treated as errors

vim +67 drivers/staging/comedi/drivers/dac02.c

9e27 H Hartley Sweeten 2014-03-11  60  static const struct comedi_lrange 
das02_ao_ranges = {
9e27 H Hartley Sweeten 2014-03-11  61   6, {
9e27 H Hartley Sweeten 2014-03-11  62   UNI_RANGE(5),
9e27 H Hartley Sweeten 2014-03-11  63   UNI_RANGE(10),
9e27 H Hartley Sweeten 2014-03-11  64   BIP_RANGE(5),
9e27 H Hartley Sweeten 2014-03-11  65   BIP_RANGE(10),
9e27 H Hartley Sweeten 2014-03-11 @66   RANGE_mA(4, 20),
9e27 H Hartley Sweeten 2014-03-11 @67   RANGE_ext(0, 1)
9e27 H Hartley Sweeten 2014-03-11  68   }
9e27 H Hartley Sweeten 2014-03-11  69  };
9e27 H Hartley Sweeten 2014-03-11  70  

:: The code at line 67 was first introduced by commit
:: 9e27475c9cbed2d59ac33f1d6f21bf9e260d staging: comedi: dac02: 
introduce comedi driver for DAC02 boards

:: TO: H Hartley Sweeten <hartl...@visionengravers.com>
:: CC: Greg Kroah-Hartman <gre...@linuxfoundation.org>

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


.config.gz
Description: Binary data


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread kbuild test robot
Hi Amit,

[auto build test WARNING on v4.8-rc4]
[cannot apply to staging/staging-testing next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]
[Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for 
convenience) to record what (public, well-known) commit your patch series was 
built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:
https://github.com/0day-ci/linux/commits/Amit-Ghadge/Staging-comedi-ni_daq_dio24-c-Fix-block-comments-use-on-subsequent-lines/20160904-170303
config: i386-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/staging/comedi/drivers/dac02.c:66:3: error: implicit declaration of 
function 'RANGE_mA' [-Werror=implicit-function-declaration]
  RANGE_mA(4, 20),
  ^~~~
   drivers/staging/comedi/drivers/dac02.c:66:3: error: initializer element is 
not constant
   drivers/staging/comedi/drivers/dac02.c:66:3: note: (near initialization for 
'das02_ao_ranges.range[4].min')
   drivers/staging/comedi/drivers/dac02.c:67:3: warning: braces around scalar 
initializer
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/dac02.c:67:3: note: (near initialization for 
'das02_ao_ranges.range[4].max')
>> drivers/staging/comedi/drivers/dac02.c:67:15: warning: excess elements in 
>> scalar initializer
  RANGE_ext(0, 1)
  ^
   drivers/staging/comedi/drivers/dac02.c:67:15: note: (near initialization for 
'das02_ao_ranges.range[4].max')
   drivers/staging/comedi/drivers/dac02.c:67:26: warning: excess elements in 
scalar initializer
  RANGE_ext(0, 1)
 ^
   drivers/staging/comedi/drivers/dac02.c:67:26: note: (near initialization for 
'das02_ao_ranges.range[4].max')
   drivers/staging/comedi/drivers/dac02.c:61:5: warning: missing braces around 
initializer [-Wmissing-braces]
 6, {
^
   drivers/staging/comedi/drivers/dac02.c:61:5: note: (near initialization for 
'das02_ao_ranges.range')
   drivers/staging/comedi/drivers/dac02.c:60:53: warning: missing braces around 
initializer [-Wmissing-braces]
static const struct comedi_lrange das02_ao_ranges = {
^
   drivers/staging/comedi/drivers/dac02.c:60:53: note: (near initialization for 
'das02_ao_ranges')
   cc1: some warnings being treated as errors

vim +67 drivers/staging/comedi/drivers/dac02.c

9e27 H Hartley Sweeten 2014-03-11  60  static const struct comedi_lrange 
das02_ao_ranges = {
9e27 H Hartley Sweeten 2014-03-11  61   6, {
9e27 H Hartley Sweeten 2014-03-11  62   UNI_RANGE(5),
9e27 H Hartley Sweeten 2014-03-11  63   UNI_RANGE(10),
9e27 H Hartley Sweeten 2014-03-11  64   BIP_RANGE(5),
9e27 H Hartley Sweeten 2014-03-11  65   BIP_RANGE(10),
9e27 H Hartley Sweeten 2014-03-11 @66   RANGE_mA(4, 20),
9e27 H Hartley Sweeten 2014-03-11 @67   RANGE_ext(0, 1)
9e27 H Hartley Sweeten 2014-03-11  68   }
9e27 H Hartley Sweeten 2014-03-11  69  };
9e27 H Hartley Sweeten 2014-03-11  70  

:: The code at line 67 was first introduced by commit
:: 9e27475c9cbed2d59ac33f1d6f21bf9e260d staging: comedi: dac02: 
introduce comedi driver for DAC02 boards

:: TO: H Hartley Sweeten 
:: CC: Greg Kroah-Hartman 

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


.config.gz
Description: Binary data


[PATCH v3 03/17] ARM: dts: exynos: Use common macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Replace duplicated macros in each DTSI file with a common macro coming
from header.  Include the header in each pinctrl DTSI so further changes
could use it.

Although PIN_FUNC_SPC_2 does not bring much information about the
function itself, it still is more descriptive then hard-coded
number <2>.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos3250-pinctrl.dtsi | 76 +++-
 arch/arm/boot/dts/exynos4210-pinctrl.dtsi |  2 +
 arch/arm/boot/dts/exynos4415-pinctrl.dtsi |  2 +
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi | 21 +++
 arch/arm/boot/dts/exynos5250-pinctrl.dtsi |  2 +
 arch/arm/boot/dts/exynos5260-pinctrl.dtsi | 96 +++
 arch/arm/boot/dts/exynos5410-pinctrl.dtsi |  2 +
 arch/arm/boot/dts/exynos5420-pinctrl.dtsi |  2 +
 8 files changed, 96 insertions(+), 107 deletions(-)

diff --git a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
index 40ea7de44933..ed22d94f4fe5 100644
--- a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
@@ -12,58 +12,46 @@
  * published by the Free Software Foundation.
 */
 
-#define PIN_PULL_NONE  0
-#define PIN_PULL_DOWN  1
-#define PIN_PULL_UP3
-
-#define PIN_DRV_LV10
-#define PIN_DRV_LV22
-#define PIN_DRV_LV31
-#define PIN_DRV_LV43
-
-#define PIN_PDN_OUT0   0
-#define PIN_PDN_OUT1   1
-#define PIN_PDN_INPUT  2
-#define PIN_PDN_PREV   3
-
-#define PIN_IN(_pin, _pull, _drv)  \
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-function = <0>; \
-   samsung,pin-pud = ;  \
-   samsung,pin-drv = ;\
+#include 
+
+#define PIN_IN(_pin, _pull, _drv)  \
+   _pin {  \
+   samsung,pins = #_pin;   \
+   samsung,pin-function = ; \
+   samsung,pin-pud = ;   \
+   samsung,pin-drv = ;\
}
 
-#define PIN_OUT(_pin, _drv)\
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-function = <1>; \
-   samsung,pin-pud = <0>;  \
-   samsung,pin-drv = ;\
+#define PIN_OUT(_pin, _drv)\
+   _pin {  \
+   samsung,pins = #_pin;   \
+   samsung,pin-function = ;\
+   samsung,pin-pud = ;   \
+   samsung,pin-drv = ;\
}
 
-#define PIN_OUT_SET(_pin, _val, _drv)  \
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-function = <1>; \
-   samsung,pin-pud = <0>;  \
-   samsung,pin-drv = ;\
-   samsung,pin-val = <_val>;   \
+#define PIN_OUT_SET(_pin, _val, _drv)  \
+   _pin {  \
+   samsung,pins = #_pin;   \
+   samsung,pin-function = ;\
+   samsung,pin-pud = ;   \
+   samsung,pin-drv = ;\
+   samsung,pin-val = <_val>;   \
}
 
-#define PIN_CFG(_pin, _sel, _pull, _drv)   \
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-function = <_sel>;  \
-   samsung,pin-pud = ;  \
-   samsung,pin-drv = ;\
+#define PIN_CFG(_pin, _sel, _pull, _drv)   \
+   _pin {  \
+   samsung,pins = #_pin;   \
+   samsung,pin-function = <_sel>;  \
+   samsung,pin-pud = ;   \
+   samsung,pin-drv = ;\
}
 
-#define PIN_SLP(_pin, _mode, _pull)\
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-con-pdn = ;   \
-   samsung,pin-pud-pdn = ;  \
+#define PIN_SLP(_pin, _mode, 

[PATCH v3 03/17] ARM: dts: exynos: Use common macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Replace duplicated macros in each DTSI file with a common macro coming
from header.  Include the header in each pinctrl DTSI so further changes
could use it.

Although PIN_FUNC_SPC_2 does not bring much information about the
function itself, it still is more descriptive then hard-coded
number <2>.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos3250-pinctrl.dtsi | 76 +++-
 arch/arm/boot/dts/exynos4210-pinctrl.dtsi |  2 +
 arch/arm/boot/dts/exynos4415-pinctrl.dtsi |  2 +
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi | 21 +++
 arch/arm/boot/dts/exynos5250-pinctrl.dtsi |  2 +
 arch/arm/boot/dts/exynos5260-pinctrl.dtsi | 96 +++
 arch/arm/boot/dts/exynos5410-pinctrl.dtsi |  2 +
 arch/arm/boot/dts/exynos5420-pinctrl.dtsi |  2 +
 8 files changed, 96 insertions(+), 107 deletions(-)

diff --git a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
index 40ea7de44933..ed22d94f4fe5 100644
--- a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
@@ -12,58 +12,46 @@
  * published by the Free Software Foundation.
 */
 
-#define PIN_PULL_NONE  0
-#define PIN_PULL_DOWN  1
-#define PIN_PULL_UP3
-
-#define PIN_DRV_LV10
-#define PIN_DRV_LV22
-#define PIN_DRV_LV31
-#define PIN_DRV_LV43
-
-#define PIN_PDN_OUT0   0
-#define PIN_PDN_OUT1   1
-#define PIN_PDN_INPUT  2
-#define PIN_PDN_PREV   3
-
-#define PIN_IN(_pin, _pull, _drv)  \
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-function = <0>; \
-   samsung,pin-pud = ;  \
-   samsung,pin-drv = ;\
+#include 
+
+#define PIN_IN(_pin, _pull, _drv)  \
+   _pin {  \
+   samsung,pins = #_pin;   \
+   samsung,pin-function = ; \
+   samsung,pin-pud = ;   \
+   samsung,pin-drv = ;\
}
 
-#define PIN_OUT(_pin, _drv)\
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-function = <1>; \
-   samsung,pin-pud = <0>;  \
-   samsung,pin-drv = ;\
+#define PIN_OUT(_pin, _drv)\
+   _pin {  \
+   samsung,pins = #_pin;   \
+   samsung,pin-function = ;\
+   samsung,pin-pud = ;   \
+   samsung,pin-drv = ;\
}
 
-#define PIN_OUT_SET(_pin, _val, _drv)  \
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-function = <1>; \
-   samsung,pin-pud = <0>;  \
-   samsung,pin-drv = ;\
-   samsung,pin-val = <_val>;   \
+#define PIN_OUT_SET(_pin, _val, _drv)  \
+   _pin {  \
+   samsung,pins = #_pin;   \
+   samsung,pin-function = ;\
+   samsung,pin-pud = ;   \
+   samsung,pin-drv = ;\
+   samsung,pin-val = <_val>;   \
}
 
-#define PIN_CFG(_pin, _sel, _pull, _drv)   \
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-function = <_sel>;  \
-   samsung,pin-pud = ;  \
-   samsung,pin-drv = ;\
+#define PIN_CFG(_pin, _sel, _pull, _drv)   \
+   _pin {  \
+   samsung,pins = #_pin;   \
+   samsung,pin-function = <_sel>;  \
+   samsung,pin-pud = ;   \
+   samsung,pin-drv = ;\
}
 
-#define PIN_SLP(_pin, _mode, _pull)\
-   _pin {  \
-   samsung,pins = #_pin;   \
-   samsung,pin-con-pdn = ;   \
-   samsung,pin-pud-pdn = ;  \
+#define PIN_SLP(_pin, _mode, _pull)\
+   _pin { 

[PATCH v3 17/17] ARM: dts: s3c64xx: Use macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier
to read.  One does not have to remember which value means pull-up/down
or specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/s3c64xx-pinctrl.dtsi | 176 -
 1 file changed, 88 insertions(+), 88 deletions(-)

diff --git a/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi 
b/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
index 93810d992c3f..4e8e802b4ee1 100644
--- a/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
+++ b/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
@@ -136,219 +136,219 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa-0", "gpa-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa-2", "gpa-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa-4", "gpa-5";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa-6", "gpa-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
ext_dma_0: ext-dma-0 {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <3>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
ext_dma_1: ext-dma-1 {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <4>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
irda_data_0: irda-data-0 {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <4>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
irda_data_1: irda-data-1 {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <3>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
irda_sdbw: irda-sdbw {
samsung,pins = "gpb-4";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
i2c0_bus: i2c0-bus {
samsung,pins = "gpb-5", "gpb-6";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
i2c1_bus: i2c1-bus {
/* S3C6410-only */
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <6>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpc-0", "gpc-1", "gpc-2";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
spi0_cs: spi0-cs {
samsung,pins = "gpc-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpc-4", "gpc-5", "gpc-6";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
spi1_cs: spi1-cs {
samsung,pins = "gpc-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
sd0_cmd: sd0-cmd {
samsung,pins = "gpg-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
sd0_clk: sd0-clk {
samsung,pins = "gpg-0";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
sd0_bus1: sd0-bus1 {
samsung,pins = "gpg-2";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
   

[PATCH v3 08/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos5250

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos5250-pinctrl.dtsi | 402 +-
 arch/arm/boot/dts/exynos5250-smdk5250.dts |   6 +-
 arch/arm/boot/dts/exynos5250-snow-common.dtsi |  76 ++---
 arch/arm/boot/dts/exynos5250-snow-rev5.dts|   6 +-
 arch/arm/boot/dts/exynos5250-snow.dts |   6 +-
 arch/arm/boot/dts/exynos5250-spring.dts   |  72 ++---
 6 files changed, 284 insertions(+), 284 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5250-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos5250-pinctrl.dtsi
index d1a4ea0fb838..2f6ab32b5954 100644
--- a/arch/arm/boot/dts/exynos5250-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos5250-pinctrl.dtsi
@@ -202,392 +202,392 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_hs_bus: i2c2-hs-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_bus: i2c3-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_hs_bus: i2c3-hs-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpa1-4", "gpa1-4";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpa2-0", "gpa2-2", "gpa2-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c4_bus: i2c4-bus {
samsung,pins = "gpa2-0", "gpa2-1";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c5_bus: i2c5-bus {
samsung,pins = "gpa2-2", "gpa2-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
 

[PATCH v3 17/17] ARM: dts: s3c64xx: Use macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier
to read.  One does not have to remember which value means pull-up/down
or specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/s3c64xx-pinctrl.dtsi | 176 -
 1 file changed, 88 insertions(+), 88 deletions(-)

diff --git a/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi 
b/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
index 93810d992c3f..4e8e802b4ee1 100644
--- a/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
+++ b/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
@@ -136,219 +136,219 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa-0", "gpa-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa-2", "gpa-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa-4", "gpa-5";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa-6", "gpa-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
ext_dma_0: ext-dma-0 {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <3>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
ext_dma_1: ext-dma-1 {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <4>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
irda_data_0: irda-data-0 {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <4>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
irda_data_1: irda-data-1 {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <3>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
irda_sdbw: irda-sdbw {
samsung,pins = "gpb-4";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
i2c0_bus: i2c0-bus {
samsung,pins = "gpb-5", "gpb-6";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
i2c1_bus: i2c1-bus {
/* S3C6410-only */
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <6>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpc-0", "gpc-1", "gpc-2";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
spi0_cs: spi0-cs {
samsung,pins = "gpc-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpc-4", "gpc-5", "gpc-6";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
spi1_cs: spi1-cs {
samsung,pins = "gpc-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
sd0_cmd: sd0-cmd {
samsung,pins = "gpg-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
sd0_clk: sd0-clk {
samsung,pins = "gpg-0";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
sd0_bus1: sd0-bus1 {
samsung,pins = "gpg-2";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
};
 
sd0_bus4: sd0-bus4 {
samsung,pins = 

[PATCH v3 08/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos5250

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos5250-pinctrl.dtsi | 402 +-
 arch/arm/boot/dts/exynos5250-smdk5250.dts |   6 +-
 arch/arm/boot/dts/exynos5250-snow-common.dtsi |  76 ++---
 arch/arm/boot/dts/exynos5250-snow-rev5.dts|   6 +-
 arch/arm/boot/dts/exynos5250-snow.dts |   6 +-
 arch/arm/boot/dts/exynos5250-spring.dts   |  72 ++---
 6 files changed, 284 insertions(+), 284 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5250-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos5250-pinctrl.dtsi
index d1a4ea0fb838..2f6ab32b5954 100644
--- a/arch/arm/boot/dts/exynos5250-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos5250-pinctrl.dtsi
@@ -202,392 +202,392 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_hs_bus: i2c2-hs-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_bus: i2c3-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_hs_bus: i2c3-hs-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpa1-4", "gpa1-4";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpa2-0", "gpa2-2", "gpa2-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c4_bus: i2c4-bus {
samsung,pins = "gpa2-0", "gpa2-1";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c5_bus: i2c5-bus {
samsung,pins = "gpa2-2", "gpa2-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = 

[PATCH v3 06/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos4x12

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  14 +-
 arch/arm/boot/dts/exynos4412-odroidx.dts|   2 +-
 arch/arm/boot/dts/exynos4412-origen.dts |  12 +-
 arch/arm/boot/dts/exynos4412-smdk4412.dts   |  12 +-
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi   | 504 
 5 files changed, 272 insertions(+), 272 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi 
b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
index be644fe6a0fd..8aa19ba14436 100644
--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
+++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
@@ -163,26 +163,26 @@
 
 /* RSTN signal for eMMC */
 _cd {
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
 };
 
 _1 {
gpio_power_key: power_key {
samsung,pins = "gpx1-3";
-   samsung,pin-pud = <0>;
+   samsung,pin-pud = ;
};
 
max77686_irq: max77686-irq {
samsung,pins = "gpx3-2";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
hdmi_hpd: hdmi-hpd {
samsung,pins = "gpx3-7";
-   samsung,pin-pud = <1>;
+   samsung,pin-pud = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos4412-odroidx.dts 
b/arch/arm/boot/dts/exynos4412-odroidx.dts
index 2af235151301..d82d85857349 100644
--- a/arch/arm/boot/dts/exynos4412-odroidx.dts
+++ b/arch/arm/boot/dts/exynos4412-odroidx.dts
@@ -83,7 +83,7 @@
 _1 {
gpio_home_key: home_key {
samsung,pins = "gpx2-2";
-   samsung,pin-pud = <0>;
+   samsung,pin-pud = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos4412-origen.dts 
b/arch/arm/boot/dts/exynos4412-origen.dts
index 26a36fed9652..96f8e94b4ac0 100644
--- a/arch/arm/boot/dts/exynos4412-origen.dts
+++ b/arch/arm/boot/dts/exynos4412-origen.dts
@@ -500,16 +500,16 @@
 _1 {
keypad_rows: keypad-rows {
samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
keypad_cols: keypad-cols {
samsung,pins = "gpx1-0", "gpx1-1";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos4412-smdk4412.dts 
b/arch/arm/boot/dts/exynos4412-smdk4412.dts
index 231ffbdbf9d0..a20b71918405 100644
--- a/arch/arm/boot/dts/exynos4412-smdk4412.dts
+++ b/arch/arm/boot/dts/exynos4412-smdk4412.dts
@@ -115,17 +115,17 @@
 _1 {
keypad_rows: keypad-rows {
samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
keypad_cols: keypad-cols {
samsung,pins = "gpx1-0", "gpx1-1", "gpx1-2", "gpx1-3",
   "gpx1-4", "gpx1-5", "gpx1-6", "gpx1-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
index b5ded0ccce07..a56bf9b1a412 100644
--- a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
@@ -129,245 +129,245 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
- 

[PATCH v3 12/17] ARM: dts: exynos: Fix mismatched value for SD4 pull up/down configuration on exynos4210

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

The pinctrl pull up/down register on exynos4210 is 2-bit wide for each
pin and it accepts only values of 0, 1 and 3.  The pins sd4-bus-width8
were configured with value of 4.  The driver does not validate the value
so this overflow effectively set a bit 1 in adjacent pins thus
configuring them to pull down.

The author's intention was probably to set drive strength of 4x.  All
other bus-widths pins are configured with pull up and drive strength of
4x.  Fix this one with same pattern.

Fixes: 87711d8c7c70 ("ARM: dts: Add pinctrl node entries for SAMSUNG EXYNOS4210 
SoC")
Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
Reviewed-by: Bartlomiej Zolnierkiewicz 
---
 arch/arm/boot/dts/exynos4210-pinctrl.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
index 8046340e50ac..d9b6d25e4abe 100644
--- a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
@@ -649,7 +649,7 @@
sd4_bus8: sd4-bus-width8 {
samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
samsung,pin-function = ;
-   samsung,pin-pud = <4>;
+   samsung,pin-pud = ;
samsung,pin-drv = ;
};
 
-- 
2.7.4



[PATCH v3 16/17] ARM: dts: s3c2416: Use macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier
to read.  One does not have to remember which value means pull-up/down
or specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/s3c2416-pinctrl.dtsi | 38 ++
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/arch/arm/boot/dts/s3c2416-pinctrl.dtsi 
b/arch/arm/boot/dts/s3c2416-pinctrl.dtsi
index 527e3193817f..6274359fb323 100644
--- a/arch/arm/boot/dts/s3c2416-pinctrl.dtsi
+++ b/arch/arm/boot/dts/s3c2416-pinctrl.dtsi
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include 
+
 _0 {
/*
 * Pin banks
@@ -83,91 +85,91 @@
 
uart0_data: uart0-data {
samsung,pins = "gph-0", "gph-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gph-8", "gph-9";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gph-2", "gph-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gph-10", "gph-11";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gph-4", "gph-5";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gph-6", "gph-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gph-6", "gph-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
extuart_clk: extuart-clk {
samsung,pins = "gph-12";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
i2c0_bus: i2c0-bus {
samsung,pins = "gpe-14", "gpe-15";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpe-11", "gpe-12", "gpe-13";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd0_clk: sd0-clk {
samsung,pins = "gpe-5";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd0_cmd: sd0-cmd {
samsung,pins = "gpe-6";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd0_bus1: sd0-bus1 {
samsung,pins = "gpe-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd0_bus4: sd0-bus4 {
samsung,pins = "gpe-8", "gpe-9", "gpe-10";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd1_cmd: sd1-cmd {
samsung,pins = "gpl-8";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd1_clk: sd1-clk {
samsung,pins = "gpl-9";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd1_bus1: sd1-bus1 {
samsung,pins = "gpl-0";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd1_bus4: sd1-bus4 {
samsung,pins = "gpl-1", "gpl-2", "gpl-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 };
-- 
2.7.4



[PATCH v3 06/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos4x12

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos4412-odroid-common.dtsi |  14 +-
 arch/arm/boot/dts/exynos4412-odroidx.dts|   2 +-
 arch/arm/boot/dts/exynos4412-origen.dts |  12 +-
 arch/arm/boot/dts/exynos4412-smdk4412.dts   |  12 +-
 arch/arm/boot/dts/exynos4x12-pinctrl.dtsi   | 504 
 5 files changed, 272 insertions(+), 272 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi 
b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
index be644fe6a0fd..8aa19ba14436 100644
--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
+++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
@@ -163,26 +163,26 @@
 
 /* RSTN signal for eMMC */
 _cd {
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
 };
 
 _1 {
gpio_power_key: power_key {
samsung,pins = "gpx1-3";
-   samsung,pin-pud = <0>;
+   samsung,pin-pud = ;
};
 
max77686_irq: max77686-irq {
samsung,pins = "gpx3-2";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
hdmi_hpd: hdmi-hpd {
samsung,pins = "gpx3-7";
-   samsung,pin-pud = <1>;
+   samsung,pin-pud = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos4412-odroidx.dts 
b/arch/arm/boot/dts/exynos4412-odroidx.dts
index 2af235151301..d82d85857349 100644
--- a/arch/arm/boot/dts/exynos4412-odroidx.dts
+++ b/arch/arm/boot/dts/exynos4412-odroidx.dts
@@ -83,7 +83,7 @@
 _1 {
gpio_home_key: home_key {
samsung,pins = "gpx2-2";
-   samsung,pin-pud = <0>;
+   samsung,pin-pud = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos4412-origen.dts 
b/arch/arm/boot/dts/exynos4412-origen.dts
index 26a36fed9652..96f8e94b4ac0 100644
--- a/arch/arm/boot/dts/exynos4412-origen.dts
+++ b/arch/arm/boot/dts/exynos4412-origen.dts
@@ -500,16 +500,16 @@
 _1 {
keypad_rows: keypad-rows {
samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
keypad_cols: keypad-cols {
samsung,pins = "gpx1-0", "gpx1-1";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos4412-smdk4412.dts 
b/arch/arm/boot/dts/exynos4412-smdk4412.dts
index 231ffbdbf9d0..a20b71918405 100644
--- a/arch/arm/boot/dts/exynos4412-smdk4412.dts
+++ b/arch/arm/boot/dts/exynos4412-smdk4412.dts
@@ -115,17 +115,17 @@
 _1 {
keypad_rows: keypad-rows {
samsung,pins = "gpx2-0", "gpx2-1", "gpx2-2";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
keypad_cols: keypad-cols {
samsung,pins = "gpx1-0", "gpx1-1", "gpx1-2", "gpx1-3",
   "gpx1-4", "gpx1-5", "gpx1-6", "gpx1-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
index b5ded0ccce07..a56bf9b1a412 100644
--- a/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4x12-pinctrl.dtsi
@@ -129,245 +129,245 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   

[PATCH v3 12/17] ARM: dts: exynos: Fix mismatched value for SD4 pull up/down configuration on exynos4210

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

The pinctrl pull up/down register on exynos4210 is 2-bit wide for each
pin and it accepts only values of 0, 1 and 3.  The pins sd4-bus-width8
were configured with value of 4.  The driver does not validate the value
so this overflow effectively set a bit 1 in adjacent pins thus
configuring them to pull down.

The author's intention was probably to set drive strength of 4x.  All
other bus-widths pins are configured with pull up and drive strength of
4x.  Fix this one with same pattern.

Fixes: 87711d8c7c70 ("ARM: dts: Add pinctrl node entries for SAMSUNG EXYNOS4210 
SoC")
Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
Reviewed-by: Bartlomiej Zolnierkiewicz 
---
 arch/arm/boot/dts/exynos4210-pinctrl.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
index 8046340e50ac..d9b6d25e4abe 100644
--- a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
@@ -649,7 +649,7 @@
sd4_bus8: sd4-bus-width8 {
samsung,pins = "gpk1-3", "gpk1-4", "gpk1-5", "gpk1-6";
samsung,pin-function = ;
-   samsung,pin-pud = <4>;
+   samsung,pin-pud = ;
samsung,pin-drv = ;
};
 
-- 
2.7.4



[PATCH v3 16/17] ARM: dts: s3c2416: Use macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier
to read.  One does not have to remember which value means pull-up/down
or specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/s3c2416-pinctrl.dtsi | 38 ++
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/arch/arm/boot/dts/s3c2416-pinctrl.dtsi 
b/arch/arm/boot/dts/s3c2416-pinctrl.dtsi
index 527e3193817f..6274359fb323 100644
--- a/arch/arm/boot/dts/s3c2416-pinctrl.dtsi
+++ b/arch/arm/boot/dts/s3c2416-pinctrl.dtsi
@@ -8,6 +8,8 @@
  * published by the Free Software Foundation.
  */
 
+#include 
+
 _0 {
/*
 * Pin banks
@@ -83,91 +85,91 @@
 
uart0_data: uart0-data {
samsung,pins = "gph-0", "gph-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gph-8", "gph-9";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gph-2", "gph-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gph-10", "gph-11";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gph-4", "gph-5";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gph-6", "gph-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gph-6", "gph-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
extuart_clk: extuart-clk {
samsung,pins = "gph-12";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
i2c0_bus: i2c0-bus {
samsung,pins = "gpe-14", "gpe-15";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpe-11", "gpe-12", "gpe-13";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd0_clk: sd0-clk {
samsung,pins = "gpe-5";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd0_cmd: sd0-cmd {
samsung,pins = "gpe-6";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd0_bus1: sd0-bus1 {
samsung,pins = "gpe-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd0_bus4: sd0-bus4 {
samsung,pins = "gpe-8", "gpe-9", "gpe-10";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd1_cmd: sd1-cmd {
samsung,pins = "gpl-8";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd1_clk: sd1-clk {
samsung,pins = "gpl-9";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd1_bus1: sd1-bus1 {
samsung,pins = "gpl-0";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 
sd1_bus4: sd1-bus4 {
samsung,pins = "gpl-1", "gpl-2", "gpl-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
};
 };
-- 
2.7.4



[PATCH v3 10/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos5410

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos5410-odroidxu.dts |  30 ++---
 arch/arm/boot/dts/exynos5410-pinctrl.dtsi | 180 +++---
 arch/arm/boot/dts/exynos5410-smdk5410.dts |  10 +-
 3 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5410-odroidxu.dts 
b/arch/arm/boot/dts/exynos5410-odroidxu.dts
index a5ae76c1838f..f263372bfb7b 100644
--- a/arch/arm/boot/dts/exynos5410-odroidxu.dts
+++ b/arch/arm/boot/dts/exynos5410-odroidxu.dts
@@ -473,38 +473,38 @@
 _0 {
emmc_nrst_pin: emmc-nrst {
samsung,pins = "gpd1-0";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
pmic_dvs_3: pmic-dvs-3 {
samsung,pins = "gpx0-0";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
pmic_dvs_2: pmic-dvs-2 {
samsung,pins = "gpx0-1";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
pmic_dvs_1: pmic-dvs-1 {
samsung,pins = "gpx0-2";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
samsung,pin-val = <1>;
};
 
max77802_irq: max77802-irq {
samsung,pins = "gpx0-4";
-   samsung,pin-function = <0xf>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
index bf43792efe27..a083d23fdee3 100644
--- a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
@@ -282,212 +282,212 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   

[PATCH v3 14/17] ARM: dts: s3c64xx: Use common macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Replace duplicated macros in each DTSI file with a common macro coming
from header.  Include the header in each pinctrl DTSI so further changes
could use it.

Although PIN_FUNC_SPC_2 does not bring much information about the
function itself, it still is more descriptive then hard-coded
number <2>.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/s3c6410-mini6410.dts |   4 +-
 arch/arm/boot/dts/s3c64xx-pinctrl.dtsi | 180 -
 2 files changed, 91 insertions(+), 93 deletions(-)

diff --git a/arch/arm/boot/dts/s3c6410-mini6410.dts 
b/arch/arm/boot/dts/s3c6410-mini6410.dts
index a25debb50401..f4afda3594f8 100644
--- a/arch/arm/boot/dts/s3c6410-mini6410.dts
+++ b/arch/arm/boot/dts/s3c6410-mini6410.dts
@@ -201,13 +201,13 @@
  {
gpio_leds: gpio-leds {
samsung,pins = "gpk-4", "gpk-5", "gpk-6", "gpk-7";
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
gpio_keys: gpio-keys {
samsung,pins = "gpn-0", "gpn-1", "gpn-2", "gpn-3",
"gpn-4", "gpn-5", "gpl-11", "gpl-12";
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 };
 
diff --git a/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi 
b/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
index b1197d8b04de..93810d992c3f 100644
--- a/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
+++ b/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
@@ -12,9 +12,7 @@
  * published by the Free Software Foundation.
  */
 
-#define PIN_PULL_NONE  0
-#define PIN_PULL_DOWN  1
-#define PIN_PULL_UP2
+#include 
 
  {
/*
@@ -139,219 +137,219 @@
uart0_data: uart0-data {
samsung,pins = "gpa-0", "gpa-1";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa-2", "gpa-3";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa-4", "gpa-5";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa-6", "gpa-7";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpb-0", "gpb-1";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpb-2", "gpb-3";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
ext_dma_0: ext-dma-0 {
samsung,pins = "gpb-0", "gpb-1";
samsung,pin-function = <3>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
ext_dma_1: ext-dma-1 {
samsung,pins = "gpb-2", "gpb-3";
samsung,pin-function = <4>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
irda_data_0: irda-data-0 {
samsung,pins = "gpb-0", "gpb-1";
samsung,pin-function = <4>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
irda_data_1: irda-data-1 {
samsung,pins = "gpb-2", "gpb-3";
samsung,pin-function = <3>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
irda_sdbw: irda-sdbw {
samsung,pins = "gpb-4";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
i2c0_bus: i2c0-bus {
samsung,pins = "gpb-5", "gpb-6";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
i2c1_bus: i2c1-bus {
/* S3C6410-only */
samsung,pins = "gpb-2", "gpb-3";
samsung,pin-function = <6>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpc-0", "gpc-1", "gpc-2";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
spi0_cs: spi0-cs {
samsung,pins = "gpc-3";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
spi1_bus: spi1-bus {

[PATCH v3 13/17] ARM: dts: exynos: Fix mismatched values of SD drive strengh configuration on exynos4415

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

The pinctrl drive strength register on exynos4415 is 2-bit wide for each
pin.  The pins for SD2 were configured with value of 4.  The driver does
not validate the value so this overflow effectively set a bit 1 in
adjacent pins thus configuring them to drive strength 2x.

The author's intention was probably to set drive strength of 4x.
All other SD pins are configured with drive strength of 4x.  Fix these
with same pattern.

Fixes: 9246e7ff24c5 ("ARM: dts: Add dts files for exynos4415 SoC")
Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
Reviewed-by: Bartlomiej Zolnierkiewicz 
---
 arch/arm/boot/dts/exynos4415-pinctrl.dtsi | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4415-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
index f54aee53b6ec..76cfd872ead3 100644
--- a/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
@@ -480,14 +480,14 @@
samsung,pins = "gpk2-0";
samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <4>;
+   samsung,pin-drv = ;
};
 
sd2_cmd: sd2-cmd {
samsung,pins = "gpk2-1";
samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <4>;
+   samsung,pin-drv = ;
};
 
sd2_cd: sd2-cd {
@@ -501,14 +501,14 @@
samsung,pins = "gpk2-3";
samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <4>;
+   samsung,pin-drv = ;
};
 
sd2_bus4: sd2-bus-width4 {
samsung,pins = "gpk2-4", "gpk2-5", "gpk2-6";
samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <4>;
+   samsung,pin-drv = ;
};
 
cam_port_b_io: cam-port-b-io {
-- 
2.7.4



[PATCH v3 15/17] ARM: dts: s5pv210: Use macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier
to read.  One does not have to remember which value means pull-up/down
or specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/s5pv210-aquila.dts   |   4 +-
 arch/arm/boot/dts/s5pv210-pinctrl.dtsi | 476 +
 2 files changed, 241 insertions(+), 239 deletions(-)

diff --git a/arch/arm/boot/dts/s5pv210-aquila.dts 
b/arch/arm/boot/dts/s5pv210-aquila.dts
index da24ab570b0e..f6cb82f36aae 100644
--- a/arch/arm/boot/dts/s5pv210-aquila.dts
+++ b/arch/arm/boot/dts/s5pv210-aquila.dts
@@ -387,7 +387,7 @@
  {
t_flash_detect: t-flash-detect {
samsung,pins = "gph3-4";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
};
 };
diff --git a/arch/arm/boot/dts/s5pv210-pinctrl.dtsi 
b/arch/arm/boot/dts/s5pv210-pinctrl.dtsi
index 8c714088e3c6..9a3e851e2e22 100644
--- a/arch/arm/boot/dts/s5pv210-pinctrl.dtsi
+++ b/arch/arm/boot/dts/s5pv210-pinctrl.dtsi
@@ -19,6 +19,8 @@
  * published by the Free Software Foundation.
  */
 
+#include 
+
  {
gpa0: gpa0 {
gpio-controller;
@@ -270,559 +272,559 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart_audio: uart-audio {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpb-0", "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <2>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpb-4", "gpb-6", "gpb-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <2>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2s0_bus: i2s0-bus {
samsung,pins = "gpi-0", "gpi-1", "gpi-2", "gpi-3",
"gpi-4", "gpi-5", "gpi-6";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-  

[PATCH v3 07/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos4415

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos4415-pinctrl.dtsi | 286 +++---
 1 file changed, 143 insertions(+), 143 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4415-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
index 63714445dddb..f54aee53b6ec 100644
--- a/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
@@ -96,180 +96,180 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_bus: i2c3-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpb-0", "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c4_bus: i2c4-bus {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpb-4", "gpb-6", "gpb-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c5_bus: i2c5-bus {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;

[PATCH v3 10/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos5410

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos5410-odroidxu.dts |  30 ++---
 arch/arm/boot/dts/exynos5410-pinctrl.dtsi | 180 +++---
 arch/arm/boot/dts/exynos5410-smdk5410.dts |  10 +-
 3 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5410-odroidxu.dts 
b/arch/arm/boot/dts/exynos5410-odroidxu.dts
index a5ae76c1838f..f263372bfb7b 100644
--- a/arch/arm/boot/dts/exynos5410-odroidxu.dts
+++ b/arch/arm/boot/dts/exynos5410-odroidxu.dts
@@ -473,38 +473,38 @@
 _0 {
emmc_nrst_pin: emmc-nrst {
samsung,pins = "gpd1-0";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
pmic_dvs_3: pmic-dvs-3 {
samsung,pins = "gpx0-0";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
pmic_dvs_2: pmic-dvs-2 {
samsung,pins = "gpx0-1";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
pmic_dvs_1: pmic-dvs-1 {
samsung,pins = "gpx0-2";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
samsung,pin-val = <1>;
};
 
max77802_irq: max77802-irq {
samsung,pins = "gpx0-4";
-   samsung,pin-function = <0xf>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
index bf43792efe27..a083d23fdee3 100644
--- a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
@@ -282,212 +282,212 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   

[PATCH v3 14/17] ARM: dts: s3c64xx: Use common macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Replace duplicated macros in each DTSI file with a common macro coming
from header.  Include the header in each pinctrl DTSI so further changes
could use it.

Although PIN_FUNC_SPC_2 does not bring much information about the
function itself, it still is more descriptive then hard-coded
number <2>.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/s3c6410-mini6410.dts |   4 +-
 arch/arm/boot/dts/s3c64xx-pinctrl.dtsi | 180 -
 2 files changed, 91 insertions(+), 93 deletions(-)

diff --git a/arch/arm/boot/dts/s3c6410-mini6410.dts 
b/arch/arm/boot/dts/s3c6410-mini6410.dts
index a25debb50401..f4afda3594f8 100644
--- a/arch/arm/boot/dts/s3c6410-mini6410.dts
+++ b/arch/arm/boot/dts/s3c6410-mini6410.dts
@@ -201,13 +201,13 @@
  {
gpio_leds: gpio-leds {
samsung,pins = "gpk-4", "gpk-5", "gpk-6", "gpk-7";
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
gpio_keys: gpio-keys {
samsung,pins = "gpn-0", "gpn-1", "gpn-2", "gpn-3",
"gpn-4", "gpn-5", "gpl-11", "gpl-12";
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 };
 
diff --git a/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi 
b/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
index b1197d8b04de..93810d992c3f 100644
--- a/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
+++ b/arch/arm/boot/dts/s3c64xx-pinctrl.dtsi
@@ -12,9 +12,7 @@
  * published by the Free Software Foundation.
  */
 
-#define PIN_PULL_NONE  0
-#define PIN_PULL_DOWN  1
-#define PIN_PULL_UP2
+#include 
 
  {
/*
@@ -139,219 +137,219 @@
uart0_data: uart0-data {
samsung,pins = "gpa-0", "gpa-1";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa-2", "gpa-3";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa-4", "gpa-5";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa-6", "gpa-7";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpb-0", "gpb-1";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpb-2", "gpb-3";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
ext_dma_0: ext-dma-0 {
samsung,pins = "gpb-0", "gpb-1";
samsung,pin-function = <3>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
ext_dma_1: ext-dma-1 {
samsung,pins = "gpb-2", "gpb-3";
samsung,pin-function = <4>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
irda_data_0: irda-data-0 {
samsung,pins = "gpb-0", "gpb-1";
samsung,pin-function = <4>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
irda_data_1: irda-data-1 {
samsung,pins = "gpb-2", "gpb-3";
samsung,pin-function = <3>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
irda_sdbw: irda-sdbw {
samsung,pins = "gpb-4";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
i2c0_bus: i2c0-bus {
samsung,pins = "gpb-5", "gpb-6";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
i2c1_bus: i2c1-bus {
/* S3C6410-only */
samsung,pins = "gpb-2", "gpb-3";
samsung,pin-function = <6>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpc-0", "gpc-1", "gpc-2";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
spi0_cs: spi0-cs {
samsung,pins = "gpc-3";
samsung,pin-function = <2>;
-   samsung,pin-pud = ;
+   samsung,pin-pud = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpc-4", "gpc-5", "gpc-6";

[PATCH v3 13/17] ARM: dts: exynos: Fix mismatched values of SD drive strengh configuration on exynos4415

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

The pinctrl drive strength register on exynos4415 is 2-bit wide for each
pin.  The pins for SD2 were configured with value of 4.  The driver does
not validate the value so this overflow effectively set a bit 1 in
adjacent pins thus configuring them to drive strength 2x.

The author's intention was probably to set drive strength of 4x.
All other SD pins are configured with drive strength of 4x.  Fix these
with same pattern.

Fixes: 9246e7ff24c5 ("ARM: dts: Add dts files for exynos4415 SoC")
Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
Reviewed-by: Bartlomiej Zolnierkiewicz 
---
 arch/arm/boot/dts/exynos4415-pinctrl.dtsi | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4415-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
index f54aee53b6ec..76cfd872ead3 100644
--- a/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
@@ -480,14 +480,14 @@
samsung,pins = "gpk2-0";
samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <4>;
+   samsung,pin-drv = ;
};
 
sd2_cmd: sd2-cmd {
samsung,pins = "gpk2-1";
samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <4>;
+   samsung,pin-drv = ;
};
 
sd2_cd: sd2-cd {
@@ -501,14 +501,14 @@
samsung,pins = "gpk2-3";
samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <4>;
+   samsung,pin-drv = ;
};
 
sd2_bus4: sd2-bus-width4 {
samsung,pins = "gpk2-4", "gpk2-5", "gpk2-6";
samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <4>;
+   samsung,pin-drv = ;
};
 
cam_port_b_io: cam-port-b-io {
-- 
2.7.4



[PATCH v3 15/17] ARM: dts: s5pv210: Use macros for pinctrl configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier
to read.  One does not have to remember which value means pull-up/down
or specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/s5pv210-aquila.dts   |   4 +-
 arch/arm/boot/dts/s5pv210-pinctrl.dtsi | 476 +
 2 files changed, 241 insertions(+), 239 deletions(-)

diff --git a/arch/arm/boot/dts/s5pv210-aquila.dts 
b/arch/arm/boot/dts/s5pv210-aquila.dts
index da24ab570b0e..f6cb82f36aae 100644
--- a/arch/arm/boot/dts/s5pv210-aquila.dts
+++ b/arch/arm/boot/dts/s5pv210-aquila.dts
@@ -387,7 +387,7 @@
  {
t_flash_detect: t-flash-detect {
samsung,pins = "gph3-4";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
};
 };
diff --git a/arch/arm/boot/dts/s5pv210-pinctrl.dtsi 
b/arch/arm/boot/dts/s5pv210-pinctrl.dtsi
index 8c714088e3c6..9a3e851e2e22 100644
--- a/arch/arm/boot/dts/s5pv210-pinctrl.dtsi
+++ b/arch/arm/boot/dts/s5pv210-pinctrl.dtsi
@@ -19,6 +19,8 @@
  * published by the Free Software Foundation.
  */
 
+#include 
+
  {
gpa0: gpa0 {
gpio-controller;
@@ -270,559 +272,559 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart_audio: uart-audio {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpb-0", "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <2>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpb-4", "gpb-6", "gpb-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <2>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2s0_bus: i2s0-bus {
samsung,pins = "gpi-0", "gpi-1", "gpi-2", "gpi-3",
"gpi-4", "gpi-5", "gpi-6";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+

[PATCH v3 07/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos4415

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos4415-pinctrl.dtsi | 286 +++---
 1 file changed, 143 insertions(+), 143 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4415-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
index 63714445dddb..f54aee53b6ec 100644
--- a/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4415-pinctrl.dtsi
@@ -96,180 +96,180 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_bus: i2c3-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpb-0", "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c4_bus: i2c4-bus {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpb-4", "gpb-6", "gpb-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c5_bus: i2c5-bus {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2s1_bus: 

[PATCH v3 09/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos5260

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos5260-pinctrl.dtsi  | 184 ++---
 arch/arm/boot/dts/exynos5260-xyref5260.dts |   6 +-
 2 files changed, 95 insertions(+), 95 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5260-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos5260-pinctrl.dtsi
index 39c046758029..1b911a219a27 100644
--- a/arch/arm/boot/dts/exynos5260-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos5260-pinctrl.dtsi
@@ -185,217 +185,217 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpa2-0", "gpa2-2", "gpa2-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpa2-4", "gpa2-6", "gpa2-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
usb3_vbus0_en: usb3-vbus0-en {
samsung,pins = "gpa2-4";
-   samsung,pin-function = <1>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
i2s1_bus: i2s1-bus {
samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
"gpb0-4";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
pcm1_bus: pcm1-bus {
samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
"gpb0-4";
-   samsung,pin-function = <3>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
spdif1_bus: spdif1-bus {
samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2";
-   samsung,pin-function = <4>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
spi2_bus: spi2-bus {
samsung,pins = "gpb1-0", "gpb1-2", "gpb1-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
i2c0_hs_bus: i2c0-hs-bus {
samsung,pins = "gpb3-0", "gpb3-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
i2c1_hs_bus: i2c1-hs-bus {
samsung,pins = "gpb3-2", "gpb3-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   

[PATCH v3 04/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos3250

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos3250-pinctrl.dtsi | 270 +++---
 1 file changed, 135 insertions(+), 135 deletions(-)

diff --git a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
index ed22d94f4fe5..ec331169c3d9 100644
--- a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
@@ -113,158 +113,158 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_bus: i2c3-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpb-0", "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c4_bus: i2c4-bus {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpb-4", "gpb-6", "gpb-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c5_bus: i2c5-bus {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2s2_bus: i2s2-bus {
samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
"gpc1-4";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
pcm2_bus: pcm2-bus {
samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
"gpc1-4";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = 

[PATCH v3 05/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos4210

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos4210-pinctrl.dtsi   | 454 
 arch/arm/boot/dts/exynos4210-smdkv310.dts   |  12 +-
 arch/arm/boot/dts/exynos4210-universal_c210.dts |   8 +-
 3 files changed, 237 insertions(+), 237 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
index cc65537ff79b..8046340e50ac 100644
--- a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
@@ -148,245 +148,245 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart_audio_a: uart-audio-a {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_bus: i2c3-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart_audio_b: uart-audio-b {
samsung,pins = "gpa1-4", 

[PATCH v3 11/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos542x/exynos5800

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos5420-arndale-octa.dts  |   6 +-
 arch/arm/boot/dts/exynos5420-peach-pit.dts | 126 
 arch/arm/boot/dts/exynos5420-pinctrl.dtsi  | 354 ++---
 arch/arm/boot/dts/exynos5420-smdk5420.dts  |  18 +-
 arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi |  18 +-
 arch/arm/boot/dts/exynos5800-peach-pi.dts  | 126 
 6 files changed, 324 insertions(+), 324 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts 
b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
index 39a3b81478fd..657ffbb096c1 100644
--- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts
+++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
@@ -378,9 +378,9 @@
 _0 {
s2mps11_irq: s2mps11-irq {
samsung,pins = "gpx3-2";
-   samsung,pin-function = <0xf>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts 
b/arch/arm/boot/dts/exynos5420-peach-pit.dts
index f6f256fd9b5e..a51175ad4b9f 100644
--- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts
@@ -753,171 +753,171 @@
 
wifi_en: wifi-en {
samsung,pins = "gpx0-0";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
max98090_irq: max98090-irq {
samsung,pins = "gpx0-2";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
/* We need GPX0_6 to be low at sleep time; just keep it low always */
mask_tpm_reset: mask-tpm-reset {
samsung,pins = "gpx0-6";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
samsung,pin-val = <0>;
};
 
tpm_irq: tpm-irq {
samsung,pins = "gpx1-0";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
trackpad_irq: trackpad-irq {
samsung,pins = "gpx1-1";
-   samsung,pin-function = <0xf>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
power_key_irq: power-key-irq {
samsung,pins = "gpx1-2";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
ec_irq: ec-irq {
samsung,pins = "gpx1-5";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
tps65090_irq: tps65090-irq {
samsung,pins = "gpx2-5";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
dp_hpd_gpio: dp_hpd_gpio {
samsung,pins = "gpx2-6";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
max77802_irq: max77802-irq {
samsung,pins = "gpx3-1";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   

[PATCH v3 09/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos5260

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos5260-pinctrl.dtsi  | 184 ++---
 arch/arm/boot/dts/exynos5260-xyref5260.dts |   6 +-
 2 files changed, 95 insertions(+), 95 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5260-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos5260-pinctrl.dtsi
index 39c046758029..1b911a219a27 100644
--- a/arch/arm/boot/dts/exynos5260-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos5260-pinctrl.dtsi
@@ -185,217 +185,217 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpa2-0", "gpa2-2", "gpa2-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpa2-4", "gpa2-6", "gpa2-7";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
usb3_vbus0_en: usb3-vbus0-en {
samsung,pins = "gpa2-4";
-   samsung,pin-function = <1>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
i2s1_bus: i2s1-bus {
samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
"gpb0-4";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
pcm1_bus: pcm1-bus {
samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2", "gpb0-3",
"gpb0-4";
-   samsung,pin-function = <3>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
spdif1_bus: spdif1-bus {
samsung,pins = "gpb0-0", "gpb0-1", "gpb0-2";
-   samsung,pin-function = <4>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
spi2_bus: spi2-bus {
samsung,pins = "gpb1-0", "gpb1-2", "gpb1-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
i2c0_hs_bus: i2c0-hs-bus {
samsung,pins = "gpb3-0", "gpb3-1";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
i2c1_hs_bus: i2c1-hs-bus {
samsung,pins = "gpb3-2", "gpb3-3";
-   samsung,pin-function = <2>;
+   samsung,pin-function = ;
samsung,pin-pud = ;
-   samsung,pin-drv = <0>;
+   samsung,pin-drv = ;
};
 
i2c2_hs_bus: 

[PATCH v3 04/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos3250

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos3250-pinctrl.dtsi | 270 +++---
 1 file changed, 135 insertions(+), 135 deletions(-)

diff --git a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
index ed22d94f4fe5..ec331169c3d9 100644
--- a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
@@ -113,158 +113,158 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_bus: i2c3-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi0_bus: spi0-bus {
samsung,pins = "gpb-0", "gpb-2", "gpb-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c4_bus: i2c4-bus {
samsung,pins = "gpb-0", "gpb-1";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
spi1_bus: spi1-bus {
samsung,pins = "gpb-4", "gpb-6", "gpb-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c5_bus: i2c5-bus {
samsung,pins = "gpb-2", "gpb-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2s2_bus: i2s2-bus {
samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
"gpc1-4";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
pcm2_bus: pcm2-bus {
samsung,pins = "gpc1-0", "gpc1-1", "gpc1-2", "gpc1-3",
"gpc1-4";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   

[PATCH v3 05/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos4210

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos4210-pinctrl.dtsi   | 454 
 arch/arm/boot/dts/exynos4210-smdkv310.dts   |  12 +-
 arch/arm/boot/dts/exynos4210-universal_c210.dts |   8 +-
 3 files changed, 237 insertions(+), 237 deletions(-)

diff --git a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
index cc65537ff79b..8046340e50ac 100644
--- a/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos4210-pinctrl.dtsi
@@ -148,245 +148,245 @@
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <0x2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_data: uart2-data {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart2_fctl: uart2-fctl {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart_audio_a: uart-audio-a {
samsung,pins = "gpa1-0", "gpa1-1";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c3_bus: i2c3-bus {
samsung,pins = "gpa1-2", "gpa1-3";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart3_data: uart3-data {
samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart_audio_b: uart-audio-b {
samsung,pins = "gpa1-4", "gpa1-5";
-   samsung,pin-function = <4>;
-   

[PATCH v3 11/17] ARM: dts: exynos: Use macros for pinctrl configuration on exynos542x/exynos5800

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Usage of DTS macros instead of hard-coded numbers makes code easier to
read.  One does not have to remember which value means pull-up/down or
specific driver strength.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 
---
 arch/arm/boot/dts/exynos5420-arndale-octa.dts  |   6 +-
 arch/arm/boot/dts/exynos5420-peach-pit.dts | 126 
 arch/arm/boot/dts/exynos5420-pinctrl.dtsi  | 354 ++---
 arch/arm/boot/dts/exynos5420-smdk5420.dts  |  18 +-
 arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi |  18 +-
 arch/arm/boot/dts/exynos5800-peach-pi.dts  | 126 
 6 files changed, 324 insertions(+), 324 deletions(-)

diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts 
b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
index 39a3b81478fd..657ffbb096c1 100644
--- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts
+++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts
@@ -378,9 +378,9 @@
 _0 {
s2mps11_irq: s2mps11-irq {
samsung,pins = "gpx3-2";
-   samsung,pin-function = <0xf>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 };
 
diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts 
b/arch/arm/boot/dts/exynos5420-peach-pit.dts
index f6f256fd9b5e..a51175ad4b9f 100644
--- a/arch/arm/boot/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts
@@ -753,171 +753,171 @@
 
wifi_en: wifi-en {
samsung,pins = "gpx0-0";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
max98090_irq: max98090-irq {
samsung,pins = "gpx0-2";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
/* We need GPX0_6 to be low at sleep time; just keep it low always */
mask_tpm_reset: mask-tpm-reset {
samsung,pins = "gpx0-6";
-   samsung,pin-function = <1>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
samsung,pin-val = <0>;
};
 
tpm_irq: tpm-irq {
samsung,pins = "gpx1-0";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
trackpad_irq: trackpad-irq {
samsung,pins = "gpx1-1";
-   samsung,pin-function = <0xf>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
power_key_irq: power-key-irq {
samsung,pins = "gpx1-2";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
ec_irq: ec-irq {
samsung,pins = "gpx1-5";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
tps65090_irq: tps65090-irq {
samsung,pins = "gpx2-5";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
dp_hpd_gpio: dp_hpd_gpio {
samsung,pins = "gpx2-6";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
max77802_irq: max77802-irq {
samsung,pins = "gpx3-1";
-   samsung,pin-function = <0>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
lid_irq: lid-irq {

[PATCH v3 01/17] pinctrl: dt-bindings: samsung: Add header with values used for configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Hard-coded pinctrl configuration values are scattered through DTS files.
The numbers are difficult to decode by human, especially without the
datasheet.  Additionally the drive strength differs between S3C64xx,
S5PV210 and Exynos SoC families increasing the confusion.

The header will help making this more readable and maintainable.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 

---

Changes since v2:
1. Rename double-include protection (suggested by Bartlomiej).
2. Squash here:
   pinctrl: dt-bindings: samsung: Add macros for S3C64xx pin configuration
   http://www.spinics.net/lists/arm-kernel/msg528016.html
3. Add Javier's reviewed-by.
4. Extend MAINTAINERS entry with bindings documentation
---
 MAINTAINERS   |  2 ++
 include/dt-bindings/pinctrl/samsung.h | 57 +++
 2 files changed, 59 insertions(+)
 create mode 100644 include/dt-bindings/pinctrl/samsung.h

diff --git a/MAINTAINERS b/MAINTAINERS
index d8e81b1dde30..be3dcca8439a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9318,6 +9318,8 @@ L:linux-arm-ker...@lists.infradead.org (moderated 
for non-subscribers)
 L: linux-samsung-...@vger.kernel.org (moderated for non-subscribers)
 S: Maintained
 F: drivers/pinctrl/samsung/
+F: include/dt-bindings/pinctrl/samsung.h
+F: Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
 
 PIN CONTROLLER - SINGLE
 M: Tony Lindgren 
diff --git a/include/dt-bindings/pinctrl/samsung.h 
b/include/dt-bindings/pinctrl/samsung.h
new file mode 100644
index ..6276eb785e2b
--- /dev/null
+++ b/include/dt-bindings/pinctrl/samsung.h
@@ -0,0 +1,57 @@
+/*
+ * Samsung's Exynos pinctrl bindings
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ * Author: Krzysztof Kozlowski 
+ *
+ * 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.
+*/
+
+#ifndef __DT_BINDINGS_PINCTRL_SAMSUNG_H__
+#define __DT_BINDINGS_PINCTRL_SAMSUNG_H__
+
+#define EXYNOS_PIN_PULL_NONE   0
+#define EXYNOS_PIN_PULL_DOWN   1
+#define EXYNOS_PIN_PULL_UP 3
+
+#define S3C64XX_PIN_PULL_NONE  0
+#define S3C64XX_PIN_PULL_DOWN  1
+#define S3C64XX_PIN_PULL_UP2
+
+/* Pin function in power down mode */
+#define EXYNOS_PIN_PDN_OUT00
+#define EXYNOS_PIN_PDN_OUT11
+#define EXYNOS_PIN_PDN_INPUT   2
+#define EXYNOS_PIN_PDN_PREV3
+
+/* Drive strengths for Exynos3250, Exynos4 (all) and Exynos5250 */
+#define EXYNOS4_PIN_DRV_LV10
+#define EXYNOS4_PIN_DRV_LV22
+#define EXYNOS4_PIN_DRV_LV31
+#define EXYNOS4_PIN_DRV_LV43
+
+/* Drive strengths for Exynos5260 */
+#define EXYNOS5260_PIN_DRV_LV1 0
+#define EXYNOS5260_PIN_DRV_LV2 1
+#define EXYNOS5260_PIN_DRV_LV4 2
+#define EXYNOS5260_PIN_DRV_LV6 3
+
+/* Drive strengths for Exynos5410, Exynos542x and Exynos5800 */
+#define EXYNOS5420_PIN_DRV_LV1 0
+#define EXYNOS5420_PIN_DRV_LV2 1
+#define EXYNOS5420_PIN_DRV_LV3 2
+#define EXYNOS5420_PIN_DRV_LV4 3
+
+#define EXYNOS_PIN_FUNC_INPUT  0
+#define EXYNOS_PIN_FUNC_OUTPUT 1
+#define EXYNOS_PIN_FUNC_2  2
+#define EXYNOS_PIN_FUNC_3  3
+#define EXYNOS_PIN_FUNC_4  4
+#define EXYNOS_PIN_FUNC_5  5
+#define EXYNOS_PIN_FUNC_6  6
+#define EXYNOS_PIN_FUNC_F  0xf
+
+#endif /* __DT_BINDINGS_PINCTRL_SAMSUNG_H__ */
-- 
2.7.4



[PATCH v3 02/17] pinctrl: dt-bindings: samsung: Update documentation with new macros

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Update examples in Samsung pinctrl dt-bindings with new macros coming
from header file.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 

---

Changes since v1:
1. Add Javier's reviewed-by.
2. Include necessary header in example (pointed by Javier).
---
 .../bindings/pinctrl/samsung-pinctrl.txt   | 44 +++---
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt 
b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
index 6db16b90873a..d49e22d2a8b5 100644
--- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
@@ -229,6 +229,8 @@ Example: A pin-controller node with pin banks:
 
 Example 1: A pin-controller node with pin groups.
 
+   #include 
+
pinctrl_0: pinctrl@1140 {
compatible = "samsung,exynos4210-pinctrl";
reg = <0x1140 0x1000>;
@@ -238,53 +240,53 @@ Example 1: A pin-controller node with pin groups.
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
sd4_bus8: sd4-bus-width8 {
part-1 {
samsung,pins = "gpk0-3", "gpk0-4",
"gpk0-5", "gpk0-6";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <3>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
part-2 {
samsung,pins = "gpk1-3", "gpk1-4",
"gpk1-5", "gpk1-6";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <4>;
-   samsung,pin-drv = <3>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
};
};
-- 
2.7.4



[PATCH v3 01/17] pinctrl: dt-bindings: samsung: Add header with values used for configuration

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Hard-coded pinctrl configuration values are scattered through DTS files.
The numbers are difficult to decode by human, especially without the
datasheet.  Additionally the drive strength differs between S3C64xx,
S5PV210 and Exynos SoC families increasing the confusion.

The header will help making this more readable and maintainable.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 

---

Changes since v2:
1. Rename double-include protection (suggested by Bartlomiej).
2. Squash here:
   pinctrl: dt-bindings: samsung: Add macros for S3C64xx pin configuration
   http://www.spinics.net/lists/arm-kernel/msg528016.html
3. Add Javier's reviewed-by.
4. Extend MAINTAINERS entry with bindings documentation
---
 MAINTAINERS   |  2 ++
 include/dt-bindings/pinctrl/samsung.h | 57 +++
 2 files changed, 59 insertions(+)
 create mode 100644 include/dt-bindings/pinctrl/samsung.h

diff --git a/MAINTAINERS b/MAINTAINERS
index d8e81b1dde30..be3dcca8439a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9318,6 +9318,8 @@ L:linux-arm-ker...@lists.infradead.org (moderated 
for non-subscribers)
 L: linux-samsung-...@vger.kernel.org (moderated for non-subscribers)
 S: Maintained
 F: drivers/pinctrl/samsung/
+F: include/dt-bindings/pinctrl/samsung.h
+F: Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
 
 PIN CONTROLLER - SINGLE
 M: Tony Lindgren 
diff --git a/include/dt-bindings/pinctrl/samsung.h 
b/include/dt-bindings/pinctrl/samsung.h
new file mode 100644
index ..6276eb785e2b
--- /dev/null
+++ b/include/dt-bindings/pinctrl/samsung.h
@@ -0,0 +1,57 @@
+/*
+ * Samsung's Exynos pinctrl bindings
+ *
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ * Author: Krzysztof Kozlowski 
+ *
+ * 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.
+*/
+
+#ifndef __DT_BINDINGS_PINCTRL_SAMSUNG_H__
+#define __DT_BINDINGS_PINCTRL_SAMSUNG_H__
+
+#define EXYNOS_PIN_PULL_NONE   0
+#define EXYNOS_PIN_PULL_DOWN   1
+#define EXYNOS_PIN_PULL_UP 3
+
+#define S3C64XX_PIN_PULL_NONE  0
+#define S3C64XX_PIN_PULL_DOWN  1
+#define S3C64XX_PIN_PULL_UP2
+
+/* Pin function in power down mode */
+#define EXYNOS_PIN_PDN_OUT00
+#define EXYNOS_PIN_PDN_OUT11
+#define EXYNOS_PIN_PDN_INPUT   2
+#define EXYNOS_PIN_PDN_PREV3
+
+/* Drive strengths for Exynos3250, Exynos4 (all) and Exynos5250 */
+#define EXYNOS4_PIN_DRV_LV10
+#define EXYNOS4_PIN_DRV_LV22
+#define EXYNOS4_PIN_DRV_LV31
+#define EXYNOS4_PIN_DRV_LV43
+
+/* Drive strengths for Exynos5260 */
+#define EXYNOS5260_PIN_DRV_LV1 0
+#define EXYNOS5260_PIN_DRV_LV2 1
+#define EXYNOS5260_PIN_DRV_LV4 2
+#define EXYNOS5260_PIN_DRV_LV6 3
+
+/* Drive strengths for Exynos5410, Exynos542x and Exynos5800 */
+#define EXYNOS5420_PIN_DRV_LV1 0
+#define EXYNOS5420_PIN_DRV_LV2 1
+#define EXYNOS5420_PIN_DRV_LV3 2
+#define EXYNOS5420_PIN_DRV_LV4 3
+
+#define EXYNOS_PIN_FUNC_INPUT  0
+#define EXYNOS_PIN_FUNC_OUTPUT 1
+#define EXYNOS_PIN_FUNC_2  2
+#define EXYNOS_PIN_FUNC_3  3
+#define EXYNOS_PIN_FUNC_4  4
+#define EXYNOS_PIN_FUNC_5  5
+#define EXYNOS_PIN_FUNC_6  6
+#define EXYNOS_PIN_FUNC_F  0xf
+
+#endif /* __DT_BINDINGS_PINCTRL_SAMSUNG_H__ */
-- 
2.7.4



[PATCH v3 02/17] pinctrl: dt-bindings: samsung: Update documentation with new macros

2016-09-04 Thread Krzysztof Kozlowski
From: Krzysztof Kozlowski 

Update examples in Samsung pinctrl dt-bindings with new macros coming
from header file.

Signed-off-by: Krzysztof Kozlowski 
Reviewed-by: Javier Martinez Canillas 

---

Changes since v1:
1. Add Javier's reviewed-by.
2. Include necessary header in example (pointed by Javier).
---
 .../bindings/pinctrl/samsung-pinctrl.txt   | 44 +++---
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt 
b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
index 6db16b90873a..d49e22d2a8b5 100644
--- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
+++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt
@@ -229,6 +229,8 @@ Example: A pin-controller node with pin banks:
 
 Example 1: A pin-controller node with pin groups.
 
+   #include 
+
pinctrl_0: pinctrl@1140 {
compatible = "samsung,exynos4210-pinctrl";
reg = <0x1140 0x1000>;
@@ -238,53 +240,53 @@ Example 1: A pin-controller node with pin groups.
 
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart0_fctl: uart0-fctl {
samsung,pins = "gpa0-2", "gpa0-3";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_data: uart1-data {
samsung,pins = "gpa0-4", "gpa0-5";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
uart1_fctl: uart1-fctl {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
i2c2_bus: i2c2-bus {
samsung,pins = "gpa0-6", "gpa0-7";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
 
sd4_bus8: sd4-bus-width8 {
part-1 {
samsung,pins = "gpk0-3", "gpk0-4",
"gpk0-5", "gpk0-6";
-   samsung,pin-function = <3>;
-   samsung,pin-pud = <3>;
-   samsung,pin-drv = <3>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
part-2 {
samsung,pins = "gpk1-3", "gpk1-4",
"gpk1-5", "gpk1-6";
-   samsung,pin-function = <4>;
-   samsung,pin-pud = <4>;
-   samsung,pin-drv = <3>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};
};
};
-- 
2.7.4



[PATCH v3 00/17] pinctrl: exynos/samsung: Add header with values used for configuration

2016-09-04 Thread Krzysztof Kozlowski

Hi,

Changes since v2

1. Combine separate patchsets into one. Previously I sent separately the fixes
   and changes for S3C platforms.
2. Fix issues pointed during review.
3. Add review tags.

Changes since v1

1. Follow Arnd's suggestion about moving the macros to common place.
2. Subjects: replace "GPIO" with "pinctrl".
3. There were some major changes here so I did not add Javier's
   reviewed-by and tested-by tags.

Merging
===
Patches #1 and #2 should probably go through pinctrl tree. In that case I would
appreciate a stable branch/tag so DTS could base on top of it.

Goal

Increase readability:
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};

Everything generated with sed:
sed -i -e 's/samsung,pin-pud = <0>;$/samsung,pin-pud = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-pud = <1>;$/samsung,pin-pud = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-pud = <3>;$/samsung,pin-pud = ;/' 
arch/arm/boot/dts/exynos*

sed -i -e 's/samsung,pin-drv = <0>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/exynos[34]* arch/arm/boot/dts/exynos5250*
sed -i -e 's/samsung,pin-drv = <2>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/exynos[34]* arch/arm/boot/dts/exynos5250*
sed -i -e 's/samsung,pin-drv = <1>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/exynos[34]* arch/arm/boot/dts/exynos5250*
sed -i -e 's/samsung,pin-drv = <3>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/exynos[34]* arch/arm/boot/dts/exynos5250*

sed -i -e 's/samsung,pin-drv = <0>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5260*
sed -i -e 's/samsung,pin-drv = <1>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5260*
sed -i -e 's/samsung,pin-drv = <2>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5260*
sed -i -e 's/samsung,pin-drv = <3>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5260*

sed -i -e 's/samsung,pin-drv = <0>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5[48]*
sed -i -e 's/samsung,pin-drv = <1>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5[48]*
sed -i -e 's/samsung,pin-drv = <2>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5[48]*
sed -i -e 's/samsung,pin-drv = <3>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5[48]*

sed -i -e 's/samsung,pin-function = <0>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <1>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*

sed -i -e 's/samsung,pin-function = <2>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <\(0x\)\?2>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <\(0x\)\?3>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <3>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <4>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <5>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <6>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <0xf>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*

sed -i -e 's/samsung,pin-drv = <0>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-drv = <2>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-drv = <1>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-drv = <3>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/s5p*

sed -i -e 's/samsung,pin-pud = <0>;$/samsung,pin-pud = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-pud = <1>;$/samsung,pin-pud = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-pud = <2>;$/samsung,pin-pud = ;/' 
arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*

sed -i -e 's/samsung,pin-function = <0>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <2>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <\(0x\)\?2>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <\(0x\)\?3>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <3>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <4>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <5>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = 

[PATCH v3 00/17] pinctrl: exynos/samsung: Add header with values used for configuration

2016-09-04 Thread Krzysztof Kozlowski

Hi,

Changes since v2

1. Combine separate patchsets into one. Previously I sent separately the fixes
   and changes for S3C platforms.
2. Fix issues pointed during review.
3. Add review tags.

Changes since v1

1. Follow Arnd's suggestion about moving the macros to common place.
2. Subjects: replace "GPIO" with "pinctrl".
3. There were some major changes here so I did not add Javier's
   reviewed-by and tested-by tags.

Merging
===
Patches #1 and #2 should probably go through pinctrl tree. In that case I would
appreciate a stable branch/tag so DTS could base on top of it.

Goal

Increase readability:
uart0_data: uart0-data {
samsung,pins = "gpa0-0", "gpa0-1";
-   samsung,pin-function = <2>;
-   samsung,pin-pud = <0>;
-   samsung,pin-drv = <0>;
+   samsung,pin-function = ;
+   samsung,pin-pud = ;
+   samsung,pin-drv = ;
};

Everything generated with sed:
sed -i -e 's/samsung,pin-pud = <0>;$/samsung,pin-pud = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-pud = <1>;$/samsung,pin-pud = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-pud = <3>;$/samsung,pin-pud = ;/' 
arch/arm/boot/dts/exynos*

sed -i -e 's/samsung,pin-drv = <0>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/exynos[34]* arch/arm/boot/dts/exynos5250*
sed -i -e 's/samsung,pin-drv = <2>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/exynos[34]* arch/arm/boot/dts/exynos5250*
sed -i -e 's/samsung,pin-drv = <1>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/exynos[34]* arch/arm/boot/dts/exynos5250*
sed -i -e 's/samsung,pin-drv = <3>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/exynos[34]* arch/arm/boot/dts/exynos5250*

sed -i -e 's/samsung,pin-drv = <0>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5260*
sed -i -e 's/samsung,pin-drv = <1>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5260*
sed -i -e 's/samsung,pin-drv = <2>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5260*
sed -i -e 's/samsung,pin-drv = <3>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5260*

sed -i -e 's/samsung,pin-drv = <0>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5[48]*
sed -i -e 's/samsung,pin-drv = <1>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5[48]*
sed -i -e 's/samsung,pin-drv = <2>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5[48]*
sed -i -e 's/samsung,pin-drv = <3>;$/samsung,pin-drv = 
;/' arch/arm/boot/dts/exynos5[48]*

sed -i -e 's/samsung,pin-function = <0>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <1>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*

sed -i -e 's/samsung,pin-function = <2>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <\(0x\)\?2>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <\(0x\)\?3>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <3>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <4>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <5>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <6>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*
sed -i -e 's/samsung,pin-function = <0xf>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/exynos*

sed -i -e 's/samsung,pin-drv = <0>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-drv = <2>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-drv = <1>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-drv = <3>;$/samsung,pin-drv = ;/' 
arch/arm/boot/dts/s5p*

sed -i -e 's/samsung,pin-pud = <0>;$/samsung,pin-pud = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-pud = <1>;$/samsung,pin-pud = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-pud = <2>;$/samsung,pin-pud = ;/' 
arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*

sed -i -e 's/samsung,pin-function = <0>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <2>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <\(0x\)\?2>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <\(0x\)\?3>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <3>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <4>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = <5>;$/samsung,pin-function = 
;/' arch/arm/boot/dts/s3c* arch/arm/boot/dts/s5p*
sed -i -e 's/samsung,pin-function = 

[PATCH v2 1/1] drivers: staging: rtl8723au: hal: Remove pointless test

2016-09-04 Thread Matthias Beyer
This patch removes the pointless `else if` test.

Signed-off-by: Matthias Beyer 
Reported-by: David Binderman 
---
 drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
index 6989580..47e8d69 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
@@ -3530,7 +3530,7 @@ bthci_CmdLinkStatusNotify(
pBtMgnt->ExtConfig.linkInfo[i].BTProfile,
pBtMgnt->ExtConfig.linkInfo[i].BTCoreSpec));
pTriple += 4;
-   } else if (pBtMgnt->ExtConfig.HCIExtensionVer >= 1) {
+   } else {
pBtMgnt->ExtConfig.linkInfo[i].ConnectHandle = *((u16 
*)[0]);
pBtMgnt->ExtConfig.linkInfo[i].BTProfile = pTriple[2];
pBtMgnt->ExtConfig.linkInfo[i].BTCoreSpec = pTriple[3];
-- 
2.9.3



[PATCH v2 1/1] drivers: staging: rtl8723au: hal: Remove pointless test

2016-09-04 Thread Matthias Beyer
This patch removes the pointless `else if` test.

Signed-off-by: Matthias Beyer 
Reported-by: David Binderman 
---
 drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c 
b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
index 6989580..47e8d69 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
@@ -3530,7 +3530,7 @@ bthci_CmdLinkStatusNotify(
pBtMgnt->ExtConfig.linkInfo[i].BTProfile,
pBtMgnt->ExtConfig.linkInfo[i].BTCoreSpec));
pTriple += 4;
-   } else if (pBtMgnt->ExtConfig.HCIExtensionVer >= 1) {
+   } else {
pBtMgnt->ExtConfig.linkInfo[i].ConnectHandle = *((u16 
*)[0]);
pBtMgnt->ExtConfig.linkInfo[i].BTProfile = pTriple[2];
pBtMgnt->ExtConfig.linkInfo[i].BTCoreSpec = pTriple[3];
-- 
2.9.3



[PATCH v2 0/1] Remove pointless test

2016-09-04 Thread Matthias Beyer
Re-sending as

On 01-09-2016 17:54:47, Greg KH wrote:
> There is no patch here :(

8<

As reported by David Binderman, this test is useless as of

if (a < 3) {
/* ... */
} else if (a >= 3) {
/* ... */
}

so this patch removes the second check.

Matthias Beyer (1):
  drivers: staging: rtl8723au: hal: Remove pointless test

 drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.3



[PATCH v2 0/1] Remove pointless test

2016-09-04 Thread Matthias Beyer
Re-sending as

On 01-09-2016 17:54:47, Greg KH wrote:
> There is no patch here :(

8<

As reported by David Binderman, this test is useless as of

if (a < 3) {
/* ... */
} else if (a >= 3) {
/* ... */
}

so this patch removes the second check.

Matthias Beyer (1):
  drivers: staging: rtl8723au: hal: Remove pointless test

 drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.3



[PATCH] vxlan: Update tx_errors statistics if vxlan_build_skb return err.

2016-09-04 Thread Haishuang Yan
If vxlan_build_skb return err < 0, tx_errors should be also increased.

Signed-off-by: Haishuang Yan 
---
 drivers/net/vxlan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index f605a36..2c72dcd 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2103,6 +2103,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct 
net_device *dev,
  vni, md, flags, udp_sum);
if (err < 0) {
dst_release(ndst);
+   dev->stats.tx_errors++;
return;
}
udp_tunnel6_xmit_skb(ndst, sk, skb, dev,
-- 
1.8.3.1





[PATCH] vxlan: Update tx_errors statistics if vxlan_build_skb return err.

2016-09-04 Thread Haishuang Yan
If vxlan_build_skb return err < 0, tx_errors should be also increased.

Signed-off-by: Haishuang Yan 
---
 drivers/net/vxlan.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index f605a36..2c72dcd 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2103,6 +2103,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct 
net_device *dev,
  vni, md, flags, udp_sum);
if (err < 0) {
dst_release(ndst);
+   dev->stats.tx_errors++;
return;
}
udp_tunnel6_xmit_skb(ndst, sk, skb, dev,
-- 
1.8.3.1





fs: GPF in bd_mount

2016-09-04 Thread Dmitry Vyukov
Hello,

The following program triggers GPF in bd_mount:


// autogenerated by syzkaller (http://github.com/google/syzkaller)
#include 
#include 
#include 
#include 
#include 
#include 

int main()
{
  int fd;

  unshare(CLONE_NEWUSER);
  unshare(CLONE_NEWNS);
  mkdir("./bus", 0662515705056234013740);
  mount("./bus/bus", "./bus", "bdev", 0,
  "\xa9\x95\xbd\x88\x07\x6a\x39\xe8\xf4\xef\xf2\x6b\x88\x53\x1d\xdb"
  "\xd2\x83\xf9\x5f\x4f\x44\x71\xf2\x08\x84\x2b\xae\x94\x87\xb7\xa6"
  "\xf8\x9d\xc9\x96\xc7\x17\x2e\x22\xc4\xd2\xcc\xf9\x04\x0b\xd2\xaf"
  "\xf3\x0b\xec\xeb\x2b\x75\xf2\x93\xa2\xd4\x00\xd8\x69\x47\x48\xf5"
  "\xaf\x2b\xb8\x7c\x06\x04\x69\x8b\x46\x0d\x44\x79\x8c\x86\x68\xfd"
  "\xd3\xb4\x1c\x8e\x9e\x6c\x58\x0c\xa5\xdf\x55\x4d\x59\x65\xc9\x70"
  "\x7c\x8a\x44\x26\x7d\xba\xf0\x3d\x46\x9e\x3c\xbe\x22\xc3");
  return 0;
}


general protection fault:  [#1] SMP DEBUG_PAGEALLOC KASAN
Modules linked in:
CPU: 2 PID: 4052 Comm: a.out Not tainted 4.8.0-rc3-next-20160825+ #11
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
task: 88006b37a380 task.stack: 880066dc
RIP: 0010:[]  []
bd_mount+0x52/0xa0 fs/block_dev.c:650
RSP: 0018:880066dc7ca0  EFLAGS: 00010207
RAX: dc00 RBX:  RCX: 0001
RDX: 0018 RSI: 886fd6c0 RDI: 00c7
RBP: 880066dc7cb0 R08: 88006b642cb8 R09: 
R10:  R11:  R12: 8880d440
R13: 88006a4ac1c0 R14: 88006b64b000 R15: 
FS:  012b2880() GS:88006d20() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 004b2160 CR3: 6cc72000 CR4: 06e0
Stack:
 880068e2c840 8880d440 880066dc7cf0 8186e73b
 0004 88006659c600 8880d440 88006a4ac1c0
  880068e2c840 880066dc7d40 818ce44a
Call Trace:
 [] mount_fs+0x9b/0x2f0 fs/super.c:1177
 [] vfs_kern_mount+0x7a/0x3e0 fs/namespace.c:948
 [< inline >] do_new_mount fs/namespace.c:2393
 [] do_mount+0x3d5/0x26b0 fs/namespace.c:2715
 [< inline >] SYSC_mount fs/namespace.c:2907
 [] SyS_mount+0xab/0x120 fs/namespace.c:2884
 [] do_syscall_64+0x1df/0x640 arch/x86/entry/common.c:288
 [] entry_SYSCALL64_slow_path+0x25/0x25
arch/x86/entry/entry_64.S:249
Code: 87 e8 f3 ca fb ff 48 85 c0 48 89 c3 74 4c e8 a6 47 ca ff 48 8d
bb c8 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80>
3c 02 00 75 36 4c 8b a3 c8 00 00 00 48 b8 00 00 00 00 00 fc
RIP  [] bd_mount+0x52/0xa0 fs/block_dev.c:650
 RSP 
---[ end trace 0e5d909159d79633 ]---


On commit 0f98f121e1670eaa2a2fbb675e07d6ba7f0e146f of linux-next.


fs: GPF in bd_mount

2016-09-04 Thread Dmitry Vyukov
Hello,

The following program triggers GPF in bd_mount:


// autogenerated by syzkaller (http://github.com/google/syzkaller)
#include 
#include 
#include 
#include 
#include 
#include 

int main()
{
  int fd;

  unshare(CLONE_NEWUSER);
  unshare(CLONE_NEWNS);
  mkdir("./bus", 0662515705056234013740);
  mount("./bus/bus", "./bus", "bdev", 0,
  "\xa9\x95\xbd\x88\x07\x6a\x39\xe8\xf4\xef\xf2\x6b\x88\x53\x1d\xdb"
  "\xd2\x83\xf9\x5f\x4f\x44\x71\xf2\x08\x84\x2b\xae\x94\x87\xb7\xa6"
  "\xf8\x9d\xc9\x96\xc7\x17\x2e\x22\xc4\xd2\xcc\xf9\x04\x0b\xd2\xaf"
  "\xf3\x0b\xec\xeb\x2b\x75\xf2\x93\xa2\xd4\x00\xd8\x69\x47\x48\xf5"
  "\xaf\x2b\xb8\x7c\x06\x04\x69\x8b\x46\x0d\x44\x79\x8c\x86\x68\xfd"
  "\xd3\xb4\x1c\x8e\x9e\x6c\x58\x0c\xa5\xdf\x55\x4d\x59\x65\xc9\x70"
  "\x7c\x8a\x44\x26\x7d\xba\xf0\x3d\x46\x9e\x3c\xbe\x22\xc3");
  return 0;
}


general protection fault:  [#1] SMP DEBUG_PAGEALLOC KASAN
Modules linked in:
CPU: 2 PID: 4052 Comm: a.out Not tainted 4.8.0-rc3-next-20160825+ #11
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
task: 88006b37a380 task.stack: 880066dc
RIP: 0010:[]  []
bd_mount+0x52/0xa0 fs/block_dev.c:650
RSP: 0018:880066dc7ca0  EFLAGS: 00010207
RAX: dc00 RBX:  RCX: 0001
RDX: 0018 RSI: 886fd6c0 RDI: 00c7
RBP: 880066dc7cb0 R08: 88006b642cb8 R09: 
R10:  R11:  R12: 8880d440
R13: 88006a4ac1c0 R14: 88006b64b000 R15: 
FS:  012b2880() GS:88006d20() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 004b2160 CR3: 6cc72000 CR4: 06e0
Stack:
 880068e2c840 8880d440 880066dc7cf0 8186e73b
 0004 88006659c600 8880d440 88006a4ac1c0
  880068e2c840 880066dc7d40 818ce44a
Call Trace:
 [] mount_fs+0x9b/0x2f0 fs/super.c:1177
 [] vfs_kern_mount+0x7a/0x3e0 fs/namespace.c:948
 [< inline >] do_new_mount fs/namespace.c:2393
 [] do_mount+0x3d5/0x26b0 fs/namespace.c:2715
 [< inline >] SYSC_mount fs/namespace.c:2907
 [] SyS_mount+0xab/0x120 fs/namespace.c:2884
 [] do_syscall_64+0x1df/0x640 arch/x86/entry/common.c:288
 [] entry_SYSCALL64_slow_path+0x25/0x25
arch/x86/entry/entry_64.S:249
Code: 87 e8 f3 ca fb ff 48 85 c0 48 89 c3 74 4c e8 a6 47 ca ff 48 8d
bb c8 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80>
3c 02 00 75 36 4c 8b a3 c8 00 00 00 48 b8 00 00 00 00 00 fc
RIP  [] bd_mount+0x52/0xa0 fs/block_dev.c:650
 RSP 
---[ end trace 0e5d909159d79633 ]---


On commit 0f98f121e1670eaa2a2fbb675e07d6ba7f0e146f of linux-next.


RE: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-04 Thread Thomas Gleixner
On Sun, 4 Sep 2016, Liav Rehana wrote:
> >> The root of the problem is that in case the multiplication of delta 
> >> and
> >> tkr->mult in the line that I've changed is too big that the MSB of the
> >> result is set, then the shift will cause an unwanted sign extension.
> 
> > I completely understand that, but as I said before:
> 
> > > > This typecast is just a baindaid. What happens if you double the 
> > > > suspend time?  The multiplication will simply overflow. So the 
> > > > proper fix is to sanity check delta and do multiple conversions if 
> > > > delta is big enough.  Preferrably this happens somewhere at the call 
> > > > site and not in this hotpath function.
> 
> > > That sign extension will be avoided completely if the variable nsec 
> > > was unsigned (u64 instead of s64), so I think the correct solution for 
> > > this is to change the type of nsec to u64.
> 
> > That's a different story and its not a solution for the general problem of
> 
> >delta * mult >= (1 << 31) or delta * mult >= (1 << 32)
> 
> The case that delta * mult >= 1 << 31 is not a problem by itself, but it 
> causes
> an unwanted sign extension since the type of nsec is signed. That sign
> extension is what causes the loop to take too long, and not the overflow.
> I understand that the typecast is not a general solution, so as I've said, I
> think that changing the type of nsec to u64 instead of s64 will be a good and
> general solution, as it will indeed solve the problem of the unwanted sign
> extension.
> 
> To summarize: a sign extension occurs if the nsec variable is signed, and so
> I ask if you think it will be a good solution to change its type to unsigned.

Do you actually read what I write? I asked John before:

> John, why is that stuff signed at all? Shouldn't we use u64 for all of this?

So to summarize: 

   - Yes, we can use u64 if there is nothing which I missed, but John will
 have the last word on this

   - No, making it u64 does not solve the general problem. It just papers
 over the problem you observe. And we don't add 'paper over' fixes,
 period.

Thanks,

tglx




RE: [PATCH] Fix chance of sign extension to nsec after its msb is set during calculation.

2016-09-04 Thread Thomas Gleixner
On Sun, 4 Sep 2016, Liav Rehana wrote:
> >> The root of the problem is that in case the multiplication of delta 
> >> and
> >> tkr->mult in the line that I've changed is too big that the MSB of the
> >> result is set, then the shift will cause an unwanted sign extension.
> 
> > I completely understand that, but as I said before:
> 
> > > > This typecast is just a baindaid. What happens if you double the 
> > > > suspend time?  The multiplication will simply overflow. So the 
> > > > proper fix is to sanity check delta and do multiple conversions if 
> > > > delta is big enough.  Preferrably this happens somewhere at the call 
> > > > site and not in this hotpath function.
> 
> > > That sign extension will be avoided completely if the variable nsec 
> > > was unsigned (u64 instead of s64), so I think the correct solution for 
> > > this is to change the type of nsec to u64.
> 
> > That's a different story and its not a solution for the general problem of
> 
> >delta * mult >= (1 << 31) or delta * mult >= (1 << 32)
> 
> The case that delta * mult >= 1 << 31 is not a problem by itself, but it 
> causes
> an unwanted sign extension since the type of nsec is signed. That sign
> extension is what causes the loop to take too long, and not the overflow.
> I understand that the typecast is not a general solution, so as I've said, I
> think that changing the type of nsec to u64 instead of s64 will be a good and
> general solution, as it will indeed solve the problem of the unwanted sign
> extension.
> 
> To summarize: a sign extension occurs if the nsec variable is signed, and so
> I ask if you think it will be a good solution to change its type to unsigned.

Do you actually read what I write? I asked John before:

> John, why is that stuff signed at all? Shouldn't we use u64 for all of this?

So to summarize: 

   - Yes, we can use u64 if there is nothing which I missed, but John will
 have the last word on this

   - No, making it u64 does not solve the general problem. It just papers
 over the problem you observe. And we don't add 'paper over' fixes,
 period.

Thanks,

tglx




Re: [PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check.

2016-09-04 Thread Amit Ghadge
I will be send individual patches.

I was try,
 make M=drivers/staging/comedi/

No issue generated, Is there have any other option to test these changes?


Amit G

On Sun, Sep 4, 2016 at 2:05 PM, Greg KH  wrote:
> On Sun, Sep 04, 2016 at 01:41:03AM +0530, Amit Ghadge wrote:
>> Fixes checkpatch warning:
>> WARNING: Block comments use * on subsequent lines
>>
>> Replace (1<<7) by BIT(7) in the file ni_670x.c to get rid
>> of checkpatch.pl "CHECK" output "Prefer using the BIT macro".
>> Replace Avoid CamelCase range_0_20mA to range_0_20ma.
>
> That's multiple things in the same patch, and you didn't even test build
> your change :(
>
> Please do better than this in the future.
>
> greg k-h


Re: [PATCH 2/2] Staging: comedi: ni_670x.c: Fix warnings and check.

2016-09-04 Thread Amit Ghadge
I will be send individual patches.

I was try,
 make M=drivers/staging/comedi/

No issue generated, Is there have any other option to test these changes?


Amit G

On Sun, Sep 4, 2016 at 2:05 PM, Greg KH  wrote:
> On Sun, Sep 04, 2016 at 01:41:03AM +0530, Amit Ghadge wrote:
>> Fixes checkpatch warning:
>> WARNING: Block comments use * on subsequent lines
>>
>> Replace (1<<7) by BIT(7) in the file ni_670x.c to get rid
>> of checkpatch.pl "CHECK" output "Prefer using the BIT macro".
>> Replace Avoid CamelCase range_0_20mA to range_0_20ma.
>
> That's multiple things in the same patch, and you didn't even test build
> your change :(
>
> Please do better than this in the future.
>
> greg k-h


Re: Possible code defects: macros and precedence

2016-09-04 Thread Julia Lawall


On Sat, 3 Sep 2016, Joe Perches wrote:

> There are many nominally incorrect macro definitions
> in linux-kernel source where parentheses are not used
> for various macros arguments with calculations.
>
> Does coccinelle or smatch have the ability to detect
> potential macro misuse where arguments passed to the
> macro are not correctly parenthesized by the macro?
>
> Something like:
>
>   #define A 1
>   #define B 2
>   #define shift(val) (val << 1)
>
> where a use is:
>
>   int c = shift(A | B)
>
> where the actual result is 5 but the expected result is 6?
>
> Can either tool suggest changing the macro to
>
>   #define shift(val) ((val) << 1)

Coccinelle could do this.  It is possible to match macro parameters, and
it is possible to match binary operators generically.  I can look into it.

julia


Re: Possible code defects: macros and precedence

2016-09-04 Thread Julia Lawall


On Sat, 3 Sep 2016, Joe Perches wrote:

> There are many nominally incorrect macro definitions
> in linux-kernel source where parentheses are not used
> for various macros arguments with calculations.
>
> Does coccinelle or smatch have the ability to detect
> potential macro misuse where arguments passed to the
> macro are not correctly parenthesized by the macro?
>
> Something like:
>
>   #define A 1
>   #define B 2
>   #define shift(val) (val << 1)
>
> where a use is:
>
>   int c = shift(A | B)
>
> where the actual result is 5 but the expected result is 6?
>
> Can either tool suggest changing the macro to
>
>   #define shift(val) ((val) << 1)

Coccinelle could do this.  It is possible to match macro parameters, and
it is possible to match binary operators generically.  I can look into it.

julia


Re: [PATCH] IB/rxe: fix GFP_KERNEL in spinlock context

2016-09-04 Thread Moni Shoua
On Fri, Sep 2, 2016 at 11:46 PM, Alexey Khoroshilov
 wrote:
> There is skb_clone(skb, GFP_KERNEL) in spinlock context
> in rxe_rcv_mcast_pkt().
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov 
> ---
>  drivers/infiniband/sw/rxe/rxe_recv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c 
> b/drivers/infiniband/sw/rxe/rxe_recv.c
> index 3d464c23e08b..144d2f129fcd 100644
> --- a/drivers/infiniband/sw/rxe/rxe_recv.c
> +++ b/drivers/infiniband/sw/rxe/rxe_recv.c
> @@ -312,7 +312,7 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct 
> sk_buff *skb)
>  * make a copy of the skb to post to the next qp
>  */
> skb_copy = (mce->qp_list.next != >qp_list) ?
> -   skb_clone(skb, GFP_KERNEL) : NULL;
> +   skb_clone(skb, GFP_ATOMIC) : NULL;
>
> pkt->qp = qp;
> rxe_add_ref(qp);
> --
> 2.7.4
>
Acked-by: Moni Shoua 


Re: [PATCH] IB/rxe: fix GFP_KERNEL in spinlock context

2016-09-04 Thread Moni Shoua
On Fri, Sep 2, 2016 at 11:46 PM, Alexey Khoroshilov
 wrote:
> There is skb_clone(skb, GFP_KERNEL) in spinlock context
> in rxe_rcv_mcast_pkt().
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov 
> ---
>  drivers/infiniband/sw/rxe/rxe_recv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c 
> b/drivers/infiniband/sw/rxe/rxe_recv.c
> index 3d464c23e08b..144d2f129fcd 100644
> --- a/drivers/infiniband/sw/rxe/rxe_recv.c
> +++ b/drivers/infiniband/sw/rxe/rxe_recv.c
> @@ -312,7 +312,7 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct 
> sk_buff *skb)
>  * make a copy of the skb to post to the next qp
>  */
> skb_copy = (mce->qp_list.next != >qp_list) ?
> -   skb_clone(skb, GFP_KERNEL) : NULL;
> +   skb_clone(skb, GFP_ATOMIC) : NULL;
>
> pkt->qp = qp;
> rxe_add_ref(qp);
> --
> 2.7.4
>
Acked-by: Moni Shoua 


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread Amit Ghadge
On Sun, Sep 4, 2016 at 3:12 PM, Giedrius Statkevičius
 wrote:
> On Sun, Sep 4, 2016 at 12:08 PM, Amit Ghadge  wrote:
>> This is a patch to the ni_daq_dio24.c that fixes checkpatch warning:
>> WARNING: Block comments use * on subsequent lines
>>
>> Signed-off-by: Amit Ghadge 
>> ---
> [...]
>
> Why are you sending so many copies of the same patch?

Accidentally I used same git branch and try to send multiple patches
but other patch has some issue, So I have exclude the other patch.


Amit


Re: [RFC v5 21/23] clockevents: initial support for mono to raw time conversion

2016-09-04 Thread Nicolai Stange
Nicolai Stange  writes:

> +static u32 __clockevents_calc_adjust_freq(u32 mult_ce_raw, u32 mult_cs_mono,
> + u32 mult_cs_raw)
> +{
> + u64 adj;
> + int sign;
> +
> + if (mult_cs_raw >= mult_cs_mono) {
> + sign = 0;
> + adj = mult_cs_raw - mult_cs_mono;
> + } else {
> + sign = 1;
> + adj = mult_cs_mono - mult_cs_raw;
> + }
> +
> + adj *= mult_ce_raw;
> + adj += mult_cs_mono / 2;
> + do_div(adj, mult_cs_mono);
> +
> + if (!sign) {
> + /*
> +  * Never increase mult by more than 12.5%,
> +  * c.f. __clockevents_update_bounds().
> +  */
> + adj = max_t(u64, adj, mult_ce_raw / 8);

This is wrong and should read as min_t(...), of course -- it's an upper
bound.


> + if (U32_MAX - mult_ce_raw < adj)
> + return U32_MAX;
> + return mult_ce_raw + (u32)adj;
> + }
> + if (adj >= mult_ce_raw)
> + return 1;
> + return mult_ce_raw - (u32)adj;
> +}


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread Amit Ghadge
On Sun, Sep 4, 2016 at 3:12 PM, Giedrius Statkevičius
 wrote:
> On Sun, Sep 4, 2016 at 12:08 PM, Amit Ghadge  wrote:
>> This is a patch to the ni_daq_dio24.c that fixes checkpatch warning:
>> WARNING: Block comments use * on subsequent lines
>>
>> Signed-off-by: Amit Ghadge 
>> ---
> [...]
>
> Why are you sending so many copies of the same patch?

Accidentally I used same git branch and try to send multiple patches
but other patch has some issue, So I have exclude the other patch.


Amit


Re: [RFC v5 21/23] clockevents: initial support for mono to raw time conversion

2016-09-04 Thread Nicolai Stange
Nicolai Stange  writes:

> +static u32 __clockevents_calc_adjust_freq(u32 mult_ce_raw, u32 mult_cs_mono,
> + u32 mult_cs_raw)
> +{
> + u64 adj;
> + int sign;
> +
> + if (mult_cs_raw >= mult_cs_mono) {
> + sign = 0;
> + adj = mult_cs_raw - mult_cs_mono;
> + } else {
> + sign = 1;
> + adj = mult_cs_mono - mult_cs_raw;
> + }
> +
> + adj *= mult_ce_raw;
> + adj += mult_cs_mono / 2;
> + do_div(adj, mult_cs_mono);
> +
> + if (!sign) {
> + /*
> +  * Never increase mult by more than 12.5%,
> +  * c.f. __clockevents_update_bounds().
> +  */
> + adj = max_t(u64, adj, mult_ce_raw / 8);

This is wrong and should read as min_t(...), of course -- it's an upper
bound.


> + if (U32_MAX - mult_ce_raw < adj)
> + return U32_MAX;
> + return mult_ce_raw + (u32)adj;
> + }
> + if (adj >= mult_ce_raw)
> + return 1;
> + return mult_ce_raw - (u32)adj;
> +}


Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile()

2016-09-04 Thread Daniel Borkmann

On 09/04/2016 09:20 AM, SF Markus Elfring wrote:

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/Documentation/CodingStyle?id=865a1caa4b6b886babdd9d67e7c3608be4567a51


[ + Jonathan for above commit in linux-next ]


You seem to lack understanding of the difference between absolute
requirements and "advice".

As Sparc maintainer I can choose to not take this "advice",
and I so choose to do so.


Your conclusion can be fine in principle.

I am just curious on how much further software development "fun" the recent 
update
by a topic like "CodingStyle: Clarify and complete chapter 7" will trigger.


I don't want to drag this thread onwards for (way) too long, but clearly "it is
advised to indent labels with a single space (not tab)" (from diff in above 
commit)
doesn't really reflect the majority of kernel practice we have in-tree today and
actually rather adds more confusion than any clarification whatsoever:

  $ git grep -n "^\ [a-z_]*:" -- '*.[ch]' | wc -l
  4919
  $ git grep -n "^[a-z_]*:" -- '*.[ch]' | wc -l
  54686

A CodingStyle document should document what's regarded as a general consensus of
kernel coding practices, and thus should represent the /majority/ of coding 
style,
which (if I didn't screw up my git-grep line completely) above 9% does not 
really
reflect at all. So, new folks starting with kernel hacking reading this are 
rather
misguided, and code-wise it just adds up to have more inconsistencies from new
patches, or worse, have noisy patches (like this one) flying around that try to
brute-force everything into this advice.


Re: sparc: bpf_jit: Rename jump labels in bpf_jit_compile()

2016-09-04 Thread Daniel Borkmann

On 09/04/2016 09:20 AM, SF Markus Elfring wrote:

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/Documentation/CodingStyle?id=865a1caa4b6b886babdd9d67e7c3608be4567a51


[ + Jonathan for above commit in linux-next ]


You seem to lack understanding of the difference between absolute
requirements and "advice".

As Sparc maintainer I can choose to not take this "advice",
and I so choose to do so.


Your conclusion can be fine in principle.

I am just curious on how much further software development "fun" the recent 
update
by a topic like "CodingStyle: Clarify and complete chapter 7" will trigger.


I don't want to drag this thread onwards for (way) too long, but clearly "it is
advised to indent labels with a single space (not tab)" (from diff in above 
commit)
doesn't really reflect the majority of kernel practice we have in-tree today and
actually rather adds more confusion than any clarification whatsoever:

  $ git grep -n "^\ [a-z_]*:" -- '*.[ch]' | wc -l
  4919
  $ git grep -n "^[a-z_]*:" -- '*.[ch]' | wc -l
  54686

A CodingStyle document should document what's regarded as a general consensus of
kernel coding practices, and thus should represent the /majority/ of coding 
style,
which (if I didn't screw up my git-grep line completely) above 9% does not 
really
reflect at all. So, new folks starting with kernel hacking reading this are 
rather
misguided, and code-wise it just adds up to have more inconsistencies from new
patches, or worse, have noisy patches (like this one) flying around that try to
brute-force everything into this advice.


Re: [list] 8052ce2d97: WARNING: CPU: 0 PID: 1 at lib/list_debug.c:60 __list_del_entry+0x4d/0x71

2016-09-04 Thread Paul E. McKenney
On Sun, Sep 04, 2016 at 08:35:40AM +0800, kernel test robot wrote:
> 
> FYI, we noticed the following commit:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git 
> dev.2016.08.19a
> commit 8052ce2d9771ab5a818307f3abbaf33bba82a631 ("list: Split list_add() 
> debug checking into separate function")
> 
> in testcase: boot
> 
> on test machine: qemu-system-i386 -enable-kvm -m 360M
> 
> caused below changes:

Hello, Kees,

Looks like your change might have actually found a bug.  ;-)

How would you like to handle this?

Thanx, Paul

> ++++
> || 0a33d912a3 | 
> 8052ce2d97 |
> ++++
> | boot_successes | 0  | 0 
>  |
> | boot_failures  | 211| 
> 18 |
> | WARNING:at_lib/list_debug.c:#__list_del_entry  | 211| 
> 18 |
> | calltrace:init | 209| 
> 18 |
> | WARNING:at_lib/list_debug.c:#__list_add| 209|   
>  |
> | calltrace:i8042_init   | 209| 
> 17 |
> | calltrace:SyS_reboot   | 192| 4 
>  |
> | EIP_is_at__mutex_unlock_slowpath   | 29 |   
>  |
> | Kernel_panic-not_syncing:softlockup:hung_tasks | 138|   
>  |
> | BUG:workqueue_lockup-pool_cpus=#flags=#nice=#stuck_for#s   | 56 |   
>  |
> | EIP_is_at_lock_release | 7  |   
>  |
> | EIP_is_at_lock_acquire | 28 |   
>  |
> | EIP_is_at_raw_spin_unlock_irq  | 30 |   
>  |
> | EIP_is_at_mutex_lock_nested| 21 |   
>  |
> | EIP_is_at_lock_is_held | 10 |   
>  |
> | EIP_is_at_device_shutdown  | 3  |   
>  |
> | EIP_is_at___might_sleep| 5  |   
>  |
> | EIP_is_at__list_del_entry  | 4  | 1 
>  |
> | EIP_is_at_get_device   | 1  |   
>  |
> | BUG:unable_to_handle_kernel| 7  | 5 
>  |
> | Oops   | 7  | 5 
>  |
> | calltrace:SyS_ipc  | 4  | 4 
>  |
> | Kernel_panic-not_syncing:Fatal_exception   | 7  | 5 
>  |
> | EIP_is_at_pm_runtime_barrier   | 1  |   
>  |
> | EIP_is_at_lock_acquired| 1  |   
>  |
> | EIP_is_at__might_sleep | 1  |   
>  |
> | BUG:workqueue_lockup-pool_cpus=#-#flags=#nice=#stuck_for#s | 1  |   
>  |
> | WARNING:at_arch/x86/mm/dump_pagetables.c:#note_page| 26 |   
>  |
> | calltrace:mark_rodata_ro   | 26 |   
>  |
> | WARNING:at_lib/list_debug.c:#__list_add_valid  | 0  | 
> 17 |
> | calltrace:serio_handle_event   | 0  | 
> 17 |
> | calltrace:userio_misc_init | 0  | 
> 17 |
> | calltrace:mousedev_init| 0  | 
> 17 |
> | calltrace:evdev_init   | 0  | 
> 17 |
> | calltrace:cmos_init| 0  | 
> 17 |
> | calltrace:test_init| 0  | 
> 17 |
> | calltrace:pca_isa_driver_init  | 0  | 
> 17 |
> | calltrace:vim2m_init   | 0  | 
> 17 |
> | calltrace:fm_drv_init  | 0  | 
> 17 |
> | calltrace:test_power_init  | 0  | 
> 17 |
> | calltrace:raid#_init   | 0  | 
> 17 |
> | calltrace:dm_init  | 0  | 
> 17 |
> | calltrace:vhci_init| 0  | 
> 17 |
> | calltrace:dcdrbu_init  | 0  

Re: [list] 8052ce2d97: WARNING: CPU: 0 PID: 1 at lib/list_debug.c:60 __list_del_entry+0x4d/0x71

2016-09-04 Thread Paul E. McKenney
On Sun, Sep 04, 2016 at 08:35:40AM +0800, kernel test robot wrote:
> 
> FYI, we noticed the following commit:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git 
> dev.2016.08.19a
> commit 8052ce2d9771ab5a818307f3abbaf33bba82a631 ("list: Split list_add() 
> debug checking into separate function")
> 
> in testcase: boot
> 
> on test machine: qemu-system-i386 -enable-kvm -m 360M
> 
> caused below changes:

Hello, Kees,

Looks like your change might have actually found a bug.  ;-)

How would you like to handle this?

Thanx, Paul

> ++++
> || 0a33d912a3 | 
> 8052ce2d97 |
> ++++
> | boot_successes | 0  | 0 
>  |
> | boot_failures  | 211| 
> 18 |
> | WARNING:at_lib/list_debug.c:#__list_del_entry  | 211| 
> 18 |
> | calltrace:init | 209| 
> 18 |
> | WARNING:at_lib/list_debug.c:#__list_add| 209|   
>  |
> | calltrace:i8042_init   | 209| 
> 17 |
> | calltrace:SyS_reboot   | 192| 4 
>  |
> | EIP_is_at__mutex_unlock_slowpath   | 29 |   
>  |
> | Kernel_panic-not_syncing:softlockup:hung_tasks | 138|   
>  |
> | BUG:workqueue_lockup-pool_cpus=#flags=#nice=#stuck_for#s   | 56 |   
>  |
> | EIP_is_at_lock_release | 7  |   
>  |
> | EIP_is_at_lock_acquire | 28 |   
>  |
> | EIP_is_at_raw_spin_unlock_irq  | 30 |   
>  |
> | EIP_is_at_mutex_lock_nested| 21 |   
>  |
> | EIP_is_at_lock_is_held | 10 |   
>  |
> | EIP_is_at_device_shutdown  | 3  |   
>  |
> | EIP_is_at___might_sleep| 5  |   
>  |
> | EIP_is_at__list_del_entry  | 4  | 1 
>  |
> | EIP_is_at_get_device   | 1  |   
>  |
> | BUG:unable_to_handle_kernel| 7  | 5 
>  |
> | Oops   | 7  | 5 
>  |
> | calltrace:SyS_ipc  | 4  | 4 
>  |
> | Kernel_panic-not_syncing:Fatal_exception   | 7  | 5 
>  |
> | EIP_is_at_pm_runtime_barrier   | 1  |   
>  |
> | EIP_is_at_lock_acquired| 1  |   
>  |
> | EIP_is_at__might_sleep | 1  |   
>  |
> | BUG:workqueue_lockup-pool_cpus=#-#flags=#nice=#stuck_for#s | 1  |   
>  |
> | WARNING:at_arch/x86/mm/dump_pagetables.c:#note_page| 26 |   
>  |
> | calltrace:mark_rodata_ro   | 26 |   
>  |
> | WARNING:at_lib/list_debug.c:#__list_add_valid  | 0  | 
> 17 |
> | calltrace:serio_handle_event   | 0  | 
> 17 |
> | calltrace:userio_misc_init | 0  | 
> 17 |
> | calltrace:mousedev_init| 0  | 
> 17 |
> | calltrace:evdev_init   | 0  | 
> 17 |
> | calltrace:cmos_init| 0  | 
> 17 |
> | calltrace:test_init| 0  | 
> 17 |
> | calltrace:pca_isa_driver_init  | 0  | 
> 17 |
> | calltrace:vim2m_init   | 0  | 
> 17 |
> | calltrace:fm_drv_init  | 0  | 
> 17 |
> | calltrace:test_power_init  | 0  | 
> 17 |
> | calltrace:raid#_init   | 0  | 
> 17 |
> | calltrace:dm_init  | 0  | 
> 17 |
> | calltrace:vhci_init| 0  | 
> 17 |
> | calltrace:dcdrbu_init  | 0  

[PATCH] sctp: Remove some redundant code

2016-09-04 Thread Christophe JAILLET
In commit 311b21774f13 ("sctp: simplify sk_receive_queue locking"), a call
to 'skb_queue_splice_tail_init()' has been made explicit. Previously it was
hidden in 'sctp_skb_list_tail()'

Now, the code around it looks redundant. The '_init()' part of
'skb_queue_splice_tail_init()' should alreday do the same.

Signed-off-by: Christophe JAILLET 
---
Un-tested
---
 net/sctp/ulpqueue.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index 877e55066f89..84d0fdaf7de9 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -140,11 +140,8 @@ int sctp_clear_pd(struct sock *sk, struct sctp_association 
*asoc)
 * we can go ahead and clear out the lobby in one shot
 */
if (!skb_queue_empty(>pd_lobby)) {
-   struct list_head *list;
skb_queue_splice_tail_init(>pd_lobby,
   >sk_receive_queue);
-   list = (struct list_head *)_sk(sk)->pd_lobby;
-   INIT_LIST_HEAD(list);
return 1;
}
} else {
-- 
2.7.4



[PATCH] sctp: Remove some redundant code

2016-09-04 Thread Christophe JAILLET
In commit 311b21774f13 ("sctp: simplify sk_receive_queue locking"), a call
to 'skb_queue_splice_tail_init()' has been made explicit. Previously it was
hidden in 'sctp_skb_list_tail()'

Now, the code around it looks redundant. The '_init()' part of
'skb_queue_splice_tail_init()' should alreday do the same.

Signed-off-by: Christophe JAILLET 
---
Un-tested
---
 net/sctp/ulpqueue.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index 877e55066f89..84d0fdaf7de9 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -140,11 +140,8 @@ int sctp_clear_pd(struct sock *sk, struct sctp_association 
*asoc)
 * we can go ahead and clear out the lobby in one shot
 */
if (!skb_queue_empty(>pd_lobby)) {
-   struct list_head *list;
skb_queue_splice_tail_init(>pd_lobby,
   >sk_receive_queue);
-   list = (struct list_head *)_sk(sk)->pd_lobby;
-   INIT_LIST_HEAD(list);
return 1;
}
} else {
-- 
2.7.4



[PATCH] x86/microcode/AMD: Fix loading of builtin microcode with CONFIG_RANDOMIZE_MEMORY

2016-09-04 Thread Borislav Petkov
Hi guys,

here's one more fix for builtin microcode with CONFIG_RANDOMIZE_MEMORY
for tip/x86/urgent. In the builtin case, we don't need to add the
randomization offset because the builtin address gets relocated
automatically.

I know Ingo is not a big fan of all that adding of offsets and
admittedly, the nature of those fixes are more of the brown-paper-baggy
nature probably due to vacation and other preventing circumstances.

I'd like to fix the whole deal properly but it will require more
involved changes - stuff like re-getting the initrd offset on the APs
too instead of caching it, etc, etc,

However, doing that would require changes which are not suitable for the
current rc4-rc5 timeframe and it would need extensive testing too and
since it is too late for 4.8, I'd like to apply this last one so that
4.8 ships fixed and tackle the issue properly for 4.9.

Hope this all makes sense to you.

I've tested this in all possible configurations I can think of so that
we can be sure it is a good fix.

Thanks.

---

We do not need to add the randomization offset when the microcode is
built in.

Reported-and-tested-by: Emanuel Czirai 
Signed-off-by: Borislav Petkov 
---
 arch/x86/kernel/cpu/microcode/amd.c | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/amd.c 
b/arch/x86/kernel/cpu/microcode/amd.c
index b816971f5da4..620ab06bcf45 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -54,6 +54,7 @@ static LIST_HEAD(pcache);
  */
 static u8 *container;
 static size_t container_size;
+static bool ucode_builtin;
 
 static u32 ucode_new_rev;
 static u8 amd_ucode_patch[PATCH_MAX_SIZE];
@@ -281,18 +282,22 @@ static bool __init load_builtin_amd_microcode(struct 
cpio_data *cp,
 void __init load_ucode_amd_bsp(unsigned int family)
 {
struct cpio_data cp;
+   bool *builtin;
void **data;
size_t *size;
 
 #ifdef CONFIG_X86_32
data =  (void **)__pa_nodebug(_cpio.data);
size = (size_t *)__pa_nodebug(_cpio.size);
+   builtin = (bool *)__pa_nodebug(_builtin);
 #else
data = _cpio.data;
size = _cpio.size;
+   builtin = _builtin;
 #endif
 
-   if (!load_builtin_amd_microcode(, family))
+   *builtin = load_builtin_amd_microcode(, family);
+   if (!*builtin)
cp = find_ucode_in_initrd();
 
if (!(cp.data && cp.size))
@@ -373,7 +378,8 @@ void load_ucode_amd_ap(void)
return;
 
/* Add CONFIG_RANDOMIZE_MEMORY offset. */
-   cont += PAGE_OFFSET - __PAGE_OFFSET_BASE;
+   if (!ucode_builtin)
+   cont += PAGE_OFFSET - __PAGE_OFFSET_BASE;
 
eax = cpuid_eax(0x0001);
eq  = (struct equiv_cpu_entry *)(cont + CONTAINER_HDR_SZ);
@@ -439,7 +445,8 @@ int __init save_microcode_in_initrd_amd(void)
container = cont_va;
 
/* Add CONFIG_RANDOMIZE_MEMORY offset. */
-   container += PAGE_OFFSET - __PAGE_OFFSET_BASE;
+   if (!ucode_builtin)
+   container += PAGE_OFFSET - __PAGE_OFFSET_BASE;
 
eax   = cpuid_eax(0x0001);
eax   = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
-- 
2.10.0


-- 
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.


[PATCH] x86/microcode/AMD: Fix loading of builtin microcode with CONFIG_RANDOMIZE_MEMORY

2016-09-04 Thread Borislav Petkov
Hi guys,

here's one more fix for builtin microcode with CONFIG_RANDOMIZE_MEMORY
for tip/x86/urgent. In the builtin case, we don't need to add the
randomization offset because the builtin address gets relocated
automatically.

I know Ingo is not a big fan of all that adding of offsets and
admittedly, the nature of those fixes are more of the brown-paper-baggy
nature probably due to vacation and other preventing circumstances.

I'd like to fix the whole deal properly but it will require more
involved changes - stuff like re-getting the initrd offset on the APs
too instead of caching it, etc, etc,

However, doing that would require changes which are not suitable for the
current rc4-rc5 timeframe and it would need extensive testing too and
since it is too late for 4.8, I'd like to apply this last one so that
4.8 ships fixed and tackle the issue properly for 4.9.

Hope this all makes sense to you.

I've tested this in all possible configurations I can think of so that
we can be sure it is a good fix.

Thanks.

---

We do not need to add the randomization offset when the microcode is
built in.

Reported-and-tested-by: Emanuel Czirai 
Signed-off-by: Borislav Petkov 
---
 arch/x86/kernel/cpu/microcode/amd.c | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/microcode/amd.c 
b/arch/x86/kernel/cpu/microcode/amd.c
index b816971f5da4..620ab06bcf45 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -54,6 +54,7 @@ static LIST_HEAD(pcache);
  */
 static u8 *container;
 static size_t container_size;
+static bool ucode_builtin;
 
 static u32 ucode_new_rev;
 static u8 amd_ucode_patch[PATCH_MAX_SIZE];
@@ -281,18 +282,22 @@ static bool __init load_builtin_amd_microcode(struct 
cpio_data *cp,
 void __init load_ucode_amd_bsp(unsigned int family)
 {
struct cpio_data cp;
+   bool *builtin;
void **data;
size_t *size;
 
 #ifdef CONFIG_X86_32
data =  (void **)__pa_nodebug(_cpio.data);
size = (size_t *)__pa_nodebug(_cpio.size);
+   builtin = (bool *)__pa_nodebug(_builtin);
 #else
data = _cpio.data;
size = _cpio.size;
+   builtin = _builtin;
 #endif
 
-   if (!load_builtin_amd_microcode(, family))
+   *builtin = load_builtin_amd_microcode(, family);
+   if (!*builtin)
cp = find_ucode_in_initrd();
 
if (!(cp.data && cp.size))
@@ -373,7 +378,8 @@ void load_ucode_amd_ap(void)
return;
 
/* Add CONFIG_RANDOMIZE_MEMORY offset. */
-   cont += PAGE_OFFSET - __PAGE_OFFSET_BASE;
+   if (!ucode_builtin)
+   cont += PAGE_OFFSET - __PAGE_OFFSET_BASE;
 
eax = cpuid_eax(0x0001);
eq  = (struct equiv_cpu_entry *)(cont + CONTAINER_HDR_SZ);
@@ -439,7 +445,8 @@ int __init save_microcode_in_initrd_amd(void)
container = cont_va;
 
/* Add CONFIG_RANDOMIZE_MEMORY offset. */
-   container += PAGE_OFFSET - __PAGE_OFFSET_BASE;
+   if (!ucode_builtin)
+   container += PAGE_OFFSET - __PAGE_OFFSET_BASE;
 
eax   = cpuid_eax(0x0001);
eax   = ((eax >> 8) & 0xf) + ((eax >> 20) & 0xff);
-- 
2.10.0


-- 
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread Giedrius Statkevičius
On Sun, Sep 4, 2016 at 12:08 PM, Amit Ghadge  wrote:
> This is a patch to the ni_daq_dio24.c that fixes checkpatch warning:
> WARNING: Block comments use * on subsequent lines
>
> Signed-off-by: Amit Ghadge 
> ---
[...]

Why are you sending so many copies of the same patch?


Re: [PATCH] Staging: comedi: ni_daq_dio24.c: Fix block comments use * on subsequent lines.

2016-09-04 Thread Giedrius Statkevičius
On Sun, Sep 4, 2016 at 12:08 PM, Amit Ghadge  wrote:
> This is a patch to the ni_daq_dio24.c that fixes checkpatch warning:
> WARNING: Block comments use * on subsequent lines
>
> Signed-off-by: Amit Ghadge 
> ---
[...]

Why are you sending so many copies of the same patch?


[GIT pull] timer fixes for 4.8

2016-09-04 Thread Thomas Gleixner
Linus,

please pull the latest timers-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
timers-urgent-for-linus

Two fixlet from the timers departement:

- A fix for scheduler stalls in the tick idle code affecting NOHZ_FULL
  kernels

- A trivial compile fix

Thanks,

tglx

-->
Daniel Lezcano (1):
  clocksource/drivers/atmel-pit: Fix compilation error

Wanpeng Li (1):
  tick/nohz: Fix softlockup on scheduler stalls in kvm guest


 drivers/clocksource/timer-atmel-pit.c | 1 +
 kernel/time/tick-sched.c  | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-atmel-pit.c 
b/drivers/clocksource/timer-atmel-pit.c
index 3494bc5a21d5..7f0f5b26d8c5 100644
--- a/drivers/clocksource/timer-atmel-pit.c
+++ b/drivers/clocksource/timer-atmel-pit.c
@@ -240,6 +240,7 @@ static int __init at91sam926x_pit_common_init(struct 
pit_data *data)
 static int __init at91sam926x_pit_dt_init(struct device_node *node)
 {
struct pit_data *data;
+   int ret;
 
data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 204fdc86863d..2ec7c00228f3 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -908,10 +908,11 @@ static void __tick_nohz_idle_enter(struct tick_sched *ts)
ktime_t now, expires;
int cpu = smp_processor_id();
 
+   now = tick_nohz_start_idle(ts);
+
if (can_stop_idle_tick(cpu, ts)) {
int was_stopped = ts->tick_stopped;
 
-   now = tick_nohz_start_idle(ts);
ts->idle_calls++;
 
expires = tick_nohz_stop_sched_tick(ts, now, cpu);


[GIT pull] timer fixes for 4.8

2016-09-04 Thread Thomas Gleixner
Linus,

please pull the latest timers-urgent-for-linus git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
timers-urgent-for-linus

Two fixlet from the timers departement:

- A fix for scheduler stalls in the tick idle code affecting NOHZ_FULL
  kernels

- A trivial compile fix

Thanks,

tglx

-->
Daniel Lezcano (1):
  clocksource/drivers/atmel-pit: Fix compilation error

Wanpeng Li (1):
  tick/nohz: Fix softlockup on scheduler stalls in kvm guest


 drivers/clocksource/timer-atmel-pit.c | 1 +
 kernel/time/tick-sched.c  | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-atmel-pit.c 
b/drivers/clocksource/timer-atmel-pit.c
index 3494bc5a21d5..7f0f5b26d8c5 100644
--- a/drivers/clocksource/timer-atmel-pit.c
+++ b/drivers/clocksource/timer-atmel-pit.c
@@ -240,6 +240,7 @@ static int __init at91sam926x_pit_common_init(struct 
pit_data *data)
 static int __init at91sam926x_pit_dt_init(struct device_node *node)
 {
struct pit_data *data;
+   int ret;
 
data = kzalloc(sizeof(*data), GFP_KERNEL);
if (!data)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 204fdc86863d..2ec7c00228f3 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -908,10 +908,11 @@ static void __tick_nohz_idle_enter(struct tick_sched *ts)
ktime_t now, expires;
int cpu = smp_processor_id();
 
+   now = tick_nohz_start_idle(ts);
+
if (can_stop_idle_tick(cpu, ts)) {
int was_stopped = ts->tick_stopped;
 
-   now = tick_nohz_start_idle(ts);
ts->idle_calls++;
 
expires = tick_nohz_stop_sched_tick(ts, now, cpu);


<    1   2   3   4   5   6   >