Re: [PATCH/RFC v4 net-next] ravb: Add dma queue interrupt support

From
Yoshihiro Kaneko <hidden>
Date
2016-02-07 16:56:40
Also in
linux-sh
Reply to
Sergei Shtylyov, 2016-01-28
2016-01-29 2:32 GMT+09:00 Sergei Shtylyov [off-list ref]:
On 01/24/2016 06:52 PM, Yoshihiro Kaneko wrote:
quoted
From: Kazuya Mizuguchi <redacted>

This patch supports the following interrupts.

- One interrupt for multiple (descriptor, error, management)
- One interrupt for emac
- Four interrupts for dma queue (best effort rx/tx, network control rx/tx)

This patch improve efficiency of the interrupt handler by adding the
interrupt handler corresponding to each interrupt source described
above. Additionally, it reduces the number of times of the access to
EthernetAVB IF.

Signed-off-by: Kazuya Mizuguchi <redacted>
Signed-off-by: Yoshihiro Kaneko <redacted>

[...]
quoted
diff --git a/drivers/net/ethernet/renesas/ravb_main.c
b/drivers/net/ethernet/renesas/ravb_main.c
index ac43ed9..076f25f 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
[...]
quoted
@@ -1215,29 +1332,64 @@ static const struct ethtool_ops ravb_ethtool_ops =
{
        .get_ts_info            = ravb_get_ts_info,
  };

+static inline int hook_irq(unsigned int irq, irq_handler_t handler,
+                          struct net_device *ndev, struct device *dev,
+                          const char *ch)
+{
+       char *name;
+       int error;
+
+       name = devm_kasprintf(dev, GFP_KERNEL, "%s:%s", ndev->name, ch);

   BTW, shouldn't we test 'name' for NULL here?
Thanks.
I will fix it to return -ENOMEM if 'name' is NULL.
quoted
+       error = request_irq(irq, handler, IRQF_SHARED, name, ndev);
+       if (error)
+               netdev_err(ndev, "cannot request IRQ %s\n", name);
+
+       return error;
+}
+

MBR, Sergei
Thanks,
kaneko
Thread (18 messages) 18 messages, 3 authors, last reply 2016-02-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help