* [PATCH 0/3] mlx4_en: loopback support + RSS TCP improve + bug fix
From: Amir Vadai @ 2011-11-15 9:14 UTC (permalink / raw)
To: David S. Miller
Cc: netdev, Oren Duer, Yevgeny Petrilin, Or Gerlitz, Amir Vadai
From: Amir Vadai <amirv@mellanox.co.il>
Amir Vadai (3):
net/mlx4_en: allow setting number of rx rings for RSS/TCP
net/mlx4_en: adding loopback support
net/mlx4_en: bug fix for the case of vlan id 0 and UP 0
drivers/net/ethernet/mellanox/mlx4/en_main.c | 7 ++++---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 9 ++++++++-
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 6 ++++--
include/linux/mlx4/qp.h | 1 +
5 files changed, 18 insertions(+), 7 deletions(-)
--
1.7.5.4
^ permalink raw reply
* sky2 hw csum failure
From: Martin Volf @ 2011-11-15 9:05 UTC (permalink / raw)
To: shemminger, bridge, netdev, davem, wcang, zheng.z.yan
Hello,
since 3.0.6 I get many "eth0: hw csum failure" messages in dmesg
followed by a call trace (see at the end). 3.0.4 is OK, 3.1.1 is not.
When I revert the "bridge: Pseudo-header required for the checksum of
ICMPv6" commit, 4b275d7efa1c4412f0d572fcd7f78ed0919370b3, in 3.1.1,
the messages would not occur.
I have two sky2 interfaces bridged together and I use IPv6, but not
MLD. Most of the time only one interface is connected, the message
occurs for either of them. Another machine with bridged e1000 and
r8169 interfaces is OK even without the revert.
Let me know, if more information is needed to create the correct fix.
Martin Volf
--
HW info from 3.1.1 with the commit reverted:
uname -mp
x86_64 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
dmesg | fgrep sky2
[ 11.226565] sky2: driver version 1.29
[ 11.226601] sky2 0000:04:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[ 11.226614] sky2 0000:04:00.0: setting latency timer to 64
[ 11.226644] sky2 0000:04:00.0: Yukon-2 EC Ultra chip revision 3
[ 11.226719] sky2 0000:04:00.0: irq 47 for MSI/MSI-X
[ 11.227327] sky2 0000:04:00.0: eth0: addr 00:22:15:98:82:ae
[ 11.227338] sky2 0000:03:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[ 11.227346] sky2 0000:03:00.0: setting latency timer to 64
[ 11.227366] sky2 0000:03:00.0: Yukon-2 EC Ultra chip revision 3
[ 11.227436] sky2 0000:03:00.0: irq 48 for MSI/MSI-X
[ 11.227625] sky2 0000:03:00.0: eth1: addr 00:22:15:98:92:e1
[ 31.809358] sky2 0000:03:00.0: eth1: enabling interface
[ 31.816587] sky2 0000:04:00.0: eth0: enabling interface
[ 34.196835] sky2 0000:04:00.0: eth0: Link is up at 1000 Mbps, full
duplex, flow control both
ethtool -k eth0 (same for eth1)
Offload parameters for eth0:
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp-segmentation-offload: on
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off
rx-vlan-offload: on
tx-vlan-offload: on
ntuple-filters: off
receive-hashing: on
lspci -vvvxxx
03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056
PCI-E Gigabit Ethernet Controller (rev 12)
Subsystem: ASUSTeK Computer Inc. Device 81f8
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 48
Region 0: Memory at fe9fc000 (64-bit, non-prefetchable) [size=16K]
Region 2: I/O ports at c800 [size=256]
Expansion ROM at fe9c0000 [disabled] [size=128K]
Capabilities: [48] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [50] Vital Product Data
Product Name: Marvell Yukon 88E8056 Gigabit Ethernet Controller
Read-only fields:
[PN] Part number: Yukon 88E8056
[EC] Engineering changes: Rev. 1.2
[MN] Manufacture ID: 4d 61 72 76 65 6c 6c
[SN] Serial number: AbCdEfG9892E1
[CP] Extended capability: 01 10 cc 03
[RV] Reserved: checksum good, 9 byte(s) reserved
Read/write fields:
[RW] Read-write area: 121 byte(s) free
End
Capabilities: [5c] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee0300c Data: 4199
Capabilities: [e0] Express (v1) Legacy Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s
unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal-
Unsupported-
RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr+ UncorrErr- FatalErr- UnsuppReq+
AuxPwr+ TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1,
Latency L0 <256ns, L1 unlimited
ClockPM+ Surprise- LLActRep- BwNot-
LnkCtl: ASPM Disabled; RCB 128 bytes Disabled- Retrain- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train-
SlotClk+ DLActive- BWMgmt- ABWMgmt-
Capabilities: [100 v1] Advanced Error Reporting
UESta: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk: DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt-
UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES- TLP- FCP+ CmpltTO- CmpltAbrt-
UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
CEMsk: RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 1f, GenCap- CGenEn- ChkCap- ChkEn-
Kernel driver in use: sky2
Kernel modules: sky2
00: ab 11 64 43 07 04 10 00 12 00 00 02 08 00 00 00
10: 04 c0 9f fe 00 00 00 00 01 c8 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 43 10 f8 81
30: 00 00 9c fe 48 00 00 00 00 00 00 00 05 01 00 00
40: 00 00 f0 01 00 80 a0 01 01 50 03 fe 00 20 00 13
50: 03 5c fc 80 00 00 00 78 00 00 00 01 05 e0 81 00
60: 0c 30 e0 fe 00 00 00 00 99 41 00 00 00 00 00 00
70: 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 70 00 00 00 00 00 00 82 a8 e8 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 10 00 11 00 c0 8f 28 00 00 20 19 00 11 ac 07 00
f0: 08 00 11 10 00 00 00 00 00 00 00 00 00 00 00 00
Call trace:
[ 64.240856] eth1: hw csum failure.
[ 64.240860] Pid: 0, comm: swapper Not tainted 3.1.1 #1
[ 64.240862] Call Trace:
[ 64.240864] <IRQ> [<ffffffff812acebf>] ? netdev_rx_csum_fault+0x29/0x31
[ 64.240875] [<ffffffff812a8e42>] ? __skb_checksum_complete_head+0x44/0x59
[ 64.240884] [<ffffffffa0174ea7>] ? br_multicast_rcv+0x7fc/0xc3f [bridge]
[ 64.240888] [<ffffffff81095c16>] ? dma_pool_alloc+0x267/0x279
[ 64.240893] [<ffffffff8102177d>] ? check_preempt_curr+0x38/0x61
[ 64.240898] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
[ 64.240903] [<ffffffff812d1472>] ? nf_hook_slow+0x73/0x111
[ 64.240908] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
[ 64.240914] [<ffffffffa0172706>] ? br_nf_forward_finish+0x95/0x95 [bridge]
[ 64.240919] [<ffffffffa016e205>] ?
br_handle_frame_finish+0x7e/0x1f3 [bridge]
[ 64.240925] [<ffffffffa017278f>] ?
br_nf_pre_routing_finish_ipv6+0x89/0x92 [bridge]
[ 64.240931] [<ffffffffa0171efe>] ? setup_pre_routing+0x38/0x5d [bridge]
[ 64.240936] [<ffffffffa0172f65>] ? br_nf_pre_routing+0x3bb/0x3cb [bridge]
[ 64.240940] [<ffffffff81026f31>] ? find_busiest_group+0x1fc/0x851
[ 64.240943] [<ffffffff810242c4>] ? enqueue_task_fair+0x126/0x219
[ 64.240947] [<ffffffff812d13c9>] ? nf_iterate+0x41/0x77
[ 64.240952] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
[ 64.240957] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
[ 64.240961] [<ffffffff812d1472>] ? nf_hook_slow+0x73/0x111
[ 64.240966] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
[ 64.240971] [<ffffffffa016e187>] ? NF_HOOK.clone.4+0x56/0x56 [bridge]
[ 64.240976] [<ffffffffa016e16d>] ? NF_HOOK.clone.4+0x3c/0x56 [bridge]
[ 64.240982] [<ffffffffa016e529>] ? br_handle_frame+0x1af/0x1c6 [bridge]
[ 64.240987] [<ffffffffa016e37a>] ?
br_handle_frame_finish+0x1f3/0x1f3 [bridge]
[ 64.240990] [<ffffffff812af07b>] ? __netif_receive_skb+0x26a/0x3b1
[ 64.240994] [<ffffffff812af34e>] ? netif_receive_skb+0x52/0x58
[ 64.240997] [<ffffffff812af7fe>] ? napi_gro_receive+0x1f/0x2f
[ 64.241000] [<ffffffff812af425>] ? napi_skb_finish+0x1c/0x31
[ 64.241011] [<ffffffffa001459e>] ? sky2_poll+0x784/0x999 [sky2]
[ 64.241015] [<ffffffff812af8da>] ? net_rx_action+0x61/0x117
[ 64.241019] [<ffffffff81031164>] ? __do_softirq+0x7f/0x106
[ 64.241023] [<ffffffff8135af8c>] ? call_softirq+0x1c/0x30
[ 64.241027] [<ffffffff8100365a>] ? do_softirq+0x31/0x67
[ 64.241030] [<ffffffff81031390>] ? irq_exit+0x3f/0xa3
[ 64.241033] [<ffffffff810033b7>] ? do_IRQ+0x85/0x9e
[ 64.241036] [<ffffffff813597ab>] ? common_interrupt+0x6b/0x6b
[ 64.241038] <EOI> [<ffffffff810081c1>] ? mwait_idle+0x59/0x5c
[ 64.241044] [<ffffffff8100098a>] ? cpu_idle+0x5c/0x7e
[ 64.241047] [<ffffffff8166f886>] ? start_kernel+0x304/0x30f
^ permalink raw reply
* re: IPv6 routing, NLM_F_* flag support: REPLACE and EXCL
From: Dan Carpenter @ 2011-11-15 9:01 UTC (permalink / raw)
To: matti.vaittinen; +Cc: netdev
flags support, warn about missing CREATE flag
Hello Matti Vaittinen,
This is a semi-automatic email about new static checker warnings.
The patch 4a287eba2de3: "IPv6 routing, NLM_F_* flag support: REPLACE
and EXCL flags support, warn about missing CREATE flag" from Nov 14,
2011, leads to the following Smatch complaint:
net/ipv6/ip6_fib.c +656 fib6_add_rt2node()
error: we previously assumed 'info' could be null (see line 641)
net/ipv6/ip6_fib.c
640 (info->nlh->nlmsg_flags&NLM_F_REPLACE));
641 int add = ((NULL == info || NULL == info->nlh) ||
^^^^^^^^^^^^
Checked here.
642 (info->nlh->nlmsg_flags&NLM_F_CREATE));
643 int found = 0;
644
645 ins = &fn->leaf;
646
647 for (iter = fn->leaf; iter; iter=iter->dst.rt6_next) {
648 /*
649 * Search for duplicates
650 */
651
652 if (iter->rt6i_metric == rt->rt6i_metric) {
653 /*
654 * Same priority level
655 */
656 if (NULL != info->nlh &&
^^^^^^^^^
Not checked here. Btw, I looked at the callers and info is always
a valid pointer.
657 (info->nlh->nlmsg_flags&NLM_F_EXCL))
658 return -EEXIST;
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH] vlan:return error when real dev is enslaved
From: Américo Wang @ 2011-11-15 8:46 UTC (permalink / raw)
To: Weiping Pan
Cc: Patrick McHardy, David S. Miller, open list:VLAN (802.1Q),
open list
In-Reply-To: <c897fa89d5ea94c6624e8cdab9787aa83526f994.1321343212.git.wpan@redhat.com>
On Tue, Nov 15, 2011 at 4:36 PM, Weiping Pan <wpan@redhat.com> wrote:
> + if (real_dev->flags & IFF_SLAVE) {
> + pr_info("Error, %s was already enslaved\n", name);
> + return -EOPNOTSUPP;
> + }
Use pr_err() then.
^ permalink raw reply
* [PATCH] vlan:return error when real dev is enslaved
From: Weiping Pan @ 2011-11-15 8:36 UTC (permalink / raw)
Cc: Weiping Pan, Patrick McHardy, David S. Miller,
open list:VLAN (802.1Q), open list
Qinhuibin reported a kernel panic when he do some operation about vlan.
https://lkml.org/lkml/2011/11/6/218
The operation is as below:
ifconfig eth2 up
modprobe bonding
modprobe 8021q
ifconfig bond0 up
ifenslave bond0 eth2
vconfig add eth2 3300
vconfig add bond0 33
vconfig rem eth2.3300
the panic stack is as below:
[<ffffffffa002f1c9>] panic_event+0x49/0x70 [ipmi_msghandler]
[<ffffffff80378917>] notifier_call_chain+0x37/0x70
[<ffffffff80372122>] panic+0xa2/0x195
[<ffffffff80376ed8>] oops_end+0xd8/0x140
[<ffffffff8001bea7>] no_context+0xf7/0x280
[<ffffffff8001c1a5>] __bad_area_nosemaphore+0x175/0x250
[<ffffffff80376318>] page_fault+0x28/0x30
[<ffffffffa039dabd>] igb_vlan_rx_kill_vid+0x4d/0x100 [igb]
[<ffffffffa044045f>] bond_vlan_rx_kill_vid+0x9f/0x290 [bonding]
[<ffffffffa047e636>] unregister_vlan_dev+0x136/0x180 [8021q]
[<ffffffffa047ed20>] vlan_ioctl_handler+0x170/0x3f0 [8021q]
[<ffffffff802c1d3f>] sock_ioctl+0x21f/0x280
[<ffffffff800e6d7f>] vfs_ioctl+0x2f/0xb0
[<ffffffff800e726b>] do_vfs_ioctl+0x3cb/0x5a0
[<ffffffff800e74e1>] sys_ioctl+0xa1/0xb0
[<ffffffff80007388>] system_call_fastpath+0x16/0x1b
[<00007f108a2b8bd7>] 0x7f108a2b8bd7
And the nic is as below:
[root@localhost ~]# ethtool -i eth2
driver: igb
version: 3.0.6-k2
firmware-version: 1.2-1
bus-info: 0000:04:00.0
kernel version:
2.6.32.12-0.7 also happen in 2.6.32-131
For kernel 2.6.32, the reason of this bug is that when we do "vconfig add bond0 33",
adapter->vlgrp is overwritten in igb_vlan_rx_register. So when we do "vconfig rem
eth2.3300", it can't find the correct vlgrp.
And this bug is avoided by vlan cleanup patchset from Jiri Pirko
<jpirko@redhat.com>, especially commit b2cb09b1a772(igb: do vlan cleanup).
But it is not a correct operation to creat a vlan interface on eth2
when it have been enslaved by bond0, so this patch is to return error
when the real dev is already enslaved.
Signed-off-by: Weiping Pan <wpan@redhat.com>
---
net/8021q/vlan.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 5471628..8ba9226 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -148,6 +148,11 @@ int vlan_check_real_dev(struct net_device *real_dev, u16 vlan_id)
const char *name = real_dev->name;
const struct net_device_ops *ops = real_dev->netdev_ops;
+ if (real_dev->flags & IFF_SLAVE) {
+ pr_info("Error, %s was already enslaved\n", name);
+ return -EOPNOTSUPP;
+ }
+
if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
pr_info("VLANs not supported on %s\n", name);
return -EOPNOTSUPP;
--
1.7.4
^ permalink raw reply related
* Re: [PATCH] ipv4: fix for ip_options_rcv_srr() daddr update.
From: Li Wei @ 2011-11-15 8:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20111115.032343.1203870624086709786.davem@davemloft.net>
> My long term plan is to eliminate cached routes, we will directly use
> routing table entries instead.
>
> In such a scheme, the member rt->rt_dst will no longer even exist.
>
> This is what I've been working towards for more than a year, it is a
> slow and very difficult transformation.
>
> If you starting adding rt->rt_dst references back, we are taking
> steps backwards.
>
>
Thank you, I got it.
I'll do my best to fix it but without any promise, because i am a kernel
newbie :D
^ permalink raw reply
* Re: [PATCH] ipv4: fix for ip_options_rcv_srr() daddr update.
From: David Miller @ 2011-11-15 8:23 UTC (permalink / raw)
To: lw; +Cc: netdev
In-Reply-To: <4EC21A01.90702@cn.fujitsu.com>
From: Li Wei <lw@cn.fujitsu.com>
Date: Tue, 15 Nov 2011 15:51:29 +0800
>> From: Li Wei <lw@cn.fujitsu.com>
>> Date: Tue, 15 Nov 2011 15:26:31 +0800
>>
>>> My question, in ip_forward() and ip_forward_options() rt is there, why not
>>> we just use it?
>>
>> Because I'm trying to eliminate all accesses to rt->rt_dst because
>> when I remove the routing cache, routes will be shared. One 'rt'
>> will refer to many specific destination addresses.
>>
>>
> Sorry, I can't understand what you said, can you make it more clear?
>
> I think in ip_forward(), we need 'rt' to forward skb, until this skb has been
> forwarded we hold a reference to it in skb, We can use rt->rt_dst safely, It
> is an ordinary __be32 not a reference.
My long term plan is to eliminate cached routes, we will directly use
routing table entries instead.
In such a scheme, the member rt->rt_dst will no longer even exist.
This is what I've been working towards for more than a year, it is a
slow and very difficult transformation.
If you starting adding rt->rt_dst references back, we are taking
steps backwards.
^ permalink raw reply
* Re: [PATCH] ipv4: fix for ip_options_rcv_srr() daddr update.
From: Li Wei @ 2011-11-15 7:51 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20111115.022835.551127337110017182.davem@davemloft.net>
> From: Li Wei <lw@cn.fujitsu.com>
> Date: Tue, 15 Nov 2011 15:26:31 +0800
>
>> My question, in ip_forward() and ip_forward_options() rt is there, why not
>> we just use it?
>
> Because I'm trying to eliminate all accesses to rt->rt_dst because
> when I remove the routing cache, routes will be shared. One 'rt'
> will refer to many specific destination addresses.
>
>
Sorry, I can't understand what you said, can you make it more clear?
I think in ip_forward(), we need 'rt' to forward skb, until this skb has been
forwarded we hold a reference to it in skb, We can use rt->rt_dst safely, It
is an ordinary __be32 not a reference.
^ permalink raw reply
* Re: [PATCH] ipv4: fix for ip_options_rcv_srr() daddr update.
From: David Miller @ 2011-11-15 7:28 UTC (permalink / raw)
To: lw; +Cc: netdev
In-Reply-To: <4EC21427.9080008@cn.fujitsu.com>
From: Li Wei <lw@cn.fujitsu.com>
Date: Tue, 15 Nov 2011 15:26:31 +0800
> My question, in ip_forward() and ip_forward_options() rt is there, why not
> we just use it?
Because I'm trying to eliminate all accesses to rt->rt_dst because
when I remove the routing cache, routes will be shared. One 'rt'
will refer to many specific destination addresses.
^ permalink raw reply
* Re: [PATCH] ipv4: fix for ip_options_rcv_srr() daddr update.
From: Li Wei @ 2011-11-15 7:26 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20111115.013527.2095109012737872896.davem@davemloft.net>
> From: Li Wei <lw@cn.fujitsu.com>
> Date: Tue, 15 Nov 2011 13:40:45 +0800
>
>> These days i am doing some ICMP tests and sadly found that wen can't update
>> iph->daddr in ip_options_rcv_srr(), It's too early. When some exception
>> ocurred later (eg. in ip_forward() when goto sr_failed) we need the ip header
>> be identical to the original one as ICMP need it.
>>
>> It seems we need rt->rt_dst in ip_forward_options() and ip_forward() instead
>> of iph->daddr.
>
> An alternative is to store the calculated destination address somewhere
> in the IPCB(skb).
>
>
You mean modify struct inet_skb_parm add some field to store the calculated
destination address?
My question, in ip_forward() and ip_forward_options() rt is there, why not
we just use it?
^ permalink raw reply
* Re: bonding xmit_policy
From: Eric Dumazet @ 2011-11-15 7:12 UTC (permalink / raw)
To: Simon Chen; +Cc: Nicolas de Pesloüan, netdev
In-Reply-To: <CANj2EbfM+5+AFYkU+erMZBtf0cCXkoDGRrXLGQFHYVL_6qvWFw@mail.gmail.com>
Le mardi 15 novembre 2011 à 01:20 -0500, Simon Chen a écrit :
> Thanks, my bad.
>
> It is pretty strange that when I use 802.3ad mode, all my packets
> (from different TCP flows) egress the same NIC even though I choose
> xmit_policy to be layer3+4. That's why I wasn't quite sure whether the
> policy is indeed in place.
>
> When I switch to balance-xor mode, the packets are roughly evenly
> distributed across two NICs.
AFAIK, layer4 information (soure/dst ports) is limited to ipv4 TCP/UDP
trafic.
Moreover, if your bond has 2 ports, only low order bit of source and dst
port is used.
layer4_xor = ntohs((*layer4hdr ^ *(layer4hdr + 1)));
So if your trafic is RTP, it probably use only even ports, (RTCP using
odd ports), and uses a single slave.
^ permalink raw reply
* [PATCH V4 13/14] i2c: imx: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-mmc, netdev, linux-serial
Cc: linux, amit.kucheria, kernel, ben-linux, cjb, alan, eric.miao,
richard.zhao
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao@linaro.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
drivers/i2c/busses/i2c-imx.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 58832e5..8d1ab6f 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -196,7 +196,7 @@ static int i2c_imx_start(struct imx_i2c_struct *i2c_imx)
dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
- clk_enable(i2c_imx->clk);
+ clk_prepare_enable(i2c_imx->clk);
writeb(i2c_imx->ifdr, i2c_imx->base + IMX_I2C_IFDR);
/* Enable I2C controller */
writeb(0, i2c_imx->base + IMX_I2C_I2SR);
@@ -245,7 +245,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx)
/* Disable I2C controller */
writeb(0, i2c_imx->base + IMX_I2C_I2CR);
- clk_disable(i2c_imx->clk);
+ clk_disable_unprepare(i2c_imx->clk);
}
static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx,
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 05/14] ARM: mxc: epit: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-mmc, netdev, linux-serial
Cc: linux, amit.kucheria, kernel, ben-linux, cjb, alan, eric.miao,
richard.zhao
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao@linaro.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/plat-mxc/epit.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/plat-mxc/epit.c
index d3467f8..9129c9e 100644
--- a/arch/arm/plat-mxc/epit.c
+++ b/arch/arm/plat-mxc/epit.c
@@ -203,7 +203,7 @@ static int __init epit_clockevent_init(struct clk *timer_clk)
void __init epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq)
{
- clk_enable(timer_clk);
+ clk_prepare_enable(timer_clk);
timer_base = base;
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 14/14] mmc: sdhci-esdhc-imx: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-mmc-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ,
amit.kucheria-Z7WLFzj8eWMS+FvcfC7Uqw,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
cjb-2X9k7bc8m7Mdnm+yROfE0A, alan-VuQAYsv1563Yd54FQh9/CA,
eric.miao-QSEj5FYQhm4dnm+yROfE0A,
richard.zhao-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index ae57769..f1ae37e 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -462,7 +462,7 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev)
err = PTR_ERR(clk);
goto err_clk_get;
}
- clk_enable(clk);
+ clk_prepare_enable(clk);
pltfm_host->clk = clk;
if (!is_imx25_esdhc(imx_data))
@@ -550,7 +550,7 @@ no_card_detect_irq:
gpio_free(boarddata->wp_gpio);
no_card_detect_pin:
no_board_data:
- clk_disable(pltfm_host->clk);
+ clk_disable_unprepare(pltfm_host->clk);
clk_put(pltfm_host->clk);
err_clk_get:
kfree(imx_data);
@@ -577,7 +577,7 @@ static int __devexit sdhci_esdhc_imx_remove(struct platform_device *pdev)
gpio_free(boarddata->cd_gpio);
}
- clk_disable(pltfm_host->clk);
+ clk_disable_unprepare(pltfm_host->clk);
clk_put(pltfm_host->clk);
kfree(imx_data);
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 12/14] net: fec: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-mmc, netdev, linux-serial
Cc: linux, amit.kucheria, kernel, ben-linux, cjb, alan, eric.miao,
richard.zhao
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao@linaro.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
drivers/net/ethernet/freescale/fec.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 1124ce0..e96fa44 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1588,7 +1588,7 @@ fec_probe(struct platform_device *pdev)
ret = PTR_ERR(fep->clk);
goto failed_clk;
}
- clk_enable(fep->clk);
+ clk_prepare_enable(fep->clk);
ret = fec_enet_init(ndev);
if (ret)
@@ -1611,7 +1611,7 @@ failed_register:
fec_enet_mii_remove(fep);
failed_mii_init:
failed_init:
- clk_disable(fep->clk);
+ clk_disable_unprepare(fep->clk);
clk_put(fep->clk);
failed_clk:
for (i = 0; i < FEC_IRQ_NUM; i++) {
@@ -1638,7 +1638,7 @@ fec_drv_remove(struct platform_device *pdev)
fec_stop(ndev);
fec_enet_mii_remove(fep);
- clk_disable(fep->clk);
+ clk_disable_unprepare(fep->clk);
clk_put(fep->clk);
iounmap(fep->hwp);
unregister_netdev(ndev);
@@ -1664,7 +1664,7 @@ fec_suspend(struct device *dev)
fec_stop(ndev);
netif_device_detach(ndev);
}
- clk_disable(fep->clk);
+ clk_disable_unprepare(fep->clk);
return 0;
}
@@ -1675,7 +1675,7 @@ fec_resume(struct device *dev)
struct net_device *ndev = dev_get_drvdata(dev);
struct fec_enet_private *fep = netdev_priv(ndev);
- clk_enable(fep->clk);
+ clk_prepare_enable(fep->clk);
if (netif_running(ndev)) {
fec_restart(ndev, fep->full_duplex);
netif_device_attach(ndev);
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 11/14] serial: imx: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-mmc, netdev, linux-serial
Cc: linux, amit.kucheria, kernel, ben-linux, cjb, alan, eric.miao,
richard.zhao
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao@linaro.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
drivers/tty/serial/imx.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 163fc90..8f3709f 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1390,7 +1390,7 @@ static int serial_imx_probe(struct platform_device *pdev)
ret = PTR_ERR(sport->clk);
goto unmap;
}
- clk_enable(sport->clk);
+ clk_prepare_enable(sport->clk);
sport->port.uartclk = clk_get_rate(sport->clk);
@@ -1413,8 +1413,8 @@ deinit:
if (pdata && pdata->exit)
pdata->exit(pdev);
clkput:
+ clk_disable_unprepare(sport->clk);
clk_put(sport->clk);
- clk_disable(sport->clk);
unmap:
iounmap(sport->port.membase);
free:
@@ -1434,11 +1434,10 @@ static int serial_imx_remove(struct platform_device *pdev)
if (sport) {
uart_remove_one_port(&imx_reg, &sport->port);
+ clk_disable_unprepare(sport->clk);
clk_put(sport->clk);
}
- clk_disable(sport->clk);
-
if (pdata && pdata->exit)
pdata->exit(pdev);
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 10/14] ARM: mxs: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-mmc-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ,
amit.kucheria-Z7WLFzj8eWMS+FvcfC7Uqw,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
cjb-2X9k7bc8m7Mdnm+yROfE0A, alan-VuQAYsv1563Yd54FQh9/CA,
eric.miao-QSEj5FYQhm4dnm+yROfE0A,
richard.zhao-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
arch/arm/mach-mxs/system.c | 2 +-
arch/arm/mach-mxs/timer.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mxs/system.c b/arch/arm/mach-mxs/system.c
index 20ec3bd..9760a12 100644
--- a/arch/arm/mach-mxs/system.c
+++ b/arch/arm/mach-mxs/system.c
@@ -66,7 +66,7 @@ static int __init mxs_arch_reset_init(void)
clk = clk_get_sys("rtc", NULL);
if (!IS_ERR(clk))
- clk_enable(clk);
+ clk_prepare_enable(clk);
return 0;
}
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index cace0d2..564a632 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -245,7 +245,7 @@ static int __init mxs_clocksource_init(struct clk *timer_clk)
void __init mxs_timer_init(struct clk *timer_clk, int irq)
{
- clk_enable(timer_clk);
+ clk_prepare_enable(timer_clk);
/*
* Initialize timers to a known state
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 09/14] ARM: mx31moboard: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-mmc, netdev, linux-serial
Cc: linux, amit.kucheria, kernel, ben-linux, cjb, alan, eric.miao,
richard.zhao
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao@linaro.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/mach-imx/mach-mx31moboard.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c
index 07034f4..d1a9337 100644
--- a/arch/arm/mach-imx/mach-mx31moboard.c
+++ b/arch/arm/mach-imx/mach-mx31moboard.c
@@ -505,7 +505,7 @@ static void mx31moboard_poweroff(void)
struct clk *clk = clk_get_sys("imx2-wdt.0", NULL);
if (!IS_ERR(clk))
- clk_enable(clk);
+ clk_prepare_enable(clk);
mxc_iomux_mode(MX31_PIN_WATCHDOG_RST__WATCHDOG_RST);
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 08/14] ARM: pm-imx5: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-mmc, netdev, linux-serial
Cc: linux, amit.kucheria, kernel, ben-linux, cjb, alan, eric.miao,
richard.zhao
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao@linaro.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/mach-mx5/pm-imx5.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mx5/pm-imx5.c b/arch/arm/mach-mx5/pm-imx5.c
index 98052fc..2bdc85f 100644
--- a/arch/arm/mach-mx5/pm-imx5.c
+++ b/arch/arm/mach-mx5/pm-imx5.c
@@ -22,7 +22,7 @@ static struct clk *gpc_dvfs_clk;
static int mx5_suspend_prepare(void)
{
- return clk_enable(gpc_dvfs_clk);
+ return clk_prepare_enable(gpc_dvfs_clk);
}
static int mx5_suspend_enter(suspend_state_t state)
@@ -52,7 +52,7 @@ static int mx5_suspend_enter(suspend_state_t state)
static void mx5_suspend_finish(void)
{
- clk_disable(gpc_dvfs_clk);
+ clk_disable_unprepare(gpc_dvfs_clk);
}
static int mx5_pm_valid(suspend_state_t state)
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 07/14] ARM: mxc: audmux-v2: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-mmc-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ,
amit.kucheria-Z7WLFzj8eWMS+FvcfC7Uqw,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
cjb-2X9k7bc8m7Mdnm+yROfE0A, alan-VuQAYsv1563Yd54FQh9/CA,
eric.miao-QSEj5FYQhm4dnm+yROfE0A,
richard.zhao-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
arch/arm/plat-mxc/audmux-v2.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/plat-mxc/audmux-v2.c b/arch/arm/plat-mxc/audmux-v2.c
index 8cced35..0e51fc3 100644
--- a/arch/arm/plat-mxc/audmux-v2.c
+++ b/arch/arm/plat-mxc/audmux-v2.c
@@ -73,13 +73,13 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
return -ENOMEM;
if (audmux_clk)
- clk_enable(audmux_clk);
+ clk_prepare_enable(audmux_clk);
ptcr = readl(audmux_base + MXC_AUDMUX_V2_PTCR(port));
pdcr = readl(audmux_base + MXC_AUDMUX_V2_PDCR(port));
if (audmux_clk)
- clk_disable(audmux_clk);
+ clk_disable_unprepare(audmux_clk);
ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
pdcr, ptcr);
@@ -172,13 +172,13 @@ int mxc_audmux_v2_configure_port(unsigned int port, unsigned int ptcr,
return -ENOSYS;
if (audmux_clk)
- clk_enable(audmux_clk);
+ clk_prepare_enable(audmux_clk);
writel(ptcr, audmux_base + MXC_AUDMUX_V2_PTCR(port));
writel(pdcr, audmux_base + MXC_AUDMUX_V2_PDCR(port));
if (audmux_clk)
- clk_disable(audmux_clk);
+ clk_disable_unprepare(audmux_clk);
return 0;
}
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 06/14] ARM: mxc: arch_reset: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:48 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-mmc-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ,
amit.kucheria-Z7WLFzj8eWMS+FvcfC7Uqw,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
cjb-2X9k7bc8m7Mdnm+yROfE0A, alan-VuQAYsv1563Yd54FQh9/CA,
eric.miao-QSEj5FYQhm4dnm+yROfE0A,
richard.zhao-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
arch/arm/plat-mxc/system.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-mxc/system.c b/arch/arm/plat-mxc/system.c
index 9dad8dc..a667adc 100644
--- a/arch/arm/plat-mxc/system.c
+++ b/arch/arm/plat-mxc/system.c
@@ -54,7 +54,7 @@ void arch_reset(char mode, const char *cmd)
clk = clk_get_sys("imx2-wdt.0", NULL);
if (!IS_ERR(clk))
- clk_enable(clk);
+ clk_prepare_enable(clk);
wcr_enable = (1 << 2);
}
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 04/14] ARM: mxc: pwm: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:47 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-mmc-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
Cc: linux-lFZ/pmaqli7XmaaqVzeoHQ,
amit.kucheria-Z7WLFzj8eWMS+FvcfC7Uqw,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ, ben-linux-elnMNo+KYs3YtjvyW6yDsg,
cjb-2X9k7bc8m7Mdnm+yROfE0A, alan-VuQAYsv1563Yd54FQh9/CA,
eric.miao-QSEj5FYQhm4dnm+yROfE0A,
richard.zhao-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
arch/arm/plat-mxc/pwm.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-mxc/pwm.c b/arch/arm/plat-mxc/pwm.c
index 42d74ea..68c7199b 100644
--- a/arch/arm/plat-mxc/pwm.c
+++ b/arch/arm/plat-mxc/pwm.c
@@ -118,7 +118,7 @@ int pwm_enable(struct pwm_device *pwm)
int rc = 0;
if (!pwm->clk_enabled) {
- rc = clk_enable(pwm->clk);
+ rc = clk_prepare_enable(pwm->clk);
if (!rc)
pwm->clk_enabled = 1;
}
@@ -131,7 +131,7 @@ void pwm_disable(struct pwm_device *pwm)
writel(0, pwm->mmio_base + MX3_PWMCR);
if (pwm->clk_enabled) {
- clk_disable(pwm->clk);
+ clk_disable_unprepare(pwm->clk);
pwm->clk_enabled = 0;
}
}
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 03/14] ARM: mxc: ahci: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:47 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-mmc, netdev, linux-serial
Cc: amit.kucheria, linux, kernel, eric.miao, ben-linux, cjb,
richard.zhao, alan
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao@linaro.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/plat-mxc/devices/platform-ahci-imx.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/plat-mxc/devices/platform-ahci-imx.c b/arch/arm/plat-mxc/devices/platform-ahci-imx.c
index d8a56ae..ade4a1c 100644
--- a/arch/arm/plat-mxc/devices/platform-ahci-imx.c
+++ b/arch/arm/plat-mxc/devices/platform-ahci-imx.c
@@ -60,9 +60,9 @@ static int imx_sata_init(struct device *dev, void __iomem *addr)
dev_err(dev, "no sata clock.\n");
return PTR_ERR(sata_clk);
}
- ret = clk_enable(sata_clk);
+ ret = clk_prepare_enable(sata_clk);
if (ret) {
- dev_err(dev, "can't enable sata clock.\n");
+ dev_err(dev, "can't prepare/enable sata clock.\n");
goto put_sata_clk;
}
@@ -73,9 +73,9 @@ static int imx_sata_init(struct device *dev, void __iomem *addr)
ret = PTR_ERR(sata_ref_clk);
goto release_sata_clk;
}
- ret = clk_enable(sata_ref_clk);
+ ret = clk_prepare_enable(sata_ref_clk);
if (ret) {
- dev_err(dev, "can't enable sata ref clock.\n");
+ dev_err(dev, "can't prepare/enable sata ref clock.\n");
goto put_sata_ref_clk;
}
@@ -104,11 +104,11 @@ static int imx_sata_init(struct device *dev, void __iomem *addr)
return 0;
release_sata_ref_clk:
- clk_disable(sata_ref_clk);
+ clk_disable_unprepare(sata_ref_clk);
put_sata_ref_clk:
clk_put(sata_ref_clk);
release_sata_clk:
- clk_disable(sata_clk);
+ clk_disable_unprepare(sata_clk);
put_sata_clk:
clk_put(sata_clk);
@@ -117,10 +117,10 @@ put_sata_clk:
static void imx_sata_exit(struct device *dev)
{
- clk_disable(sata_ref_clk);
+ clk_disable_unprepare(sata_ref_clk);
clk_put(sata_ref_clk);
- clk_disable(sata_clk);
+ clk_disable_unprepare(sata_clk);
clk_put(sata_clk);
}
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 02/14] ARM: mxc: time: add clk_prepare/clk_unprepare
From: Richard Zhao @ 2011-11-15 6:47 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-mmc, netdev, linux-serial
Cc: linux, amit.kucheria, kernel, ben-linux, cjb, alan, eric.miao,
richard.zhao
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao@linaro.org>
It's for migrating to generic clk framework API.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
arch/arm/plat-mxc/time.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index 4b0fe28..b4e8b18 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -292,7 +292,7 @@ void __init mxc_timer_init(struct clk *timer_clk, void __iomem *base, int irq)
{
uint32_t tctl_val;
- clk_enable(timer_clk);
+ clk_prepare_enable(timer_clk);
timer_base = base;
--
1.7.5.4
^ permalink raw reply related
* [PATCH V4 01/14] clk: add helper functions clk_prepare_enable and clk_disable_unprepare
From: Richard Zhao @ 2011-11-15 6:47 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-mmc, netdev, linux-serial
Cc: linux, amit.kucheria, kernel, ben-linux, cjb, alan, eric.miao,
richard.zhao
In-Reply-To: <1321339689-25256-1-git-send-email-richard.zhao@linaro.org>
It's for migrating to generic clk framework API.
The helper functions help cases clk_enable/clk_disable is used
in non-atomic context.
For example, Call clk_enable in probe and clk_disable in remove.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
include/linux/clk.h | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 7213b52..b9d46fa 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -107,6 +107,28 @@ static inline void clk_unprepare(struct clk *clk)
}
#endif
+/* clk_prepare_enable helps cases using clk_enable in non-atomic context. */
+static inline int clk_prepare_enable(struct clk *clk)
+{
+ int ret;
+
+ ret = clk_prepare(clk);
+ if (ret)
+ return ret;
+ ret = clk_enable(clk);
+ if (ret)
+ clk_unprepare(clk);
+
+ return ret;
+}
+
+/* clk_disable_unprepare helps cases using clk_disable in non-atomic context. */
+static inline void clk_disable_unprepare(struct clk *clk)
+{
+ clk_disable(clk);
+ clk_unprepare(clk);
+}
+
/**
* clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
* This is only valid once the clock source has been enabled.
--
1.7.5.4
^ 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