* [PATCH] bfin_mac: Fix MDIO clock frequency
From: Kalle Pokki @ 2008-01-29 12:27 UTC (permalink / raw)
To: netdev, Bryan Wu
The clock divisor is set to all ones at reset.
---
drivers/net/bfin_mac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index eb97175..c199633 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -425,7 +425,7 @@ static int mii_probe(struct net_device *dev)
/* MDC = 2.5 MHz */
sysctl = bfin_read_EMAC_SYSCTL();
- sysctl |= SET_MDCDIV(24);
+ sysctl = (sysctl & ~MDCDIV) | SET_MDCDIV(24);
bfin_write_EMAC_SYSCTL(sysctl);
/* search for connect PHY device */
--
1.4.4.2
^ permalink raw reply related
* [PATCH] bfin_mac: Make the MDIO polling faster
From: Kalle Pokki @ 2008-01-29 12:28 UTC (permalink / raw)
To: netdev, Bryan Wu
The poll routine always got 10 ms penalty when called immediately
after starting the transfer. The MDIO transfer takes 25.6 us at the
nominal 2.5 MHz, so MAX_TIMEOUT_CNT being 500 is still big enough.
---
drivers/net/bfin_mac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index c199633..d2e6813 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -296,7 +296,7 @@ static void mdio_poll(void)
/* poll the STABUSY bit */
while ((bfin_read_EMAC_STAADD()) & STABUSY) {
- mdelay(10);
+ udelay(1);
if (timeout_cnt-- < 0) {
printk(KERN_ERR DRV_NAME
": wait MDC/MDIO transaction to complete timeout\n");
--
1.4.4.2
^ permalink raw reply related
* Re: [PATCH 2/2] [NETFILTER] nf_conntrack_core: kill unused static inline (do_iter)
From: Patrick McHardy @ 2008-01-29 13:41 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: netfilter-devel, David Miller, netdev
In-Reply-To: <12013009401505-git-send-email-ilpo.jarvinen@helsinki.fi>
Ilpo Järvinen wrote:
> From: =?ISO-8859-1?q?Ilpo=20J=E4rvinen?= <ilpo.jarvinen@helsinki.fi>
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
> net/netfilter/nf_conntrack_core.c | 8 --------
> 1 files changed, 0 insertions(+), 8 deletions(-)
Applied.
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 1/2] [NETFILTER] ipt_CLUSTERIP: kill clusterip_config_entry_get
From: Patrick McHardy @ 2008-01-29 13:40 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: netfilter-devel, David Miller, netdev
In-Reply-To: <12013009403114-git-send-email-ilpo.jarvinen@helsinki.fi>
Ilpo Järvinen wrote:
> From: =?ISO-8859-1?q?Ilpo=20J=E4rvinen?= <ilpo.jarvinen@helsinki.fi>
>
> It's unused static inline.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Applied, thanks.
^ permalink raw reply
* pppoe, /proc/net/pppoe wrong (extra entries)
From: Denys Fedoryshchenko @ 2008-01-29 14:36 UTC (permalink / raw)
To: netdev; +Cc: paulus, mostrows
Hi again
I notice strange thing, with /proc/net/pppoe, not sure if it is bug, but for
me it looks wrong.
cat /proc/net/pppoe
there is normal entries of users, but at the end i have
....
00000D00 00:16:D3:0B:F9:34 eth1
00004000 00:50:22:00:1C:FC eth1
00007E00 00:03:47:BD:34:25 eth1
00007E00 00:03:47:BD:34:25 eth1
00007E00 00:03:47:BD:34:25 eth1
00007E00 00:03:47:BD:34:25 eth1
00007E00 00:03:47:BD:34:25 eth1
....
and last entry duplicates till end.
i have script to get customers interfaces, so i am using it to calculate
amount of users logged in
defaulthost ~ #cat /proc/net/pppoe |grep -i '00:03:47:BD:34:25'|wc -l
40
defaulthost ~ #cat /proc/net/pppoe |wc -l
113
defaulthost ~ #pppctrl |wc -l
73
It means there is 40 extra entries. 00:03:47:BD:34:25 host have established,
but only one session. I am seeing similar issue on all remaining pppoe
servers, extra entries with same mac at the end.
If you need more info or access, please let me know.
--
Denys Fedoryshchenko
Technical Manager
Virtual ISP S.A.L.
^ permalink raw reply
* [GIT PULL] pull request for lblnet-2.6_testing
From: Paul Moore @ 2008-01-29 15:09 UTC (permalink / raw)
To: James Morris; +Cc: selinux, linux-security-module, netdev
Hi James,
I've just rebased the lblnet-2.6_testing tree against Linus' latest
which already includes DaveM's net-2.6.25 tree so there shouldn't be
any collisions with the core networking bits. Other than minor changes
needed to merge cleanly with the current linux-2.6 tree there have been
no changes to the labeled networking patches since they were last
posted. The git tree can be found here:
* git://git.infradead.org/users/pcmoore/lblnet-2.6_testing
In the interest of full disclosure, I was not able to test this tree as
there are a few compile errors in the drivers area which are preventing
me from getting a kernel built. However, all of the relevant areas
(security/selinux, net/netlabel, net/netfilter, net/xfrm, net/ipv4,
net/ipv6) compiled without issue. I will continue to try and get a
kernel compiled but I thought getting this out in a reasonable
timeframe to minimize merge issues was a better decision. Thse patches
applied to 2.6.24 do compile, boot, and run without any known
regressions.
--
paul moore
linux security @ hp
^ permalink raw reply
* [VLAN]: set_rx_mode support for unicast address list
From: Patrick McHardy @ 2008-01-29 15:09 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 8731 bytes --]
commit fbf2742ff936c751444ae610ae45c6ef54c14658
Author: Chris Leech <christopher.leech@intel.com>
Date: Thu Jan 24 18:24:53 2008 +0100
[VLAN]: set_rx_mode support for unicast address list
Reuse the existing logic for multicast list synchronization for the unicast
address list. The core of dev_mc_sync/unsync are split out as
__dev_addr_sync/unsync and moved from dev_mcast.c to dev.c. These are then
used to implement dev_unicast_sync/unsync as well.
I'm working on cleaning up Intel's FCoE stack, which generates new MAC
addresses from the fibre channel device id assigned by the fabric as per the
current draft specification in T11. When using such a protocol in a VLAN
environment it would be nice to not always be forced into promiscuous mode,
assuming the underlying Ethernet driver supports multiple unicast addresses as
well.
Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b0813c3..047d432 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1414,12 +1414,16 @@ extern void dev_set_rx_mode(struct net_device *dev);
extern void __dev_set_rx_mode(struct net_device *dev);
extern int dev_unicast_delete(struct net_device *dev, void *addr, int alen);
extern int dev_unicast_add(struct net_device *dev, void *addr, int alen);
+extern int dev_unicast_sync(struct net_device *to, struct net_device *from);
+extern void dev_unicast_unsync(struct net_device *to, struct net_device *from);
extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all);
extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
extern int dev_mc_sync(struct net_device *to, struct net_device *from);
extern void dev_mc_unsync(struct net_device *to, struct net_device *from);
extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all);
extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
+extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
+extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
extern void dev_set_promiscuity(struct net_device *dev, int inc);
extern void dev_set_allmulti(struct net_device *dev, int inc);
extern void netdev_state_change(struct net_device *dev);
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 8059fa4..77f04e4 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -563,6 +563,7 @@ static int vlan_dev_stop(struct net_device *dev)
struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
dev_mc_unsync(real_dev, dev);
+ dev_unicast_unsync(real_dev, dev);
if (dev->flags & IFF_ALLMULTI)
dev_set_allmulti(real_dev, -1);
if (dev->flags & IFF_PROMISC)
@@ -634,9 +635,10 @@ static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1);
}
-static void vlan_dev_set_multicast_list(struct net_device *vlan_dev)
+static void vlan_dev_set_rx_mode(struct net_device *vlan_dev)
{
dev_mc_sync(vlan_dev_info(vlan_dev)->real_dev, vlan_dev);
+ dev_unicast_sync(vlan_dev_info(vlan_dev)->real_dev, vlan_dev);
}
/*
@@ -702,7 +704,8 @@ void vlan_setup(struct net_device *dev)
dev->open = vlan_dev_open;
dev->stop = vlan_dev_stop;
dev->set_mac_address = vlan_dev_set_mac_address;
- dev->set_multicast_list = vlan_dev_set_multicast_list;
+ dev->set_rx_mode = vlan_dev_set_rx_mode;
+ dev->set_multicast_list = vlan_dev_set_rx_mode;
dev->change_rx_flags = vlan_dev_change_rx_flags;
dev->do_ioctl = vlan_dev_ioctl;
dev->destructor = free_netdev;
diff --git a/net/core/dev.c b/net/core/dev.c
index c9c593e..edaff27 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2962,6 +2962,102 @@ int dev_unicast_add(struct net_device *dev, void *addr, int alen)
}
EXPORT_SYMBOL(dev_unicast_add);
+int __dev_addr_sync(struct dev_addr_list **to, int *to_count,
+ struct dev_addr_list **from, int *from_count)
+{
+ struct dev_addr_list *da, *next;
+ int err = 0;
+
+ da = *from;
+ while (da != NULL) {
+ next = da->next;
+ if (!da->da_synced) {
+ err = __dev_addr_add(to, to_count,
+ da->da_addr, da->da_addrlen, 0);
+ if (err < 0)
+ break;
+ da->da_synced = 1;
+ da->da_users++;
+ } else if (da->da_users == 1) {
+ __dev_addr_delete(to, to_count,
+ da->da_addr, da->da_addrlen, 0);
+ __dev_addr_delete(from, from_count,
+ da->da_addr, da->da_addrlen, 0);
+ }
+ da = next;
+ }
+ return err;
+}
+
+void __dev_addr_unsync(struct dev_addr_list **to, int *to_count,
+ struct dev_addr_list **from, int *from_count)
+{
+ struct dev_addr_list *da, *next;
+
+ da = *from;
+ while (da != NULL) {
+ next = da->next;
+ if (da->da_synced) {
+ __dev_addr_delete(to, to_count,
+ da->da_addr, da->da_addrlen, 0);
+ da->da_synced = 0;
+ __dev_addr_delete(from, from_count,
+ da->da_addr, da->da_addrlen, 0);
+ }
+ da = next;
+ }
+}
+
+/**
+ * dev_unicast_sync - Synchronize device's unicast list to another device
+ * @to: destination device
+ * @from: source device
+ *
+ * Add newly added addresses to the destination device and release
+ * addresses that have no users left. The source device must be
+ * locked by netif_tx_lock_bh.
+ *
+ * This function is intended to be called from the dev->set_rx_mode
+ * function of layered software devices.
+ */
+int dev_unicast_sync(struct net_device *to, struct net_device *from)
+{
+ int err = 0;
+
+ netif_tx_lock_bh(to);
+ err = __dev_addr_sync(&to->uc_list, &to->uc_count,
+ &from->uc_list, &from->uc_count);
+ if (!err)
+ __dev_set_rx_mode(to);
+ netif_tx_unlock_bh(to);
+ return err;
+}
+EXPORT_SYMBOL(dev_unicast_sync);
+
+/**
+ * dev_unicast_unsync - Remove synchronized addresses from the destination
+ * device
+ * @to: destination device
+ * @from: source device
+ *
+ * Remove all addresses that were added to the destination device by
+ * dev_unicast_sync(). This function is intended to be called from the
+ * dev->stop function of layered software devices.
+ */
+void dev_unicast_unsync(struct net_device *to, struct net_device *from)
+{
+ netif_tx_lock_bh(from);
+ netif_tx_lock_bh(to);
+
+ __dev_addr_unsync(&to->uc_list, &to->uc_count,
+ &from->uc_list, &from->uc_count);
+ __dev_set_rx_mode(to);
+
+ netif_tx_unlock_bh(to);
+ netif_tx_unlock_bh(from);
+}
+EXPORT_SYMBOL(dev_unicast_unsync);
+
static void __dev_addr_discard(struct dev_addr_list **list)
{
struct dev_addr_list *tmp;
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c
index cadbfbf..cec5825 100644
--- a/net/core/dev_mcast.c
+++ b/net/core/dev_mcast.c
@@ -113,32 +113,15 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)
* locked by netif_tx_lock_bh.
*
* This function is intended to be called from the dev->set_multicast_list
- * function of layered software devices.
+ * or dev->set_rx_mode function of layered software devices.
*/
int dev_mc_sync(struct net_device *to, struct net_device *from)
{
- struct dev_addr_list *da, *next;
int err = 0;
netif_tx_lock_bh(to);
- da = from->mc_list;
- while (da != NULL) {
- next = da->next;
- if (!da->da_synced) {
- err = __dev_addr_add(&to->mc_list, &to->mc_count,
- da->da_addr, da->da_addrlen, 0);
- if (err < 0)
- break;
- da->da_synced = 1;
- da->da_users++;
- } else if (da->da_users == 1) {
- __dev_addr_delete(&to->mc_list, &to->mc_count,
- da->da_addr, da->da_addrlen, 0);
- __dev_addr_delete(&from->mc_list, &from->mc_count,
- da->da_addr, da->da_addrlen, 0);
- }
- da = next;
- }
+ err = __dev_addr_sync(&to->mc_list, &to->mc_count,
+ &from->mc_list, &from->mc_count);
if (!err)
__dev_set_rx_mode(to);
netif_tx_unlock_bh(to);
@@ -160,23 +143,11 @@ EXPORT_SYMBOL(dev_mc_sync);
*/
void dev_mc_unsync(struct net_device *to, struct net_device *from)
{
- struct dev_addr_list *da, *next;
-
netif_tx_lock_bh(from);
netif_tx_lock_bh(to);
- da = from->mc_list;
- while (da != NULL) {
- next = da->next;
- if (da->da_synced) {
- __dev_addr_delete(&to->mc_list, &to->mc_count,
- da->da_addr, da->da_addrlen, 0);
- da->da_synced = 0;
- __dev_addr_delete(&from->mc_list, &from->mc_count,
- da->da_addr, da->da_addrlen, 0);
- }
- da = next;
- }
+ __dev_addr_unsync(&to->mc_list, &to->mc_count,
+ &from->mc_list, &from->mc_count);
__dev_set_rx_mode(to);
netif_tx_unlock_bh(to);
^ permalink raw reply related
* [PATCH net-2.6.25] [MACVLAN] Setting macvlan_handle_frame_hook to NULL when rtnl_link_register() fails.
From: Rami Rosen @ 2008-01-29 15:14 UTC (permalink / raw)
To: kaber, netdev
[-- Attachment #1: Type: text/plain, Size: 357 bytes --]
Hi,
In drivers/net/macvlan.c, when rtnl_link_register() fails
in macvlan_init_module(), there is no point to set it (second time in this
method) to macvlan_handle_frame; macvlan_init_module() will return a negative
number, so instead this patch sets macvlan_handle_frame_hook to NULL.
Regards,
Rami Rosen
Signed-off-by: Rami Rosen <ramirose@gmail.com>
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 405 bytes --]
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 6ef6b8b..f651a81 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -508,7 +508,7 @@ static int __init macvlan_init_module(void)
goto err1;
return 0;
err1:
- macvlan_handle_frame_hook = macvlan_handle_frame;
+ macvlan_handle_frame_hook = NULL;
unregister_netdevice_notifier(&macvlan_notifier_block);
return err;
}
^ permalink raw reply related
* Re: [PATCH net-2.6.25] [MACVLAN] Setting macvlan_handle_frame_hook to NULL when rtnl_link_register() fails.
From: Patrick McHardy @ 2008-01-29 15:19 UTC (permalink / raw)
To: Rami Rosen; +Cc: netdev, David S. Miller
In-Reply-To: <eb3ff54b0801290714ja7e7e67t3349028b7db8dc5e@mail.gmail.com>
Rami Rosen wrote:
> Hi,
> In drivers/net/macvlan.c, when rtnl_link_register() fails
> in macvlan_init_module(), there is no point to set it (second time in this
> method) to macvlan_handle_frame; macvlan_init_module() will return a negative
> number, so instead this patch sets macvlan_handle_frame_hook to NULL.
Indeed, that seems to be a stupid cut-and-paste error. Thanks for
catching this.
Dave, please apply.
^ permalink raw reply
* Re: sky2: tx hang on dual-port Yukon XL when rx csum disabled
From: Tony Battersby @ 2008-01-29 15:26 UTC (permalink / raw)
To: Stephen Hemminger, netdev
In-Reply-To: <479E2247.8080109@cybernetics.com>
Tony Battersby wrote:
> "iperf -c 192.168.1.1" never finishes, but "iperf -c 192.168.2.1" does
> finish. Press Ctrl-C to abort the hung iperf. Ping 192.168.1.1 does
> not respond. Ping 192.168.2.1 does respond, but each ping has almost
> exactly 1 second latency (the latency should be < 1 ms).
>
>
Update: after triggering the problem, the ping latency on the interface
that still responds is the same as the ping interval. The default ping
interval is 1 second, so in my initial test I was seeing a 1 second ping
latency. If I do "ping -i 2 192.168.2.1", then each ping takes 2
seconds to receive the response. If I do "ping -i 5 192.168.2.1", then
each ping takes 5 seconds to receive the response. This implies that
the network stack doesn't realize that it received the ping reply until
it goes to send another ping.
Hope that helps.
Tony Battersby
Cybernetics
^ permalink raw reply
* [NET_SCHED]: sch_ingress: remove netfilter support
From: Patrick McHardy @ 2008-01-29 15:28 UTC (permalink / raw)
To: David S. Miller; +Cc: jamal, Linux Netdev List
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 4402 bytes --]
commit 3b27667029825ba16f8509fb119bca1b445a3dc9
Author: Patrick McHardy <kaber@trash.net>
Date: Mon Jan 28 13:57:56 2008 +0100
[NET_SCHED]: sch_ingress: remove netfilter support
Since the old policer code is gone, TC actions are needed for policing.
The ingress qdisc can get packets directly from netif_receive_skb()
in case TC actions are enabled or through netfilter otherwise, but
since without TC actions there is no policer the only thing it actually
does is count packets.
Remove the netfilter support and always require TC actions.
Signed-off-by: Patrick McHardy <kaber@trash.net>
diff --git a/net/sched/Kconfig b/net/sched/Kconfig
index 87af7c9..7d4085a 100644
--- a/net/sched/Kconfig
+++ b/net/sched/Kconfig
@@ -198,7 +198,7 @@ config NET_SCH_NETEM
config NET_SCH_INGRESS
tristate "Ingress Qdisc"
- depends on NET_CLS_ACT || NETFILTER
+ depends on NET_CLS_ACT
---help---
Say Y here if you want to use classifiers for incoming packets.
If unsure, say Y.
diff --git a/net/sched/sch_ingress.c b/net/sched/sch_ingress.c
index 3f72d52..274b1dd 100644
--- a/net/sched/sch_ingress.c
+++ b/net/sched/sch_ingress.c
@@ -12,18 +12,10 @@
#include <linux/list.h>
#include <linux/skbuff.h>
#include <linux/rtnetlink.h>
-#include <linux/netfilter_ipv4.h>
-#include <linux/netfilter_ipv6.h>
-#include <linux/netfilter.h>
#include <net/netlink.h>
#include <net/pkt_sched.h>
-/* Thanks to Doron Oz for this hack */
-#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
-static int nf_registered;
-#endif
-
struct ingress_qdisc_data {
struct tcf_proto *filter_list;
};
@@ -84,11 +76,6 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
result = tc_classify(skb, p->filter_list, &res);
- /*
- * Unlike normal "enqueue" functions, ingress_enqueue returns a
- * firewall FW_* code.
- */
-#ifdef CONFIG_NET_CLS_ACT
sch->bstats.packets++;
sch->bstats.bytes += skb->len;
switch (result) {
@@ -107,71 +94,10 @@ static int ingress_enqueue(struct sk_buff *skb, struct Qdisc *sch)
result = TC_ACT_OK;
break;
}
-#else
- result = NF_ACCEPT;
- sch->bstats.packets++;
- sch->bstats.bytes += skb->len;
-#endif
return result;
}
-#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
-static unsigned int ing_hook(unsigned int hook, struct sk_buff *skb,
- const struct net_device *indev,
- const struct net_device *outdev,
- int (*okfn)(struct sk_buff *))
-{
-
- struct Qdisc *q;
- struct net_device *dev = skb->dev;
- int fwres = NF_ACCEPT;
-
- if (dev->qdisc_ingress) {
- spin_lock(&dev->ingress_lock);
- if ((q = dev->qdisc_ingress) != NULL)
- fwres = q->enqueue(skb, q);
- spin_unlock(&dev->ingress_lock);
- }
-
- return fwres;
-}
-
-/* after ipt_filter */
-static struct nf_hook_ops ing_ops[] __read_mostly = {
- {
- .hook = ing_hook,
- .owner = THIS_MODULE,
- .pf = PF_INET,
- .hooknum = NF_INET_PRE_ROUTING,
- .priority = NF_IP_PRI_FILTER + 1,
- },
- {
- .hook = ing_hook,
- .owner = THIS_MODULE,
- .pf = PF_INET6,
- .hooknum = NF_INET_PRE_ROUTING,
- .priority = NF_IP6_PRI_FILTER + 1,
- },
-};
-#endif
-
-static int ingress_init(struct Qdisc *sch, struct nlattr *opt)
-{
-#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
- printk("Ingress scheduler: Classifier actions prefered over netfilter\n");
-
- if (!nf_registered) {
- if (nf_register_hooks(ing_ops, ARRAY_SIZE(ing_ops)) < 0) {
- printk("ingress qdisc registration error \n");
- return -EINVAL;
- }
- nf_registered++;
- }
-#endif
- return 0;
-}
-
/* ------------------------------------------------------------- */
static void ingress_destroy(struct Qdisc *sch)
@@ -213,7 +139,6 @@ static struct Qdisc_ops ingress_qdisc_ops __read_mostly = {
.id = "ingress",
.priv_size = sizeof(struct ingress_qdisc_data),
.enqueue = ingress_enqueue,
- .init = ingress_init,
.destroy = ingress_destroy,
.dump = ingress_dump,
.owner = THIS_MODULE,
@@ -227,10 +152,6 @@ static int __init ingress_module_init(void)
static void __exit ingress_module_exit(void)
{
unregister_qdisc(&ingress_qdisc_ops);
-#if !defined(CONFIG_NET_CLS_ACT) && defined(CONFIG_NETFILTER)
- if (nf_registered)
- nf_unregister_hooks(ing_ops, ARRAY_SIZE(ing_ops));
-#endif
}
module_init(ingress_module_init)
^ permalink raw reply related
* [PATCH] PHYLIB: Locking fixes for PHY I/O potentially sleeping
From: Nate Case @ 2008-01-29 16:05 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Andy Fleming, David S. Miller, netdev
In-Reply-To: <479E76A2.8020304@garzik.org>
PHY read/write functions can potentially sleep (e.g., a PHY accessed
via I2C). The following changes were made to account for this:
* Change spin locks to mutex locks
* Add a BUG_ON() to phy_read() phy_write() to warn against
calling them from an interrupt context.
* Use work queue for PHY state machine handling since
it can potentially sleep
* Change phydev lock from spinlock to mutex
Signed-off-by: Nate Case <ncase@xes-inc.com>
Acked-by: Andy Fleming <afleming@freescale.com>
---
Note: This is a resend of the patch submitted on January 3rd, 2008
drivers/net/phy/mdio_bus.c | 2 +-
drivers/net/phy/phy.c | 68 ++++++++++++++++++++++++++++-------------
drivers/net/phy/phy_device.c | 11 +++----
include/linux/phy.h | 5 ++-
4 files changed, 55 insertions(+), 31 deletions(-)
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index c30196d..6e9f619 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -49,7 +49,7 @@ int mdiobus_register(struct mii_bus *bus)
int i;
int err = 0;
- spin_lock_init(&bus->mdio_lock);
+ mutex_init(&bus->mdio_lock);
if (NULL == bus || NULL == bus->name ||
NULL == bus->read ||
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 7c9e6e3..12fccb1 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -26,7 +26,6 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mii.h>
@@ -72,9 +71,11 @@ int phy_read(struct phy_device *phydev, u16 regnum)
int retval;
struct mii_bus *bus = phydev->bus;
- spin_lock_bh(&bus->mdio_lock);
+ BUG_ON(in_interrupt());
+
+ mutex_lock(&bus->mdio_lock);
retval = bus->read(bus, phydev->addr, regnum);
- spin_unlock_bh(&bus->mdio_lock);
+ mutex_unlock(&bus->mdio_lock);
return retval;
}
@@ -95,9 +96,11 @@ int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
int err;
struct mii_bus *bus = phydev->bus;
- spin_lock_bh(&bus->mdio_lock);
+ BUG_ON(in_interrupt());
+
+ mutex_lock(&bus->mdio_lock);
err = bus->write(bus, phydev->addr, regnum, val);
- spin_unlock_bh(&bus->mdio_lock);
+ mutex_unlock(&bus->mdio_lock);
return err;
}
@@ -428,7 +431,7 @@ int phy_start_aneg(struct phy_device *phydev)
{
int err;
- spin_lock_bh(&phydev->lock);
+ mutex_lock(&phydev->lock);
if (AUTONEG_DISABLE == phydev->autoneg)
phy_sanitize_settings(phydev);
@@ -449,13 +452,14 @@ int phy_start_aneg(struct phy_device *phydev)
}
out_unlock:
- spin_unlock_bh(&phydev->lock);
+ mutex_unlock(&phydev->lock);
return err;
}
EXPORT_SYMBOL(phy_start_aneg);
static void phy_change(struct work_struct *work);
+static void phy_state_machine(struct work_struct *work);
static void phy_timer(unsigned long data);
/**
@@ -476,6 +480,7 @@ void phy_start_machine(struct phy_device *phydev,
{
phydev->adjust_state = handler;
+ INIT_WORK(&phydev->state_queue, phy_state_machine);
init_timer(&phydev->phy_timer);
phydev->phy_timer.function = &phy_timer;
phydev->phy_timer.data = (unsigned long) phydev;
@@ -493,11 +498,12 @@ void phy_start_machine(struct phy_device *phydev,
void phy_stop_machine(struct phy_device *phydev)
{
del_timer_sync(&phydev->phy_timer);
+ cancel_work_sync(&phydev->state_queue);
- spin_lock_bh(&phydev->lock);
+ mutex_lock(&phydev->lock);
if (phydev->state > PHY_UP)
phydev->state = PHY_UP;
- spin_unlock_bh(&phydev->lock);
+ mutex_unlock(&phydev->lock);
phydev->adjust_state = NULL;
}
@@ -541,9 +547,9 @@ static void phy_force_reduction(struct phy_device *phydev)
*/
void phy_error(struct phy_device *phydev)
{
- spin_lock_bh(&phydev->lock);
+ mutex_lock(&phydev->lock);
phydev->state = PHY_HALTED;
- spin_unlock_bh(&phydev->lock);
+ mutex_unlock(&phydev->lock);
}
/**
@@ -705,10 +711,10 @@ static void phy_change(struct work_struct *work)
if (err)
goto phy_err;
- spin_lock_bh(&phydev->lock);
+ mutex_lock(&phydev->lock);
if ((PHY_RUNNING == phydev->state) || (PHY_NOLINK == phydev->state))
phydev->state = PHY_CHANGELINK;
- spin_unlock_bh(&phydev->lock);
+ mutex_unlock(&phydev->lock);
atomic_dec(&phydev->irq_disable);
enable_irq(phydev->irq);
@@ -735,7 +741,7 @@ phy_err:
*/
void phy_stop(struct phy_device *phydev)
{
- spin_lock_bh(&phydev->lock);
+ mutex_lock(&phydev->lock);
if (PHY_HALTED == phydev->state)
goto out_unlock;
@@ -751,7 +757,7 @@ void phy_stop(struct phy_device *phydev)
phydev->state = PHY_HALTED;
out_unlock:
- spin_unlock_bh(&phydev->lock);
+ mutex_unlock(&phydev->lock);
/*
* Cannot call flush_scheduled_work() here as desired because
@@ -773,7 +779,7 @@ out_unlock:
*/
void phy_start(struct phy_device *phydev)
{
- spin_lock_bh(&phydev->lock);
+ mutex_lock(&phydev->lock);
switch (phydev->state) {
case PHY_STARTING:
@@ -787,19 +793,26 @@ void phy_start(struct phy_device *phydev)
default:
break;
}
- spin_unlock_bh(&phydev->lock);
+ mutex_unlock(&phydev->lock);
}
EXPORT_SYMBOL(phy_stop);
EXPORT_SYMBOL(phy_start);
-/* PHY timer which handles the state machine */
-static void phy_timer(unsigned long data)
+/**
+ * phy_state_machine - Handle the state machine
+ * @work: work_struct that describes the work to be done
+ *
+ * Description: Scheduled by the state_queue workqueue each time
+ * phy_timer is triggered.
+ */
+static void phy_state_machine(struct work_struct *work)
{
- struct phy_device *phydev = (struct phy_device *)data;
+ struct phy_device *phydev =
+ container_of(work, struct phy_device, state_queue);
int needs_aneg = 0;
int err = 0;
- spin_lock_bh(&phydev->lock);
+ mutex_lock(&phydev->lock);
if (phydev->adjust_state)
phydev->adjust_state(phydev->attached_dev);
@@ -965,7 +978,7 @@ static void phy_timer(unsigned long data)
break;
}
- spin_unlock_bh(&phydev->lock);
+ mutex_unlock(&phydev->lock);
if (needs_aneg)
err = phy_start_aneg(phydev);
@@ -976,3 +989,14 @@ static void phy_timer(unsigned long data)
mod_timer(&phydev->phy_timer, jiffies + PHY_STATE_TIME * HZ);
}
+/* PHY timer which schedules the state machine work */
+static void phy_timer(unsigned long data)
+{
+ struct phy_device *phydev = (struct phy_device *)data;
+
+ /*
+ * PHY I/O operations can potentially sleep so we ensure that
+ * it's done from a process context
+ */
+ schedule_work(&phydev->state_queue);
+}
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 5b9e175..f4c4fd8 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -25,7 +25,6 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mii.h>
@@ -80,7 +79,7 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
dev->state = PHY_DOWN;
- spin_lock_init(&dev->lock);
+ mutex_init(&dev->lock);
return dev;
}
@@ -656,7 +655,7 @@ static int phy_probe(struct device *dev)
if (!(phydrv->flags & PHY_HAS_INTERRUPT))
phydev->irq = PHY_POLL;
- spin_lock_bh(&phydev->lock);
+ mutex_lock(&phydev->lock);
/* Start out supporting everything. Eventually,
* a controller will attach, and may modify one
@@ -670,7 +669,7 @@ static int phy_probe(struct device *dev)
if (phydev->drv->probe)
err = phydev->drv->probe(phydev);
- spin_unlock_bh(&phydev->lock);
+ mutex_unlock(&phydev->lock);
return err;
@@ -682,9 +681,9 @@ static int phy_remove(struct device *dev)
phydev = to_phy_device(dev);
- spin_lock_bh(&phydev->lock);
+ mutex_lock(&phydev->lock);
phydev->state = PHY_DOWN;
- spin_unlock_bh(&phydev->lock);
+ mutex_unlock(&phydev->lock);
if (phydev->drv->remove)
phydev->drv->remove(phydev);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 554836e..5e43ae7 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -88,7 +88,7 @@ struct mii_bus {
/* A lock to ensure that only one thing can read/write
* the MDIO bus at a time */
- spinlock_t mdio_lock;
+ struct mutex mdio_lock;
struct device *dev;
@@ -284,10 +284,11 @@ struct phy_device {
/* Interrupt and Polling infrastructure */
struct work_struct phy_queue;
+ struct work_struct state_queue;
struct timer_list phy_timer;
atomic_t irq_disable;
- spinlock_t lock;
+ struct mutex lock;
struct net_device *attached_dev;
--
1.5.3.3
^ permalink raw reply related
* SKBs with shared fragments
From: kristrev @ 2008-01-29 16:17 UTC (permalink / raw)
To: netdev
Hello,
I am working on a patch to the TCP-code that, among others, share
fragments between skbs, and have encountered a problem that I'm not sure
if I have solved correctly.
To share a fragment, I copy the skb_frag-struct to the correct place in
the other skbs frags-array, increase the page-counter, skb->data_len,
skb->len, skb->end_seq and gso_segs/gso_size, and calculate a new
checksum.
The problem is the skb->truesize-variable. Currently I do not increase it,
leading to a SKB BUG because truesize is less than (skb->len +
sizeof(struct skb)). When I increase/decrease truesize, both the
wmem_queue and sk_forward_alloc is something else than zero and the socket
leaks memory.
The kernel does not halt and all the data is received correctly in both
cases.
The reason that I currently don't increase/decrease truesize is that, at
least if I have understod the code correctly, truesize says something
about how much memory an skb actually consumes. And since I only copy
existing fragments into it, I don't use any more memory.
Is this correct, or should I increase/decrease truesize as well? Also, is
there a better way to share fragments between skbs?
Thanks in advance for any replies,
Kristian
^ permalink raw reply
* [PATCH] PHYLIB: Add BCM5482 PHY support
From: Nate Case @ 2008-01-29 16:19 UTC (permalink / raw)
To: Andy Fleming; +Cc: netdev
This Broadcom PHY is similar to other bcm54xx devices.
Signed-off-by: Nate Case <ncase@xes-inc.com>
---
drivers/net/phy/broadcom.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 29666c8..5b80358 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -141,6 +141,20 @@ static struct phy_driver bcm5461_driver = {
.driver = { .owner = THIS_MODULE },
};
+static struct phy_driver bcm5482_driver = {
+ .phy_id = 0x0143bcb0,
+ .phy_id_mask = 0xfffffff0,
+ .name = "Broadcom BCM5482",
+ .features = PHY_GBIT_FEATURES,
+ .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
+ .config_init = bcm54xx_config_init,
+ .config_aneg = genphy_config_aneg,
+ .read_status = genphy_read_status,
+ .ack_interrupt = bcm54xx_ack_interrupt,
+ .config_intr = bcm54xx_config_intr,
+ .driver = { .owner = THIS_MODULE },
+};
+
static int __init broadcom_init(void)
{
int ret;
@@ -154,8 +168,13 @@ static int __init broadcom_init(void)
ret = phy_driver_register(&bcm5461_driver);
if (ret)
goto out_5461;
+ ret = phy_driver_register(&bcm5482_driver);
+ if (ret)
+ goto out_5482;
return ret;
+out_5482:
+ phy_driver_unregister(&bcm5461_driver);
out_5461:
phy_driver_unregister(&bcm5421_driver);
out_5421:
@@ -166,6 +185,7 @@ out_5411:
static void __exit broadcom_exit(void)
{
+ phy_driver_unregister(&bcm5482_driver);
phy_driver_unregister(&bcm5461_driver);
phy_driver_unregister(&bcm5421_driver);
phy_driver_unregister(&bcm5411_driver);
--
1.5.3.3
^ permalink raw reply related
* [PATCH] New driver "sfc" for Solarstorm SFC4000 controller
From: Ben Hutchings @ 2008-01-29 16:22 UTC (permalink / raw)
To: netdev; +Cc: Jeff Garzik, linux-net-drivers
This is a resubmission of a new driver for Solarflare network controllers.
The driver supports several types of PHY (10Gbase-T, XFP, CX4) on six
different 10G and 1G boards. It is accompanied by an MTD driver that
allows access to the flash/EEPROM.
NICs based on this controller are now available from SMC as part numbers
SMC10GPCIe-XFP and SMC10GPCIe-10BT.
FYI the previous thread was:
http://marc.info/?l=linux-netdev&m=120067352032298&w=4
Things that have changed since the last patch:
- Changed ethtool support to use the default ethtool implementations
where possible
- Removed unused MDIO functions
- Combined struct efx_nic and struct efx_nic_port, since the driver
now only supports 1-port configurations
- Removed/combined redundant members of struct efx_nic
- Moved some constant members of struct efx_nic into struct efx_nic_type
- Moved the two steps of efx_nic::dma_mask initialisation together
- Eliminated efx_nic::features and efx_nic_type::features; moved all
feature flag setting into efx_init_netdev()
- Fixed page-based RX buffer alignment for architectures with strict
alignment
- Replaced spinlocks with mutexes where possible
- Merged efx_{init,fini}_debugfs_nic_symlink into
efx_{init,fini}_debugfs_netdev
- Renamed efx_{init,fini}_netdev and corrected comments to
indicate that they only (un)register the net device
- Added EFX_FTL - fatal in debug builds otherwise equivalent to EFX_ERR
- Changed RX FIFO watermarks to more reasonable values
- Fixed various corner cases in PHY reconfiguration
- Changed NET_DEV_NAME() to use efx->name, making races with
(un)registration harmless
- Fixed repetition of PCI or net device name in log messages
- Renamed falcon_nic_params structure to falcon_nic_data
- Fixed spelling, capitalisation, grammar, punctuation, spacing
in various comments and log messages
We believe this is ready to be merged now and would like to know if
there is anything remaining that we need to fix or improve.
The patch (against netdev-2.6) is at:
https://support.solarflare.com/netdev/6/netdev-2.6-sfc-2.2.0056.patch
The new files may also be downloaded as a tarball:
https://support.solarflare.com/netdev/6/netdev-2.6-sfc-2.2.0056.tgz
And for verification there is:
https://support.solarflare.com/netdev/6/MD5SUMS
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
^ permalink raw reply
* [PATCH] pktgen: pktgen should not print info that it is spinning
From: Jesse Brandeburg @ 2008-01-28 21:16 UTC (permalink / raw)
To: netdev; +Cc: davem, auke-jan.h.kok, Jesse Brandeburg, Robert Olsson
when using pktgen to send delay packets the module prints repeatedly to the
kernel log:
sleeping for X
sleeping for X
...
This is probably just a debugging item left in and should not be enabled for
regular use of the module.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Robert Olsson <Robert.Olsson@data.slu.se>
---
net/core/pktgen.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 285ec3e..b1b1aba 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2138,7 +2138,6 @@ static void spin(struct pktgen_dev *pkt_dev, __u64 spin_until_us)
__u64 now;
start = now = getCurUs();
- printk(KERN_INFO "sleeping for %d\n", (int)(spin_until_us - now));
while (now < spin_until_us) {
/* TODO: optimize sleeping behavior */
if (spin_until_us - now > jiffies_to_usecs(1) + 1)
^ permalink raw reply related
* status inquiry#2 (RE: [PATCH 01/03] ISATAP V2 (header file changes))
From: Templin, Fred L @ 2008-01-29 16:41 UTC (permalink / raw)
To: netdev; +Cc: YOSHIFUJI Hideaki / 吉藤英明
In-Reply-To: <39C363776A4E8C4A94691D2BD9D1C9A1029EDDAC@XCH-NW-7V2.nw.nos.boeing.com>
Would appreciate a status update on this submission, posted 1/15/08.
Thanks - Fred
fred.l.templin@boeing.com
> -----Original Message-----
> From: Templin, Fred L
> Sent: Tuesday, January 15, 2008 11:57 AM
> To: netdev@vger.kernel.org
> Cc: YOSHIFUJI Hideaki / 吉藤英明
> Subject: [PATCH 01/03] ISATAP V2 (header file changes)
>
> This patch updates the Linux the Intra-Site Automatic Tunnel
> Addressing
> Protocol (ISATAP) implementation. It places the ISATAP
> potential router
> list (PRL) in the kernel and adds three new private ioctls for PRL
> management. The diffs are specific to the netdev net-2.6.25
> development
> tree taken by "git pull" on 1/14/08.
>
> Signed-off-by: Fred L. Templin <fred.l.templin@boeing.com>
>
> --- net-2.6.25/include/linux/skbuff.h.orig 2008-01-14
> 15:33:36.000000000 -0800
> +++ net-2.6.25/include/linux/skbuff.h 2008-01-14
> 15:43:06.000000000 -0800
> @@ -311,7 +311,8 @@ struct sk_buff {
> __u16 tc_verd; /* traffic
> control verdict */
> #endif
> #endif
> - /* 2 byte hole */
> + __u8 rtr_type;
> + /* 1 byte hole */
>
> #ifdef CONFIG_NET_DMA
> dma_cookie_t dma_cookie;
> --- net-2.6.25/include/linux/if_tunnel.h.orig 2008-01-14
> 15:33:36.000000000 -0800
> +++ net-2.6.25/include/linux/if_tunnel.h 2008-01-14
> 15:42:14.000000000 -0800
> @@ -7,6 +7,9 @@
> #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1)
> #define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2)
> #define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3)
> +#define SIOCADDPRL (SIOCDEVPRIVATE + 4)
> +#define SIOCDELPRL (SIOCDEVPRIVATE + 5)
> +#define SIOCCHGPRL (SIOCDEVPRIVATE + 6)
>
> #define GRE_CSUM __constant_htons(0x8000)
> #define GRE_ROUTING __constant_htons(0x4000)
> @@ -17,9 +20,6 @@
> #define GRE_FLAGS __constant_htons(0x00F8)
> #define GRE_VERSION __constant_htons(0x0007)
>
> -/* i_flags values for SIT mode */
> -#define SIT_ISATAP 0x0001
> -
> struct ip_tunnel_parm
> {
> char name[IFNAMSIZ];
> @@ -30,5 +30,15 @@ struct ip_tunnel_parm
> __be32 o_key;
> struct iphdr iph;
> };
> +/* SIT-mode i_flags */
> +#define SIT_ISATAP 0x0001
> +
> +struct ip_tunnel_prladdr {
> + __be32 addr;
> + __be16 flags;
> + __be16 rsvd;
> +};
> +/* PRL flags */
> +#define PRL_BORDER 0x0001
>
> #endif /* _IF_TUNNEL_H_ */
> --- net-2.6.25/include/net/ipip.h.orig 2008-01-14
> 15:33:36.000000000 -0800
> +++ net-2.6.25/include/net/ipip.h 2008-01-14
> 15:41:21.000000000 -0800
> @@ -24,6 +24,13 @@ struct ip_tunnel
> int mlink;
>
> struct ip_tunnel_parm parms;
> + struct ip_tunnel_prlent *prl; /* potential
> router list */
> +};
> +
> +struct ip_tunnel_prlent
> +{
> + struct ip_tunnel_prlent *next;
> + struct ip_tunnel_prladdr ent;
> };
>
> #define IPTUNNEL_XMIT() do {
> \
> --- net-2.6.25/include/net/ndisc.h.orig 2008-01-14
> 15:40:28.000000000 -0800
> +++ net-2.6.25/include/net/ndisc.h 2008-01-15
> 08:43:21.000000000 -0800
> @@ -12,6 +12,16 @@
> #define NDISC_REDIRECT 137
>
> /*
> + * Router type: cross-layer information from link-layer to
> + * IPv6 layer reported by certain link types (e.g., RFC4214).
> + */
> +
> +#define RTRTYPE_UNSPEC 0 /*
> unspecified (default) */
> +#define RTRTYPE_HOST 1 /* host or
> unauthorized router */
> +#define RTRTYPE_INTERIOR 2 /* site-interior router */
> +#define RTRTYPE_BORDER 3 /* site
> border router */
> +
> +/*
> * ndisc options
> */
> --
> 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
>
^ permalink raw reply
* Re: Udev coldplugging loads 8139too driver instead of 8139cp
From: Ondrej Zary @ 2008-01-29 16:53 UTC (permalink / raw)
To: Michael Tokarev; +Cc: Stephen Hemminger, netdev, linux-kernel
In-Reply-To: <479F0369.3080309@msgid.tls.msk.ru>
On Tuesday 29 January 2008 11:43:53 Michael Tokarev wrote:
> Stephen Hemminger wrote:
> > On Tue, 29 Jan 2008 03:46:08 +0300
> > Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> []
>
> >> There are 2 drivers for 8139-based NICs. For really different two kinds
> >> of hardware, which both uses the same PCI identifiers. Both drivers
> >> "claims" to work with all NICs with those PCI ids, because "externally"
> >> (by means of udev for example) it's impossible to distinguish the two
> >> kinds of hardware, it becomes clean only when the driver (either of the
> >> two) loads and actually checks which hardware we have here.
> >
> > Is there any chance of using subdevice or subversion to tell them apart?
> > That worked for other vendors like DLINK who slapped same ID on different
> > cards.
>
> If it were that simple... ;)
>
> No. The difference is in PCI revision number (byte #8 in PCI config
> space). If it's >= 0x40 - it's 8139too, < 0x40 - 8139cp. Or 0x20 - I
> forgot.
Perhaps a module could be created that will claim this device ID and then use
the correct driver.
> Here's a code snippet from a shell script I used ages ago to automatically
> load modules (similar to what udev does nowadays):
>
> # special hack for 8139{too,cp} stuff
> case "$modalias" in
> *v000010ECd00008139*)
> rev="$(dd if="$1/config" bs=1 skip=8 count=1 2>/dev/null)"
> if [ -n "$rev" ]; then
> list=
> for module in $modlist; do
> case "$module" in
> 8139cp)
> if [ ".$rev" \< ". " ]; then
> $vecho1 "$TAG: not loading $module for this device"
> continue
> fi
> ;;
> 8139too)
> if [ ".$rev" \> ". " ]; then
> $vecho1 "$TAG: not loading $module for this device"
> continue
> fi
> ;;
> esac
> list="$list $module"
> done
> modlist="$list"
> fi
> ;;
> esac
>
> /mjt
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
Ondrej Zary
^ permalink raw reply
* [PATCH] forcedeth: mac address mcp77/79
From: Ayaz Abdulla @ 2008-01-28 15:24 UTC (permalink / raw)
To: Jeff Garzik, Andrew Morton, nedev, stable
[-- Attachment #1: Type: text/plain, Size: 205 bytes --]
This patch is a critical fix for MCP77 and MCP79 devices. The feature
flags were missing the define for correct mac address
(DEV_HAS_CORRECT_MACADDR).
Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
[-- Attachment #2: patch-forcedeth-macaddr-mcp77-79 --]
[-- Type: text/plain, Size: 4545 bytes --]
--- old/drivers/net/forcedeth.c 2008-01-28 10:15:28.000000000 -0500
+++ new/drivers/net/forcedeth.c 2008-01-28 10:17:38.000000000 -0500
@@ -5603,35 +5603,35 @@
},
{ /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_32),
- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{ /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_33),
- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{ /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_34),
- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{ /* MCP77 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_35),
- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{ /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_36),
- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{ /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_37),
- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{ /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_38),
- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{ /* MCP79 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39),
- .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+ .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
},
{0,},
};
^ permalink raw reply
* Re: forcedeth oops
From: Ayaz Abdulla @ 2008-01-28 15:31 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Andrew Brooks, netdev
In-Reply-To: <479643E0.8070208@garzik.org>
Jeff Garzik wrote:
> Andrew Brooks wrote:
> > Hello
> >
> > I'm getting an oops in forcedeth whenever I shutdown, details below.
> >
> > I've tried kernel 2.6.16.59 and the latest forcedeth.c from nvidia.com
> > which is package-1.23 version-0.62 date-2007/04/27.
> >
> > How can I download the latest forcedeth.c (including 2008-01-13
> patches) ?
> > It's not in the latest snapshot linux-2.6.24-rc8.
> >
> > Also, why is the version on nvidia.com not just older than the one in
> > the kernel, but it appears to have forked back in May 2006. Has there
> > been independent development on each version? They should be the same!
>
> We don't run nvidia.com here :)
>
>
> > Here's the diff:
> > < * 0.56: 22 Mar 2006: Additional ethtool and moduleparam support.
> > < * 0.57: 14 May 2006: Moved mac address writes to nv_probe and
> nv_remove.
> > < * 0.58: 20 May 2006: Optimized rx and tx data paths.
> > < * 0.59: 31 May 2006: Added support for sideband management unit.
> > < * 0.60: 31 May 2006: Added support for recoverable error.
> > < * 0.61: 18 Jul 2006: Added support for suspend/resume.
> > < * 0.62: 16 Jan 2007: Fixed statistics, mgmt communication, and
> low phy speed on S5.
> > ---
> >> * 0.56: 22 Mar 2006: Additional ethtool config and moduleparam
> support.
> >> * 0.57: 14 May 2006: Mac address set in probe/remove and order
> corrections.
> >> * 0.58: 30 Oct 2006: Added support for sideband management unit.
> >> * 0.59: 30 Oct 2006: Added support for recoverable error.
> >> * 0.60: 20 Jan 2007: Code optimizations for rings, rx & tx data
> paths, and stats.
> >
> >
> > Here's the details of the oops:
> > md: md0 switched to read-only mode.
> > Unable to handle kernel NULL pointer dereference at virtual address
> 00000000
> > printing eip:
> > f8ccdd55
> > *pde = 36c6a001
> > Oops: 0000 [#1]
> > SMP
> > Modules linked in: nvidia ... forcedeth ... sata_nv
> > CPU: 1
> > EIP:
> > EFLAGS: 00010286 (2.6.16.59 #1)
> > EIP is at nv_suspend+0x85/0x350 [forcedeth]
> > eax:
> > esi:
> > ds:
> > Process reboot
> > Stack:
> > Call Trace:
> > show_stack_log
> > show_registers
> > die
> > do_page_fault
> > error_code
> > nv_reboot_handler
> > notifier_call_chain
> > kernel_restart_prepare
> > kernel_restart
> > sys_reboot
> > sysenter_past_esp
> > Code: 8b 8c 3a 98 01 00 00 01 c8 8b ...
> > INIT: no more processes left in this runlevel
>
> Please reproduce this problem on a modern kernel (2.6.24-rc) without any
> closed source modules or drivers loaded. Thanks.
Andrew,
The driver from the nvidia.com site was forked because we needed to
create a backport driver package for older kernels. At some point, we
need to converge the two branches again.
Let us know if you still have an issue with the latest kernel as Jeff
mentioned.
Regards,
Ayaz
>
> Jeff
>
>
>
> --
> 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
>
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
^ permalink raw reply
* Still oopsing in nf_nat_move_storage()
From: Chuck Ebbert @ 2008-01-29 17:11 UTC (permalink / raw)
To: Netdev
nf_nat_move_storage():
/usr/src/debug/kernel-2.6.23/linux-2.6.23.i686/net/ipv4/netfilter/nf_nat_core.c:612
87: f7 47 64 80 01 00 00 testl $0x180,0x64(%edi)
8e: 74 39 je c9 <nf_nat_move_storage+0x65>
line 612:
if (!(ct->status & IPS_NAT_DONE_MASK))
return;
ct is NULL
To reproduce, this is the Fedora iptables config file:
*nat
:PREROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to :21
COMMIT
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p icmp --icmp-type any -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i eth0 -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
^ permalink raw reply
* Re: [PATCH] SELinux: Fix double free in selinux_netlbl_sock_setsid()
From: Paul Moore @ 2008-01-29 17:13 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, netdev, selinux, bunk, jmorris
In-Reply-To: <20080128.195124.188485009.davem@davemloft.net>
On Monday 28 January 2008 10:51:24 pm David Miller wrote:
> From: Paul Moore <paul.moore@hp.com>
> Date: Mon, 28 Jan 2008 21:20:26 -0500
>
> > As pointed out by Adrian Bunk, commit
> > 45c950e0f839fded922ebc0bfd59b1081cc71b70 caused a double-free when
> > security_netlbl_sid_to_secattr() fails. This patch fixes this by
> > removing the netlbl_secattr_destroy() call from that function since we
> > are already releasing the secattr memory in
> > selinux_netlbl_sock_setsid().
> >
> > Signed-off-by: Paul Moore <paul.moore@hp.com>
>
> Applied, and I'll queue this up for -stable too.
Thanks. Sorry for not catching this in the first place.
> Please, when mentioning specific commits please also provide
> the changelog headline along with the SHA1 hash.
>
> The reason is that when this fix is moved over to another
> tree where the SHA1 of the causing change is different people
> studying your fix won't be able to find it without more stable
> contextual information.
Noted, I'll make sure to include the patch description in the future. I
wasn't aware that the hash took into account anything other than the
individual commit it represented. However, now that I think about it, since
order is so critical it only makes sense to have the hash take into account
at least the previous commit.
--
paul moore
linux security @ hp
^ permalink raw reply
* Re: Still oopsing in nf_nat_move_storage()
From: Patrick McHardy @ 2008-01-29 17:18 UTC (permalink / raw)
To: Chuck Ebbert; +Cc: Netdev, Netfilter Development Mailinglist
In-Reply-To: <479F5E5A.8050108@redhat.com>
Chuck Ebbert wrote:
> nf_nat_move_storage():
> /usr/src/debug/kernel-2.6.23/linux-2.6.23.i686/net/ipv4/netfilter/nf_nat_core.c:612
> 87: f7 47 64 80 01 00 00 testl $0x180,0x64(%edi)
> 8e: 74 39 je c9 <nf_nat_move_storage+0x65>
>
> line 612:
> if (!(ct->status & IPS_NAT_DONE_MASK))
> return;
>
> ct is NULL
The current kernel (and 2.6.23-stable) have:
if (!ct || !(ct->status & IPS_NAT_DONE_MASK))
return;
so it seems you're using an old version.
^ permalink raw reply
* Re: [PATCH] bfin_mac: Make the MDIO polling faster
From: Bryan Wu @ 2008-01-29 17:47 UTC (permalink / raw)
To: Kalle Pokki; +Cc: netdev, Bryan Wu
In-Reply-To: <Pine.LNX.4.64.0801291427300.7503@pc-213-140-179-32.aina.net>
On Tue, 2008-01-29 at 20:28 +0800, Kalle Pokki wrote:
> The poll routine always got 10 ms penalty when called immediately
> after starting the transfer. The MDIO transfer takes 25.6 us at the
> noinal 2.5 MHz, so MAX_TIMEOUT_CNT being 500 is still big enough.
Exactly, but we got a same fixing already.
It will be sent out soon.
Thanks a lot
-Bryan
> ---
> drivers/net/bfin_mac.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
> index c199633..d2e6813 100644
> --- a/drivers/net/bfin_mac.c
> +++ b/drivers/net/bfin_mac.c
> @@ -296,7 +296,7 @@ static void mdio_poll(void)
>
> /* poll the STABUSY bit */
> while ((bfin_read_EMAC_STAADD()) & STABUSY) {
> - mdelay(10);
> + udelay(1);
> if (timeout_cnt-- < 0) {
> printk(KERN_ERR DRV_NAME
> ": wait MDC/MDIO transaction to complete
> timeout\n");
> --
> 1.4.4.2
>
^ permalink raw reply
* Re: [PATCH] bfin_mac: Fix MDIO clock frequency
From: Bryan Wu @ 2008-01-29 18:01 UTC (permalink / raw)
To: Kalle Pokki; +Cc: netdev, Bryan Wu
In-Reply-To: <Pine.LNX.4.64.0801291421440.7503@pc-213-140-179-32.aina.net>
On Tue, 2008-01-29 at 20:27 +0800, Kalle Pokki wrote:
> The clock divisor is set to all ones at reset.
> ---
> drivers/net/bfin_mac.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
> index eb97175..c199633 100644
> --- a/drivers/net/bfin_mac.c
> +++ b/drivers/net/bfin_mac.c
> @@ -425,7 +425,7 @@ static int mii_probe(struct net_device *dev)
>
> /* MDC = 2.5 MHz */
> sysctl = bfin_read_EMAC_SYSCTL();
> - sysctl |= SET_MDCDIV(24);
> + sysctl = (sysctl & ~MDCDIV) | SET_MDCDIV(24);
Good catch, I will apply this.
Actually, another patch will modified this operation, you patch can not
be applied cleanly:
>From e347fc2fdb8d8ecd8fa563929fcfa51759d5ac1c Mon Sep 17 00:00:00 2001
From: Bryan Wu <bryan.wu@analog.com>
Date: Fri, 11 Jan 2008 15:17:03 +0800
Subject: [PATCH] [Blackfin] EMAC driver: define MDC_CLK=2.5MHz and caculate mdc_div according to SCLK.
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
---
drivers/net/bfin_mac.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 4006a5d..ee39819 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -412,20 +412,26 @@ static void bf537_adjust_link(struct net_device *dev)
spin_unlock_irqrestore(&lp->lock, flags);
}
+/* MDC = 2.5 MHz */
+#define MDC_CLK 2500000
+
static int mii_probe(struct net_device *dev)
{
struct bf537mac_local *lp = netdev_priv(dev);
struct phy_device *phydev = NULL;
unsigned short sysctl;
int i;
+ u32 sclk, mdc_div;
/* Enable PHY output early */
if (!(bfin_read_VR_CTL() & PHYCLKOE))
bfin_write_VR_CTL(bfin_read_VR_CTL() | PHYCLKOE);
- /* MDC = 2.5 MHz */
+ sclk = get_sclk();
+ mdc_div = ((sclk / MDC_CLK) / 2) - 1;
+
sysctl = bfin_read_EMAC_SYSCTL();
- sysctl |= SET_MDCDIV(24);
+ sysctl |= SET_MDCDIV(mdc_div);
bfin_write_EMAC_SYSCTL(sysctl);
/* search for connect PHY device */
@@ -477,8 +483,10 @@ static int mii_probe(struct net_device *dev)
lp->phydev = phydev;
printk(KERN_INFO "%s: attached PHY driver [%s] "
- "(mii_bus:phy_addr=%s, irq=%d)\n",
- DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq);
+ "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)"
+ "@sclk=%dMHz)\n",
+ DRV_NAME, phydev->drv->name, phydev->dev.bus_id, phydev->irq,
+ MDC_CLK, mdc_div, sclk/1000000);
return 0;
}
--
1.5.3.4
Do you mind I modified you patch to against this one and send out as a patch set to upstream?
Regards,
-Bryan
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox