netdev
[Top] [All Lists]

Re: [RFR] gianfar ethernet driver

To: Jeff Garzik <jgarzik@xxxxxxxxx>
Subject: Re: [RFR] gianfar ethernet driver
From: Andy Fleming <afleming@xxxxxxxxxxxxx>
Date: Mon, 19 Jul 2004 18:29:47 -0500
Cc: Andy Fleming <AFLEMING@xxxxxxxxxxxx>, <netdev@xxxxxxxxxxx>, Kumar Gala <kumar.gala@xxxxxxxxxxxx>, <hadi@xxxxxxxxxx>, <dwmw2@xxxxxxxxxxxxx>
In-reply-to: <40F4A6E5.4060000@xxxxxxxxx>
References: <C681B01E-CEA9-11D8-931F-000393DBC2E8@xxxxxxxxxxxxx> <2A724364-D53A-11D8-8835-000393C30512@xxxxxxxxxxxxx> <40F4A6E5.4060000@xxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx

On Jul 13, 2004, at 22:22, Jeff Garzik wrote:

Andy Fleming wrote:
Ok, I've got the new PHY code working, and I've done most of the changes, but I have a couple more questions:

6) sysfs support:  call SET_NETDEV_DEV()
Ok, the first argument should be dev, but what should the second argument be? This isn't a PCI device, it's an on-chip peripheral, so I'm not sure what the class_device should be.

It's a struct device, which all devices need to have.

I could have sworn OCP does struct device these days. If not, poke the platform people.

Ah, I found it.  ocpdev->dev.  Done.



19) I think your gfar_poll() needs spin_lock_irqsave(), not spin_lock().
Hmm... I tried that, but netif_receive_skb() will eventually call local_bh_enable(), which dislikes my disabling interrupts. I could avoid this by unlocking around netif_receive_skb(), but this solution seems ugly to me. What is the preferred way of doing this?

Duh.  I had a brainfart.

RX "synchronization" is normally done by simply ensuring that no other code will cause a NAPI poll. You shouldn't need spinlocks around that section of code at all. Take a look at drivers/net/tg3.c, tg3_rx()

Ok.  I will send a new patch tomorrow.


        Jeff


<Prev in Thread] Current Thread [Next in Thread>