Re: [PATCH 1/9] Staging: bcm: DDRInit: Replaced spaces with tabs.

2013-12-07 Thread Dan Carpenter
This breaks the build...  :(

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/9] Staging: bcm: DDRInit: replaced multiple tabs with tab.

2013-12-07 Thread Dan Carpenter
On Fri, Dec 06, 2013 at 11:35:45PM -0500, Gary Rookard wrote:
> This is second in a series of patches.

This is not useful information.  Each patch is it's own thing.  If you
want to describe the patch series as a whole then send a [patch 0/9]
email.

regards,
dan carpenter

> 
> Signed-off-by: Gary Alan Rookard 
> ---
> On branch staging-next
>  drivers/staging/bcm/DDRInit.c | 910 
> +-
>  1 file changed, 455 insertions(+), 455 deletions(-)
> 
> diff --git a/drivers/staging/bcm/DDRInit.c b/drivers/staging/bcm/DDRInit.c
> index f550567..e014759 100644
> --- a/drivers/staging/bcm/DDRInit.c
> +++ b/drivers/staging/bcm/DDRInit.c
> @@ -248,286 +248,286 @@ static struct bcm_ddr_setting 
> asT3B_DDRSetting133MHz[] = {//  # DPLL Clock S
>  
>  #define T3B_SKIP_CLOCK_PROGRAM_DUMP_80MHZ 9  //index for 0x0F007000
>  static struct bcm_ddr_setting asT3B_DDRSetting80MHz[] = {//   # DPLL 
> Clock Setting
> - 
> {0x0f000810,0x0F95},
> - 
> {0x0f000820,0x07F13FFF},
> - 
> {0x0f000840,0x0FFF1F00},
> - 
> {0x0f000880,0x03DD},
> - 
> {0x0f000860,0x},
> + {0x0f000810,0x0F95},
> + {0x0f000820,0x07F13FFF},
> + {0x0f000840,0x0FFF1F00},
> + {0x0f000880,0x03DD},
> + {0x0f000860,0x},
>  
> - 
> {0x0F00a044,0x1fff},
> - 
> {0x0F00a040,0x1f00},
> - 
> {0x0F00a084,0x1Cff},
> - 
> {0x0F00a080,0x1C00},
> - 
> {0x0F00a000,0x0016},
> + {0x0F00a044,0x1fff},
> + {0x0F00a040,0x1f00},
> + {0x0F00a084,0x1Cff},
> + {0x0F00a080,0x1C00},
> + {0x0F00a000,0x0016},
>   
> //Memcontroller Default values
> - 
> {0x0F007000,0x00010001},
> - 
> {0x0F007004,0x0100},
> - 
> {0x0F007008,0x0101},
> - 
> {0x0F00700c,0x},
> - 
> {0x0F007010,0x0100},
> - 
> {0x0F007014,0x01000100},
> - 
> {0x0F007018,0x0100},
> - 
> {0x0F00701c,0x0102},
> - 
> {0x0F007020,0x04020107},
> - 
> {0x0F007024,0x0007},
> - 
> {0x0F007028,0x02020201},
> - 
> {0x0F00702c,0x0204040a},
> - 
> {0x0F007030,0x0400},
> - 
> {0x0F007034,0x0202},
> - 
> {0x0F007038,0x1F060202},
> - 
> {0x0F00703C,0x1C1F},
> - 
> {0x0F007040,0x8A006600},
> - 
> {0x0F007044,0x221a0800},
> - 
> {0x0F007048,0x02690204},
> - 
> {0x0F00704c,0x},
> - 
> {0x0F007050,0x011c},
> - 
> {0x0F007054,0x},
> - 
> {0x0F007058,0x},
> -

Re: [PATCH 5/9] Staging: bcm: DDRInit: replaced C99 comments.

2013-12-07 Thread Dan Carpenter
On Fri, Dec 06, 2013 at 11:52:35PM -0500, Gary Rookard wrote:
> This is the fifth patch of a series.
> 
> Signed-off-by: Gary Alan Rookard 
> ---
> On branch staging-next
>  drivers/staging/bcm/DDRInit.c | 270 
> +-
>  1 file changed, 135 insertions(+), 135 deletions(-)
> 
> diff --git a/drivers/staging/bcm/DDRInit.c b/drivers/staging/bcm/DDRInit.c
> index cb4dd53..1a08b17 100644
> --- a/drivers/staging/bcm/DDRInit.c
> +++ b/drivers/staging/bcm/DDRInit.c
> @@ -5,15 +5,15 @@
>  #define DDR_DUMP_INTERNAL_DEVICE_MEMORY 0xBFC02B00
>  #define MIPS_CLOCK_REG   0x0f000820
>  
> -//DDR INIT-133Mhz
> -#define T3_SKIP_CLOCK_PROGRAM_DUMP_133MHZ 12  //index for 0x0F007000
> -static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = {//  # DPLL 
> Clock Setting
> +/* DDR INIT-133Mhz */
> +#define T3_SKIP_CLOCK_PROGRAM_DUMP_133MHZ 12  /* index for 0x0F00700 */0
^^^

This also breaks the build...  :(  Really, this is not ok.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 5/9] Staging: bcm: DDRInit: replaced C99 comments.

2013-12-07 Thread Levente Kurusa

Hi,

A few comments, see below please.

2013-12-07 05:52, Gary Rookard:

This is the fifth patch of a series.

Signed-off-by: Gary Alan Rookard 
---
On branch staging-next
  drivers/staging/bcm/DDRInit.c | 270 +-
  1 file changed, 135 insertions(+), 135 deletions(-)

diff --git a/drivers/staging/bcm/DDRInit.c b/drivers/staging/bcm/DDRInit.c
index cb4dd53..1a08b17 100644
--- a/drivers/staging/bcm/DDRInit.c
+++ b/drivers/staging/bcm/DDRInit.c
@@ -5,15 +5,15 @@
  #define DDR_DUMP_INTERNAL_DEVICE_MEMORY 0xBFC02B00
  #define MIPS_CLOCK_REG0x0f000820

-//DDR INIT-133Mhz
-#define T3_SKIP_CLOCK_PROGRAM_DUMP_133MHZ 12  //index for 0x0F007000
-static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = {//  # DPLL Clock 
Setting
+/* DDR INIT-133Mhz */
+#define T3_SKIP_CLOCK_PROGRAM_DUMP_133MHZ 12  /* index for 0x0F00700 */0
+static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = { /* # DPLL Clock 
Setting */


Why not remove the '#'? It is useless and never used anywhere else.
There is a /0 after... Have you build-test it?


@@ -29,17 +29,17 @@ static struct bcm_ddr_setting asT3_DDRSetting133MHz[] = {// 
 # DPLL Clock Se
{0x0F007010, 0x0100},
{0x0F007014, 0x01000100},
{0x0F007018, 0x0100},
-   {0x0F00701c, 0x01020001},// POP - 0x00020001 Normal 0x01020001
-   {0x0F007020, 0x04030107}, //Normal - 0x04030107 POP - 0x05030107
+   {0x0F00701c, 0x01020001},/*  POP - 0x00020001 Normal 0x01020001 */
+   {0x0F007020, 0x04030107}, /* Normal - 0x04030107 POP - 0x05030107 */
{0x0F007024, 0x0207},
{0x0F007028, 0x02020202},
-   {0x0F00702c, 0x0206060a},//ROB- 0x0205050a,//0x0206060a
+   {0x0F00702c, 0x0206060a},/* ROB- 0x0205050a,0x0206060a */
{0x0F007030, 0x0500},
{0x0F007034, 0x0003};
-   {0x0F007038, 0x110a0200},//ROB - 0x110a0200,//0x180a0200,// 0x1f0a0200
-   {0x0F00703C, 0x02101010},//ROB - 0x02101010,//0x02101018},
-   {0x0F007040, 0x45751200},//ROB - 0x45751200,//0x450f1200},
-   {0x0F007044, 0x110a0d00},//ROB - 0x110a0d00//0x111f0d00
+   {0x0F007038, 0x110a0200},/* ROB - 0x110a0200,0x180a0200,0x1f0a0200 */
+   {0x0F00703C, 0x02101010},/* ROB - 0x02101010,0x02101018}, */
+   {0x0F007040, 0x45751200},/* ROB - 0x45751200,0x450f1200}, */
+   {0x0F007044, 0x110a0d00},/*ROB - 0x110a0d00.0x111f0d00 */


No space after '/*'


@@ -112,19 +112,19 @@ static struct bcm_ddr_setting asT3_DDRSetting80MHz[] = 
{//   # DPLL Clock Settin
{0x0F007080, 0x},
{0x0F007084, 0x},
{0x0F007094, 0x0104},
-//# Enable start bit within memory 
controller
+/*# Enable start bit within memory 
controller */


Again, no space and there is that '#' which looks pretty bad.


--
Regards,
Levente Kurusa
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: TIDSPBRIDGE: Remove UUID helper

2013-12-07 Thread Ivajlo Dimitrov


On 06.12.2013 17:10, gre...@linuxfoundation.org wrote:

On Fri, Dec 06, 2013 at 08:05:38AM +0200, Ivajlo Dimitrov wrote:

Hi Greg,

On 01.12.2013 19:07, Ivaylo DImitrov wrote:

From: Ivaylo Dimitrov 

Custom uuid helper function is needed only in rmgr/dbdcd.c and doesn't
need to be exported. It can also be made way simpler by using sscanf.

Signed-off-by: Ivaylo Dimitrov 
---
   drivers/staging/tidspbridge/Makefile   |2 +-
   drivers/staging/tidspbridge/gen/uuidutil.c |   85 

   .../tidspbridge/include/dspbridge/uuidutil.h   |   18 
   drivers/staging/tidspbridge/rmgr/dbdcd.c   |   42 +-
   4 files changed, 39 insertions(+), 108 deletions(-)
   delete mode 100644 drivers/staging/tidspbridge/gen/uuidutil.c


I guess the initial mail somehow didn't make it through your spam filter:
https://lkml.org/lkml/2013/12/1/70

It did, but I thought that people asked for it to be changed in the
thread afterwards, so I was expecting an updated version from you.

Care to fix things up and resend it?

thanks,

greg k-h


Sure, the change I was asked for is trivial, but I didn't get the reason 
why it is needed. Neither there is a reply to my follow-up comment [0]. 
Sorry, I am pretty much new on LKML and could miss things that are 
supposed to be clear from the start, but my impression is that when 
someone says "it is better", he/she should explain why it is better or 
at least what is wrong with the patch he/she wants  to be changed.


However, I don't want to enter some arguing loop, so if you think I 
should change the code as per Joe's comment, just confirm it and I'll do it.


Thanks,
Ivo

[0] https://lkml.org/lkml/2013/12/1/113
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/11] Staging: bcm: DDRInint: tidy up indent issue.

2013-12-07 Thread Gary Rookard
This is the eleventh patch of a series.

Signed-off-by: Gary Alan Rookard 
---
On branch staging-next
 drivers/staging/bcm/DDRInit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/bcm/DDRInit.c b/drivers/staging/bcm/DDRInit.c
index 96afa15..323570f 100644
--- a/drivers/staging/bcm/DDRInit.c
+++ b/drivers/staging/bcm/DDRInit.c
@@ -836,7 +836,7 @@ int ddr_init(struct bcm_mini_adapter *Adapter)
case DDR_100_MHZ:
psDDRSetting = asT3B_DDRSetting100MHz;
RegCount = (sizeof(asT3B_DDRSetting100MHz)/
-   sizeof(struct bcm_ddr_setting));
+   sizeof(struct bcm_ddr_setting));
break;
case DDR_133_MHZ:
if (Adapter->bDPLLConfig == PLL_266_MHZ) {  /*266Mhz 
PLL selected. */
-- 
1.8.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/7 v2] staging: et131x: reduce split lines in et131x_config_rx_dma_regs

2013-12-07 Thread ZHAO Gang
Signed-off-by: ZHAO Gang 
---
 drivers/staging/et131x/et131x.c | 24 ++--
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index e3a71d3..f86e713 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -1821,6 +1821,7 @@ static void et131x_config_rx_dma_regs(struct 
et131x_adapter *adapter)
u32 __iomem *min_des;
u32 __iomem *base_hi;
u32 __iomem *base_lo;
+   struct fbr_lookup *fbr = rx_local->fbr[id];
 
if (id == 0) {
num_des = &rx_dma->fbr0_num_des;
@@ -1837,12 +1838,10 @@ static void et131x_config_rx_dma_regs(struct 
et131x_adapter *adapter)
}
 
/* Now's the best time to initialize FBR contents */
-   fbr_entry =
-   (struct fbr_desc *) rx_local->fbr[id]->ring_virtaddr;
-   for (entry = 0;
-entry < rx_local->fbr[id]->num_entries; entry++) {
-   fbr_entry->addr_hi = rx_local->fbr[id]->bus_high[entry];
-   fbr_entry->addr_lo = rx_local->fbr[id]->bus_low[entry];
+   fbr_entry = (struct fbr_desc *) fbr->ring_virtaddr;
+   for (entry = 0; entry < fbr->num_entries; entry++) {
+   fbr_entry->addr_hi = fbr->bus_high[entry];
+   fbr_entry->addr_lo = fbr->bus_low[entry];
fbr_entry->word2 = entry;
fbr_entry++;
}
@@ -1850,19 +1849,16 @@ static void et131x_config_rx_dma_regs(struct 
et131x_adapter *adapter)
/* Set the address and parameters of Free buffer ring 1 and 0
 * into the 1310's registers
 */
-   writel(upper_32_bits(rx_local->fbr[id]->ring_physaddr),
-  base_hi);
-   writel(lower_32_bits(rx_local->fbr[id]->ring_physaddr),
-  base_lo);
-   writel(rx_local->fbr[id]->num_entries - 1, num_des);
+   writel(upper_32_bits(fbr->ring_physaddr), base_hi);
+   writel(lower_32_bits(fbr->ring_physaddr), base_lo);
+   writel(fbr->num_entries - 1, num_des);
writel(ET_DMA10_WRAP, full_offset);
 
/* This variable tracks the free buffer ring 1 full position,
 * so it has to match the above.
 */
-   rx_local->fbr[id]->local_full = ET_DMA10_WRAP;
-   writel(((rx_local->fbr[id]->num_entries *
-   LO_MARK_PERCENT_FOR_RX) / 100) - 1,
+   fbr->local_full = ET_DMA10_WRAP;
+   writel(((fbr->num_entries * LO_MARK_PERCENT_FOR_RX) / 100) - 1,
   min_des);
}
 
-- 
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/7 v2] staging: et131x: reduce split lines in nic_return_rfd

2013-12-07 Thread ZHAO Gang
Signed-off-by: ZHAO Gang 
---
 drivers/staging/et131x/et131x.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index f925ce6..5c431c3 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -2499,11 +2499,13 @@ static void nic_return_rfd(struct et131x_adapter 
*adapter, struct rfd *rfd)
u16 buff_index = rfd->bufferindex;
u8 ring_index = rfd->ringindex;
unsigned long flags;
+   struct fbr_lookup *fbr = rx_local->fbr[ring_index];
 
/* We don't use any of the OOB data besides status. Otherwise, we
 * need to clean up OOB data
 */
-   if (buff_index < rx_local->fbr[ring_index]->num_entries) {
+   if (buff_index < fbr->num_entries) {
+   u32 free_buff_ring;
u32 __iomem *offset;
struct fbr_desc *next;
 
@@ -2514,22 +2516,20 @@ static void nic_return_rfd(struct et131x_adapter 
*adapter, struct rfd *rfd)
else
offset = &rx_dma->fbr1_full_offset;
 
-   next = (struct fbr_desc *)
-  (rx_local->fbr[ring_index]->ring_virtaddr) +
-   INDEX10(rx_local->fbr[ring_index]->local_full);
+   next = (struct fbr_desc *)(fbr->ring_virtaddr) +
+  INDEX10(fbr->local_full);
 
/* Handle the Free Buffer Ring advancement here. Write
 * the PA / Buffer Index for the returned buffer into
 * the oldest (next to be freed)FBR entry
 */
-   next->addr_hi = rx_local->fbr[ring_index]->bus_high[buff_index];
-   next->addr_lo = rx_local->fbr[ring_index]->bus_low[buff_index];
+   next->addr_hi = fbr->bus_high[buff_index];
+   next->addr_lo = fbr->bus_low[buff_index];
next->word2 = buff_index;
 
-   writel(bump_free_buff_ring(
- &rx_local->fbr[ring_index]->local_full,
- rx_local->fbr[ring_index]->num_entries - 1),
-  offset);
+   free_buff_ring = bump_free_buff_ring(&fbr->local_full,
+fbr->num_entries - 1);
+   writel(free_buff_ring, offset);
 
spin_unlock_irqrestore(&adapter->fbr_lock, flags);
} else {
-- 
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv2] iio: mxs-lradc: compute temperature from channel 8 and 9

2013-12-07 Thread Jonathan Cameron
On 12/06/13 19:31, Alexandre Belloni wrote:
> The mxs LRADC is able to read an internal die temperature sensor. The
> temperature has to be calculated from the value read on channel 8 and channel 
> 9.
> To be able to expose the result to hwmon, implement iio channel 8 as
> (channel 9 - channel 8). Then, implement IIO_CHAN_INFO_SCALE and
> IIO_CHAN_INFO_OFFSET so that it can be processed by hwmon through the in 
> kernel
> provider/consumer mechanism.
> 
> Signed-off-by: Alexandre Belloni 
> Signed-off-by: Maxime Ripard 
> Reviewed-by: Lars-Peter Clausen 
Thanks for doing the rebase. Applied to the togreg branch (initially pushed out 
as testing)
of iio.git


> ---
> Changes in v2:
>   - rebased on v3.13.0-rc3
> 
>  drivers/staging/iio/adc/mxs-lradc.c | 91 
> +++--
>  1 file changed, 78 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c 
> b/drivers/staging/iio/adc/mxs-lradc.c
> index e2dd7830b320..5a4499c3d22a 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -759,20 +759,11 @@ static void mxs_lradc_handle_touch(struct mxs_lradc 
> *lradc)
>  /*
>   * Raw I/O operations
>   */
> -static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
> - const struct iio_chan_spec *chan,
> - int *val, int *val2, long m)
> +static int mxs_lradc_read_single(struct iio_dev *iio_dev, int chan, int *val)
>  {
>   struct mxs_lradc *lradc = iio_priv(iio_dev);
>   int ret;
>  
> - if (m != IIO_CHAN_INFO_RAW)
> - return -EINVAL;
> -
> - /* Check for invalid channel */
> - if (chan->channel > LRADC_MAX_TOTAL_CHANS)
> - return -EINVAL;
> -
>   /*
>* See if there is no buffered operation in progess. If there is, simply
>* bail out. This can be improved to support both buffered and raw IO at
> @@ -797,7 +788,7 @@ static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
>  
>   /* Clean the slot's previous content, then set new one. */
>   mxs_lradc_reg_clear(lradc, LRADC_CTRL4_LRADCSELECT_MASK(0), 
> LRADC_CTRL4);
> - mxs_lradc_reg_set(lradc, chan->channel, LRADC_CTRL4);
> + mxs_lradc_reg_set(lradc, chan, LRADC_CTRL4);
>  
>   mxs_lradc_reg_wrt(lradc, 0, LRADC_CH(0));
>  
> @@ -824,6 +815,71 @@ err:
>   return ret;
>  }
>  
> +static int mxs_lradc_read_temp(struct iio_dev *iio_dev, int *val)
> +{
> + int ret, min, max;
> +
> + ret = mxs_lradc_read_single(iio_dev, 8, &min);
> + if (ret != IIO_VAL_INT)
> + return ret;
> +
> + ret = mxs_lradc_read_single(iio_dev, 9, &max);
> + if (ret != IIO_VAL_INT)
> + return ret;
> +
> + *val = max - min;
> +
> + return IIO_VAL_INT;
> +}
> +
> +static int mxs_lradc_read_raw(struct iio_dev *iio_dev,
> + const struct iio_chan_spec *chan,
> + int *val, int *val2, long m)
> +{
> + /* Check for invalid channel */
> + if (chan->channel > LRADC_MAX_TOTAL_CHANS)
> + return -EINVAL;
> +
> + switch (m) {
> + case IIO_CHAN_INFO_RAW:
> + if (chan->type == IIO_TEMP)
> + return mxs_lradc_read_temp(iio_dev, val);
> +
> + return mxs_lradc_read_single(iio_dev, chan->channel, val);
> +
> + case IIO_CHAN_INFO_SCALE:
> + if (chan->type == IIO_TEMP) {
> + /* From the datasheet, we have to multiply by 1.012 and
> +  * divide by 4
> +  */
> + *val = 0;
> + *val2 = 253000;
> + return IIO_VAL_INT_PLUS_MICRO;
> + }
> +
> + return -EINVAL;
> +
> + case IIO_CHAN_INFO_OFFSET:
> + if (chan->type == IIO_TEMP) {
> + /* The calculated value from the ADC is in Kelvin, we
> +  * want Celsius for hwmon so the offset is
> +  * -272.15 * scale
> +  */
> + *val = -1075;
> + *val2 = 691699;
> +
> + return IIO_VAL_INT_PLUS_MICRO;
> + }
> +
> + return -EINVAL;
> +
> + default:
> + break;
> + }
> +
> + return -EINVAL;
> +}
> +
>  static const struct iio_info mxs_lradc_iio_info = {
>   .driver_module  = THIS_MODULE,
>   .read_raw   = mxs_lradc_read_raw,
> @@ -1151,8 +1207,17 @@ static const struct iio_chan_spec 
> mxs_lradc_chan_spec[] = {
>   MXS_ADC_CHAN(5, IIO_VOLTAGE),
>   MXS_ADC_CHAN(6, IIO_VOLTAGE),
>   MXS_ADC_CHAN(7, IIO_VOLTAGE),   /* VBATT */
> - MXS_ADC_CHAN(8, IIO_TEMP),  /* Temp sense 0 */
> - MXS_ADC_CHAN(9, IIO_TEMP),  /* Temp sense 1 */
> + /* Combined Temperature sensors */
> + {
> + .type = IIO_TEMP,
> + .indexed = 1,
> + .scan_index = 8,
> + .info_mask_separat

[PATCH] Staging: android: fix parantheses coding style issue in alarm-dev.c

2013-12-07 Thread Preetam D'Souza
This patch fixes an unecessary return statement parantheses error
found in alarm-dev.c by the checkpatch.pl tool -- alarm-dev.c now has
no more errors/warnings!

Signed-off-by: Preetam D'Souza 
---
 drivers/staging/android/alarm-dev.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/alarm-dev.c 
b/drivers/staging/android/alarm-dev.c
index 647694f..ccf74ee 100644
--- a/drivers/staging/android/alarm-dev.c
+++ b/drivers/staging/android/alarm-dev.c
@@ -68,8 +68,8 @@ static struct devalarm alarms[ANDROID_ALARM_TYPE_COUNT];
  */
 static int is_wakeup(enum android_alarm_type type)
 {
-   return (type == ANDROID_ALARM_RTC_WAKEUP ||
-   type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP);
+   return type == ANDROID_ALARM_RTC_WAKEUP ||
+   type == ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP;
 }
 
 
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: TIDSPBRIDGE: Use vm_iomap_memory for mmap-ing instead of remap_pfn_range

2013-12-07 Thread Steven Luo
This patch causes problems with DSP codecs on OMAP3 devices running
Android -- specifically, when the decoder is cleaning up after itself,
munmap() of the mapped area fails, leading to a memory leak which
eventually crashes the system.

As far as I can tell, the code with this patch applied reduces to
(ignoring checks and such)

remap_pfn_range(vma, vma->vm_start,
(pdata->phys_mempool_base >> PAGE_SHIFT) + vma->vm_pgoff,
vma->vm_end - vma->vm_start,
vma->vm_page_prot);

whereas the original was

> - status = remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
> -  vma->vm_end - vma->vm_start,
> -  vma->vm_page_prot);

We're subtracting (pdata->phys_mempool_base >> PAGE_SHIFT) from
vma->vm_pgoff before calling vm_iomap_memory() to address the issue --
if that's satisfactory to everyone involved, I can submit the following
patch.

-Steven Luo

(please cc, not subscribed)

From: Steven Luo 
Date: Sat, 7 Dec 2013 02:11:20 -0800
Subject: [PATCH] tidspbridge: fix last patch to map same region of physical
 memory as before

Commit 559c71fe5dc3 ("Staging: TIDSPBRIDGE: Use vm_iomap_memory for
mmap-ing instead of remap_pfn_range") had the effect of inadvertently
shifting the start of the physical memory area mapped by
pdata->phys_mempool_base.  Correct this by subtracting that shift before
calling vm_iomap_memory() and adding it back afterwards.

Reported-by: Dheeraj CVR 
Signed-off-by: Steven Luo 
---
 drivers/staging/tidspbridge/rmgr/drv_interface.c |   29 +++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c 
b/drivers/staging/tidspbridge/rmgr/drv_interface.c
index 83cc3a5..d7f7d04 100644
--- a/drivers/staging/tidspbridge/rmgr/drv_interface.c
+++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c
@@ -258,6 +258,9 @@ err:
 /* This function maps kernel space memory to user space memory. */
 static int bridge_mmap(struct file *filp, struct vm_area_struct *vma)
 {
+   unsigned long base_pgoff;
+   int status;
+
struct omap_dsp_platform_data *pdata =
omap_dspbridge_dev->dev.platform_data;

@@ -269,9 +272,29 @@ static int bridge_mmap(struct file *filp, struct 
vm_area_struct *vma)
vma->vm_start, vma->vm_end, vma->vm_page_prot,
vma->vm_flags);
 
-   return vm_iomap_memory(vma,
-  pdata->phys_mempool_base,
-  pdata->phys_mempool_size);
+   /*
+* vm_iomap_memory() expects vma->vm_pgoff to be expressed as an offset
+* from the start of the physical memory pool, but we're called with
+* a pfn (physical page number) stored there instead.
+*
+* To avoid duplicating lots of tricky overflow checking logic,
+* temporarily convert vma->vm_pgoff to the offset vm_iomap_memory()
+* expects, but restore the original value once the mapping has been
+* created.
+*/
+   base_pgoff = pdata->phys_mempool_base >> PAGE_SHIFT;
+   if (vma->vm_pgoff < base_pgoff)
+   return -EINVAL;
+   vma->vm_pgoff -= base_pgoff;
+
+   status = vm_iomap_memory(vma,
+pdata->phys_mempool_base,
+pdata->phys_mempool_size);
+
+   /* Restore the original value of vma->vm_pgoff */
+   vma->vm_pgoff += base_pgoff;
+
+   return status;
 }
 
 static const struct file_operations bridge_fops = {
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: et131x: improve code consistency: access struct rx_ring

2013-12-07 Thread ZHAO Gang
Let all the code use a pointer called rx_ring to access struct rx_ring
members.

Signed-off-by: ZHAO Gang 
---
 drivers/staging/et131x/et131x.c | 48 +
 1 file changed, 20 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 477c9ed..b39abb9 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -811,20 +811,21 @@ static void et131x_rx_dma_enable(struct et131x_adapter 
*adapter)
 {
/* Setup the receive dma configuration register for normal operation */
u32 csr =  ET_RXDMA_CSR_FBR1_ENABLE;
+   struct rx_ring *rx_ring = &adapter->rx_ring;
 
-   if (adapter->rx_ring.fbr[1]->buffsize == 4096)
+   if (rx_ring->fbr[1]->buffsize == 4096)
csr |= ET_RXDMA_CSR_FBR1_SIZE_LO;
-   else if (adapter->rx_ring.fbr[1]->buffsize == 8192)
+   else if (rx_ring->fbr[1]->buffsize == 8192)
csr |= ET_RXDMA_CSR_FBR1_SIZE_HI;
-   else if (adapter->rx_ring.fbr[1]->buffsize == 16384)
+   else if (rx_ring->fbr[1]->buffsize == 16384)
csr |= ET_RXDMA_CSR_FBR1_SIZE_LO | ET_RXDMA_CSR_FBR1_SIZE_HI;
 
csr |= ET_RXDMA_CSR_FBR0_ENABLE;
-   if (adapter->rx_ring.fbr[0]->buffsize == 256)
+   if (rx_ring->fbr[0]->buffsize == 256)
csr |= ET_RXDMA_CSR_FBR0_SIZE_LO;
-   else if (adapter->rx_ring.fbr[0]->buffsize == 512)
+   else if (rx_ring->fbr[0]->buffsize == 512)
csr |= ET_RXDMA_CSR_FBR0_SIZE_HI;
-   else if (adapter->rx_ring.fbr[0]->buffsize == 1024)
+   else if (rx_ring->fbr[0]->buffsize == 1024)
csr |= ET_RXDMA_CSR_FBR0_SIZE_LO | ET_RXDMA_CSR_FBR0_SIZE_HI;
writel(csr, &adapter->regs->rxdma.csr);
 
@@ -2126,12 +2127,9 @@ static int et131x_rx_dma_memory_alloc(struct 
et131x_adapter *adapter)
u32 bufsize;
u32 pktstat_ringsize;
u32 fbr_chunksize;
-   struct rx_ring *rx_ring;
+   struct rx_ring *rx_ring = &adapter->rx_ring;
struct fbr_lookup *fbr;
 
-   /* Setup some convenience pointers */
-   rx_ring = &adapter->rx_ring;
-
/* Alloc memory for the lookup table */
rx_ring->fbr[0] = kmalloc(sizeof(struct fbr_lookup), GFP_KERNEL);
rx_ring->fbr[1] = kmalloc(sizeof(struct fbr_lookup), GFP_KERNEL);
@@ -2280,12 +2278,9 @@ static void et131x_rx_dma_memory_free(struct 
et131x_adapter *adapter)
u32 bufsize;
u32 pktstat_ringsize;
struct rfd *rfd;
-   struct rx_ring *rx_ring;
+   struct rx_ring *rx_ring = &adapter->rx_ring;
struct fbr_lookup *fbr;
 
-   /* Setup some convenience pointers */
-   rx_ring = &adapter->rx_ring;
-
/* Free RFDs and associated packet descriptors */
WARN_ON(rx_ring->num_ready_recv != rx_ring->num_rfd);
 
@@ -2334,7 +2329,7 @@ static void et131x_rx_dma_memory_free(struct 
et131x_adapter *adapter)
/* Free Packet Status Ring */
if (rx_ring->ps_ring_virtaddr) {
pktstat_ringsize = sizeof(struct pkt_stat_desc) *
-   adapter->rx_ring.psr_num_entries;
+   rx_ring->psr_num_entries;
 
dma_free_coherent(&adapter->pdev->dev, pktstat_ringsize,
rx_ring->ps_ring_virtaddr,
@@ -2364,10 +2359,7 @@ static int et131x_init_recv(struct et131x_adapter 
*adapter)
 {
struct rfd *rfd;
u32 rfdct;
-   struct rx_ring *rx_ring;
-
-   /* Setup some convenience pointers */
-   rx_ring = &adapter->rx_ring;
+   struct rx_ring *rx_ring = &adapter->rx_ring;
 
/* Setup each RFD */
for (rfdct = 0; rfdct < rx_ring->num_rfd; rfdct++) {
@@ -2650,11 +2642,12 @@ static void et131x_handle_recv_interrupt(struct 
et131x_adapter *adapter)
struct rfd *rfd = NULL;
u32 count = 0;
bool done = true;
+   struct rx_ring *rx_ring = &adapter->rx_ring;
 
/* Process up to available RFD's */
while (count < NUM_PACKETS_HANDLED) {
-   if (list_empty(&adapter->rx_ring.recv_list)) {
-   WARN_ON(adapter->rx_ring.num_ready_recv != 0);
+   if (list_empty(&rx_ring->recv_list)) {
+   WARN_ON(rx_ring->num_ready_recv != 0);
done = false;
break;
}
@@ -2678,19 +2671,19 @@ static void et131x_handle_recv_interrupt(struct 
et131x_adapter *adapter)
adapter->net_stats.rx_packets++;
 
/* Set the status on the packet, either resources or success */
-   if (adapter->rx_ring.num_ready_recv < RFD_LOW_WATER_MARK)
+   if (rx_ring->num_ready_recv < RFD_LOW_WATER_MARK)
dev_warn(&adapter->pdev->dev, "RFD's are running 
out\n");
 
count++;
}
 
if (count == NUM_PACKETS_HANDLED || !done) {
- 

[PATCH 2/2] staging: et131x: improve code consistency: access struct tx_ring

2013-12-07 Thread ZHAO Gang
Let all the code use a pointer called tx_ring to access struct tx_ring
members.

Signed-off-by: ZHAO Gang 
---
 drivers/staging/et131x/et131x.c | 190 
 1 file changed, 95 insertions(+), 95 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index b39abb9..3b959aa 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -1848,26 +1848,23 @@ static void et131x_config_rx_dma_regs(struct 
et131x_adapter *adapter)
 static void et131x_config_tx_dma_regs(struct et131x_adapter *adapter)
 {
struct txdma_regs __iomem *txdma = &adapter->regs->txdma;
+   struct tx_ring *tx_ring = &adapter->tx_ring;
 
/* Load the hardware with the start of the transmit descriptor ring. */
-   writel(upper_32_bits(adapter->tx_ring.tx_desc_ring_pa),
-  &txdma->pr_base_hi);
-   writel(lower_32_bits(adapter->tx_ring.tx_desc_ring_pa),
-  &txdma->pr_base_lo);
+   writel(upper_32_bits(tx_ring->tx_desc_ring_pa), &txdma->pr_base_hi);
+   writel(lower_32_bits(tx_ring->tx_desc_ring_pa), &txdma->pr_base_lo);
 
/* Initialise the transmit DMA engine */
writel(NUM_DESC_PER_RING_TX - 1, &txdma->pr_num_des);
 
/* Load the completion writeback physical address */
-   writel(upper_32_bits(adapter->tx_ring.tx_status_pa),
-  &txdma->dma_wb_base_hi);
-   writel(lower_32_bits(adapter->tx_ring.tx_status_pa),
-  &txdma->dma_wb_base_lo);
+   writel(upper_32_bits(tx_ring->tx_status_pa), &txdma->dma_wb_base_hi);
+   writel(lower_32_bits(tx_ring->tx_status_pa), &txdma->dma_wb_base_lo);
 
-   *adapter->tx_ring.tx_status = 0;
+   *tx_ring->tx_status = 0;
 
writel(0, &txdma->service_request);
-   adapter->tx_ring.send_idx = 0;
+   tx_ring->send_idx = 0;
 }
 
 /* et131x_adapter_setup - Set the adapter up as per cassini+ documentation */
@@ -1987,13 +1984,9 @@ static void et131x_disable_txrx(struct net_device 
*netdev)
 /* et131x_init_send - Initialize send data structures */
 static void et131x_init_send(struct et131x_adapter *adapter)
 {
-   struct tcb *tcb;
u32 ct;
-   struct tx_ring *tx_ring;
-
-   /* Setup some convenience pointers */
-   tx_ring = &adapter->tx_ring;
-   tcb = adapter->tx_ring.tcb_ring;
+   struct tx_ring *tx_ring = &adapter->tx_ring;
+   struct tcb *tcb = tx_ring->tcb_ring;
 
tx_ring->tcb_qhead = tcb;
 
@@ -2700,9 +2693,9 @@ static int et131x_tx_dma_memory_alloc(struct 
et131x_adapter *adapter)
struct tx_ring *tx_ring = &adapter->tx_ring;
 
/* Allocate memory for the TCB's (Transmit Control Block) */
-   adapter->tx_ring.tcb_ring = kcalloc(NUM_TCB, sizeof(struct tcb),
-   GFP_ATOMIC | GFP_DMA);
-   if (!adapter->tx_ring.tcb_ring)
+   tx_ring->tcb_ring = kcalloc(NUM_TCB, sizeof(struct tcb),
+   GFP_ATOMIC | GFP_DMA);
+   if (!tx_ring->tcb_ring)
return -ENOMEM;
 
desc_size = (sizeof(struct tx_desc) * NUM_DESC_PER_RING_TX);
@@ -2710,7 +2703,7 @@ static int et131x_tx_dma_memory_alloc(struct 
et131x_adapter *adapter)
   desc_size,
   &tx_ring->tx_desc_ring_pa,
   GFP_KERNEL);
-   if (!adapter->tx_ring.tx_desc_ring) {
+   if (!tx_ring->tx_desc_ring) {
dev_err(&adapter->pdev->dev,
"Cannot alloc memory for Tx Ring\n");
return -ENOMEM;
@@ -2728,9 +2721,9 @@ static int et131x_tx_dma_memory_alloc(struct 
et131x_adapter *adapter)
sizeof(u32),
&tx_ring->tx_status_pa,
GFP_KERNEL);
-   if (!adapter->tx_ring.tx_status_pa) {
+   if (!tx_ring->tx_status_pa) {
dev_err(&adapter->pdev->dev,
- "Cannot alloc memory for Tx status block\n");
+   "Cannot alloc memory for Tx status block\n");
return -ENOMEM;
}
return 0;
@@ -2740,28 +2733,29 @@ static int et131x_tx_dma_memory_alloc(struct 
et131x_adapter *adapter)
 static void et131x_tx_dma_memory_free(struct et131x_adapter *adapter)
 {
int desc_size = 0;
+   struct tx_ring *tx_ring = &adapter->tx_ring;
 
-   if (adapter->tx_ring.tx_desc_ring) {
+   if (tx_ring->tx_desc_ring) {
/* Free memory relating to Tx rings here */
desc_size = (sizeof(struct tx_desc) * NUM_DESC_PER_RING_TX);
dma_free_coherent(&adapter->pdev->dev,
-   desc_size,
-   adapter->tx_ring.tx_desc_ring,
-   adapte

Re: [PATCH] Staging: TIDSPBRIDGE: Remove UUID helper

2013-12-07 Thread gre...@linuxfoundation.org
On Sat, Dec 07, 2013 at 10:41:36AM +0200, Ivajlo Dimitrov wrote:
> 
> On 06.12.2013 17:10, gre...@linuxfoundation.org wrote:
> > On Fri, Dec 06, 2013 at 08:05:38AM +0200, Ivajlo Dimitrov wrote:
> >> Hi Greg,
> >>
> >> On 01.12.2013 19:07, Ivaylo DImitrov wrote:
> >>> From: Ivaylo Dimitrov 
> >>>
> >>> Custom uuid helper function is needed only in rmgr/dbdcd.c and doesn't
> >>> need to be exported. It can also be made way simpler by using sscanf.
> >>>
> >>> Signed-off-by: Ivaylo Dimitrov 
> >>> ---
> >>>drivers/staging/tidspbridge/Makefile   |2 +-
> >>>drivers/staging/tidspbridge/gen/uuidutil.c |   85 
> >>> 
> >>>.../tidspbridge/include/dspbridge/uuidutil.h   |   18 
> >>>drivers/staging/tidspbridge/rmgr/dbdcd.c   |   42 +-
> >>>4 files changed, 39 insertions(+), 108 deletions(-)
> >>>delete mode 100644 drivers/staging/tidspbridge/gen/uuidutil.c
> >>>
> >> I guess the initial mail somehow didn't make it through your spam filter:
> >> https://lkml.org/lkml/2013/12/1/70
> > It did, but I thought that people asked for it to be changed in the
> > thread afterwards, so I was expecting an updated version from you.
> >
> > Care to fix things up and resend it?
> >
> > thanks,
> >
> > greg k-h
> 
> Sure, the change I was asked for is trivial, but I didn't get the reason 
> why it is needed. Neither there is a reply to my follow-up comment [0]. 
> Sorry, I am pretty much new on LKML and could miss things that are 
> supposed to be clear from the start, but my impression is that when 
> someone says "it is better", he/she should explain why it is better or 
> at least what is wrong with the patch he/she wants  to be changed.
> 
> However, I don't want to enter some arguing loop, so if you think I 
> should change the code as per Joe's comment, just confirm it and I'll do it.

Please try.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel