* [PATCH 1/1] drivers: net : cpsw: Use netdev_name while requesting irq
@ 2013-12-06 6:58 Mugunthan V N
2013-12-06 20:46 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Mugunthan V N @ 2013-12-06 6:58 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-omap, George Cherian, Mugunthan V N
From: George Cherian <george.cherian@ti.com>
Use netdev_name while requesting irq so that eth* name is shown
in /proc/interrupts. Previously it was showing device name as (null)
for cpsw interrupts. For using netdev_name register_netdev and then
call devm_request_irq.
Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
---
drivers/net/ethernet/ti/cpsw.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index a91f0c9..61ae17f 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2090,19 +2090,6 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
- while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) {
- for (i = res->start; i <= res->end; i++) {
- if (devm_request_irq(&pdev->dev, i, cpsw_interrupt, 0,
- dev_name(priv->dev), priv)) {
- dev_err(priv->dev, "error attaching irq\n");
- goto clean_ale_ret;
- }
- priv->irqs_table[k] = i;
- priv->num_irqs = k + 1;
- }
- k++;
- }
-
ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
ndev->netdev_ops = &cpsw_netdev_ops;
@@ -2118,6 +2105,19 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
+ while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) {
+ for (i = res->start; i <= res->end; i++) {
+ if (devm_request_irq(&pdev->dev, i, cpsw_interrupt, 0,
+ netdev_name(ndev), priv)) {
+ dev_err(priv->dev, "error attaching irq\n");
+ goto clean_ale_ret;
+ }
+ priv->irqs_table[k] = i;
+ priv->num_irqs = k + 1;
+ }
+ k++;
+ }
+
if (cpts_register(&pdev->dev, priv->cpts,
data->cpts_clock_mult, data->cpts_clock_shift))
dev_err(priv->dev, "error registering cpts device\n");
--
1.8.5.rc3.2.gc302941
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] drivers: net : cpsw: Use netdev_name while requesting irq
2013-12-06 6:58 [PATCH 1/1] drivers: net : cpsw: Use netdev_name while requesting irq Mugunthan V N
@ 2013-12-06 20:46 ` David Miller
2013-12-09 9:29 ` Mugunthan V N
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2013-12-06 20:46 UTC (permalink / raw)
To: mugunthanvnm; +Cc: netdev, linux-omap, george.cherian
From: Mugunthan V N <mugunthanvnm@ti.com>
Date: Fri, 6 Dec 2013 12:28:27 +0530
> From: George Cherian <george.cherian@ti.com>
>
> Use netdev_name while requesting irq so that eth* name is shown
> in /proc/interrupts. Previously it was showing device name as (null)
> for cpsw interrupts. For using netdev_name register_netdev and then
> call devm_request_irq.
>
> Signed-off-by: George Cherian <george.cherian@ti.com>
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Why is it showing "(null)" as the name, is dev_name() not working
properly for this device?
The only change you are making is passing netdev_name() instead
of dev_name(). dev_name() giving NULL doesn't make much sense
to me.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] drivers: net : cpsw: Use netdev_name while requesting irq
2013-12-06 20:46 ` David Miller
@ 2013-12-09 9:29 ` Mugunthan V N
2013-12-10 0:57 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Mugunthan V N @ 2013-12-09 9:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-omap, george.cherian
On Saturday 07 December 2013 02:16 AM, David Miller wrote:
> From: Mugunthan V N <mugunthanvnm@ti.com>
> Date: Fri, 6 Dec 2013 12:28:27 +0530
>
>> From: George Cherian <george.cherian@ti.com>
>>
>> Use netdev_name while requesting irq so that eth* name is shown
>> in /proc/interrupts. Previously it was showing device name as (null)
>> for cpsw interrupts. For using netdev_name register_netdev and then
>> call devm_request_irq.
>>
>> Signed-off-by: George Cherian <george.cherian@ti.com>
>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> Why is it showing "(null)" as the name, is dev_name() not working
> properly for this device?
>
> The only change you are making is passing netdev_name() instead
> of dev_name(). dev_name() giving NULL doesn't make much sense
> to me.
priv->dev is a network device which is registered to network stack after
request interrupt, so dev name is null, with this patch request
interrupt is moved below after registering the network device with the
network
Initial driver was using DT node name for the interrupts, but with the
devm changes by Daniel Mack in commit 50a5fb068 it was changed to ndev
name which introduced this issue.
Regards
Mugunthan V N
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] drivers: net : cpsw: Use netdev_name while requesting irq
2013-12-09 9:29 ` Mugunthan V N
@ 2013-12-10 0:57 ` David Miller
2013-12-10 8:32 ` Mugunthan V N
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2013-12-10 0:57 UTC (permalink / raw)
To: mugunthanvnm; +Cc: netdev, linux-omap, george.cherian
From: Mugunthan V N <mugunthanvnm@ti.com>
Date: Mon, 9 Dec 2013 14:59:05 +0530
> commit 50a5fb068
This commit doesn't appear in any tree.
And any change which makes a real "struct device" return NULL
for dev_name() is broken.
I'm not applying this patch, you have completely failed to
provide any information necessary to support and justify
your change.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/1] drivers: net : cpsw: Use netdev_name while requesting irq
2013-12-10 0:57 ` David Miller
@ 2013-12-10 8:32 ` Mugunthan V N
0 siblings, 0 replies; 5+ messages in thread
From: Mugunthan V N @ 2013-12-10 8:32 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-omap, george.cherian
On Tuesday 10 December 2013 06:27 AM, David Miller wrote:
> From: Mugunthan V N <mugunthanvnm@ti.com>
> Date: Mon, 9 Dec 2013 14:59:05 +0530
>
>> commit 50a5fb068
> This commit doesn't appear in any tree.
>
> And any change which makes a real "struct device" return NULL
> for dev_name() is broken.
>
> I'm not applying this patch, you have completely failed to
> provide any information necessary to support and justify
> your change.
Oops, the commit ID is wrong my mistake, since you have dropped this
patch, I will submit the patch again with more details.
Regards
Mugunthan V N
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-12-10 8:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-06 6:58 [PATCH 1/1] drivers: net : cpsw: Use netdev_name while requesting irq Mugunthan V N
2013-12-06 20:46 ` David Miller
2013-12-09 9:29 ` Mugunthan V N
2013-12-10 0:57 ` David Miller
2013-12-10 8:32 ` Mugunthan V N
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).