Re: [RFT PATCH] ARM: OMAP: Change all cpu_is_* occurences to soc_is_*

2015-08-23 Thread Keerthy



On Tuesday 18 August 2015 05:24 PM, Keerthy wrote:



On Tuesday 18 August 2015 03:40 PM, Keerthy wrote:

Currently apart from dra7, omap5 and amx3 all the other SoCs
are identified using cpu_is_* functions which is not right since
they are all SoCs(System on Chips). Hence changing the SoC
identificätion code to use soc_is instead of cpu_is and keeping
defines for cpu_is where needed. This allows us to replace the
rest of cpu_is usage along with other fixes as needed.

Signed-off-by: Keerthy 
---


Boot tested on dra7-evm, omap4-panda, am437x-gp-evm.


Also boot tested on OMAP3 BeagleBoard xM and AM335x BeagleBone.




  arch/arm/mach-omap2/id.c  |  30 +++
  arch/arm/mach-omap2/soc.h | 193
++
  2 files changed, 123 insertions(+), 100 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index e3f713f..24f24d4 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -57,15 +57,15 @@ int omap_type(void)
  if (val < OMAP2_DEVICETYPE_MASK)
  return val;

-if (cpu_is_omap24xx()) {
+if (soc_is_omap24xx()) {
  val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
-} else if (cpu_is_ti81xx()) {
+} else if (soc_is_ti81xx()) {
  val = omap_ctrl_readl(TI81XX_CONTROL_STATUS);
  } else if (soc_is_am33xx() || soc_is_am43xx()) {
  val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
-} else if (cpu_is_omap34xx()) {
+} else if (soc_is_omap34xx()) {
  val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
-} else if (cpu_is_omap44xx()) {
+} else if (soc_is_omap44xx()) {
  val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
  } else if (soc_is_omap54xx() || soc_is_dra7xx()) {
  val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
@@ -122,7 +122,7 @@ static u16 tap_prod_id;

  void omap_get_die_id(struct omap_die_id *odi)
  {
-if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
+if (soc_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
  odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0);
  odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1);
  odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2);
@@ -218,17 +218,17 @@ static void __init omap3_cpuinfo(void)
   * on available features. Upon detection, update the CPU id
   * and CPU class bits.
   */
-if (cpu_is_omap3630()) {
+if (soc_is_omap3630()) {
  cpu_name = "OMAP3630";
  } else if (soc_is_am35xx()) {
  cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505";
-} else if (cpu_is_ti816x()) {
+} else if (soc_is_ti816x()) {
  cpu_name = "TI816X";
  } else if (soc_is_am335x()) {
  cpu_name =  "AM335X";
  } else if (soc_is_am437x()) {
  cpu_name =  "AM437x";
-} else if (cpu_is_ti814x()) {
+} else if (soc_is_ti814x()) {
  cpu_name = "TI814X";
  } else if (omap3_has_iva() && omap3_has_sgx()) {
  /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
@@ -275,11 +275,11 @@ void __init omap3xxx_check_features(void)
  OMAP3_CHECK_FEATURE(status, SGX);
  OMAP3_CHECK_FEATURE(status, NEON);
  OMAP3_CHECK_FEATURE(status, ISP);
-if (cpu_is_omap3630())
+if (soc_is_omap3630())
  omap_features |= OMAP3_HAS_192MHZ_CLK;
-if (cpu_is_omap3430() || cpu_is_omap3630())
+if (soc_is_omap3430() || soc_is_omap3630())
  omap_features |= OMAP3_HAS_IO_WAKEUP;
-if (cpu_is_omap3630() || omap_rev() == OMAP3430_REV_ES3_1 ||
+if (soc_is_omap3630() || omap_rev() == OMAP3430_REV_ES3_1 ||
  omap_rev() == OMAP3430_REV_ES3_1_2)
  omap_features |= OMAP3_HAS_IO_CHAIN_CTRL;

@@ -697,7 +697,7 @@ void __init omap2_set_globals_tap(u32 class, void
__iomem *tap)
  tap_base = tap;

  /* XXX What is this intended to do? */
-if (cpu_is_omap34xx())
+if (soc_is_omap34xx())
  tap_prod_id = 0x0210;
  else
  tap_prod_id = 0x0208;
@@ -715,11 +715,11 @@ static const char * const omap_types[] = {

  static const char * __init omap_get_family(void)
  {
-if (cpu_is_omap24xx())
+if (soc_is_omap24xx())
  return kasprintf(GFP_KERNEL, "OMAP2");
-else if (cpu_is_omap34xx())
+else if (soc_is_omap34xx())
  return kasprintf(GFP_KERNEL, "OMAP3");
-else if (cpu_is_omap44xx())
+else if (soc_is_omap44xx())
  return kasprintf(GFP_KERNEL, "OMAP4");
  else if (soc_is_omap54xx())
  return kasprintf(GFP_KERNEL, "OMAP5");
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index f97654d..bb824ae 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -148,13 +148,13 @@ static inline int soc_is_omap(void)
  /*
   * Macros to group OMAP into cpu classes.
   * These can be used in most places.
- * cpu_is_omap24xx():True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
- * cpu_is_omap242x():True for OMAP2420, OMAP2422, OMAP2423
- * cpu_is_omap243x():

Re: [PATCH] soc: mediatek: add scpsys support active_wakeup

2015-08-23 Thread Eddie Huang
On Thu, 2015-07-23 at 14:00 +0800, Eddie Huang wrote:
> Register gpd_dev_ops.active_wakeup function to support keep power
> during suspend state. And add flag to each power domain to
> decide whether keep power during suspend or not.
> 
> Signed-off-by: Chunfeng Yun 
> Signed-off-by: Eddie Huang 
> ---
>  drivers/soc/mediatek/mtk-scpsys.c | 28 
>  1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/soc/mediatek/mtk-scpsys.c 
> b/drivers/soc/mediatek/mtk-scpsys.c
> index 43a79ed..fc78b70 100644
> --- a/drivers/soc/mediatek/mtk-scpsys.c
> +++ b/drivers/soc/mediatek/mtk-scpsys.c
> @@ -67,6 +67,7 @@ struct scp_domain_data {
> u32 sram_pdn_ack_bits;
> u32 bus_prot_mask;
> enum clk_id clk_id;
> +   bool active_wakeup;
>  };
> 
>  static const struct scp_domain_data scp_domain_data[] __initconst = {
> @@ -77,6 +78,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(12, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_VENC] = {
> .name = "venc",
> @@ -85,6 +87,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(15, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_ISP] = {
> .name = "isp",
> @@ -93,6 +96,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(13, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_MM] = {
> .name = "mm",
> @@ -101,6 +105,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(12, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> .bus_prot_mask = MT8173_TOP_AXI_PROT_EN_MM_M0 |
> MT8173_TOP_AXI_PROT_EN_MM_M1,
> },
> @@ -111,6 +116,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(15, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_AUDIO] = {
> .name = "audio",
> @@ -119,6 +125,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(15, 12),
> .clk_id = MT8173_CLK_NONE,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_USB] = {
> .name = "usb",
> @@ -127,6 +134,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(15, 12),
> .clk_id = MT8173_CLK_NONE,
> +   .active_wakeup = true,
> },
> [MT8173_POWER_DOMAIN_MFG_ASYNC] = {
> .name = "mfg_async",
> @@ -135,6 +143,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = 0,
> .clk_id = MT8173_CLK_MFG,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_MFG_2D] = {
> .name = "mfg_2d",
> @@ -143,6 +152,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(13, 12),
> .clk_id = MT8173_CLK_NONE,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_MFG] = {
> .name = "mfg",
> @@ -151,6 +161,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(13, 8),
> .sram_pdn_ack_bits = GENMASK(21, 16),
> .clk_id = MT8173_CLK_NONE,
> +   .active_wakeup = false,
> .bus_prot_mask = MT8173_TOP_AXI_PROT_EN_MFG_S |
> MT8173_TOP_AXI_PROT_EN_MFG_M0 |
> MT8173_TOP_AXI_PROT_EN_MFG_M1 |
> @@ -171,6 +182,7 @@ struct scp_domain {
> u32 sram_pdn_bits;
> u32 sram_pdn_ack_bits;
> u32 bus_prot_mask;
> +   bool active_wakeup;
>  };
> 
>  struct scp {
> @@ -370,6 +382,20 @@ out:
> return ret;
>  }
> 

Re: two RCU torture bugs

2015-08-23 Thread Paul E. McKenney
On Sun, Aug 23, 2015 at 10:07:49PM -0700, David Miller wrote:
> 
> 1) Doc bug, documentation mentions torture_type such as "rcu_sync",
>but those don't seem to exist.
> 
> 2) If you specify an unrecognized type, the module cannot be unloaded.
>Amusingly it says that it cannot unload because the unrecognized
>torture test type you requested is "running" :-)

Clearly Iftekhar was mutating the wrong code.  ;-)

And clearly I need to occasionally test failure cases.  There is code that
is supposed to unwind upon failure, but it has apparently bitrotted...

Thanx, Paul

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


[PATCH 05/17] staging: sm750fb: ddk750_hwi2c: rename CamelCase static functions

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index e6d31db..0677ff0 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -60,7 +60,7 @@ void sm750_hw_i2c_close(void)
 }
 
 
-static long hwI2CWaitTXDone(void)
+static long sm750_hw_i2c_wait_tx_done(void)
 {
unsigned int timeout;
 
@@ -90,7 +90,7 @@ static long hwI2CWaitTXDone(void)
  *  Return Value:
  *  Total number of bytes those are actually written.
  */
-static unsigned int hwI2CWriteData(
+static unsigned int sm750_hw_i2c_write_data(
unsigned char deviceAddress,
unsigned int length,
unsigned char *pBuffer
@@ -125,7 +125,7 @@ static unsigned int hwI2CWriteData(
POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
 
/* Wait until the transfer is completed. */
-   if (hwI2CWaitTXDone() != 0)
+   if (sm750_hw_i2c_wait_tx_done() != 0)
break;
 
/* Substract length */
@@ -156,7 +156,7 @@ static unsigned int hwI2CWriteData(
  *  Return Value:
  *  Total number of actual bytes read from the slave device
  */
-static unsigned int hwI2CReadData(
+static unsigned int sm750_hw_i2c_read_data(
unsigned char deviceAddress,
unsigned int length,
unsigned char *pBuffer
@@ -187,7 +187,7 @@ static unsigned int hwI2CReadData(
POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
 
/* Wait until transaction done. */
-   if (hwI2CWaitTXDone() != 0)
+   if (sm750_hw_i2c_wait_tx_done() != 0)
break;
 
/* Save the data to the given buffer */
@@ -226,8 +226,8 @@ unsigned char sm750_hw_i2c_read_reg(
 {
unsigned char value = (0xFF);
 
-   if (hwI2CWriteData(deviceAddress, 1, ) == 1)
-   hwI2CReadData(deviceAddress, 1, );
+   if (sm750_hw_i2c_write_data(deviceAddress, 1, ) == 1)
+   sm750_hw_i2c_read_data(deviceAddress, 1, );
 
return value;
 }
@@ -259,7 +259,7 @@ int sm750_hw_i2c_write_reg(
 
value[0] = registerIndex;
value[1] = data;
-   if (hwI2CWriteData(deviceAddress, 2, value) == 2)
+   if (sm750_hw_i2c_write_data(deviceAddress, 2, value) == 2)
return 0;
 
return (-1);
-- 
2.1.0

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


[PATCH 06/17] staging: sm750fb: rename swI2CInit to sm750_sw_i2c_init

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_sii164.c | 2 +-
 drivers/staging/sm750fb/ddk750_swi2c.c  | 2 +-
 drivers/staging/sm750fb/ddk750_swi2c.h  | 2 +-
 drivers/staging/sm750fb/sm750_hw.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index 3d129aa..241b77b 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -132,7 +132,7 @@ long sii164InitChip(
/* Use fast mode. */
sm750_hw_i2c_init(1);
 #else
-   swI2CInit(DEFAULT_I2C_SCL, DEFAULT_I2C_SDA);
+   sm750_sw_i2c_init(DEFAULT_I2C_SCL, DEFAULT_I2C_SDA);
 #endif
 
/* Check if SII164 Chip exists */
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index 5133bcc..ecfd300 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -386,7 +386,7 @@ static long swI2CInit_SM750LE(unsigned char i2cClkGPIO,
  *  -1   - Fail to initialize the i2c
  *   0   - Success
  */
-long swI2CInit(
+long sm750_sw_i2c_init(
unsigned char i2cClkGPIO,
unsigned char i2cDataGPIO
 )
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h 
b/drivers/staging/sm750fb/ddk750_swi2c.h
index 4af2b7a..1e18b80 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -28,7 +28,7 @@
  *  -1   - Fail to initialize the i2c
  *   0   - Success
  */
-long swI2CInit(
+long sm750_sw_i2c_init(
unsigned char i2cClkGPIO,
unsigned char i2cDataGPIO
 );
diff --git a/drivers/staging/sm750fb/sm750_hw.c 
b/drivers/staging/sm750fb/sm750_hw.c
index 7317ba9..522736e 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -169,7 +169,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct 
pci_dev *pdev)
/* Set up GPIO for software I2C to program DVI chip in the
   Xilinx SP605 board, in order to have video signal.
 */
-   swI2CInit(0, 1);
+   sm750_sw_i2c_init(0, 1);
 
 
/* Customer may NOT use CH7301 DVI chip, which has to be
-- 
2.1.0

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


[PATCH 01/17] staging: sm750fb: rename hwI2CInit to sm750_hw_i2c_init

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c  | 2 +-
 drivers/staging/sm750fb/ddk750_hwi2c.h  | 2 +-
 drivers/staging/sm750fb/ddk750_sii164.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 5ddac43..7eb122e 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -9,7 +9,7 @@
 #define HWI2C_WAIT_TIMEOUT  0xF
 
 
-int hwI2CInit(
+int sm750_hw_i2c_init(
 unsigned char busSpeedMode
 )
 {
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 0b830ba6..11381eb 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -2,7 +2,7 @@
 #define DDK750_HWI2C_H__
 
 /* hwi2c functions */
-int hwI2CInit(unsigned char busSpeedMode);
+int sm750_hw_i2c_init(unsigned char busSpeedMode);
 void hwI2CClose(void);
 
 unsigned char hwI2CReadReg(unsigned char deviceAddress, unsigned char 
registerIndex);
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index 0bdf3db..1803b74 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -130,7 +130,7 @@ long sii164InitChip(
/* Initialize the i2c bus */
 #ifdef USE_HW_I2C
/* Use fast mode. */
-   hwI2CInit(1);
+   sm750_hw_i2c_init(1);
 #else
swI2CInit(DEFAULT_I2C_SCL, DEFAULT_I2C_SDA);
 #endif
-- 
2.1.0

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


[PATCH 03/17] staging: sm750fb: rename hwI2CReadReg to sm750_hw_i2c_read_reg

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c  | 2 +-
 drivers/staging/sm750fb/ddk750_hwi2c.h  | 2 +-
 drivers/staging/sm750fb/ddk750_sii164.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 8aa83ab..03da0a7 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -219,7 +219,7 @@ static unsigned int hwI2CReadData(
  *  Return Value:
  *  Register value
  */
-unsigned char hwI2CReadReg(
+unsigned char sm750_hw_i2c_read_reg(
unsigned char deviceAddress,
unsigned char registerIndex
 )
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index a8d23d2..70a6007 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -5,6 +5,6 @@
 int sm750_hw_i2c_init(unsigned char busSpeedMode);
 void sm750_hw_i2c_close(void);
 
-unsigned char hwI2CReadReg(unsigned char deviceAddress, unsigned char 
registerIndex);
+unsigned char sm750_hw_i2c_read_reg(unsigned char deviceAddress, unsigned char 
registerIndex);
 int hwI2CWriteReg(unsigned char deviceAddress, unsigned char registerIndex, 
unsigned char data);
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index 1803b74..20dbc05 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -12,7 +12,7 @@
 
 #ifdef USE_HW_I2C
 #define i2cWriteReg hwI2CWriteReg
-#define i2cReadReg  hwI2CReadReg
+#define i2cReadReg  sm750_hw_i2c_read_reg
 #else
 #define i2cWriteReg swI2CWriteReg
 #define i2cReadReg  swI2CReadReg
-- 
2.1.0

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


[PATCH 07/17] staging: sm750fb: rename swI2CReadReg to sm750_sw_i2c_read_reg

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 2 +-
 drivers/staging/sm750fb/ddk750_swi2c.h | 2 +-
 drivers/staging/sm750fb/sm750_hw.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index ecfd300..765edd6 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -443,7 +443,7 @@ long sm750_sw_i2c_init(
  *  Return Value:
  *  Register value
  */
-unsigned char swI2CReadReg(
+unsigned char sm750_sw_i2c_read_reg(
unsigned char deviceAddress,
unsigned char registerIndex
 )
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h 
b/drivers/staging/sm750fb/ddk750_swi2c.h
index 1e18b80..2e87a63 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -44,7 +44,7 @@ long sm750_sw_i2c_init(
  *  Return Value:
  *  Register value
  */
-unsigned char swI2CReadReg(
+unsigned char sm750_sw_i2c_read_reg(
unsigned char deviceAddress,
unsigned char registerIndex
 );
diff --git a/drivers/staging/sm750fb/sm750_hw.c 
b/drivers/staging/sm750fb/sm750_hw.c
index 522736e..b8b5e00 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -175,7 +175,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct 
pci_dev *pdev)
/* Customer may NOT use CH7301 DVI chip, which has to be
   initialized differently.
*/
-   if (swI2CReadReg(0xec, 0x4a) == 0x95) {
+   if (sm750_sw_i2c_read_reg(0xec, 0x4a) == 0x95) {
/* The following register values for CH7301 are from
   Chrontel app note and our experiment.
*/
-- 
2.1.0

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


[PATCH 12/17] staging: sm750fb: hw_i2c_{read,write}: rename CamelCase variables

2015-08-23 Thread Mike Rapoport
Rename longCamelCase variables deviceAddress and registerIndex to
shorter addr and reg

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 16 
 drivers/staging/sm750fb/ddk750_hwi2c.h |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index c4c2dad..616c42f 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -220,14 +220,14 @@ static unsigned int sm750_hw_i2c_read_data(
  *  Register value
  */
 unsigned char sm750_hw_i2c_read_reg(
-   unsigned char deviceAddress,
-   unsigned char registerIndex
+   unsigned char addr,
+   unsigned char reg
 )
 {
unsigned char value = (0xFF);
 
-   if (sm750_hw_i2c_write_data(deviceAddress, 1, ) == 1)
-   sm750_hw_i2c_read_data(deviceAddress, 1, );
+   if (sm750_hw_i2c_write_data(addr, 1, ) == 1)
+   sm750_hw_i2c_read_data(addr, 1, );
 
return value;
 }
@@ -250,16 +250,16 @@ unsigned char sm750_hw_i2c_read_reg(
  * -1   - Fail
  */
 int sm750_hw_i2c_write_reg(
-   unsigned char deviceAddress,
-   unsigned char registerIndex,
+   unsigned char addr,
+   unsigned char reg,
unsigned char data
 )
 {
unsigned char value[2];
 
-   value[0] = registerIndex;
+   value[0] = reg;
value[1] = data;
-   if (sm750_hw_i2c_write_data(deviceAddress, 2, value) == 2)
+   if (sm750_hw_i2c_write_data(addr, 2, value) == 2)
return 0;
 
return (-1);
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 5872f9c..2827865 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -5,6 +5,6 @@
 int sm750_hw_i2c_init(unsigned char bus_speed_mode);
 void sm750_hw_i2c_close(void);
 
-unsigned char sm750_hw_i2c_read_reg(unsigned char deviceAddress, unsigned char 
registerIndex);
-int sm750_hw_i2c_write_reg(unsigned char deviceAddress, unsigned char 
registerIndex, unsigned char data);
+unsigned char sm750_hw_i2c_read_reg(unsigned char addr, unsigned char reg);
+int sm750_hw_i2c_write_reg(unsigned char addr, unsigned char reg, unsigned 
char data);
 #endif
-- 
2.1.0

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


[PATCH 10/17] staging: sm750fb: ddk750_swi2c: rename CamelCase static functions

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 116 -
 1 file changed, 58 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index 6a10ae3..b3f64c4 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -82,7 +82,7 @@ static unsigned long g_i2cDataGPIODataDirReg = 
GPIO_DATA_DIRECTION;
 /*
  *  This function puts a delay between command
  */
-static void swI2CWait(void)
+static void sm750_sw_i2c_wait(void)
 {
/* find a bug:
 * peekIO method works well before suspend/resume
@@ -119,7 +119,7 @@ static void swI2CWait(void)
  *  signal because the i2c will fail when other device try to drive the
  *  signal due to SM50x will drive the signal to always high.
  */
-static void swI2CSCL(unsigned char value)
+static void sm750_sw_i2c_scl(unsigned char value)
 {
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
@@ -153,7 +153,7 @@ static void swI2CSCL(unsigned char value)
  *  signal because the i2c will fail when other device try to drive the
  *  signal due to SM50x will drive the signal to always high.
  */
-static void swI2CSDA(unsigned char value)
+static void sm750_sw_i2c_sda(unsigned char value)
 {
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
@@ -181,7 +181,7 @@ static void swI2CSDA(unsigned char value)
  *  Return Value:
  *  The SDA data bit sent by the Slave
  */
-static unsigned char swI2CReadSDA(void)
+static unsigned char sm750_sw_i2c_read_sda(void)
 {
unsigned long ulGPIODirection;
unsigned long ulGPIOData;
@@ -204,7 +204,7 @@ static unsigned char swI2CReadSDA(void)
 /*
  *  This function sends ACK signal
  */
-static void swI2CAck(void)
+static void sm750_sw_i2c_ack(void)
 {
return;  /* Single byte read is ok without it. */
 }
@@ -212,23 +212,23 @@ static void swI2CAck(void)
 /*
  *  This function sends the start command to the slave device
  */
-static void swI2CStart(void)
+static void sm750_sw_i2c_start(void)
 {
/* Start I2C */
-   swI2CSDA(1);
-   swI2CSCL(1);
-   swI2CSDA(0);
+   sm750_sw_i2c_sda(1);
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_sda(0);
 }
 
 /*
  *  This function sends the stop command to the slave device
  */
-static void swI2CStop(void)
+static void sm750_sw_i2c_stop(void)
 {
/* Stop the I2C */
-   swI2CSCL(1);
-   swI2CSDA(0);
-   swI2CSDA(1);
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_sda(0);
+   sm750_sw_i2c_sda(1);
 }
 
 /*
@@ -241,7 +241,7 @@ static void swI2CStop(void)
  *   0   - Success
  *  -1   - Fail to write byte
  */
-static long swI2CWriteByte(unsigned char data)
+static long sm750_sw_i2c_write_byte(unsigned char data)
 {
unsigned char value = data;
int i;
@@ -249,47 +249,47 @@ static long swI2CWriteByte(unsigned char data)
/* Sending the data bit by bit */
for (i = 0; i < 8; i++) {
/* Set SCL to low */
-   swI2CSCL(0);
+   sm750_sw_i2c_scl(0);
 
/* Send data bit */
if ((value & 0x80) != 0)
-   swI2CSDA(1);
+   sm750_sw_i2c_sda(1);
else
-   swI2CSDA(0);
+   sm750_sw_i2c_sda(0);
 
-   swI2CWait();
+   sm750_sw_i2c_wait();
 
/* Toggle clk line to one */
-   swI2CSCL(1);
-   swI2CWait();
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_wait();
 
/* Shift byte to be sent */
value = value << 1;
}
 
/* Set the SCL Low and SDA High (prepare to get input) */
-   swI2CSCL(0);
-   swI2CSDA(1);
+   sm750_sw_i2c_scl(0);
+   sm750_sw_i2c_sda(1);
 
/* Set the SCL High for ack */
-   swI2CWait();
-   swI2CSCL(1);
-   swI2CWait();
+   sm750_sw_i2c_wait();
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_wait();
 
/* Read SDA, until SDA==0 */
for (i = 0; i < 0xff; i++) {
-   if (!swI2CReadSDA())
+   if (!sm750_sw_i2c_read_sda())
break;
 
-   swI2CSCL(0);
-   swI2CWait();
-   swI2CSCL(1);
-   swI2CWait();
+   sm750_sw_i2c_scl(0);
+   sm750_sw_i2c_wait();
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_wait();
}
 
/* Set the SCL Low and SDA High */
-   swI2CSCL(0);
-   swI2CSDA(1);
+   sm750_sw_i2c_scl(0);
+   sm750_sw_i2c_sda(1);
 
if (i < 0xff)
return 0;
@@ -307,31 +307,31 @@ static long swI2CWriteByte(unsigned char data)
  *  Return Value:
  *  One byte data read from the Slave device
  */
-static unsigned char swI2CReadByte(unsigned char ack)
+static 

[PATCH 13/17] staging: sm750fb: ddk750_hwi2c: reduce amount of CamelCase

2015-08-23 Thread Mike Rapoport
Rename camel case variables deviceAddress, pBuffer and totalBytes to
addr, buf and total_bytes respectively in sm750_hw_i2c_{read,write}_data
functions.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 36 +-
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 616c42f..fa1a4d4 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -82,25 +82,25 @@ static long sm750_hw_i2c_wait_tx_done(void)
  *  This function writes data to the i2c slave device registers.
  *
  *  Parameters:
- *  deviceAddress   - i2c Slave device address
+ *  addr- i2c Slave device address
  *  length  - Total number of bytes to be written to the device
- *  pBuffer - The buffer that contains the data to be written to 
the
+ *  buf - The buffer that contains the data to be written to 
the
  * i2c device.
  *
  *  Return Value:
  *  Total number of bytes those are actually written.
  */
 static unsigned int sm750_hw_i2c_write_data(
-   unsigned char deviceAddress,
+   unsigned char addr,
unsigned int length,
-   unsigned char *pBuffer
+   unsigned char *buf
 )
 {
unsigned char count, i;
-   unsigned int totalBytes = 0;
+   unsigned int total_bytes = 0;
 
/* Set the Device Address */
-   POKE32(I2C_SLAVE_ADDRESS, deviceAddress & ~0x01);
+   POKE32(I2C_SLAVE_ADDRESS, addr & ~0x01);
 
/* Write data.
 * Note:
@@ -119,7 +119,7 @@ static unsigned int sm750_hw_i2c_write_data(
 
/* Move the data to the I2C data register */
for (i = 0; i <= count; i++)
-   POKE32(I2C_DATA0 + i, *pBuffer++);
+   POKE32(I2C_DATA0 + i, *buf++);
 
/* Start the I2C */
POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
@@ -132,11 +132,11 @@ static unsigned int sm750_hw_i2c_write_data(
length -= (count + 1);
 
/* Total byte written */
-   totalBytes += (count + 1);
+   total_bytes += (count + 1);
 
} while (length > 0);
 
-   return totalBytes;
+   return total_bytes;
 }
 
 
@@ -147,9 +147,9 @@ static unsigned int sm750_hw_i2c_write_data(
  *  in the given buffer
  *
  *  Parameters:
- *  deviceAddress   - i2c Slave device address
+ *  addr- i2c Slave device address
  *  length  - Total number of bytes to be read
- *  pBuffer - Pointer to a buffer to be filled with the data read
+ *  buf - Pointer to a buffer to be filled with the data read
  * from the slave device. It has to be the same size as the
  * length to make sure that it can keep all the data read.
  *
@@ -157,16 +157,16 @@ static unsigned int sm750_hw_i2c_write_data(
  *  Total number of actual bytes read from the slave device
  */
 static unsigned int sm750_hw_i2c_read_data(
-   unsigned char deviceAddress,
+   unsigned char addr,
unsigned int length,
-   unsigned char *pBuffer
+   unsigned char *buf
 )
 {
unsigned char count, i;
-   unsigned int totalBytes = 0;
+   unsigned int total_bytes = 0;
 
/* Set the Device Address */
-   POKE32(I2C_SLAVE_ADDRESS, deviceAddress | 0x01);
+   POKE32(I2C_SLAVE_ADDRESS, addr | 0x01);
 
/* Read data and save them to the buffer.
 * Note:
@@ -192,17 +192,17 @@ static unsigned int sm750_hw_i2c_read_data(
 
/* Save the data to the given buffer */
for (i = 0; i <= count; i++)
-   *pBuffer++ = PEEK32(I2C_DATA0 + i);
+   *buf++ = PEEK32(I2C_DATA0 + i);
 
/* Substract length by 16 */
length -= (count + 1);
 
/* Number of bytes read. */
-   totalBytes += (count + 1);
+   total_bytes += (count + 1);
 
} while (length > 0);
 
-   return totalBytes;
+   return total_bytes;
 }
 
 
-- 
2.1.0

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


[PATCH 15/17] staging: sm750fb: ddk750_swi2c: further reduce CamelCase

2015-08-23 Thread Mike Rapoport
Rename remaining CamelCase variables

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 122 -
 drivers/staging/sm750fb/ddk750_swi2c.h |  20 +++---
 2 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index 94f4c46..ed14277 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -98,11 +98,11 @@ static void sm750_sw_i2c_wait(void)
*/
while (peekIO(0x3ce, 0x61) & 0x10);
 #else
-   int i, Temp;
+   int i, tmp;
 
for (i = 0; i < 600; i++) {
-   Temp = i;
-   Temp += i;
+   tmp = i;
+   tmp += i;
}
 #endif
 }
@@ -121,23 +121,23 @@ static void sm750_sw_i2c_wait(void)
  */
 static void sm750_sw_i2c_scl(unsigned char value)
 {
-   unsigned long ulGPIOData;
-   unsigned long ulGPIODirection;
+   unsigned long gpio_data;
+   unsigned long gpio_dir;
 
-   ulGPIODirection = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
+   gpio_dir = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
if (value) {/* High */
/* Set direction as input. This will automatically pull the 
signal up. */
-   ulGPIODirection &= ~(1 << sw_i2c_clk_gpio);
-   POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir &= ~(1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
} else {/* Low */
/* Set the signal down */
-   ulGPIOData = PEEK32(sw_i2c_clk_gpio_data_reg);
-   ulGPIOData &= ~(1 << sw_i2c_clk_gpio);
-   POKE32(sw_i2c_clk_gpio_data_reg, ulGPIOData);
+   gpio_data = PEEK32(sw_i2c_clk_gpio_data_reg);
+   gpio_data &= ~(1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_reg, gpio_data);
 
/* Set direction as output */
-   ulGPIODirection |= (1 << sw_i2c_clk_gpio);
-   POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir |= (1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
}
 }
 
@@ -155,23 +155,23 @@ static void sm750_sw_i2c_scl(unsigned char value)
  */
 static void sm750_sw_i2c_sda(unsigned char value)
 {
-   unsigned long ulGPIOData;
-   unsigned long ulGPIODirection;
+   unsigned long gpio_data;
+   unsigned long gpio_dir;
 
-   ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
+   gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
if (value) {/* High */
/* Set direction as input. This will automatically pull the 
signal up. */
-   ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
-   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
} else {/* Low */
/* Set the signal down */
-   ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
-   ulGPIOData &= ~(1 << sw_i2c_data_gpio);
-   POKE32(sw_i2c_data_gpio_data_reg, ulGPIOData);
+   gpio_data = PEEK32(sw_i2c_data_gpio_data_reg);
+   gpio_data &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_reg, gpio_data);
 
/* Set direction as output */
-   ulGPIODirection |= (1 << sw_i2c_data_gpio);
-   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir |= (1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
}
 }
 
@@ -183,19 +183,19 @@ static void sm750_sw_i2c_sda(unsigned char value)
  */
 static unsigned char sm750_sw_i2c_read_sda(void)
 {
-   unsigned long ulGPIODirection;
-   unsigned long ulGPIOData;
+   unsigned long gpio_dir;
+   unsigned long gpio_data;
 
/* Make sure that the direction is input (High) */
-   ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
-   if ((ulGPIODirection & (1 << sw_i2c_data_gpio)) != (~(1 << 
sw_i2c_data_gpio))) {
-   ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
-   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
+   if ((gpio_dir & (1 << sw_i2c_data_gpio)) != (~(1 << sw_i2c_data_gpio))) 
{
+   gpio_dir &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
}
 
/* Now read the SDA line */
-   ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
-   if (ulGPIOData & (1 << sw_i2c_data_gpio))
+   gpio_data = PEEK32(sw_i2c_data_gpio_data_reg);
+   if (gpio_data & (1 << sw_i2c_data_gpio))
return 1;
else
 

[PATCH 08/17] staging: sm750fb: rename swI2CWriteReg to sm750_sw_i2c_write_reg

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 2 +-
 drivers/staging/sm750fb/ddk750_swi2c.h | 2 +-
 drivers/staging/sm750fb/sm750_hw.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index 765edd6..e3f60eb 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -483,7 +483,7 @@ unsigned char sm750_sw_i2c_read_reg(
  *  0   - Success
  * -1   - Fail
  */
-long swI2CWriteReg(
+long sm750_sw_i2c_write_reg(
unsigned char deviceAddress,
unsigned char registerIndex,
unsigned char data
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h 
b/drivers/staging/sm750fb/ddk750_swi2c.h
index 2e87a63..37335dd 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -62,7 +62,7 @@ unsigned char sm750_sw_i2c_read_reg(
  *  0   - Success
  * -1   - Fail
  */
-long swI2CWriteReg(
+long sm750_sw_i2c_write_reg(
unsigned char deviceAddress,
unsigned char registerIndex,
unsigned char data
diff --git a/drivers/staging/sm750fb/sm750_hw.c 
b/drivers/staging/sm750fb/sm750_hw.c
index b8b5e00..de30429 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -180,9 +180,9 @@ int hw_sm750_inithw(struct lynx_share *share, struct 
pci_dev *pdev)
   Chrontel app note and our experiment.
*/
pr_info("yes,CH7301 DVI chip found\n");
-   swI2CWriteReg(0xec, 0x1d, 0x16);
-   swI2CWriteReg(0xec, 0x21, 0x9);
-   swI2CWriteReg(0xec, 0x49, 0xC0);
+   sm750_sw_i2c_write_reg(0xec, 0x1d, 0x16);
+   sm750_sw_i2c_write_reg(0xec, 0x21, 0x9);
+   sm750_sw_i2c_write_reg(0xec, 0x49, 0xC0);
pr_info("okay,CH7301 DVI chip setup done\n");
}
}
-- 
2.1.0

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


[PATCH 16/17] staging: sm750fb: ddk750_*i2c: remove multiple blank lines

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 16 
 drivers/staging/sm750fb/ddk750_swi2c.c |  1 -
 2 files changed, 17 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index fa1a4d4..a07aca4 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -8,7 +8,6 @@
 #define MAX_HWI2C_FIFO  16
 #define HWI2C_WAIT_TIMEOUT  0xF
 
-
 int sm750_hw_i2c_init(
 unsigned char bus_speed_mode
 )
@@ -39,7 +38,6 @@ unsigned char bus_speed_mode
return 0;
 }
 
-
 void sm750_hw_i2c_close(void)
 {
unsigned int value;
@@ -59,7 +57,6 @@ void sm750_hw_i2c_close(void)
POKE32(GPIO_MUX, value);
 }
 
-
 static long sm750_hw_i2c_wait_tx_done(void)
 {
unsigned int timeout;
@@ -76,8 +73,6 @@ static long sm750_hw_i2c_wait_tx_done(void)
return 0;
 }
 
-
-
 /*
  *  This function writes data to the i2c slave device registers.
  *
@@ -139,9 +134,6 @@ static unsigned int sm750_hw_i2c_write_data(
return total_bytes;
 }
 
-
-
-
 /*
  *  This function reads data from the slave device and stores them
  *  in the given buffer
@@ -205,9 +197,6 @@ static unsigned int sm750_hw_i2c_read_data(
return total_bytes;
 }
 
-
-
-
 /*
  *  This function reads the slave device's register
  *
@@ -232,10 +221,6 @@ unsigned char sm750_hw_i2c_read_reg(
return value;
 }
 
-
-
-
-
 /*
  *  This function writes a value to the slave device's register
  *
@@ -265,5 +250,4 @@ int sm750_hw_i2c_write_reg(
return (-1);
 }
 
-
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index ed14277..d5f01d3 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -15,7 +15,6 @@
 #include "ddk750_swi2c.h"
 #include "ddk750_power.h"
 
-
 /***
  * I2C Software Master Driver:
  * ===
-- 
2.1.0

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


[PATCH 14/17] staging: sm750fb: ddk750_swi2c: rename CamelCase static variables

2015-08-23 Thread Mike Rapoport
Rename static variables defining I2C GPIO pins and their control registers from
CamelCase.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 96 +-
 1 file changed, 48 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index b3f64c4..94f4c46 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -55,8 +55,8 @@
  **/
 
 /* GPIO pins used for this I2C. It ranges from 0 to 63. */
-static unsigned char g_i2cClockGPIO = DEFAULT_I2C_SCL;
-static unsigned char g_i2cDataGPIO = DEFAULT_I2C_SDA;
+static unsigned char sw_i2c_clk_gpio = DEFAULT_I2C_SCL;
+static unsigned char sw_i2c_data_gpio = DEFAULT_I2C_SDA;
 
 /*
  *  Below is the variable declaration for the GPIO pin register usage
@@ -70,14 +70,14 @@ static unsigned char g_i2cDataGPIO = DEFAULT_I2C_SDA;
  */
 
 /* i2c Clock GPIO Register usage */
-static unsigned long g_i2cClkGPIOMuxReg = GPIO_MUX;
-static unsigned long g_i2cClkGPIODataReg = GPIO_DATA;
-static unsigned long g_i2cClkGPIODataDirReg = GPIO_DATA_DIRECTION;
+static unsigned long sw_i2c_clk_gpio_mux_reg = GPIO_MUX;
+static unsigned long sw_i2c_clk_gpio_data_reg = GPIO_DATA;
+static unsigned long sw_i2c_clk_gpio_data_dir_reg = GPIO_DATA_DIRECTION;
 
 /* i2c Data GPIO Register usage */
-static unsigned long g_i2cDataGPIOMuxReg = GPIO_MUX;
-static unsigned long g_i2cDataGPIODataReg = GPIO_DATA;
-static unsigned long g_i2cDataGPIODataDirReg = GPIO_DATA_DIRECTION;
+static unsigned long sw_i2c_data_gpio_mux_reg = GPIO_MUX;
+static unsigned long sw_i2c_data_gpio_data_reg = GPIO_DATA;
+static unsigned long sw_i2c_data_gpio_data_dir_reg = GPIO_DATA_DIRECTION;
 
 /*
  *  This function puts a delay between command
@@ -124,20 +124,20 @@ static void sm750_sw_i2c_scl(unsigned char value)
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
 
-   ulGPIODirection = PEEK32(g_i2cClkGPIODataDirReg);
+   ulGPIODirection = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
if (value) {/* High */
/* Set direction as input. This will automatically pull the 
signal up. */
-   ulGPIODirection &= ~(1 << g_i2cClockGPIO);
-   POKE32(g_i2cClkGPIODataDirReg, ulGPIODirection);
+   ulGPIODirection &= ~(1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
} else {/* Low */
/* Set the signal down */
-   ulGPIOData = PEEK32(g_i2cClkGPIODataReg);
-   ulGPIOData &= ~(1 << g_i2cClockGPIO);
-   POKE32(g_i2cClkGPIODataReg, ulGPIOData);
+   ulGPIOData = PEEK32(sw_i2c_clk_gpio_data_reg);
+   ulGPIOData &= ~(1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_reg, ulGPIOData);
 
/* Set direction as output */
-   ulGPIODirection |= (1 << g_i2cClockGPIO);
-   POKE32(g_i2cClkGPIODataDirReg, ulGPIODirection);
+   ulGPIODirection |= (1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
}
 }
 
@@ -158,20 +158,20 @@ static void sm750_sw_i2c_sda(unsigned char value)
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
 
-   ulGPIODirection = PEEK32(g_i2cDataGPIODataDirReg);
+   ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
if (value) {/* High */
/* Set direction as input. This will automatically pull the 
signal up. */
-   ulGPIODirection &= ~(1 << g_i2cDataGPIO);
-   POKE32(g_i2cDataGPIODataDirReg, ulGPIODirection);
+   ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
} else {/* Low */
/* Set the signal down */
-   ulGPIOData = PEEK32(g_i2cDataGPIODataReg);
-   ulGPIOData &= ~(1 << g_i2cDataGPIO);
-   POKE32(g_i2cDataGPIODataReg, ulGPIOData);
+   ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
+   ulGPIOData &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_reg, ulGPIOData);
 
/* Set direction as output */
-   ulGPIODirection |= (1 << g_i2cDataGPIO);
-   POKE32(g_i2cDataGPIODataDirReg, ulGPIODirection);
+   ulGPIODirection |= (1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
}
 }
 
@@ -187,15 +187,15 @@ static unsigned char sm750_sw_i2c_read_sda(void)
unsigned long ulGPIOData;
 
/* Make sure that the direction is input (High) */
-   ulGPIODirection = PEEK32(g_i2cDataGPIODataDirReg);
-   if ((ulGPIODirection & (1 << g_i2cDataGPIO)) != (~(1 << 
g_i2cDataGPIO))) {
-   

[PATCH 17/17] staging: sm750fb: ddk750_*i2c: shorten lines to under 80 characters

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 19 ++-
 drivers/staging/sm750fb/ddk750_hwi2c.h |  3 ++-
 drivers/staging/sm750fb/ddk750_swi2c.c | 22 --
 3 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index a07aca4..949e03a 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -63,7 +63,8 @@ static long sm750_hw_i2c_wait_tx_done(void)
 
/* Wait until the transfer is completed. */
timeout = HWI2C_WAIT_TIMEOUT;
-   while ((FIELD_GET(PEEK32(I2C_STATUS), I2C_STATUS, TX) != 
I2C_STATUS_TX_COMPLETED) &&
+   while ((FIELD_GET(PEEK32(I2C_STATUS),
+ I2C_STATUS, TX) != I2C_STATUS_TX_COMPLETED) &&
   (timeout != 0))
timeout--;
 
@@ -102,7 +103,10 @@ static unsigned int sm750_hw_i2c_write_data(
 *  Only 16 byte can be accessed per i2c start instruction.
 */
do {
-   /* Reset I2C by writing 0 to I2C_RESET register to clear the 
previous status. */
+   /*
+* Reset I2C by writing 0 to I2C_RESET register to
+* clear the previous status.
+*/
POKE32(I2C_RESET, 0);
 
/* Set the number of bytes to be written */
@@ -117,7 +121,8 @@ static unsigned int sm750_hw_i2c_write_data(
POKE32(I2C_DATA0 + i, *buf++);
 
/* Start the I2C */
-   POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
+   POKE32(I2C_CTRL,
+  FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, START));
 
/* Wait until the transfer is completed. */
if (sm750_hw_i2c_wait_tx_done() != 0)
@@ -165,7 +170,10 @@ static unsigned int sm750_hw_i2c_read_data(
 *  Only 16 byte can be accessed per i2c start instruction.
 */
do {
-   /* Reset I2C by writing 0 to I2C_RESET register to clear all 
the status. */
+   /*
+* Reset I2C by writing 0 to I2C_RESET register to
+* clear all the status.
+*/
POKE32(I2C_RESET, 0);
 
/* Set the number of bytes to be read */
@@ -176,7 +184,8 @@ static unsigned int sm750_hw_i2c_read_data(
POKE32(I2C_BYTE_COUNT, count);
 
/* Start the I2C */
-   POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
+   POKE32(I2C_CTRL,
+  FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, START));
 
/* Wait until transaction done. */
if (sm750_hw_i2c_wait_tx_done() != 0)
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 2827865..46e22dc 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -6,5 +6,6 @@ int sm750_hw_i2c_init(unsigned char bus_speed_mode);
 void sm750_hw_i2c_close(void);
 
 unsigned char sm750_hw_i2c_read_reg(unsigned char addr, unsigned char reg);
-int sm750_hw_i2c_write_reg(unsigned char addr, unsigned char reg, unsigned 
char data);
+int sm750_hw_i2c_write_reg(unsigned char addr, unsigned char reg,
+  unsigned char data);
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index d5f01d3..b154568 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -125,7 +125,10 @@ static void sm750_sw_i2c_scl(unsigned char value)
 
gpio_dir = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
if (value) {/* High */
-   /* Set direction as input. This will automatically pull the 
signal up. */
+   /*
+* Set direction as input. This will automatically
+* pull the signal up.
+*/
gpio_dir &= ~(1 << sw_i2c_clk_gpio);
POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
} else {/* Low */
@@ -159,7 +162,10 @@ static void sm750_sw_i2c_sda(unsigned char value)
 
gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
if (value) {/* High */
-   /* Set direction as input. This will automatically pull the 
signal up. */
+   /*
+* Set direction as input. This will automatically
+* pull the signal up.
+*/
gpio_dir &= ~(1 << sw_i2c_data_gpio);
POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
} else {/* Low */
@@ -184,10 +190,11 @@ static unsigned char sm750_sw_i2c_read_sda(void)
 {
unsigned long gpio_dir;
unsigned long gpio_data;
+   unsigned long dir_mask = 1 << sw_i2c_data_gpio;
 
/* Make sure that the 

[PATCH 04/17] staging: sm750fb: rename hwI2CWriteReg to sm750_hw_i2c_write_reg

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c  | 2 +-
 drivers/staging/sm750fb/ddk750_hwi2c.h  | 2 +-
 drivers/staging/sm750fb/ddk750_sii164.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 03da0a7..e6d31db 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -249,7 +249,7 @@ unsigned char sm750_hw_i2c_read_reg(
  *  0   - Success
  * -1   - Fail
  */
-int hwI2CWriteReg(
+int sm750_hw_i2c_write_reg(
unsigned char deviceAddress,
unsigned char registerIndex,
unsigned char data
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 70a6007..29ce48d 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -6,5 +6,5 @@ int sm750_hw_i2c_init(unsigned char busSpeedMode);
 void sm750_hw_i2c_close(void);
 
 unsigned char sm750_hw_i2c_read_reg(unsigned char deviceAddress, unsigned char 
registerIndex);
-int hwI2CWriteReg(unsigned char deviceAddress, unsigned char registerIndex, 
unsigned char data);
+int sm750_hw_i2c_write_reg(unsigned char deviceAddress, unsigned char 
registerIndex, unsigned char data);
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index 20dbc05..3d129aa 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -11,7 +11,7 @@
 #define USE_HW_I2C
 
 #ifdef USE_HW_I2C
-#define i2cWriteReg hwI2CWriteReg
+#define i2cWriteReg sm750_hw_i2c_write_reg
 #define i2cReadReg  sm750_hw_i2c_read_reg
 #else
 #define i2cWriteReg swI2CWriteReg
-- 
2.1.0

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


[PATCH 09/17] staging: sm750fb: ddk750_swi2c: staticize swI2C{SCL,SDA}

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c |  4 ++--
 drivers/staging/sm750fb/ddk750_swi2c.h | 21 -
 2 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index e3f60eb..6a10ae3 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -119,7 +119,7 @@ static void swI2CWait(void)
  *  signal because the i2c will fail when other device try to drive the
  *  signal due to SM50x will drive the signal to always high.
  */
-void swI2CSCL(unsigned char value)
+static void swI2CSCL(unsigned char value)
 {
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
@@ -153,7 +153,7 @@ void swI2CSCL(unsigned char value)
  *  signal because the i2c will fail when other device try to drive the
  *  signal due to SM50x will drive the signal to always high.
  */
-void swI2CSDA(unsigned char value)
+static void swI2CSDA(unsigned char value)
 {
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h 
b/drivers/staging/sm750fb/ddk750_swi2c.h
index 37335dd..27a04f3a 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -68,25 +68,4 @@ long sm750_sw_i2c_write_reg(
unsigned char data
 );
 
-/*
- *  These two functions toggle the data on the SCL and SDA I2C lines.
- *  The use of these two functions is not recommended unless it is necessary.
- */
-
-/*
- *  This function set/reset the SCL GPIO pin
- *
- *  Parameters:
- *  value  - Bit value to set to the SCL or SDA (0 = low, 1 = high)
- */
-void swI2CSCL(unsigned char value);
-
-/*
- *  This function set/reset the SDA GPIO pin
- *
- *  Parameters:
- *  value  - Bit value to set to the SCL or SDA (0 = low, 1 = high)
- */
-void swI2CSDA(unsigned char value);
-
 #endif  /* _SWI2C_H_ */
-- 
2.1.0

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


[PATCH 11/17] staging: sm750fb: ddk750_hw_i2c: rename busSpeedMode

2015-08-23 Thread Mike Rapoport
rename CamelCase parameter in sm750_hw_i2c_init()

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 4 ++--
 drivers/staging/sm750fb/ddk750_hwi2c.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 0677ff0..c4c2dad 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -10,7 +10,7 @@
 
 
 int sm750_hw_i2c_init(
-unsigned char busSpeedMode
+unsigned char bus_speed_mode
 )
 {
unsigned int value;
@@ -29,7 +29,7 @@ unsigned char busSpeedMode
 
/* Enable the I2C Controller and set the bus speed mode */
value = PEEK32(I2C_CTRL);
-   if (busSpeedMode == 0)
+   if (bus_speed_mode == 0)
value = FIELD_SET(value, I2C_CTRL, MODE, STANDARD);
else
value = FIELD_SET(value, I2C_CTRL, MODE, FAST);
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 29ce48d..5872f9c 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -2,7 +2,7 @@
 #define DDK750_HWI2C_H__
 
 /* hwi2c functions */
-int sm750_hw_i2c_init(unsigned char busSpeedMode);
+int sm750_hw_i2c_init(unsigned char bus_speed_mode);
 void sm750_hw_i2c_close(void);
 
 unsigned char sm750_hw_i2c_read_reg(unsigned char deviceAddress, unsigned char 
registerIndex);
-- 
2.1.0

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


[PATCH 00/17] staging: sm750fb: coding style fixes

2015-08-23 Thread Mike Rapoport
Hi,

These patches are fixing coding style issues in ddk750_*i2c* files of the
sm750fb driver

Mike Rapoport (17):
  staging: sm750fb: rename hwI2CInit to sm750_hw_i2c_init
  staging: sm750fb: rename hwI2CClose to sm750_hw_i2c_close
  staging: sm750fb: rename hwI2CReadReg to sm750_hw_i2c_read_reg
  staging: sm750fb: rename hwI2CWriteReg to sm750_hw_i2c_write_reg
  staging: sm750fb: ddk750_hwi2c: rename CamelCase static functions
  staging: sm750fb: rename swI2CInit to sm750_sw_i2c_init
  staging: sm750fb: rename swI2CReadReg to sm750_sw_i2c_read_reg
  staging: sm750fb: rename swI2CWriteReg to sm750_sw_i2c_write_reg
  staging: sm750fb: ddk750_swi2c: staticize swI2C{SCL,SDA}
  staging: sm750fb: ddk750_swi2c: rename CamelCase static functions
  staging: sm750fb: ddk750_hw_i2c: rename busSpeedMode
  staging: sm750fb: hw_i2c_{read,write}: rename CamelCase variables
  staging: sm750fb: ddk750_hwi2c: reduce amount of CamelCase
  staging: sm750fb: ddk750_swi2c: rename CamelCase static variables
  staging: sm750fb: ddk750_swi2c: further reduce CamelCase
  staging: sm750fb: ddk750_*i2c: remove multiple blank lines
  staging: sm750fb: ddk750_*i2c: shorten lines to under 80 characters

 drivers/staging/sm750fb/ddk750_hwi2c.c  | 109 ++--
 drivers/staging/sm750fb/ddk750_hwi2c.h  |   9 +-
 drivers/staging/sm750fb/ddk750_sii164.c |   8 +-
 drivers/staging/sm750fb/ddk750_swi2c.c  | 291 
 drivers/staging/sm750fb/ddk750_swi2c.h  |  47 ++
 drivers/staging/sm750fb/sm750_hw.c  |  10 +-
 6 files changed, 228 insertions(+), 246 deletions(-)

-- 
2.1.0

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


[PATCH 02/17] staging: sm750fb: rename hwI2CClose to sm750_hw_i2c_close

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 2 +-
 drivers/staging/sm750fb/ddk750_hwi2c.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 7eb122e..8aa83ab 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -40,7 +40,7 @@ unsigned char busSpeedMode
 }
 
 
-void hwI2CClose(void)
+void sm750_hw_i2c_close(void)
 {
unsigned int value;
 
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 11381eb..a8d23d2 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -3,7 +3,7 @@
 
 /* hwi2c functions */
 int sm750_hw_i2c_init(unsigned char busSpeedMode);
-void hwI2CClose(void);
+void sm750_hw_i2c_close(void);
 
 unsigned char hwI2CReadReg(unsigned char deviceAddress, unsigned char 
registerIndex);
 int hwI2CWriteReg(unsigned char deviceAddress, unsigned char registerIndex, 
unsigned char data);
-- 
2.1.0

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


two RCU torture bugs

2015-08-23 Thread David Miller

1) Doc bug, documentation mentions torture_type such as "rcu_sync",
   but those don't seem to exist.

2) If you specify an unrecognized type, the module cannot be unloaded.
   Amusingly it says that it cannot unload because the unrecognized
   torture test type you requested is "running" :-)

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


Re: [f2fs-dev] [PATCH 1/2] f2fs: handle failed bio allocation

2015-08-23 Thread Jaegeuk Kim
Hi Chao,

[snip]

> > > >
> > > > -   /* No failure on bio allocation */
> > > > -   bio = bio_alloc(GFP_NOIO, npages);
> > >
> > > How about using __GFP_NOFAIL flag to avoid failing in bio_alloc instead
> > > of adding opencode endless loop in code?
> > >
> > > We can see the reason in this commit  647757197cd3
> > > ("mm: clarify __GFP_NOFAIL deprecation status ")
> > >
> > > "__GFP_NOFAIL is documented as a deprecated flag since commit
> > > 478352e789f5 ("mm: add comment about deprecation of __GFP_NOFAIL").
> > >
> > > This has discouraged people from using it but in some cases an opencoded
> > > endless loop around allocator has been used instead. So the allocator
> > > is not aware of the de facto __GFP_NOFAIL allocation because this
> > > information was not communicated properly.
> > >
> > > Let's make clear that if the allocation context really cannot afford
> > > failure because there is no good failure policy then using __GFP_NOFAIL
> > > is preferable to opencoding the loop outside of the allocator."
> > >
> > > BTW, I found that f2fs_kmem_cache_alloc also could be replaced, we could
> > > fix them together.
> > 
> > Agreed. I think that can be another patch like this.
> > 
> > From 1579e0d1ada96994c4ec6619fb5b5d9386e77ab3 Mon Sep 17 00:00:00 2001
> > From: Jaegeuk Kim 
> > Date: Thu, 20 Aug 2015 08:51:56 -0700
> > Subject: [PATCH] f2fs: use __GFP_NOFAIL to avoid infinite loop
> > 
> > __GFP_NOFAIL can avoid retrying the whole path of kmem_cache_alloc and
> > bio_alloc.
> > 
> > Suggested-by: Chao Yu 
> > Signed-off-by: Jaegeuk Kim 
> > ---
> >  fs/f2fs/f2fs.h | 16 +---
> >  1 file changed, 5 insertions(+), 11 deletions(-)
> > 
> > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > index 00591f7..c78b599 100644
> > --- a/fs/f2fs/f2fs.h
> > +++ b/fs/f2fs/f2fs.h
> > @@ -1244,13 +1244,10 @@ static inline void *f2fs_kmem_cache_alloc(struct 
> > kmem_cache *cachep,
> > gfp_t flags)
> >  {
> > void *entry;
> > -retry:
> > -   entry = kmem_cache_alloc(cachep, flags);
> > -   if (!entry) {
> > -   cond_resched();
> > -   goto retry;
> > -   }
> > 
> > +   entry = kmem_cache_alloc(cachep, flags);
> > +   if (!entry)
> > +   entry = kmem_cache_alloc(cachep, flags | __GFP_NOFAIL);
> 
> The fast + slow path model looks good to me, expect one thing:
> In several paths of checkpoint, caller will grab slab cache with GFP_ATOMIC,
> so in slow path, our flags will be GFP_ATOMIC | __GFP_NOFAIL, I'm not sure
> that the two flags can be used together.
> 
> Should we replace GFP_ATOMIC with GFP_NOFS in flags if caller passed
> GFP_ATOMIC?

Indeed, we need to avoid GFP_ATOMIC as much as possible to mitigate memory
pressure at this moment. Too much abused.

I wrote a patch like this.

>From a9209556d024cdce490695586ecee3164efda49c Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim 
Date: Thu, 20 Aug 2015 08:51:56 -0700
Subject: [PATCH] f2fs: use __GFP_NOFAIL to avoid infinite loop

__GFP_NOFAIL can avoid retrying the whole path of kmem_cache_alloc and
bio_alloc.
And, it also fixes the use cases of GFP_ATOMIC correctly.

Suggested-by: Chao Yu 
Signed-off-by: Jaegeuk Kim 
---
 fs/f2fs/checkpoint.c | 21 -
 fs/f2fs/f2fs.h   | 16 +---
 fs/f2fs/node.c   |  4 ++--
 fs/f2fs/segment.c|  2 +-
 4 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 890e4d4..c5a38e3 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -336,26 +336,18 @@ const struct address_space_operations f2fs_meta_aops = {
 static void __add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type)
 {
struct inode_management *im = >im[type];
-   struct ino_entry *e;
+   struct ino_entry *e, *tmp;
+
+   tmp = f2fs_kmem_cache_alloc(ino_entry_slab, GFP_NOFS);
 retry:
-   if (radix_tree_preload(GFP_NOFS)) {
-   cond_resched();
-   goto retry;
-   }
+   radix_tree_preload(GFP_NOFS | __GFP_NOFAIL);
 
spin_lock(>ino_lock);
-
e = radix_tree_lookup(>ino_root, ino);
if (!e) {
-   e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC);
-   if (!e) {
-   spin_unlock(>ino_lock);
-   radix_tree_preload_end();
-   goto retry;
-   }
+   e = tmp;
if (radix_tree_insert(>ino_root, ino, e)) {
spin_unlock(>ino_lock);
-   kmem_cache_free(ino_entry_slab, e);
radix_tree_preload_end();
goto retry;
}
@@ -368,6 +360,9 @@ retry:
}
spin_unlock(>ino_lock);
radix_tree_preload_end();
+
+   if (e != tmp)
+   kmem_cache_free(ino_entry_slab, tmp);
 }
 
 static void __remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type)
diff --git a/fs/f2fs/f2fs.h 

[PATCH 02/18] ARM: add const qualifier to smp_operations member in structures

2015-08-23 Thread Masahiro Yamada
The core framework does not modify smp_operations structures.
To clarify it, this commit adds 'const' qualifier to the 'ops'
member of struct of_cpu_method and the 'smp' member of struct
machine_desc.

This change allows each SoC code to add 'const' qualifier to its
smp_operation structure.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/include/asm/mach/arch.h | 2 +-
 arch/arm/include/asm/smp.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index cb3a407..5c1ad11 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -47,7 +47,7 @@ struct machine_desc {
unsignedl2c_aux_val;/* L2 cache aux value   */
unsignedl2c_aux_mask;   /* L2 cache aux mask*/
void(*l2c_write_sec)(unsigned long, unsigned);
-   struct smp_operations   *smp;   /* SMP operations   */
+   const struct smp_operations *smp;   /* SMP operations   */
bool(*smp_init)(void);
void(*fixup)(struct tag *, char **);
void(*dt_fixup)(void);
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index cd81540..50aff58 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -112,7 +112,7 @@ struct smp_operations {
 
 struct of_cpu_method {
const char *method;
-   struct smp_operations *ops;
+   const struct smp_operations *ops;
 };
 
 #define CPU_METHOD_OF_DECLARE(name, _method, _ops) \
-- 
1.9.1

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


[PATCH 09/18] ARM: hisi: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-hisi/platsmp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
index 3c5237d..47ed32c 100644
--- a/arch/arm/mach-hisi/platsmp.c
+++ b/arch/arm/mach-hisi/platsmp.c
@@ -89,7 +89,7 @@ static int hi3xxx_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-static struct smp_operations hi3xxx_smp_ops __initdata = {
+static const struct smp_operations hi3xxx_smp_ops __initconst = {
.smp_prepare_cpus   = hi3xxx_smp_prepare_cpus,
.smp_boot_secondary = hi3xxx_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -126,7 +126,7 @@ static int hix5hd2_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
 }
 
 
-static struct smp_operations hix5hd2_smp_ops __initdata = {
+static const struct smp_operations hix5hd2_smp_ops __initconst = {
.smp_prepare_cpus   = hisi_common_smp_prepare_cpus,
.smp_boot_secondary = hix5hd2_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -176,7 +176,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-static struct smp_operations hip01_smp_ops __initdata = {
+static const struct smp_operations hip01_smp_ops __initconst = {
.smp_prepare_cpus   = hisi_common_smp_prepare_cpus,
.smp_boot_secondary = hip01_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 07/18] ARM: EXYNOS: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-exynos/common.h  | 2 +-
 arch/arm/mach-exynos/platsmp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 1534925..e349a03 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -149,7 +149,7 @@ static inline void exynos_pm_init(void) {}
 extern void exynos_cpu_resume(void);
 extern void exynos_cpu_resume_ns(void);
 
-extern struct smp_operations exynos_smp_ops;
+extern const struct smp_operations exynos_smp_ops;
 
 extern void exynos_cpu_power_down(int cpu);
 extern void exynos_cpu_power_up(int cpu);
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 98a2c0c..5bd9559 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -479,7 +479,7 @@ static void exynos_cpu_die(unsigned int cpu)
 }
 #endif /* CONFIG_HOTPLUG_CPU */
 
-struct smp_operations exynos_smp_ops __initdata = {
+const struct smp_operations exynos_smp_ops __initconst = {
.smp_init_cpus  = exynos_smp_init_cpus,
.smp_prepare_cpus   = exynos_smp_prepare_cpus,
.smp_secondary_init = exynos_secondary_init,
-- 
1.9.1

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


[PATCH 08/18] ARM: hisi: do not export smp_operations structures

2015-08-23 Thread Masahiro Yamada
These three structures are only defined and referenced in
mach-hisi/platsmp.c.

Drop the declarations from the header and add static qualifier
to the definitions.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-hisi/core.h| 3 ---
 arch/arm/mach-hisi/platsmp.c | 6 +++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-hisi/core.h b/arch/arm/mach-hisi/core.h
index c7648ef..e883583 100644
--- a/arch/arm/mach-hisi/core.h
+++ b/arch/arm/mach-hisi/core.h
@@ -6,17 +6,14 @@
 extern void hi3xxx_set_cpu_jump(int cpu, void *jump_addr);
 extern int hi3xxx_get_cpu_jump(int cpu);
 extern void secondary_startup(void);
-extern struct smp_operations hi3xxx_smp_ops;
 
 extern void hi3xxx_cpu_die(unsigned int cpu);
 extern int hi3xxx_cpu_kill(unsigned int cpu);
 extern void hi3xxx_set_cpu(int cpu, bool enable);
 
-extern struct smp_operations hix5hd2_smp_ops;
 extern void hix5hd2_set_cpu(int cpu, bool enable);
 extern void hix5hd2_cpu_die(unsigned int cpu);
 
-extern struct smp_operations hip01_smp_ops;
 extern void hip01_set_cpu(int cpu, bool enable);
 extern void hip01_cpu_die(unsigned int cpu);
 #endif
diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
index 5174412..3c5237d 100644
--- a/arch/arm/mach-hisi/platsmp.c
+++ b/arch/arm/mach-hisi/platsmp.c
@@ -89,7 +89,7 @@ static int hi3xxx_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-struct smp_operations hi3xxx_smp_ops __initdata = {
+static struct smp_operations hi3xxx_smp_ops __initdata = {
.smp_prepare_cpus   = hi3xxx_smp_prepare_cpus,
.smp_boot_secondary = hi3xxx_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -126,7 +126,7 @@ static int hix5hd2_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
 }
 
 
-struct smp_operations hix5hd2_smp_ops __initdata = {
+static struct smp_operations hix5hd2_smp_ops __initdata = {
.smp_prepare_cpus   = hisi_common_smp_prepare_cpus,
.smp_boot_secondary = hix5hd2_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -176,7 +176,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-struct smp_operations hip01_smp_ops __initdata = {
+static struct smp_operations hip01_smp_ops __initdata = {
.smp_prepare_cpus   = hisi_common_smp_prepare_cpus,
.smp_boot_secondary = hip01_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 12/18] ARM: rockchip: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-rockchip/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
index 3e7a4b7..93f 100644
--- a/arch/arm/mach-rockchip/platsmp.c
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -340,7 +340,7 @@ static void rockchip_cpu_die(unsigned int cpu)
 }
 #endif
 
-static struct smp_operations rockchip_smp_ops __initdata = {
+static const struct smp_operations rockchip_smp_ops __initconst = {
.smp_prepare_cpus   = rockchip_smp_prepare_cpus,
.smp_boot_secondary = rockchip_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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


[PATCH 17/18] ARM: zynq: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-zynq/common.h  | 2 +-
 arch/arm/mach-zynq/platsmp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h
index 79cda2e..e771933 100644
--- a/arch/arm/mach-zynq/common.h
+++ b/arch/arm/mach-zynq/common.h
@@ -30,7 +30,7 @@ extern char zynq_secondary_trampoline;
 extern char zynq_secondary_trampoline_jump;
 extern char zynq_secondary_trampoline_end;
 extern int zynq_cpun_start(u32 address, int cpu);
-extern struct smp_operations zynq_smp_ops __initdata;
+extern const struct smp_operations zynq_smp_ops;
 #endif
 
 extern void __iomem *zynq_scu_base;
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index f66816c..7cd9865 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -157,7 +157,7 @@ static void zynq_cpu_die(unsigned int cpu)
 }
 #endif
 
-struct smp_operations zynq_smp_ops __initdata = {
+const struct smp_operations zynq_smp_ops __initconst = {
.smp_init_cpus  = zynq_smp_init_cpus,
.smp_prepare_cpus   = zynq_smp_prepare_cpus,
.smp_boot_secondary = zynq_boot_secondary,
-- 
1.9.1

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


[PATCH 14/18] ARM: sunxi: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, add static to sun8i_smp_ops.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-sunxi/platsmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-sunxi/platsmp.c b/arch/arm/mach-sunxi/platsmp.c
index e8483ec..6642267 100644
--- a/arch/arm/mach-sunxi/platsmp.c
+++ b/arch/arm/mach-sunxi/platsmp.c
@@ -116,7 +116,7 @@ static int sun6i_smp_boot_secondary(unsigned int cpu,
return 0;
 }
 
-static struct smp_operations sun6i_smp_ops __initdata = {
+static const struct smp_operations sun6i_smp_ops __initconst = {
.smp_prepare_cpus   = sun6i_smp_prepare_cpus,
.smp_boot_secondary = sun6i_smp_boot_secondary,
 };
@@ -185,7 +185,7 @@ static int sun8i_smp_boot_secondary(unsigned int cpu,
return 0;
 }
 
-struct smp_operations sun8i_smp_ops __initdata = {
+static const struct smp_operations sun8i_smp_ops __initconst = {
.smp_prepare_cpus   = sun8i_smp_prepare_cpus,
.smp_boot_secondary = sun8i_smp_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 05/18] ARM: BCM: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, add static to bcm63138_smp_ops.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-bcm/bcm63xx_smp.c | 2 +-
 arch/arm/mach-bcm/kona_smp.c| 2 +-
 arch/arm/mach-bcm/platsmp-brcmstb.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-bcm/bcm63xx_smp.c b/arch/arm/mach-bcm/bcm63xx_smp.c
index 19be904..9b6727e 100644
--- a/arch/arm/mach-bcm/bcm63xx_smp.c
+++ b/arch/arm/mach-bcm/bcm63xx_smp.c
@@ -161,7 +161,7 @@ static void __init bcm63138_smp_prepare_cpus(unsigned int 
max_cpus)
}
 }
 
-struct smp_operations bcm63138_smp_ops __initdata = {
+static const struct smp_operations bcm63138_smp_ops __initconst = {
.smp_prepare_cpus   = bcm63138_smp_prepare_cpus,
.smp_boot_secondary = bcm63138_smp_boot_secondary,
 };
diff --git a/arch/arm/mach-bcm/kona_smp.c b/arch/arm/mach-bcm/kona_smp.c
index 66a0465..da8328b 100644
--- a/arch/arm/mach-bcm/kona_smp.c
+++ b/arch/arm/mach-bcm/kona_smp.c
@@ -194,7 +194,7 @@ static int bcm_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return -ENOSYS;
 }
 
-static struct smp_operations bcm_smp_ops __initdata = {
+static const struct smp_operations bcm_smp_ops __initconst = {
.smp_prepare_cpus   = bcm_smp_prepare_cpus,
.smp_boot_secondary = bcm_boot_secondary,
 };
diff --git a/arch/arm/mach-bcm/platsmp-brcmstb.c 
b/arch/arm/mach-bcm/platsmp-brcmstb.c
index 44d6bddf..40dc844 100644
--- a/arch/arm/mach-bcm/platsmp-brcmstb.c
+++ b/arch/arm/mach-bcm/platsmp-brcmstb.c
@@ -356,7 +356,7 @@ static int brcmstb_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-static struct smp_operations brcmstb_smp_ops __initdata = {
+static const struct smp_operations brcmstb_smp_ops __initconst = {
.smp_prepare_cpus   = brcmstb_cpu_ctrl_setup,
.smp_boot_secondary = brcmstb_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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


[PATCH 10/18] ARM: mvebu: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-mvebu/armada-370-xp.h | 2 +-
 arch/arm/mach-mvebu/platsmp-a9.c| 4 ++--
 arch/arm/mach-mvebu/platsmp.c   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-mvebu/armada-370-xp.h 
b/arch/arm/mach-mvebu/armada-370-xp.h
index c55bbf8..09413b6 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.h
+++ b/arch/arm/mach-mvebu/armada-370-xp.h
@@ -17,7 +17,7 @@
 
 #ifdef CONFIG_SMP
 void armada_xp_secondary_startup(void);
-extern struct smp_operations armada_xp_smp_ops;
+extern const struct smp_operations armada_xp_smp_ops;
 #endif
 
 #endif /* __MACH_ARMADA_370_XP_H */
diff --git a/arch/arm/mach-mvebu/platsmp-a9.c b/arch/arm/mach-mvebu/platsmp-a9.c
index 3d50004..d715dec 100644
--- a/arch/arm/mach-mvebu/platsmp-a9.c
+++ b/arch/arm/mach-mvebu/platsmp-a9.c
@@ -93,11 +93,11 @@ static int armada_38x_cpu_kill(unsigned int cpu)
 }
 #endif
 
-static struct smp_operations mvebu_cortex_a9_smp_ops __initdata = {
+static const struct smp_operations mvebu_cortex_a9_smp_ops __initconst = {
.smp_boot_secondary = mvebu_cortex_a9_boot_secondary,
 };
 
-static struct smp_operations armada_38x_smp_ops __initdata = {
+static const struct smp_operations armada_38x_smp_ops __initconst = {
.smp_boot_secondary = mvebu_cortex_a9_boot_secondary,
.smp_secondary_init = armada_38x_secondary_init,
 #ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index 58cc8c1..f9597b7 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -170,7 +170,7 @@ static int armada_xp_cpu_kill(unsigned int cpu)
 }
 #endif
 
-struct smp_operations armada_xp_smp_ops __initdata = {
+const struct smp_operations armada_xp_smp_ops __initconst = {
.smp_init_cpus  = armada_xp_smp_init_cpus,
.smp_prepare_cpus   = armada_xp_smp_prepare_cpus,
.smp_boot_secondary = armada_xp_boot_secondary,
-- 
1.9.1

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


[PATCH 00/18] ARM: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada

Currently, SoC code can not add const qualifier to smp_operations
structures although they are never over-written.

01/18 and 02/18 add small changes to the ARM core to fix that.
The rest of this series replace "__initdata" with "const ... __initconst"
for each of SoC code.

I split this series into per-SoC so that each sub-arch maintainer
can easily give their Acked-by.  (Is this better?)

Russell, Olof, and Arnd:

How should this series be applied (if it looks good)?
The first two are ARM-tree wide and looks like in the field of Russell.
The rest are highly SoC-related.



Masahiro Yamada (18):
  ARM: add const qualifier to the argument of smp_set_ops()
  ARM: add const qualifier to smp_operations member in structures
  ARM: alpine: use const and __initconst for smp_operations
  ARM: axxia: use const and __initconst for smp_operations
  ARM: BCM: use const and __initconst for smp_operations
  ARM: berlin: use const and __initconst for smp_operations
  ARM: EXYNOS: use const and __initconst for smp_operations
  ARM: hisi: do not export smp_operations structures
  ARM: hisi: use const and __initconst for smp_operations
  ARM: mvebu: use const and __initconst for smp_operations
  ARM: qcom: use const and __initconst for smp_operations
  ARM: rockchip: use const and __initconst for smp_operations
  ARM: socfpga: use const and __initconst for smp_operations
  ARM: sunxi: use const and __initconst for smp_operations
  ARM: uniphier: use const and __initconst for smp_operations
  ARM: zx: use const and __initconst for smp_operations
  ARM: zynq: use const and __initconst for smp_operations
  ARM: mcpm: use const and __initconst for smp_operations

 arch/arm/common/mcpm_platsmp.c  | 2 +-
 arch/arm/include/asm/mach/arch.h| 2 +-
 arch/arm/include/asm/smp.h  | 4 ++--
 arch/arm/kernel/smp.c   | 2 +-
 arch/arm/mach-alpine/platsmp.c  | 2 +-
 arch/arm/mach-axxia/platsmp.c   | 2 +-
 arch/arm/mach-bcm/bcm63xx_smp.c | 2 +-
 arch/arm/mach-bcm/kona_smp.c| 2 +-
 arch/arm/mach-bcm/platsmp-brcmstb.c | 2 +-
 arch/arm/mach-berlin/platsmp.c  | 2 +-
 arch/arm/mach-exynos/common.h   | 2 +-
 arch/arm/mach-exynos/platsmp.c  | 2 +-
 arch/arm/mach-hisi/core.h   | 3 ---
 arch/arm/mach-hisi/platsmp.c| 6 +++---
 arch/arm/mach-mvebu/armada-370-xp.h | 2 +-
 arch/arm/mach-mvebu/platsmp-a9.c| 4 ++--
 arch/arm/mach-mvebu/platsmp.c   | 2 +-
 arch/arm/mach-qcom/platsmp.c| 6 +++---
 arch/arm/mach-rockchip/platsmp.c| 2 +-
 arch/arm/mach-socfpga/platsmp.c | 4 ++--
 arch/arm/mach-sunxi/platsmp.c   | 4 ++--
 arch/arm/mach-uniphier/platsmp.c| 2 +-
 arch/arm/mach-zx/platsmp.c  | 2 +-
 arch/arm/mach-zynq/common.h | 2 +-
 arch/arm/mach-zynq/platsmp.c| 2 +-
 25 files changed, 32 insertions(+), 35 deletions(-)

-- 
1.9.1

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


[PATCH 16/18] ARM: zx: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, add static to the structure.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-zx/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-zx/platsmp.c b/arch/arm/mach-zx/platsmp.c
index a369398..0297f92 100644
--- a/arch/arm/mach-zx/platsmp.c
+++ b/arch/arm/mach-zx/platsmp.c
@@ -176,7 +176,7 @@ static void zx_secondary_init(unsigned int cpu)
scu_power_mode(scu_base, SCU_PM_NORMAL);
 }
 
-struct smp_operations zx_smp_ops __initdata = {
+static const struct smp_operations zx_smp_ops __initconst = {
.smp_prepare_cpus   = zx_smp_prepare_cpus,
.smp_secondary_init = zx_secondary_init,
.smp_boot_secondary = zx_boot_secondary,
-- 
1.9.1

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


[PATCH 18/18] ARM: mcpm: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, __initconst has been moved after mcpm_smp_ops because
scripts/checkpatch.pl suggests to do so.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/common/mcpm_platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/common/mcpm_platsmp.c b/arch/arm/common/mcpm_platsmp.c
index 92e54d7..1011b0e 100644
--- a/arch/arm/common/mcpm_platsmp.c
+++ b/arch/arm/common/mcpm_platsmp.c
@@ -87,7 +87,7 @@ static void mcpm_cpu_die(unsigned int cpu)
 
 #endif
 
-static struct smp_operations __initdata mcpm_smp_ops = {
+static const struct smp_operations mcpm_smp_ops __initconst = {
.smp_boot_secondary = mcpm_boot_secondary,
.smp_secondary_init = mcpm_secondary_init,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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


[PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops()

2015-08-23 Thread Masahiro Yamada
This function just copies '*ops' to 'smp_ops', so the given
structure '*ops' is not modified at all.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/include/asm/smp.h | 2 +-
 arch/arm/kernel/smp.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 2f3ac1b..cd81540 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -122,6 +122,6 @@ struct of_cpu_method {
 /*
  * set platform specific SMP operations
  */
-extern void smp_set_ops(struct smp_operations *);
+extern void smp_set_ops(const struct smp_operations *);
 
 #endif /* ifndef __ASM_ARM_SMP_H */
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 3d6b782..bb63a4e 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -78,7 +78,7 @@ static DECLARE_COMPLETION(cpu_running);
 
 static struct smp_operations smp_ops;
 
-void __init smp_set_ops(struct smp_operations *ops)
+void __init smp_set_ops(const struct smp_operations *ops)
 {
if (ops)
smp_ops = *ops;
-- 
1.9.1

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


[PATCH 11/18] ARM: qcom: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-qcom/platsmp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-qcom/platsmp.c b/arch/arm/mach-qcom/platsmp.c
index 5cde63a..11847cd 100644
--- a/arch/arm/mach-qcom/platsmp.c
+++ b/arch/arm/mach-qcom/platsmp.c
@@ -332,7 +332,7 @@ static void __init qcom_smp_prepare_cpus(unsigned int 
max_cpus)
}
 }
 
-static struct smp_operations smp_msm8660_ops __initdata = {
+static const struct smp_operations smp_msm8660_ops __initconst = {
.smp_prepare_cpus   = qcom_smp_prepare_cpus,
.smp_secondary_init = qcom_secondary_init,
.smp_boot_secondary = msm8660_boot_secondary,
@@ -342,7 +342,7 @@ static struct smp_operations smp_msm8660_ops __initdata = {
 };
 CPU_METHOD_OF_DECLARE(qcom_smp, "qcom,gcc-msm8660", _msm8660_ops);
 
-static struct smp_operations qcom_smp_kpssv1_ops __initdata = {
+static const struct smp_operations qcom_smp_kpssv1_ops __initconst = {
.smp_prepare_cpus   = qcom_smp_prepare_cpus,
.smp_secondary_init = qcom_secondary_init,
.smp_boot_secondary = kpssv1_boot_secondary,
@@ -352,7 +352,7 @@ static struct smp_operations qcom_smp_kpssv1_ops __initdata 
= {
 };
 CPU_METHOD_OF_DECLARE(qcom_smp_kpssv1, "qcom,kpss-acc-v1", 
_smp_kpssv1_ops);
 
-static struct smp_operations qcom_smp_kpssv2_ops __initdata = {
+static const struct smp_operations qcom_smp_kpssv2_ops __initconst = {
.smp_prepare_cpus   = qcom_smp_prepare_cpus,
.smp_secondary_init = qcom_secondary_init,
.smp_boot_secondary = kpssv2_boot_secondary,
-- 
1.9.1

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


[PATCH 06/18] ARM: berlin: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-berlin/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c
index 34a3753..41a626b 100644
--- a/arch/arm/mach-berlin/platsmp.c
+++ b/arch/arm/mach-berlin/platsmp.c
@@ -91,7 +91,7 @@ unmap_scu:
iounmap(scu_base);
 }
 
-static struct smp_operations berlin_smp_ops __initdata = {
+static const struct smp_operations berlin_smp_ops __initconst = {
.smp_prepare_cpus   = berlin_smp_prepare_cpus,
.smp_boot_secondary = berlin_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 04/18] ARM: axxia: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-axxia/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c
index 959d4df..ffbd71d 100644
--- a/arch/arm/mach-axxia/platsmp.c
+++ b/arch/arm/mach-axxia/platsmp.c
@@ -82,7 +82,7 @@ static void __init axxia_smp_prepare_cpus(unsigned int 
max_cpus)
}
 }
 
-static struct smp_operations axxia_smp_ops __initdata = {
+static const struct smp_operations axxia_smp_ops __initconst = {
.smp_prepare_cpus   = axxia_smp_prepare_cpus,
.smp_boot_secondary = axxia_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 15/18] ARM: uniphier: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-uniphier/platsmp.c b/arch/arm/mach-uniphier/platsmp.c
index 4b784f7..da5359c 100644
--- a/arch/arm/mach-uniphier/platsmp.c
+++ b/arch/arm/mach-uniphier/platsmp.c
@@ -76,7 +76,7 @@ static int uniphier_boot_secondary(unsigned int cpu,
return ret;
 }
 
-struct smp_operations uniphier_smp_ops __initdata = {
+static const struct smp_operations uniphier_smp_ops __initconst = {
.smp_prepare_cpus   = uniphier_smp_prepare_cpus,
.smp_boot_secondary = uniphier_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 13/18] ARM: socfpga: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-socfpga/platsmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
index 15c8ce8..cbb0a54 100644
--- a/arch/arm/mach-socfpga/platsmp.c
+++ b/arch/arm/mach-socfpga/platsmp.c
@@ -117,7 +117,7 @@ static int socfpga_cpu_kill(unsigned int cpu)
return 1;
 }
 
-static struct smp_operations socfpga_smp_ops __initdata = {
+static const struct smp_operations socfpga_smp_ops __initconst = {
.smp_prepare_cpus   = socfpga_smp_prepare_cpus,
.smp_boot_secondary = socfpga_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -126,7 +126,7 @@ static struct smp_operations socfpga_smp_ops __initdata = {
 #endif
 };
 
-static struct smp_operations socfpga_a10_smp_ops __initdata = {
+static const struct smp_operations socfpga_a10_smp_ops __initconst = {
.smp_prepare_cpus   = socfpga_smp_prepare_cpus,
.smp_boot_secondary = socfpga_a10_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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


[PATCH 03/18] ARM: alpine: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-alpine/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-alpine/platsmp.c b/arch/arm/mach-alpine/platsmp.c
index f78429f..dd77ea2 100644
--- a/arch/arm/mach-alpine/platsmp.c
+++ b/arch/arm/mach-alpine/platsmp.c
@@ -42,7 +42,7 @@ static void __init alpine_smp_prepare_cpus(unsigned int 
max_cpus)
alpine_cpu_pm_init();
 }
 
-static struct smp_operations alpine_smp_ops __initdata = {
+static const struct smp_operations alpine_smp_ops __initconst = {
.smp_prepare_cpus   = alpine_smp_prepare_cpus,
.smp_boot_secondary = alpine_boot_secondary,
 };
-- 
1.9.1

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


Re: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen support for Colibri VF50

2015-08-23 Thread maitysanchayan
Hello Dmitry,

On 15-08-21 18:30:57, Dmitry Torokhov wrote:
> Hi Sanchayan,
> 
> On Fri, Aug 21, 2015 at 06:56:32PM +0530, Sanchayan Maity wrote:
> > The Colibri Vybrid VF50 module supports 4-wire touchscreens using
> > FETs and ADC inputs. This driver uses the IIO consumer interface
> > and relies on the vf610_adc driver based on the IIO framework.
> > 
> 
> Thank you for making changes. I have a few comments still.

It has really improved with your comments. Thanks for your feedback.

> 
> > Signed-off-by: Sanchayan Maity 
> > ---
> >  drivers/input/touchscreen/Kconfig   |  12 +
> >  drivers/input/touchscreen/Makefile  |   1 +
> >  drivers/input/touchscreen/colibri-vf50-ts.c | 370 
> > 
> >  3 files changed, 383 insertions(+)
> >  create mode 100644 drivers/input/touchscreen/colibri-vf50-ts.c
> > 
> > diff --git a/drivers/input/touchscreen/Kconfig 
> > b/drivers/input/touchscreen/Kconfig
> > index 80f6386..28948ca 100644
> > --- a/drivers/input/touchscreen/Kconfig
> > +++ b/drivers/input/touchscreen/Kconfig
> > @@ -1027,4 +1027,16 @@ config TOUCHSCREEN_ZFORCE
> >   To compile this driver as a module, choose M here: the
> >   module will be called zforce_ts.
> >  
> > +config TOUCHSCREEN_COLIBRI_VF50
> > +   tristate "Toradex Colibri on board touchscreen driver"
> > +   depends on GPIOLIB && IIO && VF610_ADC
> 
> Can we possibly add "|| COMPILE_TEST" dependency? Will it compile
> without IIO or VF610_ADC enabled?

I will add and do the checks. It should compile without VF610_ADC
atleast, I don't see how it will without the others. I will check
once at my end also with other configs.

> 
> 
> > +   help
> > + Say Y here if you have a Colibri VF50 and plan to use
> > + the on-board provided 4-wire touchscreen driver.
> > +
> > + If unsure, say N.
> > +
> > + To compile this driver as a module, choose M here: the
> > + module will be called colibri_vf50_ts.
> > +
> >  endif
> > diff --git a/drivers/input/touchscreen/Makefile 
> > b/drivers/input/touchscreen/Makefile
> > index 44deea7..93746a0 100644
> > --- a/drivers/input/touchscreen/Makefile
> > +++ b/drivers/input/touchscreen/Makefile
> > @@ -84,3 +84,4 @@ obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_SX8654)   += sx8654.o
> >  obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_ZFORCE)   += zforce_ts.o
> > +obj-$(CONFIG_TOUCHSCREEN_COLIBRI_VF50) += colibri-vf50-ts.o
> > diff --git a/drivers/input/touchscreen/colibri-vf50-ts.c 
> > b/drivers/input/touchscreen/colibri-vf50-ts.c
> > new file mode 100644
> > index 000..0793fdc
> > --- /dev/null
> > +++ b/drivers/input/touchscreen/colibri-vf50-ts.c
> > @@ -0,0 +1,370 @@
> > +/* Copyright 2015 Toradex AG
> > + *
> > + * Toradex Colibri VF50 Touchscreen driver
> > + *
> > + * Originally authored by Stefan Agner for 3.0 kernel
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> 
> Don't you need gpio/consumer.h?

Yes.

> 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#define DRIVER_NAME "colibri-vf50-ts"
> > +#define DRV_VERSION "1.0"
> > +
> > +#define VF_ADC_MAX ((1 << 12) - 1)
> > +
> > +#define COLI_TOUCH_MIN_DELAY_US 1000
> > +#define COLI_TOUCH_MAX_DELAY_US 2000
> > +#define COLI_TOUCH_NO_OF_AVGS  5
> > +
> > +struct vf50_touch_device {
> > +   struct platform_device  *pdev;
> > +   struct input_dev*ts_input;
> > +   struct iio_channel  *channels;
> > +   struct gpio_desc *gpio_xp;
> > +   struct gpio_desc *gpio_xm;
> > +   struct gpio_desc *gpio_yp;
> > +   struct gpio_desc *gpio_ym;
> > +   struct gpio_desc *gpio_pen_detect;
> 
> I do not see gpio_pen_detect being used anymore.

Sorry. My mistake. It needs to be deleted. Will fix.

> 
> > +   int pen_irq;
> > +   int min_pressure;
> > +   bool stop_touchscreen;
> > +};
> > +
> > +/*
> > + * Enables given plates and measures touch parameters using ADC
> > + */
> > +static int adc_ts_measure(struct iio_channel *channel,
> > + struct gpio_desc *plate_p, struct gpio_desc *plate_m)
> > +{
> > +   int i, value = 0, val = 0;
> > +   int ret;
> > +
> > +   gpiod_set_value(plate_p, 1);
> > +   gpiod_set_value(plate_m, 1);
> > +
> > +   usleep_range(COLI_TOUCH_MIN_DELAY_US, COLI_TOUCH_MAX_DELAY_US);
> > +
> > +   for (i = 0; i < COLI_TOUCH_NO_OF_AVGS; i++) {
> > +   ret = iio_read_channel_raw(channel, );
> > +   if (ret < 0) {
> > +   value = ret;
> > +   goto error_iio_read;
> > +   }
> > +
> > +   value += val;
> > +   }
> > +
> > + 

Re: [PATCH 1/1] fix cpufreq/cpufreq.c some coding style issues

2015-08-23 Thread Vaishali Thakkar
On Mon, Aug 24, 2015 at 9:53 AM, Viresh Kumar  wrote:
> On 23-08-15, 21:19, Vaishali Thakkar wrote:
>>
>> On 23 Aug 2015 21:05, "Muhammad Falak R Wani"  wrote:
>> >
>> > Hi,
>> >
>> > This patch fixes issues in coding style, of a missing blank line
>> after
>> > declarations.
>> >
>> > Best,
>> > mfrw
>>
>> Please use subject lines and commit log matching the kernel coding style for
>> the subsystem on patches.
>
> And Vaishali, please don't send any mails in html. Please configure
> your gmail client to send mails only in text.

Yes. Sorry. I realized my mistake. Will keep in mind.

> --
> viresh



-- 
Vaishali
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RESEND PATCH] cpufreq: cpufreq: Fix coding style issues

2015-08-23 Thread Viresh Kumar
On 23-08-15, 22:13, Muhammad Falak R Wani wrote:
> This patch introduces a blank line after declarations, which
> fix the checkpatch.pl warnings at 3 places.
> 
> Signed-off-by: Muhammad Falak R Wani 
> ---
>  drivers/cpufreq/cpufreq.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 8ae655c..5aea659 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -718,6 +718,7 @@ static ssize_t show_bios_limit(struct cpufreq_policy 
> *policy, char *buf)
>  {
>   unsigned int limit;
>   int ret;
> +
>   if (cpufreq_driver->bios_limit) {
>   ret = cpufreq_driver->bios_limit(policy->cpu, );
>   if (!ret)
> @@ -815,6 +816,7 @@ unlock:
>  static void cpufreq_sysfs_release(struct kobject *kobj)
>  {
>   struct cpufreq_policy *policy = to_policy(kobj);
> +
>   pr_debug("last reference is dropped\n");
>   complete(>kobj_unregister);
>  }
> @@ -2129,6 +2131,7 @@ EXPORT_SYMBOL_GPL(cpufreq_unregister_governor);
>  int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
>  {
>   struct cpufreq_policy *cpu_policy;
> +
>   if (!policy)
>   return -EINVAL;

We don't really need a patch for this, unless Rafael wants to apply
this one :)

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/1] fix cpufreq/cpufreq.c some coding style issues

2015-08-23 Thread Viresh Kumar
On 23-08-15, 21:09, Muhammad Falak R Wani wrote:
> Hi,
> 
>   This patch fixes issues in coding style, of a missing blank line after
> declarations.
> 
> Best,
> mfrw

This is as ugly as it could be. Please go through
Documentation/SubmittingPatches and other related stuff to see you to
send patches.

> Signed-off-by: Muhammad Falak R Wani 
> ---
>  drivers/cpufreq/cpufreq.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 8ae655c..5aea659 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -718,6 +718,7 @@ static ssize_t show_bios_limit(struct cpufreq_policy 
> *policy, char *buf)
>  {
>   unsigned int limit;
>   int ret;
> +
>   if (cpufreq_driver->bios_limit) {
>   ret = cpufreq_driver->bios_limit(policy->cpu, );
>   if (!ret)
> @@ -815,6 +816,7 @@ unlock:
>  static void cpufreq_sysfs_release(struct kobject *kobj)
>  {
>   struct cpufreq_policy *policy = to_policy(kobj);
> +
>   pr_debug("last reference is dropped\n");
>   complete(>kobj_unregister);
>  }
> @@ -2129,6 +2131,7 @@ EXPORT_SYMBOL_GPL(cpufreq_unregister_governor);
>  int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
>  {
>   struct cpufreq_policy *cpu_policy;
> +
>   if (!policy)
>   return -EINVAL;

And then these changes are all trivial and not at all important. We
don't want a patch for that even if checkpatch complains.

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: is this a problem of numactl in RedHat7.0 ?

2015-08-23 Thread Xishi Qiu
On 2015/8/22 4:53, Rik van Riel wrote:

> On 08/21/2015 05:27 AM, Xishi Qiu wrote:
>> I use numactl(--localalloc) tool run a test case, but it shows that
>> the numa policy is prefer, I don't know why.
> 
> The kernel implements MPOL_PREFERRED and MPOL_LOCAL
> in the same way. Look at this code in mpol_new(),
> in mm/mempolicy.c:
> 

user:
"numactl --localalloc" wil call
main()
  numa_set_localalloc()
setpol(MPOL_DEFAULT, numa_no_nodes_ptr);
  set_mempolicy()
syscall(__NR_set_mempolicy,mode,nmask,maxnode);

kernel:
do_set_mempolicy()
  mpol_new()
if (mode == MPOL_DEFAULT) {
if (nodes && !nodes_empty(*nodes))
return ERR_PTR(-EINVAL);
return NULL;  // return from here
}

> /*
>  * MPOL_PREFERRED cannot be used with MPOL_F_STATIC_NODES or
>  * MPOL_F_RELATIVE_NODES if the nodemask is empty (local allocation).
>  * All other modes require a valid pointer to a non-empty nodemask.
>  */
> if (mode == MPOL_PREFERRED) {
> if (nodes_empty(*nodes)) {
> if (((flags & MPOL_F_STATIC_NODES) ||
>  (flags & MPOL_F_RELATIVE_NODES)))
> return ERR_PTR(-EINVAL);
> }
> } else if (mode == MPOL_LOCAL) {
> if (!nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> mode = MPOL_PREFERRED;
> } else if (nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> 
> 
> 
> 



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


Re: [PATCH 1/1] fix cpufreq/cpufreq.c some coding style issues

2015-08-23 Thread Viresh Kumar
On 23-08-15, 21:19, Vaishali Thakkar wrote:
> 
> On 23 Aug 2015 21:05, "Muhammad Falak R Wani"  wrote:
> >
> > Hi,
> >
> >         This patch fixes issues in coding style, of a missing blank line
> after
> > declarations.
> >
> > Best,
> > mfrw
> 
> Please use subject lines and commit log matching the kernel coding style for
> the subsystem on patches.

And Vaishali, please don't send any mails in html. Please configure
your gmail client to send mails only in text.

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


.. one more last -rc after all

2015-08-23 Thread Linus Torvalds
So 4.2-rc8 is out, and that obviously means that I ended up deciding
to chicken out after all, and delay the 4.2 release one week.

It's not like there are any real outstanding issues, and I waffled
between just doing the release and doing another -rc. But we did have
another low-level x86 issue come up this week, and together with the
fact that a number of people are on vacation, I decided that waiting
an extra week isn't going to hurt. But it was close. It's a fairly
small rc8, and I really feel like it could have gone either way.

So rc8 isn't a big rc, and most of it is actually some last-minute
reverts for stuff that just wasn't quite ready. Mostly drivers, with
some networking, an x86 fix, and a smattering of perf tooling fixes.
The shortlog gives an overview of the details.

Linus
---

Adrian Hunter (3):
  perf tools: Avoid deadlock when map_groups are broken
  perf tools: Make fork event processing more resilient
  perf tools: Fix buildid processing

Adrien Schildknecht (1):
  mac80211: fix invalid read in minstrel_sort_best_tp_rates()

Alan Stern (1):
  SCSI: Fix NULL pointer dereference in runtime PM

Alban Crequy (1):
  cpuset: use trialcs->mems_allowed as a temp variable

Alexei Potashnik (1):
  target/iscsi: Fix double free of a TUR followed by a solicited NOPOUT

Andy Lutomirski (1):
  Revert "sched/x86_64: Don't save flags on context switch"

Andy Whitcroft (1):
  ipv4: off-by-one in continuation handling in /proc/net/route

Arnaldo Carvalho de Melo (1):
  perf top: Show backtrace when handling a SIGSEGV on --stdio mode

Axel Lin (2):
  ata: ahci_brcmstb: Fix misuse of IS_ENABLED
  FIRMWARE: bcm47xx_nvram: Fix module license.

Bjorn Helgaas (1):
  PCI: Don't use 64-bit bus addresses on PA-RISC

Calvin Owens (1):
  Revert "net: limit tcp/udp rmem/wmem to SOCK_{RCV,SND}BUF_MIN"

Chris Wilson (1):
  drm/i915: Flag the execlists context object as dirty after every use

Christoph Hellwig (1):
  Add hch to .get_maintainer.ignore

Claudiu Manoil (1):
  gianfar: Restore link state settings after MAC reset

Dan Carpenter (1):
  net: ethernet: micrel: fix an error code

Daniel Vetter (1):
  drm/i915: Only dither on 6bpc panels

Dave Airlie (1):
  drm/radeon: fix hotplug race at startup

David Härdeman (7):
  Revert "[media] rc: nuvoton-cir: Add support for writing wakeup
samples via sysfs filter callback"
  Revert "[media] rc: rc-loopback: Add loopback of filter scancodes"
  Revert "[media] rc: rc-core: Add support for encode_wakeup drivers"
  Revert "[media] rc: ir-rc6-decoder: Add encode capability"
  Revert "[media] rc: ir-rc5-decoder: Add encode capability"
  Revert "[media] rc: rc-ir-raw: Add Manchester encoder (phase
encoder) helper"
  Revert "[media] rc: rc-ir-raw: Add scancode encoder callback"

David Vrabel (1):
  x86/xen: make CONFIG_XEN depend on CONFIG_X86_LOCAL_APIC

David Ward (1):
  net: qmi_wwan: add HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module

Dmitry Torokhov (1):
  thermal: power_allocator: do not use devm* interfaces

Eric Dumazet (2):
  inet: fix potential deadlock in reqsk_queue_unlink()
  timer: Write timer->flags atomically

Fabio Estevam (1):
  [media] mantis: Fix error handling in mantis_dma_init()

Florian Fainelli (1):
  ata: ahci_brcmstb: Fix warnings with CONFIG_PM_SLEEP=n

Grygorii Strashko (6):
  genirq: Don't return ENOSYS in irq_chip_retrigger_hierarchy
  genirq: Introduce irq_chip_set_type_parent() helper
  irqchip/crossbar: Restore the irq_set_type() mechanism
  ARM: OMAP: wakeupgen: Restore the irq_set_type() mechanism
  irqchip/crossbar: Restore the mask on suspend behaviour
  irqchip/crossbar: Restore set_wake functionality

Guenter Roeck (1):
  clocksource/imx: Fix boot with non-DT systems

Guillaume Nault (1):
  ppp: fix device unregistration upon netns deletion

Hans de Goede (1):
  ACPI / video: Fix circular lock dependency issue in the video-detect code

Hariprasad S (1):
  iw_cxgb4: gracefully handle unknown CQE status errors

Herbert Xu (1):
  crypto: authencesn - Fix breakage with new ESP code

Hiral Shah (1):
  fnic: Use the local variable instead of I/O flag to acquire
io_req_lock in fnic_queuecommand() to avoid deadloack

Horia Geant? (1):
  crypto: caam - fix memory corruption in ahash_final_ctx

Igor Plyatov (1):
  net: phy: workaround for buggy cable detection by LAN8700 after
cable plugging

Ingo Molnar (2):
  x86/fpu/math-emu: Fix math-emu boot crash
  x86/fpu/math-emu: Fix crash in fork()

Ivan Vecera (1):
  be2net: avoid vxlan offloading on multichannel configs

Jan Stancek (1):
  crypto: nx - respect sg limit bounds when building sg lists for SHA

Jani Nikula (1):
  Revert "drm/i915: Allow parsing of variable size child device
entries from VBT"

Jiang Liu (1):
  x86/irq: Build correct vector mapping for multiple MSI 

Re: [PATCH v3 06/14] Documentation: drm/bridge: add document for analogix_dp

2015-08-23 Thread Krzysztof Kozlowski
On 24.08.2015 11:42, Yakir Yang wrote:
> Hi Krzysztof,
> 
> 在 08/23/2015 07:43 PM, Krzysztof Kozlowski 写道:
>> 2015-08-24 8:23 GMT+09:00 Rob Herring :
>>> On Wed, Aug 19, 2015 at 9:50 AM, Yakir Yang  wrote:
 Analogix dp driver is split from exynos dp driver, so we just
 make an copy of exynos_dp.txt, and then simplify exynos_dp.txt

 Beside update some exynos dtsi file with the latest change
 according to the devicetree binding documents.
>>> You can't just change the exynos bindings and break compatibility. Is
>>> there some agreement with exynos folks to do this?
>> No, there is no agreement. This wasn't even sent to Exynos maintainers.
> 
> Sorry about this one, actually I have add Exynos maintainers in version
> 1 & version 2,
> but lose some maintainers in version 3, I would fix it in bellow versions.
> 
>> Additionally the patchset did not look interesting to me because of
>> misleading subject - Documentation instead of "ARM: dts:".
>>
>> Yakir, please:
>> 1. Provide backward compatibility. Mark old properties as deprecated
>> but still support them.
> 
> Do you mean that I should keep the old properties declare in exynos-dp.txt,
> but just mark them as deprecated flag.

That is one of ways how to do this. However more important is that
driver should still support old bindings so such code:

-   if (of_property_read_u32(dp_node, "samsung,color-space",
+   if (of_property_read_u32(dp_node, "analogix,color-space",

is probably wrong. Will the driver support old DTB in the same way as it
was supporting before the change?

> Let me show same examples, make
> me understand your suggest rightly.

exynos-dp already contains deprecated properties. Other ways of doing
this would be:
Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
Documentation/devicetree/bindings/rtc/s3c-rtc.txt

It depends up to you. The "touchscreen" looks good because it organizes
old properties in a common section. In case of exynos-dp.txt you can add
at beginning of file information about new bindings and mark everything
deprecated.

> 
> 1. "samsung,ycbcr-coeff" is abandoned in latest analogix-dp driver,
> absolutely
> I should not carry this to analogix-dp.txt document. But I should
> keep this in
> exynos-dp.txt document, and mark them with an little "deprecated" flag.
> 
> [Documentation/devicetree/bindings/video/exynos_dp.txt]
> Required properties for dp-controller:
>[...]
> -samsung,ycbcr-coeff (DEPRECATED):
> YCbCr co-efficients for input video.
> COLOR_YCBCR601 = 0, COLOR_YCBCR709 = 1
> 
> Is it right ?

Yes, this is right.

> 
>> 2. Separate all DTS changes to a separate patch, unless bisectability
>> would be hurt. Anyway you should prepare it in a such way that
>> separation would be possible without breaking bisectability.
> 
> So I should separate this patch into two parts, one is name "Document:",
> the other is "ARM: dts: ".

Yes.

> 
> Honestly, I don't understand what the "bisectability" means in this case.

I was referring to bisectability in general. The patchset should be
fully bisectable which means that it does not introduce any issues
during "git bisect". This effectively means that at each intermediate
step (after applying each patch, one by one) every existing stuff works
the same as previously without any regression. Including booting with
old DTB.

> 
>> 3. Use proper subject for the patch changing DTS. This is not
>> documentation change!
> 
> Hmm... when I separate this patch into two parts, I though I can keep
> "Documentation" proper subject in this patch, and the other is the "ARM:
> dts"
> proper subject. Am I right ?

Yes, you're right.

> 
>> 4. Please use script get_maintainers to obtain list of valid
>> maintainers and CC-them with at least cover letter and patches
>> requiring their attention.
> 
> Yeah, thanks.

Sure. Now I found older versions of the patchset but previously there
were no changes to the bindings. Again the prefix in subject is
important to easily filter out and find necessary emails.

BTW, I like the patchset because I like in general works which merge
code and reduce duplicate stuff.

Best regards,
Krzysztof


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


Re: linux-next: build failure after merge of the net-next tree

2015-08-23 Thread Stephen Rothwell
Hi Dave,

On Sun, 23 Aug 2015 20:33:25 -0700 (PDT) David Miller  
wrote:
>
> From: Stephen Rothwell 
> Date: Mon, 24 Aug 2015 13:21:11 +1000
> 
> > After merging the net-next tree, today's linux-next build (arm
> > multi_v7_defconfig) failed like this:
> 
> Fixed by:
> 
> 
> [PATCH] route: fix breakage after moving lwtunnel state

Thanks, I will get that tomorrow.  I must try to remember to check to
see if you have added fixes to your tree when I get these errors (not
that it happens all that often).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the block tree with the btrfs tree

2015-08-23 Thread Stephen Rothwell
Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/inode.c

between commit:

  da2f0f74cf7d ("Btrfs: add support for blkio controllers")

from the btrfs tree and commit:

  b54ffb73cadc ("block: remove bio_get_nr_vecs()")

from the block tree.

I fixed it up (following Chris's example merge - see below) and can
carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/btrfs/inode.c
index bda3c41dc9d5,f924d9a62700..
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -7986,12 -7958,7 +7987,11 @@@ out
  static struct bio *btrfs_dio_bio_alloc(struct block_device *bdev,
   u64 first_sector, gfp_t gfp_flags)
  {
-   int nr_vecs = bio_get_nr_vecs(bdev);
 -  return btrfs_bio_alloc(bdev, first_sector, BIO_MAX_PAGES, gfp_flags);
 +  struct bio *bio;
-   bio = btrfs_bio_alloc(bdev, first_sector, nr_vecs, gfp_flags);
++  bio = btrfs_bio_alloc(bdev, first_sector, BIO_MAX_PAGES, gfp_flags);
 +  if (bio)
 +  bio_associate_current(bio);
 +  return bio;
  }
  
  static inline int btrfs_lookup_and_bind_dio_csum(struct btrfs_root *root,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the block tree with the btrfs tree

2015-08-23 Thread Stephen Rothwell
Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/scrub.c

between commit:

  4246a0b63bd8 ("block: add a bi_error field to struct bio")

from the btrfs tree and commit:

  03679ade86b2 ("Btrfs: remove misleading handling of missing device scrub")

from the block tree.

I fixed it up (using Chris' example merge - see below) and can carry
the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/btrfs/scrub.c
index c69c75e7b841,9c146d8307b5..
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@@ -2174,134 -2165,6 +2161,134 @@@ again
return 0;
  }
  
- static void scrub_missing_raid56_end_io(struct bio *bio, int error)
++static void scrub_missing_raid56_end_io(struct bio *bio)
 +{
 +  struct scrub_block *sblock = bio->bi_private;
 +  struct btrfs_fs_info *fs_info = sblock->sctx->dev_root->fs_info;
 +
-   if (error)
++  if (bio->bi_error)
 +  sblock->no_io_error_seen = 0;
 +
 +  btrfs_queue_work(fs_info->scrub_workers, >work);
 +}
 +
 +static void scrub_missing_raid56_worker(struct btrfs_work *work)
 +{
 +  struct scrub_block *sblock = container_of(work, struct scrub_block, 
work);
 +  struct scrub_ctx *sctx = sblock->sctx;
 +  struct btrfs_fs_info *fs_info = sctx->dev_root->fs_info;
 +  unsigned int is_metadata;
 +  unsigned int have_csum;
 +  u8 *csum;
 +  u64 generation;
 +  u64 logical;
 +  struct btrfs_device *dev;
 +
 +  is_metadata = !(sblock->pagev[0]->flags & BTRFS_EXTENT_FLAG_DATA);
 +  have_csum = sblock->pagev[0]->have_csum;
 +  csum = sblock->pagev[0]->csum;
 +  generation = sblock->pagev[0]->generation;
 +  logical = sblock->pagev[0]->logical;
 +  dev = sblock->pagev[0]->dev;
 +
 +  if (sblock->no_io_error_seen) {
 +  scrub_recheck_block_checksum(fs_info, sblock, is_metadata,
 +   have_csum, csum, generation,
 +   sctx->csum_size);
 +  }
 +
 +  if (!sblock->no_io_error_seen) {
 +  spin_lock(>stat_lock);
 +  sctx->stat.read_errors++;
 +  spin_unlock(>stat_lock);
 +  printk_ratelimited_in_rcu(KERN_ERR
 +  "BTRFS: I/O error rebulding logical %llu for dev %s\n",
 +  logical, rcu_str_deref(dev->name));
 +  } else if (sblock->header_error || sblock->checksum_error) {
 +  spin_lock(>stat_lock);
 +  sctx->stat.uncorrectable_errors++;
 +  spin_unlock(>stat_lock);
 +  printk_ratelimited_in_rcu(KERN_ERR
 +  "BTRFS: failed to rebuild valid logical %llu for dev 
%s\n",
 +  logical, rcu_str_deref(dev->name));
 +  } else {
 +  scrub_write_block_to_dev_replace(sblock);
 +  }
 +
 +  scrub_block_put(sblock);
 +
 +  if (sctx->is_dev_replace &&
 +  atomic_read(>wr_ctx.flush_all_writes)) {
 +  mutex_lock(>wr_ctx.wr_lock);
 +  scrub_wr_submit(sctx);
 +  mutex_unlock(>wr_ctx.wr_lock);
 +  }
 +
 +  scrub_pending_bio_dec(sctx);
 +}
 +
 +static void scrub_missing_raid56_pages(struct scrub_block *sblock)
 +{
 +  struct scrub_ctx *sctx = sblock->sctx;
 +  struct btrfs_fs_info *fs_info = sctx->dev_root->fs_info;
 +  u64 length = sblock->page_count * PAGE_SIZE;
 +  u64 logical = sblock->pagev[0]->logical;
 +  struct btrfs_bio *bbio;
 +  struct bio *bio;
 +  struct btrfs_raid_bio *rbio;
 +  int ret;
 +  int i;
 +
 +  ret = btrfs_map_sblock(fs_info, REQ_GET_READ_MIRRORS, logical, ,
 + , 0, 1);
 +  if (ret || !bbio || !bbio->raid_map)
 +  goto bbio_out;
 +
 +  if (WARN_ON(!sctx->is_dev_replace ||
 +  !(bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK))) {
 +  /*
 +   * We shouldn't be scrubbing a missing device. Even for dev
 +   * replace, we should only get here for RAID 5/6. We either
 +   * managed to mount something with no mirrors remaining or
 +   * there's a bug in scrub_remap_extent()/btrfs_map_block().
 +   */
 +  goto bbio_out;
 +  }
 +
 +  bio = btrfs_io_bio_alloc(GFP_NOFS, 0);
 +  if (!bio)
 +  goto bbio_out;
 +
 +  bio->bi_iter.bi_sector = logical >> 9;
 +  bio->bi_private = sblock;
 +  bio->bi_end_io = scrub_missing_raid56_end_io;
 +
 +  rbio = raid56_alloc_missing_rbio(sctx->dev_root, bio, bbio, length);
 +  if (!rbio)
 +  goto rbio_out;
 +
 +  for (i = 0; i < sblock->page_count; i++) {
 +  struct scrub_page *spage = sblock->pagev[i];
 +
 +  raid56_add_scrub_pages(rbio, spage->page, spage->logical);
 +  }
 +
 +  btrfs_init_work(>work, btrfs_scrub_helper,
 +   

linux-next: manual merge of the block tree with the btrfs tree

2015-08-23 Thread Stephen Rothwell
Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/raid56.c

between commit:

  b4ee1782686d ("Btrfs: add RAID 5/6 BTRFS_RBIO_REBUILD_MISSING operation")

from the btrfs tree and commit:

  4246a0b63bd8 ("block: add a bi_error field to struct bio")

from the block tree.

I fixed it up (using Chris's example merge - see below) and can carry
the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc fs/btrfs/raid56.c
index 6fe2613ef288,0a02e24900aa..
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@@ -1975,9 -1960,7 +1971,9 @@@ cleanup_io
else
clear_bit(RBIO_CACHE_READY_BIT, >flags);
  
-   rbio_orig_end_io(rbio, err, err == 0);
+   rbio_orig_end_io(rbio, err);
 +  } else if (rbio->operation == BTRFS_RBIO_REBUILD_MISSING) {
-   rbio_orig_end_io(rbio, err, err == 0);
++  rbio_orig_end_io(rbio, err);
} else if (err == 0) {
rbio->faila = -1;
rbio->failb = -1;
@@@ -2114,9 -2096,8 +2109,9 @@@ out
return 0;
  
  cleanup:
 -  if (rbio->operation == BTRFS_RBIO_READ_REBUILD)
 +  if (rbio->operation == BTRFS_RBIO_READ_REBUILD ||
 +  rbio->operation == BTRFS_RBIO_REBUILD_MISSING)
-   rbio_orig_end_io(rbio, -EIO, 0);
+   rbio_orig_end_io(rbio, -EIO);
return -EIO;
  }
  
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the block tree with the btrfs tree

2015-08-23 Thread Stephen Rothwell
Hi Jens,

Today's linux-next merge of the block tree got a conflict in:

  fs/btrfs/volumes.c

between commits:

  da2f0f74cf7d ("Btrfs: add support for blkio controllers")
  3a9508b0221d ("btrfs: fix compile when block cgroups are not enabled")

from the btrfs tree and commit:

  0e28997ec476 ("btrfs: remove bio splitting and merge_bvec_fn() calls")

from the block tree.

I fixed it up (I removed breakup_stripe_bio) and can carry the fix as
necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: drm/layerscape: Add Freescale DCU DRM driver

2015-08-23 Thread Jianwei Wang
Hi Andreas,

Sorry for the late reply. Yes, this driver should also work on the
arm64 SOCs using DCU in the future. So I did some prepare for adapting
arm64 SOCs. But for now, It only support 32bit arm SOCs.

Regards,

Jianwei.

On Fri, Aug 21, 2015 at 9:41 PM, Andreas Ruprecht
 wrote:
> Hi Jianwei,
>
> your commit 109eee2f2a18 ("drm/layerscape: Add Freescale DCU DRM
> driver") showed up in linux-next today (i.e., next-20150821). I noticed
> it because we are running a daily analysis on the newest linux-next tree
> as part of our research.
>
> In the source code of fsl_dcu_drm_drv.c, there is the following #ifdef:
>  #ifdef CONFIG_COMPAT
> .compat_ioctl   = drm_compat_ioctl,
>  #endif
>
> The Kconfig option for the driver, however, states that the driver can
> only be built with CONFIG_ARM enabled:
>
> config DRM_FSL_DCU
>tristate "DRM Support for Freescale DCU"
>depends on DRM && OF && ARM
>[...]
>
> Inside arch/arm/, however, there is no definition of CONFIG_COMPAT (note
> that there is one in arch/arm64/, but the driver explicitely needs
> CONFIG_ARM), so the #ifdef block above can never be compiled in the
> current state. Is this intended?
>
> Regards,
>
> Andreas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: drm/layerscape: Add Freescale DCU DRM driver

2015-08-23 Thread Jianwei Wang
On Fri, Aug 21, 2015 at 9:41 PM, Andreas Ruprecht
 wrote:
> Hi Jianwei,
>
> your commit 109eee2f2a18 ("drm/layerscape: Add Freescale DCU DRM
> driver") showed up in linux-next today (i.e., next-20150821). I noticed
> it because we are running a daily analysis on the newest linux-next tree
> as part of our research.
>
> In the source code of fsl_dcu_drm_drv.c, there is the following #ifdef:
>  #ifdef CONFIG_COMPAT
> .compat_ioctl   = drm_compat_ioctl,
>  #endif
>
> The Kconfig option for the driver, however, states that the driver can
> only be built with CONFIG_ARM enabled:
>
> config DRM_FSL_DCU
>tristate "DRM Support for Freescale DCU"
>depends on DRM && OF && ARM
>[...]
>
> Inside arch/arm/, however, there is no definition of CONFIG_COMPAT (note
> that there is one in arch/arm64/, but the driver explicitely needs
> CONFIG_ARM), so the #ifdef block above can never be compiled in the
> current state. Is this intended?
>
> Regards,
>
> Andreas


Hi Andreas,

Sorry for the late reply. Yes, this driver should also work on the
arm64 SOCs using DCU in the future. So I did some prepare for adapting
arm64 SOCs. But for now, It only support 32bit arm SOCs.

Regards,

Jianwei.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/7] selftests: add CFLAGS_EXTRA

2015-08-23 Thread Michael Ellerman
On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> One may pass the "-I /path/to/headers -L /path/to/lib" through
> CFLAGS_EXTRA for cross compiling. mqueue could compile pass
> in this way when we provide the popt.h and libpopt.so. And kdbus
> could compile pass with sys/capability and libcap.so

There should be no need to define a new variable.

You should just update the relevant Makefiles to use CFLAGS += rather than
CFLAGS =. And then you can just specifiy CFLAGS on the command line.

cheers


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


Re: [PATCH 5/7] selftests: disable seccomp for arm64

2015-08-23 Thread Michael Ellerman
On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> Currently, seccomp need the __NR_poll which is not supported
> by arm64(There is only __NR_ppoll). I am not sure we should
> skip this test testcase or update the seccomp without __NR_poll.

You should fix or skip the test that needs __NR_poll, not skip the entire test
suite.

You should also CC the author of the tests, they might be able to help you.

cheers



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


Re: [PATCH] net/wireless: enable wiphy device to suspend/resume asynchronously

2015-08-23 Thread Fu, Zhonghui


On 2015/8/17 16:46, Arend van Spriel wrote:
> + Rafael
>
> On 08/17/2015 09:29 AM, Johannes Berg wrote:
>> On Mon, 2015-08-17 at 09:48 +0800, Fu, Zhonghui wrote:
>>>
>>> The suspend/resume timing of wiphy device and related devices will be
>>> ensured by their parent/child relationship. So, enabling wiphy device
>>> to suspend/resume asynchronously does not change any  dependency. It
>>> can only take advantage of multicore and improve system
>>> suspend/resume speed.
>>>
>>
>> You're going to have to explain that to me, because I don't see that.
>> All I see is that when looking at a device, if async is possible, it
>> gets added to an async work, and if async is not possible then it gets
>> done immediately. Even putting aside the question of whether or not
>> async is ordered or not (I don't know), if the wiphy is async and the
>> PCI (or other bus) device isn't, then it seems they could get handled
>> out of order, no? Or is there some magic code somewhere that I'm
>> missing that explicitly waits for the async of the parent/child
>> relationship?
>
> This patch got me worried as well. Can't find the magic either. Maybe Rafael 
> can give some hints here.

"dpm_wait_for_children" function will be invoked in "__device_suspend", 
"__device_suspend_late", and "__device_suspend_noirq" functions to synchronize 
the child relationship. "dpm_wait" function will be invoked in 
"device_resume_noirq", "device_resume_early", and "device_resume" functions to 
synchronize the parent relationship. If two devices have parent/child 
relationship, but different suspend/resume mode(sync or async), this will have 
no impact to PM timing order between them. Because all devices will use 
"__device_suspend", "__device_suspend_late" ... functions to complete their PM 
transition.


Thanks,
Zhonghui 
>
> Regards,
> Arend
>
>> johannes
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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


[PATCH v3 2/4] spi: mediatek: replace int with u32, delete TAB and define MTK_SPI_PAUSE_INT_STATUS marco

2015-08-23 Thread Leilk Liu
this patch replaces int with u32, deletes TAB, and defines
MTK_SPI_PAUSE_INT_STATUS marco.

Signed-off-by: Leilk Liu 
---
 drivers/spi/spi-mt65xx.c | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index fe4eda3..f81618c 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -67,6 +67,8 @@
 
 #define MT8173_SPI_MAX_PAD_SEL 3
 
+#define MTK_SPI_PAUSE_INT_STATUS 0x2
+
 #define MTK_SPI_IDLE 0
 #define MTK_SPI_PAUSED 1
 
@@ -179,7 +181,7 @@ static int mtk_spi_prepare_hardware(struct spi_master 
*master)
 
trans = list_first_entry(>transfers, struct spi_transfer,
 transfer_list);
-   if (trans->cs_change == 0) {
+   if (!trans->cs_change) {
mdata->state = MTK_SPI_IDLE;
mtk_spi_reset(mdata);
}
@@ -269,11 +271,11 @@ static void mtk_spi_setup_packet(struct spi_master 
*master)
u32 packet_size, packet_loop, reg_val;
struct mtk_spi *mdata = spi_master_get_devdata(master);
 
-   packet_size = min_t(unsigned, mdata->xfer_len, MTK_SPI_PACKET_SIZE);
+   packet_size = min_t(u32, mdata->xfer_len, MTK_SPI_PACKET_SIZE);
packet_loop = mdata->xfer_len / packet_size;
 
reg_val = readl(mdata->base + SPI_CFG1_REG);
-   reg_val &= ~(SPI_CFG1_PACKET_LENGTH_MASK + SPI_CFG1_PACKET_LOOP_MASK);
+   reg_val &= ~(SPI_CFG1_PACKET_LENGTH_MASK | SPI_CFG1_PACKET_LOOP_MASK);
reg_val |= (packet_size - 1) << SPI_CFG1_PACKET_LENGTH_OFFSET;
reg_val |= (packet_loop - 1) << SPI_CFG1_PACKET_LOOP_OFFSET;
writel(reg_val, mdata->base + SPI_CFG1_REG);
@@ -281,7 +283,7 @@ static void mtk_spi_setup_packet(struct spi_master *master)
 
 static void mtk_spi_enable_transfer(struct spi_master *master)
 {
-   int cmd;
+   u32 cmd;
struct mtk_spi *mdata = spi_master_get_devdata(master);
 
cmd = readl(mdata->base + SPI_CMD_REG);
@@ -292,9 +294,9 @@ static void mtk_spi_enable_transfer(struct spi_master 
*master)
writel(cmd, mdata->base + SPI_CMD_REG);
 }
 
-static int mtk_spi_get_mult_delta(int xfer_len)
+static int mtk_spi_get_mult_delta(u32 xfer_len)
 {
-   int mult_delta;
+   u32 mult_delta;
 
if (xfer_len > MTK_SPI_PACKET_SIZE)
mult_delta = xfer_len % MTK_SPI_PACKET_SIZE;
@@ -435,7 +437,7 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)
struct spi_transfer *trans = mdata->cur_transfer;
 
reg_val = readl(mdata->base + SPI_STATUS0_REG);
-   if (reg_val & 0x2)
+   if (reg_val & MTK_SPI_PAUSE_INT_STATUS)
mdata->state = MTK_SPI_PAUSED;
else
mdata->state = MTK_SPI_IDLE;
@@ -498,7 +500,7 @@ static int mtk_spi_probe(struct platform_device *pdev)
struct mtk_spi *mdata;
const struct of_device_id *of_id;
struct resource *res;
-   int irq, ret;
+   int irq, ret;
 
master = spi_alloc_master(>dev, sizeof(*mdata));
if (!master) {
-- 
1.8.1.1.dirty

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


[PATCH v3 3/4] spi: mediatek: add PM clk_prepare_enable fail flow

2015-08-23 Thread Leilk Liu
This patch adds PM clk_prepare_enable fail flow.

Signed-off-by: Leilk Liu 
---
 drivers/spi/spi-mt65xx.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index f81618c..e14f583 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -665,8 +665,10 @@ static int mtk_spi_resume(struct device *dev)
 
if (!pm_runtime_suspended(dev)) {
ret = clk_prepare_enable(mdata->spi_clk);
-   if (ret < 0)
+   if (ret < 0) {
+   dev_err(dev, "failed to enable spi_clk (%d)\n", ret);
return ret;
+   }
}
 
ret = spi_master_resume(master);
@@ -692,8 +694,15 @@ static int mtk_spi_runtime_resume(struct device *dev)
 {
struct spi_master *master = dev_get_drvdata(dev);
struct mtk_spi *mdata = spi_master_get_devdata(master);
+   int ret;
+
+   ret = clk_prepare_enable(mdata->spi_clk);
+   if (ret < 0) {
+   dev_err(dev, "failed to enable spi_clk (%d)\n", ret);
+   return ret;
+   }
 
-   return clk_prepare_enable(mdata->spi_clk);
+   return 0;
 }
 #endif /* CONFIG_PM */
 
-- 
1.8.1.1.dirty

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


[PATCH v3 4/4] spi: mediatek: replace *_time name

2015-08-23 Thread Leilk Liu
This patch replaces *_time name in mtk_spi_prepare_transfer().

Signed-off-by: Leilk Liu 
---
 drivers/spi/spi-mt65xx.c | 20 
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index e14f583..eaadc7e 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -238,8 +238,7 @@ static void mtk_spi_set_cs(struct spi_device *spi, bool 
enable)
 static void mtk_spi_prepare_transfer(struct spi_master *master,
 struct spi_transfer *xfer)
 {
-   u32 spi_clk_hz, div, high_time, low_time, holdtime,
-   setuptime, cs_idletime, reg_val = 0;
+   u32 spi_clk_hz, div, sck_time, cs_time, reg_val = 0;
struct mtk_spi *mdata = spi_master_get_devdata(master);
 
spi_clk_hz = clk_get_rate(mdata->spi_clk);
@@ -248,21 +247,18 @@ static void mtk_spi_prepare_transfer(struct spi_master 
*master,
else
div = 1;
 
-   high_time = (div + 1) / 2;
-   low_time = (div + 1) / 2;
-   holdtime = (div + 1) / 2 * 2;
-   setuptime = (div + 1) / 2 * 2;
-   cs_idletime = (div + 1) / 2 * 2;
+   sck_time = (div + 1) / 2;
+   cs_time = sck_time * 2;
 
-   reg_val |= (((high_time - 1) & 0xff) << SPI_CFG0_SCK_HIGH_OFFSET);
-   reg_val |= (((low_time - 1) & 0xff) << SPI_CFG0_SCK_LOW_OFFSET);
-   reg_val |= (((holdtime - 1) & 0xff) << SPI_CFG0_CS_HOLD_OFFSET);
-   reg_val |= (((setuptime - 1) & 0xff) << SPI_CFG0_CS_SETUP_OFFSET);
+   reg_val |= (((sck_time - 1) & 0xff) << SPI_CFG0_SCK_HIGH_OFFSET);
+   reg_val |= (((sck_time - 1) & 0xff) << SPI_CFG0_SCK_LOW_OFFSET);
+   reg_val |= (((cs_time - 1) & 0xff) << SPI_CFG0_CS_HOLD_OFFSET);
+   reg_val |= (((cs_time - 1) & 0xff) << SPI_CFG0_CS_SETUP_OFFSET);
writel(reg_val, mdata->base + SPI_CFG0_REG);
 
reg_val = readl(mdata->base + SPI_CFG1_REG);
reg_val &= ~SPI_CFG1_CS_IDLE_MASK;
-   reg_val |= (((cs_idletime - 1) & 0xff) << SPI_CFG1_CS_IDLE_OFFSET);
+   reg_val |= (((cs_time - 1) & 0xff) << SPI_CFG1_CS_IDLE_OFFSET);
writel(reg_val, mdata->base + SPI_CFG1_REG);
 }
 
-- 
1.8.1.1.dirty

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


[PATCHi v3 0/4] Fixup mediatek spi driver

2015-08-23 Thread Leilk Liu
From: Leilk Liu 

This series are based on 4.2-rc1 and provide four patches to fix mediatek spi 
driver.

Change in v3:
1. The follow patches are applied, so remove them from series:
  - spi: mediatek: fix spi incorrect endian usage
  - spi: medaitek: revise quirks compatibility style
  - spi: mediatek: use BIT() to instead of SPI_CMD_*_OFFSET
2. The patch "spi: mediatek: revise coding style" title is not clear, so split 
it to four patches.

Change in v2:
1. The patch "spi: mediatek: remove redundant clock in 
prepare_hardware/unprepare_hardware" 
   is applied, so remove it from series.
2. fix incorrect endian usage to support little-endian and big-endian system.
3. revise quirks style to bool.
4. use BIT() to instead of SPI_CMD_*_OFFSET.
5. revise coding style, such as time name, and variable type. 

Leilk Liu (4):
  spi: mediatek: add linux/io.h include file
  spi: mediatek: replace int with u32, delete TAB and define
MTK_SPI_PAUSE_INT_STATUS marco
  spi: mediatek: add PM clk_prepare_enable fail flow
  spi: mediatek: replace *_time name

 drivers/spi/spi-mt65xx.c | 52 
 1 file changed, 30 insertions(+), 22 deletions(-)

--
1.8.1.1.dirty

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


[PATCH v3 1/4] spi: mediatek: add linux/io.h include file

2015-08-23 Thread Leilk Liu
mediatek spi driver uses readl/writel, so add linux/io.h,
even so it's implicitly imported by spi/spi.h

Signed-off-by: Leilk Liu 
---
 drivers/spi/spi-mt65xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 43c1dd5..fe4eda3 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
1.8.1.1.dirty

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


drm/radeon: take the mode_config mutex when dealing with hpds (v2) crashes

2015-08-23 Thread Joerg Platte

Dear Alex,

on my old P4 based non-SMP router your patch (commit 
32d12fc20e3c726ca858d0e5055fb596fce2f8bc in linux stable) crashes on 
Linux 4.1.4 and above. I was only able to take a picture of the whole 
trace https://ferdi.naasa.net/url/jplatte/IMG_3116.JPG


Reverting the patch resolves the issue.

This is my old graphics hardware:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. 
[AMD/ATI] RV100 [Radeon 7000 / Radeon VE]


Just for the reference, here is the full patch:
commit 32d12fc20e3c726ca858d0e5055fb596fce2f8bc
Author: Alex Deucher 
Date:   Fri May 15 11:48:52 2015 -0400

drm/radeon: take the mode_config mutex when dealing with hpds (v2)

commit 39fa10f7e21574a70cecf1fed0f9b36535aa68a0 upstream.

Since we are messing with state in the worker.

v2: drop the changes in the mst worker

Signed-off-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 

diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
b/drivers/gpu/drm/radeon/radeon_irq_kms.c

index 7162c93..f682e53 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -79,10 +79,12 @@ static void radeon_hotplug_work_func(struct 
work_struct *work)

struct drm_mode_config *mode_config = >mode_config;
struct drm_connector *connector;

+   mutex_lock(_config->mutex);
if (mode_config->num_connector) {
list_for_each_entry(connector, 
_config->connector_list, head)

radeon_connector_hotplug(connector);
}
+   mutex_unlock(_config->mutex);
/* Just fire off a uevent and let userspace tell us what to do */
drm_helper_hpd_irq_event(dev);
 }

Is it possible that the mutex is not defined on non-SMP systems? Can you 
help to resolve this regression?


Best regards,
Joerg
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: build failure after merge of the net-next tree

2015-08-23 Thread David Miller
From: Stephen Rothwell 
Date: Mon, 24 Aug 2015 13:21:11 +1000

> After merging the net-next tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:

Fixed by:


[PATCH] route: fix breakage after moving lwtunnel state

__recnt and related fields need to be in its own cacheline for performance
reasons. Commit 61adedf3e3f1 ("route: move lwtunnel state to dst_entry")
broke that on 32bit archs, causing BUILD_BUG_ON in dst_hold to be triggered.

This patch fixes the breakage by moving the lwtunnel state to the end of
dst_entry on 32bit archs. Unfortunately, this makes it share the cacheline
with __refcnt and may affect performance, thus further patches may be
needed.

Reported-by: kbuild test robot 
Fixes: 61adedf3e3f1 ("route: move lwtunnel state to dst_entry")
Signed-off-by: Jiri Benc 
Signed-off-by: David S. Miller 
---
 include/net/dst.h | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/net/dst.h b/include/net/dst.h
index 0a9a723..ef8f1d4 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -44,7 +44,6 @@ struct dst_entry {
 #else
void*__pad1;
 #endif
-   struct lwtunnel_state   *lwtstate;
int (*input)(struct sk_buff *);
int (*output)(struct sock *sk, struct sk_buff *skb);
 
@@ -85,11 +84,12 @@ struct dst_entry {
__u32   __pad2;
 #endif
 
+#ifdef CONFIG_64BIT
+   struct lwtunnel_state   *lwtstate;
/*
 * Align __refcnt to a 64 bytes alignment
 * (L1_CACHE_SIZE would be too much)
 */
-#ifdef CONFIG_64BIT
long__pad_to_align_refcnt[1];
 #endif
/*
@@ -99,6 +99,9 @@ struct dst_entry {
atomic_t__refcnt;   /* client references*/
int __use;
unsigned long   lastuse;
+#ifndef CONFIG_64BIT
+   struct lwtunnel_state   *lwtstate;
+#endif
union {
struct dst_entry*next;
struct rtable __rcu *rt_next;
-- 
2.1.0

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


Re: [PATCH 1/2] watchdog: bcm7038: add device tree binding documentation

2015-08-23 Thread Guenter Roeck

Hi Justin,

On 08/20/2015 10:41 AM, Justin Chen wrote:

Add device tree binding docmentation for the watchdog hardware block
on bcm7038 and newer SoCs.

Signed-off-by: Justin Chen 
---
  .../devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt | 19 +++
  1 file changed, 19 insertions(+)
  create mode 100644 
Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt

diff --git a/Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt
new file mode 100644
index 000..adb8260
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt
@@ -0,0 +1,19 @@
+BCM7038 Watchdog timer
+
+Required properties:
+
+- compatible : should be "brcm,bcm7038-wdt"
+- reg : Specifies base physical address and size of the registers.
+
+Optional properties:
+
+- clocks: the clock running the watchdog
+- clock-frequency: the rate of the clock


Is 'clock-frequency' really needed (and useful), or would it make more sense
to expect the user to configure a fixed clock if nothing else is available ?
How do other drivers handle this ?

Thanks,
Guenter


+
+Example:
+
+watchdog {
+   compatible = "brcm,bcm7038-wdt";
+   clocks = <_fixed>;
+   reg = <0xf040a7e8 0x16>;
+};



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


Re: is this a problem of numactl in RedHat7.0 ?

2015-08-23 Thread Xishi Qiu
On 2015/8/22 4:53, Rik van Riel wrote:

> On 08/21/2015 05:27 AM, Xishi Qiu wrote:
>> I use numactl(--localalloc) tool run a test case, but it shows that
>> the numa policy is prefer, I don't know why.
> 
> The kernel implements MPOL_PREFERRED and MPOL_LOCAL
> in the same way. Look at this code in mpol_new(),
> in mm/mempolicy.c:
> 
> /*
>  * MPOL_PREFERRED cannot be used with MPOL_F_STATIC_NODES or
>  * MPOL_F_RELATIVE_NODES if the nodemask is empty (local allocation).
>  * All other modes require a valid pointer to a non-empty nodemask.
>  */
> if (mode == MPOL_PREFERRED) {
> if (nodes_empty(*nodes)) {
> if (((flags & MPOL_F_STATIC_NODES) ||
>  (flags & MPOL_F_RELATIVE_NODES)))
> return ERR_PTR(-EINVAL);
> }
> } else if (mode == MPOL_LOCAL) {
> if (!nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> mode = MPOL_PREFERRED;
> } else if (nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> 

Hi Rik,

Thank you for your reply. I find the reason is this patch,
and it is not backport to RedHat 7.0

8790c71a18e5d2d93532ae250bcf5eddbba729cd

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 873de7e..ae3c8f3 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2930,7 +2930,7 @@ void mpol_to_str(char *buffer, int maxlen, struct 
mempolicy *pol)
unsigned short mode = MPOL_DEFAULT;
unsigned short flags = 0;

-   if (pol && pol != _policy) {
+   if (pol && pol != _policy && !(pol->flags & MPOL_F_MORON)) {
mode = pol->mode;
flags = pol->flags;
}

Thanks,
Xishi Qiu

> 
> 
> 



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


Re: [PATCH 2/3] kvm: don't register wildcard MMIO EVENTFD on two buses

2015-08-23 Thread Jason Wang


On 08/21/2015 05:29 PM, Cornelia Huck wrote:
> On Fri, 21 Aug 2015 16:03:52 +0800
> Jason Wang  wrote:
>
>
>> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
>> index 9ff4193..834a409 100644
>> --- a/virt/kvm/eventfd.c
>> +++ b/virt/kvm/eventfd.c
>> @@ -838,11 +838,6 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct 
>> kvm_ioeventfd *args)
>>  
>>  kvm_iodevice_init(>dev, _ops);
>>  
>> -ret = kvm_io_bus_register_dev(kvm, bus_idx, p->addr, p->length,
>> -  >dev);
>> -if (ret < 0)
>> -goto unlock_fail;
>> -
>>  /* When length is ignored, MMIO is also put on a separate bus, for
>>   * faster lookups.
> You probably want to change this comment as well?

Yes.

>
>>   */
>> @@ -850,9 +845,15 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct 
>> kvm_ioeventfd *args)
> Unfortunately snipped by diff, but the check here is on !len && !PIO,
> which only does the desired thing as VIRTIO_CCW always uses len == 8.
> Should the check be for !len && MMIO instead?

I think the answer depends on whether len == 0 is valid for ccw. If not
we can fail the assign earlier. Since even without this patch, if
userspace tries to register a dev with len equals to zero, it will also
be registered to KVM_FAST_MMIO_BUS. If yes, we need check as you
suggested here.

>
>>  ret = kvm_io_bus_register_dev(kvm, KVM_FAST_MMIO_BUS,
>>p->addr, 0, >dev);
>>  if (ret < 0)
>> -goto register_fail;
>> +goto unlock_fail;
>> +} else {
>> +ret = kvm_io_bus_register_dev(kvm, bus_idx, p->addr, p->length,
>> +  >dev);
>> +if (ret < 0)
>> +goto unlock_fail;
>>  }
> Hm... maybe the following would be more obvious:
>
> my_bus = (p->length == 0) && (bus_idx == KVM_MMIO_BUS) ? KVM_FAST_MMIO_BUS : 
> bus_idx;
> ret = kvm_io_bus_register_dev(kvm, my_bus, p->addr, p->length, >dev); 
>
>>  
>> +
>>  kvm->buses[bus_idx]->ioeventfd_count++;
>>  list_add_tail(>list, >ioeventfds);
> (...)
>
>> @@ -900,10 +899,11 @@ kvm_deassign_ioeventfd(struct kvm *kvm, struct 
>> kvm_ioeventfd *args)
>>  if (!p->wildcard && p->datamatch != args->datamatch)
>>  continue;
>>  
>> -kvm_io_bus_unregister_dev(kvm, bus_idx, >dev);
>>  if (!p->length) {
>>  kvm_io_bus_unregister_dev(kvm, KVM_FAST_MMIO_BUS,
>>>dev);
>> +} else {
>> +kvm_io_bus_unregister_dev(kvm, bus_idx, >dev);
>>  }
> Similar comments here... do you want to check for bus_idx ==
> KVM_MMIO_BUS as well?

Good catch. I think keep the original code as is will be also ok to
solve this. (with changing the bus_idx to KVM_FAST_MMIO_BUS during
registering if it was an wildcard mmio).

>
>>  kvm->buses[bus_idx]->ioeventfd_count--;
>>  ioeventfd_release(p);

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


Re: [PATCH 2/2] watchdog: Watchdog driver for Broadcom Set-Top Box

2015-08-23 Thread Guenter Roeck

Hi Justin,

On 08/20/2015 10:41 AM, Justin Chen wrote:

Watchdog driver for Broadcom 7038 and newer chips.

Signed-off-by: Justin Chen 


Looks pretty good. Couple of comments below.

Thanks,
Guenter


---
  drivers/watchdog/Kconfig   |   8 ++
  drivers/watchdog/Makefile  |   1 +
  drivers/watchdog/bcm7038_wdt.c | 253 +
  3 files changed, 262 insertions(+)
  create mode 100644 drivers/watchdog/bcm7038_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 241fafd..4fbe8ab 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1291,6 +1291,14 @@ config BCM_KONA_WDT_DEBUG

  If in doubt, say 'N'.

+config BCM7038_WDT
+   tristate "BCM7038 Watchdog"
+   select WATCHDOG_CORE
+   help
+Watchdog driver for the built-in hardware in Broadcom 7038 SoCs.
+
+Say 'Y or 'M' here to enable the driver.
+
  config IMGPDC_WDT
tristate "Imagination Technologies PDC Watchdog Timer"
depends on HAS_IOMEM
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 59ea9a1..65d4169 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -66,6 +66,7 @@ obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_wdt.o
  obj-$(CONFIG_MESON_WATCHDOG) += meson_wdt.o
  obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
  obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
+obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o


Can you try to insert this in alphabetic order ?


  # AVR32 Architecture
  obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c
new file mode 100644
index 000..a70730b
--- /dev/null
+++ b/drivers/watchdog/bcm7038_wdt.c
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2015 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+

Please order include files in alphabetic order.


+#define WDT_START_10xff00
+#define WDT_START_20x00ff
+#define WDT_STOP_1 0xee00
+#define WDT_STOP_2 0x00ee
+
+#define WDT_TIMEOUT_REG0x0
+#define WDT_CMD_REG0x4
+
+#define WDT_MIN_TIMEOUT1 /* seconds */
+#define WDT_DEFAULT_TIMEOUT30 /* seconds */
+#define WDT_DEFAULT_RATE   2700
+
+struct bcm7038_watchdog {
+   void __iomem*reg;


'base' would be a better name for this variable.


+   struct clk  *wdt_clk;
+   struct watchdog_device  wdd;
+   u32 hz;


How about "rate" ?


+};
+
+static bool nowayout = WATCHDOG_NOWAYOUT;
+
+static unsigned long bcm7038_wdt_get_rate(struct bcm7038_watchdog *wdt)
+{
+   /* if clock is missing return hz */
+   if (!wdt->wdt_clk)
+   return wdt->hz;
+
+   return clk_get_rate(wdt->wdt_clk);
+

Unnecessary empty line.

This is unnecessary complex. See below.


+}
+
+static void bcm7038_wdt_set_timeout_reg(struct watchdog_device *wdog)
+{
+   struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog);
+   u32 timeout;
+
+   timeout = bcm7038_wdt_get_rate(wdt) * wdog->timeout;
+
+   writel(timeout, wdt->reg + WDT_TIMEOUT_REG);
+}
+
+static int bcm7038_wdt_ping(struct watchdog_device *wdog)
+{
+   struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog);
+
+   writel(WDT_START_1, wdt->reg + WDT_CMD_REG);
+   writel(WDT_START_2, wdt->reg + WDT_CMD_REG);
+
+   return 0;
+}
+
+static int bcm7038_wdt_start(struct watchdog_device *wdog)
+{
+   bcm7038_wdt_set_timeout_reg(wdog);
+   bcm7038_wdt_ping(wdog);
+
+   return 0;
+}
+
+static int bcm7038_wdt_stop(struct watchdog_device *wdog)
+{
+   struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog);
+
+   writel(WDT_STOP_1, wdt->reg + WDT_CMD_REG);
+   writel(WDT_STOP_2, wdt->reg + WDT_CMD_REG);
+
+   return 0;
+}
+
+static int bcm7038_wdt_set_timeout(struct watchdog_device *wdog,
+   unsigned int t)


Please align continuation lines to '('.


+{
+   if (watchdog_timeout_invalid(wdog, t))
+   return -EINVAL;
+

Unnecessary; checked by infrastructure.


+   /* Can't modify timeout value if watchdog timer is running */
+   bcm7038_wdt_stop(wdog);
+   wdog->timeout = t;
+   bcm7038_wdt_start(wdog);
+
+   return 0;
+}
+
+static unsigned int bcm7038_wdt_get_timeleft(struct watchdog_device 

RE: [PATCH] [v2] x86, suspend: Save/restore extra MSR registers for suspend

2015-08-23 Thread Chen, Yu C
Hi, Pavel,
> Plus, I acked V2 when V3 was available.
> 
V3 is to only save/restore THERM_CONTRO msr,  
so I think I'll do some check based on V2, It is more extensible.
Thanks,
Best Regards,
Yu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 3/3] arm64: dts: add Hi6220 mailbox node

2015-08-23 Thread Leo Yan
Hi Mark,

On Sat, Aug 22, 2015 at 09:30:50PM +0800, Leo Yan wrote:
> On Fri, Aug 21, 2015 at 07:40:59PM +0100, Mark Rutland wrote:
> > On Wed, Aug 19, 2015 at 10:37:35AM +0100, Leo Yan wrote:
> > > On Hi6220, below memory regions in DDR have specific purpose:
> > > 
> > >   0x05e0, - 0x05ef,: For MCU firmware using at runtime;
> > >   0x0740,f000 - 0x0740,: For MCU firmware's section;
> > >   0x06df,f000 - 0x06df,: For mailbox message data.
> > > 
> > > This patch reserves these memory regions and add device node for
> > > mailbox in dts.
> > > 
> > > Signed-off-by: Leo Yan 
> > > ---
> > >  arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 20 +---
> > >  arch/arm64/boot/dts/hisilicon/hi6220.dtsi  |  8 
> > >  2 files changed, 25 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts 
> > > b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> > > index e36a539..d5470d3 100644
> > > --- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> > > +++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> > > @@ -7,9 +7,6 @@
> > >  
> > >  /dts-v1/;
> > >  
> > > -/*Reserved 1MB memory for MCU*/
> > > -/memreserve/ 0x05e0 0x0010;
> > > -
> > >  #include "hi6220.dtsi"
> > >  
> > >  / {
> > > @@ -28,4 +25,21 @@
> > >   device_type = "memory";
> > >   reg = <0x0 0x0 0x0 0x4000>;
> > >   };
> > > +
> > > + reserved-memory {
> > > + #address-cells = <2>;
> > > + #size-cells = <2>;
> > > + ranges;
> > > +
> > > + mcu-buf@05e0 {
> > > + no-map;
> > > + reg = <0x0 0x05e0 0x0 0x0010>,  /* MCU firmware 
> > > buffer */
> > > +   <0x0 0x0740f000 0x0 0x1000>;  /* MCU firmware 
> > > section */
> > > + };
> > > +
> > > + mbox-buf@06dff000 {
> > > + no-map;
> > > + reg = <0x0 0x06dff000 0x0 0x1000>;  /* Mailbox 
> > > message buf */
> > > + };
> > > + };
> > 
> > As far as I can see, it would be simpler to simply carve these out of the
> > memory node.
> 
> Will modify for MCU firmware buffer and section.
> 
> > I don't see why you need reserved-memory here, given you're not referring to
> > these regions by phandle anyway.
> 
> mbox-buf is used by below mailbox's node, but the start address has
> been truncated with 4KB alignment; so should keep it, right?

I think i got your point, all these nodes can be removed and just use
memory node to carve them out; but currently i saw the memory node
cannot be passed correctly from UEFI to kernel, we will check for
this. So will follow your suggestion if without any unknown reason.

Thanks,
Leo Yan

> > >  };
> > > diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi 
> > > b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> > > index 3f03380..9ff25bc 100644
> > > --- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> > > +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> > > @@ -167,5 +167,13 @@
> > >   clocks = <_ctrl 36>, <_ctrl 36>;
> > >   clock-names = "uartclk", "apb_pclk";
> > >   };
> > > +
> > > + mailbox: mailbox@f751 {
> > > + #mbox-cells = <1>;
> > > + compatible = "hisilicon,hi6220-mbox";
> > > + reg = <0x0 0xf751 0x0 0x1000>, /* IPC_S */
> > > +   <0x0 0x06dff800 0x0 0x0800>; /* Mailbox buffer */
> > > + interrupts = ;
> > > + };
> > >   };
> > >  };
> > > -- 
> > > 1.9.1
> > > 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] [v2] x86, suspend: Save/restore extra MSR registers for suspend

2015-08-23 Thread Chen, Yu C
Hi Ingo, thanks for your reply,
 
> So I like the general structure of the patch and I like the MSR saving
> mechanism it introduces, but it is full of typos and small stylistic
> uncleanlinesses which need to be fixed before this patch can be applied.
> Please don't ack incomplete patches.
> 
Sorry for my poor English, I'll check these typos.

Best Regards,
Yu

> Thanks,
> 
>   Ingo

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


linux-next: build failure after merge of the net-next tree

2015-08-23 Thread Stephen Rothwell
Hi all,

After merging the net-next tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:

In function 'dst_hold',
inlined from '__ipv6_dev_ac_dec' at 
/home/sfr/next/next/net/ipv6/anycast.c:328:2:
/home/sfr/next/next/include/linux/compiler.h:447:38: error: call to 
'__compiletime_assert_243' declared with attribute error: BUILD_BUG_ON failed: 
offsetof(struct dst_entry, __refcnt) & 63
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
/home/sfr/next/next/include/linux/compiler.h:430:4: note: in definition of 
macro '__compiletime_assert'
prefix ## suffix();\
^
/home/sfr/next/next/include/linux/compiler.h:447:2: note: in expansion of macro 
'_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
/home/sfr/next/next/include/linux/bug.h:50:37: note: in expansion of macro 
'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
 ^
/home/sfr/next/next/include/linux/bug.h:74:2: note: in expansion of macro 
'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
  ^
/home/sfr/next/next/include/net/dst.h:243:2: note: in expansion of macro 
'BUILD_BUG_ON'
  BUILD_BUG_ON(offsetof(struct dst_entry, __refcnt) & 63);
  ^

And many more :-(

Caused by commit

  61adedf3e3f1 ("route: move lwtunnel state to dst_entry")

I have used the net-next tree from next-20150821 for today.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes

2015-08-23 Thread Eryu Guan
On Mon, Aug 24, 2015 at 11:11:23AM +1000, Dave Chinner wrote:
> 
> Eryu, can you change the way you run the event trace to be:
> 
> $ sudo trace-cmd  -o  ./check 
> 
> rather than running the trace as a background operation elsewhere?
> Maybe that will give better results.

The results are here

http://128.199.137.77/writeback-v3/

> 
> Also, it would be informative to us if you can reproduce this with a
> v5 filesystem (i.e. mkfs.xfs -m crc=1) because it has much better
> on-disk information for sequence-of-event triage like this. If you
> can reproduce it with a v5 filesystem, can you post the trace and
> metadump?

This seems to be harder to reproduce with tracepoints enabled, but I'll
keep trying, and the tests below.

Thanks,
Eryu

> 
> Other things to check (separately):
> 
>   - change godown to godown -f
>   - add a "sleep 5" before running godown after sync
>   - add a "sleep 5; sync" before running godown
> 
> i.e. I'm wondering if sync is not waiting for everything, and so we
> aren't capturing the IO completions because the filesystem is
> already shut down by the time they are delivered...
> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> da...@fromorbit.com
> 
> ___
> xfs mailing list
> x...@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] ARM: uniphier: add outer cache support

2015-08-23 Thread Masahiro Yamada
Hi Joe,


2015-08-24 11:29 GMT+09:00 Joe Perches :
> On Mon, 2015-08-24 at 11:18 +0900, Masahiro Yamada wrote:
>> This commit adds support for UniPhier outer cache controller.
>> All the UniPhier SoCs are equipped with the L2 cache, while the L3
>> cache is currently only integrated on PH1-Pro5 SoC.
>
> style trivia:
>
> You might add and use
> #define pr_fmt(fmt) "uniphier: " fmt
> before any other #include so all of the pr_
> uses are automatically prefixed.


I did not know that.  Thanks!

I will do so for the whole series in v2.





-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-23 Thread Doug Anderson
Aapo,

Including the stack trace with this would have been helpful, though
it's not too hard to reproduce.  Here it is:

[  416.510559] BUG: scheduling while atomic: swapper/0/0/0x00010007
[  416.516554] Modules linked in:
[  416.519614] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
4.2.0-rc7-00133-geb63b34 #1073
[  416.527341] Hardware name: Rockchip (Device Tree)
[  416.532042] [] (unwind_backtrace) from []
(show_stack+0x20/0x24)
[  416.539772] [] (show_stack) from []
(dump_stack+0x84/0xb8)
[  416.546983] [] (dump_stack) from []
(__schedule_bug+0x54/0x6c)
[  416.554540] [] (__schedule_bug) from []
(__schedule+0x80/0x668)
[  416.562183] [] (__schedule) from [] (schedule+0xb8/0xd4)
[  416.569219] [] (schedule) from []
(schedule_timeout+0x2c/0x234)
[  416.576861] [] (schedule_timeout) from []
(wait_for_common+0xf4/0x188)
[  416.585109] [] (wait_for_common) from []
(wait_for_completion+0x20/0x24)
[  416.593531] [] (wait_for_completion) from []
(__stop_cpus+0x58/0x70)
[  416.601608] [] (__stop_cpus) from []
(stop_cpus+0x3c/0x54)
[  416.608817] [] (stop_cpus) from []
(__stop_machine+0xcc/0xe8)
[  416.616286] [] (__stop_machine) from []
(stop_machine+0x34/0x44)
[  416.624016] [] (stop_machine) from []
(patch_text+0x28/0x34)
[  416.631399] [] (patch_text) from []
(kgdb_arch_set_breakpoint+0x40/0x4c)
[  416.639823] [] (kgdb_arch_set_breakpoint) from
[] (kgdb_validate_break_address+0x2c/0x60)
[  416.649719] [] (kgdb_validate_break_address) from
[] (dbg_set_sw_break+0x1c/0xdc)
[  416.658922] [] (dbg_set_sw_break) from []
(gdb_serial_stub+0x9c4/0xba4)
[  416.667259] [] (gdb_serial_stub) from []
(kgdb_cpu_enter+0x1f8/0x60c)
[  416.675423] [] (kgdb_cpu_enter) from []
(kgdb_handle_exception+0x19c/0x1d0)
[  416.684106] [] (kgdb_handle_exception) from []
(kgdb_compiled_brk_fn+0x30/0x3c)
[  416.693135] [] (kgdb_compiled_brk_fn) from []
(do_undefinstr+0x1a4/0x20c)
[  416.701643] [] (do_undefinstr) from []
(__und_svc_finish+0x0/0x34)
[  416.709543] Exception stack(0xc07c1ce8 to 0xc07c1d30)
[  416.714584] 1ce0:    c07c6504 c086e290
c086e294 c086e294 c086e290
[  416.722745] 1d00: c07c6504 0067 0001 c07c2100 0027
c07c1d4c c07c1d50 c07c1d30
[  416.730905] 1d20: c00a0990 c00a08d0 6193 
[  416.735947] [] (__und_svc_finish) from []
(kgdb_breakpoint+0x58/0x94)
[  416.744110] [] (kgdb_breakpoint) from []
(sysrq_handle_dbg+0x58/0x6c)
[  416.752273] [] (sysrq_handle_dbg) from []
(__handle_sysrq+0xac/0x15c)
[  416.760437] [] (__handle_sysrq) from []
(handle_sysrq+0x30/0x34)


Kees: I think you've dealt with a lot more of these types of issues
than I have.  Any quick thoughts?  If not I can put it on my long-term
list of things to do, but until then we could always just post a
Revert...


-Doug


On Wed, Aug 5, 2015 at 8:50 AM, Aapo Vienamo  wrote:
> Hi,
>
> The breakpoint setting code in arch/arm/kernel/kgdb.c calls
> patch_text(), which ends up trying to sleep while in interrupt context.
> The bug was introduced by commit: 23a4e40 arm: kgdb: Handle read-only
> text / modules. The resulting behavior is "BUG: scheduling while
> atomic..." when setting a breakpoint in kgdb. This was tested on an
> Nvidia Jetson TK1 board with 4.2.0-rc5-next-20150805 kernel.
>
> Regards,
> Aapo Vienamo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 06/14] Documentation: drm/bridge: add document for analogix_dp

2015-08-23 Thread Yakir Yang

Hi Krzysztof,

在 08/23/2015 07:43 PM, Krzysztof Kozlowski 写道:

2015-08-24 8:23 GMT+09:00 Rob Herring :

On Wed, Aug 19, 2015 at 9:50 AM, Yakir Yang  wrote:

Analogix dp driver is split from exynos dp driver, so we just
make an copy of exynos_dp.txt, and then simplify exynos_dp.txt

Beside update some exynos dtsi file with the latest change
according to the devicetree binding documents.

You can't just change the exynos bindings and break compatibility. Is
there some agreement with exynos folks to do this?

No, there is no agreement. This wasn't even sent to Exynos maintainers.


Sorry about this one, actually I have add Exynos maintainers in version 
1 & version 2,

but lose some maintainers in version 3, I would fix it in bellow versions.


Additionally the patchset did not look interesting to me because of
misleading subject - Documentation instead of "ARM: dts:".

Yakir, please:
1. Provide backward compatibility. Mark old properties as deprecated
but still support them.


Do you mean that I should keep the old properties declare in exynos-dp.txt,
but just mark them as deprecated flag. Let me show same examples, make
me understand your suggest rightly.

1. "samsung,ycbcr-coeff" is abandoned in latest analogix-dp driver, 
absolutely
I should not carry this to analogix-dp.txt document. But I should 
keep this in

exynos-dp.txt document, and mark them with an little "deprecated" flag.

[Documentation/devicetree/bindings/video/exynos_dp.txt]
Required properties for dp-controller:
   [...]
-samsung,ycbcr-coeff (DEPRECATED):
YCbCr co-efficients for input video.
COLOR_YCBCR601 = 0, COLOR_YCBCR709 = 1

Is it right ?


2. Separate all DTS changes to a separate patch, unless bisectability
would be hurt. Anyway you should prepare it in a such way that
separation would be possible without breaking bisectability.


So I should separate this patch into two parts, one is name "Document:",
the other is "ARM: dts: ".

Honestly, I don't understand what the "bisectability" means in this case.


3. Use proper subject for the patch changing DTS. This is not
documentation change!


Hmm... when I separate this patch into two parts, I though I can keep
"Documentation" proper subject in this patch, and the other is the "ARM: 
dts"

proper subject. Am I right ?


4. Please use script get_maintainers to obtain list of valid
maintainers and CC-them with at least cover letter and patches
requiring their attention.


Yeah, thanks.


Thanks a lot,
- Yakir


Best regards,
Krzysztof





Signed-off-by: Yakir Yang 
---
Changes in v3:
- Take Heiko suggest, add devicetree binding documents.
- Take Thierry Reding suggest, remove sync pol & colorimetry properies
   from the new analogix dp driver devicetree binding.
- Update the exist exynos dtsi file with the latest DP DT properies.

Changes in v2: None

  .../devicetree/bindings/drm/bridge/analogix_dp.txt | 70 ++
  .../devicetree/bindings/video/exynos_dp.txt| 50 ++--
  arch/arm/boot/dts/exynos5250-arndale.dts   | 10 ++--
  arch/arm/boot/dts/exynos5250-smdk5250.dts  | 10 ++--
  arch/arm/boot/dts/exynos5250-snow.dts  | 12 ++--
  arch/arm/boot/dts/exynos5250-spring.dts| 12 ++--
  arch/arm/boot/dts/exynos5420-peach-pit.dts | 12 ++--
  arch/arm/boot/dts/exynos5420-smdk5420.dts  | 10 ++--
  arch/arm/boot/dts/exynos5800-peach-pi.dts  | 12 ++--
  9 files changed, 119 insertions(+), 79 deletions(-)
  create mode 100644 
Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt

diff --git a/Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt 
b/Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt
new file mode 100644
index 000..6127018
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt
@@ -0,0 +1,70 @@
+Analogix Display Port bridge bindings
+
+Required properties for dp-controller:
+   -compatible:
+   platform specific such as:
+* "samsung,exynos5-dp"
+* "rockchip,rk3288-dp"
+   -reg:
+   physical base address of the controller and length
+   of memory mapped region.
+   -interrupts:
+   interrupt combiner values.
+   -clocks:
+   from common clock binding: handle to dp clock.
+   -clock-names:
+   from common clock binding: Shall be "dp".
+   -interrupt-parent:
+   phandle to Interrupt combiner node.
+   -phys:
+   from general PHY binding: the phandle for the PHY device.
+   -phy-names:
+   from general PHY binding: Should be "dp".
+   -analogix,color-space:
+   input video data format.
+   COLOR_RGB = 0, COLOR_YCBCR422 = 1, COLOR_YCBCR444 = 2
+   -analogix,color-depth:
+   number of bits per colour component.
+   COLOR_6 = 0, COLOR_8 = 1, COLOR_10 = 2, COLOR_12 = 3


Re: [PATCH 1/3] ARM: uniphier: add outer cache support

2015-08-23 Thread Joe Perches
On Mon, 2015-08-24 at 11:18 +0900, Masahiro Yamada wrote:
> This commit adds support for UniPhier outer cache controller.
> All the UniPhier SoCs are equipped with the L2 cache, while the L3
> cache is currently only integrated on PH1-Pro5 SoC.

style trivia:

You might add and use
#define pr_fmt(fmt) "uniphier: " fmt
before any other #include so all of the pr_
uses are automatically prefixed.

> diff --git a/arch/arm/mm/cache-uniphier.c b/arch/arm/mm/cache-uniphier.c
[]
> +static int __init __uniphier_cache_init(void)
> +{
[]
> + if (uniphier_outer_levels == 0) {
> + ret = ret ?: -ENODEV;
> + pr_err("uniphier: failed to initialize outer cache\n");

So this becomes:
pr_err("failed to initialize outer cache\n");

> +int __init uniphier_cache_init(void)
> +{
[]
> + pr_info("uniphier: enabled outer cache (%s)\n",
> + uniphier_outer_levels >= 2 ? "L2 and L3" : "L2");

pr_info("enabled outer cache (%s)\n",
uniphier_outer_levels >= 2 ? "L2 and L3" : "L2");

etc...


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


[PATCH 3/3] ARM: dts: uniphier: add outer cache controller nodes

2015-08-23 Thread Masahiro Yamada
Add L2 cache controller nodes for all the UniPhier SoC DTSI.
Also, add an L3 cache controller node for PH1-Pro5 DTSI.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/boot/dts/uniphier-ph1-ld4.dtsi |  7 +++
 arch/arm/boot/dts/uniphier-ph1-pro4.dtsi|  7 +++
 arch/arm/boot/dts/uniphier-ph1-pro5.dtsi| 14 ++
 arch/arm/boot/dts/uniphier-ph1-sld3.dtsi|  7 +++
 arch/arm/boot/dts/uniphier-ph1-sld8.dtsi|  7 +++
 arch/arm/boot/dts/uniphier-proxstream2.dtsi |  7 +++
 6 files changed, 49 insertions(+)

diff --git a/arch/arm/boot/dts/uniphier-ph1-ld4.dtsi 
b/arch/arm/boot/dts/uniphier-ph1-ld4.dtsi
index a6a185f..2d60960 100644
--- a/arch/arm/boot/dts/uniphier-ph1-ld4.dtsi
+++ b/arch/arm/boot/dts/uniphier-ph1-ld4.dtsi
@@ -91,6 +91,13 @@
#size-cells = <1>;
};
 
+   l2-cache@500c {
+   compatible = "socionext,uniphier-l2-cache";
+   reg = <0x500c 0x2000>, <0x503c0100 0x4>,
+ <0x506c 0x400>;
+   interrupts = <0 174 4>, <0 175 4>;
+   };
+
serial0: serial@54006800 {
compatible = "socionext,uniphier-uart";
status = "disabled";
diff --git a/arch/arm/boot/dts/uniphier-ph1-pro4.dtsi 
b/arch/arm/boot/dts/uniphier-ph1-pro4.dtsi
index e8bbc45..02acc07 100644
--- a/arch/arm/boot/dts/uniphier-ph1-pro4.dtsi
+++ b/arch/arm/boot/dts/uniphier-ph1-pro4.dtsi
@@ -98,6 +98,13 @@
#size-cells = <1>;
};
 
+   l2-cache@500c {
+   compatible = "socionext,uniphier-l2-cache";
+   reg = <0x500c 0x2000>, <0x503c0100 0x4>,
+ <0x506c 0x400>;
+   interrupts = <0 174 4>, <0 175 4>;
+   };
+
serial0: serial@54006800 {
compatible = "socionext,uniphier-uart";
status = "disabled";
diff --git a/arch/arm/boot/dts/uniphier-ph1-pro5.dtsi 
b/arch/arm/boot/dts/uniphier-ph1-pro5.dtsi
index 59c2b12..084bc47 100644
--- a/arch/arm/boot/dts/uniphier-ph1-pro5.dtsi
+++ b/arch/arm/boot/dts/uniphier-ph1-pro5.dtsi
@@ -98,6 +98,20 @@
#size-cells = <1>;
};
 
+   l2-cache@500c {
+   compatible = "socionext,uniphier-l2-cache";
+   reg = <0x500c 0x2000>, <0x503c0100 0x8>,
+ <0x506c 0x400>;
+   interrupts = <0 190 4>, <0 191 4>;
+   };
+
+   l3-cache@500c8000 {
+   compatible = "socionext,uniphier-l3-cache";
+   reg = <0x500c8000 0x2000>, <0x503c8100 0x8>,
+ <0x506c8000 0x400>;
+   interrupts = <0 174 4>, <0 175 4>;
+   };
+
serial0: serial@54006800 {
compatible = "socionext,uniphier-uart";
status = "disabled";
diff --git a/arch/arm/boot/dts/uniphier-ph1-sld3.dtsi 
b/arch/arm/boot/dts/uniphier-ph1-sld3.dtsi
index 3cc90cd..e989281 100644
--- a/arch/arm/boot/dts/uniphier-ph1-sld3.dtsi
+++ b/arch/arm/boot/dts/uniphier-ph1-sld3.dtsi
@@ -120,6 +120,13 @@
  <0x2100 0x100>;
};
 
+   l2-cache@500c {
+   compatible = "socionext,uniphier-l2-cache";
+   reg = <0x500c 0x2000>, <0x503c0100 0x4>,
+ <0x506c 0x400>;
+   interrupts = <0 174 4>, <0 175 4>;
+   };
+
serial0: serial@54006800 {
compatible = "socionext,uniphier-uart";
status = "disabled";
diff --git a/arch/arm/boot/dts/uniphier-ph1-sld8.dtsi 
b/arch/arm/boot/dts/uniphier-ph1-sld8.dtsi
index 58067df..3ff897c 100644
--- a/arch/arm/boot/dts/uniphier-ph1-sld8.dtsi
+++ b/arch/arm/boot/dts/uniphier-ph1-sld8.dtsi
@@ -91,6 +91,13 @@
#size-cells = <1>;
};
 
+   l2-cache@500c {
+   compatible = "socionext,uniphier-l2-cache";
+   reg = <0x500c 0x2000>, <0x503c0100 0x4>,
+ <0x506c 0x400>;
+   interrupts = <0 174 4>, <0 175 4>;
+   };
+
serial0: serial@54006800 {
compatible = "socionext,uniphier-uart";
status = "disabled";
diff --git a/arch/arm/boot/dts/uniphier-proxstream2.dtsi 
b/arch/arm/boot/dts/uniphier-proxstream2.dtsi
index 4c7b246..f318548 100644
--- a/arch/arm/boot/dts/uniphier-proxstream2.dtsi
+++ b/arch/arm/boot/dts/uniphier-proxstream2.dtsi
@@ -110,6 +110,13 @@
#size-cells = <1>;
};
 
+   

[PATCH v2 2/9] mm/compaction: introduce compaction depleted state on zone

2015-08-23 Thread Joonsoo Kim
Further compaction attempt is deferred when some of compaction attempts
already fails. But, after some number of trial are skipped, compaction
restarts work to check whether compaction is now possible or not. It
scans whole range of zone to determine this possibility and if compaction
possibility doesn't recover, this whole range scan is quite big overhead.
As a first step to reduce this overhead, this patch implement compaction
depleted state on zone.

The way to determine depletion of compaction possility is checking number
of success on previous compaction attempt. If number of successful
compaction is below than specified threshold, we guess that compaction
will not successful next time so mark the zone as compaction depleted.
In this patch, threshold is choosed by 1 to imitate current compaction
deferring algorithm. In the following patch, compaction algorithm will be
changed and this threshold is also adjusted to that change.

In this patch, only state definition is implemented. There is no action
for this new state so no functional change. But, following patch will
add some handling for this new state.

Signed-off-by: Joonsoo Kim 
---
 include/linux/mmzone.h |  3 +++
 mm/compaction.c| 44 +---
 2 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 754c259..700e9b5 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -517,6 +517,8 @@ struct zone {
unsigned intcompact_considered;
unsigned intcompact_defer_shift;
int compact_order_failed;
+   unsigned long   compact_success;
+   unsigned long   compact_depletion_depth;
 #endif
 
 #if defined CONFIG_COMPACTION || defined CONFIG_CMA
@@ -543,6 +545,7 @@ enum zone_flags {
 * many pages under writeback
 */
ZONE_FAIR_DEPLETED, /* fair zone policy batch depleted */
+   ZONE_COMPACTION_DEPLETED,   /* compaction possiblity depleted */
 };
 
 static inline unsigned long zone_end_pfn(const struct zone *zone)
diff --git a/mm/compaction.c b/mm/compaction.c
index c2d3d6a..de96e9d 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -129,6 +129,23 @@ static struct page *pageblock_pfn_to_page(unsigned long 
start_pfn,
 
 /* Do not skip compaction more than 64 times */
 #define COMPACT_MAX_DEFER_SHIFT 6
+#define COMPACT_MIN_DEPLETE_THRESHOLD 1UL
+
+static bool compaction_depleted(struct zone *zone)
+{
+   unsigned long threshold;
+   unsigned long success = zone->compact_success;
+
+   /*
+* Now, to imitate current compaction deferring approach,
+* choose threshold to 1. It will be changed in the future.
+*/
+   threshold = COMPACT_MIN_DEPLETE_THRESHOLD;
+   if (success >= threshold)
+   return false;
+
+   return true;
+}
 
 /*
  * Compaction is deferred when compaction fails to result in a page
@@ -223,6 +240,16 @@ static void __reset_isolation_suitable(struct zone *zone)
zone->compact_cached_free_pfn = end_pfn;
zone->compact_blockskip_flush = false;
 
+   if (compaction_depleted(zone)) {
+   if (test_bit(ZONE_COMPACTION_DEPLETED, >flags))
+   zone->compact_depletion_depth++;
+   else {
+   set_bit(ZONE_COMPACTION_DEPLETED, >flags);
+   zone->compact_depletion_depth = 0;
+   }
+   }
+   zone->compact_success = 0;
+
/* Walk the zone and mark every pageblock as suitable for isolation */
for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) {
struct page *page;
@@ -1185,22 +1212,28 @@ static int __compact_finished(struct zone *zone, struct 
compact_control *cc,
bool can_steal;
 
/* Job done if page is free of the right migratetype */
-   if (!list_empty(>free_list[migratetype]))
+   if (!list_empty(>free_list[migratetype])) {
+   zone->compact_success++;
return COMPACT_PARTIAL;
+   }
 
 #ifdef CONFIG_CMA
/* MIGRATE_MOVABLE can fallback on MIGRATE_CMA */
if (migratetype == MIGRATE_MOVABLE &&
-   !list_empty(>free_list[MIGRATE_CMA]))
+   !list_empty(>free_list[MIGRATE_CMA])) {
+   zone->compact_success++;
return COMPACT_PARTIAL;
+   }
 #endif
/*
 * Job done if allocation would steal freepages from
 * other migratetype buddy lists.
 */
if (find_suitable_fallback(area, order, migratetype,
-   true, _steal) != -1)
+   true, _steal) 

[PATCH v2 6/9] mm/compaction: manage separate skip-bits for migration and free scanner

2015-08-23 Thread Joonsoo Kim
Currently, just one skip-bit is used for migration and free scanner
at the sametime. This has problem if migrate scanner go into
the region where free scanner marks the skip-bit. Free scanner
just checks if there is freepage or not, so there would be migratable
page. But, due to skip-bit, migrate scanner would skip scanning.

Currently, this doesn't result in any problem because migration scanner
and free scanner always meets similar position in the zone and
stops scanning at that position.

But, following patch will change compaction algorithm that migration
scanner scans whole zone range in order to get much better success rate.
In this case, skip-bit marked from freepage scanner should be ignored
but at the sametime we need to check if there is migratable page and
skip that pageblock in next time. This cannot be achived by just one
skip-bit so this patch add one more skip-bit and use each one
for migrate and free scanner, respectively.

This patch incrases memory usage that each pageblock uses 4 bit more than
before. This means that if we have 1GB memory system we lose another
256 bytes. I think this is really marginal overhead.

Motivation for compaction algorithm change will be mentioned
on following patch. Please refer it.

Signed-off-by: Joonsoo Kim 
---
 include/linux/mmzone.h  |  3 ---
 include/linux/pageblock-flags.h | 37 +++--
 mm/compaction.c | 25 -
 mm/page_alloc.c |  3 ++-
 4 files changed, 45 insertions(+), 23 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 5cae0ad..e641fd1 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -75,9 +75,6 @@ enum {
 
 extern int page_group_by_mobility_disabled;
 
-#define NR_MIGRATETYPE_BITS (PB_migrate_end - PB_migrate + 1)
-#define MIGRATETYPE_MASK ((1UL << NR_MIGRATETYPE_BITS) - 1)
-
 #define get_pageblock_migratetype(page)
\
get_pfnblock_flags_mask(page, page_to_pfn(page),\
PB_migrate_end, MIGRATETYPE_MASK)
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index 2baeee1..de6997e 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -30,8 +30,13 @@ enum pageblock_bits {
PB_migrate,
PB_migrate_end = PB_migrate + 3 - 1,
/* 3 bits required for migrate types */
-   PB_migrate_skip,/* If set the block is skipped by compaction */
+   PB_padding1,/* Padding for 4 byte aligned migrate types */
+   NR_MIGRATETYPE_BITS,
 
+   PB_skip_migratescan = 4,/* If set the block is skipped by compaction */
+   PB_skip_freescan,
+   PB_padding2,
+   PB_padding3,
/*
 * Assume the bits will always align on a word. If this assumption
 * changes then get/set pageblock needs updating.
@@ -39,6 +44,8 @@ enum pageblock_bits {
NR_PAGEBLOCK_BITS
 };
 
+#define MIGRATETYPE_MASK ((1UL << NR_MIGRATETYPE_BITS) - 1)
+
 #ifdef CONFIG_HUGETLB_PAGE
 
 #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
@@ -87,15 +94,25 @@ void set_pfnblock_flags_mask(struct page *page,
(1 << (end_bitidx - start_bitidx + 1)) - 1)
 
 #ifdef CONFIG_COMPACTION
-#define get_pageblock_skip(page) \
-   get_pageblock_flags_group(page, PB_migrate_skip, \
-   PB_migrate_skip)
-#define clear_pageblock_skip(page) \
-   set_pageblock_flags_group(page, 0, PB_migrate_skip,  \
-   PB_migrate_skip)
-#define set_pageblock_skip(page) \
-   set_pageblock_flags_group(page, 1, PB_migrate_skip,  \
-   PB_migrate_skip)
+#define get_pageblock_skip_migratescan(page) \
+   get_pageblock_flags_group(page, PB_skip_migratescan,\
+   PB_skip_migratescan)
+#define clear_pageblock_skip_migratescan(page) \
+   set_pageblock_flags_group(page, 0, PB_skip_migratescan, \
+   PB_skip_migratescan)
+#define set_pageblock_skip_migratescan(page) \
+   set_pageblock_flags_group(page, 1, PB_skip_migratescan, \
+   PB_skip_migratescan)
+#define get_pageblock_skip_freescan(page) \
+   get_pageblock_flags_group(page, PB_skip_freescan,   \
+   PB_skip_freescan)
+#define clear_pageblock_skip_freescan(page) \
+   set_pageblock_flags_group(page, 0, PB_skip_freescan,\
+   PB_skip_freescan)
+#define set_pageblock_skip_freescan(page) \
+   set_pageblock_flags_group(page, 1, PB_skip_freescan,\
+   

[PATCH 0/3] ARM: uniphier: add outer cache support and rework SMP operations

2015-08-23 Thread Masahiro Yamada
1/3: add outer cache support
2/3: rework SMP operations
3/3: add device tree nodes

Because 2/3 highly depends on 1/3, I hope whole of this series
is applied to ARM-SOC tree.

Olof,
>From this series, I am using "ARM: uniphier:" rather than "ARM: UniPhier:"
for the subject prefixes because I noticed you often rephased so when you
applied my patches.
Are sub-arch names in lower cases preferable in subject prefixes?



Masahiro Yamada (3):
  ARM: uniphier: add outer cache support
  ARM: uniphier: rework SMP operations to use trampoline code
  ARM: dts: uniphier: add outer cache controller nodes

 .../bindings/arm/uniphier/cache-uniphier.txt   |  30 ++
 MAINTAINERS|   2 +
 arch/arm/boot/dts/uniphier-ph1-ld4.dtsi|   7 +
 arch/arm/boot/dts/uniphier-ph1-pro4.dtsi   |   7 +
 arch/arm/boot/dts/uniphier-ph1-pro5.dtsi   |  14 +
 arch/arm/boot/dts/uniphier-ph1-sld3.dtsi   |   7 +
 arch/arm/boot/dts/uniphier-ph1-sld8.dtsi   |   7 +
 arch/arm/boot/dts/uniphier-proxstream2.dtsi|   7 +
 arch/arm/include/asm/hardware/cache-uniphier.h |  40 ++
 arch/arm/mach-uniphier/Makefile|   2 +-
 arch/arm/mach-uniphier/headsmp.S   |  43 ++
 arch/arm/mach-uniphier/platsmp.c   | 183 ++--
 arch/arm/mach-uniphier/uniphier.c  |  11 +
 arch/arm/mm/Kconfig|  10 +
 arch/arm/mm/Makefile   |   1 +
 arch/arm/mm/cache-uniphier.c   | 518 +
 16 files changed, 857 insertions(+), 32 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/arm/uniphier/cache-uniphier.txt
 create mode 100644 arch/arm/include/asm/hardware/cache-uniphier.h
 create mode 100644 arch/arm/mach-uniphier/headsmp.S
 create mode 100644 arch/arm/mm/cache-uniphier.c

-- 
1.9.1

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


[PATCH v2 5/9] mm/compaction: allow to scan nonmovable pageblock when depleted state

2015-08-23 Thread Joonsoo Kim
Currently, freescanner doesn't scan non-movable pageblock, because if
freepages in non-movable pageblock are exhausted, another movable
pageblock would be used for non-movable allocation and it could cause
fragmentation.

But, we should know that watermark check for compaction doesn't
distinguish where freepage is. If all freepages are in non-movable
pageblock, although, system has enough freepages and watermark check
is passed, freepage scanner can't get any freepage and compaction will
be failed. There is no way to get precise number of freepage on movable
pageblock and no way to reclaim only used pages in movable pageblock.
Therefore, I think that best way to overcome this situation is
to use freepage in non-movable pageblock in compaction.

My test setup for this situation is:

Memory is artificially fragmented to make order 3 allocation hard. And,
most of pageblocks are changed to unmovable migratetype.

  System: 512 MB with 32 MB Zram
  Memory: 25% memory is allocated to make fragmentation and kernel build
is running on background.
  Fragmentation: Successful order 3 allocation candidates may be around
1500 roughly.
  Allocation attempts: Roughly 3000 order 3 allocation attempts
with GFP_NORETRY. This value is determined to saturate allocation
success.

Below is the result of this test.

Test: build-frag-unmovable

Kernel: Base vs Nonmovable

Success(N)37  64
compact_stall6245056
compact_success  103 419
compact_fail 5214637
pgmigrate_success  22004  277106
compact_isolated   61021 1056863
compact_migrate_scanned  260936070252458
compact_free_scanned 480898923091292

Column 'Success(N) are calculated by following equations.

Success(N) = successful allocation * 100 / order 3 candidates

Result shows that success rate is roughly doubled in this case
because we can search more area.

Because we just allow freepage scanner to scan non-movable pageblock
in very limited situation, more scanning events happen. But, allowing
in very limited situation results in a very important benefit that
memory isn't fragmented more than before. Fragmentation effect is
measured on following patch so please refer it.

Signed-off-by: Joonsoo Kim 
---
 include/linux/mmzone.h |  1 +
 mm/compaction.c| 27 +--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index e13b732..5cae0ad 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -545,6 +545,7 @@ enum zone_flags {
 */
ZONE_FAIR_DEPLETED, /* fair zone policy batch depleted */
ZONE_COMPACTION_DEPLETED,   /* compaction possiblity depleted */
+   ZONE_COMPACTION_SCANALLFREE,/* scan all kinds of pageblocks */
 };
 
 static inline unsigned long zone_end_pfn(const struct zone *zone)
diff --git a/mm/compaction.c b/mm/compaction.c
index 1817564..b58f162 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -243,9 +243,17 @@ static void __reset_isolation_suitable(struct zone *zone)
zone->compact_cached_free_pfn = end_pfn;
zone->compact_blockskip_flush = false;
 
+   clear_bit(ZONE_COMPACTION_SCANALLFREE, >flags);
if (compaction_depleted(zone)) {
if (test_bit(ZONE_COMPACTION_DEPLETED, >flags))
zone->compact_depletion_depth++;
+
+   /* Last resort to make high-order page */
+   if (!zone->compact_success) {
+   set_bit(ZONE_COMPACTION_SCANALLFREE,
+   >flags);
+   }
+
else {
set_bit(ZONE_COMPACTION_DEPLETED, >flags);
zone->compact_depletion_depth = 0;
@@ -914,7 +922,8 @@ isolate_migratepages_range(struct compact_control *cc, 
unsigned long start_pfn,
 #ifdef CONFIG_COMPACTION
 
 /* Returns true if the page is within a block suitable for migration to */
-static bool suitable_migration_target(struct page *page)
+static bool suitable_migration_target(struct compact_control *cc,
+   struct page *page)
 {
/* If the page is a large free page, then disallow migration */
if (PageBuddy(page)) {
@@ -931,6 +940,16 @@ static bool suitable_migration_target(struct page *page)
if (migrate_async_suitable(get_pageblock_migratetype(page)))
return true;
 
+   /*
+* Allow to scan all kinds of pageblock. Without this relaxation,
+* all freepage could be in non-movable pageblock and compaction
+* can be satuarated and cannot make high-order page even if there
+* is enough freepage in the system.
+*/
+   if (cc->mode != MIGRATE_ASYNC &&
+   

Re: [PATCH v3 06/14] Documentation: drm/bridge: add document for analogix_dp

2015-08-23 Thread Yakir Yang

Hi Rob,

在 08/23/2015 06:23 PM, Rob Herring 写道:

On Wed, Aug 19, 2015 at 9:50 AM, Yakir Yang  wrote:

Analogix dp driver is split from exynos dp driver, so we just
make an copy of exynos_dp.txt, and then simplify exynos_dp.txt

Beside update some exynos dtsi file with the latest change
according to the devicetree binding documents.

You can't just change the exynos bindings and break compatibility. Is
there some agreement with exynos folks to do this?



Yeah, this change only start to introduce in version 3 series, so there is
no agreement or discuss before.




Signed-off-by: Yakir Yang 
---
Changes in v3:
- Take Heiko suggest, add devicetree binding documents.
- Take Thierry Reding suggest, remove sync pol & colorimetry properies
   from the new analogix dp driver devicetree binding.
- Update the exist exynos dtsi file with the latest DP DT properies.

Changes in v2: None

  .../devicetree/bindings/drm/bridge/analogix_dp.txt | 70 ++
  .../devicetree/bindings/video/exynos_dp.txt| 50 ++--
  arch/arm/boot/dts/exynos5250-arndale.dts   | 10 ++--
  arch/arm/boot/dts/exynos5250-smdk5250.dts  | 10 ++--
  arch/arm/boot/dts/exynos5250-snow.dts  | 12 ++--
  arch/arm/boot/dts/exynos5250-spring.dts| 12 ++--
  arch/arm/boot/dts/exynos5420-peach-pit.dts | 12 ++--
  arch/arm/boot/dts/exynos5420-smdk5420.dts  | 10 ++--
  arch/arm/boot/dts/exynos5800-peach-pi.dts  | 12 ++--
  9 files changed, 119 insertions(+), 79 deletions(-)
  create mode 100644 
Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt

diff --git a/Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt 
b/Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt
new file mode 100644
index 000..6127018
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt
@@ -0,0 +1,70 @@
+Analogix Display Port bridge bindings
+
+Required properties for dp-controller:
+   -compatible:
+   platform specific such as:
+* "samsung,exynos5-dp"
+* "rockchip,rk3288-dp"
+   -reg:
+   physical base address of the controller and length
+   of memory mapped region.
+   -interrupts:
+   interrupt combiner values.
+   -clocks:
+   from common clock binding: handle to dp clock.
+   -clock-names:
+   from common clock binding: Shall be "dp".
+   -interrupt-parent:
+   phandle to Interrupt combiner node.
+   -phys:
+   from general PHY binding: the phandle for the PHY device.
+   -phy-names:
+   from general PHY binding: Should be "dp".
+   -analogix,color-space:
+   input video data format.
+   COLOR_RGB = 0, COLOR_YCBCR422 = 1, COLOR_YCBCR444 = 2
+   -analogix,color-depth:
+   number of bits per colour component.
+   COLOR_6 = 0, COLOR_8 = 1, COLOR_10 = 2, COLOR_12 = 3

This seems pretty generic. Just use 6, 8, 10, or 12 for values. And
drop the vendor prefix.


Okay, thanks



+   -analogix,link-rate:
+   max link rate supported by the eDP controller.
+   LINK_RATE_1_62GBPS = 0x6, LINK_RATE_2_70GBPS = 0x0A,
+   LINK_RATE_5_40GBPS = 0x14

Same here. I'd rather see something like "link-rate-mbps" and use the
actual rate.


Like "link-rate-mbps = 162000", so I need of_property_read_u32() for 
this prop.


Okay, done.


+   -analogix,lane-count:
+   max number of lanes supported by the eDP contoller.
+   LANE_COUNT1 = 1, LANE_COUNT2 = 2, LANE_COUNT4 = 4

And drop the vendor prefix here.


Done


+   -port@[X]: SoC specific port nodes with endpoint definitions as defined
+   in Documentation/devicetree/bindings/media/video-interfaces.txt,
+   please refer to the SoC specific binding document:
+   * Documentation/devicetree/bindings/video/exynos_dp.txt
+   * 
Documentation/devicetree/bindings/video/analogix_dp-rockchip.txt
+
+Optional properties for dp-controller:
+   -analogix,hpd-gpio:
+   Hotplug detect GPIO.
+   Indicates which GPIO should be used for hotplug
+   detection

We should align with "hpd-gpios" used by HDMI connector binding. Or do
we need a DP connector binding that this should be defined in?
Probably so.

The DRM related bindings are such a cluster f*ck with everyone picking
their own way to do things. Just grep hpd in bindings for starters.
That is just the tip.



Hmm... I don't understand how the HDMI connector binding works, there are no
driver that name with "hdmi-connector" compatible, does it just an 
sample case

for all HDMI dts node?

But I'm okay with your suggest here, change "analogix,hpd-gpio" to 
"hpd-gpios"  ;)



+   -video interfaces: Device node can contain video 

[PATCH 1/3] ARM: uniphier: add outer cache support

2015-08-23 Thread Masahiro Yamada
This commit adds support for UniPhier outer cache controller.
All the UniPhier SoCs are equipped with the L2 cache, while the L3
cache is currently only integrated on PH1-Pro5 SoC.

Signed-off-by: Masahiro Yamada 
---

 .../bindings/arm/uniphier/cache-uniphier.txt   |  30 ++
 MAINTAINERS|   2 +
 arch/arm/include/asm/hardware/cache-uniphier.h |  40 ++
 arch/arm/mach-uniphier/uniphier.c  |  11 +
 arch/arm/mm/Kconfig|  10 +
 arch/arm/mm/Makefile   |   1 +
 arch/arm/mm/cache-uniphier.c   | 518 +
 7 files changed, 612 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/arm/uniphier/cache-uniphier.txt
 create mode 100644 arch/arm/include/asm/hardware/cache-uniphier.h
 create mode 100644 arch/arm/mm/cache-uniphier.c

diff --git a/Documentation/devicetree/bindings/arm/uniphier/cache-uniphier.txt 
b/Documentation/devicetree/bindings/arm/uniphier/cache-uniphier.txt
new file mode 100644
index 000..6428289
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/uniphier/cache-uniphier.txt
@@ -0,0 +1,30 @@
+UniPhier outer cache controller
+
+UniPhier SoCs are integrated with a level 2 cache controller that resides
+outside of the ARM cores, some of them also have a level 3 cache controller.
+
+Required properties:
+- compatible: should be one of the followings:
+   "socionext,uniphier-l2-cache"   (L2 cache)
+   "socionext,uniphier-l3-cache"   (L3 cache)
+- reg: offsets and lengths of the register sets for the device.  It should
+  contain 3 regions: control registers, revision registers, operation
+  registers, in this order.
+
+The L2 cache must exist to use the L3 cache; adding only an L3 cache device
+node to the device tree causes the initialization failure of the whole outer
+cache system.
+
+Example:
+   l2-cache@500c {
+   compatible = "socionext,uniphier-l2-cache";
+   reg = <0x500c 0x2000>, <0x503c0100 0x8>,
+ <0x506c 0x400>;
+   };
+
+   /* Not all of UniPhier SoCs have L3 cache */
+   l3-cache@500c8000 {
+   compatible = "socionext,uniphier-l3-cache";
+   reg = <0x500c8000 0x2000>, <0x503c8100 0x8>,
+ <0x506c8000 0x400>;
+   };
diff --git a/MAINTAINERS b/MAINTAINERS
index a4fbfc8..62e0784 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1578,7 +1578,9 @@ M:Masahiro Yamada 
 L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers)
 S: Maintained
 F: arch/arm/boot/dts/uniphier*
+F: arch/arm/include/asm/hardware/cache-uniphier.h
 F: arch/arm/mach-uniphier/
+F: arch/arm/mm/cache-uniphier.c
 F: drivers/pinctrl/uniphier/
 F: drivers/tty/serial/8250/8250_uniphier.c
 N: uniphier
diff --git a/arch/arm/include/asm/hardware/cache-uniphier.h 
b/arch/arm/include/asm/hardware/cache-uniphier.h
new file mode 100644
index 000..641d32f
--- /dev/null
+++ b/arch/arm/include/asm/hardware/cache-uniphier.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2015 Masahiro Yamada 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __CACHE_UNIPHIER_H
+#define __CACHE_UNIPHIER_H
+
+#ifdef CONFIG_CACHE_UNIPHIER
+int uniphier_cache_init(void);
+int uniphier_cache_init_locked(void);
+void uniphier_cache_touch_range(unsigned long start, unsigned long end);
+#else
+static inline int uniphier_cache_init(void)
+{
+   return -ENODEV;
+}
+
+static inline int uniphier_cache_init_locked(void)
+{
+   return -ENODEV;
+}
+
+static inline void uniphier_cache_touch_range(unsigned long start,
+ unsigned long end)
+{
+}
+
+#endif
+
+#endif /* __CACHE_UNIPHIER_H */
diff --git a/arch/arm/mach-uniphier/uniphier.c 
b/arch/arm/mach-uniphier/uniphier.c
index 9be10ef..6aed136 100644
--- a/arch/arm/mach-uniphier/uniphier.c
+++ b/arch/arm/mach-uniphier/uniphier.c
@@ -12,6 +12,8 @@
  * GNU General Public License for more details.
  */
 
+#include 
+#include 
 #include 
 
 static const char * const uniphier_dt_compat[] __initconst = {
@@ -25,6 +27,15 @@ static const char * const uniphier_dt_compat[] __initconst = 
{
NULL,
 };
 
+static void __init uniphier_init_machine(void)
+{
+   if (uniphier_cache_init())
+   pr_warn("outer cache was not enabled");
+
+   of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+}
+
 DT_MACHINE_START(UNIPHIER, 

[PATCH v2 7/9] mm/compaction: redesign compaction

2015-08-23 Thread Joonsoo Kim
Currently, compaction works as following.
1) migration scanner scans from zone_start_pfn to zone_end_pfn
to find migratable pages
2) free scanner scans from zone_end_pfn to zone_start_pfn to
find free pages
3) If both scanner crossed, compaction is finished.

This algorithm has some drawbacks. 1) Back of the zone cannot be
scanned by migration scanner because migration scanner can't pass
over freepage scanner. So, although there are some high order page
candidates at back of the zone, we can't utilize it.
Another weakness is 2) compaction's success highly depends on amount
of freepage. Compaction can migrate used pages by amount of freepage
at maximum. If we can't make high order page by this effort, both
scanner should meet and compaction will fail.

We can easily observe problem 1) by following test.

Memory is artificially fragmented to make order 3 allocation hard. And,
most of pageblocks are changed to movable migratetype.

  System: 512 MB with 32 MB Zram
  Memory: 25% memory is allocated to make fragmentation and 200 MB is
occupied by memory hogger. Most pageblocks are movable
migratetype.
  Fragmentation: Successful order 3 allocation candidates may be around
1500 roughly.
  Allocation attempts: Roughly 3000 order 3 allocation attempts
with GFP_NORETRY. This value is determined to saturate allocation
success.

Test: hogger-frag-movable

Success(N)70
compact_stall307
compact_success   64
compact_fail 243
pgmigrate_success  34592
compact_isolated   73977
compact_migrate_scanned  2280770
compact_free_scanned 4710313

Column 'Success(N) are calculated by following equations.

Success(N) = successful allocation * 100 /
number of successful order-3 candidates

As mentioned above, there are roughly 1500 high order page candidates,
but, compaction just returns 70% of them, because migration scanner
can't pass over freepage scanner. With new compaction approach, it can
be increased to 94% by this patch.

To check 2), hogger-frag-movable benchmark is used again, but, with some
tweaks. Amount of allocated memory by memory hogger varys.

Test: hogger-frag-movable with free memory variation

Kernel: Base

200MB-Success(N)70
250MB-Success(N)38
300MB-Success(N)29

As background knowledge, up to 250MB, there is enough
memory to succeed all order-3 allocation attempts. In 300MB case,
available memory before starting allocation attempt is just 57MB,
so all of attempts cannot succeed.

Anyway, as free memory decreases, compaction success rate also decreases.
It is better to remove this dependency to get stable compaction result
in any case.

This patch solves these problems mentioned in above.
Freepage scanner is largely changed to scan zone from zone_start_pfn
to zone_end_pfn. And, by this change, compaction finish condition is also
changed that migration scanner reach zone_end_pfn. With these changes,
migration scanner can traverse anywhere in the zone.

To prevent back and forth migration within one compaction iteration,
freepage scanner marks skip-bit when scanning pageblock. migration scanner
checks it and will skip this marked pageblock so back and forth migration
cannot be possible in one compaction iteration.

If freepage scanner reachs the end of zone, it restarts at zone_start_pfn.
In this time, freepage scanner would scan the pageblock where migration
scanner has migrated some pages but fail to make high order page. This
leaved freepages means that they can't become high order page due to
the fragmentation so it is good source for freepage scanner.

With this change, above test result is:

Kernel: Base vs Redesign

Test: hogger-frag-movable

Success(N)70  94
compact_stall3073642
compact_success   64 144
compact_fail 2433498
pgmigrate_success  3459215897219
compact_isolated   7397731899553
compact_migrate_scanned  228077059146745
compact_free_scanned 471031349566134

Test: hogger-frag-movable with free memory variation

200MB-Success(N)70  94
250MB-Success(N)38  93
300MB-Success(N)29  89

Compaction gives us almost all possible high order page. Overhead is
highly increased, but, further patch will reduce it greatly
by adjusting depletion check with this new algorithm.

Signed-off-by: Joonsoo Kim 
---
 mm/compaction.c | 145 ++--
 1 file changed, 77 insertions(+), 68 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index a259608..ca4d6d1 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -53,17 +53,17 @@ static const char *const compaction_status_string[] = {
 static unsigned long release_freepages(struct list_head *freelist)
 {
struct page *page, *next;
-   unsigned long 

[PATCH v2 8/9] mm/compaction: don't use higher order freepage than compaction aims at

2015-08-23 Thread Joonsoo Kim
Purpose of compaction is to make high order page. To achive this purpose,
it is the best strategy that compaction migrates contiguous used pages
to fragmented unused freepages. Currently, freepage scanner don't
distinguish whether freepage is fragmented or not and blindly use
any freepage for migration target regardless of freepage's order.

Using higher order freepage than compaction aims at is not good because
what we do here is breaking high order freepage at somewhere and migrating
used pages from elsewhere to this broken high order freepages in order to
make new high order freepage. That is just position change of high order
freepage.

This is useless effort and doesn't help to make more high order freepages
because we can't be sure that migrating used pages makes high order
freepage. So, this patch makes freepage scanner only uses the ordered
freepage lower than compaction order.

Signed-off-by: Joonsoo Kim 
---
 mm/compaction.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/mm/compaction.c b/mm/compaction.c
index ca4d6d1..e61ee77 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -455,6 +455,7 @@ static unsigned long isolate_freepages_block(struct 
compact_control *cc,
unsigned long flags = 0;
bool locked = false;
unsigned long blockpfn = *start_pfn;
+   unsigned long freepage_order;
 
cursor = pfn_to_page(blockpfn);
 
@@ -482,6 +483,20 @@ static unsigned long isolate_freepages_block(struct 
compact_control *cc,
if (!PageBuddy(page))
goto isolate_fail;
 
+   if (!strict && cc->order != -1) {
+   freepage_order = page_order_unsafe(page);
+
+   if (freepage_order > 0 && freepage_order < MAX_ORDER) {
+   /*
+* Do not use high order freepage for migration
+* taret. It would not be beneficial for
+* compaction success rate.
+*/
+   if (freepage_order >= cc->order)
+   goto isolate_fail;
+   }
+   }
+
/*
 * If we already hold the lock, we can skip some rechecking.
 * Note that if we hold the lock now, checked_pageblock was
-- 
1.9.1

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


[PATCH v2 9/9] mm/compaction: new threshold for compaction depleted zone

2015-08-23 Thread Joonsoo Kim
Now, compaction algorithm become powerful. Migration scanner traverses
whole zone range. So, old threshold for depleted zone which is designed
to imitate compaction deferring approach isn't appropriate for current
compaction algorithm. If we adhere to current threshold, 1, we can't
avoid excessive overhead caused by compaction, because one compaction
for low order allocation would be easily successful in any situation.

This patch re-implements threshold calculation based on zone size and
allocation requested order. We judge whther compaction possibility is
depleted or not by number of successful compaction. Roughly, 1/100
of future scanned area should be allocated for high order page during
one comaction iteration in order to determine whether zone's compaction
possiblity is depleted or not.

Below is test result with following setup.

Memory is artificially fragmented to make order 3 allocation hard. And,
most of pageblocks are changed to movable migratetype.

  System: 512 MB with 32 MB Zram
  Memory: 25% memory is allocated to make fragmentation and 200 MB is
occupied by memory hogger. Most pageblocks are movable
migratetype.
  Fragmentation: Successful order 3 allocation candidates may be around
1500 roughly.
  Allocation attempts: Roughly 3000 order 3 allocation attempts
with GFP_NORETRY. This value is determined to saturate allocation
success.

Test: hogger-frag-movable

Success(N)94  83
compact_stall   36424048
compact_success  144 212
compact_fail34983835
pgmigrate_success   15897219  216387
compact_isolated31899553  487712
compact_migrate_scanned 59146745 2513245
compact_free_scanned49566134 4124319

This change results in greatly decreasing compaction overhead when
zone's compaction possibility is nearly depleted. But, I should admit
that it's not perfect because compaction success rate is decreased.
More precise tuning threshold would restore this regression, but,
it highly depends on workload so I'm not doing it here.

Other test doesn't show big regression.

  System: 512 MB with 32 MB Zram
  Memory: 25% memory is allocated to make fragmentation and kernel
build is running on background. Most pageblocks are movable
migratetype.
  Fragmentation: Successful order 3 allocation candidates may be around
1500 roughly.
  Allocation attempts: Roughly 3000 order 3 allocation attempts
with GFP_NORETRY. This value is determined to saturate allocation
success.

Test: build-frag-movable

Success(N)89  87
compact_stall   40533642
compact_success  264 202
compact_fail37883440
pgmigrate_success6497642  153413
compact_isolated13292640  353445
compact_migrate_scanned 69714502 2307433
compact_free_scanned20243121 2325295

This looks like reasonable trade-off.

Signed-off-by: Joonsoo Kim 
---
 mm/compaction.c | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index e61ee77..e1b44a5 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -129,19 +129,24 @@ static struct page *pageblock_pfn_to_page(unsigned long 
start_pfn,
 
 /* Do not skip compaction more than 64 times */
 #define COMPACT_MAX_FAILED 4
-#define COMPACT_MIN_DEPLETE_THRESHOLD 1UL
+#define COMPACT_MIN_DEPLETE_THRESHOLD 4UL
 #define COMPACT_MIN_SCAN_LIMIT (pageblock_nr_pages)
 
 static bool compaction_depleted(struct zone *zone)
 {
-   unsigned long threshold;
+   unsigned long nr_possible;
unsigned long success = zone->compact_success;
+   unsigned long threshold;
 
-   /*
-* Now, to imitate current compaction deferring approach,
-* choose threshold to 1. It will be changed in the future.
-*/
-   threshold = COMPACT_MIN_DEPLETE_THRESHOLD;
+   nr_possible = zone->managed_pages >> zone->compact_order_failed;
+
+   /* Migration scanner normally scans less than 1/4 range of zone */
+   nr_possible >>= 2;
+
+   /* We hope to succeed more than 1/100 roughly */
+   threshold = nr_possible >> 7;
+
+   threshold = max(threshold, COMPACT_MIN_DEPLETE_THRESHOLD);
if (success >= threshold)
return false;
 
-- 
1.9.1

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


[PATCH v2 4/9] mm/compaction: remove compaction deferring

2015-08-23 Thread Joonsoo Kim
Now, we have a way to determine compaction depleted state and compaction
activity will be limited according this state and depletion depth so
compaction overhead would be well controlled without compaction deferring.
So, this patch remove compaction deferring completely and enable
compaction activity limit.

Various functions are renamed and tracepoint outputs are changed due to
this removing.

Signed-off-by: Joonsoo Kim 
---
 include/linux/compaction.h| 14 +--
 include/linux/mmzone.h|  3 +-
 include/trace/events/compaction.h | 30 ++---
 mm/compaction.c   | 88 ++-
 mm/page_alloc.c   |  2 +-
 mm/vmscan.c   |  4 +-
 6 files changed, 49 insertions(+), 92 deletions(-)

diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index aa8f61c..8d98f3c 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -45,11 +45,8 @@ extern void reset_isolation_suitable(pg_data_t *pgdat);
 extern unsigned long compaction_suitable(struct zone *zone, int order,
int alloc_flags, int classzone_idx);
 
-extern void defer_compaction(struct zone *zone, int order);
-extern bool compaction_deferred(struct zone *zone, int order);
-extern void compaction_defer_reset(struct zone *zone, int order,
+extern void compaction_failed_reset(struct zone *zone, int order,
bool alloc_success);
-extern bool compaction_restarting(struct zone *zone, int order);
 
 #else
 static inline unsigned long try_to_compact_pages(gfp_t gfp_mask,
@@ -74,15 +71,6 @@ static inline unsigned long compaction_suitable(struct zone 
*zone, int order,
return COMPACT_SKIPPED;
 }
 
-static inline void defer_compaction(struct zone *zone, int order)
-{
-}
-
-static inline bool compaction_deferred(struct zone *zone, int order)
-{
-   return true;
-}
-
 #endif /* CONFIG_COMPACTION */
 
 #if defined(CONFIG_COMPACTION) && defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 700e9b5..e13b732 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -514,8 +514,7 @@ struct zone {
 * are skipped before trying again. The number attempted since
 * last failure is tracked with compact_considered.
 */
-   unsigned intcompact_considered;
-   unsigned intcompact_defer_shift;
+   int compact_failed;
int compact_order_failed;
unsigned long   compact_success;
unsigned long   compact_depletion_depth;
diff --git a/include/trace/events/compaction.h 
b/include/trace/events/compaction.h
index 9a6a3fe..323e614 100644
--- a/include/trace/events/compaction.h
+++ b/include/trace/events/compaction.h
@@ -239,7 +239,7 @@ DEFINE_EVENT(mm_compaction_suitable_template, 
mm_compaction_suitable,
 );
 
 #ifdef CONFIG_COMPACTION
-DECLARE_EVENT_CLASS(mm_compaction_defer_template,
+DECLARE_EVENT_CLASS(mm_compaction_deplete_template,
 
TP_PROTO(struct zone *zone, int order),
 
@@ -249,8 +249,9 @@ DECLARE_EVENT_CLASS(mm_compaction_defer_template,
__field(int, nid)
__field(char *, name)
__field(int, order)
-   __field(unsigned int, considered)
-   __field(unsigned int, defer_shift)
+   __field(unsigned long, success)
+   __field(unsigned long, depletion_depth)
+   __field(int, failed)
__field(int, order_failed)
),
 
@@ -258,35 +259,30 @@ DECLARE_EVENT_CLASS(mm_compaction_defer_template,
__entry->nid = zone_to_nid(zone);
__entry->name = (char *)zone->name;
__entry->order = order;
-   __entry->considered = zone->compact_considered;
-   __entry->defer_shift = zone->compact_defer_shift;
+   __entry->success = zone->compact_success;
+   __entry->depletion_depth = zone->compact_depletion_depth;
+   __entry->failed = zone->compact_failed;
__entry->order_failed = zone->compact_order_failed;
),
 
-   TP_printk("node=%d zone=%-8s order=%d order_failed=%d consider=%u 
limit=%lu",
+   TP_printk("node=%d zone=%-8s order=%d failed=%d order_failed=%d 
consider=%lu depth=%lu",
__entry->nid,
__entry->name,
__entry->order,
+   __entry->failed,
__entry->order_failed,
-   __entry->considered,
-   1UL << __entry->defer_shift)
+   __entry->success,
+   __entry->depletion_depth)
 );
 
-DEFINE_EVENT(mm_compaction_defer_template, mm_compaction_deferred,
+DEFINE_EVENT(mm_compaction_deplete_template, mm_compaction_fail_compaction,
 
TP_PROTO(struct zone *zone, int order),
 
TP_ARGS(zone, 

[PATCH v2 3/9] mm/compaction: limit compaction activity in compaction depleted state

2015-08-23 Thread Joonsoo Kim
Compaction deferring was introduced to reduce overhead of compaction
when compaction attempt is expected to fail. But, it has a problem.
Whole zone is rescanned after some compaction attempts are deferred and
this rescan overhead is quite big. And, it imposes large latency to one
random requestor while others will get nearly zero latency to fail due
to deferring compaction. This patch try to handle this situation
differently to solve above problems.

At first, we should know when compaction will fail. Previous patch
defines compaction depleted state. In this state, compaction failure
is highly expected so we don't need to take much effort on compaction.
So, this patch forces migration scanner scan restricted number of pages
in this state. With this way, we can evenly distribute compaction overhead
to all compaction requestors. And, there is a way to escape from
compaction depleted state so we don't need to defer specific number of
compaction attempts unconditionally if compaction possibility recovers.

In this patch, migration scanner limit is defined to imitate current
compaction deferring approach. But, we can tune it easily if this
overhead doesn't look appropriate. It would be further work.

There would be a situation that compaction depleted state is maintained
for a long time. In this case, repeated compaction attempts would cause
useless overhead continually. To optimize this case, this patch uses
compaction depletion depth and make migration scanner limit diminished
according to this depth. It effectively reduce compaction overhead in
this situation.

Should note that this patch just introduces scan_limit infrastructure
and doesn't check scan_limit to finish the compaction. It will
be implemented in next patch with removing compaction deferring.

Signed-off-by: Joonsoo Kim 
---
 mm/compaction.c | 41 +
 mm/internal.h   |  1 +
 2 files changed, 42 insertions(+)

diff --git a/mm/compaction.c b/mm/compaction.c
index de96e9d..c6b8277 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -130,6 +130,7 @@ static struct page *pageblock_pfn_to_page(unsigned long 
start_pfn,
 /* Do not skip compaction more than 64 times */
 #define COMPACT_MAX_DEFER_SHIFT 6
 #define COMPACT_MIN_DEPLETE_THRESHOLD 1UL
+#define COMPACT_MIN_SCAN_LIMIT (pageblock_nr_pages)
 
 static bool compaction_depleted(struct zone *zone)
 {
@@ -147,6 +148,42 @@ static bool compaction_depleted(struct zone *zone)
return true;
 }
 
+static void set_migration_scan_limit(struct compact_control *cc)
+{
+   struct zone *zone = cc->zone;
+   int order = cc->order;
+   unsigned long limit;
+
+   cc->migration_scan_limit = LONG_MAX;
+   if (order < 0)
+   return;
+
+   if (!test_bit(ZONE_COMPACTION_DEPLETED, >flags))
+   return;
+
+   if (!zone->compact_depletion_depth)
+   return;
+
+   /*
+* Experimental observation shows that migration scanner
+* normally scans 1/4 pages
+*/
+   limit = zone->managed_pages >> 2;
+
+   /*
+* Deferred compaction restart compaction every 64 compaction
+* attempts and it rescans whole zone range. If we limit
+* migration scanner to scan 1/64 range when depleted, 64
+* compaction attempts will rescan whole zone range as same
+* as deferred compaction.
+*/
+   limit >>= 6;
+   limit = max(limit, COMPACT_MIN_SCAN_LIMIT);
+
+   /* Degradation scan limit according to depletion depth. */
+   limit >>= zone->compact_depletion_depth;
+   cc->migration_scan_limit = max(limit, COMPACT_CLUSTER_MAX);
+}
 /*
  * Compaction is deferred when compaction fails to result in a page
  * allocation success. 1 << compact_defer_limit compactions are skipped up
@@ -839,6 +876,8 @@ isolate_success:
update_pageblock_skip(cc, valid_page, nr_isolated,
end_pfn, true);
 
+   cc->migration_scan_limit -= nr_scanned;
+
trace_mm_compaction_isolate_migratepages(start_pfn, low_pfn,
nr_scanned, nr_isolated);
 
@@ -1367,6 +1406,8 @@ static int compact_zone(struct zone *zone, struct 
compact_control *cc)
zone->compact_cached_migrate_pfn[1] = cc->migrate_pfn;
}
 
+   set_migration_scan_limit(cc);
+
trace_mm_compaction_begin(start_pfn, cc->migrate_pfn,
cc->free_pfn, end_pfn, sync);
 
diff --git a/mm/internal.h b/mm/internal.h
index 36b23f1..a427695 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -182,6 +182,7 @@ struct compact_control {
unsigned long nr_migratepages;  /* Number of pages to migrate */
unsigned long free_pfn; /* isolate_freepages search base */
unsigned long migrate_pfn;  /* isolate_migratepages search base */
+   long migration_scan_limit;  /* Limit migration scanner activity */
enum migrate_mode 

[PATCH v2 1/9] mm/compaction: skip useless pfn when updating cached pfn

2015-08-23 Thread Joonsoo Kim
Cached pfn is used to determine the start position of scanner
at next compaction run. Current cached pfn points the skipped pageblock
so we uselessly checks whether pageblock is valid for compaction and
skip-bit is set or not. If we set scanner's cached pfn to next pfn of
skipped pageblock, we don't need to do this check.

Signed-off-by: Joonsoo Kim 
---
 mm/compaction.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/mm/compaction.c b/mm/compaction.c
index 6ef2fdf..c2d3d6a 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -261,10 +261,9 @@ void reset_isolation_suitable(pg_data_t *pgdat)
  */
 static void update_pageblock_skip(struct compact_control *cc,
struct page *page, unsigned long nr_isolated,
-   bool migrate_scanner)
+   unsigned long pfn, bool migrate_scanner)
 {
struct zone *zone = cc->zone;
-   unsigned long pfn;
 
if (cc->ignore_skip_hint)
return;
@@ -277,8 +276,6 @@ static void update_pageblock_skip(struct compact_control 
*cc,
 
set_pageblock_skip(page);
 
-   pfn = page_to_pfn(page);
-
/* Update where async and sync compaction should restart */
if (migrate_scanner) {
if (pfn > zone->compact_cached_migrate_pfn[0])
@@ -300,7 +297,7 @@ static inline bool isolation_suitable(struct 
compact_control *cc,
 
 static void update_pageblock_skip(struct compact_control *cc,
struct page *page, unsigned long nr_isolated,
-   bool migrate_scanner)
+   unsigned long pfn, bool migrate_scanner)
 {
 }
 #endif /* CONFIG_COMPACTION */
@@ -509,7 +506,8 @@ isolate_fail:
 
/* Update the pageblock-skip if the whole pageblock was scanned */
if (blockpfn == end_pfn)
-   update_pageblock_skip(cc, valid_page, total_isolated, false);
+   update_pageblock_skip(cc, valid_page, total_isolated,
+   end_pfn, false);
 
count_compact_events(COMPACTFREE_SCANNED, nr_scanned);
if (total_isolated)
@@ -811,7 +809,8 @@ isolate_success:
 * if the whole pageblock was scanned without isolating any page.
 */
if (low_pfn == end_pfn)
-   update_pageblock_skip(cc, valid_page, nr_isolated, true);
+   update_pageblock_skip(cc, valid_page, nr_isolated,
+   end_pfn, true);
 
trace_mm_compaction_isolate_migratepages(start_pfn, low_pfn,
nr_scanned, nr_isolated);
-- 
1.9.1

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


[PATCH 2/3] ARM: uniphier: rework SMP operations to use trampoline code

2015-08-23 Thread Masahiro Yamada
The complexity of the boot sequence of UniPhier SoC family is
a PITA due to the following hardware limitations:

[1] No dedicated on-chip SRAM
SoCs in general have small SRAM, on which a tiny firmware or a boot
loader can run before SDRAM is initialized.  As UniPhier SoCs do not
have any dedicated SRAM accessible from CPUs, the locked outer cache
is used instead.  Due to the ARM specification, to have access to
the outer cache, the MMU must be enabled.  This is done for all CPU
cores by the program hard-wired in the boot ROM.  The boot ROM code
loads a small amount of program (this is usually SPL of U-Boot) from
a non-volatile device onto the locked outer cache, and the primary
CPU jumps to it.  The secondary CPUs stay in the boot ROM until they
are kicked by the primary CPU.

[2] CPUs can not directly jump to SDRAM address space
As mentioned above, the MMU is enable for all the CPUs with the page
table hard-wired in the boot ROM.  Unfortunately, the page table only
has minimal sets of valid sections; all the sections of SDRAM address
space are zero-filled.  That means all the CPUs, including secondary
ones, can not jump directly to SDRAM address space.  So, the primary
CPU must bring up secondary CPUs to accessible address mapped onto
the outer cache, then again kick them to SDRAM address space.

Before this commit, this complex task was done with help of a boot
loader (U-Boot); U-Boot SPL brings up the secondary CPUs to the entry
of U-Boot SPL and they stay there until they are kicked by Linux.
This is not nice because a boot loader must put the secondary CPUs
into a certain state the kernel expects.  It makes difficult to port
another boot loader because the boot loader and the kernel must work
in sync to wake up the secondary CPUs.

This commit reworks the SMP operations without any help of the boot
loader; the SMP operations (mach-uniphier/platsmp.c) enables the
locked outer cache and puts trampoline code (mach-uniphier/headsmp.S)
there.  The secondary CPUs jump from the boot ROM to secondary_entry
via the trampoline code.  The boot loader no longer need to take care
of SMP.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/Makefile   |   2 +-
 arch/arm/mach-uniphier/headsmp.S  |  43 +
 arch/arm/mach-uniphier/platsmp.c  | 183 +++---
 arch/arm/mach-uniphier/uniphier.c |   2 +-
 4 files changed, 197 insertions(+), 33 deletions(-)
 create mode 100644 arch/arm/mach-uniphier/headsmp.S

diff --git a/arch/arm/mach-uniphier/Makefile b/arch/arm/mach-uniphier/Makefile
index 60bd226..1233f9b 100644
--- a/arch/arm/mach-uniphier/Makefile
+++ b/arch/arm/mach-uniphier/Makefile
@@ -1,2 +1,2 @@
 obj-y  := uniphier.o
-obj-$(CONFIG_SMP)  += platsmp.o
+obj-$(CONFIG_SMP)  += platsmp.o headsmp.o
diff --git a/arch/arm/mach-uniphier/headsmp.S b/arch/arm/mach-uniphier/headsmp.S
new file mode 100644
index 000..c819dff
--- /dev/null
+++ b/arch/arm/mach-uniphier/headsmp.S
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2015 Masahiro Yamada 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+
+ENTRY(uniphier_smp_trampoline)
+ARM_BE8(setend be) @ ensure we are in BE8 mode
+   mrc p15, 0, r0, c0, c0, 5   @ MPIDR (Multiprocessor Affinity Reg)
+   and r2, r0, #0x3@ CPU ID
+   ldr r1, uniphier_smp_trampoline_jump
+   ldr r3, uniphier_smp_trampoline_poll_addr
+   mrc p15, 0, r0, c1, c0, 0   @ SCTLR (System Control Register)
+   orr r0, r0, #CR_I   @ Enable ICache
+   bic r0, r0, #(CR_C | CR_M)  @ Disable MMU and Dcache
+   mcr p15, 0, r0, c1, c0, 0
+   b   1f  @ cache the following 5 instructions
+0: wfe
+1: ldr r0, [r3]
+   cmp r0, r2
+   bxeqr1  @ branch to secondary_startup
+   b   0b
+   .globl  uniphier_smp_trampoline_jump
+uniphier_smp_trampoline_jump:
+   .word   0   @ set virt_to_phys(secondary_startup)
+   .globl  uniphier_smp_trampoline_poll_addr
+uniphier_smp_trampoline_poll_addr:
+   .word   0   @ set CPU ID to be kicked to this reg
+   .globl  uniphier_smp_trampoline_end
+uniphier_smp_trampoline_end:
+ENDPROC(uniphier_smp_trampoline)
diff --git a/arch/arm/mach-uniphier/platsmp.c b/arch/arm/mach-uniphier/platsmp.c
index 4b784f7..774dd5f 100644
--- a/arch/arm/mach-uniphier/platsmp.c
+++ 

[PATCH v2 0/9] mm/compaction: redesign compaction

2015-08-23 Thread Joonsoo Kim
Major changes from v1:
o Add one skip-bit on each pageblock to avoid the pageblock that
cannot be used for migration target

o Allow freepage scanner to scan non-movable pageblock only if zone
is in compaction depleted state:
To allow scanning on non-movable pageblock cannot be avoided because
there is a system where almost pageblocks are unmovable pageblock.
And, without this patch, as compaction progress, all of freepages are
moved to non-movable pageblock due to asymetric characteristic of
scanner's target pageblock and compaction will stop working due to
shortage of migration target freepage. In experiment, allowing
freepage scanner to scan non-movable pageblock only if zone is
in compaction depleted state doesn't fragment the system more than
before with ensuring great success rate improvement.

o Don't use high-order freepage higher than the order we try to make:
It prevents parallel freepage scanner undo migration scanner's work.

o Include elapsed time in stress-highalloc test

o Include page owner result to check fragmentation

o All result are refreshed

o Remove Success attribute in result:
Showing two similar metric make reader somewhat confused
so remove less important one. Remained one Success(N) is calculated
by following equation.

Success(N) = successful allocation * 100 / order-3 candidates

o Prevent freepage scanner to scan a zone many times

Orignial cover-letter with some refresh
Recently, I got a report that android get slow due to order-2 page
allocation. With some investigation, I found that compaction usually
fails and many pages are reclaimed to make order-2 freepage. I can't
analyze detailed reason that causes compaction fail because I don't
have reproducible environment and compaction code is changed so much
from that version, v3.10. But, I was inspired by this report and started
to think limitation of current compaction algorithm.

Limitation of current compaction algorithm:

1) Migrate scanner can't scan behind of free scanner, because
each scanner starts at both side of zone and go toward each other. If
they meet at some point, compaction is stopped and scanners' position
is reset to both side of zone again. From my experience, migrate scanner
usually doesn't scan beyond of half of the zone range.

2) Compaction capability is highly depends on amount of free memory.
If there is 50 MB free memory on 4 GB system, migrate scanner can
migrate 50 MB used pages at maximum and then will meet free scanner.
If compaction can't make enough high order freepages during this
amount of work, compaction would fail. There is no way to escape this
failure situation in current algorithm and it will scan same region and
fail again and again. And then, it goes into compaction deferring logic
and will be deferred for some times.

3) Compaction capability is highly depends on migratetype of memory,
because freepage scanner doesn't scan unmovable pageblock.

To investigate compaction limitations, I made some compaction benchmarks.
Base environment of this benchmark is fragmented memory. Before testing,
25% of total size of memory is allocated. With some tricks, these
allocations are evenly distributed to whole memory range. So, after
allocation is finished, memory is highly fragmented and possibility of
successful order-3 allocation is very low. Roughly 1500 order-3 allocation
can be successful. Tests attempt excessive amount of allocation request,
that is, 3000, to find out algorithm limitation.

There are two variations.

pageblock type (unmovable / movable):

One is that most pageblocks are unmovable migratetype and the other is
that most pageblocks are movable migratetype.

memory usage (memory hogger 200 MB / kernel build with -j8):

Memory hogger means that 200 MB free memory is occupied by hogger.
Kernel build means that kernel build is running on background and it
will consume free memory, but, amount of consumption will be very
fluctuated.

With these variations, I made 4 test cases by mixing them.

hogger-frag-unmovable
hogger-frag-movable
build-frag-unmovable
build-frag-movable

All tests are conducted on 512 MB QEMU virtual machine with 8 CPUs.

I can easily check weakness of compaction algorithm by following test.

To check 1), hogger-frag-movable benchmark is used. Result is as
following.

Kernel: Base

Success(N)70
compact_stall307
compact_success   64
compact_fail 243
pgmigrate_success  34592
compact_isolated   73977
compact_migrate_scanned  2280770
compact_free_scanned 4710313

Column 'Success(N) are calculated by following equations.

Success(N) = successful allocation * 100 /
number of order-3 candidates

As mentioned above, there are roughly 1500 high order page candidates,
but, compaction just returns 70% of them even if system is under low load.
With new compaction approach, it can be increased to 94%.

To check 2), hogger-frag-movable benchmark is used again, but, with some

RE: [PATCH 7/7] ipmi/kcs: Don't run the KCS state machine when it is KCS_IDLE

2015-08-23 Thread 河合英宏 / KAWAI,HIDEHIRO
> From: Corey Minyard [mailto:tcminy...@gmail.com] On Behalf Of Corey Minyard
> 
> On 08/17/2015 09:54 PM, 河合英宏 / KAWAI,HIDEHIRO wrote:
> >> From: Corey Minyard [mailto:tcminy...@gmail.com] On Behalf Of Corey Minyard
> >>
> >> This patch will break ATN handling on the interfaces.  So we can't do this.
> > I understand.  So how about doing like this:
> >
> > /* All states wait for ibf, so just do it here. */
> > -   if (!check_ibf(kcs, status, time))
> > +   if (kcs->state != KCS_IDLE && !check_ibf(kcs, status, time))
> > return SI_SM_CALL_WITH_DELAY;
> >
> > I think it is not necessary to wait IBF when the state is IDLE.
> > In this way, we can also handle the ATN case.
> 
> I think it would be more reliable to go up a level and add a timeout.

It may be so, but we should address this issue separately (at least
I think above solution reasonably solves the issue).

This issue happens after all queued messages are processed or dropped
by timeout.  There is no current message.  So what should we set
a timeout against?  We can add a timeout into my new flush_messages(),
but that is meaningful only in panic context.  That doesn't help
in normal context; we would perform a busy loop of smi_event_handler()
and schedule() in ipmi_thread().

Regards,

Hidehiro Kawai

> One should
> be there, anyway.  I thought they were all covered, but I may have missed
> something.
> 
> -corey
> 
> >
> > Regards,
> >
> > Hidehiro Kawai
> > Hitachi, Ltd. Research & Development Group
> >
> >> It's going to be extremely hard to recover if the BMC is not working
> >> correctly when a panic happens.  I'm not sure what can be done, but if
> >> you can fix it another way it would be good.
> >>
> >> -corey
> >>
> >> On 07/27/2015 12:55 AM, Hidehiro Kawai wrote:
> >>> If a BMC is unresponsive for some reason, it ends up completing
> >>> the requested message as an error, then kcs_event() is called once
> >>> to advance the state machine.  However, since the BMC is
> >>> unresponsive now, the status of the KCS interface may not be
> >>> idle.  As the result, the state machine can continue to run and
> >>> comsume CPU time indefinitely even if there is no more request
> >>> message.  Moreover, if this happens in run-to-completion mode
> >>> (i.e. context of panic_event()), the kernel hangs up.
> >>>
> >>> To fix this problem, this patch ignores kcs_event() call if there
> >>> is no request message to be processed.
> >>>
> >>> Signed-off-by: Hidehiro Kawai 
> >>> ---
> >>>  drivers/char/ipmi/ipmi_kcs_sm.c |4 
> >>>  1 file changed, 4 insertions(+)
> >>>
> >>> diff --git a/drivers/char/ipmi/ipmi_kcs_sm.c 
> >>> b/drivers/char/ipmi/ipmi_kcs_sm.c
> >>> index 8c25f59..0e187fb 100644
> >>> --- a/drivers/char/ipmi/ipmi_kcs_sm.c
> >>> +++ b/drivers/char/ipmi/ipmi_kcs_sm.c
> >>> @@ -353,6 +353,10 @@ static enum si_sm_result kcs_event(struct si_sm_data 
> >>> *kcs, long time)
> >>>   if (kcs_debug & KCS_DEBUG_STATES)
> >>>   printk(KERN_DEBUG "KCS: State = %d, %x\n", kcs->state, status);
> >>>
> >>> + /* We don't want to run the state machine when the state is IDLE */
> >>> + if (kcs->state == KCS_IDLE)
> >>> + return SI_SM_IDLE;
> >>> +
> >>>   /* All states wait for ibf, so just do it here. */
> >>>   if (!check_ibf(kcs, status, time))
> >>>   return SI_SM_CALL_WITH_DELAY;
> >>>
> >>>



Re: [PATCH RESEND] sched/nohz: Affine unpinned timers to housekeepers

2015-08-23 Thread Frederic Weisbecker
On Sun, Aug 23, 2015 at 07:40:32AM +0200, Ingo Molnar wrote:
> So I almost applied this yesterday, but had the following question: what 
> ensures 
> that housekeeping_mask isn't empty? If it's empty then housekeeping_any_cpu() 
> returns cpumask_any_and() of an empty cpumask - which returns an out of range 
> index AFAICS - which will crash and burn in:
> 
> kernel/time/hrtimer.c:  return _cpu(hrtimer_bases, 
> get_nohz_timer_target());
> kernel/time/timer.c:return per_cpu_ptr(_bases, 
> get_nohz_timer_target());
> 
> housekeeping_mask itself is derived from tick_nohz_full_mask (it's the 
> inverse of 
> it in essence), and tick_nohz_full_mask is set via two methods, either via a 
> boot 
> parameter:
> 
> if (cpulist_parse(str, tick_nohz_full_mask) < 0) {
> 
> in tick_nohz_full_setup(). What ensures here that tick_nohz_full_mask is not 
> completely full - making housekeeping_mask empty?
> 
> The other method is via CONFIG_NO_HZ_FULL_ALL:
> 
> cpumask_setall(tick_nohz_full_mask);
> 
> here it's fully set - triggering the bug I'm worried about. So what am I 
> missing, 
> what prevents CONFIG_NO_HZ_FULL_ALL from crashing?

Legitimate worry and I should have explained that in the changelog.

Like Paul replied, we make sure that at least the boot CPU is excluded
from tick_nohz_full_mask in tick_nohz_init(). Then housekeeping_mask,
by reverse effect, contains that boot CPU at least.

And we also make sure that the boot CPU can't get offline
(tick_nohz_cpu_down_callback()).

Now we should really document and check that assumption so here is a
second patch below. The sched patch depends on tip:sched/core (to avoid
conflicts with sched changes) and the following one is based on
tip:timer/nohz but should be applicable to sched/core without conflict.
Both are standalone anyway.

Thanks!

---
From: Frederic Weisbecker 
Date: Sun, 23 Aug 2015 19:34:31 +0200
Subject: [PATCH] nohz: Assert existing housekeepers when nohz full enabled

The code ensures that at least the boot CPU serves as a housekeeper.

Let's assert this assumption to make sure that we have CPUs to handle
unbound jobs like workqueues and timers while nohz full CPUs run
undisturbed.

Signed-off-by: Frederic Weisbecker 
---
 kernel/time/tick-sched.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 3319e16..cc9884f 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -370,6 +370,12 @@ void __init tick_nohz_init(void)
cpu_notifier(tick_nohz_cpu_down_callback, 0);
pr_info("NO_HZ: Full dynticks CPUs: %*pbl.\n",
cpumask_pr_args(tick_nohz_full_mask));
+
+   /*
+* We need at least one CPU to handle housekeeping work such
+* as timekeeping, unbound timers, workqueues, ...
+*/
+   WARN_ON_ONCE(cpumask_empty(housekeeping_mask));
 }
 #endif
 
-- 
2.1.4


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


[RFC PATCH v7 10/10] arm: zx_defconfig: remove CONFIG_MMC_DW_IDMAC

2015-08-23 Thread Shawn Lin
DesignWare MMC Controller's transfer mode should be decided
at runtime instead of compile-time. So we remove this config
option and read dw_mmc's register to select DMA master.

Signed-off-by: Shawn Lin 
---

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/configs/zx_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/configs/zx_defconfig b/arch/arm/configs/zx_defconfig
index b200bb0..ab683fb 100644
--- a/arch/arm/configs/zx_defconfig
+++ b/arch/arm/configs/zx_defconfig
@@ -83,7 +83,6 @@ CONFIG_MMC=y
 CONFIG_MMC_UNSAFE_RESUME=y
 CONFIG_MMC_BLOCK_MINORS=16
 CONFIG_MMC_DW=y
-CONFIG_MMC_DW_IDMAC=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT4_FS=y
 CONFIG_EXT4_FS_POSIX_ACL=y
-- 
2.3.7


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


Re: [PATCH RESEND] sched/nohz: Affine unpinned timers to housekeepers

2015-08-23 Thread Frederic Weisbecker
On Sun, Aug 23, 2015 at 09:01:01AM -0700, Paul E. McKenney wrote:
> The boot CPU is excluded from tick_nohz_full_mask in tick_nohz_init(),
> which is called from tick_init() which is called from start_kernel()
> shortly after rcu_init():
> 
>   cpu = smp_processor_id();
> 
>   if (cpumask_test_cpu(cpu, tick_nohz_full_mask)) {
>   pr_warning("NO_HZ: Clearing %d from nohz_full range for 
> timekeeping\n", cpu);
>   cpumask_clear_cpu(cpu, tick_nohz_full_mask);
>   }
> 
> This happens after the call to tick_nohz_init_all() that does the
> cpumask_setall() that you called out above.
> 
> Or is a recent patch that I missed changing this?

Exactly, this happens right after tick_nohz_full_mask is filled and
makes sure that at least the boot CPU runs as a housekeeper. We
also make sure that it can't become offline later.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC PATCH v7 08/10] arm: lpc18xx_defconfig: remove CONFIG_MMC_DW_IDMAC

2015-08-23 Thread Shawn Lin
DesignWare MMC Controller's transfer mode should be decided
at runtime instead of compile-time. So we remove this config
option and read dw_mmc's register to select DMA master.

Signed-off-by: Shawn Lin 
Acked-by: Joachim Eastwood 
---

Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 arch/arm/configs/lpc18xx_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/configs/lpc18xx_defconfig 
b/arch/arm/configs/lpc18xx_defconfig
index 1c47f86..b7e8cda 100644
--- a/arch/arm/configs/lpc18xx_defconfig
+++ b/arch/arm/configs/lpc18xx_defconfig
@@ -119,7 +119,6 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_MMC=y
 CONFIG_MMC_DW=y
-CONFIG_MMC_DW_IDMAC=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
 CONFIG_LEDS_PCA9532=y
-- 
2.3.7


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


  1   2   3   4   5   6   >