Re: [V9fs-developer] [PATCH] 9p: trans_fd, initialize recv fcall properly if not set

2015-09-05 Thread Dominique Martinet
Eric Van Hensbergen wrote on Sat, Sep 05, 2015:
> On Thu, Sep 3, 2015 at 4:38 AM, Dominique Martinet
>  wrote:
> > To be honest, I think it might be better to just bail out if we get in
> > this switch (m->req->rc == NULL after p9_tag_lookup) and not try to
> > allocate more, because if we get there it's likely a race condition and
> > silently re-allocating will end up in more troubles than trying to
> > recover is worth.
> > Thoughts ?
> >
> 
> Hmmm...trying to rattle my brain and remember why I put it in there
> back in 2008.
> It might have just been over-defensive programming -- or more likely it just
> pre-dated all the zero copy infrastructure which pretty much guaranteed we had
> an rc allocated and what is there is vestigial.  I'm happy to accept a
> patch which
> makes this an assert, or perhaps just resets the connection because something
> has gone horribly wrong (similar to the ENOMEM path that is there now).

Yeah, it looks like the safety comes from the zero-copy stuff that came
much later.
Let's go with resetting the connection then. Hmm. EIO is a bit too
generic so would be good to avoid that if possible, but can't think of
anything better...


Speaking of zero-copy, I believe it should be fairly straight-forward to
implement for trans_fd now I've actually looked at it, since we do the
payload read after a p9_tag_lookup, would just need m->req to point to a
zc buffer. Write is similar, if there's a zc buffer just send it after
the header.
The cost is a couple more pointers in req and an extra if in both
workers, that seems pretty reasonable.

Well, I'm not using trans_fd much here (and unfortunately zero-copy
isn't possible at all given the transport protocol for RDMA, at least
for recv), but if anyone cares it probably could be done without too
much hassle for the fd workers.

-- 
Dominique
--
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 15/15] x86/headers: Remove

2015-09-05 Thread Ingo Molnar

* Mikko Rapeli  wrote:

> On Sat, Sep 05, 2015 at 01:59:43PM +0200, Ingo Molnar wrote:
> > 
> > * Mikko Rapeli  wrote:
> > 
> > > > diff --git a/arch/x86/include/uapi/asm/sigcontext32.h 
> > > > b/arch/x86/include/uapi/asm/sigcontext32.h
> > > > index a92b0f0dc09e..8b870175befa 100644
> > > > --- a/arch/x86/include/uapi/asm/sigcontext32.h
> > > > +++ b/arch/x86/include/uapi/asm/sigcontext32.h
> > > > @@ -3,6 +3,6 @@
> > > >  
> > > >  /* This is a legacy file - all the type definitions are in 
> > > > sigcontext.h: */
> > > >  
> > > > -#include 
> > > > +#include 
> > > 
> > > This needs to be without uapi directory in path.
> > 
> > What do you mean?
> 
> There is not uapi in path in userspace so it fails to compile:

Ok, I see. So it's not common, but I don't think there's an outright 
prohibition 
for uapi headers to refer to each other:

 arch/hexagon/include/uapi/asm/signal.h:#include 
 arch/mips/include/uapi/asm/siginfo.h:#include 
 arch/x86/include/uapi/asm/sigcontext32.h:#include 

There are a couple of solutions:

  - copy the uapi/ directory if you take the kernel headers as-is

  - adapt the headers to the old user-space layout when you import them.
(i.e. do a sed -i 's/ This is the fix:
> 
> --- a/arch/x86/include/uapi/asm/sigcontext32.h
> +++ b/arch/x86/include/uapi/asm/sigcontext32.h
> @@ -3,6 +3,6 @@
>  
>  /* This is a legacy file - all the type definitions are in sigcontext.h: */
>  
> -#include 
> +#include 

There's no asm/sigcontext.h file anymore if you apply my patches - but we could 
reintroduce it to make the copy of UAPI headers to user-space work as-is.

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/


RE: [PATCH V7 2/3] qe_common: add qe_muram_ functions to manage muram

2015-09-05 Thread Zhao Qiang
On Mon, 2015-09-2 at 8:34 +0800, Wood Scott-B07421 wrote:
> -Original Message-
> From: Wood Scott-B07421
> Sent: Wednesday, September 02, 2015 8:34 AM
> To: Zhao Qiang-B45475
> Cc: linux-kernel@vger.kernel.org; linuxppc-...@lists.ozlabs.org;
> lau...@codeaurora.org; Xie Xiaobo-R63061; b...@kernel.crashing.org; Li
> Yang-Leo-R58472; pau...@samba.org
> Subject: Re: [PATCH V7 2/3] qe_common: add qe_muram_ functions to manage
> muram
> 
> On Mon, 2015-08-31 at 16:58 +0800, Zhao Qiang wrote:
> 
> > @@ -187,12 +190,25 @@ static inline int qe_alive_during_sleep(void)  }
> >
> >  /* we actually use cpm_muram implementation, define this for
> > convenience */ -#define qe_muram_init cpm_muram_init -#define
> > qe_muram_alloc cpm_muram_alloc -#define qe_muram_alloc_fixed
> > cpm_muram_alloc_fixed -#define qe_muram_free cpm_muram_free -#define
> > qe_muram_addr cpm_muram_addr -#define qe_muram_offset cpm_muram_offset
> > +#define cpm_muram_init qe_muram_init
> > +#define cpm_muram_alloc qe_muram_alloc #define cpm_muram_alloc_fixed
> > +qe_muram_alloc_fixed #define cpm_muram_free qe_muram_free #define
> > +cpm_muram_addr qe_muram_addr #define cpm_muram_offset qe_muram_offset
> 
> Why?  This is unnecessary churn.
> 
This is necessary. QE is on both ARM and PowerPC, its code is under public code.
But CPM is only on PowerPC and its code is under PowerPC.
So when build ARM, QE will not find cpm_muram_* function.
> 
> 
> >
> > -int cpm_muram_init(void)
> > -{
> > - struct device_node *np;
> > - struct resource r;
> > - u32 zero[OF_MAX_ADDR_CELLS] = {};
> > - resource_size_t max = 0;
> > - int i = 0;
> > - int ret = 0;
> > -
> > - if (muram_pbase)
> > - return 0;
> > -
> > - spin_lock_init(&cpm_muram_lock);
> > - /* initialize the info header */
> > - rh_init(&cpm_muram_info, 1,
> > - sizeof(cpm_boot_muram_rh_block) /
> > - sizeof(cpm_boot_muram_rh_block[0]),
> > - cpm_boot_muram_rh_block);
> > -
> > - np = of_find_compatible_node(NULL, NULL, "fsl,cpm-muram-data");
> > - if (!np) {
> > - /* try legacy bindings */
> > - np = of_find_node_by_name(NULL, "data-only");
> > - if (!np) {
> > - printk(KERN_ERR "Cannot find CPM muram data
> node");
> > - ret = -ENODEV;
> > - goto out;
> > - }
> > - }
> > -
> > - muram_pbase = of_translate_address(np, zero);
> > - if (muram_pbase == (phys_addr_t)OF_BAD_ADDR) {
> > - printk(KERN_ERR "Cannot translate zero through CPM muram
> node");
> > - ret = -ENODEV;
> > - goto out;
> > - }
> > 
> -Scott



Re: [PATCH net] net: bridge: check __vlan_vid_del for error

2015-09-05 Thread Jiri Pirko
Sun, Sep 06, 2015 at 03:27:57AM CEST, vivien.dide...@savoirfairelinux.com wrote:
>Since __vlan_del can return an error code, change its inner function
>__vlan_vid_del to return an eventual error from switchdev_port_obj_del.
>
>Signed-off-by: Vivien Didelot 

Acked-by: Jiri Pirko 
--
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: bridge: remove unnecessary switchdev include

2015-09-05 Thread Jiri Pirko
Sun, Sep 06, 2015 at 03:49:41AM CEST, vivien.dide...@savoirfairelinux.com wrote:
>Remove the unnecessary switchdev.h include from br_netlink.c.
>
>Signed-off-by: Vivien Didelot 

Acked-by: Jiri Pirko 
--
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 16/17] staging: sm750fb: ddk750_*i2c: remove multiple blank lines

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about multiple blank lines

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 8d06f48..34b687b 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 hw_i2c_wait_tx_done(void)
 {
unsigned int timeout;
@@ -76,8 +73,6 @@ static long 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 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 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 5cb1cf2..ddbbeff 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 v3 13/17] staging: sm750fb: ddk750_hwi2c: reduce amount of CamelCase

2015-09-05 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 abac6ae..8d06f48 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -82,25 +82,25 @@ static long 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 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 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 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 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 hw_i2c_write_data(
  *  Total number of actual bytes read from the slave device
  */
 static unsigned int 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 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 v3 15/17] staging: sm750fb: ddk750_swi2c: further reduce CamelCase

2015-09-05 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 1d7e8f6..5cb1cf2 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -98,11 +98,11 @@ static void 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 sw_i2c_wait(void)
  */
 static void 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 sw_i2c_scl(unsigned char value)
  */
 static void 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 sw_i2c_sda(unsigned char value)
  */
 static unsigned char 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
return 0;
@@ -340,15 +340,15 @@ static 

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

2015-09-05 Thread Mike Rapoport
Fix some checkpatch warnings about long lines

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 34b687b..7be2111 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -63,7 +63,8 @@ static long 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 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 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 (hw_i2c_wait_tx_done() != 0)
@@ -165,7 +170,10 @@ static unsigned int 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 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 (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 ddbbeff..37cdd5b 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -125,7 +125,10 @@ static void 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 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 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 direction is i

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

2015-09-05 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 a35505d..abac6ae 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -220,14 +220,14 @@ static unsigned int 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 (hw_i2c_write_data(deviceAddress, 1, ®isterIndex) == 1)
-   hw_i2c_read_data(deviceAddress, 1, &value);
+   if (hw_i2c_write_data(addr, 1, ®) == 1)
+   hw_i2c_read_data(addr, 1, &value);
 
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 (hw_i2c_write_data(deviceAddress, 2, value) == 2)
+   if (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 v3 10/17] staging: sm750fb: ddk750_swi2c: rename CamelCase static functions

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about CamelCase.

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..faaf858 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 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 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 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 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 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 sw_i2c_start(void)
 {
/* Start I2C */
-   swI2CSDA(1);
-   swI2CSCL(1);
-   swI2CSDA(0);
+   sw_i2c_sda(1);
+   sw_i2c_scl(1);
+   sw_i2c_sda(0);
 }
 
 /*
  *  This function sends the stop command to the slave device
  */
-static void swI2CStop(void)
+static void sw_i2c_stop(void)
 {
/* Stop the I2C */
-   swI2CSCL(1);
-   swI2CSDA(0);
-   swI2CSDA(1);
+   sw_i2c_scl(1);
+   sw_i2c_sda(0);
+   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 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);
+   sw_i2c_scl(0);
 
/* Send data bit */
if ((value & 0x80) != 0)
-   swI2CSDA(1);
+   sw_i2c_sda(1);
else
-   swI2CSDA(0);
+   sw_i2c_sda(0);
 
-   swI2CWait();
+   sw_i2c_wait();
 
/* Toggle clk line to one */
-   swI2CSCL(1);
-   swI2CWait();
+   sw_i2c_scl(1);
+   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);
+   sw_i2c_scl(0);
+   sw_i2c_sda(1);
 
/* Set the SCL High for ack */
-   swI2CWait();
-   swI2CSCL(1);
-   swI2CWait();
+   sw_i2c_wait();
+   sw_i2c_scl(1);
+   sw_i2c_wait();
 
/* Read SDA, until SDA==0 */
for (i = 0; i < 0xff; i++) {
-   if (!swI2CReadSDA())
+   if (!sw_i2c_read_sda())
break;
 
-   swI2CSCL(0);
-   swI2CWait();
-   swI2CSCL(1);
-   swI2CWait();
+   sw_i2c_scl(0);
+   sw_i2c_wait();
+   sw_i2c_scl(1);
+   sw_i2c_wait();
}
 
/* Set the SCL Low and SDA High */
-   swI2CSCL(0);
-   swI2CSDA(1);
+   sw_i2c_scl(0);
+   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 unsigned char sw_i2c_read_byte(unsigned char ack)
 {
int i;
unsigned char data = 0;
 
for (i = 7; i >= 0; i--) {

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

2015-09-05 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 65c1546..a35505d 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 v3 14/17] staging: sm750fb: ddk750_swi2c: rename CamelCase static variables

2015-09-05 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 faaf858..1d7e8f6 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 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 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 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))) {
-   ulGPIODirection &= ~(1 

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

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about CamelCase.

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 v3 06/17] staging: sm750fb: rename swI2CInit to sm750_sw_i2c_init

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about CamelCase.

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 v3 09/17] staging: sm750fb: ddk750_swi2c: staticize swI2C{SCL,SDA}

2015-09-05 Thread Mike Rapoport
swI2C{SCL,SDA} are not used outside ddk750_swi2c, make them static

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 v3 07/17] staging: sm750fb: rename swI2CReadReg to sm750_sw_i2c_read_reg

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about CamelCase.

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 v3 05/17] staging: sm750fb: ddk750_hwi2c: rename CamelCase static functions

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about CamelCase.

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..65c1546 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 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 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 (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 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 (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, ®isterIndex) == 1)
-   hwI2CReadData(deviceAddress, 1, &value);
+   if (hw_i2c_write_data(deviceAddress, 1, ®isterIndex) == 1)
+   hw_i2c_read_data(deviceAddress, 1, &value);
 
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 (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 v3 03/17] staging: sm750fb: rename hwI2CReadReg to sm750_hw_i2c_read_reg

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about CamelCase

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 v3 04/17] staging: sm750fb: rename hwI2CWriteReg to sm750_hw_i2c_write_reg

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about CamelCase

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 v3 01/17] staging: sm750fb: rename hwI2CInit to sm750_hw_i2c_init

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about CamelCase

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 v3 02/17] staging: sm750fb: rename hwI2CClose to sm750_hw_i2c_close

2015-09-05 Thread Mike Rapoport
Fix the checkpatch warning about CamelCase

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/


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

2015-09-05 Thread Mike Rapoport
Hi,

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

v3 changes:
* fix wrong variable rename in patch 12 (staging: sm750fb: ddk750_swi2c: 
staticize swI2C{SCL,SDA})
* fix changelong text in patch 9 (staging: sm750fb: ddk750_swi2c: staticize 
swI2C{SCL,SDA})

v2 changes:
* add changelog text
* change patch 5 (staging: sm750fb: ddk750_hwi2c: rename CamelCase static 
functions) so that ut won't add sm750_ prefix to static functions


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] perf test: Enforce LLVM test, add kbuild test

2015-09-05 Thread Wang Nan
This patch enforces existing LLVM test, makes it compile more than one
BPF source file. The compiled results are stored, can be used for other
testcases. Except the first testcase (named LLVM_TESTCASE_BASE), failures
of other test cases are not considered as failure of the whole test.

Adds a kbuild testcase to check whether kernel headers can be correctly
found.

For example:

 # perf test LLVM

   38: Test LLVM searching and compiling: 
(llvm.kbuild-dir can be fixed) Ok

Signed-off-by: Wang Nan 
Cc: Arnaldo Carvalho de Melo 
Cc: Alexei Starovoitov 
Cc: Brendan Gregg 
Cc: Daniel Borkmann 
Cc: David Ahern 
Cc: He Kuang 
Cc: Jiri Olsa 
Cc: Kaixu Xia 
Cc: Masami Hiramatsu 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Zefan Li 
Cc: pi3or...@163.com
---
 tools/perf/tests/Build|  11 ++-
 tools/perf/tests/bpf-script-example.c |   4 +
 tools/perf/tests/bpf-script-test-kbuild.c |  21 
 tools/perf/tests/bpf.c|   3 +-
 tools/perf/tests/llvm.c   | 154 ++
 tools/perf/tests/llvm.h   |  10 +-
 6 files changed, 156 insertions(+), 47 deletions(-)
 create mode 100644 tools/perf/tests/bpf-script-test-kbuild.c

diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build
index 5cfb420..2bd5f37 100644
--- a/tools/perf/tests/Build
+++ b/tools/perf/tests/Build
@@ -32,17 +32,24 @@ perf-y += sample-parsing.o
 perf-y += parse-no-sample-id-all.o
 perf-y += kmod-path.o
 perf-y += thread-map.o
-perf-y += llvm.o llvm-src.o
+perf-y += llvm.o llvm-src-base.o llvm-src-kbuild.o
 perf-y += bpf.o
 perf-y += topology.o
 
-$(OUTPUT)tests/llvm-src.c: tests/bpf-script-example.c
+$(OUTPUT)tests/llvm-src-base.c: tests/bpf-script-example.c
$(call rule_mkdir)
$(Q)echo '#include ' > $@
$(Q)echo 'const char test_llvm__bpf_prog[] =' >> $@
$(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@
$(Q)echo ';' >> $@
 
+$(OUTPUT)tests/llvm-src-kbuild.c: tests/bpf-script-test-kbuild.c
+   $(call rule_mkdir)
+   $(Q)echo '#include ' > $@
+   $(Q)echo 'const char test_llvm__bpf_test_kbuild_prog[] =' >> $@
+   $(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@
+   $(Q)echo ';' >> $@
+
 perf-$(CONFIG_X86) += perf-time-to-tsc.o
 ifdef CONFIG_AUXTRACE
 perf-$(CONFIG_X86) += insn-x86.o
diff --git a/tools/perf/tests/bpf-script-example.c 
b/tools/perf/tests/bpf-script-example.c
index 410a70b..0ec9c2c 100644
--- a/tools/perf/tests/bpf-script-example.c
+++ b/tools/perf/tests/bpf-script-example.c
@@ -1,3 +1,7 @@
+/*
+ * bpf-script-example.c
+ * Test basic LLVM building
+ */
 #ifndef LINUX_VERSION_CODE
 # error Need LINUX_VERSION_CODE
 # error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x40200" 
into llvm section of ~/.perfconfig'
diff --git a/tools/perf/tests/bpf-script-test-kbuild.c 
b/tools/perf/tests/bpf-script-test-kbuild.c
new file mode 100644
index 000..a11f589
--- /dev/null
+++ b/tools/perf/tests/bpf-script-test-kbuild.c
@@ -0,0 +1,21 @@
+/*
+ * bpf-script-test-kbuild.c
+ * Test include from kernel header
+ */
+#ifndef LINUX_VERSION_CODE
+# error Need LINUX_VERSION_CODE
+# error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x40200" 
into llvm section of ~/.perfconfig'
+#endif
+#define SEC(NAME) __attribute__((section(NAME), used))
+
+#include 
+#include 
+
+SEC("func=vfs_llseek")
+int bpf_func__vfs_llseek(struct pt_regs *ctx)
+{
+   return 0;
+}
+
+char _license[] SEC("license") = "GPL";
+int _version SEC("version") = LINUX_VERSION_CODE;
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index e256c12..64aaab68 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -143,7 +143,8 @@ int test__bpf(void)
return TEST_SKIP;
}
 
-   test_llvm__fetch_bpf_obj(&obj_buf, &obj_buf_sz);
+   test_llvm__fetch_bpf_obj(&obj_buf, &obj_buf_sz, LLVM_TESTCASE_BASE);
+
if (!obj_buf || !obj_buf_sz) {
if (verbose == 0)
fprintf(stderr, " (fix 'perf test LLVM' first)");
diff --git a/tools/perf/tests/llvm.c b/tools/perf/tests/llvm.c
index fd5fdb0..75cd99f 100644
--- a/tools/perf/tests/llvm.c
+++ b/tools/perf/tests/llvm.c
@@ -9,6 +9,22 @@
 #include "debug.h"
 #include "llvm.h"
 
+#define SHARED_BUF_INIT_SIZE   (1 << 20)
+struct llvm_testcase {
+   const char *source;
+   const char *errmsg;
+   struct test_llvm__bpf_result *result;
+   bool tried;
+} llvm_testcases[NR_LLVM_TESTCASES + 1] = {
+   [LLVM_TESTCASE_BASE]= {.source = test_llvm__bpf_prog,
+  .errmsg = "Basic LLVM compiling failed",
+  .tried = false},
+   [LLVM_TESTCASE_KBUILD]  = {.source = test_llvm__bpf_test_kbuild_prog,
+  .errmsg = "llvm.kbuild-dir can be fixed",
+  .tried = false},
+   {.source = NULL}
+};
+
 static int perf_config

[PATCH] perf test: Test BPF prologue

2015-09-05 Thread Wang Nan
This patch introduces a new BPF script to test BPF prologue. The new
script probes at null_lseek, which is the function pointer when we try
to lseek on '/dev/null'.

null_lseek is chosen because it is a function pointer, so we don't need
to consider inlining and LTP.

By extracting file->f_mode, bpf-script-test-prologue.c should know whether
the file is writable or readonly. According to llseek_loop() and
bpf-script-test-prologue.c, one forth of total lseeks should be collected.

This patch improve test__bpf so it can run multiple BPF programs on
different test functions.

Signed-off-by: Wang Nan 
Cc: Arnaldo Carvalho de Melo 
Cc: Alexei Starovoitov 
Cc: Brendan Gregg 
Cc: Daniel Borkmann 
Cc: David Ahern 
Cc: He Kuang 
Cc: Jiri Olsa 
Cc: Kaixu Xia 
Cc: Masami Hiramatsu 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Zefan Li 
Cc: pi3or...@163.com
---
 tools/perf/tests/Build  |  9 ++-
 tools/perf/tests/bpf-script-test-prologue.c | 35 +++
 tools/perf/tests/bpf.c  | 93 +++--
 tools/perf/tests/llvm.c |  5 ++
 tools/perf/tests/llvm.h |  8 +++
 5 files changed, 130 insertions(+), 20 deletions(-)
 create mode 100644 tools/perf/tests/bpf-script-test-prologue.c

diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build
index 2bd5f37..3e98a97 100644
--- a/tools/perf/tests/Build
+++ b/tools/perf/tests/Build
@@ -32,7 +32,7 @@ perf-y += sample-parsing.o
 perf-y += parse-no-sample-id-all.o
 perf-y += kmod-path.o
 perf-y += thread-map.o
-perf-y += llvm.o llvm-src-base.o llvm-src-kbuild.o
+perf-y += llvm.o llvm-src-base.o llvm-src-kbuild.o llvm-src-prologue.o
 perf-y += bpf.o
 perf-y += topology.o
 
@@ -50,6 +50,13 @@ $(OUTPUT)tests/llvm-src-kbuild.c: 
tests/bpf-script-test-kbuild.c
$(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@
$(Q)echo ';' >> $@
 
+$(OUTPUT)tests/llvm-src-prologue.c: tests/bpf-script-test-prologue.c
+   $(call rule_mkdir)
+   $(Q)echo '#include ' > $@
+   $(Q)echo 'const char test_llvm__bpf_test_prologue_prog[] =' >> $@
+   $(Q)sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/g' $< >> $@
+   $(Q)echo ';' >> $@
+
 perf-$(CONFIG_X86) += perf-time-to-tsc.o
 ifdef CONFIG_AUXTRACE
 perf-$(CONFIG_X86) += insn-x86.o
diff --git a/tools/perf/tests/bpf-script-test-prologue.c 
b/tools/perf/tests/bpf-script-test-prologue.c
new file mode 100644
index 000..7230e62
--- /dev/null
+++ b/tools/perf/tests/bpf-script-test-prologue.c
@@ -0,0 +1,35 @@
+/*
+ * bpf-script-test-prologue.c
+ * Test BPF prologue
+ */
+#ifndef LINUX_VERSION_CODE
+# error Need LINUX_VERSION_CODE
+# error Example: for 4.2 kernel, put 'clang-opt="-DLINUX_VERSION_CODE=0x40200" 
into llvm section of ~/.perfconfig'
+#endif
+#define SEC(NAME) __attribute__((section(NAME), used))
+
+#include 
+
+#define FMODE_READ 0x1
+#define FMODE_WRITE0x2
+
+static void (*bpf_trace_printk)(const char *fmt, int fmt_size, ...) =
+   (void *) 6;
+
+SEC("func=null_lseek file->f_mode offset orig")
+int bpf_func__null_lseek(void *ctx, int err, unsigned long f_mode,
+unsigned long offset, unsigned long orig)
+{
+   if (err)
+   return 0;
+   if (f_mode & FMODE_WRITE)
+   return 0;
+   if (offset & 1)
+   return 0;
+   if (orig == SEEK_CUR)
+   return 0;
+   return 1;
+}
+
+char _license[] SEC("license") = "GPL";
+int _version SEC("version") = LINUX_VERSION_CODE;
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 64aaab68..6305b3d 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -19,14 +19,37 @@ static int epoll_pwait_loop(void)
return 0;
 }
 
-static int prepare_bpf(void *obj_buf, size_t obj_buf_sz)
+#ifdef HAVE_BPF_PROLOGUE
+
+static int llseek_loop(void)
+{
+   int fds[2], i;
+
+   fds[0] = open("/dev/null", O_RDONLY);
+   fds[1] = open("/dev/null", O_RDWR);
+
+   if (fds[0] < 0 || fds[1] < 0)
+   return -1;
+
+   for (i = 0; i < NR_ITERS; i++) {
+   lseek(fds[i % 2], i, (i / 2) % 2 ? SEEK_CUR : SEEK_SET);
+   lseek(fds[(i + 1) % 2], i, (i / 2) % 2 ? SEEK_CUR : SEEK_SET);
+   }
+   close(fds[0]);
+   close(fds[1]);
+   return 0;
+}
+
+#endif
+
+static int prepare_bpf(const char *name, void *obj_buf, size_t obj_buf_sz)
 {
int err;
char errbuf[BUFSIZ];
 
-   err = bpf__prepare_load_buffer(obj_buf, obj_buf_sz, NULL);
+   err = bpf__prepare_load_buffer(obj_buf, obj_buf_sz, name);
if (err) {
-   bpf__strerror_prepare_load("[buffer]", false, err, errbuf,
+   bpf__strerror_prepare_load(name, false, err, errbuf,
   sizeof(errbuf));
fprintf(stderr, " (%s)", errbuf);
return TEST_FAIL;
@@ -49,7 +72,7 @@ static int prepare_bpf(void *obj_buf, size_t obj_buf_sz)
return 0;
 }

Re: [PATCH v2] x86/asm/entry/64: Minor cleanup of conditional compilation

2015-09-05 Thread H. Peter Anvin

On 09/05/15 13:53, Nikolay Borisov wrote:

The entry_SYSCALL_64_fastpath was checking the value of __SYSCALL_MASK,
which in turn was being set in arch/x86/include/asm/unistd.h depending on
whether CONFIG_X86_X32_ABI was set or not. This made the intention a bit
cryptic.


On the contrary: that instruction can be omitted if and only if the 
value of the mask is all 1's; it doesn't matter how the mask is set.  So 
you just turned a local constraint into a global constraint.  This is 
both unnecessarily confusing and opens the risk for bugs later.


If you feel the need, you could submit a patch to add a comment, but 
this version is:


Nacked-by: H. Peter Anvin 

--
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 23/31] perf tools: Introduce regs_query_register_offset() for x86

2015-09-05 Thread Wangnan (F)



On 2015/9/1 23:54, 平松雅巳 / HIRAMATU,MASAMI wrote:

From: Arnaldo Carvalho de Melo [mailto:a...@redhat.com]

Em Tue, Sep 01, 2015 at 11:47:41AM +, 平松雅巳 / HIRAMATU,MASAMI escreveu:

From: Wang Nan [mailto:wangn...@huawei.com]

regs_query_register_offset() is a helper function which converts
register name like "%rax" to offset of a register in 'struct pt_regs',
which is required by BPF prologue generator. Since the function is
identical, try to reuse the code in arch/x86/kernel/ptrace.c.

Comment inside dwarf-regs.c list the differences between this
implementation and kernel code.

Hmm, this also introduce a duplication of the code...
It might be a good time to move them into arch/x86/lib/ and
reuse it directly from perf code.

It is strange to, having tried sharing stuff directly from the kernel,
to be now in a position where I advocate against it...

Copy'n'pasting what I said in another message:

-
We would go back to sharing stuff with the kernel, but this time around
we would be using something that everybody knows is being shared, which
doesn't elliminates the possibility that at some point changes made with
the kernel in mind would break the tools/ using code.

Perhaps it is better to keep copying what we want and introduce
infrastructure to check for differences and warn us as soon as possible
so that we would do the copy, test if it doesn't break what we use, etc.

I.e. we wouldn't be putting any new burden on the "kernel people", i.e.
the burden of having to check that changes they make don't break tools/
living code, nor any out of the blue breakage on tools/ for tools/
developers to fix when changes are made on the kernel "side" -
---

The "stop sharing directly stuff with the kernel" stance was taken after
a report from Linus about breakage due to tools/ using kernel files
directly and then a change made in some RCU files broke the tools/perf/
build, even with tools/perf/ not using anything RCU related so far.

Looking at tools/perf/MANIFEST, the file used to create a detached
tarball so that perf can be built outside the kernel sources there are
still some kernel source files listed, but those probably need to be
copied too...

OK, so let this apply.

Acked-by: Masami Hiramatsu 

And also we'll need a testcase for this.


I created a testcase for the whole BPF prologue, so I think this can be 
covered?


I'll post them by replying this mail.

Thank you.


Thank you,


- Arnaldo


Thank you,


get_arch_regstr() switches to regoffset_table and the old string table
is dropped.

Signed-off-by: Wang Nan 
Signed-off-by: He Kuang 
Cc: Alexei Starovoitov 
Cc: Brendan Gregg 
Cc: Daniel Borkmann 
Cc: David Ahern 
Cc: He Kuang 
Cc: Jiri Olsa 
Cc: Kaixu Xia 
Cc: Masami Hiramatsu 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Zefan Li 
Cc: pi3or...@163.com
Cc: Arnaldo Carvalho de Melo 
---
  tools/perf/arch/x86/Makefile  |   1 +
  tools/perf/arch/x86/util/Build|   1 +
  tools/perf/arch/x86/util/dwarf-regs.c | 122 --
  3 files changed, 90 insertions(+), 34 deletions(-)

diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index 21322e0..09ba923 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -2,3 +2,4 @@ ifndef NO_DWARF
  PERF_HAVE_DWARF_REGS := 1
  endif
  HAVE_KVM_STAT_SUPPORT := 1
+PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
diff --git a/tools/perf/arch/x86/util/Build b/tools/perf/arch/x86/util/Build
index 2c55e1b..d4d1f23 100644
--- a/tools/perf/arch/x86/util/Build
+++ b/tools/perf/arch/x86/util/Build
@@ -4,6 +4,7 @@ libperf-y += pmu.o
  libperf-y += kvm-stat.o

  libperf-$(CONFIG_DWARF) += dwarf-regs.o
+libperf-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o

  libperf-$(CONFIG_LIBUNWIND)  += unwind-libunwind.o
  libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
diff --git a/tools/perf/arch/x86/util/dwarf-regs.c 
b/tools/perf/arch/x86/util/dwarf-regs.c
index a08de0a..de5b936 100644
--- a/tools/perf/arch/x86/util/dwarf-regs.c
+++ b/tools/perf/arch/x86/util/dwarf-regs.c
@@ -21,55 +21,109 @@
   */

  #include 
+#include  /* for EINVAL */
+#include  /* for strcmp */
+#include  /* for struct pt_regs */
+#include  /* for offsetof */
  #include 

  /*
- * Generic dwarf analysis helpers
+ * See arch/x86/kernel/ptrace.c.
+ * Different from it:
+ *
+ *  - Since struct pt_regs is defined differently for user and kernel,
+ *but we want to use 'ax, bx' instead of 'rax, rbx' (which is struct
+ *field name of user's pt_regs), we make REG_OFFSET_NAME to accept
+ *both string name and reg field name.
+ *
+ *  - Since accessing x86_32's pt_regs from x86_64 building is difficult
+ *and vise versa, we simply fill offset with -1, so
+ *get_arch_regstr() still works but regs_query_register_offset()
+ *returns error.
+ *The only inconvenience caused by it now is that we are not allowed
+ *to generate BPF prologue for a x86_64 kernel if perf is built for
+ *

[PATCH] perf tools: Sync setting of real bpf events with placeholder

2015-09-05 Thread Wang Nan
In this patch, when adding real events described in BPF objects, sync
filter and tracking settings with previous dummy placeholder. After
this patch, command like:

 # perf record --test-filter.o --exclude-perf ls

work as we expect.

After all settings are synced, we remove those placeholder from evlist
so they won't appear in the final perf.data.

Signed-off-by: Wang Nan 
Cc: Alexei Starovoitov 
Cc: Brendan Gregg 
Cc: Daniel Borkmann 
Cc: David Ahern 
Cc: He Kuang 
Cc: Jiri Olsa 
Cc: Kaixu Xia 
Cc: Masami Hiramatsu 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Zefan Li 
Cc: pi3or...@163.com
Cc: Arnaldo Carvalho de Melo 
---
 tools/perf/util/bpf-loader.c |  8 -
 tools/perf/util/bpf-loader.h |  1 +
 tools/perf/util/evlist.c | 75 +---
 3 files changed, 79 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 2880dbf..3400538 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -325,6 +325,12 @@ int bpf__foreach_tev(bpf_prog_iter_callback_t func, void 
*arg)
int err;
 
bpf_object__for_each_safe(obj, tmp) {
+   const char *obj_name;
+
+   obj_name = bpf_object__get_name(obj);
+   if (!obj_name)
+   obj_name = "[unknown].o";
+
bpf_object__for_each_program(prog, obj) {
struct probe_trace_event *tev;
struct perf_probe_event *pev;
@@ -348,7 +354,7 @@ int bpf__foreach_tev(bpf_prog_iter_callback_t func, void 
*arg)
return fd;
}
 
-   err = (*func)(tev, fd, arg);
+   err = (*func)(tev, obj_name, fd, arg);
if (err) {
pr_debug("bpf: call back failed, stop 
iterate\n");
return err;
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h
index 34656f8..5bac423 100644
--- a/tools/perf/util/bpf-loader.h
+++ b/tools/perf/util/bpf-loader.h
@@ -13,6 +13,7 @@
 #define PERF_BPF_PROBE_GROUP "perf_bpf_probe"
 
 typedef int (*bpf_prog_iter_callback_t)(struct probe_trace_event *tev,
+   const char *obj_name,
int fd, void *arg);
 
 #ifdef HAVE_LIBBPF_SUPPORT
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 29212dc..7e36563 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -197,7 +197,54 @@ error:
return -ENOMEM;
 }
 
-static int add_bpf_event(struct probe_trace_event *tev, int fd,
+static void sync_with_bpf_placeholder(struct perf_evlist *evlist,
+ const char *obj_name,
+ struct list_head *list)
+{
+   struct perf_evsel *dummy_evsel, *pos;
+
+   const char *filter;
+   bool tracking_set = false;
+   bool found = false;
+
+   evlist__for_each(evlist, dummy_evsel) {
+   if (!perf_evsel__is_bpf_placeholder(dummy_evsel))
+   continue;
+
+   if (strcmp(dummy_evsel->name, obj_name) == 0) {
+   found = true;
+   break;
+   }
+   }
+
+   if (!found) {
+   pr_debug("Failed to find dummy event of '%s'\n",
+obj_name);
+   return;
+   }
+
+   filter = dummy_evsel->filter;
+
+   list_for_each_entry(pos, list, node) {
+   if (filter && perf_evsel__set_filter(pos, filter)) {
+   pr_debug("Failed to set filter '%s' to evsel %s\n",
+filter, pos->name);
+   }
+
+   /* Sync tracking */
+   if (dummy_evsel->tracking && !tracking_set)
+   pos->tracking = tracking_set = true;
+
+   /*
+* If someday we allow to add config terms or modifiers
+* to placeholder, we should sync them with real events
+* here. Currently only tracking needs to be considered.
+*/
+   }
+}
+
+static int add_bpf_event(struct probe_trace_event *tev,
+const char *obj_name, int fd,
 void *arg)
 {
struct perf_evlist *evlist = arg;
@@ -205,8 +252,8 @@ static int add_bpf_event(struct probe_trace_event *tev, int 
fd,
struct list_head list;
int err, idx, entries;
 
-   pr_debug("add bpf event %s:%s and attach bpf program %d\n",
-   tev->group, tev->event, fd);
+   pr_debug("add bpf event %s:%s and attach bpf program %d (from %s)\n",
+   tev->group, tev->event, fd, obj_name);
INIT_LIST_HEAD(&list);
idx = evlist->nr_entries;
 
@@ -228,13 +275,33 @@ stati

Re: [RFC PATCH v1 2/4] irqchip: GICv3: set non-percpu irqs status with _IRQ_MOVE_PCNTXT

2015-09-05 Thread Jiang Liu
On 2015/9/6 12:23, Yang Yingliang wrote:
> Use irq_settings_set_move_pcntxt() helper irqs status with
> _IRQ_MOVE_PCNTXT. So that it can do set affinity when calling
> irq_set_affinity_locked().
Hi Yingliang,
We could only set _IRQ_MOVE_PCNTCT flag to enable migrating
IRQ in process context if your hardware platform supports atomically
change IRQ configuration. Not sure whether that's true for GICv3.
If GICv3 doesn't support atomically change irq configuration, this
change may cause trouble.
Thanks!
Gerry

> 
> Cc: Jiang Liu 
> Cc: Thomas Gleixner 
> Cc: Marc Zyngier 
> Cc: Mark Rutland 
> Cc: Will Deacon 
> Cc: Russell King - ARM Linux 
> Cc: Hanjun Guo 
> Signed-off-by: Yang Yingliang 
> ---
>  drivers/irqchip/irq-gic-v3.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
> index e406bc5..9108387 100644
> --- a/drivers/irqchip/irq-gic-v3.c
> +++ b/drivers/irqchip/irq-gic-v3.c
> @@ -688,6 +688,7 @@ static int gic_irq_domain_map(struct irq_domain *d, 
> unsigned int irq,
>   irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
>   handle_fasteoi_irq, NULL, NULL);
>   set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
> + irq_set_move_pcntxt(irq);
>   }
>   /* LPIs */
>   if (hw >= 8192 && hw < GIC_ID_NR) {
> @@ -696,6 +697,7 @@ static int gic_irq_domain_map(struct irq_domain *d, 
> unsigned int irq,
>   irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
>   handle_fasteoi_irq, NULL, NULL);
>   set_irq_flags(irq, IRQF_VALID);
> + irq_set_move_pcntxt(irq);
>   }
>  
>   return 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] perf tools: Allow BPF placeholder dummy events to collect --filter options

2015-09-05 Thread Wang Nan
This patch improves collection and setting of filters, allows --filter
be set to BPF placeholder events (which is a software dummy event).

perf_evsel__is_dummy(), perf_evsel__is_bpf_placeholder() and
perf_evsel__can_filter() are introduced for this.

Test result:

 # perf record --event dummy --exclude-perf
 --exclude-perf option should follow a -e tracepoint option

 # perf record --event dummy:u --exclude-perf ls
 --exclude-perf option should follow a -e tracepoint option

 # perf record --event test.o --exclude-perf ls
 Added new event:
   perf_bpf_probe:func_vfs_write (on vfs_write)
 ...

 # perf record --event dummy.o --exclude-perf ls
 Added new event:
   perf_bpf_probe:func_write (on sys_write)
 ...

Signed-off-by: Wang Nan 
Cc: Alexei Starovoitov 
Cc: Brendan Gregg 
Cc: Daniel Borkmann 
Cc: David Ahern 
Cc: He Kuang 
Cc: Jiri Olsa 
Cc: Kaixu Xia 
Cc: Masami Hiramatsu 
Cc: Namhyung Kim 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Zefan Li 
Cc: pi3or...@163.com
Cc: Arnaldo Carvalho de Melo 
---
 tools/perf/util/evlist.c   |  7 +++
 tools/perf/util/evsel.c| 32 
 tools/perf/util/evsel.h| 23 +++
 tools/perf/util/parse-events.c |  4 ++--
 4 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 93db4c1..29212dc 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1223,6 +1223,13 @@ int perf_evlist__apply_filters(struct perf_evlist 
*evlist, struct perf_evsel **e
continue;
 
/*
+* Filters are allowed to be set to dummy event for BPF object
+* placeholder. Don't really apply them.
+*/
+   if (perf_evsel__is_dummy(evsel))
+   continue;
+
+   /*
 * filters only work for tracepoint event, which doesn't have 
cpu limit.
 * So evlist and evsel should always be same.
 */
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 73cf9fc..e307ea2 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2344,3 +2344,35 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, 
struct target *target,
 err, strerror_r(err, sbuf, sizeof(sbuf)),
 perf_evsel__name(evsel));
 }
+
+bool perf_evsel__is_bpf_placeholder(struct perf_evsel *evsel)
+{
+   if (!perf_evsel__is_dummy(evsel))
+   return false;
+   if (!evsel->name)
+   return false;
+   /*
+* If evsel->name doesn't starts with 'dummy', it must be a BPF
+* place holder.
+*/
+   if (strncmp(evsel->name, perf_evsel__sw_names[PERF_COUNT_SW_DUMMY],
+   strlen(perf_evsel__sw_names[PERF_COUNT_SW_DUMMY])))
+   return true;
+   /*
+* Very rare case: evsel->name is 'dummy_crazy.bpf'.
+*
+* Let's check name suffix. A bpf file should ends with one of:
+* '.o', '.c' or '.bpf'.
+*/
+#define SUFFIX_CMP(s)\
+   strcmp(evsel->name + strlen(evsel->name) - (sizeof(s) - 1), s)
+
+   if (SUFFIX_CMP(".o") == 0)
+   return true;
+   if (SUFFIX_CMP(".c") == 0)
+   return true;
+   if (SUFFIX_CMP(".bpf") == 0)
+   return true;
+   return false;
+#undef SUFFIX_CMP
+}
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index fd22f83..864fd3f 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -372,11 +372,34 @@ bool perf_evsel__fallback(struct perf_evsel *evsel, int 
err,
 int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
  int err, char *msg, size_t size);
 
+bool perf_evsel__is_bpf_placeholder(struct perf_evsel *evsel);
+
 static inline int perf_evsel__group_idx(struct perf_evsel *evsel)
 {
return evsel->idx - evsel->leader->idx;
 }
 
+static inline bool perf_evsel__is_dummy(struct perf_evsel *evsel)
+{
+   if (!evsel)
+   return false;
+   if (evsel->attr.type != PERF_TYPE_SOFTWARE)
+   return false;
+   if (evsel->attr.config != PERF_COUNT_SW_DUMMY)
+   return false;
+   return true;
+}
+
+static inline int perf_evsel__can_filter(struct perf_evsel *evsel)
+{
+   if (!evsel)
+   return false;
+   if (evsel->attr.type == PERF_TYPE_TRACEPOINT)
+   return true;
+
+   return perf_evsel__is_bpf_placeholder(evsel);
+}
+
 #define for_each_group_member(_evsel, _leader) 
\
 for ((_evsel) = list_entry((_leader)->node.next, struct perf_evsel, node); 
\
  (_evsel) && (_evsel)->leader == (_leader);
\
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index b560f5f..d961e90 100644
--- a/tools/perf/util/parse-even

Re: [RFC PATCH v1 4/4] arm/arm64: fix a migrating irq bug when hotplug cpu

2015-09-05 Thread Jiang Liu


On 2015/9/6 12:23, Yang Yingliang wrote:
> When cpu is disabled, all irqs will be migratged to another cpu.
> In some cases, a new affinity is different, it needed to be coppied
> to irq's affinity. But if the type of irq is LPI, it's affinity will
> not be coppied because of irq_set_affinity's return value. Fix it by
> using irq_do_set_affinity.
> 
> And migrating interrupts is a core code matter, so move the code to
> kernel/irq/migration.c and select CONFIG_GENERIC_IRQ_MIGRATION when
> CONFIG_HOTPLUG_CPU and CONFIG_SMP is enabled.
> 
> Cc: Jiang Liu 
> Cc: Thomas Gleixner 
> Cc: Marc Zyngier 
> Cc: Mark Rutland 
> Cc: Will Deacon 
> Cc: Russell King - ARM Linux 
> Cc: Hanjun Guo 
> Signed-off-by: Yang Yingliang 
> ---
>  arch/arm/Kconfig |  1 +
>  arch/arm/include/asm/irq.h   |  1 -
>  arch/arm/kernel/irq.c| 62 
> 
>  arch/arm64/Kconfig   |  1 +
>  arch/arm64/include/asm/irq.h |  1 -
>  arch/arm64/kernel/irq.c  | 62 
> 
>  kernel/irq/migration.c   | 62 
> 
>  7 files changed, 64 insertions(+), 126 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 41cbb4a..ebc8a33 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -22,6 +22,7 @@ config ARM
>   select GENERIC_CLOCKEVENTS_BROADCAST if SMP
>   select GENERIC_IDLE_POLL_SETUP
>   select GENERIC_IRQ_PROBE
> + select GENERIC_IRQ_MIGRATION if SMP && HOTPLUG_CPU
>   select GENERIC_IRQ_SHOW
>   select GENERIC_IRQ_SHOW_LEVEL
>   select GENERIC_PCI_IOMAP
> diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
> index 53c15de..d17fc900 100644
> --- a/arch/arm/include/asm/irq.h
> +++ b/arch/arm/include/asm/irq.h
> @@ -24,7 +24,6 @@
>  #ifndef __ASSEMBLY__
>  struct irqaction;
>  struct pt_regs;
> -extern void migrate_irqs(void);
>  
>  extern void asm_do_IRQ(unsigned int, struct pt_regs *);
>  void handle_IRQ(unsigned int, struct pt_regs *);
> diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
> index baf8ede..2efdb40 100644
> --- a/arch/arm/kernel/irq.c
> +++ b/arch/arm/kernel/irq.c
> @@ -31,7 +31,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
> @@ -135,64 +134,3 @@ int __init arch_probe_nr_irqs(void)
>   return nr_irqs;
>  }
>  #endif
> -
> -#ifdef CONFIG_HOTPLUG_CPU
> -static bool migrate_one_irq(struct irq_desc *desc)
> -{
> - struct irq_data *d = irq_desc_get_irq_data(desc);
> - const struct cpumask *affinity = irq_data_get_affinity_mask(d);
> - struct irq_chip *c;
> - bool ret = false;
> -
> - /*
> -  * If this is a per-CPU interrupt, or the affinity does not
> -  * include this CPU, then we have nothing to do.
> -  */
> - if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), 
> affinity))
> - return false;
> -
> - if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
> - affinity = cpu_online_mask;
> - ret = true;
> - }
> -
> - c = irq_data_get_irq_chip(d);
> - if (!c->irq_set_affinity)
> - pr_debug("IRQ%u: unable to set affinity\n", d->irq);
> - else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && 
> ret)
> - cpumask_copy(irq_data_get_affinity_mask(d), affinity);
> -
> - return ret;
> -}
> -
> -/*
> - * The current CPU has been marked offline.  Migrate IRQs off this CPU.
> - * If the affinity settings do not allow other CPUs, force them onto any
> - * available CPU.
> - *
> - * Note: we must iterate over all IRQs, whether they have an attached
> - * action structure or not, as we need to get chained interrupts too.
> - */
> -void migrate_irqs(void)
> -{
> - unsigned int i;
> - struct irq_desc *desc;
> - unsigned long flags;
> -
> - local_irq_save(flags);
> -
> - for_each_irq_desc(i, desc) {
> - bool affinity_broken;
> -
> - raw_spin_lock(&desc->lock);
> - affinity_broken = migrate_one_irq(desc);
> - raw_spin_unlock(&desc->lock);
> -
> - if (affinity_broken)
> - pr_warn_ratelimited("IRQ%u no longer affine to CPU%u\n",
> - i, smp_processor_id());
> - }
> -
> - local_irq_restore(flags);
> -}
> -#endif /* CONFIG_HOTPLUG_CPU */
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index b7b9cea..6ffe411 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -32,6 +32,7 @@ config ARM64
>   select GENERIC_CPU_AUTOPROBE
>   select GENERIC_EARLY_IOREMAP
>   select GENERIC_IRQ_PROBE
> + select GENERIC_IRQ_MIGRATION if SMP && HOTPLUG_CPU
>   select GENERIC_IRQ_SHOW
>   select GENERIC_IRQ_SHOW_LEVEL
>   select GENERIC_PCI_IOMAP
> diff --git a/arch/arm64/include/asm/irq.h b/arch/arm64/include/asm/irq.h
> index bbb251b..0916929 100644
> ---

RE: [PATCH] ahci: added a new driver for supporting Freescale AHCI sata

2015-09-05 Thread Yuantian Tang
Hi,

> -Original Message-
> From: Hans de Goede [mailto:hdego...@redhat.com]
> Sent: Wednesday, September 02, 2015 4:32 PM
> To: Tang Yuantian-B29983 
> Cc: t...@kernel.org; linux-...@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH] ahci: added a new driver for supporting Freescale AHCI
> sata
> 
> Hi,
> 
> On 02-09-15 04:25, yuantian.t...@freescale.com wrote:
> > From: Tang Yuantian 
> >
> > Currently Freescale QorIQ series SATA is supported by ahci_platform
> > driver. Some SoC specific settings have been put in uboot. So whether
> > SATA works or not heavily depends on uboot.
> > This patch will add a new driver to support QorIQ sata which removes
> > the dependency on any other boot loader.
> > Freescale QorIQ series sata, like ls1021a ls2085a ls1043a, is
> > compatible with serial ATA 3.0 and AHCI 1.3 specification.
> >
> > Signed-off-by: Yuantian Tang 
> 
> Thanks for the patch looks good overall.
> 
> You need to add a Documentation/devicetree/bindings/ata/ahci-fsl-qoriq.txt
> (or a similar named file) documenting the compatible strings and what the
> devicetree nodes should contain wrt reg, interrupts, etc.
> properties. See Documentation/devicetree/bindings/ata/ahci-platform.txt
> as an example.
> 
> Further comments inline.
> 
I was about to use ahci_platform driver, so I added the bindings stuff to
Documentation/devicetree/bindings/ata/ahci-platform.txt
So I need to revert the old bingings first and then add a new one.

> > ---
> >   drivers/ata/Kconfig |   9 ++
> >   drivers/ata/Makefile|   1 +
> >   drivers/ata/ahci_platform.c |   1 -
> >   drivers/ata/ahci_qoriq.c| 308
> 
> >   4 files changed, 318 insertions(+), 1 deletion(-)
> >   create mode 100644 drivers/ata/ahci_qoriq.c
> >
> > diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index
> > 15e40ee..6aaa3f8 100644
> > --- a/drivers/ata/Kconfig
> > +++ b/drivers/ata/Kconfig
> > @@ -175,6 +175,15 @@ config AHCI_XGENE
> > help
> >  This option enables support for APM X-Gene SoC SATA host
> controller.
> >
> > +config AHCI_QORIQ
> > +   tristate "Freescale QorIQ AHCI SATA support"
> > +   depends on OF
> > +   help
> > + This option enables support for the Freescale QorIQ AHCI SoC's
> > + onboard AHCI SATA.
> > +
> > + If unsure, say N.
> > +
> >   config SATA_FSL
> > tristate "Freescale 3.0Gbps SATA support"
> > depends on FSL_SOC
> > diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile index
> > af70919..af45eff 100644
> > --- a/drivers/ata/Makefile
> > +++ b/drivers/ata/Makefile
> > @@ -19,6 +19,7 @@ obj-$(CONFIG_AHCI_SUNXI)  += ahci_sunxi.o
> libahci.o libahci_platform.o
> >   obj-$(CONFIG_AHCI_ST) += ahci_st.o libahci.o
> libahci_platform.o
> >   obj-$(CONFIG_AHCI_TEGRA)  += ahci_tegra.o libahci.o
> libahci_platform.o
> >   obj-$(CONFIG_AHCI_XGENE)  += ahci_xgene.o libahci.o
> libahci_platform.o
> > +obj-$(CONFIG_AHCI_QORIQ)   += ahci_qoriq.o libahci.o
> libahci_platform.o
> >
> >   # SFF w/ custom DMA
> >   obj-$(CONFIG_PDC_ADMA)+= pdc_adma.o
> > diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
> > index 1befb11..04975b8 100644
> > --- a/drivers/ata/ahci_platform.c
> > +++ b/drivers/ata/ahci_platform.c
> > @@ -76,7 +76,6 @@ static const struct of_device_id ahci_of_match[] = {
> > { .compatible = "ibm,476gtr-ahci", },
> > { .compatible = "snps,dwc-ahci", },
> > { .compatible = "hisilicon,hisi-ahci", },
> > -   { .compatible = "fsl,qoriq-ahci", },
> > {},
> >   };
> >   MODULE_DEVICE_TABLE(of, ahci_of_match);
> 
> This will break booting new kernels with old dtb files, something which in
> general is considered a big non-no, I suggest adding a comment that this has
> been superseded by the new ahci_qoriq.c code, and maybe add a date to
> retire the compatible in say a year from now.
> 
There is no old dtb because LS* platforms are not been upstreamed yet.
So I think we can safely replace it without breaking anything.

Regards,
Yuantian

> > diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c new
> > file mode 100644 index 000..943b783
> > --- /dev/null
> > +++ b/drivers/ata/ahci_qoriq.c
> > @@ -0,0 +1,308 @@
> > +/*
> > + * Freescale QorIQ AHCI SATA platform driver
> > + *
> > + * Copyright 2015 Freescale, Inc.
> > + *   Tang Yuantian 
> > + *
> > + * 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, or (at your
> > +option)
> > + * any later version.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include "ahci.h"
> > +
> > +#define DRV_NAME "ahci-qoriq"
> > +
> > +#define AHCI_PORT_PHY_1_CFG0xa003fffe
> > +#define AHCI_PORT_PHY_2_CFG0x2818

Re: [PATCH net-next] RDS: rds_conn_lookup() should factor in the struct net for a match

2015-09-05 Thread David Miller
From: Sowmini Varadhan 
Date: Thu, 3 Sep 2015 16:24:52 -0400

> 
> Only return a conn if the rds_conn_net(conn) matches the struct
> net passed to rds_conn_lookup().
> 
> Fixes: 467fa15356ac ("RDS-TCP: Support multiple RDS-TCP listen endpoints,
>one per netns.")
> 
> Signed-off-by: Sowmini Varadhan 

Applied.
--
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: fec: normalize return value of pm_runtime_get_sync() in MDIO write

2015-09-05 Thread David Miller
From: "Maciej S. Szmigiero" 
Date: Thu, 03 Sep 2015 21:38:30 +0200

> If fec MDIO write method succeeds its return value comes from
> call to pm_runtime_get_sync().
> But pm_runtime_get_sync() can also return 1.
> 
> In case of Micrel KSZ9031 PHY this value will then
> be returned along the call chain of phy_write() ->
> ksz9031_extended_write() -> ksz9031_center_flp_timing() ->
> ksz9031_config_init() -> phy_init_hw() -> phy_attach_direct() ->
> phy_connect_direct().
> 
> Then phy_connect() will cast it into a pointer using ERR_PTR(),
> which then fec_enet_mii_probe() will try to dereference
> resulting in an oops.
> 
> Fix it by normalizing return value of pm_runtime_get_sync()
> to be zero if positive in MDIO write method.
> 
> Signed-off-by: Maciej Szmigiero 

Applied.
--
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] ARM: dts: vfxxx: Add iio_hwmon node for ADC temperature channel

2015-09-05 Thread Shawn Guo
On Thu, Aug 06, 2015 at 09:28:22PM +0530, Sanchayan Maity wrote:
> Add iio_hwmon node to expose the temperature channel on Vybrid
> as hardware monitor device using the iio_hwmon driver.
> 
> Signed-off-by: Sanchayan Maity 
> ---
>  arch/arm/boot/dts/vfxxx.dtsi | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi
> index 39173bb..0993d66 100644
> --- a/arch/arm/boot/dts/vfxxx.dtsi
> +++ b/arch/arm/boot/dts/vfxxx.dtsi
> @@ -597,5 +597,10 @@
>   status = "disabled";
>   };
>   };
> +
> + iio_hwmon {
> + compatible = "iio-hwmon";
> + io-channels = <&adc0 16>;
> + };

Also, what's the reason that the node is being put under
aips-bus@4008 (aips1)?

Shawn

>   };
>  };
> -- 
> 2.5.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] ARM: dts: vfxxx: Add iio_hwmon node for ADC temperature channel

2015-09-05 Thread Shawn Guo
On Thu, Aug 06, 2015 at 09:28:22PM +0530, Sanchayan Maity wrote:
> Add iio_hwmon node to expose the temperature channel on Vybrid
> as hardware monitor device using the iio_hwmon driver.
> 
> Signed-off-by: Sanchayan Maity 
> ---
>  arch/arm/boot/dts/vfxxx.dtsi | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi
> index 39173bb..0993d66 100644
> --- a/arch/arm/boot/dts/vfxxx.dtsi
> +++ b/arch/arm/boot/dts/vfxxx.dtsi
> @@ -597,5 +597,10 @@
>   status = "disabled";
>   };
>   };
> +
> + iio_hwmon {

Hyphen rather than underscore should be used in node name.

Shawn

> + compatible = "iio-hwmon";
> + io-channels = <&adc0 16>;
> + };
>   };
>  };
> -- 
> 2.5.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/


[RFC PATCH v1 4/4] arm/arm64: fix a migrating irq bug when hotplug cpu

2015-09-05 Thread Yang Yingliang
When cpu is disabled, all irqs will be migratged to another cpu.
In some cases, a new affinity is different, it needed to be coppied
to irq's affinity. But if the type of irq is LPI, it's affinity will
not be coppied because of irq_set_affinity's return value. Fix it by
using irq_do_set_affinity.

And migrating interrupts is a core code matter, so move the code to
kernel/irq/migration.c and select CONFIG_GENERIC_IRQ_MIGRATION when
CONFIG_HOTPLUG_CPU and CONFIG_SMP is enabled.

Cc: Jiang Liu 
Cc: Thomas Gleixner 
Cc: Marc Zyngier 
Cc: Mark Rutland 
Cc: Will Deacon 
Cc: Russell King - ARM Linux 
Cc: Hanjun Guo 
Signed-off-by: Yang Yingliang 
---
 arch/arm/Kconfig |  1 +
 arch/arm/include/asm/irq.h   |  1 -
 arch/arm/kernel/irq.c| 62 
 arch/arm64/Kconfig   |  1 +
 arch/arm64/include/asm/irq.h |  1 -
 arch/arm64/kernel/irq.c  | 62 
 kernel/irq/migration.c   | 62 
 7 files changed, 64 insertions(+), 126 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 41cbb4a..ebc8a33 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -22,6 +22,7 @@ config ARM
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
select GENERIC_IDLE_POLL_SETUP
select GENERIC_IRQ_PROBE
+   select GENERIC_IRQ_MIGRATION if SMP && HOTPLUG_CPU
select GENERIC_IRQ_SHOW
select GENERIC_IRQ_SHOW_LEVEL
select GENERIC_PCI_IOMAP
diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
index 53c15de..d17fc900 100644
--- a/arch/arm/include/asm/irq.h
+++ b/arch/arm/include/asm/irq.h
@@ -24,7 +24,6 @@
 #ifndef __ASSEMBLY__
 struct irqaction;
 struct pt_regs;
-extern void migrate_irqs(void);
 
 extern void asm_do_IRQ(unsigned int, struct pt_regs *);
 void handle_IRQ(unsigned int, struct pt_regs *);
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index baf8ede..2efdb40 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -31,7 +31,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -135,64 +134,3 @@ int __init arch_probe_nr_irqs(void)
return nr_irqs;
 }
 #endif
-
-#ifdef CONFIG_HOTPLUG_CPU
-static bool migrate_one_irq(struct irq_desc *desc)
-{
-   struct irq_data *d = irq_desc_get_irq_data(desc);
-   const struct cpumask *affinity = irq_data_get_affinity_mask(d);
-   struct irq_chip *c;
-   bool ret = false;
-
-   /*
-* If this is a per-CPU interrupt, or the affinity does not
-* include this CPU, then we have nothing to do.
-*/
-   if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), 
affinity))
-   return false;
-
-   if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
-   affinity = cpu_online_mask;
-   ret = true;
-   }
-
-   c = irq_data_get_irq_chip(d);
-   if (!c->irq_set_affinity)
-   pr_debug("IRQ%u: unable to set affinity\n", d->irq);
-   else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && 
ret)
-   cpumask_copy(irq_data_get_affinity_mask(d), affinity);
-
-   return ret;
-}
-
-/*
- * The current CPU has been marked offline.  Migrate IRQs off this CPU.
- * If the affinity settings do not allow other CPUs, force them onto any
- * available CPU.
- *
- * Note: we must iterate over all IRQs, whether they have an attached
- * action structure or not, as we need to get chained interrupts too.
- */
-void migrate_irqs(void)
-{
-   unsigned int i;
-   struct irq_desc *desc;
-   unsigned long flags;
-
-   local_irq_save(flags);
-
-   for_each_irq_desc(i, desc) {
-   bool affinity_broken;
-
-   raw_spin_lock(&desc->lock);
-   affinity_broken = migrate_one_irq(desc);
-   raw_spin_unlock(&desc->lock);
-
-   if (affinity_broken)
-   pr_warn_ratelimited("IRQ%u no longer affine to CPU%u\n",
-   i, smp_processor_id());
-   }
-
-   local_irq_restore(flags);
-}
-#endif /* CONFIG_HOTPLUG_CPU */
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index b7b9cea..6ffe411 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -32,6 +32,7 @@ config ARM64
select GENERIC_CPU_AUTOPROBE
select GENERIC_EARLY_IOREMAP
select GENERIC_IRQ_PROBE
+   select GENERIC_IRQ_MIGRATION if SMP && HOTPLUG_CPU
select GENERIC_IRQ_SHOW
select GENERIC_IRQ_SHOW_LEVEL
select GENERIC_PCI_IOMAP
diff --git a/arch/arm64/include/asm/irq.h b/arch/arm64/include/asm/irq.h
index bbb251b..0916929 100644
--- a/arch/arm64/include/asm/irq.h
+++ b/arch/arm64/include/asm/irq.h
@@ -7,7 +7,6 @@
 
 struct pt_regs;
 
-extern void migrate_irqs(void);
 extern void set_handle_irq(void (*handle_irq)(struct pt_regs *));
 
 static inline void acpi_irq_init(void)

[RFC PATCH v1 2/4] irqchip: GICv3: set non-percpu irqs status with _IRQ_MOVE_PCNTXT

2015-09-05 Thread Yang Yingliang
Use irq_settings_set_move_pcntxt() helper irqs status with
_IRQ_MOVE_PCNTXT. So that it can do set affinity when calling
irq_set_affinity_locked().

Cc: Jiang Liu 
Cc: Thomas Gleixner 
Cc: Marc Zyngier 
Cc: Mark Rutland 
Cc: Will Deacon 
Cc: Russell King - ARM Linux 
Cc: Hanjun Guo 
Signed-off-by: Yang Yingliang 
---
 drivers/irqchip/irq-gic-v3.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index e406bc5..9108387 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -688,6 +688,7 @@ static int gic_irq_domain_map(struct irq_domain *d, 
unsigned int irq,
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_fasteoi_irq, NULL, NULL);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+   irq_set_move_pcntxt(irq);
}
/* LPIs */
if (hw >= 8192 && hw < GIC_ID_NR) {
@@ -696,6 +697,7 @@ static int gic_irq_domain_map(struct irq_domain *d, 
unsigned int irq,
irq_domain_set_info(d, irq, hw, &gic_chip, d->host_data,
handle_fasteoi_irq, NULL, NULL);
set_irq_flags(irq, IRQF_VALID);
+   irq_set_move_pcntxt(irq);
}
 
return 0;
-- 
2.5.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/


[RFC PATCH v1 3/4] genirq: rename config GENERIC_PENDING_IRQ to GENERIC_IRQ_MIGRATION

2015-09-05 Thread Yang Yingliang
Make the config name more general for moving other migration
interrupts code into kernel/irq/migration.c

Cc: Jiang Liu 
Cc: Thomas Gleixner 
Cc: Marc Zyngier 
Cc: Mark Rutland 
Cc: Will Deacon 
Cc: Russell King - ARM Linux 
Cc: Hanjun Guo 
Signed-off-by: Yang Yingliang 
---
 arch/arc/Kconfig   | 2 +-
 arch/hexagon/Kconfig   | 2 +-
 arch/ia64/Kconfig  | 2 +-
 arch/tile/Kconfig  | 2 +-
 arch/x86/Kconfig   | 2 +-
 arch/x86/kernel/apic/io_apic.c | 2 +-
 include/linux/irq.h| 4 +++-
 include/linux/irqdesc.h| 2 +-
 kernel/irq/Kconfig | 4 ++--
 kernel/irq/Makefile| 2 +-
 kernel/irq/irqdesc.c   | 6 +++---
 kernel/irq/manage.c| 2 +-
 kernel/irq/proc.c  | 2 +-
 13 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 78c0621..5d11976 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -19,7 +19,7 @@ config ARC
select GENERIC_FIND_FIRST_BIT
# for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP
select GENERIC_IRQ_SHOW
-   select GENERIC_PENDING_IRQ if SMP
+   select GENERIC_IRQ_MIGRATION if SMP
select GENERIC_SMP_IDLE_THREAD
select HAVE_ARCH_KGDB
select HAVE_ARCH_TRACEHOOK
diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
index 4dc89d1..ffee613 100644
--- a/arch/hexagon/Kconfig
+++ b/arch/hexagon/Kconfig
@@ -11,7 +11,7 @@ config HEXAGON
# select ARCH_WANT_OPTIONAL_GPIOLIB
# select ARCH_REQUIRE_GPIOLIB
# select HAVE_CLK
-   # select GENERIC_PENDING_IRQ if SMP
+   # select GENERIC_IRQ_MIGRATION if SMP
select GENERIC_ATOMIC64
select HAVE_PERF_EVENTS
# GENERIC_ALLOCATOR is used by dma_alloc_coherent()
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 42a91a7..6e7fb9b 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -36,7 +36,7 @@ config IA64
select VIRT_TO_BUS
select ARCH_DISCARD_MEMBLOCK
select GENERIC_IRQ_PROBE
-   select GENERIC_PENDING_IRQ if SMP
+   select GENERIC_IRQ_MIGRATION if SMP
select GENERIC_IRQ_SHOW
select GENERIC_IRQ_LEGACY
select ARCH_WANT_OPTIONAL_GPIOLIB
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
index 9def1f5..cb47e6c 100644
--- a/arch/tile/Kconfig
+++ b/arch/tile/Kconfig
@@ -13,7 +13,7 @@ config TILE
select CC_OPTIMIZE_FOR_SIZE
select HAVE_DEBUG_KMEMLEAK
select GENERIC_IRQ_PROBE
-   select GENERIC_PENDING_IRQ if SMP
+   select GENERIC_IRQ_MIGRATION if SMP
select GENERIC_IRQ_SHOW
select HAVE_DEBUG_BUGVERBOSE
select VIRT_TO_BUS
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 48f7433..c869f75 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -65,7 +65,7 @@ config X86
select GENERIC_IOMAP
select GENERIC_IRQ_PROBE
select GENERIC_IRQ_SHOW
-   select GENERIC_PENDING_IRQ  if SMP
+   select GENERIC_IRQ_MIGRATIONif SMP
select GENERIC_SMP_IDLE_THREAD
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 38a76f8..a1203d5 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1684,7 +1684,7 @@ static unsigned int startup_ioapic_irq(struct irq_data 
*data)
 
 atomic_t irq_mis_count;
 
-#ifdef CONFIG_GENERIC_PENDING_IRQ
+#ifdef CONFIG_GENERIC_IRQ_MIGRATION
 static bool io_apic_level_ack_pending(struct mp_chip_data *data)
 {
struct irq_pin_list *entry;
diff --git a/include/linux/irq.h b/include/linux/irq.h
index f4ecfb9..3461809 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -438,12 +438,14 @@ extern int irq_set_affinity_locked(struct irq_data *data,
   const struct cpumask *cpumask, bool force);
 extern int irq_set_vcpu_affinity(unsigned int irq, void *vcpu_info);
 
-#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ)
+#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_IRQ_MIGRATION)
 void irq_move_irq(struct irq_data *data);
 void irq_move_masked_irq(struct irq_data *data);
+void migrate_irqs(void);
 #else
 static inline void irq_move_irq(struct irq_data *data) { }
 static inline void irq_move_masked_irq(struct irq_data *data) { }
+static inline void migrate_irqs(void) { }
 #endif
 
 extern int no_irq_affinity;
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 5acfa26..1ec727d 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -66,7 +66,7 @@ struct irq_desc {
 #ifdef CONFIG_SMP
const struct cpumask*affinity_hint;
struct irq_affinity_notify *affinity_notify;
-#ifdef CONFIG_GENERIC_PENDING_IRQ
+#ifdef CONFIG_GENERIC_IRQ_MIGRATION
cpumask_var_t   pending_mask;
 #endif
 #endif
diff --git a/kernel/irq/Kconfig b/kernel/irq/Kconfi

[RFC PATCH v1 0/4] arm/arm64: fix a migrating irq bug when hotplug cpu

2015-09-05 Thread Yang Yingliang
Hi All,

There is a bug:

When cpu is disabled, all irqs will be migratged to another cpu.
In some cases, a new affinity is different, it needed to be coppied
to irq's affinity. But if the type of irq is LPI, it's affinity will
not be coppied because of irq_set_affinity's return value.



As Marc and Will suggested, I refactor the arm/arm64 migrating interrupts
code and fix the migrating irq bug while cpu is offline.

I'm trying let the core code do the migrating interrupts matter. 
kernel/irq/migration.c
depends on CONFIG_GENERIC_PENDING_IRQ, so I make it selected by CONFIG_SMP and
CONFIG_HOTPLUG_CPU and rename it to CONFIG_GENERIC_IRQ_MIGRATION for more 
general.
When CONFIG_GENERIC_IRQ_MIGRATION is enabled, an interrupt whose 
state_use_accessors
is not set with IRQD_MOVE_PCNTXT won't be migrated immediately in 
irq_set_affinity_locked().
So introduce irq_settings_set_move_pcntxt() helper to set the state in 
gic_irq_domain_map().

With the above preparation, move the migrating interrupts code into 
kernel/irq/migration.c
and fix the bug by using irq_do_set_affinity().

Cc: Jiang Liu 
Cc: Thomas Gleixner 
Cc: Marc Zyngier 
Cc: Mark Rutland 
Cc: Will Deacon 
Cc: Russell King - ARM Linux 
Cc: Hanjun Guo 

Yang Yingliang (4):
  genirq: Introduce irq_settings_set_move_pcntxt() helper
  irqchip: GICv3: set non-percpu irqs status with _IRQ_MOVE_PCNTXT
  genirq: rename config GENERIC_PENDING_IRQ to GENERIC_IRQ_MIGRATION
  arm/arm64: fix a migrating irq bug when hotplug cpu

 arch/arc/Kconfig   |  2 +-
 arch/arm/Kconfig   |  1 +
 arch/arm/include/asm/irq.h |  1 -
 arch/arm/kernel/irq.c  | 62 --
 arch/arm64/Kconfig |  1 +
 arch/arm64/include/asm/irq.h   |  1 -
 arch/arm64/kernel/irq.c| 62 --
 arch/hexagon/Kconfig   |  2 +-
 arch/ia64/Kconfig  |  2 +-
 arch/tile/Kconfig  |  2 +-
 arch/x86/Kconfig   |  2 +-
 arch/x86/kernel/apic/io_apic.c |  2 +-
 drivers/irqchip/irq-gic-v3.c   |  2 ++
 include/linux/irq.h|  5 +++-
 include/linux/irqdesc.h|  2 +-
 kernel/irq/Kconfig |  4 +--
 kernel/irq/Makefile|  2 +-
 kernel/irq/irqdesc.c   | 18 ++--
 kernel/irq/manage.c|  2 +-
 kernel/irq/migration.c | 62 ++
 kernel/irq/proc.c  |  2 +-
 kernel/irq/settings.h  |  5 
 22 files changed, 102 insertions(+), 142 deletions(-)

-- 
2.5.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/


[RFC PATCH v1 1/4] genirq: Introduce irq_settings_set_move_pcntxt() helper

2015-09-05 Thread Yang Yingliang
It's expected to use the helper when interrupt can be moved
in process.

Cc: Jiang Liu 
Cc: Thomas Gleixner 
Cc: Marc Zyngier 
Cc: Mark Rutland 
Cc: Will Deacon 
Cc: Russell King - ARM Linux 
Cc: Hanjun Guo 
Signed-off-by: Yang Yingliang 
---
 include/linux/irq.h   |  1 +
 kernel/irq/irqdesc.c  | 12 
 kernel/irq/settings.h |  5 +
 3 files changed, 18 insertions(+)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 6f8b340..f4ecfb9 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -514,6 +514,7 @@ static inline void irq_set_chip_and_handler(unsigned int 
irq, struct irq_chip *c
 }
 
 extern int irq_set_percpu_devid(unsigned int irq);
+extern int irq_set_move_pcntxt(unsigned int irq);
 
 extern void
 __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 0a2a4b6..c036a1a 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -580,6 +580,18 @@ int irq_set_percpu_devid(unsigned int irq)
return 0;
 }
 
+int irq_set_move_pcntxt(unsigned int irq)
+{
+   struct irq_desc *desc = irq_to_desc(irq);
+
+   if (!desc)
+   return -EINVAL;
+
+   irq_settings_set_move_pcntxt(desc);
+
+   return 0;
+}
+
 void kstat_incr_irq_this_cpu(unsigned int irq)
 {
kstat_incr_irqs_this_cpu(irq_to_desc(irq));
diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h
index 3320b84..ea58bc2 100644
--- a/kernel/irq/settings.h
+++ b/kernel/irq/settings.h
@@ -135,6 +135,11 @@ static inline void irq_settings_set_noprobe(struct 
irq_desc *desc)
desc->status_use_accessors |= _IRQ_NOPROBE;
 }
 
+static inline void irq_settings_set_move_pcntxt(struct irq_desc *desc)
+{
+   desc->status_use_accessors |= _IRQ_MOVE_PCNTXT;
+}
+
 static inline bool irq_settings_can_move_pcntxt(struct irq_desc *desc)
 {
return desc->status_use_accessors & _IRQ_MOVE_PCNTXT;
-- 
2.5.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 v4 11/16] drm: bridge: analogix/dp: add platform device type support

2015-09-05 Thread Yakir Yang

Hi Krzysztof,

在 09/04/2015 08:36 AM, Krzysztof Kozlowski 写道:

On 01.09.2015 15:07, Yakir Yang wrote:

Empty commit message. Please explain here why you want to add platform
device type support.

Actually the title is confusing. You are not adding support for platform
device types but rather adding a field containing type of device.



Signed-off-by: Yakir Yang 
---
Changes in v4: None
Changes in v3: None
Changes in v2:
- Add GNU license v2 declared and samsung copyright

  drivers/gpu/drm/exynos/exynos_dp.c  |  1 +
  drivers/gpu/drm/rockchip/analogix_dp-rockchip.c |  1 +
  include/drm/bridge/analogix_dp.h| 16 
  3 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_dp.c 
b/drivers/gpu/drm/exynos/exynos_dp.c
index 6060d2c..40ef727 100644
--- a/drivers/gpu/drm/exynos/exynos_dp.c
+++ b/drivers/gpu/drm/exynos/exynos_dp.c
@@ -224,6 +224,7 @@ static int exynos_dp_bind(struct device *dev, struct device 
*master, void *data)
dp->dev = dev;
dp->drm_dev = drm_dev;
  
+	dp->plat_data.dev_type = EXYNOS_DP;

dp->plat_data.power_on = exynos_dp_poweron;
dp->plat_data.power_off = exynos_dp_poweroff;
dp->plat_data.get_modes = exynos_dp_get_modes;
diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c 
b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index efea045..4934271 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -293,6 +293,7 @@ static int rockchip_dp_bind(struct device *dev, struct 
device *master,
return ret;
}
  
+	dp->plat_data.dev_type = RK3288_DP;

dp->plat_data.attach = NULL;
dp->plat_data.get_modes = NULL;
dp->plat_data.power_on = rockchip_dp_poweron;
diff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
index 8b4ffad..7209a64 100644
--- a/include/drm/bridge/analogix_dp.h
+++ b/include/drm/bridge/analogix_dp.h
@@ -1,9 +1,25 @@
+/*
+ * Analogix Core DP (Display Port) interface driver.
+ *
+ * Copyright (C) 2012 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ */

Two questions:
1. Why this change is here? I would rather expect it at patch 3/16 when
you created this file... That is the usual time for adding copyrights.


Yep, I should move this to 03/16.


2. Does this file contains previous Samsung work?


Hmm... I think this haven't contains the previous Samsung works,
but I have the cover the head message from analogix_dp_core driver
(include the copyright, but without ant author).

Thanks
- Yakir


Best regards,
Krzysztof


  #ifndef _ANALOGIX_DP_H_
  #define _ANALOGIX_DP_H_
  
  #include 
  
+enum analogix_dp_devtype {

+   EXYNOS_DP,
+   RK3288_DP,
+};
+
  struct analogix_dp_plat_data {
+   enum analogix_dp_devtype dev_type;
struct drm_panel *panel;
  
  	int (*power_on)(struct analogix_dp_plat_data *);









--
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 4/4] sched/numa: Convert sched_numa_balancing to a static_branch

2015-09-05 Thread Wanpeng Li

Hi Srikar,
On 8/12/15 12:24 AM, Srikar Dronamraju wrote:

Variable sched_numa_balancing toggles numa_balancing feature. Hence
moving from a simple read mostly variable to a more apt static_branch.

Suggested-by: Peter Zijlstra 
Signed-off-by: Srikar Dronamraju 


This commit breaks Peter's queue:

kernel/sched/fair.c: In function ‘task_numa_fault’:
kernel/sched/fair.c:2072: error: implicit declaration of function 
‘static_branch_likely’

kernel/sched/fair.c: In function ‘task_tick_fair’:
kernel/sched/fair.c:7867: error: implicit declaration of function 
‘static_branch_unlikely’

make[1]: *** [kernel/sched/fair.o] Error 1
make[1]: *** Waiting for unfinished jobs
kernel/sched/core.c:2116: warning: data definition has no type or 
storage class
kernel/sched/core.c:2116: error: type defaults to ‘int’ in declaration 
of ‘DEFINE_STATIC_KEY_FALSE’
kernel/sched/core.c:2116: warning: parameter names (without types) in 
function declaration

kernel/sched/core.c: In function ‘set_numabalancing_state’:
kernel/sched/core.c:2123: error: implicit declaration of function 
‘static_branch_enable’
kernel/sched/core.c:2125: error: implicit declaration of function 
‘static_branch_disable’

kernel/sched/core.c: In function ‘sysctl_numa_balancing’:
kernel/sched/core.c:2134: error: implicit declaration of function 
‘static_branch_likely’

make[1]: *** [kernel/sched/core.o] Error 1
make: *** [kernel/sched/] Error 2

Regards,
Wanpeng Li
--
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] arm64: add kc_offset_to_vaddr and kc_vaddr_to_offset macro

2015-09-05 Thread yalin wang
ok

i will send a V2 patch for this change.
> On Sep 2, 2015, at 18:24, Will Deacon  wrote:
> 
> On Sun, Aug 30, 2015 at 07:19:59AM +0100, yalin wang wrote:
>> This patch add kc_offset_to_vaddr() and kc_vaddr_to_offset(),
>> the default version doesn't work on arm64, because arm64 kernel address
>> is below the PAGE_OFFSET, like module address and vmemmap address are
>> all below PAGE_OFFSET address.
>> 
>> Signed-off-by: yalin wang 
>> ---
>> arch/arm64/include/asm/pgtable.h | 2 ++
>> 1 file changed, 2 insertions(+)
>> 
>> diff --git a/arch/arm64/include/asm/pgtable.h 
>> b/arch/arm64/include/asm/pgtable.h
>> index d374191..ef1ed5c 100644
>> --- a/arch/arm64/include/asm/pgtable.h
>> +++ b/arch/arm64/include/asm/pgtable.h
>> @@ -660,6 +660,8 @@ static inline void update_mmu_cache(struct 
>> vm_area_struct *vma,
>> 
>> #define update_mmu_cache_pmd(vma, address, pmd) do { } while (0)
>> 
>> +#define kc_vaddr_to_offset(v) ((v) & ((1UL << VA_BITS) - 1))
>> +#define kc_offset_to_vaddr(o) ((o) | ~((1UL << VA_BITS) - 1))
> 
> I think it would be cleaner to define something like VIRTUAL_BASE, and
> then define the vmalloc area in terms of that as well as these kcore
> macros.
> 
> Will

--
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] arm64: add kc_offset_to_vaddr and kc_vaddr_to_offset macro

2015-09-05 Thread yalin wang
This patch add kc_offset_to_vaddr() and kc_vaddr_to_offset(),
the default version doesn't work on arm64, because arm64 kernel address
is below the PAGE_OFFSET, like module address and vmemmap address are
all below PAGE_OFFSET address.

Signed-off-by: yalin wang 
---
 arch/arm64/include/asm/memory.h  | 1 +
 arch/arm64/include/asm/pgtable.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
index f800d45..2d09fe8 100644
--- a/arch/arm64/include/asm/memory.h
+++ b/arch/arm64/include/asm/memory.h
@@ -55,6 +55,7 @@
 #define PCI_IO_START   (PCI_IO_END - PCI_IO_SIZE)
 #define FIXADDR_TOP(PCI_IO_START - SZ_2M)
 #define TASK_SIZE_64   (UL(1) << VA_BITS)
+#define __VIRTUAL_MASK ((1UL << VA_BITS) - 1)
 
 #ifdef CONFIG_COMPAT
 #define TASK_SIZE_32   UL(0x1)
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
index d374191..9da6681 100644
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -660,6 +660,8 @@ static inline void update_mmu_cache(struct vm_area_struct 
*vma,
 
 #define update_mmu_cache_pmd(vma, address, pmd) do { } while (0)
 
+#definekc_vaddr_to_offset(v) ((v) & __VIRTUAL_MASK)
+#definekc_offset_to_vaddr(o) ((o) | ~__VIRTUAL_MASK)
 #endif /* !__ASSEMBLY__ */
 
 #endif /* __ASM_PGTABLE_H */
-- 
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 5/9] usb: dwc3: core: make dual-role work with OTG irq

2015-09-05 Thread Peter Chen
On Wed, Sep 02, 2015 at 09:43:38AM -0500, Felipe Balbi wrote:
> Hi,
> 
> > +
> > +static irqreturn_t dwc3_otg_irq(int irq, void *_dwc)
> > +{
> > +   struct dwc3 *dwc = _dwc;
> > +   irqreturn_t ret = IRQ_NONE;
> > +   u32 reg;
> > +
> > +   spin_lock(&dwc->lock);
> 
> this seems unnecessary, we're already in hardirq with IRQs disabled.
> What sort of race could we have ? (in fact, this also needs change in
> dwc3/gadget.c).
> 

Is it possible the kernel process is accessing the content you will 
access?

-- 

Best Regards,
Peter Chen
--
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] 9p: trans_fd, initialize recv fcall properly if not set

2015-09-05 Thread Eric Van Hensbergen
On Thu, Sep 3, 2015 at 4:38 AM, Dominique Martinet
 wrote:
> That code really should never be called (rc is allocated in
> tag_alloc), but if it had been it couldn't have worked...
>
> Signed-off-by: Dominique Martinet 
> ---
>  net/9p/trans_fd.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> To be honest, I think it might be better to just bail out if we get in
> this switch (m->req->rc == NULL after p9_tag_lookup) and not try to
> allocate more, because if we get there it's likely a race condition and
> silently re-allocating will end up in more troubles than trying to
> recover is worth.
> Thoughts ?
>

Hmmm...trying to rattle my brain and remember why I put it in there
back in 2008.
It might have just been over-defensive programming -- or more likely it just
pre-dated all the zero copy infrastructure which pretty much guaranteed we had
an rc allocated and what is there is vestigial.  I'm happy to accept a
patch which
makes this an assert, or perhaps just resets the connection because something
has gone horribly wrong (similar to the ENOMEM path that is there now).

-eric
--
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 1/9] usb: dwc3: add dual-role support

2015-09-05 Thread Peter Chen
On Wed, Sep 02, 2015 at 05:24:16PM +0300, Roger Quadros wrote:
> Register with the USB OTG core. Since we don't support
> OTG yet we just work as a dual-role device even
> if device tree says "otg".
> 
> +
> +static int dwc3_drd_init(struct dwc3 *dwc)
> +{
> + int ret, id, vbus;
> + struct usb_otg_caps *otgcaps = &dwc->otg_config.otg_caps;
> +
> + otgcaps->otg_rev = 0;
> + otgcaps->hnp_support = false;
> + otgcaps->srp_support = false;
> + otgcaps->adp_support = false;
> + dwc->otg_config.fsm_ops = &dwc3_drd_ops;
> +
> + if (!dwc->edev) {
> + dev_err(dwc->dev, "No extcon device found for OTG mode\n");
> + return -ENODEV;
> + }
> +

Do All dwc3 platforms id/vbus need to get through extcon? Do the
SoCs have id/vbus pin?


-- 

Best Regards,
Peter Chen
--
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 V7 1/3] genalloc:support memory-allocation with bytes-alignment to genalloc

2015-09-05 Thread Zhao Qiang
On Wed, 2015-09-02 at 10:18AM +0800, Wood Scott-B07421 wrote:
> -Original Message-
> From: Wood Scott-B07421
> Sent: Wednesday, September 02, 2015 10:18 AM
> To: Zhao Qiang-B45475
> Cc: linux-kernel@vger.kernel.org; linuxppc-...@lists.ozlabs.org;
> lau...@codeaurora.org; Xie Xiaobo-R63061; b...@kernel.crashing.org; Li
> Yang-Leo-R58472; pau...@samba.org
> Subject: Re: [PATCH V7 1/3] genalloc:support memory-allocation with
> bytes-alignment to genalloc
> 
> On Tue, 2015-09-01 at 21:10 -0500, Zhao Qiang-B45475 wrote:
> > On Wed, 2015-09-02 at 08:38AM +0800, Wood Scott-B07421 wrote:
> > > -Original Message-
> > > From: Wood Scott-B07421
> > > Sent: Wednesday, September 02, 2015 8:30 AM
> > > To: Zhao Qiang-B45475
> > > Cc: linux-kernel@vger.kernel.org; linuxppc-...@lists.ozlabs.org;
> > > lau...@codeaurora.org; Xie Xiaobo-R63061; b...@kernel.crashing.org;
> > > Li Yang-Leo-R58472; pau...@samba.org
> > > Subject: Re: [PATCH V7 1/3] genalloc:support memory-allocation with
> > > bytes-alignment to genalloc
> > >
> > > On Mon, 2015-08-31 at 16:58 +0800, Zhao Qiang wrote:
> > > > Bytes alignment is required to manage some special RAM, so add
> > > > gen_pool_first_fit_align to genalloc, meanwhile add
> > > > gen_pool_alloc_data to pass data to
> > > > gen_pool_first_fit_align(modify gen_pool_alloc as a wrapper)
> > > >
> > > > Signed-off-by: Zhao Qiang 
> > > > ---
> > > > Changes for v6:
> > > >   - patches set v6 include a new patch because of using
> > > >   - genalloc to manage QE MURAM, patch 0001 is the new
> > > >   - patch, adding bytes alignment for allocation for use.
> > > > Changes for v7:
> > > >   - cpm muram also need to use genalloc to manage, it has
> > > > a function to reserve a specific region of muram,
> > > > add offset to genpool_data for start addr to be allocated.
> > >
> > > This seems to be describing more than just the changes in this patch.
> > > What does also handling cpm have to do with this patch?  Are you
> > > adding support for reserving a specific region in this patch?  I
> > > don't see it, and in any case it should go in a different patch.
> >
> > Yes, I added. The code below can support the function.
> >   offset_bit = (alignment->offset + (1UL << order) - 1) >> order;
> >   return bitmap_find_next_zero_area(map, size, start + offset_bit,
> nr,
> > align_mask);
> >
> > CPM has an function cpm_muram_alloc_fixed, needing to allocate muram
> > from a Specific offset. So I add the code and add offset to struct data.
> 
> I thought the offset was related to the previous discussion of checking
> for allocation failure.  Are you using it to implement alloc_fixed()?  If
> so, please don't.  Besides the awkward implementation (what does it
> logically have to do with gen_pool_first_fit_align?), it does not appear
> to be correct -
> - what happens with multiple chunks?  What happens if part of the region
> the caller is trying to reserve is already taken?  Implement a proper
> function to reserve a fixed genalloc region.
> 
The offset is which allocation block address need to be larger than, 
Not equal to, it really like the parameter start of the algo(the bitnumber
To start searching at).

> 
> > > > +/*
> > > > + *  gen_pool data descriptor for gen_pool_first_fit_align.
> > > > + */
> > > > +struct genpool_data_align {
> > > > + int align;  /* alignment by bytes for starting
> > > address */
> > > > + unsigned long offset;   /* the offset of allocation start
> addr*/
> > > > +};
> > >
> 
> -Scott
> 
-Zhao
N�r��yb�X��ǧv�^�)޺{.n�+{zX����ܨ}���Ơz�&j:+v���zZ+��+zf���h���~i���z��w���?�&�)ߢf��^jǫy�m��@A�a���
0��h���i

Re: [PATCH v17 3/4] soc: rockchip: power-domain: Add power domain driver

2015-09-05 Thread Caesar Wang

Kevin,

Thanks for having a look into it.


在 2015年09月03日 02:28, Kevin Hilman 写道:

Caesar Wang  writes:


This driver is found on RK3288 SoCs.

In order to meet high performance and low power requirements, a power
management unit is designed or saving power when RK3288 in low power
mode.
The RK3288 PMU is dedicated for managing the power of the whole chip.

PMU can work in the Low Power Mode by setting bit[0] of PMU_PWRMODE_CON
register. After setting the register, PMU would enter the Low Power mode.
In the low power mode, pmu will auto power on/off the specified power
domain, send idle req to specified power domain, shut down/up pll and
so on. All of above are configurable by setting corresponding registers.

Signed-off-by: jinkun.hong 
Signed-off-by: Caesar Wang 

[...]


+static void rockchip_pm_remove_one_domain(struct rockchip_pm_domain *pd)
+{
+   int i;
+
+   for (i = 0; i < pd->num_clks; i++) {
+   clk_unprepare(pd->clks[i]);
+   clk_put(pd->clks[i]);
+   }


You don't set pd->num_clks = 0 here, which means other places that
iterate over the clocks might race with this and try to use clocks that
have been unprepared/put.


Agree, we should set the "pd->num_cloks=0' in here.

This might be over-paranoid, but in particular, this could race with
rockchip_pd_power().

Also not setting the pd->num_clks to zero would be a problem for a
power-controller that is configured as a module which could be unloaded
and reloaded (I know that doesn't really work now, but it will
eventually, I hope.)


Yep.


Maybe use the mutex here?  It should at least protect the zeroing of
pm->num_clks.


Sound resonable.
Done.

---
Thanks,
Caesar


Kevin

___
Linux-rockchip mailing list
linux-rockc...@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip


--
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/


[git pull] vfs pile 1

2015-09-05 Thread Al Viro
In this one: d_move fixes (Eric), UFS fixes (me; locking is mostly sane
now, a bunch of bugs in error handling ought to be fixed), switch of sb_writers
to percpu rwsem (Oleg), superblock scalability (Josef and Dave), swapon(2) race
fix (Hugh).  Please, pull from the usual place -
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for-linus

Shortlog:
Al Viro (47):
  ufs: kill more lock_ufs() calls
  ufs: switch ufs_evict_inode() to trimmed-down variant of ufs_truncate()
  ufs: free excessive blocks upon ->write_begin() failure/short copy
  ufs: move truncate_setsize() down into ufs_truncate()
  ufs: move lock_ufs() down into __ufs_truncate_blocks()
  ufs: bforget() indirect blocks before freeing them
  ufs: don't use lock_ufs() for block pointers tree protection
  ufs: kill lock_ufs()
  ufs: ufs_trunc_direct() always returns 0
  ufs: ufs_trunc_...() has exclusion with everything that might cause 
allocations
  ufs: no retries are needed on truncate
  ufs: move truncate code into inode.c
  ufs: the offsets ufs_block_to_path() puts into array are not sector_t
  ufs: beginning of __ufs_truncate_block() massage
  ufs_trunc_tindirect(): pass the number of blocks to keep
  ufs_trunc_indirect(): pass the index of the first pointer to free
  ufs_trunc_dindirect(): pass the number of blocks to keep
  __ufs_truncate(); find cutoff distances into branches by offsets[] array
  ufs_trunc_...indirect(): pass the array of indices instead of offsets
  ufs_trunc_..indirect(): more massage towards unifying
  unify ufs_trunc_..indirect()
  __ufs_truncate_blocks(): unify freeing the full branches
  __ufs_trunc_blocks(): turn the part after switch into a loop
  ufs_trunc_branch(): never call with offsets != NULL && depth2 == 0
  ufs_trunc_branch(): separate the calls with non-NULL offsets
  ufs: unify the logics for collecting adjacent data blocks to free
  split ufs_truncate_branch() into full- and partial-branch variants
  ufs_trunc_branch(): massage towards killing recursion
  ufs_trunc_branch(): kill recursion
  free_full_branch(): saner calling conventions
  move marking inode dirty to the end of __ufs_truncate_blocks()
  free_full_branch(): don't bother modifying the block we are going to free
  __ufs_truncate_blocks(): avoid excessive dirtying of indirect blocks
  ufs_inode_get{frag,block}(): get rid of retries
  ufs: move calculation of offsets into ufs_getfrag_block()
  ufs: use the branch depth in ufs_getfrag_block()
  ufs_inode_get{frag,block}(): consolidate success exits
  ufs_getfrag_block(): get rid of macro jungles
  ufs_inode_get{frag,block}(): leave sb_getblk() to caller
  ufs_inode_getblock(): pass index instead of 'fragment'
  ufs_inode_getblock(): pass indirect block number and full index
  ufs_inode_getfrag(): split extending the partial blocks off
  ufs_inode_getfrag(): pass index instead of 'fragment'
  ufs_getfrag_block(): turn following indirects into a loop
  ufs_inode_getblock(): failure to read an indirect block is -EIO
  ufs_getfrag_block(): tidy up a bit
  ufs_inode_get{frag,block}(): get rid of 'phys' argument

Dave Chinner (4):
  writeback: plug writeback at a high level
  inode: convert inode_sb_list_lock to per-sb
  sync: serialise per-superblock sync operations
  inode: rename i_wb_list to i_io_list

Eric W. Biederman (3):
  dcache: Handle escaped paths in prepend_path
  dcache: Reduce the scope of i_lock in d_splice_alias
  vfs: Test for and handle paths that are unreachable from their mnt_root

Hugh Dickins (1):
  mm: fix potential data race in SyS_swapon

Josef Bacik (2):
  inode: add hlist_fake to avoid the inode hash lock in evict
  inode: don't softlockup when evicting inodes

Oleg Nesterov (8):
  introduce __sb_writers_{acquired,release}() helpers
  fix the broken lockdep logic in __sb_start_write()
  document rwsem_release() in sb_wait_write()
  percpu-rwsem: introduce percpu_down_read_trylock()
  percpu-rwsem: introduce percpu_rwsem_release() and percpu_rwsem_acquire()
  percpu-rwsem: kill CONFIG_PERCPU_RWSEM
  shift percpu_counter_destroy() into destroy_super_work()
  change sb_writers to use percpu_rw_semaphore

Diffstat:
 arch/Kconfig |   1 -
 fs/block_dev.c   |  12 +-
 fs/btrfs/transaction.c   |   8 +-
 fs/dcache.c  |  14 +-
 fs/drop_caches.c |  10 +-
 fs/fs-writeback.c|  72 +--
 fs/inode.c   |  50 ++-
 fs/internal.h|   3 +-
 fs/namei.c   |  27 +-
 fs/notify/inode_mark.c   |  20 +-
 fs/quota/dquot.c |  16 +-
 fs/super.c   | 175 
 fs/ufs/Makefile  |   2 +-
 fs/ufs/balloc.c  

Re: [PATCH 2/2] arm64: dts: add dts files for Hisilicon Hip05-D02 Development Board

2015-09-05 Thread Ding Tianhong
On 2015/9/5 17:28, Marc Zyngier wrote:
> On Sat, 5 Sep 2015 10:58:59 +0800
> Ding Tianhong  wrote:
> 
>> Add initial dtsi file to support Hisilicon Hip05-D02 Board with
>> support of CPUs in four clusters and each cluster has quard Cortex-A57.
>>
>> Also add dts file to support Hip05-D02 development board.
>>
>> Signed-off-by: Ding Tianhong 
>> Signed-off-by: Kefeng Wang 
>> ---
>>  arch/arm64/boot/dts/hisilicon/Makefile  |   2 +-
>>  arch/arm64/boot/dts/hisilicon/hip05-d02.dts |  36 
>>  arch/arm64/boot/dts/hisilicon/hip05.dtsi| 271 
>> 
>>  3 files changed, 308 insertions(+), 1 deletion(-)
>>  create mode 100644 arch/arm64/boot/dts/hisilicon/hip05-d02.dts
>>  create mode 100644 arch/arm64/boot/dts/hisilicon/hip05.dtsi
>>
>> diff --git a/arch/arm64/boot/dts/hisilicon/Makefile 
>> b/arch/arm64/boot/dts/hisilicon/Makefile
>> index fa81a6e..cd158b8 100644
>> --- a/arch/arm64/boot/dts/hisilicon/Makefile
>> +++ b/arch/arm64/boot/dts/hisilicon/Makefile
>> @@ -1,4 +1,4 @@
>> -dtb-$(CONFIG_ARCH_HISI) += hi6220-hikey.dtb
>> +dtb-$(CONFIG_ARCH_HISI) += hi6220-hikey.dtb hip05-d02.dtb
>>  
>>  always  := $(dtb-y)
>>  subdir-y:= $(dts-dirs)
>> diff --git a/arch/arm64/boot/dts/hisilicon/hip05-d02.dts 
>> b/arch/arm64/boot/dts/hisilicon/hip05-d02.dts
>> new file mode 100644
>> index 000..ae34e25
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/hisilicon/hip05-d02.dts
>> @@ -0,0 +1,36 @@
>> +/**
>> + * dts file for Hisilicon D02 Development Board
>> + *
>> + * Copyright (C) 2014,2015 Hisilicon Ltd.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * publishhed by the Free Software Foundation.
>> + *
>> + */
>> +
>> +/dts-v1/;
>> +
>> +#include "hip05.dtsi"
>> +
>> +/ {
>> +model = "Hisilicon Hip05 D02 Development Board";
>> +compatible = "hisilicon,hip05-d02";
>> +
>> +memory@ {
>> +device_type = "memory";
>> +reg = <0x0 0x 0x0 0x8000>;
>> +};
>> +
>> +aliases {
>> +serial0 = &uart0;
>> +};
>> +
>> +chosen {
>> +stdout-path = "serial0:115200n8";
>> +};
>> +};
>> +
>> +&uart0 {
>> +status = "ok";
>> +};
>> diff --git a/arch/arm64/boot/dts/hisilicon/hip05.dtsi 
>> b/arch/arm64/boot/dts/hisilicon/hip05.dtsi
>> new file mode 100644
>> index 000..92d00f4
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/hisilicon/hip05.dtsi
>> @@ -0,0 +1,271 @@
>> +/**
>> + * dts file for Hisilicon D02 Development Board
>> + *
>> + * Copyright (C) 2014,2015 Hisilicon Ltd.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * publishhed by the Free Software Foundation.
>> + *
>> + */
>> +
>> +#include 
>> +
>> +/ {
>> +compatible = "hisilicon,hip05-d02";
>> +interrupt-parent = <&gic>;
>> +#address-cells = <2>;
>> +#size-cells = <2>;
>> +
>> +psci {
>> +compatible = "arm,psci-0.2";
>> +method = "smc";
>> +};
>> +
>> +cpus {
>> +#address-cells = <1>;
>> +#size-cells = <0>;
>> +
>> +cpu-map {
>> +cluster0 {
>> +core0 {
>> +cpu = <&cpu0>;
>> +};
>> +core1 {
>> +cpu = <&cpu1>;
>> +};
>> +core2 {
>> +cpu = <&cpu2>;
>> +};
>> +core3 {
>> +cpu = <&cpu3>;
>> +};
>> +};
>> +cluster1 {
>> +core0 {
>> +cpu = <&cpu4>;
>> +};
>> +core1 {
>> +cpu = <&cpu5>;
>> +};
>> +core2 {
>> +cpu = <&cpu6>;
>> +};
>> +core3 {
>> +cpu = <&cpu7>;
>> +};
>> +};
>> +cluster2 {
>> +core0 {
>> +cpu = <&cpu8>;
>> +};
>> +core1 {
>> +cpu = <&cpu9>;
>> +};
>> +core2 {
>> +cpu = <&cpu10>;
>> +};
>> +core3 {
>> +cpu = <&cpu11>;
>> +};
>> +  

Re: [PATCH] MIPS: UAPI: Fix unrecognized opcode WSBH/DSBH/DSHD when using MIPS16.

2015-09-05 Thread Yousong Zhou
Hi, Maciej, first of all, thank you for your time on this,
appreciate it.

Comments inline

On 5 September 2015 at 22:25, Maciej W. Rozycki  wrote:
> On Sat, 5 Sep 2015, Yousong Zhou wrote:
>
>> >  This can't be true.  The compiler does not intepret the contents of an
>> > inline asm and therefore cannot decide whether to inline a function
>> > containing one or not based on the lone presence or the absence of an
>> > assembly directive within.
>> >
>>
>> Most of the time I trust my compiler and never meddle with the
>> toolchain.  Anyway I made a patch because it really did not work for
>> me.   No big deal.  It's not the end of world.  It started with a
>> comment from OpenWrt packages feeds [1].  Actually this "unrecognized
>> opcode" problem have occurred within OpenWrt quite a few times before.
>>
>>  [1] 
>> https://github.com/openwrt/packages/commit/1e29676a8ac74f797f8ca799364681cec575ae6f#commitcomment-12901931
>
>  The bug certainly was there, it's just your analysis and consequently the
> fix that are wrong in the general case for some reason, maybe a buggy
> compiler.
>

This is the compiler "--version",

mips-openwrt-linux-gcc (OpenWrt/Linaro GCC 4.8-2014.04 r46763) 4.8.3

>> >  It looks to me you're papering something over here -- when you use a
>> > `.set nomips16' directive the assembler will happily switch your
>> > instruction set in the middle of an instruction stream.  Consequently if
>> > this function is (for whatever reason; it should not really) inlined in
>> > MIPS16 code, then you'll get a MIPS32 instruction in the middle, which
>> > will obviously be interpreted differently in the MIPS16 execution mode and
>> > is therefore surely a recipe for disaster.
>>
>> If by "papering" you mean "made up", then whatever.  Yeah, it's
>> disaster, an "invalid instruction" abort.
>
>  By "papering over" I mean forcing source code to compile successfully at
> the risk of producing incorrect binary code.

Learned a new phrase/idiom :)

>
>> >  How did you test your change and made the conclusion quoted with your
>> > patch description?
>> >
>>
>> Compile the following program with a MIPS 24kc big endian variant compiler 
>> with
>> flag "-mips32r2 -mips16 -Os".
>>
>> #include 
>> #include 
>>
>> uint16_t __attribute__((noinline)) f(uint16_t v)
>> {
>> v = __cpu_to_le16(v);
>> return v;
>> }
>>
>> int main()
>> {
>> printf("%x\n", f(0xbeef));
>>
>> return 0;
>> }
>>
>> When only ".set nomips16" was specified in __arch_swab16(), this was output
>> from objdump.
>>
>> 242 004003e0 :
>> 243   4003e0:   7c0410a0wsbhv0,a0
>> 244   4003e4:   e820ea31swc2$0,-5583(at)
>> 245   4003e8:   650065000x65006500
>> 246   4003ec:   650065000x65006500
>
>  Quite obviously.
>
>  For the record: the first instruction has been assembled in the regular
> MIPS mode and that propagated to symbol annotation.  Consequently `f' is
> seen by `objdump' as a regular MIPS function and disassembles it all as
> such.  You can put a global label immediately after the WSBH instruction
> in your source code to have the rest of the function disassembled
> correctly (of course this won't make this code work at the run time).

Thanks for the trick.  Objdump really disassembled it
correctly.

>
>> __arch_swab16() was indeed inlined.  That swc2 instruction can be got from
>> assembler with the following code (it's from the "-S" result of GCC).
>>
>> .setmips16
>> .setnoreorder
>> .setnomacro
>> j   $31
>> zeh $2
>>
>> When only nomips16 function attribute was specified, this time GCC failed 
>> with
>> unrecognized opcode
>>
>> /tmp/ccaGCouL.s: Assembler messages:
>> /tmp/ccaGCouL.s:21: Error: unrecognized opcode `wsbh $2,$4'
>>
>> The generated assembly was something in the following form.  Looks like the
>> assembler did not automatically switch to MIPS32 mode when ".set 
>> arch=mip32r2"
>
>  There's no switch to regular MIPS mode implied with `.set arch=mip32r2',
> the directive merely switches the ISA level, affecting both the regular
> MIPS and the MIPS16 mode (the MIPS32r2 ISA level adds extra MIPS16
> instructions too, e.g. ZEH is a new addition).

Agreed

>
>> .set mips16
>>
>> .ent f
>> .type f, @function
>> f
>> ...
>> .set push
>> .set arch=mips32r2
>> wsbh $2,$4
>> .pop
>> j $31
>> zeh $2
>> .end f
>> ...
>
>  That's exactly the papered-over buggy code scenario I've been referring
> to above.  This is clearly MIPS16 code: ZEH is a MIPS16 instruction only,
> there's no such regular MIPS counterpart.  And it also obviously fails to
> assemble because on the contrary there's no MIPS16 WSBH instruction.
>

Yes, it won't assemble.

>  Now if you stick `.set nomips16' just above WSBH, then this code will
> happily assemble, because this single

Re: [PATCH 0/2] arm64: Support Hisilicon Hip05-D02 board

2015-09-05 Thread Ding Tianhong
On 2015/9/5 17:18, Marc Zyngier wrote:
> On Sat, 5 Sep 2015 10:58:57 +0800
> Ding Tianhong  wrote:
> 
>> Hip05-D02 Development Board is based on Cortex-A57, this patchset
>> contains initial support for Hip05-D02 Soc and Board. Initial support
>> is minimal and includes just the arch configuration, device tree
>> configuration.
>>
>> PSCI is enabled in device tree and there is no problem to boot all the
>> 16 cores, and the CPU hotplug is also working now, you can download and
>> compile the latest firmware based on the following link to run this
>> patch set.
>>
>> https://github.com/hisilicon/estuary/blob/master/README
>>
>> v1->v2:
>> - 1. Change the compatible name for per CPU.
>>   2. Remove the GIC_CPU_MASK_SIMPLE(xx) which is not used for gicv3
>>  from hip05.dtsi.
> 
> Please always indicate the version number in the email subject ("PATCH
> v2" is the usual scheme). It makes it otherwise difficult to keep track
> of what version I am looking at.
> 
> Thanks,
> 
Miss it, fix it in next version, thanks.

Ding


>   M.
> 


--
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/


[GIT PULL] 9p changes for 4.3 merge window (part-1)

2015-09-05 Thread Eric Van Hensbergen
The following changes since commit eb63b34bdfbdd70a734c2a90d89117c5c6c605c2:

  Merge branch 'upstream' of
git://git.linux-mips.org/pub/scm/ralf/upstream-linus (2015-08-23
07:23:09 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs.git
tags/for-linus-4.3-merge-window-part-1

for you to fetch changes up to b5ac1fb2717e48177d3f73f9e4c9b556c0a24c6b:

  9p: fix return code of read() when count is 0 (2015-08-23 14:21:36 -0500)


Just a few cleanups for 4.3 merge window for the 9p file system.
I've gotten several more over the past week, but this group has been
in for-next for at least a couple of weeks so I figured I'd push them
first while I test the rest.  Most of the ones not in this set are
bug-fixes anyways so I could hold them for rc1 if you'd rather they
see more time in for-next.

-eric


Fabian Frederick (1):
  9p: remove unused option Opt_trans

Vincent Bernat (1):
  9p: fix return code of read() when count is 0

 fs/9p/v9fs.c | 2 +-
 fs/9p/vfs_file.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--
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/


[PATCHv2] staging: rtl8192u: r8192U_core: fix use ether_addr_copy() over memcpy() code style issue

2015-09-05 Thread Raphaël Beamonte
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

The values used are stored as dev_addr in net_device (declared in
include/linux/netdevice.h) and sa_data in sockaddr (declared in
include/linux/socket.h). Both these elements are u16 aligned as
shown by using pahole (position must be a multiple of sizeof(u16)):
unsigned char *dev_addr; /*   888 8 */
char   sa_data[14];  /* 214 */

It is thus safe to use ether_addr_copy() instead of memcpy() for
that call, as it is already done in multiple files in the Linux
kernel sources:
  drivers/net/ethernet/broadcom/genet/bcmgenet.c
  drivers/net/ethernet/brocade/bna/bnad.c
  drivers/net/ethernet/emulex/benet/be_main.c
  drivers/net/ethernet/ezchip/nps_enet.c
  drivers/net/ethernet/ibm/ibmveth.c
  drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
  drivers/net/ethernet/intel/i40e/i40e_main.c
  drivers/net/ethernet/mellanox/mlx5/core/en_main.c
  drivers/net/usb/lan78xx.c
  net/8021q/vlan_dev.c
  net/batman-adv/soft-interface.c
  net/dsa/slave.c

Signed-off-by: Raphaël Beamonte 
---
 drivers/staging/rtl8192u/r8192U_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
b/drivers/staging/rtl8192u/r8192U_core.c
index 76255cb..b143b36 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -3469,7 +3469,7 @@ static int r8192_set_mac_adr(struct net_device *dev, void 
*mac)
 
down(&priv->wx_sem);
 
-   memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
+   ether_addr_copy(dev->dev_addr, addr->sa_data);
 
schedule_work(&priv->reset_wq);
up(&priv->wx_sem);
-- 
2.5.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 09/16] drm: rockchip: add bpc and color mode setting

2015-09-05 Thread Yakir Yang

Hi Thierry,

在 09/03/2015 04:38 PM, Thierry Reding 写道:

On Wed, Sep 02, 2015 at 06:02:25PM +0800, Yakir Yang wrote:

在 2015/9/2 16:34, Thierry Reding 写道:

[...]

At the very least your code must compile when applied against a recent
upstream tree. I would also expect you to make sure the code works at
runtime, though, contrary to build testing, not everybody will be able
to verify that you've actually done so. It is ultimately your platform
maintainer's (i.e. Heiko's) responsibility to ensure that because they
will get to deal with user complaints if people can't run an upstream
kernel on the devices.

Oh, first time to know this rule. So I should work on Heiko's github
kernel branch at the first time to start send upstream.

It's usually not necessary to rebase on a specific platform tree. Most
platform trees should feed into linux-next anyway, so linux-next would
be the appropriate base in almost all cases.

Note, though, that that's only true if you expect somebody else to merge
your code. The reason is that whoever will end up applying your patches
will likely apply to a tree that feeds into linux-next, and that way you
both end up having roughly the same base.

On the other hand if you are a maintainer yourself you should be keeping
a branch based on the latest -rc1. That's especially important if your
tree feeds into linux-next, because basing on linux-next will break very
horribly that way.

So for this particular case I would expect either Mark or Inki to apply
these patches when they're ready. Their trees should be based on the
latest -rc1. At least the Exynos DRM tree feeds into linux-next, so you
should be fine if you use linux-next as a base.


Glad to know this, thanks,
- Yakir



Mark, have you ever considered having your tree added to linux-next?

I'm beginning to think that we need to make that a requirement for all
DRM drivers so that we can resolve integration issues early on rather
than Dave having to deal with them when he pulls code in.

Thierry



--
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 05/16] drm: bridge: analogix/dp: dynamic parse sync_pol & interlace & colorimetry

2015-09-05 Thread Yakir Yang

Hi Krzysztof,

在 09/03/2015 04:04 PM, Krzysztof Kozlowski 写道:

On 01.09.2015 14:55, Yakir Yang wrote:

Both hsync/vsync polarity and interlace mode can be parsed from
drm display mode, and dynamic_range and ycbcr_coeff can be judge
by the video code, same to color space and color depth can be
parsed from EDID.

But presumably Exynos still relaies on the DT properties, so take

s/relaies/relies/


good use of mode_fixup() in to achieve the compatibility hacks.

Signed-off-by: Yakir Yang 
---
Changes in v4:
- Take Krzysztof suggest, provide backword compatibility with samsung.
- Take Thierry suggest, add "color-depth" and "color-space" dynamic parsed.

Changes in v3:
- Take Thierry Reding suggest, dynamic parse video timing info from
   struct drm_display_mode and struct drm_display_info.

Changes in v2: None

  drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 141 +
  drivers/gpu/drm/bridge/analogix/analogix_dp_core.h |   2 +-
  drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c  |  14 +-
  drivers/gpu/drm/exynos/exynos_dp.c |  58 -
  4 files changed, 151 insertions(+), 64 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c 
b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index 7196097..f0db92e 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -897,8 +897,8 @@ static void analogix_dp_commit(struct analogix_dp_device 
*dp)
return;
}
  
-	ret = analogix_dp_set_link_train(dp, dp->video_info->lane_count,

-dp->video_info->link_rate);
+   ret = analogix_dp_set_link_train(dp, dp->video_info.lane_count,
+dp->video_info.link_rate);
if (ret) {
dev_err(dp->dev, "unable to do link train\n");
return;
@@ -1081,6 +1081,82 @@ static void analogix_dp_bridge_disable(struct drm_bridge 
*bridge)
dp->dpms_mode = DRM_MODE_DPMS_OFF;
  }
  
+static void analogix_dp_bridge_mode_set(struct drm_bridge *bridge,

+   struct drm_display_mode *orig_mode,
+   struct drm_display_mode *mode)
+{
+   struct analogix_dp_device *dp = bridge->driver_private;
+   struct drm_display_info *display_info = &dp->connector.display_info;
+   struct video_info *video_info = &dp->video_info;
+   struct device_node *dp_node = dp->dev->of_node;
+   int vic;
+
+   /* interlaces & hsync pol & vsync pol */
+   video_info->interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
+   video_info->v_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NVSYNC);
+   video_info->h_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NHSYNC);
+
+   /* dynamic_range & colorimetry */
+   vic = drm_match_cea_mode(mode);
+   if ((vic == 6) || (vic == 7) || (vic == 21) || (vic == 22) ||
+   (vic == 2) || (vic == 3) || (vic == 17) || (vic == 18)) {
+   video_info->dynamic_range = CEA;
+   video_info->ycbcr_coeff = COLOR_YCBCR601;
+   } else if (vic) {
+   video_info->dynamic_range = CEA;
+   video_info->ycbcr_coeff = COLOR_YCBCR709;
+   } else {
+   video_info->dynamic_range = VESA;
+   video_info->ycbcr_coeff = COLOR_YCBCR709;
+   }
+
+   switch (display_info->bpc) {
+   case 12:
+   video_info->color_depth = COLOR_12;
+   break;
+   case 10:
+   video_info->color_depth = COLOR_10;
+   break;
+   case 8:
+   video_info->color_depth = COLOR_8;
+   break;
+   case 6:
+   video_info->color_depth = COLOR_6;
+   break;
+   default:
+   video_info->color_depth = COLOR_8;
+   break;
+   }
+
+   if (display_info->color_formats | DRM_COLOR_FORMAT_YCRCB444)
+   video_info->color_space = COLOR_YCBCR444;
+   else if (display_info->color_formats | DRM_COLOR_FORMAT_YCRCB422)
+   video_info->color_space = COLOR_YCBCR422;
+   else if (display_info->color_formats | DRM_COLOR_FORMAT_RGB444)
+   video_info->color_space = COLOR_RGB;
+   else
+   video_info->color_space = COLOR_RGB;
+
+   /*
+* NOTE: those property parseing code is used for

s/parseing/parsing/

BTW, you can easily integrate spell-check to vim... It is not that I
search for such misspellings - they are highlighted...


Wow, thanks for your remind, I have set the spell-check now.  :)




+* providing backward compatibility for samsung platform.
+*/
+   of_property_read_u32(dp_node, "samsung,color-space",
+&video_info->color_space);
+   of_property_read_u32(dp_node, "samsung,dynamic-range",
+&video_info->dynamic_range);
+   of_p

TAKE NOTE

2015-09-05 Thread oficefi...@ono.com



As you are not a nationality of my country; i have a business proposal for you, 
and it will be for the mutual benefit of the both of us.
--
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] net: bridge: remove unnecessary switchdev include

2015-09-05 Thread Vivien Didelot
Remove the unnecessary switchdev.h include from br_netlink.c.

Signed-off-by: Vivien Didelot 
---
 net/bridge/br_netlink.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index af5e187..ea748c9 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "br_private.h"
-- 
2.5.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/


usually 3000 customers/Where 100,000+ customers worldwide?

2015-09-05 Thread iSayor
Hi
  Are you still develop foreign customers with alibaba, exhibition?
 You out of!!!
  Are you looking other channel beside exhibition/B2B when you feel difficult 
to find foreign customers?
  Industry hundreds of thousands of customers worldwide, usually we can only 
contact three thousand, do you want to rest also developed?
  Guangdong General Chamber of Commerce recommended the initiative customer 
develop first brand, nearly ten thousand companies are benefiting.
  the first benefit with first use, nearly twenty thousand companies lead you!
  You can not use, but not without understanding.
  Add QQ767650805/Skype:iSayor let's show you the initiative customer develop 
means.
--
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 01/16] drm: exynos/dp: fix code style

2015-09-05 Thread Yakir Yang

Hi Joe,

在 09/03/2015 01:57 PM, Joe Perches 写道:

On Thu, 2015-09-03 at 13:33 +0800, Yakir Yang wrote:
[]

diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c

[]

@@ -155,24 +156,22 @@ static int exynos_dp_read_edid(struct
exynos_dp_device *dp)
}
  exynos_dp_read_byte_from_dpcd(dp, DP_TEST_REQUEST,
-&test_vector);
+  &test_vector);
if (test_vector & DP_TEST_LINK_EDID_READ) {
-exynos_dp_write_byte_to_dpcd(dp,
-DP_TEST_EDID_CHECKSUM,
+exynos_dp_write_byte_to_dpcd(
+dp, DP_TEST_EDID_CHECKSUM,
edid[EDID_BLOCK_LENGTH + EDID_CHECKSUM]);
-exynos_dp_write_byte_to_dpcd(dp,
-DP_TEST_RESPONSE,
+exynos_dp_write_byte_to_dpcd(
+dp, DP_TEST_RESPONSE,
DP_TEST_EDID_CHECKSUM_WRITE);

To me, missing argument after opening parenthesis, looks worse. I would
prefer:

  exynos_dp_write_byte_to_dpcd(dp,

Why you moved the 'dp' argument to new line?

Hmm... Just like style tool indicate, no more warning after
that change.

For now, I would like to follow the original style, just improved
some obvious style problem.  :-)

What was the checkpatch warning that said 'dp' has to move to new line?
I tried this and I don't see it.

checkpatch haven't remind me that put dp to new line would fix
this warning, this just come from my experiments. And I works,
no more warnings from checkpatch, so I toke this style.

Checkpatch isn't a great arbiter of style.
It's just a brainless tool.

Always use your instead of anything brainless.

If it were code I was writing, I'd ignore 80 columns warnings
where appropriate.

These are long function names and long macro defines, so it's
inappropriate to use 80 columns as a guiding style.

I'd write:

exynos_dp_read_byte_from_dpcd(dp, DP_TEST_REQUEST, 
&test_vector);
if (test_vector & DP_TEST_LINK_EDID_READ) {
exynos_dp_write_byte_to_dpcd(dp, DP_TEST_EDID_CHECKSUM,
 edid[EDID_BLOCK_LENGTH + 
EDID_CHECKSUM]);
exynos_dp_write_byte_to_dpcd(dp, DP_TEST_RESPONSE,
 
DP_TEST_EDID_CHECKSUM_WRITE);
}



So... just ignore the 80 columns warnings. Actually I prefer to
keep the original style in this case.

Thanks,
- Yakir
]







--
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 net] net: bridge: check __vlan_vid_del for error

2015-09-05 Thread Vivien Didelot
Since __vlan_del can return an error code, change its inner function
__vlan_vid_del to return an eventual error from switchdev_port_obj_del.

Signed-off-by: Vivien Didelot 
---
 net/bridge/br_vlan.c | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 3cd8cc9..5f5a02b 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -117,10 +117,11 @@ out_filt:
return err;
 }
 
-static void __vlan_vid_del(struct net_device *dev, struct net_bridge *br,
-  u16 vid)
+static int __vlan_vid_del(struct net_device *dev, struct net_bridge *br,
+ u16 vid)
 {
const struct net_device_ops *ops = dev->netdev_ops;
+   int err = 0;
 
/* If driver uses VLAN ndo ops, use 8021q to delete vid
 * on device, otherwise try switchdev ops to delete vid.
@@ -137,8 +138,12 @@ static void __vlan_vid_del(struct net_device *dev, struct 
net_bridge *br,
},
};
 
-   switchdev_port_obj_del(dev, &vlan_obj);
+   err = switchdev_port_obj_del(dev, &vlan_obj);
+   if (err == -EOPNOTSUPP)
+   err = 0;
}
+
+   return err;
 }
 
 static int __vlan_del(struct net_port_vlans *v, u16 vid)
@@ -151,7 +156,11 @@ static int __vlan_del(struct net_port_vlans *v, u16 vid)
 
if (v->port_idx) {
struct net_bridge_port *p = v->parent.port;
-   __vlan_vid_del(p->dev, p->br, vid);
+   int err;
+
+   err = __vlan_vid_del(p->dev, p->br, vid);
+   if (err)
+   return err;
}
 
clear_bit(vid, v->vlan_bitmap);
-- 
2.5.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/


usually 3000 customers/Where 100,000+ customers worldwide?

2015-09-05 Thread iSayor
Hi
  Are you still develop foreign customers with alibaba, exhibition?
 You out of!!!
  Are you looking other channel beside exhibition/B2B when you feel difficult 
to find foreign customers?
  Industry hundreds of thousands of customers worldwide, usually we can only 
contact three thousand, do you want to rest also developed?
  Guangdong General Chamber of Commerce recommended the initiative customer 
develop first brand, nearly ten thousand companies are benefiting.
  the first benefit with first use, nearly twenty thousand companies lead you!
  You can not use, but not without understanding.
  Add QQ767650805/Skype:iSayor let's show you the initiative customer develop 
means.
--
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 v4 09/10] snd: dmaengine-pcm: add snd_dmaengine_pcm_get_quirks interface

2015-09-05 Thread Shawn Lin
Add snd_dmaengine_pcm_get_quirks for I2S devices to query
dma controller's quirks if they need it to make special workaround
due to broken dma controller design

Signed-off-by: Shawn Lin 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None
Changes in v1: None

 sound/soc/soc-generic-dmaengine-pcm.c | 24 
 1 file changed, 24 insertions(+)

diff --git a/sound/soc/soc-generic-dmaengine-pcm.c 
b/sound/soc/soc-generic-dmaengine-pcm.c
index 6fd1906..42136005 100644
--- a/sound/soc/soc-generic-dmaengine-pcm.c
+++ b/sound/soc/soc-generic-dmaengine-pcm.c
@@ -466,4 +466,28 @@ void snd_dmaengine_pcm_unregister(struct device *dev)
 }
 EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_unregister);
 
+
+/**
+ * snd_dmaengine_pcm_get_quirks - Get dmaengine quirks based PCM device
+ * @dev: Parent device the PCM was register with
+ */
+int snd_dmaengine_pcm_get_quirks(struct device *dev)
+{
+   struct snd_soc_platform *platform;
+   struct dmaengine_pcm *pcm;
+   int ret = -ENODEV;
+
+   platform = snd_soc_lookup_platform(dev);
+   if (!platform)
+   return ret;
+
+   pcm = soc_platform_to_pcm(platform);
+
+   if (pcm->chan)
+   ret = dmaengine_get_quirks(pcm->chan[0]);
+
+   return ret;
+}
+EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_get_quirks);
+
 MODULE_LICENSE("GPL");
-- 
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/


usually 3000 customers/Where 100,000+ customers worldwide?

2015-09-05 Thread iSayor
Hi
  Are you still develop foreign customers with alibaba, exhibition?
 You out of!!!
  Are you looking other channel beside exhibition/B2B when you feel difficult 
to find foreign customers?
  Industry hundreds of thousands of customers worldwide, usually we can only 
contact three thousand, do you want to rest also developed?
  Guangdong General Chamber of Commerce recommended the initiative customer 
develop first brand, nearly ten thousand companies are benefiting.
  the first benefit with first use, nearly twenty thousand companies lead you!
  You can not use, but not without understanding.
  Add QQ767650805/Skype:iSayor let's show you the initiative customer develop 
means.
--
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 v4 05/10] ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3xxx platform

2015-09-05 Thread Shawn Lin
Pl330 integrated in rk3xxx platform doesn't support
DMAFLUSHP function. So we add arm,pl330-broken-no-flushp quirk
for it.

Signed-off-by: Shawn Lin 
cc: Heiko Stuebner 
cc: Doug Anderson 
cc: Olof Johansson 

---

Changes in v4:
- remove rockchip,i2s-broken-burst-len and
  rockchip,spi-broken-burst-len

Changes in v3: None
Changes in v2: None
Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
  by Krzysztof.

 arch/arm/boot/dts/rk3xxx.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/rk3xxx.dtsi b/arch/arm/boot/dts/rk3xxx.dtsi
index a2ae9f3..a8ca4b3 100644
--- a/arch/arm/boot/dts/rk3xxx.dtsi
+++ b/arch/arm/boot/dts/rk3xxx.dtsi
@@ -79,6 +79,7 @@
#dma-cells = <1>;
clocks = <&cru ACLK_DMA1>;
clock-names = "apb_pclk";
+   arm,pl330-broken-no-flushp;
};
 
dmac1_ns: dma-controller@2001c000 {
@@ -89,6 +90,7 @@
#dma-cells = <1>;
clocks = <&cru ACLK_DMA1>;
clock-names = "apb_pclk";
+   arm,pl330-broken-no-flushp;
status = "disabled";
};
 
@@ -100,6 +102,7 @@
#dma-cells = <1>;
clocks = <&cru ACLK_DMA2>;
clock-names = "apb_pclk";
+   arm,pl330-broken-no-flushp;
};
};
 
-- 
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/


[PATCH v4 07/10] DMA: pl330: implement dmaengine_get_quirks hook

2015-09-05 Thread Shawn Lin
By adding this function, slave device can query quirks
from pl330 if they need special settings for dmaengine.

Signed-off-by: Shawn Lin 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None
Changes in v1: None

 drivers/dma/pl330.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 3b9b426..bf01d24 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -2156,6 +2156,14 @@ static int pl330_config(struct dma_chan *chan,
return 0;
 }
 
+static int pl330_quirks(struct dma_chan *chan)
+{
+   struct dma_pl330_chan *pch = to_pchan(chan);
+   struct pl330_dmac *pl330 = pch->dmac;
+
+   return pl330->quirks;
+}
+
 static int pl330_terminate_all(struct dma_chan *chan)
 {
struct dma_pl330_chan *pch = to_pchan(chan);
@@ -2928,6 +2936,7 @@ pl330_probe(struct amba_device *adev, const struct 
amba_id *id)
pd->device_tx_status = pl330_tx_status;
pd->device_prep_slave_sg = pl330_prep_slave_sg;
pd->device_config = pl330_config;
+   pd->device_get_quirks = pl330_quirks;
pd->device_pause = pl330_pause;
pd->device_terminate_all = pl330_terminate_all;
pd->device_issue_pending = pl330_issue_pending;
-- 
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/


[PATCH v4 10/10] ASoC: rockchip_i2s: modify DMA max burst to 1

2015-09-05 Thread Shawn Lin
From: Yiwei Cai 

Test with command -
arecord -D hw:0,0 /tmp/a.wav, there are the error dump:
dma-pl330 ffb2.dma-controller: fill_queue:2251 Bad Desc(7)

This error is happening when no a multiple of burst size * burst
length are coming in. The root cause is pl330 dma controller on
Rockchips' platform cannot support DMAFLUSHP instruction which make
dma to flush the req of non-aligned or non-multiple of what we set
before. The saftest way is to set dma max burst to 1.

Signed-off-by: Yiwei Cai 
Fixes: 4495c89fc ("ASoC: add driver for Rockchip RK3xxx I2S")
Signed-off-by: Shawn Lin 
cc: Addy Ke 
cc: Jianqun Xu 
cc: Heiko Stuebner 
cc: Olof Johansson 
cc: Doug Anderson 
cc: Sonny Rao 
---

Changes in v4:
- use snd_dmaengine_pcm_get_quirks to get quirks

Changes in v3: None
Changes in v2: None
Changes in v1: None

 sound/soc/rockchip/rockchip_i2s.c | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/sound/soc/rockchip/rockchip_i2s.c 
b/sound/soc/rockchip/rockchip_i2s.c
index acb5be5..b06e08a 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -23,6 +23,8 @@
 
 #define DRV_NAME "rockchip-i2s"
 
+#define ROCKCHIP_I2S_BROKEN_BURST_LEN (1<<0) /* broken burst len */
+
 struct rk_i2s_dev {
struct device *dev;
 
@@ -418,6 +420,7 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
struct rk_i2s_dev *i2s;
struct resource *res;
void __iomem *regs;
+   int dma_quirk;
int ret;
 
i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
@@ -460,7 +463,6 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
i2s->playback_dma_data.addr = res->start + I2S_TXDR;
i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
i2s->playback_dma_data.maxburst = 4;
-
i2s->capture_dma_data.addr = res->start + I2S_RXDR;
i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
i2s->capture_dma_data.maxburst = 4;
@@ -489,6 +491,18 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
goto err_pcm_register;
}
 
+   dma_quirk = snd_dmaengine_pcm_get_quirks(&pdev->dev);
+   if (dma_quirk == ROCKCHIP_I2S_BROKEN_BURST_LEN) {
+   /*
+* Unfortunately, we find broken burst len here,
+* just have to limit maxburst to ONE in order to avoid
+* non-multiple burst len access fail the dmaengine if
+* it can't support flush peripheral function.
+*/
+   i2s->playback_dma_data.maxburst = 1;
+   i2s->capture_dma_data.maxburst = 1;
+   }
+
return 0;
 
 err_pcm_register:
-- 
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/


[PATCH v4 06/10] dmaengine: add API for getting dma controller's quirk

2015-09-05 Thread Shawn Lin
Add dmaengine_get_quirks API for peripheral devices to query
quirks if they need it to make special workaround due to broken
dma controller design.

Signed-off-by: Shawn Lin 
---

Changes in v4: None
Changes in v3: None
Changes in v2: None
Changes in v1: None

 include/linux/dmaengine.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index e2f5eb4..5174ca4 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -704,6 +704,7 @@ struct dma_device {
 
int (*device_config)(struct dma_chan *chan,
 struct dma_slave_config *config);
+   int (*device_get_quirks)(struct dma_chan *chan);
int (*device_pause)(struct dma_chan *chan);
int (*device_resume)(struct dma_chan *chan);
int (*device_terminate_all)(struct dma_chan *chan);
@@ -723,6 +724,14 @@ static inline int dmaengine_slave_config(struct dma_chan 
*chan,
return -ENOSYS;
 }
 
+static inline int dmaengine_get_quirks(struct dma_chan *chan)
+{
+   if (chan->device->device_get_quirks)
+   return chan->device->device_get_quirks(chan);
+
+   return -ENOSYS;
+}
+
 static inline bool is_slave_direction(enum dma_transfer_direction direction)
 {
return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM);
-- 
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/


[PATCH v4 08/10] spi: rockchip: modify DMA max burst to 1

2015-09-05 Thread Shawn Lin
From: Addy Ke 

Generic dma controller on Rockchips' platform cannot support
DMAFLUSHP instruction which make dma to flush the req of non-aligned
or non-multiple of what we need. That will cause an unrecoverable
dma bus error. The saftest way is to set dma max burst to 1.

Signed-off-by: Addy ke 
Fixes: 64e36824b32b06 ("spi/rockchip: add driver for Rockchip...")
Signed-off-by: Shawn Lin 
cc: Heiko Stuebner 
cc: Olof Johansson 
cc: Doug Anderson 
cc: Sonny Rao 
---

Changes in v4:
- use dmaengine_get_quirks to get quirks

Changes in v3: None
Changes in v2: None
Changes in v1: None

 drivers/spi/spi-rockchip.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 68e7efe..89dd3d8 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -199,6 +199,8 @@ struct rockchip_spi {
struct sg_table rx_sg;
struct rockchip_spi_dma_data dma_rx;
struct rockchip_spi_dma_data dma_tx;
+   int dma_quirk;
+#define ROCKCHIP_SPI_BROKEN_BURST_LEN (1<<0) /* broken burst len*/
 };
 
 static inline void spi_enable_chip(struct rockchip_spi *rs, int enable)
@@ -449,7 +451,10 @@ static void rockchip_spi_prepare_dma(struct rockchip_spi 
*rs)
rxconf.direction = rs->dma_rx.direction;
rxconf.src_addr = rs->dma_rx.addr;
rxconf.src_addr_width = rs->n_bytes;
-   rxconf.src_maxburst = rs->n_bytes;
+   if (rs->dma_quirk == ROCKCHIP_SPI_BROKEN_BURST_LEN)
+   rxconf.src_maxburst = 1;
+   else
+   rxconf.src_maxburst = 4;
dmaengine_slave_config(rs->dma_rx.ch, &rxconf);
 
rxdesc = dmaengine_prep_slave_sg(
@@ -466,7 +471,10 @@ static void rockchip_spi_prepare_dma(struct rockchip_spi 
*rs)
txconf.direction = rs->dma_tx.direction;
txconf.dst_addr = rs->dma_tx.addr;
txconf.dst_addr_width = rs->n_bytes;
-   txconf.dst_maxburst = rs->n_bytes;
+   if (rs->dma_quirk == ROCKCHIP_SPI_BROKEN_BURST_LEN)
+   txconf.dst_maxburst = 1;
+   else
+   txconf.dst_maxburst = 4;
dmaengine_slave_config(rs->dma_tx.ch, &txconf);
 
txdesc = dmaengine_prep_slave_sg(
@@ -731,6 +739,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
}
 
if (rs->dma_tx.ch && rs->dma_rx.ch) {
+   rs->dma_quirk = dmaengine_get_quirks(rs->dma_rx.ch);
rs->dma_tx.addr = (dma_addr_t)(mem->start + ROCKCHIP_SPI_TXDR);
rs->dma_rx.addr = (dma_addr_t)(mem->start + ROCKCHIP_SPI_RXDR);
rs->dma_tx.direction = DMA_MEM_TO_DEV;
-- 
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/


[PATCH v4 04/10] ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3288 platform

2015-09-05 Thread Shawn Lin
From: Addy Ke 

Pl330 integrated in rk3288 platform doesn't support
DMAFLUSHP function. So we add arm,pl330-broken-no-flushp quirk
for it.

Signed-off-by: Addy Ke 
Signed-off-by: Shawn Lin 
cc: Heiko Stuebner 
cc: Olof Johansson 
cc: Sonny Rao 

Reviewed-by: Doug Anderson 
Reviewed-by: Sonny Rao 
---

Changes in v4:
- remove rockchip,i2s-broken-burst-len and
  rockchip,spi-broken-burst-len

Changes in v3:
- add Reviewed-by: Sonny Rao 

Changes in v2:
- amend the author
- add Reviewed-by: Doug Anderson 
- amend Olof's mail address

Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
  by Krzysztof.
- remove Sunny's tag

 arch/arm/boot/dts/rk3288.dtsi | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
index 22316d0..106adf7 100644
--- a/arch/arm/boot/dts/rk3288.dtsi
+++ b/arch/arm/boot/dts/rk3288.dtsi
@@ -144,6 +144,7 @@
#dma-cells = <1>;
clocks = <&cru ACLK_DMAC2>;
clock-names = "apb_pclk";
+   arm,pl330-broken-no-flushp;
};
 
dmac_bus_ns: dma-controller@ff60 {
@@ -155,6 +156,7 @@
clocks = <&cru ACLK_DMAC1>;
clock-names = "apb_pclk";
status = "disabled";
+   arm,pl330-broken-no-flushp;
};
 
dmac_bus_s: dma-controller@ffb2 {
@@ -165,6 +167,7 @@
#dma-cells = <1>;
clocks = <&cru ACLK_DMAC1>;
clock-names = "apb_pclk";
+   arm,pl330-broken-no-flushp;
};
};
 
-- 
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/


[PATCH v4 02/10] Documentation: arm-pl330: add description of arm,pl330-broken-no-flushp

2015-09-05 Thread Shawn Lin
Signed-off-by: Shawn Lin 

Reviewed-by: Doug Anderson 
Reviewed-by: Sonny Rao 
---

Changes in v4: None
Changes in v3:
- add Reviewed-by: Sonny Rao 

Changes in v2:
- add Reviewed-by: Doug Anderson 

Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
  by Krzysztof.

 Documentation/devicetree/bindings/dma/arm-pl330.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/dma/arm-pl330.txt 
b/Documentation/devicetree/bindings/dma/arm-pl330.txt
index 2675658..db7e226 100644
--- a/Documentation/devicetree/bindings/dma/arm-pl330.txt
+++ b/Documentation/devicetree/bindings/dma/arm-pl330.txt
@@ -15,6 +15,7 @@ Optional properties:
 cells in the dmas property of client device.
   - dma-channels: contains the total number of DMA channels supported by the 
DMAC
   - dma-requests: contains the total number of DMA requests supported by the 
DMAC
+  - arm,pl330-broken-no-flushp: quirk for avoiding to execute DMAFLUSHP
 
 Example:
 
-- 
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/


[PATCH v4 03/10] DMA: pl330: add quirk for broken no flushp

2015-09-05 Thread Shawn Lin
From: Addy Ke 

This patch add "arm,pl330-broken-no-flushp" quirk to avoid execute
DMAFLUSHP if Soc doesn't support it.

Signed-off-by: Addy Ke 
Signed-off-by: Shawn Lin 
cc: Doug Anderson 
cc: Heiko Stuebner 
cc: Olof Johansson 

Reviewed-by: Sonny Rao 
---

Changes in v4: None
Changes in v3:
- add Reviewed-by: Sonny Rao 

Changes in v2:
- amend the author
- fix Olof's mail address

Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
  by Krzysztof.
- remove Sunny's tag

 drivers/dma/pl330.c | 87 ++---
 1 file changed, 62 insertions(+), 25 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 0d544d2..3b9b426 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -34,6 +34,8 @@
 #define PL330_MAX_IRQS 32
 #define PL330_MAX_PERI 32
 
+#define PL330_QUIRK_BROKEN_NO_FLUSHP BIT(0)
+
 enum pl330_cachectrl {
CCTRL0, /* Noncacheable and nonbufferable */
CCTRL1, /* Bufferable only */
@@ -488,6 +490,17 @@ struct pl330_dmac {
/* Peripheral channels connected to this DMAC */
unsigned int num_peripherals;
struct dma_pl330_chan *peripherals; /* keep at end */
+   int quirks;
+};
+
+static struct pl330_of_quirks {
+   char *quirk;
+   int id;
+} of_quirks[] = {
+   {
+   .quirk = "arm,pl330-broken-no-flushp",
+   .id = PL330_QUIRK_BROKEN_NO_FLUSHP,
+   }
 };
 
 struct dma_pl330_desc {
@@ -1137,53 +1150,68 @@ static inline int _ldst_memtomem(unsigned dry_run, u8 
buf[],
return off;
 }
 
-static inline int _ldst_devtomem(unsigned dry_run, u8 buf[],
-   const struct _xfer_spec *pxs, int cyc)
+static inline int _ldst_devtomem(struct pl330_dmac *pl330, unsigned dry_run,
+u8 buf[], const struct _xfer_spec *pxs,
+int cyc)
 {
int off = 0;
enum pl330_cond cond;
 
-   cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST;
+   if (pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP)
+   cond = BURST;
+   else
+   cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST;
 
while (cyc--) {
off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
off += _emit_LDP(dry_run, &buf[off], cond, pxs->desc->peri);
off += _emit_ST(dry_run, &buf[off], ALWAYS);
-   off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri);
+
+   if (!(pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP))
+   off += _emit_FLUSHP(dry_run, &buf[off],
+   pxs->desc->peri);
}
 
return off;
 }
 
-static inline int _ldst_memtodev(unsigned dry_run, u8 buf[],
-   const struct _xfer_spec *pxs, int cyc)
+static inline int _ldst_memtodev(struct pl330_dmac *pl330,
+unsigned dry_run, u8 buf[],
+const struct _xfer_spec *pxs, int cyc)
 {
int off = 0;
enum pl330_cond cond;
 
-   cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST;
+   if (pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP)
+   cond = BURST;
+   else
+   cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST;
+
 
while (cyc--) {
off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
off += _emit_LD(dry_run, &buf[off], ALWAYS);
off += _emit_STP(dry_run, &buf[off], cond, pxs->desc->peri);
-   off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri);
+
+   if (!(pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP))
+   off += _emit_FLUSHP(dry_run, &buf[off],
+   pxs->desc->peri);
}
 
return off;
 }
 
-static int _bursts(unsigned dry_run, u8 buf[],
+static int _bursts(struct pl330_dmac *pl330, unsigned dry_run, u8 buf[],
const struct _xfer_spec *pxs, int cyc)
 {
int off = 0;
 
switch (pxs->desc->rqtype) {
case DMA_MEM_TO_DEV:
-   off += _ldst_memtodev(dry_run, &buf[off], pxs, cyc);
+   off += _ldst_memtodev(pl330, dry_run, &buf[off], pxs, cyc);
break;
case DMA_DEV_TO_MEM:
-   off += _ldst_devtomem(dry_run, &buf[off], pxs, cyc);
+   off += _ldst_devtomem(pl330, dry_run, &buf[off], pxs, cyc);
break;
case DMA_MEM_TO_MEM:
off += _ldst_memtomem(dry_run, &buf[off], pxs, cyc);
@@ -1197,7 +1225,7 @@ static int _bursts(unsigned dry_run, u8 buf[],
 }
 
 /* Returns bytes consumed and updates bursts */
-static inline int _loop(unsigned dry_run, u8 buf[],
+static inline int _loop(struct pl330_dmac *pl330, unsigned dry_run, u8 buf[],
unsigned long *bursts, const struct _xfer_spec *pxs)
 {

[PATCH v4 01/10] DMA: pl330: support burst mode for dev-to-mem and mem-to-dev transmit

2015-09-05 Thread Shawn Lin
From: Boojin Kim 

This patch adds to support burst mode for dev-to-mem and
mem-to-dev transmit.

Signed-off-by: Boojin Kim 
Signed-off-by: Addy Ke 
Signed-off-by: Shawn Lin 
cc: Heiko Stuebner 
cc: Doug Anderson 
cc: Olof Johansson 

Reviewed-by: Sonny Rao 
---

Changes in v4: None
Changes in v3: None
Changes in v2:
- amend the author
- reorder the patches suggested by Doug
- add Reviewed-by: Doug Anderson  for
  rk3288.dtsi patch and arm-pl330.txt patch

Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
  by Krzysztof.
- add From original author.
- remove Sunny's tag

 drivers/dma/pl330.c | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index ecab4ea0..0d544d2 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -1141,10 +1141,13 @@ static inline int _ldst_devtomem(unsigned dry_run, u8 
buf[],
const struct _xfer_spec *pxs, int cyc)
 {
int off = 0;
+   enum pl330_cond cond;
+
+   cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST;
 
while (cyc--) {
-   off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->desc->peri);
-   off += _emit_LDP(dry_run, &buf[off], SINGLE, pxs->desc->peri);
+   off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
+   off += _emit_LDP(dry_run, &buf[off], cond, pxs->desc->peri);
off += _emit_ST(dry_run, &buf[off], ALWAYS);
off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri);
}
@@ -1156,11 +1159,14 @@ static inline int _ldst_memtodev(unsigned dry_run, u8 
buf[],
const struct _xfer_spec *pxs, int cyc)
 {
int off = 0;
+   enum pl330_cond cond;
+
+   cond = (pxs->desc->rqcfg.brst_len == 1) ? SINGLE : BURST;
 
while (cyc--) {
-   off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->desc->peri);
+   off += _emit_WFP(dry_run, &buf[off], cond, pxs->desc->peri);
off += _emit_LD(dry_run, &buf[off], ALWAYS);
-   off += _emit_STP(dry_run, &buf[off], SINGLE, pxs->desc->peri);
+   off += _emit_STP(dry_run, &buf[off], cond, pxs->desc->peri);
off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri);
}
 
@@ -2557,7 +2563,7 @@ static struct dma_async_tx_descriptor 
*pl330_prep_dma_cyclic(
 
desc->rqtype = direction;
desc->rqcfg.brst_size = pch->burst_sz;
-   desc->rqcfg.brst_len = 1;
+   desc->rqcfg.brst_len = pch->burst_len;
desc->bytes_requested = period_len;
fill_px(&desc->px, dst, src, period_len);
 
@@ -2702,7 +2708,7 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct 
scatterlist *sgl,
}
 
desc->rqcfg.brst_size = pch->burst_sz;
-   desc->rqcfg.brst_len = 1;
+   desc->rqcfg.brst_len = pch->burst_len;
desc->rqtype = direction;
desc->bytes_requested = sg_dma_len(sg);
}
-- 
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/


[PATCH v4 0/10] Fix broken DMAFLUSHP on Rockchips platform

2015-09-05 Thread Shawn Lin

The purpose of the DMAFLUSHP instruction:
- Tell the peripheral to clear its status and control registers.
- Send a message to the peripheral to resend its level status.

There are 3 timings described in PL330 Technical Reference Manual:
- Timing 1: Burst request, can work well without DMAFLUSHP.
- Timing 2: Single and burst request, DMAC will ignore the single
transfer request. This timing happens if there are single
and burst request.
- Timing 3: Single transfers for a burst request, DMAC should signals
datype to request the peripheral to flush the contents of
any control registers. This timing happens if there is
not enough MFIFO to places the burst data.

A peripheral may signal a DMA request during the execution of
DMAFLUSHP instruction, that cause DMA request being ignored by DMAC.

But DMAC and all peripherals on RK3X SoCs DO NOT support DMAFLUSHP.
It can't send a message to the peripheral to resend DMA request,
and the peripheral can't acknowledge a flush request from DMAC.
So all DMA requests should NOT be ignored by DMAC, and DMAC will not
notify the peripheral to flush.

To fix this problem, we need:
- Do NOT execute DMAFLUSHP instruction.
- Timing 2 and timing 3 should not happen.

Because on RK3X SoCs, there are 6 or below  channels and 32 MFIFO depth
for DMAC_BUS, and 8 channels and 64 MFIFO depth for DMAC_PERI, it is
impossible to hit the timing 3 if burst length is equal or less than 4.

Since the request type signal by the peripheral can only be set by
software. We can set Rockchip Soc's GRF_PERIDMAC_CON0[2:1] to select single
or burst request, if it is set b01,  all of the peripharals will signal a brust
request. So the timing 2 will not happen, too.

So DMAC on RK3X can support single or burst transfer, but can't support
mixed transfer.

Because burst transfer is more efficient than single transfer, this is
confirmed by our ASIC team, who strongly suggest to use burst transfer.
And this is confirmed by Addy's test on RK3288-Pink2 board, the speed of
spi flash burst transfer will increase about two times than single transfer.
Also, I have tested dw_mmc with pl330 on RK3188 platform to double confirm
the result. That means burst transfer is reansonable.

So we need a quirk not to execute DMAFLUSHP instruction and to use burst
transfer.

Note:
- The Rockchip Soc default value of GRF_PERIDMAC_CON0[2:1] is b01. To
  support brust transfer, these bits should not be changed in bootloader.


Changes in v4:
- remove spi & i2s dts changes and query quirk from dmaengine API
  suggeseted by Mark Brown.
- fix typo
- Add dmaengine_get_quirk hook and implement it for pl330

Changes in v3:
- add more rockchip drivers' changes in this patchset
- add Reviewed-by: Sonny Rao 

Changes in v2:
- amend the author
- reorder the patches suggested by Doug
- add Reviewed-by: Doug Anderson  for
  rk3288.dtsi patch and arm-pl330.txt patch
- amend Olof's mail address

Changes in v1:
- rename broken-no-flushp to "arm,pl330-broken-no-flushp" suggested
  by Krzysztof.
- add From original author.
- remove Sunny's tag

Addy Ke (3):
  DMA: pl330: add quirk for broken no flushp
  ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3288 platform
  spi: rockchip: modify DMA max burst to 1

Boojin Kim (1):
  DMA: pl330: support burst mode for dev-to-mem and mem-to-dev transmit

Shawn Lin (5):
  Documentation: arm-pl330: add description of
arm,pl330-broken-no-flushp
  ARM: dts: Add arm,pl330-broken-no-flushp quirk for rk3xxx platform
  dmaengine: add API for getting dma controller's quirk
  DMA: pl330: implement dmaengine_get_quirks hook
  snd: dmaengine-pcm: add snd_dmaengine_pcm_get_quirks interface

Yiwei Cai (1):
  ASoC: rockchip_i2s: modify DMA max burst to 1

 .../devicetree/bindings/dma/arm-pl330.txt  |   1 +
 arch/arm/boot/dts/rk3288.dtsi  |   3 +
 arch/arm/boot/dts/rk3xxx.dtsi  |   3 +
 drivers/dma/pl330.c| 110 +++--
 drivers/spi/spi-rockchip.c |  13 ++-
 include/linux/dmaengine.h  |   9 ++
 sound/soc/rockchip/rockchip_i2s.c  |  16 ++-
 sound/soc/soc-generic-dmaengine-pcm.c  |  24 +
 8 files changed, 147 insertions(+), 32 deletions(-)

-- 
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/


usually 3000 customers/Where 100,000+ customers worldwide?

2015-09-05 Thread iSayor
Hi
  Are you still develop foreign customers with alibaba, exhibition?
 You out of!!!
  Are you looking other channel beside exhibition/B2B when you feel difficult 
to find foreign customers?
  Industry hundreds of thousands of customers worldwide, usually we can only 
contact three thousand, do you want to rest also developed?
  Guangdong General Chamber of Commerce recommended the initiative customer 
develop first brand, nearly ten thousand companies are benefiting.
  the first benefit with first use, nearly twenty thousand companies lead you!
  You can not use, but not without understanding.
  Add QQ767650805/Skype:iSayor let's show you the initiative customer develop 
means.
--
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: [GIT PULL REQUEST] md updates for 4.3

2015-09-05 Thread Linus Torvalds
On Sat, Sep 5, 2015 at 2:37 AM, Neil Brown  wrote:
>
> Please pull these updates.  I've already merged with the 'block' tree
> to resolve a few simple conflicts.

So for the future, I actually prefer to see and handle the conflicts myself.

I really just prefer knowing what's going on, and merge conflicts are
an indication of cross-maintainer issues which are *exactly* the kinds
of things I want to be aware of.

However, in this case I was "ok, I've already done several other merge
resolutions with the wbole damn bio_endio error handling changes", so
I felt I was aware enough about how that ended up being a
cross-subsystem conflict, and just took your pre-merged version.

If you feel that the conflicts are particularly subtle, or just
generally worry about the merge, or just because you want to do some
merge-testing, what some people end up doing is to send me their
unmerged branch, and then send me a separate ".. and here's the merge
I did". I'll then do the merge myself anyway, but then after doing the
merge I'll switch to a temporary testing branch and re-do the  merge
with the pre-merged state just to verify. Generally the end result is
identical, but when it isn't, that's actually usually interesting
(sometimes it's just a ordering difference, but sometimes it's a merge
error - and so far I think most merge errors have come from
sub-maintainers, for the simple reason that they generally aren't as
used to merging as I am - so even if they know the code better, I
sometimes catch merge gotcha's better).

Thanks,
  Linus
--
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] arm:irqchip: IRQCHIP_DECLARE macro is now accessible

2015-09-05 Thread Shawn Guo
On Fri, Sep 04, 2015 at 04:54:21PM -0400, Joel Porquet wrote:
> On Monday, July 13, 2015 11:20:35 PM Shawn Guo wrote:
> > On Tue, Jul 07, 2015 at 04:02:53PM -0400, Joel Porquet wrote:
> > > The IRQCHIP_DECLARE macro migrated to 'include/linux/irqchip.h', making it
> > > globally accessible.
> > > 
> > > See commit 91e20b5040c67c51aad88cf87db4305c5bd7f79d
> > > ("irqchip: Move IRQCHIP_DECLARE macro to include/linux/irqchip.h").
> > > 
> > > This patch adds inclusions of 'include/linux/irqchip.h' and replaces uses
> > > of macro OF_DECLARE_2 with IRQCHIP_DECLARE.
> > > 
> > > Signed-off-by: Joel Porquet 
> > > ---
> > 
> > ...
> > 
> > >  arch/arm/mach-imx/gpc.c  | 7 ++-
> > 
> > Acked-by: Shawn Guo 
> > 
> > How will this patch be sent to upstream?
> 
> If it's more convenient for the different maintainers affected by this patch, 
> I can probably resubmit it into a series of patches that modify each file 
> separately... Let me know quickly so we don't miss the merge window!

We had sent out the materials for this merge window.  So if you have a
path to upstream, you'd better send this patch through that.  You've
already got the ACKs from maintainers of affected platform.

Shawn
--
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: [PATCHv2 18/19] staging: rtl8192u: r8192U_core: fix use ether_addr_copy() over memcpy() code style issue

2015-09-05 Thread Greg Kroah-Hartman
On Sat, Sep 05, 2015 at 06:16:16PM -0400, Raphaël Beamonte wrote:
> 2015-09-03 13:00 GMT-04:00 Greg Kroah-Hartman :
> > You need to prove that they are aligned before I can take this patch :(
> 
> Right!
> 
> I looked at those structs using pahole. The structs used are
> net_device from include/linux/netdevice.h and sockaddr from
> include/linux/socket.h, in which we use the elements dev_addr and
> sa_data respectively.
> 
> Using pahole, the output for both those elements in the structs are:
> unsigned char *dev_addr; /*   888 8 */
> char   sa_data[14];  /* 214 */
> 
> If I understand correctly how pahole is outputing the information and
> what a u16 alignment means in the struct, I should, for both those
> cases, have a multiple of 2 (sizeof(u16)) as first value in the
> comment following the line (first value being the position of the
> element in the struct, second value its size). So if I understood
> correctly, in both those cases, it's working: they're u16 aligned.
> 
> Also, to be sure, I searched in the kernel sources and found multiple
> files that are currently using both those structs and ether_addr_copy:
> (line numbers are those for commit 34fca4b of your staging-testing
> tree)
> drivers/net/ethernet/broadcom/genet/bcmgenet.c (line 2957)
> drivers/net/ethernet/brocade/bna/bnad.c (line 3250)
> drivers/net/ethernet/emulex/benet/be_main.c (line 315)
> drivers/net/ethernet/ezchip/nps_enet.c (line 421)
> drivers/net/ethernet/ibm/ibmveth.c (line 1460)
> drivers/net/ethernet/intel/fm10k/fm10k_netdev.c (line 911)
> drivers/net/ethernet/intel/i40e/i40e_main.c (line 1518)
> drivers/net/ethernet/mellanox/mlx5/core/en_main.c (line 1796)
> drivers/net/usb/lan78xx.c (line 1777)
> drivers/staging/rtl8192e/rtl8192e/rtl_core.c (line 2285)
> drivers/staging/rtl8712/os_intfs.c (line 181)
> net/8021q/vlan_dev.c (line 338)
> net/batman-adv/soft-interface.c (line 140)
> net/dsa/slave.c (line 198)
> 
> Given that information, it should be fine for that change in rtl8192u!
> But if I'm mistaken somewhere please tell me!
> Should I update my patch with those information in the changelog?

Yes.

> If so, how verbose do you expect it to be?

Very :)

--
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: wan: sbni: fix device usage count

2015-09-05 Thread David Miller
From: Sudip Mukherjee 
Date: Thu,  3 Sep 2015 11:30:30 +0530

> dev_get_by_name() will increment the usage count if the matching device
> is found. But we were not decrementing the count if we have got the
> device and the device is non-active.
> 
> Signed-off-by: Sudip Mukherjee 

Applied, 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/


Re: [GIT PULL] nfsd changes for 4.3

2015-09-05 Thread Linus Torvalds
On Fri, Sep 4, 2015 at 1:09 PM, J. Bruce Fields  wrote:
>
> (Also, that's my first attempt at a pull request for a signed tag.  Let
> me know if I screwed anything up.)

Looks fine here.

   Linus
--
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 0/1] Revert "spi/doc: spi_master_put must be followed up by kfree"

2015-09-05 Thread Alexey Klimov
On Sun, Sep 6, 2015 at 3:06 AM, Mark Brown  wrote:
> On Sun, Sep 06, 2015 at 01:47:21AM +0300, Alexey Klimov wrote:
>
>> During review of new SPI drivers I tried to understand connection
>> between comment "calling spi_master_put() and kfree() to prevent a
>> memory leak" for spi_alloc_master() in spi.c and why no driver calls
>> kfree() on error path. Looks like Uwe added this comment and later I
>> found patch from Guenter that reverted this comment but spi-imx.c was
>> not fixed for that time. Later in 2013 spi-imx was fixed. Is it
>> correct time right now to fix comment?
>
> I'm sorry but I'm not clear what you're talking about here as there's
> missing context...  where is this comment you're talking about?
>
> In general please don't send cover letters for single patches, either
> add the content to the commit message or put it after the --- if it's
> administrative stuff (like SubmittingPatches says).

Okay, understand (about formatting of subject, RESEND noise and no
cover letter for single patches). Just never send reverts before
(especially when it's re-send from 2012 year).
It's easy to see comment in patch with subject: [PATCH RESEND 1/1]
Revert "spi/doc: spi_master_put must be followed up by kfree"
It's in drivers/spi/spi.c, line 1440 in tag v4.2 released ~ 5 days
ago. Comment for function spi_alloc_master().

Sorry. Right now I see how I screwed up. Should I re-send it as single
patch with all info included (marking as RESEND)?

-- 
Best regards,
Klimov Alexey
--
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/


Applied "regulator: pbias: program pbias register offset in pbias driver" to the regulator tree

2015-09-05 Thread Mark Brown
The patch

   regulator: pbias: program pbias register offset in pbias driver

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From b9c93646fd5cb669d096fec5ad25a01f04cfde27 Mon Sep 17 00:00:00 2001
From: Kishon Vijay Abraham I 
Date: Thu, 3 Sep 2015 12:20:37 +0530
Subject: [PATCH] regulator: pbias: program pbias register offset in pbias
 driver

Add separate compatible strings for every platform and populate the
pbias register offset in the driver data.
This helps avoid depending on the dt for pbias register offset.

Also update the dt binding documentation for the new compatible
strings.

Suggested-by: Tony Lindgren 
Signed-off-by: Kishon Vijay Abraham I 
Acked-by: Tony Lindgren 
Signed-off-by: Mark Brown 
---
 .../bindings/regulator/pbias-regulator.txt |  7 ++-
 drivers/regulator/pbias-regulator.c| 56 +++---
 2 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/regulator/pbias-regulator.txt 
b/Documentation/devicetree/bindings/regulator/pbias-regulator.txt
index 32aa26f1e434..acbcb452a69a 100644
--- a/Documentation/devicetree/bindings/regulator/pbias-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/pbias-regulator.txt
@@ -2,7 +2,12 @@ PBIAS internal regulator for SD card dual voltage i/o pads on 
OMAP SoCs.
 
 Required properties:
 - compatible:
-  - "ti,pbias-omap" for OMAP2, OMAP3, OMAP4, OMAP5, DRA7.
+  - should be "ti,pbias-dra7" for DRA7
+  - should be "ti,pbias-omap2" for OMAP2
+  - should be "ti,pbias-omap3" for OMAP3
+  - should be "ti,pbias-omap4" for OMAP4
+  - should be "ti,pbias-omap5" for OMAP5
+  - "ti,pbias-omap" is deprecated
 - reg: pbias register offset from syscon base and size of pbias register.
 - syscon : phandle of the system control module
 - regulator-name : should be
diff --git a/drivers/regulator/pbias-regulator.c 
b/drivers/regulator/pbias-regulator.c
index bd2b75c0d1d1..c21cedbdf451 100644
--- a/drivers/regulator/pbias-regulator.c
+++ b/drivers/regulator/pbias-regulator.c
@@ -44,6 +44,10 @@ struct pbias_regulator_data {
int voltage;
 };
 
+struct pbias_of_data {
+   unsigned int offset;
+};
+
 static const unsigned int pbias_volt_table[] = {
180,
300
@@ -98,8 +102,35 @@ static struct of_regulator_match pbias_matches[] = {
 };
 #define PBIAS_NUM_REGS ARRAY_SIZE(pbias_matches)
 
+/* Offset from SCM general area (and syscon) base */
+
+static const struct pbias_of_data pbias_of_data_omap2 = {
+   .offset = 0x230,
+};
+
+static const struct pbias_of_data pbias_of_data_omap3 = {
+   .offset = 0x2b0,
+};
+
+static const struct pbias_of_data pbias_of_data_omap4 = {
+   .offset = 0x60,
+};
+
+static const struct pbias_of_data pbias_of_data_omap5 = {
+   .offset = 0x60,
+};
+
+static const struct pbias_of_data pbias_of_data_dra7 = {
+   .offset = 0xe00,
+};
+
 static const struct of_device_id pbias_of_match[] = {
{ .compatible = "ti,pbias-omap", },
+   { .compatible = "ti,pbias-omap2", .data = &pbias_of_data_omap2, },
+   { .compatible = "ti,pbias-omap3", .data = &pbias_of_data_omap3, },
+   { .compatible = "ti,pbias-omap4", .data = &pbias_of_data_omap4, },
+   { .compatible = "ti,pbias-omap5", .data = &pbias_of_data_omap5, },
+   { .compatible = "ti,pbias-dra7", .data = &pbias_of_data_dra7, },
{},
 };
 MODULE_DEVICE_TABLE(of, pbias_of_match);
@@ -114,6 +145,9 @@ static int pbias_regulator_probe(struct platform_device 
*pdev)
const struct pbias_reg_info *info;
int ret = 0;
int count, idx, data_idx = 0;
+   const struct of_device_id *match;
+   const struct pbias_of_data *data;
+   unsigned int offset;
 
count = of_regulator_match(&pdev->dev, np, pbias_matches,
PBIAS_NUM_REGS);
@@ -129,6 +163,20 @@ static int pbias_regulator_probe(struct platform_device 
*pdev)
if (IS_ERR(syscon))
return PTR_ERR(syscon);
 
+   match = of_match_device(of_match_ptr(pbias_of_match), &pdev->dev);
+   if (match && match->data) {
+   data = match->data;
+ 

Re: [PATCH RESEND 0/1] Revert "spi/doc: spi_master_put must be followed up by kfree"

2015-09-05 Thread Mark Brown
On Sun, Sep 06, 2015 at 01:47:21AM +0300, Alexey Klimov wrote:

> During review of new SPI drivers I tried to understand connection
> between comment "calling spi_master_put() and kfree() to prevent a
> memory leak" for spi_alloc_master() in spi.c and why no driver calls
> kfree() on error path. Looks like Uwe added this comment and later I
> found patch from Guenter that reverted this comment but spi-imx.c was
> not fixed for that time. Later in 2013 spi-imx was fixed. Is it
> correct time right now to fix comment?

I'm sorry but I'm not clear what you're talking about here as there's
missing context...  where is this comment you're talking about?

In general please don't send cover letters for single patches, either
add the content to the commit message or put it after the --- if it's
administrative stuff (like SubmittingPatches says).


signature.asc
Description: Digital signature


usually 3000 customers/Where 100,000+ customers worldwide?

2015-09-05 Thread iSayor
Hi
  Are you still develop foreign customers with alibaba, exhibition?
 You out of!!!
  Are you looking other channel beside exhibition/B2B when you feel difficult 
to find foreign customers?
  Industry hundreds of thousands of customers worldwide, usually we can only 
contact three thousand, do you want to rest also developed?
  Guangdong General Chamber of Commerce recommended the initiative customer 
develop first brand, nearly ten thousand companies are benefiting.
  the first benefit with first use, nearly twenty thousand companies lead you!
  You can not use, but not without understanding.
  Add QQ2652697913/Skype:iSayor let's show you the initiative customer develop 
means.
--
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 1/1] Revert "spi/doc: spi_master_put must be followed up by kfree"

2015-09-05 Thread Mark Brown
On Sun, Sep 06, 2015 at 01:46:54AM +0300, Alexey Klimov wrote:
> From: Guenter Roeck 
> 
> Actually, spi_master_put() after spi_alloc_master() must _not_ be followed

Please use subject lines matching the style for the subsystem and please
don't put noise like RESEND in the subject line, especially if the patch
isn't actually being resent.  Both these things make it easier to scan
incoming mail for relevant and important patches.


signature.asc
Description: Digital signature


Re: [PATCH 02/18] staging: iio: hmc5843: Export missing SPI module alias information

2015-09-05 Thread Javier Martinez Canillas
Hello Jonathan,

On 09/05/2015 06:31 PM, Jonathan Cameron wrote:
> On 01/09/15 00:09, Javier Martinez Canillas wrote:
>> Hello Jonathan,
>>
>> On 08/22/2015 07:59 PM, Jonathan Cameron wrote:
>>> On 20/08/15 08:07, Javier Martinez Canillas wrote:
 The SPI core always reports the MODALIAS uevent as "spi:"
 regardless of the mechanism that was used to register the device
 (i.e: OF or board code) and the table that is used later to match
 the driver with the device (i.e: SPI id table or OF match table).

 So drivers needs to export the SPI id table and this be built into
 the module or udev won't have the necessary information to autoload
 the needed driver module when the device is added.

 Signed-off-by: Javier Martinez Canillas 
>>> Applied to the togreg branch of iio.git.
>>>
>>> This is too late for the upcoming merge window so it will be queued up for
>>> the next one.
>>>
>>
>> IMHO this patch and "[PATCH 01/18] iio: Export SPI module alias
>> information in missing drivers" [0] are fixing broken module
>> autoloading which are bugs so are material for the 4.3 -rc cycle.
> 
> It's a corner case.  Could also be argued that this isn't
> a bug but rather a case of a feature (autoprobing) being added
> that wasn't supported before.  It's not obligatory to support
> autoloading (even if we would normally aim to do so).
> 
> I'm happy enough for a request to apply these to stable occurs
> after they hit Linus' tree (as a trivial backport) but I don't
> think they really deserve being sent on as fixes.
> 
> Of course, I might be missing something that means something is
> actually broken, as opposed to not present.
>

Well, as a user I would expect that if I have a driver built-in
and it works, building it as a module will also work so I think
module autoload it's a bugfix and not a new feature.

And the patch is trivial and won't cause any issues so I don't
see why it can't be -rc material.

But of course is up to you, git log shows me that these drivers
have been since v3.10 so it seems that nobody cared anyways.
 
> Jonathan
> 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
--
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: [RFC v1 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-05 Thread Matt Ranostay
On Sat, Sep 5, 2015 at 1:11 AM, Peter Meerwald  wrote:
>
>> >> Add support for VZ89X sensors VOC and CO2 reporting channels in
>> >> ppm/ppb units.
>> >
>> > comments below
>> > link to datasheet?
>>
>> I will post the links when I am not at the Oregon coast. Have no laptop 
>> atm...
>>
>> >
>> >> Signed-off-by: Matt Ranostay 
>> >> ---
>> >> .../devicetree/bindings/i2c/trivial-devices.txt|   1 +
>> >> drivers/iio/Kconfig|   1 +
>> >> drivers/iio/Makefile   |   1 +
>> >> drivers/iio/chemical/Makefile  |   6 +
>> >> drivers/iio/chemical/vz89x.c   | 237 
>> >> +
>> >> 5 files changed, 246 insertions(+)
>> >> create mode 100644 drivers/iio/chemical/Makefile
>> >> create mode 100644 drivers/iio/chemical/vz89x.c
>> >>
>> >> diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt 
>> >> b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
>> >> index d77d412..a550216 100644
>> >> --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
>> >> +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
>> >> @@ -88,6 +88,7 @@ ricoh,rs5c372bI2C bus SERIAL INTERFACE 
>> >> REAL-TIME CLOCK IC
>> >> ricoh,rv5c386I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
>> >> ricoh,rv5c387aI2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
>> >> samsung,24ad0xd1S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power)
>> >> +sgx,vz89xSGX Sensortech VZ89X Sensors
>> >> sii,s35390a2-wire CMOS real-time clock
>> >> skyworks,sky81452Skyworks SKY81452: Six-Channel White LED Driver with 
>> >> Touch Panel Bias Supply
>> >> st-micro,24c256i2c serial eeprom  (24cxx)
>> >> diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig
>> >> index 4011eff..9664e9c 100644
>> >> --- a/drivers/iio/Kconfig
>> >> +++ b/drivers/iio/Kconfig
>> >> @@ -61,6 +61,7 @@ config IIO_CONSUMERS_PER_TRIGGER
>> >> source "drivers/iio/accel/Kconfig"
>> >> source "drivers/iio/adc/Kconfig"
>> >> source "drivers/iio/amplifiers/Kconfig"
>> >> +source "drivers/iio/chemical/Kconfig"
>> >> source "drivers/iio/common/Kconfig"
>> >> source "drivers/iio/dac/Kconfig"
>> >> source "drivers/iio/frequency/Kconfig"
>> >> diff --git a/drivers/iio/Makefile b/drivers/iio/Makefile
>> >> index 698afc2..2288684 100644
>> >> --- a/drivers/iio/Makefile
>> >> +++ b/drivers/iio/Makefile
>> >> @@ -14,6 +14,7 @@ obj-$(CONFIG_IIO_KFIFO_BUF) += kfifo_buf.o
>> >> obj-y += accel/
>> >> obj-y += adc/
>> >> obj-y += amplifiers/
>> >> +obj-y += chemical/
>> >> obj-y += common/
>> >> obj-y += dac/
>> >> obj-y += gyro/
>> >> diff --git a/drivers/iio/chemical/Makefile b/drivers/iio/chemical/Makefile
>> >> new file mode 100644
>> >> index 000..7292f2d
>> >> --- /dev/null
>> >> +++ b/drivers/iio/chemical/Makefile
>> >> @@ -0,0 +1,6 @@
>> >> +#
>> >> +# Makefile for IIO chemical sensors
>> >> +#
>> >> +
>> >> +# When adding new entries keep the list in alphabetical order
>> >> +obj-$(CONFIG_VZ89X)+= vz89x.o
>> >> diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c
>> >> new file mode 100644
>> >> index 000..a596a22
>> >> --- /dev/null
>> >> +++ b/drivers/iio/chemical/vz89x.c
>> >> @@ -0,0 +1,237 @@
>> >> +/*
>> >> + * vz89x.c - Support for SGX Sensortech MiCS VZ89X VOC sensors
>> >> + *
>> >> + * Copyright (C) 2015 Matt Ranostay 
>> >> + *
>> >> + * 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 
>> >> +
>> >> +#define VZ89X_REG_MEASUREMENT0x09
>> >> +#define VZ89X_REG_MEASUREMENT_SIZE6
>> >> +
>> >> +#define VZ89X_VOC_CO2_IDX0
>> >> +#define VZ89X_VOC_SHORT_IDX1
>> >> +#define VZ89X_VOC_TVOC_IDX2
>> >> +#define VZ89X_RESISTANCE_IDX3
>> >> +
>> >> +struct vz89x_data {
>> >> +struct i2c_client *client;
>> >> +struct mutex lock;
>> >> +unsigned long last_update;
>> >> +
>> >> +u8 buffer[VZ89X_REG_MEASUREMENT_SIZE];
>> >> +};
>> >> +
>> >> +static const struct iio_chan_spec vz89x_channels[] = {
>> >> +{
>> >> +.type = IIO_CONCENTRATION,
>> >> +.channel2 = IIO_MOD_PPM,
>> >> +.modified = 1,
>> >> +.info_mask_separate = BIT(IIO_CHAN_INFO_OFFSET) |
>> >> +BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE),
>> >> +.address = VZ89X_VOC_CO2_IDX,
>> >> +

[PATCH RESEND 0/1] Revert "spi/doc: spi_master_put must be followed up by kfree"

2015-09-05 Thread Alexey Klimov
Hi all,

During review of new SPI drivers I tried to understand connection
between comment "calling spi_master_put() and kfree() to prevent a
memory leak" for spi_alloc_master() in spi.c and why no driver calls
kfree() on error path. Looks like Uwe added this comment and later I
found patch from Guenter that reverted this comment but spi-imx.c was
not fixed for that time. Later in 2013 spi-imx was fixed. Is it
correct time right now to fix comment?

I tried to save authorship of patch from Guenter, added field "From"
and kept signed-off-by and cc. I hope i did it correctly in patch
(sorry for possible inconvenience).
Also marked it as RESEND since it's resend of original patch from 2012 year.

Best regards,
Alexey Klimov
--
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 RESEND 1/1] Revert "spi/doc: spi_master_put must be followed up by kfree"

2015-09-05 Thread Alexey Klimov
From: Guenter Roeck 

Actually, spi_master_put() after spi_alloc_master() must _not_ be followed
by kfree(). The memory is already freed with the call to spi_master_put()
through spi_master_class, which registers a release function. Calling both
spi_master_put() and kfree() results in often nasty (and delayed) crashes
elsewhere in the kernel, often in the networking stack.

This reverts commit eb4af0f5349235df2e4a5057a72fc8962d00308a.

Link to patch and concerns: https://lkml.org/lkml/2012/9/3/269
or
http://lkml.iu.edu/hypermail/linux/kernel/1209.0/00790.html

Alexey Klimov: This revert becomes valid after
94c69f765f1b4a658d96905ec59928e3e3e07e6a when spi-imx.c
has been fixed and there is no need to call kfree() so comment
for spi_alloc_master() should be fixed.

Cc: Uwe Kleine-Koenig 
Signed-off-by: Guenter Roeck 
Signed-off-by: Alexey Klimov 
---
 drivers/spi/spi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3abb390..a5f53de 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1610,8 +1610,7 @@ static struct class spi_master_class = {
  *
  * The caller is responsible for assigning the bus number and initializing
  * the master's methods before calling spi_register_master(); and (after errors
- * adding the device) calling spi_master_put() and kfree() to prevent a memory
- * leak.
+ * adding the device) calling spi_master_put() to prevent a memory leak.
  */
 struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
 {
-- 
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/


Re: [RFC v1 4/4] iio: chemical: add SGX VZ89x VOC sensor support

2015-09-05 Thread Matt Ranostay
On Sat, Sep 5, 2015 at 9:14 AM, Jonathan Cameron  wrote:
> On 05/09/15 06:53, Matt Ranostay wrote:
>> Add support for VZ89X sensors VOC and CO2 reporting channels in
>> ppm/ppb units.
>>
>> Signed-off-by: Matt Ranostay 
> Few points inline.  I'm either rather too sleepy or you don't actually
> store threadings in your cache during the read measurement function hence
> the driver will rather spectacularly not work right now :)
>
> Jonathan
>> ---
>>  .../devicetree/bindings/i2c/trivial-devices.txt|   1 +
>>  drivers/iio/Kconfig|   1 +
>>  drivers/iio/Makefile   |   1 +
>>  drivers/iio/chemical/Makefile  |   6 +
>>  drivers/iio/chemical/vz89x.c   | 237 
>> +
>>  5 files changed, 246 insertions(+)
>>  create mode 100644 drivers/iio/chemical/Makefile
>>  create mode 100644 drivers/iio/chemical/vz89x.c
>>
>> diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt 
>> b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
>> index d77d412..a550216 100644
>> --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
>> +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
>> @@ -88,6 +88,7 @@ ricoh,rs5c372b  I2C bus SERIAL INTERFACE 
>> REAL-TIME CLOCK IC
>>  ricoh,rv5c386I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
>>  ricoh,rv5c387a   I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
>>  samsung,24ad0xd1 S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power)
>> +sgx,vz89xSGX Sensortech VZ89X Sensors
>>  sii,s35390a  2-wire CMOS real-time clock
>>  skyworks,sky81452Skyworks SKY81452: Six-Channel White LED Driver with 
>> Touch Panel Bias Supply
>>  st-micro,24c256  i2c serial eeprom  (24cxx)
>> diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig
>> index 4011eff..9664e9c 100644
>> --- a/drivers/iio/Kconfig
>> +++ b/drivers/iio/Kconfig
>> @@ -61,6 +61,7 @@ config IIO_CONSUMERS_PER_TRIGGER
>>  source "drivers/iio/accel/Kconfig"
>>  source "drivers/iio/adc/Kconfig"
>>  source "drivers/iio/amplifiers/Kconfig"
>> +source "drivers/iio/chemical/Kconfig"
>>  source "drivers/iio/common/Kconfig"
>>  source "drivers/iio/dac/Kconfig"
>>  source "drivers/iio/frequency/Kconfig"
>> diff --git a/drivers/iio/Makefile b/drivers/iio/Makefile
>> index 698afc2..2288684 100644
>> --- a/drivers/iio/Makefile
>> +++ b/drivers/iio/Makefile
>> @@ -14,6 +14,7 @@ obj-$(CONFIG_IIO_KFIFO_BUF) += kfifo_buf.o
>>  obj-y += accel/
>>  obj-y += adc/
>>  obj-y += amplifiers/
>> +obj-y += chemical/
>>  obj-y += common/
>>  obj-y += dac/
>>  obj-y += gyro/
>> diff --git a/drivers/iio/chemical/Makefile b/drivers/iio/chemical/Makefile
>> new file mode 100644
>> index 000..7292f2d
>> --- /dev/null
>> +++ b/drivers/iio/chemical/Makefile
>> @@ -0,0 +1,6 @@
>> +#
>> +# Makefile for IIO chemical sensors
>> +#
>> +
>> +# When adding new entries keep the list in alphabetical order
>> +obj-$(CONFIG_VZ89X)  += vz89x.o
>> diff --git a/drivers/iio/chemical/vz89x.c b/drivers/iio/chemical/vz89x.c
>> new file mode 100644
>> index 000..a596a22
>> --- /dev/null
>> +++ b/drivers/iio/chemical/vz89x.c
>> @@ -0,0 +1,237 @@
>> +/*
>> + * vz89x.c - Support for SGX Sensortech MiCS VZ89X VOC sensors
>> + *
>> + * Copyright (C) 2015 Matt Ranostay 
>> + *
>> + * 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 
>> +
>> +#define VZ89X_REG_MEASUREMENT0x09
>> +#define VZ89X_REG_MEASUREMENT_SIZE   6
>> +
>> +#define VZ89X_VOC_CO2_IDX0
>> +#define VZ89X_VOC_SHORT_IDX  1
>> +#define VZ89X_VOC_TVOC_IDX   2
>> +#define VZ89X_RESISTANCE_IDX 3
>> +
>> +struct vz89x_data {
>> + struct i2c_client *client;
>> + struct mutex lock;
>> + unsigned long last_update;
>> +
>> + u8 buffer[VZ89X_REG_MEASUREMENT_SIZE];
>
> Just a small point, but unless I'm missing something you forgot
> to actually copy any data into the buffer anywhere.  Guess testing would
> make this obviously fairly quickly once you have the part :)
>
>> +};
>> +
>> +static const struct iio_chan_spec vz89x_channels[] = {
>> + {
>> + .type = IIO_CONCENTRATION,
>> + .channel2 = IIO_MOD_PPM,
>> + .modified = 1,
>> + .info_mask_separate = BIT(IIO_CHAN_INFO_OFFSET) |
>> + BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_

Re: [PATCH] ARM: fix alignement of __bug_table section entries

2015-09-05 Thread Robert Jarzmik
Russell King - ARM Linux  writes:

>> Moreover, this is consistent with the fact that this commit is in linux-next 
>> but
>> not in v4.1 :
>> a5e090acbf54 ("ARM: software-based priviledged-no-access support")
>> 
>> So the issue is around this SW_DOMAIN_PAN, at least on PXA.
>
> Is it only PXA which seems to be affected?
Sorry I don't know, I only own pxa platforms.

> If so, you may need to add:
>
>   mrc p15, 0, \rd, c2, c0, 0
>   mov \rd, \rd
>   sub pc, pc, #4
>
> to the places we update the domain access register to ensure that the
> Xscale pipeline stalls to allow the CP15 DACR update to hit.
Okay, I'll try that.

By the way, the ARMv5 manual states in chapter "B4.5.1 MMU Fault" that for a
DACR update, a "PrefetchFlush" operation has to be done (chapter B2.6.3
PrefetchFlush CP15 register 7), quoting :
Changes to the Domain Access Control register are synchronized by performing
a PrefetchFlush operation (or as result of an exception or exception
return). See Changes to CP15 registers and the memory order model on page
B2-24 for details.

Cheers.

-- 
Robert
--
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: [PATCHv2 18/19] staging: rtl8192u: r8192U_core: fix use ether_addr_copy() over memcpy() code style issue

2015-09-05 Thread Raphaël Beamonte
2015-09-03 13:00 GMT-04:00 Greg Kroah-Hartman :
> You need to prove that they are aligned before I can take this patch :(

Right!

I looked at those structs using pahole. The structs used are
net_device from include/linux/netdevice.h and sockaddr from
include/linux/socket.h, in which we use the elements dev_addr and
sa_data respectively.

Using pahole, the output for both those elements in the structs are:
unsigned char *dev_addr; /*   888 8 */
char   sa_data[14];  /* 214 */

If I understand correctly how pahole is outputing the information and
what a u16 alignment means in the struct, I should, for both those
cases, have a multiple of 2 (sizeof(u16)) as first value in the
comment following the line (first value being the position of the
element in the struct, second value its size). So if I understood
correctly, in both those cases, it's working: they're u16 aligned.

Also, to be sure, I searched in the kernel sources and found multiple
files that are currently using both those structs and ether_addr_copy:
(line numbers are those for commit 34fca4b of your staging-testing
tree)
drivers/net/ethernet/broadcom/genet/bcmgenet.c (line 2957)
drivers/net/ethernet/brocade/bna/bnad.c (line 3250)
drivers/net/ethernet/emulex/benet/be_main.c (line 315)
drivers/net/ethernet/ezchip/nps_enet.c (line 421)
drivers/net/ethernet/ibm/ibmveth.c (line 1460)
drivers/net/ethernet/intel/fm10k/fm10k_netdev.c (line 911)
drivers/net/ethernet/intel/i40e/i40e_main.c (line 1518)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c (line 1796)
drivers/net/usb/lan78xx.c (line 1777)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c (line 2285)
drivers/staging/rtl8712/os_intfs.c (line 181)
net/8021q/vlan_dev.c (line 338)
net/batman-adv/soft-interface.c (line 140)
net/dsa/slave.c (line 198)

Given that information, it should be fine for that change in rtl8192u!
But if I'm mistaken somewhere please tell me!
Should I update my patch with those information in the changelog? If
so, how verbose do you expect it to be?

Thanks!
-R
--
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/


usually 3000 customers/Where 100,000+ customers worldwide?

2015-09-05 Thread iSayor
Hi
  Are you still develop foreign customers with alibaba, exhibition?
 You out of!!!
  Are you looking other channel beside exhibition/B2B when you feel difficult 
to find foreign customers?
  Industry hundreds of thousands of customers worldwide, usually we can only 
contact three thousand, do you want to rest also developed?
  Guangdong General Chamber of Commerce recommended the initiative customer 
develop first brand, nearly ten thousand companies are benefiting.
  the first benefit with first use, nearly twenty thousand companies lead you!
  You can not use, but not without understanding.
  Add QQ767650805/Skype:iSayor let's show you the initiative customer develop 
means.
--
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] usb: gadget: amd5536udc: fix error handling in udc_pci_probe()

2015-09-05 Thread Alexey Khoroshilov
If a failure happens early in udc_pci_probe(), error handling code
just kfree(dev) and returns. The patch adds proper resource
deallocations in udc_pci_probe() itself,
since udc_pci_remove() is not suitabe to be called so early
in initialization process.

By the way, iounmap(dev->regs) is replaced by iounmap(dev->virt_addr)
in udc_pci_remove() for clarity.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov 
---
 drivers/usb/gadget/udc/amd5536udc.c | 43 +
 1 file changed, 20 insertions(+), 23 deletions(-)

diff --git a/drivers/usb/gadget/udc/amd5536udc.c 
b/drivers/usb/gadget/udc/amd5536udc.c
index fdacddb18c00..175ca93fe5e2 100644
--- a/drivers/usb/gadget/udc/amd5536udc.c
+++ b/drivers/usb/gadget/udc/amd5536udc.c
@@ -3138,8 +3138,8 @@ static void udc_pci_remove(struct pci_dev *pdev)
writel(AMD_BIT(UDC_DEVCFG_SOFTRESET), &dev->regs->cfg);
if (dev->irq_registered)
free_irq(pdev->irq, dev);
-   if (dev->regs)
-   iounmap(dev->regs);
+   if (dev->virt_addr)
+   iounmap(dev->virt_addr);
if (dev->mem_region)
release_mem_region(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
@@ -3226,17 +3226,13 @@ static int udc_pci_probe(
 
/* init */
dev = kzalloc(sizeof(struct udc), GFP_KERNEL);
-   if (!dev) {
-   retval = -ENOMEM;
-   goto finished;
-   }
+   if (!dev)
+   return -ENOMEM;
 
/* pci setup */
if (pci_enable_device(pdev) < 0) {
-   kfree(dev);
-   dev = NULL;
retval = -ENODEV;
-   goto finished;
+   goto err_pcidev;
}
dev->active = 1;
 
@@ -3246,28 +3242,22 @@ static int udc_pci_probe(
 
if (!request_mem_region(resource, len, name)) {
dev_dbg(&pdev->dev, "pci device used already\n");
-   kfree(dev);
-   dev = NULL;
retval = -EBUSY;
-   goto finished;
+   goto err_memreg;
}
dev->mem_region = 1;
 
dev->virt_addr = ioremap_nocache(resource, len);
if (dev->virt_addr == NULL) {
dev_dbg(&pdev->dev, "start address cannot be mapped\n");
-   kfree(dev);
-   dev = NULL;
retval = -EFAULT;
-   goto finished;
+   goto err_ioremap;
}
 
if (!pdev->irq) {
dev_err(&pdev->dev, "irq not set\n");
-   kfree(dev);
-   dev = NULL;
retval = -ENODEV;
-   goto finished;
+   goto err_irq;
}
 
spin_lock_init(&dev->lock);
@@ -3283,10 +3273,8 @@ static int udc_pci_probe(
 
if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq);
-   kfree(dev);
-   dev = NULL;
retval = -EBUSY;
-   goto finished;
+   goto err_irq;
}
dev->irq_registered = 1;
 
@@ -3314,8 +3302,17 @@ static int udc_pci_probe(
return 0;
 
 finished:
-   if (dev)
-   udc_pci_remove(pdev);
+   udc_pci_remove(pdev);
+   return retval;
+
+err_irq:
+   iounmap(dev->virt_addr);
+err_ioremap:
+   release_mem_region(resource, len);
+err_memreg:
+   pci_disable_device(pdev);
+err_pcidev:
+   kfree(dev);
return retval;
 }
 
-- 
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/


usually 3000 customers/Where 100,000+ customers worldwide?

2015-09-05 Thread iSayor
Hi
  Are you still develop foreign customers with alibaba, exhibition?
 You out of!!!
  Are you looking other channel beside exhibition/B2B when you feel difficult 
to find foreign customers?
  Industry hundreds of thousands of customers worldwide, usually we can only 
contact three thousand, do you want to rest also developed?
  Guangdong General Chamber of Commerce recommended the initiative customer 
develop first brand, nearly ten thousand companies are benefiting.
  the first benefit with first use, nearly twenty thousand companies lead you!
  You can not use, but not without understanding.
  Add QQ767650805/Skype:iSayor let's show you the initiative customer develop 
means.
--
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/


usually 3000 customers/Where 100,000+ customers worldwide?

2015-09-05 Thread iSayor
Hi
  Are you still develop foreign customers with alibaba, exhibition?
 You out of!!!
  Are you looking other channel beside exhibition/B2B when you feel difficult 
to find foreign customers?
  Industry hundreds of thousands of customers worldwide, usually we can only 
contact three thousand, do you want to rest also developed?
  Guangdong General Chamber of Commerce recommended the initiative customer 
develop first brand, nearly ten thousand companies are benefiting.
  the first benefit with first use, nearly twenty thousand companies lead you!
  You can not use, but not without understanding.
  Add QQ767650805/Skype:iSayor let's show you the initiative customer develop 
means.
--
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] x86/asm/entry/64: Minor cleanup of conditional compilation

2015-09-05 Thread Nikolay Borisov
The entry_SYSCALL_64_fastpath was checking the value of __SYSCALL_MASK,
which in turn was being set in arch/x86/include/asm/unistd.h depending on
whether CONFIG_X86_X32_ABI was set or not. This made the intention a bit
cryptic.

Juggle the code around so that the conditional compilation depends on
the value of CONFIG_X86_X32_ABI

Signed-off-by: Nikolay Borisov 
---

Sending v2 as I had forgotten to add my signed-off-by line.

 arch/x86/entry/entry_64.S | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S
index 8cb3e43..b0177f9 100644
--- a/arch/x86/entry/entry_64.S
+++ b/arch/x86/entry/entry_64.S
@@ -175,11 +175,11 @@ GLOBAL(entry_SYSCALL_64_after_swapgs)
testl   $_TIF_WORK_SYSCALL_ENTRY, ASM_THREAD_INFO(TI_flags, %rsp, 
SIZEOF_PTREGS)
jnz tracesys
 entry_SYSCALL_64_fastpath:
-#if __SYSCALL_MASK == ~0
-   cmpq$__NR_syscall_max, %rax
-#else
+#ifdef CONFIG_X86_X32_ABI
andl$__SYSCALL_MASK, %eax
cmpl$__NR_syscall_max, %eax
+#else
+   cmpq$__NR_syscall_max, %rax
 #endif
ja  1f  /* return -ENOSYS (already in 
pt_regs->ax) */
movq%r10, %rcx
-- 
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/


Re: [PATCH] task_work: remove fifo ordering guarantee

2015-09-05 Thread Linus Torvalds
On Fri, Sep 4, 2015 at 10:42 PM, Al Viro  wrote:
>
> OK, having found the beginning of the thread, I understand what is being
> attempted, but... why the hell bother with FIFO in the first place?  AFAICS,
> task_work_add() uses in VFS (final fput() and final mntput() alike)
> do not care about the FIFO at all.
>
> Sure, some out-of-tree mer^H^Hodule might rely on that.  So what?
>
> IMO, unless we have a good in-tree reason for insisting on FIFO, dropping it
> is the most obvious solution...

I agree. We should just try that.

I'll apply Eric's patch from the beginning of this tree, and let's
just see if anybody ever notices.

Removing code and possibly fixing a latency issue sounds like a win-win.

  Linus
--
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   >