* [net-next.git 2/4] stmmac: update the driver Documentation and add EEE
From: Giuseppe CAVALLARO @ 2012-06-18 6:49 UTC (permalink / raw)
To: netdev
Cc: eric.dumazet, bhutchings, rayagond, davem, yuvalmin,
Giuseppe Cavallaro
In-Reply-To: <1340002187-9248-1-git-send-email-peppe.cavallaro@st.com>
This patch updates the stmmac's documentation adding
some missing files in the section used to describe the
internal driver's structure.
Also the patch adds a new section to describe the EEE support.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
Documentation/networking/stmmac.txt | 36 +++++++++++++++++++++++++++++-----
1 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/Documentation/networking/stmmac.txt b/Documentation/networking/stmmac.txt
index 5cb9a19..c676b9c 100644
--- a/Documentation/networking/stmmac.txt
+++ b/Documentation/networking/stmmac.txt
@@ -257,9 +257,11 @@ reset procedure etc).
o Makefile
o stmmac_main.c: main network device driver;
o stmmac_mdio.c: mdio functions;
+ o stmmac_pci: PCI driver;
+ o stmmac_platform.c: platform driver
o stmmac_ethtool.c: ethtool support;
o stmmac_timer.[ch]: timer code used for mitigating the driver dma interrupts
- Only tested on ST40 platforms based.
+ (only tested on ST40 platforms based);
o stmmac.h: private driver structure;
o common.h: common definitions and VFTs;
o descs.h: descriptor structure definitions;
@@ -269,9 +271,11 @@ reset procedure etc).
o dwmac100_core: MAC 100 core and dma code;
o dwmac100_dma.c: dma funtions for the MAC chip;
o dwmac1000.h: specific header file for the MAC;
- o dwmac_lib.c: generic DMA functions shared among chips
- o enh_desc.c: functions for handling enhanced descriptors
- o norm_desc.c: functions for handling normal descriptors
+ o dwmac_lib.c: generic DMA functions shared among chips;
+ o enh_desc.c: functions for handling enhanced descriptors;
+ o norm_desc.c: functions for handling normal descriptors;
+ o chain_mode.c/ring_mode.c:: functions to manage RING/CHAINED modes;
+ o mmc_core.c/mmc.h: Management MAC Counters;
5) Debug Information
@@ -304,7 +308,27 @@ All these are only useful during the developing stage
and should never enabled inside the code for general usage.
In fact, these can generate an huge amount of debug messages.
-6) TODO:
+6) Energy Efficient Ethernet
+
+Energy Efficient Ethernet(EEE) enables IEEE 802.3 MAC sublayer along
+with a family of Physical layer to operate in the Low power Idle(LPI)
+mode. The EEE mode supports the IEEE 802.3 MAC operation at 100Mbps,
+1000Mbps & 10Gbps.
+
+The LPI mode allows power saving by switching off parts of the
+communication device functionality when there is no data to be
+transmitted & received. The system on both the side of the link can
+disable some functionalities & save power during the period of low-link
+utilization. The MAC controls whether the system should enter or exit
+the LPI mode & communicate this to PHY.
+
+As soon as the interface is opened, the driver verifies if the EEE can
+be supported. This is done by looking at both the DMA HW capability
+register and the PHY devices MCD registers.
+To enter in Tx LPI mode the driver needs to have a software timer
+that enable and disable the LPI mode when there is nothing to be
+transmitted.
+
+7) TODO:
o XGMAC is not supported.
- o Add the EEE - Energy Efficient Ethernet
o Add the PTP - precision time protocol
--
1.7.4.4
^ permalink raw reply related
* [net-next.git 0/4] EEE for PAL and stmmac (V4)
From: Giuseppe CAVALLARO @ 2012-06-18 6:49 UTC (permalink / raw)
To: netdev
Cc: eric.dumazet, bhutchings, rayagond, davem, yuvalmin,
Giuseppe Cavallaro
These patches add the EEE support in the stmmac device driver
restoring an old work I had done some months ago and not
completed in time.
I've tested all on ST STB with the IC+ 101G PHY device that has
this feature.
The initial EEE support for the stmmac has been written by Rayagond
but I have reworked all his code adding new parts and especially
performing tests on a real hardware. Thx Rayagond!
In these patches, we can see that the stmmac supports the EEE
only if the DMA HW capability register says that this
feature is actually available. In that case, the driver can enter
in the Tx LPI mode by using a timer as recommended by Synopsys.
Note that EEE is supported in new chip generations; in particular
I used the 3.61a.
At any rate, further information about how the driver treats the EEE
can be found in the stmmac.txt file (there is a patch for that).
Another patch is for Physical Abstraction Layer now able to
manage the MMD registers (clause 45); it also provides the ethtool
support to manage supported/advertisement/lp adv features.
v3: fixed the "stmmac: do not use strict_strtoul but kstrtoint"
to use the kstrtoint.
v4: fixed the function to enable the EEE and add a check that verifies
if the link auto-negotiated matches with the bits in the adv and lp
registers.
Giuseppe Cavallaro (4):
stmmac: do not use strict_strtoul but kstrtoint
stmmac: update the driver Documentation and add EEE
stmmac: add the Energy Efficient Ethernet support
phy: add the EEE support and the way to access to the MMD registers.
Documentation/networking/stmmac.txt | 36 +++-
drivers/net/ethernet/stmicro/stmmac/common.h | 31 +++-
drivers/net/ethernet/stmicro/stmmac/dwmac1000.h | 20 ++
.../net/ethernet/stmicro/stmmac/dwmac1000_core.c | 101 +++++++-
.../net/ethernet/stmicro/stmmac/dwmac100_core.c | 4 +-
drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h | 1 +
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 8 +
.../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 57 ++++
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 193 ++++++++++++--
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +
drivers/net/phy/phy.c | 274 ++++++++++++++++++++
include/linux/mdio.h | 21 ++-
include/linux/mii.h | 9 +
include/linux/phy.h | 5 +
14 files changed, 717 insertions(+), 45 deletions(-)
--
1.7.4.4
^ permalink raw reply
* [net-next.git 1/4 (v3)] stmmac: do not use strict_strtoul but kstrtoint
From: Giuseppe CAVALLARO @ 2012-06-18 6:49 UTC (permalink / raw)
To: netdev
Cc: eric.dumazet, bhutchings, rayagond, davem, yuvalmin,
Giuseppe Cavallaro
In-Reply-To: <1340002187-9248-1-git-send-email-peppe.cavallaro@st.com>
This patch replaces the obsolete strict_strtoul with kstrtoint.
v2: also removed casting on kstrtoul.
v3: use kstrtoint instead of kstrtoul due to all vars are integer.
thanks to E. Dumazet.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 27 +++++++-------------
1 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 590e95b..eba49cb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2129,42 +2129,35 @@ static int __init stmmac_cmdline_opt(char *str)
return -EINVAL;
while ((opt = strsep(&str, ",")) != NULL) {
if (!strncmp(opt, "debug:", 6)) {
- if (strict_strtoul(opt + 6, 0, (unsigned long *)&debug))
+ if (kstrtoint(opt + 6, 0, &debug))
goto err;
} else if (!strncmp(opt, "phyaddr:", 8)) {
- if (strict_strtoul(opt + 8, 0,
- (unsigned long *)&phyaddr))
+ if (kstrtoint(opt + 8, 0, &phyaddr))
goto err;
} else if (!strncmp(opt, "dma_txsize:", 11)) {
- if (strict_strtoul(opt + 11, 0,
- (unsigned long *)&dma_txsize))
+ if (kstrtoint(opt + 11, 0, &dma_txsize))
goto err;
} else if (!strncmp(opt, "dma_rxsize:", 11)) {
- if (strict_strtoul(opt + 11, 0,
- (unsigned long *)&dma_rxsize))
+ if (kstrtoint(opt + 11, 0, &dma_rxsize))
goto err;
} else if (!strncmp(opt, "buf_sz:", 7)) {
- if (strict_strtoul(opt + 7, 0,
- (unsigned long *)&buf_sz))
+ if (kstrtoint(opt + 7, 0, &buf_sz))
goto err;
} else if (!strncmp(opt, "tc:", 3)) {
- if (strict_strtoul(opt + 3, 0, (unsigned long *)&tc))
+ if (kstrtoint(opt + 3, 0, &tc))
goto err;
} else if (!strncmp(opt, "watchdog:", 9)) {
- if (strict_strtoul(opt + 9, 0,
- (unsigned long *)&watchdog))
+ if (kstrtoint(opt + 9, 0, &watchdog))
goto err;
} else if (!strncmp(opt, "flow_ctrl:", 10)) {
- if (strict_strtoul(opt + 10, 0,
- (unsigned long *)&flow_ctrl))
+ if (kstrtoint(opt + 10, 0, &flow_ctrl))
goto err;
} else if (!strncmp(opt, "pause:", 6)) {
- if (strict_strtoul(opt + 6, 0, (unsigned long *)&pause))
+ if (kstrtoint(opt + 6, 0, &pause))
goto err;
#ifdef CONFIG_STMMAC_TIMER
} else if (!strncmp(opt, "tmrate:", 7)) {
- if (strict_strtoul(opt + 7, 0,
- (unsigned long *)&tmrate))
+ if (kstrtoint(opt + 7, 0, &tmrate))
goto err;
#endif
}
--
1.7.4.4
^ permalink raw reply related
* [PATCH] tc: prio: Perform more strict check on priomap.
From: Li Wei @ 2012-06-18 6:33 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger
Since band number counts from zero thus band must be little than
opt.bands.
---
tc/q_prio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tc/q_prio.c b/tc/q_prio.c
index 79b4fd0..bacc702 100644
--- a/tc/q_prio.c
+++ b/tc/q_prio.c
@@ -67,7 +67,7 @@ static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
fprintf(stderr, "Illegal \"priomap\" element\n");
return -1;
}
- if (band > opt.bands) {
+ if (band >= opt.bands) {
fprintf(stderr, "\"priomap\" element is out of bands\n");
return -1;
}
--
1.7.1
^ permalink raw reply related
* Re: [net-next.git 1/4 (v5)] phy: add the EEE support and the way to access to the MMD registers.
From: Giuseppe CAVALLARO @ 2012-06-18 6:23 UTC (permalink / raw)
To: Ben Hutchings; +Cc: netdev, eric.dumazet, rayagond, davem, yuvalmin
In-Reply-To: <1339778248.2555.9.camel@bwh-desktop.uk.solarflarecom.com>
On 6/15/2012 6:37 PM, Ben Hutchings wrote:
> On Fri, 2012-06-15 at 08:06 +0200, Giuseppe CAVALLARO wrote:
>> Hello Ben
>>
>> On 6/14/2012 1:28 AM, Ben Hutchings wrote:
> [...]
>>> But you also use this condition to decide whether to enable TX LPI, so
>>> it's important that it does match the specification (§78.3) for whether
>>> EEE is supported - but it doesn't. You need to work out what mode was
>>> autonegotiated, then check that the relevant bit is set in both our EEE
>>> advertising (*not* supported) and the LP EEE advertising masks.
>>
>> I've some doubts and, before resending the patch, I kindly ask you some
>> further details just on this point.
>>
>> In the code, I check if the EEE is supported and on GMII, MII and RGMII
>> and duplex mode; in case of success the Ethernet driver can enable the
>> TX LPI.
>> Indeed, I am only using the 3.20 and 7.61 registers w/o looking at the
>> 7.60. So this should be fixed, shouldn't it?
>> Am I missing anything else?
>> What do you mean when say that it doesn't match the specification
>> (§78.3)? I'm pointing to the '78.3 Capabilities Negotiation' chapter of
>> the IEEE802-3az, is it ok?
>
> Yes that's what I mean. As I read it, you need to check which link mode
> was autonegotiated, then the corresponding bit in 7.60 and 7.61. If
> they're both set then EEE is supported on the current link. (But, let
> me repeat, I have not done any work on implementing EEE, so it's
> entirely possible that I have misunderstood some things.)
Ben, you are right, the code needs this kind of check.
For example, my phy device only supports the 100BASE-TX and, with the
current implementation, the phy_init_eee could enable the EEE on 10/full
link mode and it is not good.
I'll send the new patch asap.
Thanks
Peppe
>
> Ben.
>
^ permalink raw reply
* [PATCH] tc: man: Fix incorrect parameter format in prio.
From: Li Wei @ 2012-06-18 6:23 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger
Parameter priomap use blank instead of comma to separate bands,
update manpage to confirms to this.
---
man/man8/tc-prio.8 | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/man8/tc-prio.8 b/man/man8/tc-prio.8
index 1625fcc..55a5f3d 100644
--- a/man/man8/tc-prio.8
+++ b/man/man8/tc-prio.8
@@ -11,7 +11,7 @@ major:
.B ] prio [ bands
bands
.B ] [ priomap
-band,band,band...
+band band band...
.B ] [ estimator
interval timeconstant
.B ]
@@ -134,7 +134,7 @@ showing to which Priority they are mapped.
The last column shows the result of the default priomap. On the command line,
the default priomap looks like this:
- 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1
+ 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
This means that priority 4, for example, gets mapped to band number 1.
The priomap also allows you to list higher priorities (> 7) which do not
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] net: remove my future former mail address
From: Rémi Denis-Courmont @ 2012-06-18 3:45 UTC (permalink / raw)
To: netdev
In-Reply-To: <4FDAE7D5.5040709@nokia.com>
Le vendredi 15 juin 2012 10:44:21 Sakari Ailus, vous avez écrit :
> Hi Rémi,
>
> Rémi Denis-Courmont wrote:
> > From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
> >
> > Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
> > Cc: Sakari Ailus <sakari.ailus@nokia.com>
>
> Hmm. While you're at it, could you please remove mine from the same
> files as well, please?
>
> I wonder if this also means that the code will be without a maintainer
> in the future.
I don't have a crystal ball. As far as I know, the ISI modem "assets" have
been sold to Renesas several years ago, so it would natural for them to take
over. Or a Renesas licensee (ST-E seemed to be one at some point).
In any case, the Phonet stack has been essentially code complete from the
beginning: the changes with new modems occur either above in userspace, or
below in device drivers. In the past few years, it boiled down to keeping it
up to date with kernel internal changes.
--
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis
^ permalink raw reply
* [PATCH] ipv4: Cap ADVMSS metric in the FIB rather than the routing cache.
From: David Miller @ 2012-06-18 2:53 UTC (permalink / raw)
To: netdev
It makes no sense to execute this limit test every time we create a
routing cache entry.
We can't simply error out on these things since we've silently
accepted and truncated them forever.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/ipv4/fib_semantics.c | 7 ++++++-
net/ipv4/route.c | 2 --
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index e5b7182..415f823 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -779,9 +779,14 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
int type = nla_type(nla);
if (type) {
+ u32 val;
+
if (type > RTAX_MAX)
goto err_inval;
- fi->fib_metrics[type - 1] = nla_get_u32(nla);
+ val = nla_get_u32(nla);
+ if (type == RTAX_ADVMSS && val > 65535 - 40)
+ val = 65535 - 40;
+ fi->fib_metrics[type - 1] = val;
}
}
}
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 41df529..a91f6d3 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1951,8 +1951,6 @@ static void rt_set_nexthop(struct rtable *rt, const struct flowi4 *fl4,
if (dst_mtu(dst) > IP_MAX_MTU)
dst_metric_set(dst, RTAX_MTU, IP_MAX_MTU);
- if (dst_metric_raw(dst, RTAX_ADVMSS) > 65535 - 40)
- dst_metric_set(dst, RTAX_ADVMSS, 65535 - 40);
#ifdef CONFIG_IP_ROUTE_CLASSID
#ifdef CONFIG_IP_MULTIPLE_TABLES
--
1.7.10
^ permalink raw reply related
* Re: [PATCH 3/3] usbnet: handle remote wakeup asap
From: Ming Lei @ 2012-06-18 1:55 UTC (permalink / raw)
To: David Miller
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, oneukum-l3A5Bk7waGM,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
stable-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120617.162233.868029041800646826.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Mon, Jun 18, 2012 at 7:22 AM, David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:
> From: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> Date: Fri, 15 Jun 2012 10:22:16 +0800
>
>> David, sorry, the 'GFP_ATOMIC' above should be 'flags', so could
>> you take the fixed version from attachment? Or could you do it by
>> your self?
>
> You are rushing this patch submission if you are finding such
> errors right after you post the patch.
>
> Take your time and properly audit your work, then resubmit your
> entire series again once it is really ready.
Good suggestion, I will check the patches again and test them further.
Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next v2 01/12] netfilter: fix problem with proto register
From: Gao feng @ 2012-06-18 0:59 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: netdev, netfilter-devel
In-Reply-To: <20120616105037.GA18251@1984>
于 2012年06月16日 18:50, Pablo Neira Ayuso 写道:
> On Sat, Jun 16, 2012 at 11:41:12AM +0800, Gao feng wrote:
>> commit 2c352f444ccfa966a1aa4fd8e9ee29381c467448
>> (netfilter: nf_conntrack: prepare namespace support for
>> l4 protocol trackers) register proto before register sysctl.
>>
>> it changes the behavior that when register sysctl failed, the
>> proto should not be registered too.
>>
>> so change to register sysctl before register protos.
>
> Could you explain why we need to change the order in the registration?
> ie. now first proto->init_net then sysctl things.
before commit 2c352f444ccfa966a1aa4fd8e9ee29381c467448, we register sysctl before
register protos, so if sysctl is registered faild, the protos will not be registered.
but now, we register protos first, and when register sysctl failed, we can use protos
too, it's different from before.
>
>> Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
>> ---
>> net/netfilter/nf_conntrack_proto.c | 37 ++++++++++++++++++++++-------------
>> 1 files changed, 23 insertions(+), 14 deletions(-)
>>
>> diff --git a/net/netfilter/nf_conntrack_proto.c b/net/netfilter/nf_conntrack_proto.c
>> index 1ea9194..a434dd7 100644
>> --- a/net/netfilter/nf_conntrack_proto.c
>> +++ b/net/netfilter/nf_conntrack_proto.c
>> @@ -253,18 +253,23 @@ int nf_conntrack_l3proto_register(struct net *net,
>> {
>> int ret = 0;
>>
>> - if (net == &init_net)
>> - ret = nf_conntrack_l3proto_register_net(proto);
>> + if (proto->init_net) {
>> + ret = proto->init_net(net);
>> + if (ret < 0)
>> + return ret;
>> + }
>>
>> + ret = nf_ct_l3proto_register_sysctl(net, proto);
>> if (ret < 0)
>> return ret;
>>
>> - if (proto->init_net) {
>> - ret = proto->init_net(net);
>> + if (net == &init_net) {
>> + ret = nf_conntrack_l3proto_register_net(proto);
>> if (ret < 0)
>> - return ret;
>> + nf_ct_l3proto_unregister_sysctl(net, proto);
>> }
>> - return nf_ct_l3proto_register_sysctl(net, proto);
>> +
>> + return ret;
>> }
>> EXPORT_SYMBOL_GPL(nf_conntrack_l3proto_register);
>>
>> @@ -454,19 +459,23 @@ int nf_conntrack_l4proto_register(struct net *net,
>> struct nf_conntrack_l4proto *l4proto)
>> {
>> int ret = 0;
>> - if (net == &init_net)
>> - ret = nf_conntrack_l4proto_register_net(l4proto);
>> -
>> - if (ret < 0)
>> - return ret;
>> -
>> - if (l4proto->init_net)
>> + if (l4proto->init_net) {
>> ret = l4proto->init_net(net);
>> + if (ret < 0)
>> + return ret;
>> + }
>>
>> + ret = nf_ct_l4proto_register_sysctl(net, l4proto);
>> if (ret < 0)
>> return ret;
>>
>> - return nf_ct_l4proto_register_sysctl(net, l4proto);
>> + if (net == &init_net) {
>> + ret = nf_conntrack_l4proto_register_net(l4proto);
>> + if (ret < 0)
>> + nf_ct_l4proto_unregister_sysctl(net, l4proto);
>> + }
>> +
>> + return ret;
>> }
>> EXPORT_SYMBOL_GPL(nf_conntrack_l4proto_register);
>>
>> --
>> 1.7.7.6
>>
>> --
>> 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
> --
> 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
>
--
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 v3] fec: fix clk handling for Coldfire.
From: David Miller @ 2012-06-17 23:47 UTC (permalink / raw)
To: sfking; +Cc: netdev
In-Reply-To: <201206171639.43651.sfking@fdwdc.com>
From: Steven King <sfking@fdwdc.com>
Date: Sun, 17 Jun 2012 16:39:43 -0700
> commit f4d40de39a23f0c39cca55ac63e1175c69c3d2f7
> 'net fec: do not depend on grouped clocks' broke fec for Coldfire.
>
> Hide the details of the fec clk management in a trio of new functions:
> fec_clk_get, fec_clk_prepare and fec_clk_disable_unprepare. these then can
> be modified as needed to manage the clks for the different arches that use
> the fec controller.
>
> Signed-off-by: Steven King <sfking@fdwdc.com>
I said keep the ifdefs out of the foo.c code.
Put this ifdef'y into one of the driver's header files, such
as fec.h
^ permalink raw reply
* [PATCH v3] fec: fix clk handling for Coldfire.
From: Steven King @ 2012-06-17 23:39 UTC (permalink / raw)
To: netdev
commit f4d40de39a23f0c39cca55ac63e1175c69c3d2f7
'net fec: do not depend on grouped clocks' broke fec for Coldfire.
Hide the details of the fec clk management in a trio of new functions:
fec_clk_get, fec_clk_prepare and fec_clk_disable_unprepare. these then can
be modified as needed to manage the clks for the different arches that use
the fec controller.
Signed-off-by: Steven King <sfking@fdwdc.com>
---
drivers/net/ethernet/freescale/fec.c | 84 ++++++++++++++++++++++++++--------
1 file changed, 65 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index ff7f4c5..1072da6 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -207,8 +207,12 @@ struct fec_enet_private {
struct net_device *netdev;
+#ifdef CONFIG_COLDFIRE
+ struct clk *clk;
+#else
struct clk *clk_ipg;
struct clk *clk_ahb;
+#endif
/* The saved address of a sent-in-place packet/buffer, for skfree(). */
unsigned char *tx_bounce[TX_RING_SIZE];
@@ -248,6 +252,56 @@ struct fec_enet_private {
int irq[FEC_IRQ_NUM];
};
+static int fec_clk_get(struct platform_device *pdev,
+ struct fec_enet_private *fep)
+{
+ int ret;
+
+#ifdef CONFIG_COLDFIRE
+ fep->clk = clk_get(&pdev->dev, NULL);
+ if (IS_ERR(fep->clk)) {
+ ret = PTR_ERR(fep->clk);
+ goto failed_clk;
+ }
+#else
+ fep->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
+ if (IS_ERR(fep->clk_ipg)) {
+ ret = PTR_ERR(fep->clk_ipg);
+ goto failed_clk;
+ }
+
+ fep->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
+ if (IS_ERR(fep->clk_ahb)) {
+ ret = PTR_ERR(fep->clk_ahb);
+ goto failed_clk;
+ }
+#endif
+ return 0;
+
+failed_clk:
+ return ret;
+}
+
+static void fec_clk_prepare(struct fec_enet_private *fep)
+{
+#ifdef CONFIG_COLDFIRE
+ clk_prepare_enable(fep->clk);
+#else
+ clk_prepare_enable(fep->clk_ahb);
+ clk_prepare_enable(fep->clk_ipg);
+#endif
+}
+
+static void fec_clk_disable_unprepare(struct fec_enet_private *fep)
+{
+#ifdef CONFIG_COLDFIRE
+ clk_disable_unprepare(fep->clk);
+#else
+ clk_disable_unprepare(fep->clk_ahb);
+ clk_disable_unprepare(fep->clk_ipg);
+#endif
+}
+
/* FEC MII MMFR bits definition */
#define FEC_MMFR_ST (1 << 30)
#define FEC_MMFR_OP_READ (2 << 28)
@@ -1066,7 +1120,11 @@ static int fec_enet_mii_init(struct platform_device *pdev)
* Reference Manual has an error on this, and gets fixed on i.MX6Q
* document.
*/
+#ifdef CONFIG_COLDFIRE
+ fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk), 5000000);
+#else
fep->phy_speed = DIV_ROUND_UP(clk_get_rate(fep->clk_ahb), 5000000);
+#endif
if (id_entry->driver_data & FEC_QUIRK_ENET_MAC)
fep->phy_speed--;
fep->phy_speed <<= 1;
@@ -1619,20 +1677,11 @@ fec_probe(struct platform_device *pdev)
goto failed_pin;
}
- fep->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
- if (IS_ERR(fep->clk_ipg)) {
- ret = PTR_ERR(fep->clk_ipg);
- goto failed_clk;
- }
- fep->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
- if (IS_ERR(fep->clk_ahb)) {
- ret = PTR_ERR(fep->clk_ahb);
+ if (fec_clk_get(pdev, fep))
goto failed_clk;
- }
- clk_prepare_enable(fep->clk_ahb);
- clk_prepare_enable(fep->clk_ipg);
+ fec_clk_prepare(fep);
ret = fec_enet_init(ndev);
if (ret)
@@ -1655,8 +1704,7 @@ failed_register:
fec_enet_mii_remove(fep);
failed_mii_init:
failed_init:
- clk_disable_unprepare(fep->clk_ahb);
- clk_disable_unprepare(fep->clk_ipg);
+ fec_clk_disable_unprepare(fep);
failed_pin:
failed_clk:
for (i = 0; i < FEC_IRQ_NUM; i++) {
@@ -1689,8 +1737,7 @@ fec_drv_remove(struct platform_device *pdev)
if (irq > 0)
free_irq(irq, ndev);
}
- clk_disable_unprepare(fep->clk_ahb);
- clk_disable_unprepare(fep->clk_ipg);
+ fec_clk_disable_unprepare(fep);
iounmap(fep->hwp);
free_netdev(ndev);
@@ -1714,8 +1761,7 @@ fec_suspend(struct device *dev)
fec_stop(ndev);
netif_device_detach(ndev);
}
- clk_disable_unprepare(fep->clk_ahb);
- clk_disable_unprepare(fep->clk_ipg);
+ fec_clk_disable_unprepare(fep);
return 0;
}
@@ -1726,8 +1772,8 @@ fec_resume(struct device *dev)
struct net_device *ndev = dev_get_drvdata(dev);
struct fec_enet_private *fep = netdev_priv(ndev);
- clk_prepare_enable(fep->clk_ahb);
- clk_prepare_enable(fep->clk_ipg);
+ fec_clk_prepare(fep);
+
if (netif_running(ndev)) {
fec_restart(ndev, fep->full_duplex);
netif_device_attach(ndev);
^ permalink raw reply related
* Re: [PATCH] usbnet: Activate halt interrupt endpoint before re-submit URB
From: David Miller @ 2012-06-17 23:30 UTC (permalink / raw)
To: huajun.li.lee; +Cc: tom.leiming, stern, linux-usb, netdev
In-Reply-To: <CA+v9cxad+THL8u7tr_ubD7H7o+6x+qTOXOgowmPDnWUxa8aJtQ@mail.gmail.com>
From: Huajun Li <huajun.li.lee@gmail.com>
Date: Wed, 13 Jun 2012 20:50:31 +0800
> intr_complete() submits URB even the interrupt endpoint stalls.
> This patch will try to activate the endpoint once the exception
> occurs, and then re-submit the URB if the endpoint works again.
>
> Signed-off-by: Huajun Li <huajun.li.lee@gmail.com>
Review from USB experts would be appreciated.
Thanks.
^ permalink raw reply
* Re: [PATCH] net: remove my future former mail address
From: David Miller @ 2012-06-17 23:29 UTC (permalink / raw)
To: remi; +Cc: netdev, remi.denis-courmont, sakari.ailus
In-Reply-To: <1339662543-7203-1-git-send-email-remi@remlab.net>
From: Rémi Denis-Courmont <remi@remlab.net>
Date: Thu, 14 Jun 2012 11:29:03 +0300
> From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
>
> Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
Applied.
^ permalink raw reply
* Re: [PATCH net-next] net: lpc_eth: free skbs in start_xmit
From: David Miller @ 2012-06-17 23:28 UTC (permalink / raw)
To: eric.dumazet
Cc: stigge, netdev, kevin.wells, srinivas.bakki, aletes.xgr,
linux-arm-kernel
In-Reply-To: <1339581496.22704.346.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 13 Jun 2012 11:58:16 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> Transmitted skbs can be freed immediately in lpc_eth_hard_start_xmit()
> instead of at TX completion, since driver copies the frames in DMA area.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Tested-by: Roland Stigge <stigge@antcom.de>
Applied.
^ permalink raw reply
* Re: [net-next PATCH 02/02] net/ipv4: VTI support new module for ip_vti.
From: David Miller @ 2012-06-17 23:27 UTC (permalink / raw)
To: steffen.klassert; +Cc: saurabh.mohan, netdev
In-Reply-To: <20120615053707.GV27795@secunet.com>
From: Steffen Klassert <steffen.klassert@secunet.com>
Date: Fri, 15 Jun 2012 07:37:07 +0200
> VTI should be independent of the IPsec protocol.
> Our IPsec implementation supports AH (and IPCOMP)
> so VTI should support these protocols too.
I agree with Steffen, it shouldn't require very much work to support
all of the 3 major IPSEC protocols. So if we are going to add a
feature like this I require that you completely flesh out the support
and support IPV6 as well.
Doing otherwise creates a terrible user experience.
^ permalink raw reply
* Re: [PATCH] net: remove my future former mail address
From: David Miller @ 2012-06-17 23:26 UTC (permalink / raw)
To: sakari.ailus; +Cc: remi, netdev, remi.denis-courmont
In-Reply-To: <4FDAE7D5.5040709@nokia.com>
From: Sakari Ailus <sakari.ailus@nokia.com>
Date: Fri, 15 Jun 2012 10:44:21 +0300
> I wonder if this also means that the code will be without a
> maintainer in the future.
I really want to thank Nokia for submitting code then abandoning
it completely.
I am warning future Nokia patch submitters that I'm now, as a
result, extremely resultant to apply anything they submit other
than the absolutely most trivial bug fixes.
^ permalink raw reply
* Re: [Patch] bonding: show all the link status of slaves
From: David Miller @ 2012-06-17 23:24 UTC (permalink / raw)
To: amwang; +Cc: netdev, fubar, andy
In-Reply-To: <1339749567-20393-1-git-send-email-amwang@redhat.com>
From: Cong Wang <amwang@redhat.com>
Date: Fri, 15 Jun 2012 16:39:27 +0800
> There are four link statuses of a bonding slave, the procfs
> code shows a wrong status when using downdelay/updelay:
>
> (slave->link == BOND_LINK_UP) ? "up" : "down"
>
> It doesn't respect the rest two statuses. This patch fixes it.
>
> Cc: Jay Vosburgh <fubar@us.ibm.com>
> Cc: Andy Gospodarek <andy@greyhouse.net>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH 3/3] usbnet: handle remote wakeup asap
From: David Miller @ 2012-06-17 23:22 UTC (permalink / raw)
To: ming.lei; +Cc: gregkh, oneukum, netdev, linux-usb, stable
In-Reply-To: <CACVXFVMO0Z23kW59YRyfbVFu77vG6_yAMxAhOXk619V0dhF7Fw@mail.gmail.com>
From: Ming Lei <ming.lei@canonical.com>
Date: Fri, 15 Jun 2012 10:22:16 +0800
> David, sorry, the 'GFP_ATOMIC' above should be 'flags', so could
> you take the fixed version from attachment? Or could you do it by
> your self?
You are rushing this patch submission if you are finding such
errors right after you post the patch.
Take your time and properly audit your work, then resubmit your
entire series again once it is really ready.
^ permalink raw reply
* Re: [PATCH] usbnet: sanitise overlong driver information strings
From: David Miller @ 2012-06-17 23:20 UTC (permalink / raw)
To: phil.sutter; +Cc: netdev
In-Reply-To: <1339672722-22793-1-git-send-email-phil.sutter@viprinet.com>
From: Phil Sutter <phil.sutter@viprinet.com>
Date: Thu, 14 Jun 2012 13:18:42 +0200
> As seen on smsc75xx, driver_info->description being longer than 32
> characters messes up 'ethtool -i' output.
>
> Signed-off-by: Phil Sutter <phil.sutter@viprinet.com>
Applied.
^ permalink raw reply
* Re: [PATCH 0/3] be2net: patches fix max gso size, modify driver log info and stats struct.
From: David Miller @ 2012-06-17 23:19 UTC (permalink / raw)
To: sarveshwar.bandi; +Cc: netdev
In-Reply-To: <8b01e121-64f5-4a7a-ace5-2f811b097a8d@exht1.ad.emulex.com>
From: <sarveshwar.bandi@emulex.com>
Date: Thu, 14 Jun 2012 11:21:42 +0530
> Please apply these patches. Thanks.
You've been doing this long enough to know that you can't just
say "apply these patches", you also need to tell me which tree
you want them applied to.
Since they are fixes, I assumed 'net' and applied them there,
but next time I'm simply going to drop your patches entirely
if you can't be bothered to tell me where they belong.
Thanks.
^ permalink raw reply
* Re: [net-next PATCH] bnx2x: correct LPI pass-through configuration
From: David Miller @ 2012-06-17 23:17 UTC (permalink / raw)
To: yuvalmin; +Cc: netdev, dan.carpenter, eilong, yaniv.rosner
In-Reply-To: <1339934690-28191-1-git-send-email-yuvalmin@broadcom.com>
From: "Yuval Mintz" <yuvalmin@broadcom.com>
Date: Sun, 17 Jun 2012 15:04:50 +0300
> Commit c8c60d88c59cbb48737732ba948663a3efe882aa contained
> an incorrect logic which enabled a buffer overflow when accessing
> an array during LPI pass-through configuration.
> This patch fixes this issue by removing that logic altogether.
>
> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
> Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Applied.
^ permalink raw reply
* Re: [net] ixgbe: Fix PHC loophole allowing misconfiguration of increment register
From: David Miller @ 2012-06-17 23:16 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: jacob.e.keller, netdev, gospo, sassmann
In-Reply-To: <1339925340-26286-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Sun, 17 Jun 2012 02:29:00 -0700
> From: Jacob Keller <jacob.e.keller@intel.com>
>
> This patch fixes a potential hole when configuring the cycle counter used to
> generate the nanosecond time clock. This clock is based off of the SYSTIME
> registers along with the TIMINCA registers. The TIMINCA register determines
> the increment to be added to the SYSTIME registers every DMA clock tick. This
> register needs to be reconfigured whenever the link-speed changes. However,
> the value calculated stays the same when link is down and when link is up.
> Misconfiguration can occur if the link status changes due to a reset, which
> causes the TIMINCA register to be reset. This reset puts the device in an
> unstable state where the SYSTIME registers stop incrementing and the PTP
> protocol does not function.
>
> The solution is to double check the TIMINCA value and always reset the value
> if the register is zero. This prevents a misconfiguration bug that halts the
> PHC.
>
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Acked-by: Don Skidmore <donald.c.skidmore@intel.com>
> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH v2] fec: fix clk handling for Coldfire.
From: David Miller @ 2012-06-17 23:16 UTC (permalink / raw)
To: sfking; +Cc: netdev
In-Reply-To: <201206170306.58576.sfking@fdwdc.com>
Your email client corrupted the patch, don't waste my time like
this.
^ permalink raw reply
* Re: [PATCH 4/5] powerpc: bitops: Introduce {clear,set}_bit_le()
From: Benjamin Herrenschmidt @ 2012-06-17 21:49 UTC (permalink / raw)
To: Takuya Yoshikawa
Cc: akpm, bhutchings, grundler, arnd, avi, mtosatti,
linux-net-drivers, netdev, linux-kernel, linux-arch, kvm,
takuya.yoshikawa
In-Reply-To: <20120613130438.b1cd04db.yoshikawa.takuya@oss.ntt.co.jp>
On Wed, 2012-06-13 at 13:04 +0900, Takuya Yoshikawa wrote:
> From: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
>
> Needed to replace test_and_set_bit_le() in virt/kvm/kvm_main.c which is
> being used for this missing function.
>
> Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> arch/powerpc/include/asm/bitops.h | 10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h
> index efdc926..dc2cf9c 100644
> --- a/arch/powerpc/include/asm/bitops.h
> +++ b/arch/powerpc/include/asm/bitops.h
> @@ -288,6 +288,16 @@ static __inline__ int test_bit_le(unsigned long nr,
> return (tmp[nr >> 3] >> (nr & 7)) & 1;
> }
>
> +static inline void set_bit_le(int nr, void *addr)
> +{
> + set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
> +}
> +
> +static inline void clear_bit_le(int nr, void *addr)
> +{
> + clear_bit(nr ^ BITOP_LE_SWIZZLE, addr);
> +}
> +
> static inline void __set_bit_le(int nr, void *addr)
> {
> __set_bit(nr ^ BITOP_LE_SWIZZLE, addr);
^ permalink raw reply
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