* Re: r8169 driver crashes in 2.6.32.43
From: Kasper Dupont @ 2011-08-05 14:08 UTC (permalink / raw)
To: Francois Romieu; +Cc: ivecera, hayeswang, gregkh, netdev
In-Reply-To: <20110728210112.GA25953@colin.search.kasperd.net>
I did a bit more of experiments. I took the unmodified
2.6.32.43 kernel and added printk statements to see when
it entered the interrupt handler and when it left it.
That way I was able to confirm that the system locked
up inside the interrupt handler.
Next I added printk statements to see how many times the
loop in the interrupt handler was run. It seemed that
when it locked up inside the handler it would run the
loop just two times and then lock up before leaving the
handler.
I added more printk statements to see which branches were
taken inside the loop. Unfortunately those printk
statements changed the timing enough that the crashes
were no longer as reproducable.
I saw a pattern repeating. It would do the stop queue
thing, then leave the handler and while not inside this
interrupt handler there would be a message about the
interface coming up again. Seems like it was doing stop
queue calls much more frequently than it should be.
After a few attempts I managed to get it to lock up again
with all the printk statements in place. What I found was
that in the beginning of the loop status was 0x85. It
would then call the napi event code. At the end of the
first itteration of the loop status was 0.
At that point it did not itterate through the loop again
and it did not leave the interrupt handler either. I'll
power cycle the machine and take a closer look on the
source to see what could possible be happening at that
point.
I also did a bit of testing with the patches that causes
it to drop the network instead of crashing. On those I
am able to bring up the second interface and get data off
the machine for debugging, so if there is any debug info
you think would be useful in those cases, let me know.
--
Kasper Dupont -- Rigtige mænd skriver deres egne backupprogrammer
#define _(_)"d.%.4s%."_"2s" /* This is my email address */
char*_="@2kaspner"_()"%03"_("4s%.")"t\n";printf(_+11,_+6,_,11,_+2,_+7,_+6);
^ permalink raw reply
* Re: [forcedeth bug] Re: [GIT] Networking
From: Jiri Pirko @ 2011-08-05 14:37 UTC (permalink / raw)
To: Ingo Molnar; +Cc: David Miller, torvalds, akpm, netdev, linux-kernel
In-Reply-To: <20110805123136.GF1928@minipsycho.orion>
Fri, Aug 05, 2011 at 02:31:37PM CEST, jpirko@redhat.com wrote:
>Fri, Aug 05, 2011 at 02:18:55PM CEST, mingo@elte.hu wrote:
>>
>>* Jiri Pirko <jpirko@redhat.com> wrote:
>>
>>> >> Is DEV_HAS_VLAN set in id->driver_data (L5344) ?
>>> >
>>> >How do i tell that without hacking the driver?
>>>
>>> look in dmesg for line like:
>>> "forcedeth 0000:00:08.0: highdma csum vlan pwrctl mgmt gbit lnktim msi
>>> desc-v3"
>>>
>>> if "vlan" is there, DEV_HAS_VLAN is set
>>
>>[ 3.534489] forcedeth 0000:00:0a.0: highdma csum gbit lnktim desc-v3
>>
>>Note, this is a pretty old system with an old nvidia chipset and
>>on-board ethernet:
>>
>>00:0a.0 Bridge: nVidia Corporation CK804 Ethernet Controller (rev a3)
>> Subsystem: ASUSTeK Computer Inc. K8N4-E Mainboard
>> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
>> Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
>> Latency: 0 (250ns min, 5000ns max)
>> Interrupt: pin A routed to IRQ 11
>> Region 0: Memory at da100000 (32-bit, non-prefetchable) [size=4K]
>> Region 1: I/O ports at d000 [size=8]
>> Capabilities: [44] Power Management version 2
>> Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
>> Status: D0 PME-Enable+ DSel=0 DScale=0 PME-
>
>Please do lspci -nn
>
>There are two CK804 chips:
>0x10DE, 0x0056
>0x10DE, 0x0057
>
>I have only the second one handy - Getting the machine as we speak.
I'm unable to see problems you are referring to on my machine.
Would you please try following patch if it fixes your issue? It's
in fact returning everything back to the original state (for your card).
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index e55df30..d7d43d4 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -2763,18 +2763,18 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
skb->protocol = eth_type_trans(skb, dev);
prefetch(skb->data);
- vlanflags = le32_to_cpu(np->get_rx.ex->buflow);
-
/*
* There's need to check for NETIF_F_HW_VLAN_RX here.
* Even if vlan rx accel is disabled,
* NV_RX3_VLAN_TAG_PRESENT is pseudo randomly set.
*/
- if (dev->features & NETIF_F_HW_VLAN_RX &&
- vlanflags & NV_RX3_VLAN_TAG_PRESENT) {
- u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK;
+ if (dev->features & NETIF_F_HW_VLAN_RX) {
+ vlanflags = le32_to_cpu(np->get_rx.ex->buflow);
+ if (vlanflags & NV_RX3_VLAN_TAG_PRESENT) {
+ u16 vid = vlanflags & NV_RX3_VLAN_TAG_MASK;
- __vlan_hwaccel_put_tag(skb, vid);
+ __vlan_hwaccel_put_tag(skb, vid);
+ }
}
napi_gro_receive(&np->napi, skb);
@@ -5615,7 +5615,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
goto out_error;
}
- nv_vlan_mode(dev, dev->features);
+ //nv_vlan_mode(dev, dev->features);
netif_carrier_off(dev);
^ permalink raw reply related
* Re: r8169 driver crashes in 2.6.32.43
From: Kasper Dupont @ 2011-08-05 14:40 UTC (permalink / raw)
To: Francois Romieu; +Cc: ivecera, hayeswang, gregkh, netdev
In-Reply-To: <20110805140047.GA19758@colin.search.kasperd.net>
On 05/08/11 16.08, Kasper Dupont wrote:
> At that point it did not itterate through the loop again
> and it did not leave the interrupt handler either. I'll
> power cycle the machine and take a closer look on the
> source to see what could possible be happening at that
> point.
I looked at the source around the place where that lockup
happened. There was absolutely no I/O or loops happening
between the two printk calls. It seemed the only real
candidate for a culprit responsible for that lockup was
the printk calls themselves.
Is it plausible that in 2.6.32.43 it is not safe to call
printk from within an interrupt handler?
I added some more printk statements in an attempt to find
out how it was possible for the code to lock up between
the end of the loop and the exit from the interrupt handler.
I wasn't able to reproduce the lockup in the same spot, but
instead I saw a lockup inside the loop in the branch where
it does netif_stop_queue.
Right now I suspect those builds where I added printk
statements lockup due to the printk statements. But does
the plain 2.6.32.43 kernel then also lockup due to printk
statements in the interrupt handler, or is it something
else?
--
Kasper Dupont -- Rigtige mænd skriver deres egne backupprogrammer
#define _(_)"d.%.4s%."_"2s" /* This is my email address */
char*_="@2kaspner"_()"%03"_("4s%.")"t\n";printf(_+11,_+6,_,11,_+2,_+7,_+6);
^ permalink raw reply
* Re: [PATCH 1/3] net: sendmmsg should only return an error if no messages were sent
From: Arnaldo Carvalho de Melo @ 2011-08-05 14:40 UTC (permalink / raw)
To: Steven Whitehouse; +Cc: Tetsuo Handa, rdenis, netdev
In-Reply-To: <1312532408.2762.4.camel@menhir>
Em Fri, Aug 05, 2011 at 09:20:08AM +0100, Steven Whitehouse escreveu:
> On Fri, 2011-08-05 at 12:57 +0900, Tetsuo Handa wrote:
> > Anton Blanchard wrote:
> > > sendmmsg uses a similar error return strategy as recvmmsg but it
> > > turns out to be a confusing way to communicate errors.
> > >
> > > The current code stores the error code away and returns it on the next
> > > sendmmsg call. This means a call with completely valid arguments could
> > > get an error from a previous call.
> > >
> > > Change things so we only return an error if no datagrams could be sent.
> > > If less than the requested number of messages were sent, the application
> > > must retry starting at the first failed one and if the problem is
> > > persistent the error will be returned.
> > >
> > > This matches the behaviour of other syscalls like read/write - it
> > > is not an error if less than the requested number of elements are sent.
> >
> > OK. David S. Miller suggested this behavior and Anton Blanchard agreed with
> > this behavior.
> >
> > Quoting from commit a2e27255 "net: Introduce recvmmsg socket syscall":
> > | . R?mi Denis-Courmont & Steven Whitehouse: If we receive N < vlen
> > | datagrams and then recvmsg returns an error, recvmmsg will return
> > | the successfully received datagrams, store the error and return it
> > | in the next call.
> >
> > R?mi Denis-Courmont, Steven Whitehouse and Arnaldo Carvalho de Melo, do you
> > want to change recvmmsg()'s behaviour as well?
>
> Since I've joined this part way through it seems, I'm assuming that if
> something was sent/received then that will be returned and the error
> stored until the next call. If nothing was sent/received then the error
> can be returned immediately.
>
> That is what I'd expect to be the case, since otherwise it is impossible
> to know how much has been successfully sent/received in the partial
> failure case, I think. Also it means that sendmmesg/recvmmsg matches
> sendmsg/recvmsg in terms of expected return values and thus the
> principle of least surprise.
>
> So if thats what is being proposed, then it sounds good to me,
Sounds sane to me too.
- Arnaldo
^ permalink raw reply
* Re: Fw: [Bug 39132] Starting with 3.0.0-rc6, masquerading seems to be broken.
From: Julian Anastasov @ 2011-08-05 15:16 UTC (permalink / raw)
To: David Hill; +Cc: Florian Mickler, netdev, David Miller, bugzilla-daemon
In-Reply-To: <8A188C9C23A54337A5A276BAE29DC6E0@delorimier>
Hello,
On Fri, 5 Aug 2011, David Hill wrote:
> I'm not using TPROXY and I've used a blank firewall with only masquerading
> and reproduced the issue.
> Nothing is in NAT/mangle nor OUTPUT but the rules mentionned in the attached
> files to this bug.
>
> Francis Whittle (Comment #18) has the same issue.
I compiled 3.0 kernel, added one -j MASQUERADE and
tried TCP connection - it works. I'm not sure ip_route_me_harder
is called for masqueraded traffic, usually it is called
from LOCAL_OUT handlers or to send TCP RST (-j REJECT) via
LOCAL_OUT, not for forwarded traffic.
Can you show lines of tcpdump output with addresses and
ports, so that I can understand what kind of traffic is
dropped, is it initial forwarded packet or its response,
is it problem with some ICMP packets, I assume there is
no problem with locally generated traffic.
Can you show output from:
# grep . /proc/sys/net/ipv4/conf/*/rp_filter
# grep . /proc/sys/net/ipv4/conf/*/send_redirects
If it works with -rc5 it should not be rp_filter,
for NAT, problem can be with ICMP redirects or something else.
Can you tell us if the internal and external devices are
same or may be many.
Regards
--
Julian Anastasov <ja@ssi.bg>
^ permalink raw reply
* Re: return of ip_rt_bug()
From: Julian Anastasov @ 2011-08-05 16:36 UTC (permalink / raw)
To: Tom London; +Cc: Dave Jones, netdev
In-Reply-To: <CAFiZG+Wmv_FEx2ZX3qZt0tAr-QVQD_javX1gbRWujr9xyf7nbQ@mail.gmail.com>
Hello,
On Fri, 5 Aug 2011, Tom London wrote:
> I'd like to conclude that this is due to UDP casting on the wlan.
> I'll reboot with the radio on and in debug mode to see what happens.
Sending to 255.255.255.255 without binding to source address
or output device will succeed only if there is a route that matches
the 255.255.255.255 address (default route as last option).
If no route matches, the result is ENETUNREACH and packet
should be dropped. But how input route is attached, I still don't know.
Your ip monitor does not show fatal event that can
invalidate the source address or the default route (that
will match for 255.255.255.255) while sending packet.
It is almost impossible such problem to occur, i.e. between routing
and following re-routing the address/route to disappear.
Such events:
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>
link/ether
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>
link/ether
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP>
link/ether
are may be for link, not sure. Events for addresses/routes
would show addresses and routes in a way similar to
ip addr and ip route list.
Not sure where your logs go, may be you can add
"kern.* /var/log/kernel.log" in your /etc/rsyslog.conf. But if
you don't see the WARNING then the problem does not happen.
You can also see the ip_rt_bug line with 'dmesg'. So, can
you confirm the problem occurs only when default route
points to wlan? Even if so, I still don't see good explanation
for the error message.
Regards
--
Julian Anastasov <ja@ssi.bg>
^ permalink raw reply
* Fix bridge MAC change notification.
From: Andrei Warkentin @ 2011-08-05 1:55 UTC (permalink / raw)
To: netdev
This is my first time on netdev. I am writing about the ensuring
that upper network layers are aware of bridge MAC changes due
to re-configuration or port addition/removal.
It seems this topic has cropped up before, with one patch by
Stephen Hemminger already in 3.0, and a fix for it (sent 7/22)
(http://marc.info/?l=linux-netdev&m=131135705613958&w=2) pending.
The existing patches don't cover the br_del_if case, the case of
a changing MAC address on a port associated with the bridge, and
the case of manually setting the MAC address, which the following
patch remedies.
Table of Contents:
[PATCH] Bridge: Always send NETDEV_CHANGEADDR up on br MAC change.
Thank you,
A
^ permalink raw reply
* Re: [PATCHv3] Bridge: Always send NETDEV_CHANGEADDR up on br MAC change.
From: Andrei Warkentin @ 2011-08-05 6:13 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
In-Reply-To: <20110804213605.31be6131@nehalam.ftrdhcpuser.net>
Hi Stephen,
On Thu, Aug 4, 2011 at 11:36 PM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> On Thu, 4 Aug 2011 21:17:05 -0500
> Andrei Warkentin <andreiw@motorola.com> wrote:
>
> Half ok, half not.
>
>> diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
>> index cf09fe5..ef18070 100644
>> --- a/net/bridge/br_device.c
>> +++ b/net/bridge/br_device.c
>> @@ -162,6 +162,7 @@ static int br_set_mac_address(struct net_device *dev, void *p)
>> br->flags |= BR_SET_MAC_ADDR;
>> spin_unlock_bh(&br->lock);
>>
>> + call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
>> return 0;
>> }
>
> This is unnecessary since already done by dev_set_mac_address.
>
>> diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
>> index c0990ba..4528e9a 100644
>> --- a/net/bridge/br_stp_if.c
>> +++ b/net/bridge/br_stp_if.c
>> @@ -213,7 +213,7 @@ bool br_stp_recalculate_bridge_id(struct net_bridge *br)
>>
>> /* user has chosen a value so keep it */
>> if (br->flags & BR_SET_MAC_ADDR)
>> - return;
>> + return false;
>>
>> list_for_each_entry(p, &br->port_list, list) {
>> if (addr == br_mac_zero ||
>
> This is already in net-next.
>
Thank you for your feedback. I will clean this up and resubmit tomorrow.
A
^ permalink raw reply
* [PATCH] slip: fix NOHZ local_softirq_pending 08 warning
From: Matvejchikov Ilya @ 2011-08-05 19:23 UTC (permalink / raw)
To: netdev
When using nanosleep() in an userspace application we get a ratelimit warning:
NOHZ: local_softirq_pending 08
According to 481a8199142c050b72bff8a1956a49fd0a75bbe0 the problem is caused by
netif_rx() function. This patch replaces netif_rx() with netif_rx_ni() which
has to be used from process/softirq context.
Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>
---
drivers/net/slip.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index f11b3f3..4c61753 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -367,7 +367,7 @@ static void sl_bump(struct slip *sl)
memcpy(skb_put(skb, count), sl->rbuff, count);
skb_reset_mac_header(skb);
skb->protocol = htons(ETH_P_IP);
- netif_rx(skb);
+ netif_rx_ni(skb);
dev->stats.rx_packets++;
}
--
1.7.4.1
^ permalink raw reply related
* [PATCH net-next 1/6] be2net: set wrb.hdr.domain in be_cmd_link_status_query
From: Ajit Khaparde @ 2011-08-05 19:59 UTC (permalink / raw)
To: davem; +Cc: netdev
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_cmds.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 4278595..8d178d2 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -1282,6 +1282,8 @@ int be_cmd_link_status_query(struct be_adapter *adapter, u8 *mac_speed,
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_NTWK_LINK_STATUS_QUERY, sizeof(*req));
+ req->hdr.domain = dom;
+
status = be_mcc_notify_wait(adapter);
if (!status) {
struct be_cmd_resp_link_status *resp = embedded_payload(wrb);
--
1.7.4.1
^ permalink raw reply related
* [PATCH net-next 0/6] be2net: patch series
From: Ajit Khaparde @ 2011-08-05 19:59 UTC (permalink / raw)
To: davem; +Cc: netdev
Series of 6 patches against net-next-2.6
Please apply.
Thanks
-Ajit
[1/6] be2net: set wrb.hdr.domain in be_cmd_link_status_query
[2/6] be2net: add be_cmd_set_port_speed_v1 to set port speed
[3/6] be2net: add be_cmd_get_port_speed to get port speed
[4/6] be2net: add ethtool::set_settings support
[5/6] be2net: Disable RSS for VF interfaces
[6/6] be2net: fix to set ecmd->autoneg correctly
^ permalink raw reply
* [PATCH net-next 2/6] be2net: add be_cmd_set_port_speed_v1 to set port speed
From: Ajit Khaparde @ 2011-08-05 19:59 UTC (permalink / raw)
To: davem; +Cc: netdev
Signed-off-by: Suresh Reddy <suresh.reddy@emulex.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_cmds.c | 35 +++++++++++++++++++++++++++++++++++
drivers/net/benet/be_cmds.h | 37 ++++++++++++++++++++++++++++++++++++-
2 files changed, 71 insertions(+), 1 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 8d178d2..863ae67 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -2367,3 +2367,38 @@ err:
mutex_unlock(&adapter->mbox_lock);
return status;
}
+
+int be_cmd_set_port_speed_v1(struct be_adapter *adapter,
+ u8 port_num, u16 mac_speed,
+ u16 dac_cable_len)
+{
+ struct be_mcc_wrb *wrb;
+ struct be_cmd_req_set_port_speed_v1 *req;
+ int status = 0;
+
+ spin_lock_bh(&adapter->mcc_lock);
+
+ wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
+ req = embedded_payload(wrb);
+ be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0,
+ OPCODE_COMMON_NTWK_SET_LINK_SPEED);
+
+ be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
+ OPCODE_COMMON_NTWK_SET_LINK_SPEED,
+ sizeof(*req));
+ req->hdr.version = 1;
+
+ req->port_num = port_num;
+ req->virt_port = port_num;
+ req->mac_speed = cpu_to_le16(mac_speed);
+ req->dac_cable_length = cpu_to_le16(dac_cable_len);
+ status = be_mcc_notify_wait(adapter);
+err:
+ spin_unlock_bh(&adapter->mcc_lock);
+ return status;
+}
+
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index b61eac7..4a6a959 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -178,6 +178,7 @@ struct be_mcc_mailbox {
#define OPCODE_COMMON_MCC_DESTROY 53
#define OPCODE_COMMON_CQ_DESTROY 54
#define OPCODE_COMMON_EQ_DESTROY 55
+#define OPCODE_COMMON_NTWK_SET_LINK_SPEED 57
#define OPCODE_COMMON_QUERY_FIRMWARE_CONFIG 58
#define OPCODE_COMMON_NTWK_PMAC_ADD 59
#define OPCODE_COMMON_NTWK_PMAC_DEL 60
@@ -1237,6 +1238,8 @@ enum {
PHY_TYPE_KX4_10GB,
PHY_TYPE_BASET_10GB,
PHY_TYPE_BASET_1GB,
+ PHY_TYPE_BASEX_1GB,
+ PHY_TYPE_SGMII,
PHY_TYPE_DISABLED = 255
};
@@ -1301,6 +1304,37 @@ struct be_cmd_resp_set_func_cap {
u8 rsvd[212];
};
+/* MAC speed valid values */
+#define SPEED_DEFAULT 0x0
+#define SPEED_FORCED_10GB 0x1
+#define SPEED_FORCED_1GB 0x2
+#define SPEED_AUTONEG_10GB 0x3
+#define SPEED_AUTONEG_1GB 0x4
+#define SPEED_AUTONEG_100MB 0x5
+#define SPEED_AUTONEG_10GB_1GB 0x6
+#define SPEED_AUTONEG_10GB_1GB_100MB 0x7
+#define SPEED_AUTONEG_1GB_100MB 0x8
+#define SPEED_AUTONEG_10MB 0x9
+#define SPEED_AUTONEG_1GB_100MB_10MB 0xa
+#define SPEED_AUTONEG_100MB_10MB 0xb
+#define SPEED_FORCED_100MB 0xc
+#define SPEED_FORCED_10MB 0xd
+
+/*************** Set speed ********************/
+struct be_cmd_req_set_port_speed_v1 {
+ struct be_cmd_req_hdr hdr;
+ u8 port_num;
+ u8 virt_port;
+ u16 mac_speed;
+ u16 dac_cable_length;
+ u16 rsvd0;
+};
+
+struct be_cmd_resp_set_port_speed_v1 {
+ struct be_cmd_resp_hdr hdr;
+ u32 rsvd0;
+};
+
/*************** HW Stats Get v1 **********************************/
#define BE_TXP_SW_SZ 48
struct be_port_rxf_stats_v1 {
@@ -1499,4 +1533,5 @@ extern int be_cmd_get_cntl_attributes(struct be_adapter *adapter);
extern int be_cmd_req_native_mode(struct be_adapter *adapter);
extern int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size);
extern void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf);
-
+extern int be_cmd_set_port_speed_v1(struct be_adapter *adapter, u8 port_num,
+ u16 mac_speed, u16 dac_cable_len);
--
1.7.4.1
^ permalink raw reply related
* [PATCH net-next 3/6] be2net: add be_cmd_get_port_speed to get port speed
From: Ajit Khaparde @ 2011-08-05 20:00 UTC (permalink / raw)
To: davem; +Cc: netdev
Signed-off-by: Suresh Reddy <suresh.reddy@emulex.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_cmds.c | 35 +++++++++++++++++++++++++++++++++++
drivers/net/benet/be_cmds.h | 15 +++++++++++++++
2 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 863ae67..ee6d274 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -2368,6 +2368,41 @@ err:
return status;
}
+int be_cmd_get_port_speed(struct be_adapter *adapter,
+ u8 port_num, u16 *dac_cable_len, u16 *port_speed)
+{
+ struct be_mcc_wrb *wrb;
+ struct be_cmd_req_get_port_speed *req;
+ int status = 0;
+
+ spin_lock_bh(&adapter->mcc_lock);
+
+ wrb = wrb_from_mccq(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
+
+ req = embedded_payload(wrb);
+ be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0,
+ OPCODE_COMMON_NTWK_GET_LINK_SPEED);
+ be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
+ OPCODE_COMMON_NTWK_GET_LINK_SPEED,
+ sizeof(*req));
+ req->port_num = port_num;
+ status = be_mcc_notify_wait(adapter);
+ if (!status) {
+ struct be_cmd_resp_get_port_speed *resp =
+ embedded_payload(wrb);
+ *dac_cable_len = le16_to_cpu(resp->dac_cable_length);
+ *port_speed = le16_to_cpu(resp->mac_speed);
+ }
+
+err:
+ spin_unlock_bh(&adapter->mcc_lock);
+ return status;
+}
+
int be_cmd_set_port_speed_v1(struct be_adapter *adapter,
u8 port_num, u16 mac_speed,
u16 dac_cable_len)
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index 4a6a959..40ce808 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -190,6 +190,7 @@ struct be_mcc_mailbox {
#define OPCODE_COMMON_GET_PHY_DETAILS 102
#define OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP 103
#define OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES 121
+#define OPCODE_COMMON_NTWK_GET_LINK_SPEED 134
#define OPCODE_COMMON_WRITE_OBJECT 172
#define OPCODE_ETH_RSS_CONFIG 1
@@ -1335,6 +1336,18 @@ struct be_cmd_resp_set_port_speed_v1 {
u32 rsvd0;
};
+/************** get port speed *******************/
+struct be_cmd_req_get_port_speed {
+ struct be_cmd_req_hdr hdr;
+ u8 port_num;
+};
+
+struct be_cmd_resp_get_port_speed {
+ struct be_cmd_resp_hdr hdr;
+ u16 mac_speed;
+ u16 dac_cable_length;
+};
+
/*************** HW Stats Get v1 **********************************/
#define BE_TXP_SW_SZ 48
struct be_port_rxf_stats_v1 {
@@ -1535,3 +1548,5 @@ extern int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size);
extern void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf);
extern int be_cmd_set_port_speed_v1(struct be_adapter *adapter, u8 port_num,
u16 mac_speed, u16 dac_cable_len);
+extern int be_cmd_get_port_speed(struct be_adapter *adapter, u8 port_num,
+ u16 *dac_cable_len, u16 *port_speed);
--
1.7.4.1
^ permalink raw reply related
* [PATCH net-next 4/6] be2net: add ethtool::set_settings support
From: Ajit Khaparde @ 2011-08-05 20:00 UTC (permalink / raw)
To: davem; +Cc: netdev
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_ethtool.c | 63 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index f144a6f..5dd3ed6 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -443,6 +443,68 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
return 0;
}
+static int be_set_settings(struct net_device *netdev,
+ struct ethtool_cmd *ecmd)
+{
+ struct be_adapter *adapter = netdev_priv(netdev);
+ struct be_phy_info phy_info;
+ u16 mac_speed = 0;
+ u16 dac_cable_len = 0;
+ u16 port_speed = 0;
+ int status;
+
+ status = be_cmd_get_phy_info(adapter, &phy_info);
+ if (status) {
+ dev_err(&adapter->pdev->dev, "Get phy info cmd failed.\n");
+ return status;
+ }
+
+ if (ecmd->autoneg == AUTONEG_ENABLE) {
+ switch (phy_info.interface_type) {
+ case PHY_TYPE_SFP_1GB:
+ case PHY_TYPE_BASET_1GB:
+ case PHY_TYPE_BASEX_1GB:
+ case PHY_TYPE_SGMII:
+ mac_speed = SPEED_AUTONEG_1GB_100MB_10MB;
+ break;
+ case PHY_TYPE_SFP_PLUS_10GB:
+ dev_warn(&adapter->pdev->dev,
+ "Autoneg not supported on this module.\n");
+ return -EINVAL;
+ case PHY_TYPE_KR_10GB:
+ case PHY_TYPE_KX4_10GB:
+ mac_speed = SPEED_AUTONEG_10GB_1GB;
+ break;
+ case PHY_TYPE_BASET_10GB:
+ mac_speed = SPEED_AUTONEG_10GB_1GB_100MB;
+ break;
+ }
+ } else if (ecmd->autoneg == AUTONEG_DISABLE) {
+ if (ethtool_cmd_speed(ecmd) == SPEED_10)
+ mac_speed = SPEED_FORCED_10MB;
+ else if (ethtool_cmd_speed(ecmd) == SPEED_100)
+ mac_speed = SPEED_FORCED_100MB;
+ else if (ethtool_cmd_speed(ecmd) == SPEED_1000)
+ mac_speed = SPEED_FORCED_1GB;
+ else if (ethtool_cmd_speed(ecmd) == SPEED_10000)
+ mac_speed = SPEED_FORCED_10GB;
+ }
+
+ status = be_cmd_get_port_speed(adapter, adapter->port_num,
+ &dac_cable_len, &port_speed);
+ if (status) {
+ dev_err(&adapter->pdev->dev, "Get port speed cmd failed.\n");
+ return status;
+ }
+
+ status = be_cmd_set_port_speed_v1(adapter, adapter->port_num,
+ mac_speed, dac_cable_len);
+ if (status)
+ dev_err(&adapter->pdev->dev, "Set port speed cmd failed.\n");
+
+ return status;
+}
+
static void
be_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
{
@@ -692,6 +754,7 @@ be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
const struct ethtool_ops be_ethtool_ops = {
.get_settings = be_get_settings,
+ .set_settings = be_set_settings,
.get_drvinfo = be_get_drvinfo,
.get_wol = be_get_wol,
.set_wol = be_set_wol,
--
1.7.4.1
^ permalink raw reply related
* [PATCH net-next 5/6] be2net: Disable RSS for VF interfaces
From: Ajit Khaparde @ 2011-08-05 20:00 UTC (permalink / raw)
To: davem; +Cc: netdev
Signed-off-by: Suresh Reddy <suresh.reddy@emulex.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_main.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 1a3acca..c20e302 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1685,7 +1685,8 @@ static void be_rx_queues_destroy(struct be_adapter *adapter)
static u32 be_num_rxqs_want(struct be_adapter *adapter)
{
if ((adapter->function_caps & BE_FUNCTION_CAPS_RSS) &&
- !adapter->sriov_enabled && !(adapter->function_mode & 0x400)) {
+ !adapter->sriov_enabled && !(adapter->function_mode & 0x400) &&
+ be_physfn(adapter)) {
return 1 + MAX_RSS_QS; /* one default non-RSS queue */
} else {
dev_warn(&adapter->pdev->dev,
--
1.7.4.1
^ permalink raw reply related
* [PATCH net-next 6/6] be2net: fix to set ecmd->autoneg correctly
From: Ajit Khaparde @ 2011-08-05 20:01 UTC (permalink / raw)
To: davem; +Cc: netdev
Set the autonegotation settings correctly based on the port speed.
Signed-off-by: Suresh Reddy <suresh.reddy@emulex.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
---
drivers/net/benet/be_ethtool.c | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 5dd3ed6..2177c8c 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -353,6 +353,8 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
u8 mac_speed = 0;
u16 link_speed = 0;
int status;
+ u16 port_speed = 0;
+ u16 dac_cable_len = 0;
if ((adapter->link_speed < 0) || (!(netdev->flags & IFF_UP))) {
status = be_cmd_link_status_query(adapter, &mac_speed,
@@ -397,11 +399,9 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
switch (phy_info.interface_type) {
case PHY_TYPE_KR_10GB:
case PHY_TYPE_KX4_10GB:
- ecmd->autoneg = AUTONEG_ENABLE;
ecmd->transceiver = XCVR_INTERNAL;
break;
default:
- ecmd->autoneg = AUTONEG_DISABLE;
ecmd->transceiver = XCVR_EXTERNAL;
break;
}
@@ -411,12 +411,25 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
adapter->link_speed = ethtool_cmd_speed(ecmd);
adapter->port_type = ecmd->port;
adapter->transceiver = ecmd->transceiver;
- adapter->autoneg = ecmd->autoneg;
} else {
ethtool_cmd_speed_set(ecmd, adapter->link_speed);
ecmd->port = adapter->port_type;
ecmd->transceiver = adapter->transceiver;
- ecmd->autoneg = adapter->autoneg;
+ }
+
+ be_cmd_get_port_speed(adapter, adapter->port_num,
+ &dac_cable_len, &port_speed);
+ switch (port_speed) {
+ case SPEED_FORCED_10GB:
+ case SPEED_FORCED_1GB:
+ case SPEED_FORCED_100MB:
+ case SPEED_FORCED_10MB:
+ case SPEED_DEFAULT:
+ ecmd->autoneg = AUTONEG_DISABLE;
+ break;
+ default:
+ ecmd->autoneg = AUTONEG_ENABLE;
+ break;
}
ecmd->duplex = DUPLEX_FULL;
--
1.7.4.1
^ permalink raw reply related
* Always send NETDEV_CHANGEADDR up
From: Andrei Warkentin @ 2011-08-05 21:04 UTC (permalink / raw)
To: netdev
In-Reply-To: <CALfQTu7MVjfO7vHB-mAC=RwokBRsi7vR6_XVfQX0+vU2ZCVHOw@mail.gmail.com>
Here is the v4 of the patch, now rebased on net-next-2.6.
ToC:
[PATCHv4] Bridge: Always send NETDEV_CHANGEADDR up on br MAC change.
Thank you,
A
^ permalink raw reply
* [PATCHv4] Bridge: Always send NETDEV_CHANGEADDR up on br MAC change.
From: Andrei Warkentin @ 2011-08-05 21:04 UTC (permalink / raw)
To: netdev; +Cc: Andrei Warkentin, Stephen Hemminger
In-Reply-To: <CALfQTu7MVjfO7vHB-mAC=RwokBRsi7vR6_XVfQX0+vU2ZCVHOw@mail.gmail.com>
This ensures the neighbor entries associated with the bridge
dev are flushed, also invalidating the associated cached L2 headers.
This means we br_add_if/br_del_if ports to implement hand-over and
not wind up with bridge packets going out with stale MAC.
This means we can also change MAC of port device and also not wind
up with bridge packets going out with stale MAC.
This builds on Stephen Hemminger's patch, also handling the br_del_if
case and the port MAC change case.
Cc: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
---
net/bridge/br_if.c | 6 +++++-
net/bridge/br_notify.c | 7 ++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 3176e2e..2cdf007 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -417,6 +417,7 @@ put_back:
int br_del_if(struct net_bridge *br, struct net_device *dev)
{
struct net_bridge_port *p;
+ bool changed_addr;
p = br_port_get_rtnl(dev);
if (!p || p->br != br)
@@ -425,9 +426,12 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)
del_nbp(p);
spin_lock_bh(&br->lock);
- br_stp_recalculate_bridge_id(br);
+ changed_addr = br_stp_recalculate_bridge_id(br);
spin_unlock_bh(&br->lock);
+ if (changed_addr)
+ call_netdevice_notifiers(NETDEV_CHANGEADDR, br->dev);
+
netdev_update_features(br->dev);
return 0;
diff --git a/net/bridge/br_notify.c b/net/bridge/br_notify.c
index 6545ee9..a76b621 100644
--- a/net/bridge/br_notify.c
+++ b/net/bridge/br_notify.c
@@ -34,6 +34,7 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
struct net_device *dev = ptr;
struct net_bridge_port *p;
struct net_bridge *br;
+ bool changed_addr;
int err;
/* register of bridge completed, add sysfs entries */
@@ -57,8 +58,12 @@ static int br_device_event(struct notifier_block *unused, unsigned long event, v
case NETDEV_CHANGEADDR:
spin_lock_bh(&br->lock);
br_fdb_changeaddr(p, dev->dev_addr);
- br_stp_recalculate_bridge_id(br);
+ changed_addr = br_stp_recalculate_bridge_id(br);
spin_unlock_bh(&br->lock);
+
+ if (changed_addr)
+ call_netdevice_notifiers(NETDEV_CHANGEADDR, br->dev);
+
break;
case NETDEV_CHANGE:
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] sunrpc: use better NUMA affinities
From: J. Bruce Fields @ 2011-08-05 21:28 UTC (permalink / raw)
To: Eric Dumazet
Cc: Trond Myklebust, Neil Brown, David Miller,
linux-nfs-u79uwXL29TY76Z2rM5mHXA, netdev, linux-kernel
In-Reply-To: <1311876249.2346.39.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
On Thu, Jul 28, 2011 at 08:04:09PM +0200, Eric Dumazet wrote:
> Use NUMA aware allocations to reduce latencies and increase throughput.
>
> sunrpc kthreads can use kthread_create_on_node() if pool_mode is
> "percpu" or "pernode", and svc_prepare_thread()/svc_init_buffer() can
> also take into account NUMA node affinity for memory allocations.
By the way, thanks, applying for 3.2 with one minor fixup below.--b.
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
index ce620b5..516f337 100644
--- a/fs/nfs/callback.c
+++ b/fs/nfs/callback.c
@@ -199,7 +199,7 @@ nfs41_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt)
INIT_LIST_HEAD(&serv->sv_cb_list);
spin_lock_init(&serv->sv_cb_lock);
init_waitqueue_head(&serv->sv_cb_waitq);
- rqstp = svc_prepare_thread(serv, &serv->sv_pools[0]);
+ rqstp = svc_prepare_thread(serv, &serv->sv_pools[0], NUMA_NO_NODE);
if (IS_ERR(rqstp)) {
svc_xprt_put(serv->sv_bc_xprt);
serv->sv_bc_xprt = NULL;
>
> Signed-off-by: Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> CC: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
> CC: Neil Brown <neilb-l3A5Bk7waGM@public.gmane.org>
> CC: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
> ---
> fs/lockd/svc.c | 2 +-
> fs/nfs/callback.c | 2 +-
> include/linux/sunrpc/svc.h | 2 +-
> net/sunrpc/svc.c | 33 ++++++++++++++++++++++++---------
> 4 files changed, 27 insertions(+), 12 deletions(-)
>
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index abfff9d..c061b9a 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -282,7 +282,7 @@ int lockd_up(void)
> /*
> * Create the kernel thread and wait for it to start.
> */
> - nlmsvc_rqst = svc_prepare_thread(serv, &serv->sv_pools[0]);
> + nlmsvc_rqst = svc_prepare_thread(serv, &serv->sv_pools[0], NUMA_NO_NODE);
> if (IS_ERR(nlmsvc_rqst)) {
> error = PTR_ERR(nlmsvc_rqst);
> nlmsvc_rqst = NULL;
> diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c
> index e3d2942..ce620b5 100644
> --- a/fs/nfs/callback.c
> +++ b/fs/nfs/callback.c
> @@ -125,7 +125,7 @@ nfs4_callback_up(struct svc_serv *serv)
> else
> goto out_err;
>
> - return svc_prepare_thread(serv, &serv->sv_pools[0]);
> + return svc_prepare_thread(serv, &serv->sv_pools[0], NUMA_NO_NODE);
>
> out_err:
> if (ret == 0)
> diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
> index 223588a..a78a51e 100644
> --- a/include/linux/sunrpc/svc.h
> +++ b/include/linux/sunrpc/svc.h
> @@ -404,7 +404,7 @@ struct svc_procedure {
> struct svc_serv *svc_create(struct svc_program *, unsigned int,
> void (*shutdown)(struct svc_serv *));
> struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
> - struct svc_pool *pool);
> + struct svc_pool *pool, int node);
> void svc_exit_thread(struct svc_rqst *);
> struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
> void (*shutdown)(struct svc_serv *),
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> index 6a69a11..30d70ab 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -295,6 +295,18 @@ svc_pool_map_put(void)
> }
>
>
> +static int svc_pool_map_get_node(unsigned int pidx)
> +{
> + const struct svc_pool_map *m = &svc_pool_map;
> +
> + if (m->count) {
> + if (m->mode == SVC_POOL_PERCPU)
> + return cpu_to_node(m->pool_to[pidx]);
> + if (m->mode == SVC_POOL_PERNODE)
> + return m->pool_to[pidx];
> + }
> + return NUMA_NO_NODE;
> +}
> /*
> * Set the given thread's cpus_allowed mask so that it
> * will only run on cpus in the given pool.
> @@ -499,7 +511,7 @@ EXPORT_SYMBOL_GPL(svc_destroy);
> * We allocate pages and place them in rq_argpages.
> */
> static int
> -svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
> +svc_init_buffer(struct svc_rqst *rqstp, unsigned int size, int node)
> {
> unsigned int pages, arghi;
>
> @@ -513,7 +525,7 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size)
> arghi = 0;
> BUG_ON(pages > RPCSVC_MAXPAGES);
> while (pages) {
> - struct page *p = alloc_page(GFP_KERNEL);
> + struct page *p = alloc_pages_node(node, GFP_KERNEL, 0);
> if (!p)
> break;
> rqstp->rq_pages[arghi++] = p;
> @@ -536,11 +548,11 @@ svc_release_buffer(struct svc_rqst *rqstp)
> }
>
> struct svc_rqst *
> -svc_prepare_thread(struct svc_serv *serv, struct svc_pool *pool)
> +svc_prepare_thread(struct svc_serv *serv, struct svc_pool *pool, int node)
> {
> struct svc_rqst *rqstp;
>
> - rqstp = kzalloc(sizeof(*rqstp), GFP_KERNEL);
> + rqstp = kzalloc_node(sizeof(*rqstp), GFP_KERNEL, node);
> if (!rqstp)
> goto out_enomem;
>
> @@ -554,15 +566,15 @@ svc_prepare_thread(struct svc_serv *serv, struct svc_pool *pool)
> rqstp->rq_server = serv;
> rqstp->rq_pool = pool;
>
> - rqstp->rq_argp = kmalloc(serv->sv_xdrsize, GFP_KERNEL);
> + rqstp->rq_argp = kmalloc_node(serv->sv_xdrsize, GFP_KERNEL, node);
> if (!rqstp->rq_argp)
> goto out_thread;
>
> - rqstp->rq_resp = kmalloc(serv->sv_xdrsize, GFP_KERNEL);
> + rqstp->rq_resp = kmalloc_node(serv->sv_xdrsize, GFP_KERNEL, node);
> if (!rqstp->rq_resp)
> goto out_thread;
>
> - if (!svc_init_buffer(rqstp, serv->sv_max_mesg))
> + if (!svc_init_buffer(rqstp, serv->sv_max_mesg, node))
> goto out_thread;
>
> return rqstp;
> @@ -647,6 +659,7 @@ svc_set_num_threads(struct svc_serv *serv, struct svc_pool *pool, int nrservs)
> struct svc_pool *chosen_pool;
> int error = 0;
> unsigned int state = serv->sv_nrthreads-1;
> + int node;
>
> if (pool == NULL) {
> /* The -1 assumes caller has done a svc_get() */
> @@ -662,14 +675,16 @@ svc_set_num_threads(struct svc_serv *serv, struct svc_pool *pool, int nrservs)
> nrservs--;
> chosen_pool = choose_pool(serv, pool, &state);
>
> - rqstp = svc_prepare_thread(serv, chosen_pool);
> + node = svc_pool_map_get_node(chosen_pool->sp_id);
> + rqstp = svc_prepare_thread(serv, chosen_pool, node);
> if (IS_ERR(rqstp)) {
> error = PTR_ERR(rqstp);
> break;
> }
>
> __module_get(serv->sv_module);
> - task = kthread_create(serv->sv_function, rqstp, serv->sv_name);
> + task = kthread_create_on_node(serv->sv_function, rqstp,
> + node, serv->sv_name);
> if (IS_ERR(task)) {
> error = PTR_ERR(task);
> module_put(serv->sv_module);
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" 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 related
* Re: [PATCH net-next 4/6] be2net: add ethtool::set_settings support
From: Ben Hutchings @ 2011-08-05 21:43 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: davem, netdev
In-Reply-To: <20110805200036.GA13585@akhaparde-VBox>
On Fri, 2011-08-05 at 15:00 -0500, Ajit Khaparde wrote:
> Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
> ---
> drivers/net/benet/be_ethtool.c | 63 ++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 63 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
> index f144a6f..5dd3ed6 100644
> --- a/drivers/net/benet/be_ethtool.c
> +++ b/drivers/net/benet/be_ethtool.c
> @@ -443,6 +443,68 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
> return 0;
> }
>
> +static int be_set_settings(struct net_device *netdev,
> + struct ethtool_cmd *ecmd)
> +{
> + struct be_adapter *adapter = netdev_priv(netdev);
> + struct be_phy_info phy_info;
> + u16 mac_speed = 0;
> + u16 dac_cable_len = 0;
> + u16 port_speed = 0;
> + int status;
> +
> + status = be_cmd_get_phy_info(adapter, &phy_info);
> + if (status) {
> + dev_err(&adapter->pdev->dev, "Get phy info cmd failed.\n");
> + return status;
> + }
> +
> + if (ecmd->autoneg == AUTONEG_ENABLE) {
> + switch (phy_info.interface_type) {
> + case PHY_TYPE_SFP_1GB:
> + case PHY_TYPE_BASET_1GB:
> + case PHY_TYPE_BASEX_1GB:
> + case PHY_TYPE_SGMII:
> + mac_speed = SPEED_AUTONEG_1GB_100MB_10MB;
> + break;
> + case PHY_TYPE_SFP_PLUS_10GB:
> + dev_warn(&adapter->pdev->dev,
> + "Autoneg not supported on this module.\n");
> + return -EINVAL;
> + case PHY_TYPE_KR_10GB:
> + case PHY_TYPE_KX4_10GB:
> + mac_speed = SPEED_AUTONEG_10GB_1GB;
> + break;
> + case PHY_TYPE_BASET_10GB:
> + mac_speed = SPEED_AUTONEG_10GB_1GB_100MB;
> + break;
> + }
[....]
This is wrong. When autoneg is enabled, you have to look at the
'advertised' field to find out which link modes you are supposed to
enable.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next 6/6] be2net: fix to set ecmd->autoneg correctly
From: Ben Hutchings @ 2011-08-05 21:51 UTC (permalink / raw)
To: Ajit Khaparde; +Cc: davem, netdev
In-Reply-To: <20110805200107.GA13631@akhaparde-VBox>
On Fri, 2011-08-05 at 15:01 -0500, Ajit Khaparde wrote:
> Set the autonegotation settings correctly based on the port speed.
[...]
Autonegotiation and multi-speed are two entirely different things.
Selecting a single speed doesn't mean turning autoneg off. If you
enable only 1000BASE-T or only 10GBASE-T, the PHY must still go through
autoneg to determine whether it is the clock master for the link.
Enabling multiple speeds doesn't mean turning autoneg on. An SFP+ slot
can take 1G and 10G modules but the modules generally won't support
autoneg.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* include/linux/netlink.h: problem when included by an application
From: Michel Machado @ 2011-08-05 21:45 UTC (permalink / raw)
To: netdev
Hi there,
When an application includes header <linux/netlink.h> obtained with
'make headers_install' or from /usr/include/, it produces the following
error:
/usr/include/linux/netlink.h:31:2: error: expected
specifier-qualifier-list before ‘sa_family_t’
The error doesn't come up in the kernel because
include/linux/netlink.h has the following line:
#include <linux/socket.h> /* for sa_family_t */
However, <linux/socket.h> from /usr/include/ doesn't have sa_family_t
because it's protected by an $ifdef __KERNEL__ in
include/linux/socket.h.
A workaround for an application is to include <sys/socket.h> before
<linux/netlink.h>. However, shouldn't include/linux/netlink.h be fixed?
The simplest solution that I came up was replacing sa_family_t in
include/linux/netlink.h to 'unsigned short' as header
include/linux/socket.h does for struct __kernel_sockaddr_storage
available to applications.
--
[ ]'s
Michel Machado
^ permalink raw reply
* [RFC 0/4] [flexcan] Add support for powerpc (freescale p1010) -V5
From: Robin Holt @ 2011-08-06 4:05 UTC (permalink / raw)
To: Robin Holt, Marc Kleine-Budde, Wolfgang Grandegger,
U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA
Marc, Wolfgang or U Bhaskar,
This patch set should have all your comments included.
I did implement a very simple clock source in the p1010rdb.c file, which,
unfortunately, your tree will not have so please do not apply the last
patch in the series. That will need to go to the powerpc folks and
follow the p1010rdb patch from freescale.
Could you please apply the first three patches to a test branch, compile
and test them on an arm based system? I would like to at least feel
comfortable that I have not broken anything there.
I have tested the full set on a p1010rdb with an external PSOC based
can communicator. That PSOC code has a bunch of erroneous can comms it
can generate, but I do not know how the developer of that code injects
those errors. As a result, no error handling from the can input has been
tested. I have tested both flexcan interfaces on the board and both work
with these patches in addition to the other p1010rdb patches not included.
Thanks,
Robin Holt
^ permalink raw reply
* [RFC 1/4] [flexcan] Abstract off read/write for big/little endian.
From: Robin Holt @ 2011-08-06 4:05 UTC (permalink / raw)
To: Robin Holt, Marc Kleine-Budde, Wolfgang Grandegger,
U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA, Marc Kleine-Budde
In-Reply-To: <1312603504-30282-1-git-send-email-holt-sJ/iWh9BUns@public.gmane.org>
First step in converting the flexcan driver from supporting just arm to
supporting both arm and powerpc architectures.
Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
Acked-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
drivers/net/can/flexcan.c | 140 ++++++++++++++++++++++++++------------------
1 files changed, 83 insertions(+), 57 deletions(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 67d9fc0..74b1706 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -196,6 +196,31 @@ static struct can_bittiming_const flexcan_bittiming_const = {
};
/*
+ * Abstract off the read/write for arm versus ppc.
+ */
+#if defined(__BIG_ENDIAN)
+static inline u32 flexcan_read(void __iomem *addr)
+{
+ return in_be32(addr);
+}
+
+static inline void flexcan_write(u32 val, void __iomem *addr)
+{
+ out_be32(addr, val);
+}
+#else
+static inline u32 flexcan_read(void __iomem *addr)
+{
+ return readl(addr);
+}
+
+static inline void flexcan_write(u32 val, void __iomem *addr)
+{
+ writel(val, addr);
+}
+#endif
+
+/*
* Swtich transceiver on or off
*/
static void flexcan_transceiver_switch(const struct flexcan_priv *priv, int on)
@@ -216,9 +241,9 @@ static inline void flexcan_chip_enable(struct flexcan_priv *priv)
struct flexcan_regs __iomem *regs = priv->base;
u32 reg;
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
reg &= ~FLEXCAN_MCR_MDIS;
- writel(reg, ®s->mcr);
+ flexcan_write(reg, ®s->mcr);
udelay(10);
}
@@ -228,9 +253,9 @@ static inline void flexcan_chip_disable(struct flexcan_priv *priv)
struct flexcan_regs __iomem *regs = priv->base;
u32 reg;
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
reg |= FLEXCAN_MCR_MDIS;
- writel(reg, ®s->mcr);
+ flexcan_write(reg, ®s->mcr);
}
static int flexcan_get_berr_counter(const struct net_device *dev,
@@ -238,7 +263,7 @@ static int flexcan_get_berr_counter(const struct net_device *dev,
{
const struct flexcan_priv *priv = netdev_priv(dev);
struct flexcan_regs __iomem *regs = priv->base;
- u32 reg = readl(®s->ecr);
+ u32 reg = flexcan_read(®s->ecr);
bec->txerr = (reg >> 0) & 0xff;
bec->rxerr = (reg >> 8) & 0xff;
@@ -272,15 +297,15 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (cf->can_dlc > 0) {
u32 data = be32_to_cpup((__be32 *)&cf->data[0]);
- writel(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[0]);
+ flexcan_write(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[0]);
}
if (cf->can_dlc > 3) {
u32 data = be32_to_cpup((__be32 *)&cf->data[4]);
- writel(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[1]);
+ flexcan_write(data, ®s->cantxfg[FLEXCAN_TX_BUF_ID].data[1]);
}
- writel(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
- writel(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
+ flexcan_write(can_id, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
+ flexcan_write(ctrl, ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
kfree_skb(skb);
@@ -468,8 +493,8 @@ static void flexcan_read_fifo(const struct net_device *dev,
struct flexcan_mb __iomem *mb = ®s->cantxfg[0];
u32 reg_ctrl, reg_id;
- reg_ctrl = readl(&mb->can_ctrl);
- reg_id = readl(&mb->can_id);
+ reg_ctrl = flexcan_read(&mb->can_ctrl);
+ reg_id = flexcan_read(&mb->can_id);
if (reg_ctrl & FLEXCAN_MB_CNT_IDE)
cf->can_id = ((reg_id >> 0) & CAN_EFF_MASK) | CAN_EFF_FLAG;
else
@@ -479,12 +504,12 @@ static void flexcan_read_fifo(const struct net_device *dev,
cf->can_id |= CAN_RTR_FLAG;
cf->can_dlc = get_can_dlc((reg_ctrl >> 16) & 0xf);
- *(__be32 *)(cf->data + 0) = cpu_to_be32(readl(&mb->data[0]));
- *(__be32 *)(cf->data + 4) = cpu_to_be32(readl(&mb->data[1]));
+ *(__be32 *)(cf->data + 0) = cpu_to_be32(flexcan_read(&mb->data[0]));
+ *(__be32 *)(cf->data + 4) = cpu_to_be32(flexcan_read(&mb->data[1]));
/* mark as read */
- writel(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1);
- readl(®s->timer);
+ flexcan_write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1);
+ flexcan_read(®s->timer);
}
static int flexcan_read_frame(struct net_device *dev)
@@ -520,17 +545,17 @@ static int flexcan_poll(struct napi_struct *napi, int quota)
* The error bits are cleared on read,
* use saved value from irq handler.
*/
- reg_esr = readl(®s->esr) | priv->reg_esr;
+ reg_esr = flexcan_read(®s->esr) | priv->reg_esr;
/* handle state changes */
work_done += flexcan_poll_state(dev, reg_esr);
/* handle RX-FIFO */
- reg_iflag1 = readl(®s->iflag1);
+ reg_iflag1 = flexcan_read(®s->iflag1);
while (reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_AVAILABLE &&
work_done < quota) {
work_done += flexcan_read_frame(dev);
- reg_iflag1 = readl(®s->iflag1);
+ reg_iflag1 = flexcan_read(®s->iflag1);
}
/* report bus errors */
@@ -540,8 +565,8 @@ static int flexcan_poll(struct napi_struct *napi, int quota)
if (work_done < quota) {
napi_complete(napi);
/* enable IRQs */
- writel(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
- writel(priv->reg_ctrl_default, ®s->ctrl);
+ flexcan_write(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
+ flexcan_write(priv->reg_ctrl_default, ®s->ctrl);
}
return work_done;
@@ -555,9 +580,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
struct flexcan_regs __iomem *regs = priv->base;
u32 reg_iflag1, reg_esr;
- reg_iflag1 = readl(®s->iflag1);
- reg_esr = readl(®s->esr);
- writel(FLEXCAN_ESR_ERR_INT, ®s->esr); /* ACK err IRQ */
+ reg_iflag1 = flexcan_read(®s->iflag1);
+ reg_esr = flexcan_read(®s->esr);
+ flexcan_write(FLEXCAN_ESR_ERR_INT, ®s->esr); /* ACK err IRQ */
/*
* schedule NAPI in case of:
@@ -573,16 +598,16 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
* save them for later use.
*/
priv->reg_esr = reg_esr & FLEXCAN_ESR_ERR_BUS;
- writel(FLEXCAN_IFLAG_DEFAULT & ~FLEXCAN_IFLAG_RX_FIFO_AVAILABLE,
- ®s->imask1);
- writel(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL,
+ flexcan_write(FLEXCAN_IFLAG_DEFAULT &
+ ~FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->imask1);
+ flexcan_write(priv->reg_ctrl_default & ~FLEXCAN_CTRL_ERR_ALL,
®s->ctrl);
napi_schedule(&priv->napi);
}
/* FIFO overflow */
if (reg_iflag1 & FLEXCAN_IFLAG_RX_FIFO_OVERFLOW) {
- writel(FLEXCAN_IFLAG_RX_FIFO_OVERFLOW, ®s->iflag1);
+ flexcan_write(FLEXCAN_IFLAG_RX_FIFO_OVERFLOW, ®s->iflag1);
dev->stats.rx_over_errors++;
dev->stats.rx_errors++;
}
@@ -591,7 +616,7 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
if (reg_iflag1 & (1 << FLEXCAN_TX_BUF_ID)) {
/* tx_bytes is incremented in flexcan_start_xmit */
stats->tx_packets++;
- writel((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1);
+ flexcan_write((1 << FLEXCAN_TX_BUF_ID), ®s->iflag1);
netif_wake_queue(dev);
}
@@ -605,7 +630,7 @@ static void flexcan_set_bittiming(struct net_device *dev)
struct flexcan_regs __iomem *regs = priv->base;
u32 reg;
- reg = readl(®s->ctrl);
+ reg = flexcan_read(®s->ctrl);
reg &= ~(FLEXCAN_CTRL_PRESDIV(0xff) |
FLEXCAN_CTRL_RJW(0x3) |
FLEXCAN_CTRL_PSEG1(0x7) |
@@ -629,11 +654,11 @@ static void flexcan_set_bittiming(struct net_device *dev)
reg |= FLEXCAN_CTRL_SMP;
dev_info(dev->dev.parent, "writing ctrl=0x%08x\n", reg);
- writel(reg, ®s->ctrl);
+ flexcan_write(reg, ®s->ctrl);
/* print chip status */
dev_dbg(dev->dev.parent, "%s: mcr=0x%08x ctrl=0x%08x\n", __func__,
- readl(®s->mcr), readl(®s->ctrl));
+ flexcan_read(®s->mcr), flexcan_read(®s->ctrl));
}
/*
@@ -654,10 +679,10 @@ static int flexcan_chip_start(struct net_device *dev)
flexcan_chip_enable(priv);
/* soft reset */
- writel(FLEXCAN_MCR_SOFTRST, ®s->mcr);
+ flexcan_write(FLEXCAN_MCR_SOFTRST, ®s->mcr);
udelay(10);
- reg_mcr = readl(®s->mcr);
+ reg_mcr = flexcan_read(®s->mcr);
if (reg_mcr & FLEXCAN_MCR_SOFTRST) {
dev_err(dev->dev.parent,
"Failed to softreset can module (mcr=0x%08x)\n",
@@ -679,12 +704,12 @@ static int flexcan_chip_start(struct net_device *dev)
* choose format C
*
*/
- reg_mcr = readl(®s->mcr);
+ reg_mcr = flexcan_read(®s->mcr);
reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT |
FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN |
FLEXCAN_MCR_IDAM_C;
dev_dbg(dev->dev.parent, "%s: writing mcr=0x%08x", __func__, reg_mcr);
- writel(reg_mcr, ®s->mcr);
+ flexcan_write(reg_mcr, ®s->mcr);
/*
* CTRL
@@ -702,7 +727,7 @@ static int flexcan_chip_start(struct net_device *dev)
* (FLEXCAN_CTRL_ERR_MSK), too. Otherwise we don't get any
* warning or bus passive interrupts.
*/
- reg_ctrl = readl(®s->ctrl);
+ reg_ctrl = flexcan_read(®s->ctrl);
reg_ctrl &= ~FLEXCAN_CTRL_TSYN;
reg_ctrl |= FLEXCAN_CTRL_BOFF_REC | FLEXCAN_CTRL_LBUF |
FLEXCAN_CTRL_ERR_STATE | FLEXCAN_CTRL_ERR_MSK;
@@ -710,38 +735,39 @@ static int flexcan_chip_start(struct net_device *dev)
/* save for later use */
priv->reg_ctrl_default = reg_ctrl;
dev_dbg(dev->dev.parent, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
- writel(reg_ctrl, ®s->ctrl);
+ flexcan_write(reg_ctrl, ®s->ctrl);
for (i = 0; i < ARRAY_SIZE(regs->cantxfg); i++) {
- writel(0, ®s->cantxfg[i].can_ctrl);
- writel(0, ®s->cantxfg[i].can_id);
- writel(0, ®s->cantxfg[i].data[0]);
- writel(0, ®s->cantxfg[i].data[1]);
+ flexcan_write(0, ®s->cantxfg[i].can_ctrl);
+ flexcan_write(0, ®s->cantxfg[i].can_id);
+ flexcan_write(0, ®s->cantxfg[i].data[0]);
+ flexcan_write(0, ®s->cantxfg[i].data[1]);
/* put MB into rx queue */
- writel(FLEXCAN_MB_CNT_CODE(0x4), ®s->cantxfg[i].can_ctrl);
+ flexcan_write(FLEXCAN_MB_CNT_CODE(0x4),
+ ®s->cantxfg[i].can_ctrl);
}
/* acceptance mask/acceptance code (accept everything) */
- writel(0x0, ®s->rxgmask);
- writel(0x0, ®s->rx14mask);
- writel(0x0, ®s->rx15mask);
+ flexcan_write(0x0, ®s->rxgmask);
+ flexcan_write(0x0, ®s->rx14mask);
+ flexcan_write(0x0, ®s->rx15mask);
flexcan_transceiver_switch(priv, 1);
/* synchronize with the can bus */
- reg_mcr = readl(®s->mcr);
+ reg_mcr = flexcan_read(®s->mcr);
reg_mcr &= ~FLEXCAN_MCR_HALT;
- writel(reg_mcr, ®s->mcr);
+ flexcan_write(reg_mcr, ®s->mcr);
priv->can.state = CAN_STATE_ERROR_ACTIVE;
/* enable FIFO interrupts */
- writel(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
+ flexcan_write(FLEXCAN_IFLAG_DEFAULT, ®s->imask1);
/* print chip status */
dev_dbg(dev->dev.parent, "%s: reading mcr=0x%08x ctrl=0x%08x\n",
- __func__, readl(®s->mcr), readl(®s->ctrl));
+ __func__, flexcan_read(®s->mcr), flexcan_read(®s->ctrl));
return 0;
@@ -763,12 +789,12 @@ static void flexcan_chip_stop(struct net_device *dev)
u32 reg;
/* Disable all interrupts */
- writel(0, ®s->imask1);
+ flexcan_write(0, ®s->imask1);
/* Disable + halt module */
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
reg |= FLEXCAN_MCR_MDIS | FLEXCAN_MCR_HALT;
- writel(reg, ®s->mcr);
+ flexcan_write(reg, ®s->mcr);
flexcan_transceiver_switch(priv, 0);
priv->can.state = CAN_STATE_STOPPED;
@@ -860,24 +886,24 @@ static int __devinit register_flexcandev(struct net_device *dev)
/* select "bus clock", chip must be disabled */
flexcan_chip_disable(priv);
- reg = readl(®s->ctrl);
+ reg = flexcan_read(®s->ctrl);
reg |= FLEXCAN_CTRL_CLK_SRC;
- writel(reg, ®s->ctrl);
+ flexcan_write(reg, ®s->ctrl);
flexcan_chip_enable(priv);
/* set freeze, halt and activate FIFO, restrict register access */
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT |
FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV;
- writel(reg, ®s->mcr);
+ flexcan_write(reg, ®s->mcr);
/*
* Currently we only support newer versions of this core
* featuring a RX FIFO. Older cores found on some Coldfire
* derivates are not yet supported.
*/
- reg = readl(®s->mcr);
+ reg = flexcan_read(®s->mcr);
if (!(reg & FLEXCAN_MCR_FEN)) {
dev_err(dev->dev.parent,
"Could not enable RX FIFO, unsupported core\n");
--
1.7.2.1
^ permalink raw reply related
* [RFC 2/4] [flexcan] Add of_match to platform_device definition.
From: Robin Holt @ 2011-08-06 4:05 UTC (permalink / raw)
To: Robin Holt, Marc Kleine-Budde, Wolfgang Grandegger,
U Bhaskar-B22300
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1312603504-30282-1-git-send-email-holt-sJ/iWh9BUns@public.gmane.org>
The OpenFirmware devices are not matched without specifying
an of_match array. Introduce that array as that is used for
matching on the Freescale P1010 processor.
Signed-off-by: Robin Holt <holt-sJ/iWh9BUns@public.gmane.org>
To: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
To: U Bhaskar-B22300 <B22300-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
drivers/net/can/flexcan.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 74b1706..c20d673 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1033,8 +1033,22 @@ static int __devexit flexcan_remove(struct platform_device *pdev)
return 0;
}
+static struct of_device_id flexcan_of_match[] = {
+ {
+ .compatible = "fsl,flexcan-v1.0",
+ },
+ {
+ .compatible = "fsl,flexcan",
+ },
+ {},
+};
+
static struct platform_driver flexcan_driver = {
- .driver.name = DRV_NAME,
+ .driver = {
+ .name = DRV_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = flexcan_of_match,
+ },
.probe = flexcan_probe,
.remove = __devexit_p(flexcan_remove),
};
--
1.7.2.1
^ 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