Patchwork [2/6] drivers: net: ethernet: davinci_cpdma: add clear api for statistics interrupt

login
register
mail settings
Submitter Mugunthan V N
Date Oct. 16, 2012, 10:45 p.m.
Message ID <1350427518-7230-3-git-send-email-mugunthanvnm@ti.com>
Download mbox | patch
Permalink /patch/191907/
State Deferred
Delegated to: David Miller
Headers show

Comments

Mugunthan V N - Oct. 16, 2012, 10:45 p.m.
Adding api to clear statistics interrupt which is generated by
CPTS event pend, stat pend, mdio interrupts

Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
 drivers/net/ethernet/ti/davinci_cpdma.c |    8 ++++++++
 drivers/net/ethernet/ti/davinci_cpdma.h |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)
Richard Cochran - Oct. 18, 2012, 2:48 a.m.
On Wed, Oct 17, 2012 at 04:15:14AM +0530, Mugunthan V N wrote:
> Adding api to clear statistics interrupt which is generated by
> CPTS event pend, stat pend, mdio interrupts

As I said, we don't need or want the interrupt for the CPTS. If you
want to add this for the statistics function, go right ahead, but
please make a separate patch or series for that.

Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mugunthan V N - Oct. 22, 2012, 10:42 a.m.
> -----Original Message-----
> From: Richard Cochran [mailto:richardcochran@gmail.com]
> Sent: Thursday, October 18, 2012 8:18 AM
> To: N, Mugunthan V
> Cc: netdev@vger.kernel.org; davem@davemloft.net
> Subject: Re: [PATCH 2/6] drivers: net: ethernet: davinci_cpdma: add
> clear api for statistics interrupt
> 
> On Wed, Oct 17, 2012 at 04:15:14AM +0530, Mugunthan V N wrote:
> > Adding api to clear statistics interrupt which is generated by
> > CPTS event pend, stat pend, mdio interrupts
> 
> As I said, we don't need or want the interrupt for the CPTS. If you
> want to add this for the statistics function, go right ahead, but
> please make a separate patch or series for that.
> 

What happens when Hardware timestamps are used? It will be good to
notify the application immediately using the interrupts instead of
using workqueue which can delay the event in hardware for max about
HZ*8.

Regards
Mugunthan V N
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Richard Cochran - Oct. 22, 2012, 11:31 a.m.
On Mon, Oct 22, 2012 at 10:42:26AM +0000, N, Mugunthan V wrote:
> 
> What happens when Hardware timestamps are used?

They are not being used.

> It will be good to
> notify the application immediately using the interrupts instead of
> using workqueue which can delay the event in hardware for max about
> HZ*8.

Yes, it would make sense to use the interrupt in that case, but I did
not see any code supporting external events. In any case, I still want
to handle the overflow in the same way as in the other PHC drivers,
for the sake of consistency, and to avoid wasting CPU time "in
interrupt" with silly counter overflow code.

Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index d15c888..656712c 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -63,6 +63,8 @@ 
 
 #define CPDMA_TEARDOWN_VALUE	0xfffffffc
 
+#define CPDMA_STAT_PEND_EOI	0x3
+
 struct cpdma_desc {
 	/* hardware fields */
 	u32			hw_next;
@@ -479,6 +481,12 @@  void cpdma_ctlr_eoi(struct cpdma_ctlr *ctlr)
 	dma_reg_write(ctlr, CPDMA_MACEOIVECTOR, 0);
 }
 
+void cpdma_ctlr_eoi_statistics(struct cpdma_ctlr *ctlr)
+{
+	dma_reg_write(ctlr, CPDMA_MACEOIVECTOR, CPDMA_STAT_PEND_EOI);
+}
+EXPORT_SYMBOL_GPL(cpdma_ctlr_eoi_statistics);
+
 struct cpdma_chan *cpdma_chan_create(struct cpdma_ctlr *ctlr, int chan_num,
 				     cpdma_handler_fn handler)
 {
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.h b/drivers/net/ethernet/ti/davinci_cpdma.h
index afa19a0..e25e9d5 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.h
+++ b/drivers/net/ethernet/ti/davinci_cpdma.h
@@ -87,6 +87,7 @@  int cpdma_chan_process(struct cpdma_chan *chan, int quota);
 
 int cpdma_ctlr_int_ctrl(struct cpdma_ctlr *ctlr, bool enable);
 void cpdma_ctlr_eoi(struct cpdma_ctlr *ctlr);
+void cpdma_ctlr_eoi_statistics(struct cpdma_ctlr *ctlr);
 int cpdma_chan_int_ctrl(struct cpdma_chan *chan, bool enable);
 
 enum cpdma_control {