[Bug] compile error

2015-12-29 Thread Chen Bough
Hi,
For the latest linux-next tree[tag: v4.4-rc6], I meet one compile error, 

drivers/media/usb/uvc/uvc_driver.c: In function 'uvc_probe':
drivers/media/usb/uvc/uvc_driver.c:1941:32: error: 'struct uvc_device' has no 
member named 'mdev'
  if (media_device_register(&dev->mdev) < 0)
^
make[4]: *** [drivers/media/usb/uvc/uvc_driver.o] Error 1
make[4]: *** Waiting for unfinished jobs



Best Regards
Haibo 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 v5 1/4] iio: adc: add IMX7D ADC driver support

2015-12-13 Thread Chen Bough
Hi Jonathan,

Thanks for your careful and patient review!

Best Regards
Haibo Chen


> -Original Message-
> From: Jonathan Cameron [mailto:ji...@kernel.org]
> Sent: Sunday, December 13, 2015 1:03 AM
> To: Chen Haibo-B51421; knaac...@gmx.de; l...@metafoo.de;
> pme...@pmeerw.net; shawn...@kernel.org; ker...@pengutronix.de
> Cc: linux-...@vger.kernel.org; devicet...@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v5 1/4] iio: adc: add IMX7D ADC driver support
> 
> On 08/12/15 10:26, Haibo Chen wrote:
> > Freescale i.MX7D soc contains a new ADC IP. This patch add this ADC
> > driver support, and the driver only support ADC software trigger.
> >
> > Signed-off-by: Haibo Chen 
> One significant issue, but as the fix is simple I've made it.
> A few formatting bits and bobs that I've also cleaned up (overly long
> lines).
> If I don't clean them up on merge I have to deal with the little 'fix'
> patches in the coming weeks :) Easier to do it now.
> I left one case where I felt it would hurt readability alone, but fixed
> the others.
> 
> Applied to the togreg branch of iio.git - initially pushed out as testing
> for the autobuilders to play with it.
> 
> Thanks,
> 
> Jonathan
> > ---
> >  drivers/iio/adc/Kconfig |   9 +
> >  drivers/iio/adc/Makefile|   1 +
> >  drivers/iio/adc/imx7d_adc.c | 589
> > 
> >  3 files changed, 599 insertions(+)
> >  create mode 100644 drivers/iio/adc/imx7d_adc.c
> >
> > diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index
> > 7868c74..3493a46 100644
> > --- a/drivers/iio/adc/Kconfig
> > +++ b/drivers/iio/adc/Kconfig
> > @@ -194,6 +194,15 @@ config HI8435
> >   This driver can also be built as a module. If so, the module will
> be
> >   called hi8435.
> >
> > +config IMX7D_ADC
> > +   tristate "IMX7D ADC driver"
> > +   depends on ARCH_MXC || COMPILE_TEST
> > +   help
> > + Say yes here to build support for IMX7D ADC.
> > +
> > + This driver can also be built as a module. If so, the module will
> be
> > + called imx7d_adc.
> > +
> >  config LP8788_ADC
> > tristate "LP8788 ADC driver"
> > depends on MFD_LP8788
> > diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index
> > 99b37a9..282ffc01 100644
> > --- a/drivers/iio/adc/Makefile
> > +++ b/drivers/iio/adc/Makefile
> > @@ -20,6 +20,7 @@ obj-$(CONFIG_CC10001_ADC) += cc10001_adc.o
> >  obj-$(CONFIG_DA9150_GPADC) += da9150-gpadc.o
> >  obj-$(CONFIG_EXYNOS_ADC) += exynos_adc.o
> >  obj-$(CONFIG_HI8435) += hi8435.o
> > +obj-$(CONFIG_IMX7D_ADC) += imx7d_adc.o
> >  obj-$(CONFIG_LP8788_ADC) += lp8788_adc.o
> >  obj-$(CONFIG_MAX1027) += max1027.o
> >  obj-$(CONFIG_MAX1363) += max1363.o
> > diff --git a/drivers/iio/adc/imx7d_adc.c b/drivers/iio/adc/imx7d_adc.c
> > new file mode 100644 index 000..d3511b9
> > --- /dev/null
> > +++ b/drivers/iio/adc/imx7d_adc.c
> > @@ -0,0 +1,589 @@
> > +/*
> > + * Freescale i.MX7D ADC driver
> > + *
> > + * Copyright (C) 2015 Freescale Semiconductor, Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or
> > +modify
> > + * it under the terms of the GNU General Public License as published
> > +by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/* ADC register */
> > +#define IMX7D_REG_ADC_CH_A_CFG10x00
> > +#define IMX7D_REG_ADC_CH_A_CFG20x10
> > +#define IMX7D_REG_ADC_CH_B_CFG10x20
> > +#define IMX7D_REG_ADC_CH_B_CFG20x30
> > +#define IMX7D_REG_ADC_CH_C_CFG10x40
> > +#define IMX7D_REG_ADC_CH_C_CFG20x50
> > +#define IMX7D_REG_ADC_CH_D_CFG10x60
> > +#define IMX7D_REG_ADC_CH_D_CFG20x70
> > +#define IMX7D_REG_ADC_CH_SW_CFG0x80
> > +#define IMX7D_REG_ADC_TIMER_UNIT   0x90
> > +#define IMX7D_REG_ADC_DMA_FIFO 0xa0
> > +#define IMX7D_REG_ADC_FIFO_STATUS  0xb0
> > +#define IMX7D_REG_ADC_INT_SIG_EN   0xc0
> > +#define IMX7D_REG_ADC_INT_EN   0xd0
> > +#define IMX7D_REG_ADC_INT_STATUS   0xe0
> > +#define IMX7D_REG_ADC_CHA_B_CNV_RSLT   0xf0
> > +#define IMX7D_REG_ADC_CHC_D_CNV_RSLT   0x100
> > +#define IMX7D_REG_ADC_CH_SW_CNV_RSLT   0x110
> > +#define IMX7D_REG_ADC_DMA_FIFO_DAT 0x120
> > +#define IMX7D_REG_ADC_ADC_CFG  0x130
> > +
> > +#define IMX7D_REG_ADC_CHANNEL_CFG2_BASE0x10
> > +#define IMX7D_EACH_CHANNEL_REG_OFFSET  0x20
> > +
> > +#define IMX7D_REG_ADC_CH_CFG1_CHANNEL_EN   (0x1 << 31)
> 

RE: [PATCH v4 1/4] iio: adc: add IMX7D ADC driver support

2015-12-01 Thread Chen Bough

> -Original Message-
> From: Peter Meerwald-Stadler [mailto:pme...@pmeerw.net]
> Sent: Tuesday, December 01, 2015 4:51 PM
> To: Chen Haibo-B51421
> Cc: ji...@kernel.org; knaac...@gmx.de; l...@metafoo.de;
> shawn...@kernel.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH v4 1/4] iio: adc: add IMX7D ADC driver support
> 
> 
> > Freescale i.MX7D soc contains a new ADC IP. This patch add this ADC
> > driver support, and the driver only support ADC software trigger.
> 
> some extreme nitpicking below :)
> 
> > Signed-off-by: Haibo Chen 
> > ---
> >  drivers/iio/adc/Kconfig |   9 +
> >  drivers/iio/adc/Makefile|   1 +
> >  drivers/iio/adc/imx7d_adc.c | 588
> > 
> >  3 files changed, 598 insertions(+)
> >  create mode 100644 drivers/iio/adc/imx7d_adc.c
> >
> > diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index
> > 7868c74..3493a46 100644
> > --- a/drivers/iio/adc/Kconfig
> > +++ b/drivers/iio/adc/Kconfig
> > @@ -194,6 +194,15 @@ config HI8435
> >   This driver can also be built as a module. If so, the module will
> be
> >   called hi8435.
> >
> > +config IMX7D_ADC
> > +   tristate "IMX7D ADC driver"
> > +   depends on ARCH_MXC || COMPILE_TEST
> > +   help
> > + Say yes here to build support for IMX7D ADC.
> > +
> > + This driver can also be built as a module. If so, the module will
> be
> > + called imx7d_adc.
> > +
> >  config LP8788_ADC
> > tristate "LP8788 ADC driver"
> > depends on MFD_LP8788
> > diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index
> > 99b37a9..282ffc01 100644
> > --- a/drivers/iio/adc/Makefile
> > +++ b/drivers/iio/adc/Makefile
> > @@ -20,6 +20,7 @@ obj-$(CONFIG_CC10001_ADC) += cc10001_adc.o
> >  obj-$(CONFIG_DA9150_GPADC) += da9150-gpadc.o
> >  obj-$(CONFIG_EXYNOS_ADC) += exynos_adc.o
> >  obj-$(CONFIG_HI8435) += hi8435.o
> > +obj-$(CONFIG_IMX7D_ADC) += imx7d_adc.o
> >  obj-$(CONFIG_LP8788_ADC) += lp8788_adc.o
> >  obj-$(CONFIG_MAX1027) += max1027.o
> >  obj-$(CONFIG_MAX1363) += max1363.o
> > diff --git a/drivers/iio/adc/imx7d_adc.c b/drivers/iio/adc/imx7d_adc.c
> > new file mode 100644 index 000..4780595
> > --- /dev/null
> > +++ b/drivers/iio/adc/imx7d_adc.c
> > @@ -0,0 +1,588 @@
> > +/*
> > + * Freescale i.MX7D ADC driver
> > + *
> > + * Copyright (C) 2015 Freescale Semiconductor, Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or
> > +modify
> > + * it under the terms of the GNU General Public License as published
> > +by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/* ADC register */
> > +#define IMX7D_REG_ADC_CH_A_CFG10x00
> > +#define IMX7D_REG_ADC_CH_A_CFG20x10
> > +#define IMX7D_REG_ADC_CH_B_CFG10x20
> > +#define IMX7D_REG_ADC_CH_B_CFG20x30
> > +#define IMX7D_REG_ADC_CH_C_CFG10x40
> > +#define IMX7D_REG_ADC_CH_C_CFG20x50
> > +#define IMX7D_REG_ADC_CH_D_CFG10x60
> > +#define IMX7D_REG_ADC_CH_D_CFG20x70
> > +#define IMX7D_REG_ADC_CH_SW_CFG0x80
> > +#define IMX7D_REG_ADC_TIMER_UNIT   0x90
> > +#define IMX7D_REG_ADC_DMA_FIFO 0xa0
> > +#define IMX7D_REG_ADC_FIFO_STATUS  0xb0
> > +#define IMX7D_REG_ADC_INT_SIG_EN   0xc0
> > +#define IMX7D_REG_ADC_INT_EN   0xd0
> > +#define IMX7D_REG_ADC_INT_STATUS   0xe0
> > +#define IMX7D_REG_ADC_CHA_B_CNV_RSLT   0xf0
> > +#define IMX7D_REG_ADC_CHC_D_CNV_RSLT   0x100
> > +#define IMX7D_REG_ADC_CH_SW_CNV_RSLT   0x110
> > +#define IMX7D_REG_ADC_DMA_FIFO_DAT 0x120
> > +#define IMX7D_REG_ADC_ADC_CFG  0x130
> > +
> > +#define IMX7D_REG_ADC_CHANNEL_CFG2_BASE0x10
> > +#define IMX7D_EACH_CHANNEL_REG_OFFSET  0x20
> > +
> > +#define IMX7D_REG_ADC_CH_CFG1_CHANNEL_EN   (0x1 << 31)
> > +#define IMX7D_REG_ADC_CH_CFG1_CHANNEL_SINGLE   BIT(30)
> > +#define IMX7D_REG_ADC_CH_CFG1_CHANNEL_AVG_EN   BIT(29)
> > +#define IMX7D_REG_ADC_CH_CFG1_CHANNEL_SEL(x)   ((x) << 
> > 24)
> > +
> > +#define IMX7D_REG_ADC_CH_CFG2_AVG_NUM_4(0x0 <<
> 12)
> > +#define IMX7D_REG_ADC_CH_CFG2_AVG_NUM_8(0x1 <<
> 12)
> > +#define IMX7D_REG_ADC_CH_CFG2_AVG_NUM_16   (0x2 << 12)
> > +#define IMX7D_REG_ADC_CH_CFG2_AVG_NUM_32   (0x3 << 12)
> > +
> > +#define IMX7D_REG_ADC_TIMER_UNIT_PRE_DIV_4 (0x0 << 29)
> > +#define 

RE: [RFC] sdhci: fix DMA leaks [was: [SHDCI] Heavy (thousands) DMA leaks]

2015-08-24 Thread Chen Bough
Hi Laura,

You can find the patch here:
http://patchwork.kernerl.xyz/patch/6967161/

I will send this patch again and cc to you.


Best regards

Haibo



> -Original Message-
> From: Laura Abbott [mailto:labb...@redhat.com]
> Sent: Tuesday, August 25, 2015 12:27 AM
> To: Chen Haibo-B51421; Jiri Slaby; Ulf Hansson
> Cc: linux-...@vger.kernel.org; Linux kernel mailing list
> Subject: Re: [RFC] sdhci: fix DMA leaks [was: [SHDCI] Heavy (thousands)
> DMA leaks]
> 
> On 08/06/2015 02:17 AM, Chen Bough wrote:
> > I will format a patch based on your diff file firstly. I will test
> > this on my side, If any issue, like dma issue or performance issue, I
> will add some modification.
> > Then I will send the patch for review, and you can test the patch on
> your platform.
> >
> > Best Regards
> > Haibo Chen
> >
> 
> Did I miss the follow up patch or is this still pending? If it's still
> pending, would you mind Ccing me when it's available for testing?
> 
> Thanks,
> Laura
> 
> >
> >> -Original Message-
> >> From: Jiri Slaby [mailto:jsl...@suse.cz]
> >> Sent: Thursday, August 06, 2015 5:07 PM
> >> To: Chen Haibo-B51421; Ulf Hansson
> >> Cc: linux-...@vger.kernel.org; Linux kernel mailing list
> >> Subject: Re: [RFC] sdhci: fix DMA leaks [was: [SHDCI] Heavy
> >> (thousands) DMA leaks]
> >>
> >> On 08/06/2015, 09:42 AM, Chen Bough wrote:
> >>> I read your attached log and patch, yes, dma memory leak will happen
> >>> when more than one pre_request execute. The method of ++next->cookie
> >>> is not good, your patch seems good, but I still need some time to
> >>> test the patch, because you unmap the dma in sdhci_finish_data
> >>> rather than
> >> the sdhci_post_req.
> >>
> >> Hi,
> >>
> >> yes, this is not correct. We can perhaps differentiate according to
> >> the COOKIE value. Should I fix it or are you going to prepare a patch
> >> based on my RFC?
> >>
> >> thanks,
> >> --
> >> js
> >> suse labs

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 v2 2/5] Documentation: Detail permitted DT properties for the imx6ul_tsc

2015-08-24 Thread Chen Bough


> -Original Message-
> From: Markus Pargmann [mailto:m...@pengutronix.de]
> Sent: Friday, August 21, 2015 5:27 PM
> To: Chen Haibo-B51421
> Cc: robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com;
> ijc+devicet...@hellion.org.uk; ga...@codeaurora.org; shawn...@kernel.org;
> ker...@pengutronix.de; li...@arm.linux.org.uk; dmitry.torok...@gmail.com;
> devicet...@vger.kernel.org; sbran...@broadcom.com; a...@arndb.de;
> mche...@osg.samsung.com; christian.gmei...@gmail.com;
> scott@emc.com.tw; linux-kernel@vger.kernel.org; hdego...@redhat.com;
> jonat...@broadcom.com; benjamin.tissoi...@redhat.com;
> hans.verk...@cisco.com; had...@hadess.net; linux-in...@vger.kernel.org;
> ge...@linux-m68k.org; sebastien.szyman...@armadeus.com;
> mamli...@gmail.com; linux-arm-ker...@lists.infradead.org
> Subject: Re: [PATCH v2 2/5] Documentation: Detail permitted DT properties
> for the imx6ul_tsc
> 
> On Fri, Aug 21, 2015 at 08:30:16AM +, Chen Bough wrote:
> > Hi Markus,
> >
> > > -Original Message-
> > > From: Markus Pargmann [mailto:m...@pengutronix.de]
> > > Sent: Wednesday, August 19, 2015 1:55 PM
> > > To: Chen Haibo-B51421
> > > Cc: robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com;
> > > ijc+devicet...@hellion.org.uk; ga...@codeaurora.org;
> > > ijc+shawn...@kernel.org;
> > > ker...@pengutronix.de; li...@arm.linux.org.uk;
> > > dmitry.torok...@gmail.com; devicet...@vger.kernel.org;
> > > sbran...@broadcom.com; a...@arndb.de; mche...@osg.samsung.com;
> > > christian.gmei...@gmail.com; scott@emc.com.tw;
> > > linux-kernel@vger.kernel.org; hdego...@redhat.com;
> > > jonat...@broadcom.com; benjamin.tissoi...@redhat.com;
> > > hans.verk...@cisco.com; had...@hadess.net;
> > > linux-in...@vger.kernel.org; ge...@linux-m68k.org;
> > > sebastien.szyman...@armadeus.com; mamli...@gmail.com;
> > > linux-arm-ker...@lists.infradead.org
> > > Subject: Re: [PATCH v2 2/5] Documentation: Detail permitted DT
> > > properties for the imx6ul_tsc
> > >
> > > Hi,
> > >
> > > On Tue, Jul 28, 2015 at 05:58:38PM +0800, Haibo Chen wrote:
> > > > Here we apply required documentation for the imx6ul touch screen
> > > > controller driver which describe available properties and how to
> > > > use them.
> > > >
> > > > Signed-off-by: Haibo Chen 
> > > > ---
> > > >  .../bindings/input/touchscreen/imx6ul_tsc.txt  | 36
> > > ++
> > > >  1 file changed, 36 insertions(+)
> > > >  create mode 100644
> > > > Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.txt
> > > >
> > > > diff --git
> > > > a/Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.t
> > > > xt
> > > > b/Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.t
> > > > xt
> > > > new file mode 100644
> > > > index 000..ac41c32
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/imx6ul_t
> > > > +++ sc.t
> > > > +++ xt
> > > > @@ -0,0 +1,36 @@
> > > > +* Freescale i.MX6UL Touch Controller
> > > > +
> > > > +Required properties:
> > > > +- compatible: must be "fsl,imx6ul-tsc".
> > > > +- reg: this touch controller address and the ADC2 address.
> > >
> > > This suggests that this driver is using a unit ADC2. Which also
> > > means that there are more than one ADC which are probably identical?
> > >
> > > Shouldn't these ADCs be properly described by their own device nodes
> > > instead of these two register ranges, two interrupts and two clocks?
> > >
> > > Is 'ADC2' usable without tsc? Then ADC1/ADC2 should perhaps get a
> > > proper IIO driver.
> >
> > For i.MX6UL, there are two ADC. ADC1 is a normal ADC, and ADC2 can
> > only works for TSC, the channels of ADC2 are connected to TSC
> > directly. TSC and ADC2 should work together as a touch screen
> controller.
> 
> But as I understand these are two different units. Wouldn't it be better
> to abstract it that way in the DT?

Since the ADC2 just work for TSC, no other use, why not bind ADC2 and TSC?
If separate, seems ADC2 can works as a normal ADC, but actually it can't.

Best regards,

Haibo

> 
> Best regards,
> 
> Markus
> 
> >
> > For ADC1, it share the driver vf610_adc.c (drivers/iio/adc/vf610_adc.c).
>

RE: [PATCH v2 1/5] input: touchscreen: add imx6ul_tsc driver support

2015-08-24 Thread Chen Bough
Hi Markus,



> -Original Message-
> From: Markus Pargmann [mailto:m...@pengutronix.de]
> Sent: Friday, August 21, 2015 5:26 PM
> To: Chen Haibo-B51421
> Cc: robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com;
> ijc+devicet...@hellion.org.uk; ga...@codeaurora.org; shawn...@kernel.org;
> ker...@pengutronix.de; li...@arm.linux.org.uk; dmitry.torok...@gmail.com;
> hans.verk...@cisco.com; had...@hadess.net; mche...@osg.samsung.com;
> mamli...@gmail.com; a...@arndb.de; jonat...@broadcom.com;
> hdego...@redhat.com; christian.gmei...@gmail.com; scott@emc.com.tw;
> ge...@linux-m68k.org; benjamin.tissoi...@redhat.com;
> sebastien.szyman...@armadeus.com; sbran...@broadcom.com;
> devicet...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-in...@vger.kernel.org
> Subject: Re: [PATCH v2 1/5] input: touchscreen: add imx6ul_tsc driver
> support
> 
> On Tue, Jul 28, 2015 at 05:58:37PM +0800, Haibo Chen wrote:
> > Freescale i.MX6UL contains a internal touchscreen controller, this
> > patch add a driver to support this controller.
> >
> > Signed-off-by: Haibo Chen 
> > ---
> >  drivers/input/touchscreen/Kconfig  |  12 +
> >  drivers/input/touchscreen/Makefile |   1 +
> >  drivers/input/touchscreen/imx6ul_tsc.c | 504
> > +
> >  3 files changed, 517 insertions(+)
> >  create mode 100644 drivers/input/touchscreen/imx6ul_tsc.c
> >
> > diff --git a/drivers/input/touchscreen/Kconfig
> > b/drivers/input/touchscreen/Kconfig
> > index 5b272ba..32c300d 100644
> > --- a/drivers/input/touchscreen/Kconfig
> > +++ b/drivers/input/touchscreen/Kconfig
> > @@ -479,6 +479,18 @@ config TOUCHSCREEN_MTOUCH
> >   To compile this driver as a module, choose M here: the
> >   module will be called mtouch.
> >
> > +config TOUCHSCREEN_IMX6UL_TSC
> > +   tristate "Freescale i.MX6UL touchscreen controller"
> > +   depends on OF
> > +   help
> > + Say Y here if you have a Freescale i.MX6UL, and want to
> > + use the internal touchscreen controller.
> > +
> > + If unsure, say N.
> > +
> > + To compile this driver as a module, choose M here: the
> > + moduel will be called imx6ul_tsc.
> > +
> >  config TOUCHSCREEN_INEXIO
> > tristate "iNexio serial touchscreens"
> > select SERIO
> > diff --git a/drivers/input/touchscreen/Makefile
> > b/drivers/input/touchscreen/Makefile
> > index c85aae2..9379b32 100644
> > --- a/drivers/input/touchscreen/Makefile
> > +++ b/drivers/input/touchscreen/Makefile
> > @@ -38,6 +38,7 @@ obj-$(CONFIG_TOUCHSCREEN_EGALAX)  += egalax_ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_FUJITSU)  += fujitsu_ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_GOODIX)   += goodix.o
> >  obj-$(CONFIG_TOUCHSCREEN_ILI210X)  += ili210x.o
> > +obj-$(CONFIG_TOUCHSCREEN_IMX6UL_TSC)   += imx6ul_tsc.o
> >  obj-$(CONFIG_TOUCHSCREEN_INEXIO)   += inexio.o
> >  obj-$(CONFIG_TOUCHSCREEN_INTEL_MID)+= intel-mid-touch.o
> >  obj-$(CONFIG_TOUCHSCREEN_IPROC)+= bcm_iproc_tsc.o
> > diff --git a/drivers/input/touchscreen/imx6ul_tsc.c
> > b/drivers/input/touchscreen/imx6ul_tsc.c
> > new file mode 100644
> > index 000..807f1db
> > --- /dev/null
> > +++ b/drivers/input/touchscreen/imx6ul_tsc.c
> > @@ -0,0 +1,504 @@
> > +/*
> > + * Freescale i.MX6UL touchscreen controller driver
> > + *
> > + * Copyright (C) 2015 Freescale Semiconductor, Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or
> > +modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/* ADC configuration registers field define */
> > +#define ADC_AIEN   (0x1 << 7)
> > +#define ADC_CONV_DISABLE   0x1F
> > +#define ADC_CAL(0x1 << 7)
> > +#define ADC_CALF   0x2
> > +#define ADC_12BIT_MODE (0x2 << 2)
> > +#define ADC_IPG_CLK0x00
> > +#define ADC_CLK_DIV_8  (0x03 << 5)
> > +#define ADC_SHORT_SAMPLE_MODE  (0x0 << 4)
> > +#define ADC_HARDWARE_TRIGGER   (0x1 << 13)
> > +#define SELECT_CHANNEL_4   0x04
> > +#define SELECT_CHANNEL_1   0x01
> > +#define DISABLE_CONVERSION_INT (0x0 << 7)
> > +
> > +/* ADC registers */
> > +#define REG_ADC_HC00x00
> > +#define REG_ADC_HC10x04
> > +#define REG_ADC_HC20x08
> > +#define REG_ADC_HC30x0C
> > +#define REG_ADC_HC40x10
> > +#define REG_ADC_HS 0x14
> > +#define REG_ADC_R0 0x18
> > +#define REG_ADC_CFG0x2C
> > +#define REG_ADC_GC 0x30
> > +#define REG_ADC_GS 0x34
> > +
> > +#define ADC_TIMEOUTmsecs_to_jiffies(100)
> 
> These defines are in tw

RE: [PATCH v2 2/5] Documentation: Detail permitted DT properties for the imx6ul_tsc

2015-08-21 Thread Chen Bough
Hi Markus,

> -Original Message-
> From: Markus Pargmann [mailto:m...@pengutronix.de]
> Sent: Wednesday, August 19, 2015 1:55 PM
> To: Chen Haibo-B51421
> Cc: robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com;
> ijc+devicet...@hellion.org.uk; ga...@codeaurora.org; shawn...@kernel.org;
> ker...@pengutronix.de; li...@arm.linux.org.uk; dmitry.torok...@gmail.com;
> devicet...@vger.kernel.org; sbran...@broadcom.com; a...@arndb.de;
> mche...@osg.samsung.com; christian.gmei...@gmail.com;
> scott@emc.com.tw; linux-kernel@vger.kernel.org; hdego...@redhat.com;
> jonat...@broadcom.com; benjamin.tissoi...@redhat.com;
> hans.verk...@cisco.com; had...@hadess.net; linux-in...@vger.kernel.org;
> ge...@linux-m68k.org; sebastien.szyman...@armadeus.com;
> mamli...@gmail.com; linux-arm-ker...@lists.infradead.org
> Subject: Re: [PATCH v2 2/5] Documentation: Detail permitted DT properties
> for the imx6ul_tsc
> 
> Hi,
> 
> On Tue, Jul 28, 2015 at 05:58:38PM +0800, Haibo Chen wrote:
> > Here we apply required documentation for the imx6ul touch screen
> > controller driver which describe available properties and how to use
> > them.
> >
> > Signed-off-by: Haibo Chen 
> > ---
> >  .../bindings/input/touchscreen/imx6ul_tsc.txt  | 36
> ++
> >  1 file changed, 36 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.txt
> >
> > diff --git
> > a/Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.txt
> > b/Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.txt
> > new file mode 100644
> > index 000..ac41c32
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.t
> > +++ xt
> > @@ -0,0 +1,36 @@
> > +* Freescale i.MX6UL Touch Controller
> > +
> > +Required properties:
> > +- compatible: must be "fsl,imx6ul-tsc".
> > +- reg: this touch controller address and the ADC2 address.
> 
> This suggests that this driver is using a unit ADC2. Which also means
> that there are more than one ADC which are probably identical?
> 
> Shouldn't these ADCs be properly described by their own device nodes
> instead of these two register ranges, two interrupts and two clocks?
> 
> Is 'ADC2' usable without tsc? Then ADC1/ADC2 should perhaps get a proper
> IIO driver.

For i.MX6UL, there are two ADC. ADC1 is a normal ADC, and ADC2 can only works 
for
TSC, the channels of ADC2 are connected to TSC directly. TSC and ADC2 should 
work
together as a touch screen controller. 

For ADC1, it share the driver vf610_adc.c (drivers/iio/adc/vf610_adc.c). 

Best Regards

Haibo 
 
> 
> Unfortunately I don't have the reference manual to have a look how this
> all works.
> 
> Best regards,
> 
> Markus
> 
> > +- interrupts: the interrupt of this touch controller and ADC2.
> > +- clocks: the root clock of touch controller and ADC2.
> > +- clock-names; must be "tsc" and "adc".
> > +- xnur-gpio: the X- gpio this controller connect to.
> > +  This xnur-gpio returns to high once the finger leave the touch
> > +screen (The
> > +  last touch event the touch controller capture).
> > +
> > +Optional properties:
> > +- measure-delay-time: the value of measure delay time.
> > +  Before X-axis or Y-axis measurement, the screen need some time
> > +before
> > +  even potential distribution ready.
> > +  This value depends on the touch screen.
> > +- pre-charge-time: the touch screen need some time to precharge.
> > +  This value depends on the touch screen.
> > +
> > +Example:
> > +   tsc: tsc@0204 {
> > +   compatible = "fsl,imx6ul-tsc";
> > +   reg = <0x0204 0x4000>, <0x0219c000 0x4000>;
> > +   interrupts = ,
> > +;
> > +   clocks = <&clks IMX6UL_CLK_IPG>,
> > +<&clks IMX6UL_CLK_ADC2>;
> > +   clock-names = "tsc", "adc";
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <&pinctrl_tsc>;
> > +   xnur-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
> > +   measure-delay-time = <0xfff>;
> > +   pre-charge-time = <0x>;
> > +   status = "okay";
> > +   };
> > --
> > 1.9.1
> >
> >
> >
> 
> --
> Pengutronix e.K.   |
> |
> Industrial Linux Solutions | http://www.pengutronix.de/
> |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0
> |
> Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917-
> |
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 v2 1/5] input: touchscreen: add imx6ul_tsc driver support

2015-08-21 Thread Chen Bough
Hi Dmitry,

Thanks for your patient review, especially for the patch you attached.

I test your patch these days, with below change, touch can work normally.
(also change the xnur to active low in dts)

In probe function:

> - tsc->xnur_gpio = of_get_named_gpio(np, "xnur-gpio", 0);
> - err = gpio_request_one(tsc->xnur_gpio, GPIOF_IN, "tsc_X-");
> - if (err) {
> - dev_err(&pdev->dev, "failed to request GPIO tsc_X-\n");
> + input_set_drvdata(input_dev, tsc);
> +
> + tsc->dev = &pdev->dev;
> + tsc->input = input_dev;
> + init_completion(&tsc->completion);
> +
> + tsc->xnur_gpio = devm_gpiod_get(&pdev->dev, "xnur-gpio", GPIOD_IN);  

Here, we need to change "xnur-gpio" to "xnur", otherwise the gpio request will 
be failed.
This is because gpiod common code already add suffix '-gpio' or 'gpios'.  



For others, your patch seems normal and rational. I will add your patch and 
send patch-V3.

Thanks again!


Best Regards
Haibo Chen



> -Original Message-
> From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com]
> Sent: Wednesday, August 19, 2015 1:12 PM
> To: Chen Haibo-B51421
> Cc: robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com;
> ijc+devicet...@hellion.org.uk; ga...@codeaurora.org; shawn...@kernel.org;
> ker...@pengutronix.de; li...@arm.linux.org.uk; hans.verk...@cisco.com;
> had...@hadess.net; mche...@osg.samsung.com; mamli...@gmail.com;
> a...@arndb.de; jonat...@broadcom.com; hdego...@redhat.com;
> christian.gmei...@gmail.com; scott@emc.com.tw; ge...@linux-m68k.org;
> benjamin.tissoi...@redhat.com; sebastien.szyman...@armadeus.com;
> sbran...@broadcom.com; devicet...@vger.kernel.org; linux-
> ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux-
> in...@vger.kernel.org
> Subject: Re: [PATCH v2 1/5] input: touchscreen: add imx6ul_tsc driver
> support
> 
> Hi Haibo,
> 
> On Tue, Jul 28, 2015 at 05:58:37PM +0800, Haibo Chen wrote:
> > Freescale i.MX6UL contains a internal touchscreen controller, this
> > patch add a driver to support this controller.
> >
> 
> This looks pretty reasonable; just a few comments below.
> 
> > Signed-off-by: Haibo Chen 
> > ---
> >  drivers/input/touchscreen/Kconfig  |  12 +
> >  drivers/input/touchscreen/Makefile |   1 +
> >  drivers/input/touchscreen/imx6ul_tsc.c | 504
> > +
> >  3 files changed, 517 insertions(+)
> >  create mode 100644 drivers/input/touchscreen/imx6ul_tsc.c
> >
> > diff --git a/drivers/input/touchscreen/Kconfig
> > b/drivers/input/touchscreen/Kconfig
> > index 5b272ba..32c300d 100644
> > --- a/drivers/input/touchscreen/Kconfig
> > +++ b/drivers/input/touchscreen/Kconfig
> > @@ -479,6 +479,18 @@ config TOUCHSCREEN_MTOUCH
> >   To compile this driver as a module, choose M here: the
> >   module will be called mtouch.
> >
> > +config TOUCHSCREEN_IMX6UL_TSC
> > +   tristate "Freescale i.MX6UL touchscreen controller"
> > +   depends on OF
> > +   help
> > + Say Y here if you have a Freescale i.MX6UL, and want to
> > + use the internal touchscreen controller.
> > +
> > + If unsure, say N.
> > +
> > + To compile this driver as a module, choose M here: the
> > + moduel will be called imx6ul_tsc.
> > +
> >  config TOUCHSCREEN_INEXIO
> > tristate "iNexio serial touchscreens"
> > select SERIO
> > diff --git a/drivers/input/touchscreen/Makefile
> > b/drivers/input/touchscreen/Makefile
> > index c85aae2..9379b32 100644
> > --- a/drivers/input/touchscreen/Makefile
> > +++ b/drivers/input/touchscreen/Makefile
> > @@ -38,6 +38,7 @@ obj-$(CONFIG_TOUCHSCREEN_EGALAX)  += egalax_ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_FUJITSU)  += fujitsu_ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_GOODIX)   += goodix.o
> >  obj-$(CONFIG_TOUCHSCREEN_ILI210X)  += ili210x.o
> > +obj-$(CONFIG_TOUCHSCREEN_IMX6UL_TSC)   += imx6ul_tsc.o
> >  obj-$(CONFIG_TOUCHSCREEN_INEXIO)   += inexio.o
> >  obj-$(CONFIG_TOUCHSCREEN_INTEL_MID)+= intel-mid-touch.o
> >  obj-$(CONFIG_TOUCHSCREEN_IPROC)+= bcm_iproc_tsc.o
> > diff --git a/drivers/input/touchscreen/imx6ul_tsc.c
> > b/drivers/input/touchscreen/imx6ul_tsc.c
> > new file mode 100644
> > index 000..807f1db
> > --- /dev/null
> > +++ b/drivers/input/touchscreen/imx6ul_tsc.c
> > @@ -0,0 +1,504 @@
> > +/*
> > + * Freescale i.MX6UL touchscreen controller driver
> > + *
> > + * Copyright (C) 2015 Freescale Semiconductor, Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or
> > +modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> 
> I do not think you need of_irq and of_device.
> 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/* ADC configuration registers field define *

RE: [PATCH v2 0/5] Add imx6ul touch screen controller support

2015-08-12 Thread Chen Bough

Hi all,

Any suggestion about these patch set? Since half month passed without any 
response.



> -Original Message-
> From: Haibo Chen [mailto:haibo.c...@freescale.com]
> Sent: Tuesday, July 28, 2015 5:59 PM
> To: robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com;
> ijc+devicet...@hellion.org.uk; ga...@codeaurora.org; shawn...@kernel.org;
> ker...@pengutronix.de; li...@arm.linux.org.uk; dmitry.torok...@gmail.com
> Cc: Chen Haibo-B51421; hans.verk...@cisco.com; had...@hadess.net;
> mche...@osg.samsung.com; mamli...@gmail.com; a...@arndb.de;
> jonat...@broadcom.com; hdego...@redhat.com; christian.gmei...@gmail.com;
> scott@emc.com.tw; ge...@linux-m68k.org; benjamin.tissoi...@redhat.com;
> sebastien.szyman...@armadeus.com; sbran...@broadcom.com;
> devicet...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org; linux-in...@vger.kernel.org
> Subject: [PATCH v2 0/5] Add imx6ul touch screen controller support
> 
> i.MX6UL contains a touch screen controller. This patch set add imx6ul
> touch screen controller driver support.
> 
> Changes for v2:
> -Add property in devicetree Documentation.
> -Add tsc disable code in tsc_remove function.
> -Remove some redundant code.
> 
> 
> Haibo Chen (5):
>   input: touchscreen: add imx6ul_tsc driver support
>   Documentation: Detail permitted DT properties for the imx6ul_tsc
>   ARM: imx_v6_v7_defconfig: enable imx6ul_tsc
>   ARM: dts: imx6ul.dtsi: add TSC support
>   ARM: dts: imx6ul-14x14-evk.dts: add tsc support
> 
>  .../bindings/input/touchscreen/imx6ul_tsc.txt  |  36 ++
>  arch/arm/boot/dts/imx6ul-14x14-evk.dts |  18 +
>  arch/arm/boot/dts/imx6ul.dtsi  |  11 +
>  arch/arm/configs/imx_v6_v7_defconfig   |   1 +
>  drivers/input/touchscreen/Kconfig  |  12 +
>  drivers/input/touchscreen/Makefile |   1 +
>  drivers/input/touchscreen/imx6ul_tsc.c | 504
> +
>  7 files changed, 583 insertions(+)
>  create mode 100644
> Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.txt
>  create mode 100644 drivers/input/touchscreen/imx6ul_tsc.c
> 
> --
> 1.9.1

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


RE: [RFC] sdhci: fix DMA leaks [was: [SHDCI] Heavy (thousands) DMA leaks]

2015-08-06 Thread Chen Bough
I will format a patch based on your diff file firstly. I will test this on my 
side,
If any issue, like dma issue or performance issue, I will add some modification.
Then I will send the patch for review, and you can test the patch on your 
platform.

Best Regards
Haibo Chen


> -Original Message-
> From: Jiri Slaby [mailto:jsl...@suse.cz]
> Sent: Thursday, August 06, 2015 5:07 PM
> To: Chen Haibo-B51421; Ulf Hansson
> Cc: linux-...@vger.kernel.org; Linux kernel mailing list
> Subject: Re: [RFC] sdhci: fix DMA leaks [was: [SHDCI] Heavy (thousands)
> DMA leaks]
> 
> On 08/06/2015, 09:42 AM, Chen Bough wrote:
> > I read your attached log and patch, yes, dma memory leak will happen
> > when more than one pre_request execute. The method of ++next->cookie
> > is not good, your patch seems good, but I still need some time to test
> > the patch, because you unmap the dma in sdhci_finish_data rather than
> the sdhci_post_req.
> 
> Hi,
> 
> yes, this is not correct. We can perhaps differentiate according to the
> COOKIE value. Should I fix it or are you going to prepare a patch based
> on my RFC?
> 
> thanks,
> --
> js
> suse labs
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: [RFC] sdhci: fix DMA leaks [was: [SHDCI] Heavy (thousands) DMA leaks]

2015-08-06 Thread Chen Bough
Hi Js,

I read your attached log and patch, yes, dma memory leak will happen when
more than one pre_request execute. The method of ++next->cookie is not good,
your patch seems good, but I still need some time to test the patch, because
you unmap the dma in sdhci_finish_data rather than the sdhci_post_req.

Anyway, thanks for report and debug this issue. I will give you my test result
ASAP.  

Best Regards
Haibo Chen


> -Original Message-
> From: Jiri Slaby [mailto:jsl...@suse.cz]
> Sent: Wednesday, August 05, 2015 11:12 PM
> To: Chen Haibo-B51421; Ulf Hansson
> Cc: linux-...@vger.kernel.org; Linux kernel mailing list
> Subject: [RFC] sdhci: fix DMA leaks [was: [SHDCI] Heavy (thousands) DMA
> leaks]
> 
> On 08/05/2015, 01:52 PM, Jiri Slaby wrote:
> >> Yes, I see:
> >> sdhci-pci :02:00.0: swiotlb buffer is full (sz: 65536 bytes)
> >> after some time. The driver falls back to non-DMA transfers after that.
> >> It also generates a warning about that:
> >> WARNING: CPU: 0 PID: 0 at drivers/mmc/host/sdhci.c:857
> >> sdhci_prepare_data+0x8ec/0x900 [sdhci]()
> >
> > I am attaching a debug patch and a debug log. You can see where
> > 0xfffb and 0xfffe is leaked. It is when
> > 'invalid cookie' error happens.
> 
> And you could see the cookie handling is totally bogus.
> 
> With this rewrite, I no longer see the problems. Could you confirm it
> still does the good job with respect to performance -- the numbers you
> mentioned in your commit.
> 
> Ulf, what do you think about the attached patch? (Do not look at the
> commented info prints.)
> 
> thanks,
> --
> js
> suse labs


RE: [SHDCI] Heavy (thousands) DMA leaks

2015-08-03 Thread Chen Bough
Hi Js,

I carefully review my patch, all the DMA memory mapped in sdhci_pre_req() is 
unmapped in sdhci_post_req.

Can you provide the method of your testing DMA leaks?  You said over 4000 
leaked mappings during one card transfer, if true, 
We can't map any dma memory after some sd transfer, do you meet this?


Best Regards
Haibo Chen



> -Original Message-
> From: Jiri Slaby [mailto:jsl...@suse.cz]
> Sent: Thursday, July 30, 2015 5:32 PM
> To: Chen Haibo-B51421
> Cc: Ulf Hansson; linux-...@vger.kernel.org; Linux kernel mailing list
> Subject: [SHDCI] Heavy (thousands) DMA leaks
> 
> Hi,
> 
> after
> commit 348487cb28e66b032bae1b38424d81bf5b08
> Author: Haibo Chen 
> Date:   Tue Dec 9 17:04:05 2014 +0800
> 
> mmc: sdhci: use pipeline mmc requests to improve performance
> 
> I see heavy DMA leaks which result in warnings of the dma api debug code:
> WARNING: CPU: 0 PID: 0 at lib/dma-debug.c:509 add_dma_entry+0x138/0x150()
> DMA-API: exceeded 7 overlapping mappings of cacheline 0x0b20ec00
> 
> 
> 
> And mainly this one upon sdhci module removal. It is over 4000 leaked
> mappings during one card transfer.
> mmc0: card e624 removed
> [ cut here ]
> WARNING: CPU: 2 PID: 1263 at lib/dma-debug.c:974
> dma_debug_device_change+0x158/0x1c0()
> pci :02:00.0: DMA-API: device driver has pending DMA allocations
> while released from device [count=4041] One of leaked entries details:
> [device address=0xddff]
> [size=65536 bytes] [mapped with DMA_FROM_DEVICE] [mapped as scather-
> gather] Modules linked in:
> CPU: 2 PID: 1263 Comm: bash Tainted: GW   4.2.0-rc4 #12
> Hardware name: LENOVO 23252SG/23252SG, BIOS G2ET33WW (1.13 ) 07/24/2012
>  81cc5e32 8800d03c3b68 81820938 
>  8800d03c3bb8 8800d03c3ba8 810b827a 000100260021
>  88030e50 0fc9 88030d95aeb8 88030e4ddd68 Call
> Trace:
>  [] dump_stack+0x4c/0x6e  []
> warn_slowpath_common+0x8a/0xc0  []
> warn_slowpath_fmt+0x46/0x50  []
> dma_debug_device_change+0x158/0x1c0
>  [] notifier_call_chain+0x4d/0x80  []
> __blocking_notifier_call_chain+0x4d/0x70
>  [] blocking_notifier_call_chain+0x16/0x20
>  [] __device_release_driver+0x105/0x130
>  [] device_release_driver+0x23/0x30
> [] unbind_store+0xba/0xe0  [] ?
> kernfs_fop_write+0xe8/0x170  []
> drv_attr_store+0x24/0x30  [] sysfs_kf_write+0x3a/0x50
> [] kernfs_fop_write+0x120/0x170  []
> __vfs_write+0x28/0xe0  [] ? __sb_start_write+0x49/0xe0
> [] ? local_clock+0x25/0x30  []
> vfs_write+0xa1/0x170  [] ? vtime_account_user+0x54/0x60
> [] SyS_write+0x46/0xa0  [] ?
> context_tracking_user_exit+0x13/0x20
>  [] entry_SYSCALL_64_fastpath+0x12/0x6a
> ---[ end trace 398181ad32332b33 ]---
> Mapped at:
>  [] debug_dma_map_sg+0x122/0x140  []
> sdhci_pre_dma_transfer+0xc3/0x1b0  []
> sdhci_pre_req+0x42/0x70  [] mmc_pre_req+0x42/0x60
> [] mmc_start_req+0x3e/0x400
> 
> I already fixed one symptom -- memory corruption. Could you revisit the
> commit once again, as there is surely at least one more bug?
> 
> thanks,
> --
> js
> suse labs
--
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: [SHDCI] Heavy (thousands) DMA leaks

2015-07-30 Thread Chen Bough
Hi Jiri,

I will check this issue ASAP, thanks for report this!


Best Regards
Haibo Chen


> -Original Message-
> From: Jiri Slaby [mailto:jsl...@suse.cz]
> Sent: Thursday, July 30, 2015 5:32 PM
> To: Chen Haibo-B51421
> Cc: Ulf Hansson; linux-...@vger.kernel.org; Linux kernel mailing list
> Subject: [SHDCI] Heavy (thousands) DMA leaks
> 
> Hi,
> 
> after
> commit 348487cb28e66b032bae1b38424d81bf5b08
> Author: Haibo Chen 
> Date:   Tue Dec 9 17:04:05 2014 +0800
> 
> mmc: sdhci: use pipeline mmc requests to improve performance
> 
> I see heavy DMA leaks which result in warnings of the dma api debug code:
> WARNING: CPU: 0 PID: 0 at lib/dma-debug.c:509 add_dma_entry+0x138/0x150()
> DMA-API: exceeded 7 overlapping mappings of cacheline 0x0b20ec00
> 
> 
> 
> And mainly this one upon sdhci module removal. It is over 4000 leaked
> mappings during one card transfer.
> mmc0: card e624 removed
> [ cut here ]
> WARNING: CPU: 2 PID: 1263 at lib/dma-debug.c:974
> dma_debug_device_change+0x158/0x1c0()
> pci :02:00.0: DMA-API: device driver has pending DMA allocations
> while released from device [count=4041] One of leaked entries details:
> [device address=0xddff]
> [size=65536 bytes] [mapped with DMA_FROM_DEVICE] [mapped as scather-
> gather] Modules linked in:
> CPU: 2 PID: 1263 Comm: bash Tainted: GW   4.2.0-rc4 #12
> Hardware name: LENOVO 23252SG/23252SG, BIOS G2ET33WW (1.13 ) 07/24/2012
>  81cc5e32 8800d03c3b68 81820938 
>  8800d03c3bb8 8800d03c3ba8 810b827a 000100260021
>  88030e50 0fc9 88030d95aeb8 88030e4ddd68 Call
> Trace:
>  [] dump_stack+0x4c/0x6e  []
> warn_slowpath_common+0x8a/0xc0  []
> warn_slowpath_fmt+0x46/0x50  []
> dma_debug_device_change+0x158/0x1c0
>  [] notifier_call_chain+0x4d/0x80  []
> __blocking_notifier_call_chain+0x4d/0x70
>  [] blocking_notifier_call_chain+0x16/0x20
>  [] __device_release_driver+0x105/0x130
>  [] device_release_driver+0x23/0x30
> [] unbind_store+0xba/0xe0  [] ?
> kernfs_fop_write+0xe8/0x170  []
> drv_attr_store+0x24/0x30  [] sysfs_kf_write+0x3a/0x50
> [] kernfs_fop_write+0x120/0x170  []
> __vfs_write+0x28/0xe0  [] ? __sb_start_write+0x49/0xe0
> [] ? local_clock+0x25/0x30  []
> vfs_write+0xa1/0x170  [] ? vtime_account_user+0x54/0x60
> [] SyS_write+0x46/0xa0  [] ?
> context_tracking_user_exit+0x13/0x20
>  [] entry_SYSCALL_64_fastpath+0x12/0x6a
> ---[ end trace 398181ad32332b33 ]---
> Mapped at:
>  [] debug_dma_map_sg+0x122/0x140  []
> sdhci_pre_dma_transfer+0xc3/0x1b0  []
> sdhci_pre_req+0x42/0x70  [] mmc_pre_req+0x42/0x60
> [] mmc_start_req+0x3e/0x400
> 
> I already fixed one symptom -- memory corruption. Could you revisit the
> commit once again, as there is surely at least one more bug?
> 
> thanks,
> --
> js
> suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 2/5] Documentation: Detail permitted DT properties for the imx6ul_tsc

2015-07-28 Thread Chen Bough
Hi Mark,



> -Original Message-
> From: Mark Rutland [mailto:mark.rutl...@arm.com]
> Sent: Monday, July 27, 2015 7:26 PM
> To: Chen Haibo-B51421
> Cc: robh...@kernel.org; Pawel Moll; ijc+devicet...@hellion.org.uk;
> ga...@codeaurora.org; shawn...@kernel.org; ker...@pengutronix.de;
> li...@arm.linux.org.uk; dmitry.torok...@gmail.com; hans.verk...@cisco.com;
> had...@hadess.net; mche...@osg.samsung.com; mamli...@gmail.com;
> a...@arndb.de; jonat...@broadcom.com; hdego...@redhat.com;
> christian.gmei...@gmail.com; scott@emc.com.tw; ge...@linux-m68k.org;
> benjamin.tissoi...@redhat.com; sebastien.szyman...@armadeus.com;
> sbran...@broadcom.com; devicet...@vger.kernel.org; linux-
> ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux-
> in...@vger.kernel.org
> Subject: Re: [PATCH 2/5] Documentation: Detail permitted DT properties
> for the imx6ul_tsc
> 
> On Mon, Jul 27, 2015 at 12:26:44PM +0100, Haibo Chen wrote:
> > Here we apply required documentation for the imx6ul touch screen
> > controller driver which describe available properties and how to use
> > them.
> >
> > Signed-off-by: Haibo Chen 
> > ---
> >  .../devicetree/bindings/input/touchscreen/imx6ul_tsc.txt   | 14
> ++
> >  1 file changed, 14 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.txt
> >
> > diff --git
> > a/Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.txt
> > b/Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.txt
> > new file mode 100644
> > index 000..e34d752
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/imx6ul_tsc.t
> > +++ xt
> > @@ -0,0 +1,14 @@
> > +* Freescale i.MX6UL Touch Controller
> > +
> > +Required properties:
> > +- compatible: must be "fsl,imx6ul-tsc"
> > +
> 
> What about all the other properties in the example?

[haibo] I will add other properties in the documentation. 

> 
> > +Example:
> > +   &tsc {
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <&pinctrl_tsc>;
> > +   status = "okay";
> > +   xnur-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
> > +   measure_delay_time = <0xfff>;
> > +   pre_charge_time = <0x>;
> 
> Thiose underscores should be dashes, and all the properties should be
> documented.

[haibo] I will change to "measure-delay-time" and "pre-charge-time"

Thanks for your review!

Haibo.

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


RE: [PATCH 1/5] input: touchscreen: add imx6ul_tsc driver support

2015-07-28 Thread Chen Bough

Hi Dmitry,

Thanks for your careful review! My comments is following.


Best Regards

Haibo Chen


> -Original Message-
> From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com]
> Sent: Tuesday, July 28, 2015 6:05 AM
> To: Chen Haibo-B51421
> Cc: robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com;
> ijc+devicet...@hellion.org.uk; ga...@codeaurora.org; shawn...@kernel.org;
> ker...@pengutronix.de; li...@arm.linux.org.uk; hans.verk...@cisco.com;
> had...@hadess.net; mche...@osg.samsung.com; mamli...@gmail.com;
> a...@arndb.de; jonat...@broadcom.com; hdego...@redhat.com;
> christian.gmei...@gmail.com; scott@emc.com.tw; ge...@linux-m68k.org;
> benjamin.tissoi...@redhat.com; sebastien.szyman...@armadeus.com;
> sbran...@broadcom.com; devicet...@vger.kernel.org; linux-
> ker...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; linux-
> in...@vger.kernel.org
> Subject: Re: [PATCH 1/5] input: touchscreen: add imx6ul_tsc driver
> support
> 
> Hi Haibo,
> 
> On Mon, Jul 27, 2015 at 07:26:43PM +0800, Haibo Chen wrote:
> > Freescale i.MX6UL contains a internal touchscreen controller, this
> > patch add a driver to support this controller.
> >
> > Signed-off-by: Haibo Chen 
> > ---
> >  drivers/input/touchscreen/Kconfig  |  12 +
> >  drivers/input/touchscreen/Makefile |   1 +
> >  drivers/input/touchscreen/imx6ul_tsc.c | 510
> > +
> >  3 files changed, 523 insertions(+)
> >  create mode 100644 drivers/input/touchscreen/imx6ul_tsc.c
> >
> > diff --git a/drivers/input/touchscreen/Kconfig
> > b/drivers/input/touchscreen/Kconfig
> > index 5b272ba..32c300d 100644
> > --- a/drivers/input/touchscreen/Kconfig
> > +++ b/drivers/input/touchscreen/Kconfig
> > @@ -479,6 +479,18 @@ config TOUCHSCREEN_MTOUCH
> >   To compile this driver as a module, choose M here: the
> >   module will be called mtouch.
> >
> > +config TOUCHSCREEN_IMX6UL_TSC
> > +   tristate "Freescale i.MX6UL touchscreen controller"
> > +   depends on OF
> > +   help
> > + Say Y here if you have a Freescale i.MX6UL, and want to
> > + use the internal touchscreen controller.
> > +
> > + If unsure, say N.
> > +
> > + To compile this driver as a module, choose M here: the
> > + moduel will be called imx6ul_tsc.
> > +
> >  config TOUCHSCREEN_INEXIO
> > tristate "iNexio serial touchscreens"
> > select SERIO
> > diff --git a/drivers/input/touchscreen/Makefile
> > b/drivers/input/touchscreen/Makefile
> > index c85aae2..9379b32 100644
> > --- a/drivers/input/touchscreen/Makefile
> > +++ b/drivers/input/touchscreen/Makefile
> > @@ -38,6 +38,7 @@ obj-$(CONFIG_TOUCHSCREEN_EGALAX)  += egalax_ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_FUJITSU)  += fujitsu_ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_GOODIX)   += goodix.o
> >  obj-$(CONFIG_TOUCHSCREEN_ILI210X)  += ili210x.o
> > +obj-$(CONFIG_TOUCHSCREEN_IMX6UL_TSC)   += imx6ul_tsc.o
> >  obj-$(CONFIG_TOUCHSCREEN_INEXIO)   += inexio.o
> >  obj-$(CONFIG_TOUCHSCREEN_INTEL_MID)+= intel-mid-touch.o
> >  obj-$(CONFIG_TOUCHSCREEN_IPROC)+= bcm_iproc_tsc.o
> > diff --git a/drivers/input/touchscreen/imx6ul_tsc.c
> > b/drivers/input/touchscreen/imx6ul_tsc.c
> > new file mode 100644
> > index 000..5a5a368
> > --- /dev/null
> > +++ b/drivers/input/touchscreen/imx6ul_tsc.c
> > @@ -0,0 +1,510 @@
> > +/*
> > + * Freescale i.MX6UL touchscreen controller driver
> > + *
> > + * Copyright (C) 2015 Freescale Semiconductor, Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or
> > +modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/* ADC configuration registers field define */
> > +#define ADC_AIEN   (0x1 << 7)
> > +#define ADC_CONV_DISABLE   0x1F
> > +#define ADC_CAL(0x1 << 7)
> > +#define ADC_CALF   0x2
> > +#define ADC_12BIT_MODE (0x2 << 2)
> > +#define ADC_IPG_CLK0x00
> > +#define ADC_CLK_DIV_8  (0x03 << 5)
> > +#define ADC_SHORT_SAMPLE_MODE  (0x0 << 4)
> > +#define ADC_HARDWARE_TRIGGER   (0x1 << 13)
> > +#define SELECT_CHANNEL_4   0x04
> > +#define SELECT_CHANNEL_1   0x01
> > +#define DISABLE_CONVERSION_INT (0x0 << 7)
> > +
> > +/* ADC registers */
> > +#define REG_ADC_HC00x00
> > +#define REG_ADC_HC10x04
> > +#define REG_ADC_HC20x08
> > +#define REG_ADC_HC30x0C
> > +#define REG_ADC_HC40x10
> > +#define REG_ADC_HS 0x14
> > +#define REG_ADC_R0 0x18
> > +#define REG_ADC_CFG0x2C
> > +#define REG_ADC_GC 0x30
> > +#define REG_ADC_GS 0x34
> > +
> > +#define 

RE: [PATCH 5/5] ARM: dts: imx6ul-14x14-evk.dts: add tsc support

2015-07-28 Thread Chen Bough


> -Original Message-
> From: Shawn Guo [mailto:shawn...@kernel.org]
> Sent: Monday, July 27, 2015 10:13 PM
> To: Chen Haibo-B51421
> Cc: robh...@kernel.org; pawel.m...@arm.com; mark.rutl...@arm.com;
> ijc+devicet...@hellion.org.uk; ga...@codeaurora.org;
> ker...@pengutronix.de; li...@arm.linux.org.uk; dmitry.torok...@gmail.com;
> devicet...@vger.kernel.org; sbran...@broadcom.com; a...@arndb.de;
> mche...@osg.samsung.com; christian.gmei...@gmail.com;
> scott@emc.com.tw; linux-kernel@vger.kernel.org; hdego...@redhat.com;
> jonat...@broadcom.com; benjamin.tissoi...@redhat.com;
> hans.verk...@cisco.com; had...@hadess.net; linux-in...@vger.kernel.org;
> ge...@linux-m68k.org; sebastien.szyman...@armadeus.com;
> mamli...@gmail.com; linux-arm-ker...@lists.infradead.org
> Subject: Re: [PATCH 5/5] ARM: dts: imx6ul-14x14-evk.dts: add tsc support
> 
> On Mon, Jul 27, 2015 at 07:26:47PM +0800, Haibo Chen wrote:
> > Add touch screen surpport for i.MX6UL-EVK board.
> >
> > Signed-off-by: Haibo Chen 
> > ---
> >  arch/arm/boot/dts/imx6ul-14x14-evk.dts | 18 ++
> >  1 file changed, 18 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dts
> b/arch/arm/boot/dts/imx6ul-14x14-evk.dts
> > index 61b41ee..323d32d 100644
> > --- a/arch/arm/boot/dts/imx6ul-14x14-evk.dts
> > +++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dts
> > @@ -44,6 +44,15 @@
> > soc-supply = <®_soc>;
> >  };
> >
> > +&tsc {
> > +   pinctrl-names = "default";
> > +   pinctrl-0 = <&pinctrl_tsc>;
> > +   status = "okay";
> 
> We generally have "status" at the bottom of the property list.
> 
> Shawn
>
 
[haibo] Yes, it's my negligence, I will amend this.

> > +   xnur-gpio = <&gpio1 3 0>;
> > +   measure_delay_time = <0x>;
> > +   pre_charge_time = <0xfff>;
> > +};
> > +
> >  &uart1 {
> > pinctrl-names = "default";
> > pinctrl-0 = <&pinctrl_uart1>;
> > @@ -212,6 +221,15 @@
> > >;
> > };
> >
> > +   pinctrl_tsc: tscgrp {
> > +   fsl,pins = <
> > +   MX6UL_PAD_GPIO1_IO01__GPIO1_IO010xb0
> > +   MX6UL_PAD_GPIO1_IO02__GPIO1_IO020xb0
> > +   MX6UL_PAD_GPIO1_IO03__GPIO1_IO030xb0
> > +   MX6UL_PAD_GPIO1_IO04__GPIO1_IO040xb0
> > +   >;
> > +   };
> > +
> > pinctrl_uart1: uart1grp {
> > fsl,pins = <
> > MX6UL_PAD_UART1_TX_DATA__UART1_DCE_TX 0x1b0b1
> > --
> > 1.9.1
> >
> >
> > ___
> > linux-arm-kernel mailing list
> > linux-arm-ker...@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
--
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/