RE: [PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-09-12 Thread Mohammed, Afzal
On Tue, Sep 11, 2012 at 23:51:07, Tony Lindgren wrote:

 Ah thanks, that's a copy paste UTF-8 issue. I'll just fold
 in the fixes and push them out to a new devel-gpmc-fixed
 branch.

Thanks Tony

Regards
Afzal


RE: [PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-09-11 Thread Mohammed, Afzal
Hi Tony,

On Tue, Sep 11, 2012 at 11:12:27, Tony Lindgren wrote:
 * Mohammed, Afzal af...@ti.com [120910 22:36]:

  I was not careful enough, sorry. Thanks for fixing it.
  
  Another hunk as follows would also be required for error
  path even though compiler didn't complain.
  
  Not sure whether you can fixup or I should post as a
  separate patch.
 
 Oh OK, please just post a separate patch as I've
 already pushed it out.

I have posted a separate patch, please consider for
inclusion in your tree.

BTW, you original commit that fixes the compiler
warning has some strange characters.

Regards
Afzal


Re: [PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-09-11 Thread Tony Lindgren
* Mohammed, Afzal af...@ti.com [120910 23:40]:
 Hi Tony,
 
 On Tue, Sep 11, 2012 at 11:12:27, Tony Lindgren wrote:
  * Mohammed, Afzal af...@ti.com [120910 22:36]:
 
   I was not careful enough, sorry. Thanks for fixing it.
   
   Another hunk as follows would also be required for error
   path even though compiler didn't complain.
   
   Not sure whether you can fixup or I should post as a
   separate patch.
  
  Oh OK, please just post a separate patch as I've
  already pushed it out.
 
 I have posted a separate patch, please consider for
 inclusion in your tree.
 
 BTW, you original commit that fixes the compiler
 warning has some strange characters.

Ah thanks, that's a copy paste UTF-8 issue. I'll just fold
in the fixes and push them out to a new devel-gpmc-fixed
branch.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-09-10 Thread Tony Lindgren
* Tony Lindgren t...@atomide.com [120830 12:54]:
 * Artem Bityutskiy dedeki...@gmail.com [120825 04:49]:
  On Tue, 2012-08-21 at 15:14 +0530, Afzal Mohammed wrote:
   GPMC platform initialization provides it's clients
   with interrupts that can be used through struct
   resource. Make use of it for irq mode functionality.
   
   Also now write protect disable is done by GPMC,
   hence remove it.
   
   Signed-off-by: Afzal Mohammed af...@ti.com
  
  Acked-by: Artem Bityutskiy artem.bityuts...@linux.intel.com
 
 Thanks I'll apply these into omap devel-gpmc branch.

FYI, looks like a new warning got introduced, so I've
committed the following trivial patch on top of this series.

Regards,

Tony

From: Tony Lindgren t...@atomide.com
Date: Mon, 10 Sep 2012 17:14:13 -0700
Subject: [PATCH] mtd: nand omap2: Fix uninitialized err warning

Commit bd4156fd (mtd: nand: omap2: use gpmc provided irqs)
introduced a new warning:

drivers/mtd/nand/omap2.c: In function ‘omap_nand_probe’:
drivers/mtd/nand/omap2.c:1267: warning: ‘err’ may be used uninitialized in this 
function

Signed-off-by: Tony Lindgren t...@atomide.com

--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1389,6 +1389,7 @@ static int __devinit omap_nand_probe(struct 
platform_device *pdev)
info-gpmc_irq_fifo = platform_get_irq(pdev, 0);
if (info-gpmc_irq_fifo = 0) {
dev_err(pdev-dev, error getting fifo irq\n);
+   err = -ENODEV;
goto out_release_mem_region;
}
err = request_irq(info-gpmc_irq_fifo,  omap_nand_irq,
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-09-10 Thread Mohammed, Afzal
Hi Tony,

On Tue, Sep 11, 2012 at 05:47:10, Tony Lindgren wrote:

 FYI, looks like a new warning got introduced, so I've
 committed the following trivial patch on top of this series.

I was not careful enough, sorry. Thanks for fixing it.

Another hunk as follows would also be required for error
path even though compiler didn't complain.

Not sure whether you can fixup or I should post as a
separate patch.

As an aside, there was compiler warning before this
series, but I didn't dare to touch it, so a warning
was seen but thought it was due to the earlier one.
And now Arnd has fixed the original warning.

Regards
Afzal

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 337cf0a..27293e3 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1404,6 +1404,7 @@ static int __devinit omap_nand_probe(struct 
platform_device *pdev)
info-gpmc_irq_count = platform_get_irq(pdev, 1);
if (info-gpmc_irq_count = 0) {
dev_err(pdev-dev, error getting count irq\n);
+   err = -ENODEV;
goto out_release_mem_region;
}
err = request_irq(info-gpmc_irq_count, omap_nand_irq, 


 From: Tony Lindgren t...@atomide.com
 Date: Mon, 10 Sep 2012 17:14:13 -0700
 Subject: [PATCH] mtd: nand omap2: Fix uninitialized err warning
 
 Commit bd4156fd (mtd: nand: omap2: use gpmc provided irqs)
 introduced a new warning:
 
 drivers/mtd/nand/omap2.c: In function ‘omap_nand_probe’:
 drivers/mtd/nand/omap2.c:1267: warning: ‘err’ may be used uninitialized in 
 this function
 
 Signed-off-by: Tony Lindgren t...@atomide.com
 
 --- a/drivers/mtd/nand/omap2.c
 +++ b/drivers/mtd/nand/omap2.c
 @@ -1389,6 +1389,7 @@ static int __devinit omap_nand_probe(struct 
 platform_device *pdev)
   info-gpmc_irq_fifo = platform_get_irq(pdev, 0);
   if (info-gpmc_irq_fifo = 0) {
   dev_err(pdev-dev, error getting fifo irq\n);
 + err = -ENODEV;
   goto out_release_mem_region;
   }
   err = request_irq(info-gpmc_irq_fifo,  omap_nand_irq,
 



Re: [PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-09-10 Thread Tony Lindgren
* Mohammed, Afzal af...@ti.com [120910 22:36]:
 Hi Tony,
 
 On Tue, Sep 11, 2012 at 05:47:10, Tony Lindgren wrote:
 
  FYI, looks like a new warning got introduced, so I've
  committed the following trivial patch on top of this series.
 
 I was not careful enough, sorry. Thanks for fixing it.
 
 Another hunk as follows would also be required for error
 path even though compiler didn't complain.
 
 Not sure whether you can fixup or I should post as a
 separate patch.

Oh OK, please just post a separate patch as I've
already pushed it out.

 As an aside, there was compiler warning before this
 series, but I didn't dare to touch it, so a warning
 was seen but thought it was due to the earlier one.
 And now Arnd has fixed the original warning.

OK

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-08-30 Thread Tony Lindgren
* Artem Bityutskiy dedeki...@gmail.com [120825 04:49]:
 On Tue, 2012-08-21 at 15:14 +0530, Afzal Mohammed wrote:
  GPMC platform initialization provides it's clients
  with interrupts that can be used through struct
  resource. Make use of it for irq mode functionality.
  
  Also now write protect disable is done by GPMC,
  hence remove it.
  
  Signed-off-by: Afzal Mohammed af...@ti.com
 
 Acked-by: Artem Bityutskiy artem.bityuts...@linux.intel.com

Thanks I'll apply these into omap devel-gpmc branch.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-08-25 Thread Artem Bityutskiy
On Tue, 2012-08-21 at 15:14 +0530, Afzal Mohammed wrote:
 GPMC platform initialization provides it's clients
 with interrupts that can be used through struct
 resource. Make use of it for irq mode functionality.
 
 Also now write protect disable is done by GPMC,
 hence remove it.
 
 Signed-off-by: Afzal Mohammed af...@ti.com

Acked-by: Artem Bityutskiy artem.bityuts...@linux.intel.com

-- 
Best Regards,
Artem Bityutskiy


signature.asc
Description: This is a digitally signed message part


Re: [PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-08-24 Thread Tony Lindgren
Artem,

* Afzal Mohammed af...@ti.com [120821 02:44]:
 GPMC platform initialization provides it's clients
 with interrupts that can be used through struct
 resource. Make use of it for irq mode functionality.
 
 Also now write protect disable is done by GPMC,
 hence remove it.
 
 Signed-off-by: Afzal Mohammed af...@ti.com
 ---
 
 v3: Handle error path properly

Care to (re)ack this one as the error path handling changed?

Regards,

Tony
 
  drivers/mtd/nand/omap2.c |   76 
 +-
  1 files changed, 48 insertions(+), 28 deletions(-)
 
 diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
 index f65f7f8..0e9d7b3 100644
 --- a/drivers/mtd/nand/omap2.c
 +++ b/drivers/mtd/nand/omap2.c
 @@ -137,7 +137,8 @@ struct omap_nand_info {
   unsigned long   mem_size;
   struct completion   comp;
   struct dma_chan *dma;
 - int gpmc_irq;
 + int gpmc_irq_fifo;
 + int gpmc_irq_count;
   enum {
   OMAP_NAND_IO_READ = 0,  /* read */
   OMAP_NAND_IO_WRITE, /* write */
 @@ -553,14 +554,12 @@ static irqreturn_t omap_nand_irq(int this_irq, void 
 *dev)
  {
   struct omap_nand_info *info = (struct omap_nand_info *) dev;
   u32 bytes;
 - u32 irq_stat;
  
 - irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);
   bytes = readl(info-reg.gpmc_prefetch_status);
   bytes = GPMC_PREFETCH_STATUS_FIFO_CNT(bytes);
   bytes = bytes   0xFFFC; /* io in multiple of 4 bytes */
   if (info-iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */
 - if (irq_stat  0x2)
 + if (this_irq == info-gpmc_irq_count)
   goto done;
  
   if (info-buf_len  (info-buf_len  bytes))
 @@ -577,20 +576,17 @@ static irqreturn_t omap_nand_irq(int this_irq, void 
 *dev)
   (u32 *)info-buf, bytes  2);
   info-buf = info-buf + bytes;
  
 - if (irq_stat  0x2)
 + if (this_irq == info-gpmc_irq_count)
   goto done;
   }
 - gpmc_cs_configure(info-gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
  
   return IRQ_HANDLED;
  
  done:
   complete(info-comp);
 - /* disable irq */
 - gpmc_cs_configure(info-gpmc_cs, GPMC_ENABLE_IRQ, 0);
  
 - /* clear status */
 - gpmc_cs_configure(info-gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
 + disable_irq_nosync(info-gpmc_irq_fifo);
 + disable_irq_nosync(info-gpmc_irq_count);
  
   return IRQ_HANDLED;
  }
 @@ -624,9 +620,9 @@ static void omap_read_buf_irq_pref(struct mtd_info *mtd, 
 u_char *buf, int len)
   goto out_copy;
  
   info-buf_len = len;
 - /* enable irq */
 - gpmc_cs_configure(info-gpmc_cs, GPMC_ENABLE_IRQ,
 - (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT));
 +
 + enable_irq(info-gpmc_irq_count);
 + enable_irq(info-gpmc_irq_fifo);
  
   /* waiting for read to complete */
   wait_for_completion(info-comp);
 @@ -674,12 +670,13 @@ static void omap_write_buf_irq_pref(struct mtd_info 
 *mtd,
   goto out_copy;
  
   info-buf_len = len;
 - /* enable irq */
 - gpmc_cs_configure(info-gpmc_cs, GPMC_ENABLE_IRQ,
 - (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT));
 +
 + enable_irq(info-gpmc_irq_count);
 + enable_irq(info-gpmc_irq_fifo);
  
   /* waiting for write to complete */
   wait_for_completion(info-comp);
 +
   /* wait for data to flushed-out before reset the prefetch */
   tim = 0;
   limit = (loops_per_jiffy *  msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
 @@ -1300,9 +1297,6 @@ static int __devinit omap_nand_probe(struct 
 platform_device *pdev)
   info-nand.options  = pdata-devsize;
   info-nand.options  |= NAND_SKIP_BBTSCAN;
  
 - /* NAND write protect off */
 - gpmc_cs_configure(info-gpmc_cs, GPMC_CONFIG_WP, 0);
 -
   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   if (res == NULL) {
   err = -EINVAL;
 @@ -1393,17 +1387,37 @@ static int __devinit omap_nand_probe(struct 
 platform_device *pdev)
   break;
  
   case NAND_OMAP_PREFETCH_IRQ:
 - err = request_irq(pdata-gpmc_irq,
 - omap_nand_irq, IRQF_SHARED, gpmc-nand, info);
 + info-gpmc_irq_fifo = platform_get_irq(pdev, 0);
 + if (info-gpmc_irq_fifo = 0) {
 + dev_err(pdev-dev, error getting fifo irq\n);
 + goto out_release_mem_region;
 + }
 + err = request_irq(info-gpmc_irq_fifo,  omap_nand_irq,
 + IRQF_SHARED, gpmc-nand-fifo, info);
   if (err) {
   dev_err(pdev-dev, requesting irq(%d) error:%d,
 - 

[PATCH v3 10/10] mtd: nand: omap2: use gpmc provided irqs

2012-08-21 Thread Afzal Mohammed
GPMC platform initialization provides it's clients
with interrupts that can be used through struct
resource. Make use of it for irq mode functionality.

Also now write protect disable is done by GPMC,
hence remove it.

Signed-off-by: Afzal Mohammed af...@ti.com
---

v3: Handle error path properly

 drivers/mtd/nand/omap2.c |   76 +-
 1 files changed, 48 insertions(+), 28 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index f65f7f8..0e9d7b3 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -137,7 +137,8 @@ struct omap_nand_info {
unsigned long   mem_size;
struct completion   comp;
struct dma_chan *dma;
-   int gpmc_irq;
+   int gpmc_irq_fifo;
+   int gpmc_irq_count;
enum {
OMAP_NAND_IO_READ = 0,  /* read */
OMAP_NAND_IO_WRITE, /* write */
@@ -553,14 +554,12 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev)
 {
struct omap_nand_info *info = (struct omap_nand_info *) dev;
u32 bytes;
-   u32 irq_stat;
 
-   irq_stat = gpmc_read_status(GPMC_GET_IRQ_STATUS);
bytes = readl(info-reg.gpmc_prefetch_status);
bytes = GPMC_PREFETCH_STATUS_FIFO_CNT(bytes);
bytes = bytes   0xFFFC; /* io in multiple of 4 bytes */
if (info-iomode == OMAP_NAND_IO_WRITE) { /* checks for write io */
-   if (irq_stat  0x2)
+   if (this_irq == info-gpmc_irq_count)
goto done;
 
if (info-buf_len  (info-buf_len  bytes))
@@ -577,20 +576,17 @@ static irqreturn_t omap_nand_irq(int this_irq, void *dev)
(u32 *)info-buf, bytes  2);
info-buf = info-buf + bytes;
 
-   if (irq_stat  0x2)
+   if (this_irq == info-gpmc_irq_count)
goto done;
}
-   gpmc_cs_configure(info-gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
 
return IRQ_HANDLED;
 
 done:
complete(info-comp);
-   /* disable irq */
-   gpmc_cs_configure(info-gpmc_cs, GPMC_ENABLE_IRQ, 0);
 
-   /* clear status */
-   gpmc_cs_configure(info-gpmc_cs, GPMC_SET_IRQ_STATUS, irq_stat);
+   disable_irq_nosync(info-gpmc_irq_fifo);
+   disable_irq_nosync(info-gpmc_irq_count);
 
return IRQ_HANDLED;
 }
@@ -624,9 +620,9 @@ static void omap_read_buf_irq_pref(struct mtd_info *mtd, 
u_char *buf, int len)
goto out_copy;
 
info-buf_len = len;
-   /* enable irq */
-   gpmc_cs_configure(info-gpmc_cs, GPMC_ENABLE_IRQ,
-   (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT));
+
+   enable_irq(info-gpmc_irq_count);
+   enable_irq(info-gpmc_irq_fifo);
 
/* waiting for read to complete */
wait_for_completion(info-comp);
@@ -674,12 +670,13 @@ static void omap_write_buf_irq_pref(struct mtd_info *mtd,
goto out_copy;
 
info-buf_len = len;
-   /* enable irq */
-   gpmc_cs_configure(info-gpmc_cs, GPMC_ENABLE_IRQ,
-   (GPMC_IRQ_FIFOEVENTENABLE | GPMC_IRQ_COUNT_EVENT));
+
+   enable_irq(info-gpmc_irq_count);
+   enable_irq(info-gpmc_irq_fifo);
 
/* waiting for write to complete */
wait_for_completion(info-comp);
+
/* wait for data to flushed-out before reset the prefetch */
tim = 0;
limit = (loops_per_jiffy *  msecs_to_jiffies(OMAP_NAND_TIMEOUT_MS));
@@ -1300,9 +1297,6 @@ static int __devinit omap_nand_probe(struct 
platform_device *pdev)
info-nand.options  = pdata-devsize;
info-nand.options  |= NAND_SKIP_BBTSCAN;
 
-   /* NAND write protect off */
-   gpmc_cs_configure(info-gpmc_cs, GPMC_CONFIG_WP, 0);
-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
err = -EINVAL;
@@ -1393,17 +1387,37 @@ static int __devinit omap_nand_probe(struct 
platform_device *pdev)
break;
 
case NAND_OMAP_PREFETCH_IRQ:
-   err = request_irq(pdata-gpmc_irq,
-   omap_nand_irq, IRQF_SHARED, gpmc-nand, info);
+   info-gpmc_irq_fifo = platform_get_irq(pdev, 0);
+   if (info-gpmc_irq_fifo = 0) {
+   dev_err(pdev-dev, error getting fifo irq\n);
+   goto out_release_mem_region;
+   }
+   err = request_irq(info-gpmc_irq_fifo,  omap_nand_irq,
+   IRQF_SHARED, gpmc-nand-fifo, info);
if (err) {
dev_err(pdev-dev, requesting irq(%d) error:%d,
-   pdata-gpmc_irq, err);
+   info-gpmc_irq_fifo, err);
+