* Re: [PATCH net-next v3 0/4] bridge: support for vlan range in setlink/dellink
From: David Miller @ 2015-01-12 21:47 UTC (permalink / raw)
To: roopa; +Cc: netdev, shemminger, vyasevic, wkok, sfeldma
In-Reply-To: <1420903874-25528-1-git-send-email-roopa@cumulusnetworks.com>
From: roopa@cumulusnetworks.com
Date: Sat, 10 Jan 2015 07:31:11 -0800
> From: Roopa Prabhu <roopa@cumulusnetworks.com>
>
> This series adds new flags in IFLA_BRIDGE_VLAN_INFO to indicate
> vlan range.
>
> Will post corresponding iproute2 patches if these get accepted.
>
> v1-> v2
> - changed patches to use a nested list attribute
> IFLA_BRIDGE_VLAN_INFO_LIST as suggested by scott feldman
> - dropped notification changes from the series. Will post them
> separately after this range message is accepted.
>
> v2 -> v3
> - incorporated some review feedback
> - include patches to fill vlan ranges during getlink
> - Dropped IFLA_BRIDGE_VLAN_INFO_LIST. I think it may get
> confusing to userspace if we introduce yet another way to
> send lists. With getlink already sending nested
> IFLA_BRIDGE_VLAN_INFO in IFLA_AF_SPEC, It seems better to
> use the existing format for lists and just use the flags from v2
> to mark vlan ranges
>
> Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
> Signed-off-by: Wilson Kok <wkok@cumulusnetworks.com>
This looks fine to me, series applied, thanks.
^ permalink raw reply
* Re: [PATCH net] drivers: net: xen-netfront: remove residual dead code
From: David Miller @ 2015-01-12 21:44 UTC (permalink / raw)
To: v.maffione; +Cc: netdev, xen-devel, david.vrabel, boris.ostrovsky, konrad.wilk
In-Reply-To: <1420881625-4935-1-git-send-email-v.maffione@gmail.com>
From: Vincenzo Maffione <v.maffione@gmail.com>
Date: Sat, 10 Jan 2015 10:20:25 +0100
> This patch removes some unused arrays from the netfront private
> data structures. These arrays were used in "flip" receive mode.
>
> Signed-off-by: Vincenzo Maffione <v.maffione@gmail.com>
Applied to net-next.
^ permalink raw reply
* Re: [PATCH net-next] Driver: Vmxnet3: Reinitialize vmxnet3 backend on wakeup from hibernate
From: David Miller @ 2015-01-12 21:44 UTC (permalink / raw)
To: skhare; +Cc: sbhatewara, pv-drivers, netdev, linux-kernel, smurali
In-Reply-To: <1420845554-491-1-git-send-email-skhare@vmware.com>
From: Shrikrishna Khare <skhare@vmware.com>
Date: Fri, 9 Jan 2015 15:19:14 -0800
> Failing to reinitialize on wakeup results in loss of network connectivity for
> vmxnet3 interface.
>
> Signed-off-by: Srividya Murali <smurali@vmware.com>
> Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
> Reviewed-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] bonding: cleanup bond_opts array
From: David Miller @ 2015-01-12 21:43 UTC (permalink / raw)
To: jtoppins; +Cc: netdev, shm, gospo, nikolay
In-Reply-To: <1420828268-10360-1-git-send-email-jtoppins@cumulusnetworks.com>
From: Jonathan Toppins <jtoppins@cumulusnetworks.com>
Date: Fri, 9 Jan 2015 13:31:08 -0500
> Remove the empty array element initializer and size the array with
> BOND_OPT_LAST so the compiler will complain if more elements are in
> there than should be.
>
> An interesting unwanted side effect of this initializer is that if one
> inserts new options into the middle of the array then this initializer
> will zero out the option that equals BOND_OPT_TLB_DYNAMIC_LB+1.
>
> Example:
> Extend the OPTS enum:
> enum {
> ...
> BOND_OPT_TLB_DYNAMIC_LB,
> BOND_OPT_LACP_NEW1,
> BOND_OPT_LAST
> };
>
> Now insert into bond_opts array:
> static const struct bond_option bond_opts[] = {
> ...
> [BOND_OPT_LACP_RATE] = { .... unchanged stuff .... },
> [BOND_OPT_LACP_NEW1] = { ... new stuff ... },
> ...
> [BOND_OPT_TLB_DYNAMIC_LB] = { .... unchanged stuff ....},
> { } // MARK A
> };
>
> Since BOND_OPT_LACP_NEW1 = BOND_OPT_TLB_DYNAMIC_LB+1, the last
> initializer (MARK A) will overwrite the contents of BOND_OPT_LACP_NEW1
> and can be easily viewed with the crash utility.
>
> Signed-off-by: Jonathan Toppins <jtoppins@cumulusnetworks.com>
Applied.
^ permalink raw reply
* Re: [PATCH] usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()
From: David Miller @ 2015-01-12 21:43 UTC (permalink / raw)
To: khoroshilov; +Cc: linux-usb, netdev, linux-kernel, ldv-project
In-Reply-To: <1420845382-25815-1-git-send-email-khoroshilov@ispras.ru>
From: Alexey Khoroshilov <khoroshilov@ispras.ru>
Date: Sat, 10 Jan 2015 02:16:22 +0300
> Commit e4c7f259c5be ("USB: kaweth.c: use GFP_ATOMIC under spin_lock")
> makes sure that kaweth_internal_control_msg() allocates memory with GFP_ATOMIC,
> but kaweth_internal_control_msg() also calls usb_start_wait_urb()
> that still allocates memory with GFP_NOIO.
>
> The patch fixes usb_start_wait_urb() as well.
>
> Found by Linux Driver Verification project (linuxtesting.org).
>
> Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: add me as ibmveth maintainer
From: David Miller @ 2015-01-12 21:42 UTC (permalink / raw)
To: tlfalcon; +Cc: netdev, santi_leon, brking, nfont
In-Reply-To: <1420835380-2824-1-git-send-email-tlfalcon@linux.vnet.ibm.com>
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Fri, 9 Jan 2015 14:29:40 -0600
> Adding myself as the ibmveth maintainer and replacing
> Santiago Leon.
>
> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Applied.
^ permalink raw reply
* Re: [PATCH 4/6] openvswitch: Rename GENEVE_TUN_OPTS() to TUN_METADATA_OPTS()
From: Jesse Gross @ 2015-01-12 21:38 UTC (permalink / raw)
To: Thomas Graf
Cc: David Miller, Stephen Hemminger, Pravin Shelar, Tom Herbert,
Alexei Starovoitov, dev@openvswitch.org, netdev
In-Reply-To: <c55f879e5dedb8ec3d6d06ce7d9d095e787e1c77.1421064100.git.tgraf@suug.ch>
On Mon, Jan 12, 2015 at 4:26 AM, Thomas Graf <tgraf@suug.ch> wrote:
> diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
> index d1eecf7..8980d32 100644
> --- a/net/openvswitch/flow_netlink.c
> +++ b/net/openvswitch/flow_netlink.c
> +static int validate_and_copy_geneve_opts(struct sw_flow_key *key)
> +{
This function doesn't actually do any copying, so maybe there is a
more descriptive name for it?
^ permalink raw reply
* Re: [RFC net-next 0/3] devconf: New infrastructure for setting pre-load parameters for a module
From: Rob Herring @ 2015-01-12 21:02 UTC (permalink / raw)
To: netdev
In-Reply-To: <CAPcc5PgyBh3Hn4_7kiche2VLFJRXGPUaBw1ycZgvXiR0TSToxw@mail.gmail.com>
Amir Vadai <amirv <at> mellanox.com> writes:
> On Thu, Jan 8, 2015 at 9:25 PM, Greg KH <gregkh <at> linuxfoundation.org>
wrote:
> > On Thu, Jan 08, 2015 at 09:14:32PM +0200, Amir Vadai wrote:
> >> On Thu, Jan 8, 2015 at 7:47 PM, Greg KH <gregkh <at>
linuxfoundation.org> wrote:
> >> > On Thu, Jan 08, 2015 at 07:11:04PM +0200, Amir Vadai wrote:
> >> >> On 1/8/2015 6:46 PM, Greg KH wrote:
> >> >> > On Thu, Jan 08, 2015 at 05:16:57PM +0200, Hadar Hen Zion wrote:
> >> >> >> Hi,
> >> >> >>
> >> >> >> When configuring a device at an early boot stage, most kernel
drivers
> >> >> >> use module parameters (the parameters' settings can be determined
in
> >> >> >> modprobe.d config files).
> >> >> >
> >> >> > Which is a bad idea, as you have learned :)
>
> [...]
>
> >
> > But you are talking about loading config info before the driver is
> > loaded, which goes backwards for how we automatically load modules when
> > the hardware is found.
>
> I guess you're a busy man and getting tired of my nudges. And it is ok
> with us to make it a non-generic solution - so I won't bother you much
> more...
> I would like to understand the arguments here: Maybe there is a
> history that I missed - What are the arguments against having a config
> info before the driver is loaded? Assuming, that it will make the
> driver loading process simpler and faster.
DeviceTree does exactly this. Even discoverable buses sometimes need
additional information. DT can be used to add additional properties to PCI
devices for example. I'm not sure DT is a fit here. As a matter of policy to
be OS independent, the configuration data should be tied to the hardware and
not purely software configuration. The example of netdev vs. infiniband would
fit, but I don't know about other cases. Traditionally, DT would be part of
the firmware/bootloader rather than coupled to the kernel or distro. It is
not clear to me in your case who does the configuration and when does it
change. There is new support making its way into the kernel called DT
overlays which allows loading additional DT data after or during boot. That
may be a good fit for your use case.
Rob
^ permalink raw reply
* Re: [PATCH net-next 2/3] netlink: eliminate nl_sk_hash_lock
From: David Miller @ 2015-01-12 21:27 UTC (permalink / raw)
To: tgraf; +Cc: ying.xue, netdev
In-Reply-To: <20150109105516.GA1600@casper.infradead.org>
From: Thomas Graf <tgraf@suug.ch>
Date: Fri, 9 Jan 2015 10:55:16 +0000
> Since this code can now run in parallel, there is a race between
> checking portid and then setting it. CPU#1 could overwrite portid after
> CPU#0 has already checked portid, this would then insert the socket on
> CPU#0 with the portid created on CPU#1. So this would need some kind
> of atomic operation.
Thomas, please review Ying's new version of this patch.
Thanks.
^ permalink raw reply
* Re: [PATCH net-next 00/16] tipc: make tipc support namespace
From: David Miller @ 2015-01-12 21:24 UTC (permalink / raw)
To: ying.xue
Cc: jon.maloy, Tero.Aho, Paul.Gortmaker, erik.hugne, richard.alpe,
netdev, tipc-discussion
In-Reply-To: <1420788433-17960-1-git-send-email-ying.xue@windriver.com>
From: Ying Xue <ying.xue@windriver.com>
Date: Fri, 9 Jan 2015 15:26:57 +0800
> This patchset aims to add net namespace support for TIPC stack.
>
> Currently TIPC module declares the following global resources:
> - TIPC network idenfication number
> - TIPC node table
> - TIPC bearer list table
> - TIPC broadcast link
> - TIPC socket reference table
> - TIPC name service table
> - TIPC node address
> - TIPC service subscriber server
> - TIPC random value
> - TIPC netlink
>
> In order that TIPC is aware of namespace, above each resource must be
> allocated, initialized and destroyed inside per namespace. Therefore,
> the major works of this patchset are to isolate these global resources
> and make them private for each namespace. However, before these changes
> come true, some necessary preparation works must be first done: convert
> socket reference table with generic rhashtable, cleanup core.c and
> core.h files, remove unnecessary wrapper functions for kernel timer
> interfaces and so on.
>
> It should be noted that commit ##1 ("tipc: fix bug in broadcast
> retransmit code") was already submitted to 'net' tree, so please see
> below link:
>
> http://patchwork.ozlabs.org/patch/426717/
>
> Since it is prerequisite for the rest of the series to apply, I
> prepend them to the series.
Series applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next 0/2] All Chelsio drivers : Cleanup CPL messages macros
From: David Miller @ 2015-01-12 21:20 UTC (permalink / raw)
To: anish-ut6Up61K2wZBDgjK7y7TUQ
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
linux-scsi-u79uwXL29TY76Z2rM5mHXA, roland-BHEL68pLQRGGvPXPguhicg,
hch-wEGCiKHe2LqWVfeAwA7xHQ, jbottomley-bzQdu9zFT3WakBO8gow8eQ,
hariprasad-ut6Up61K2wZBDgjK7y7TUQ,
swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
kxie-ut6Up61K2wZBDgjK7y7TUQ, leedom-ut6Up61K2wZBDgjK7y7TUQ
In-Reply-To: <1420781896-25337-1-git-send-email-anish-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
From: Anish Bhatt <anish-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Date: Thu, 8 Jan 2015 21:38:14 -0800
> This patch series cleans up all register defines/MACROS defined in t4_msg.h and
> affected files as part of the continuing cleanup effort
>
> The patches series is created against 'net-next' tree and includes patches
> to the cxgb4, cxgb4vf, iw_cxgb4, cxgb4i and csiostor drivers.
>
> We have included all the maintainers of respective drivers. Kindly review the
> change and let us know in case of any review comments.
Looks fine, applied to net-next, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v2 net-next] bridge: Add ability to enable TSO
From: David Miller @ 2015-01-12 21:18 UTC (permalink / raw)
To: makita.toshiaki; +Cc: netdev, bridge
In-Reply-To: <1420780600-11313-1-git-send-email-makita.toshiaki@lab.ntt.co.jp>
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Fri, 9 Jan 2015 14:16:40 +0900
> Currently a bridge device turns off TSO feature if no bridge ports
> support it. We can always enable it, since packets can be segmented on
> ports by software as well as on the bridge device.
> This will reduce the number of packets processed in the bridge.
>
> Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> ---
> v2: Use an existing helper function.
Applied, thank you.
^ permalink raw reply
* Re: [PATCH net-next v2 0/2 RESEND] r8152: adjust r8152_submit_rx
From: David Miller @ 2015-01-12 21:11 UTC (permalink / raw)
To: hayeswang; +Cc: netdev, nic_swsd, linux-kernel, linux-usb
In-Reply-To: <1394712342-15778-114-Taiwan-albertk@realtek.com>
From: Hayes Wang <hayeswang@realtek.com>
Date: Fri, 9 Jan 2015 10:26:34 +0800
> v2:
> Replace the patch #1 with "call rtl_start_rx after netif_carrier_on".
>
> For patch #2, replace checking tp->speed with netif_carrier_ok.
>
> v1:
> Avoid r8152_submit_rx() from submitting rx during unexpected
> moment. This could reduce the time of stopping rx.
>
> For patch #1, the tp->speed should be updated early. Then,
> the patch #2 could use it to check the current linking status.
Series applied, thanks.
^ permalink raw reply
* Re: [PATCHn net-next] vxlan: Improve support for header flags
From: David Miller @ 2015-01-12 21:06 UTC (permalink / raw)
To: therbert; +Cc: tgraf, netdev
In-Reply-To: <1420749078-18913-1-git-send-email-therbert@google.com>
From: Tom Herbert <therbert@google.com>
Date: Thu, 8 Jan 2015 12:31:18 -0800
> This patch cleans up the header flags of VXLAN in anticipation of
> defining some new ones:
>
> - Move header related definitions from vxlan.c to vxlan.h
> - Change VXLAN_FLAGS to be VXLAN_HF_VNI (only currently defined flag)
> - Move check for unknown flags to after we find vxlan_sock, this
> assumes that some flags may be processed based on tunnel
> configuration
> - Add a comment about why the stack treating unknown set flags as an
> error instead of ignoring them
>
> Signed-off-by: Tom Herbert <therbert@google.com>
Applied, thanks Tom.
^ permalink raw reply
* Re: [PATCH net 1/1] tipc: fix bug in broadcast retransmit code
From: David Miller @ 2015-01-12 21:02 UTC (permalink / raw)
To: jon.maloy
Cc: netdev, paul.gortmaker, erik.hugne, ying.xue, maloy,
tipc-discussion
In-Reply-To: <1420738047-16466-1-git-send-email-jon.maloy@ericsson.com>
From: Jon Maloy <jon.maloy@ericsson.com>
Date: Thu, 8 Jan 2015 12:27:27 -0500
> In commit 58dc55f25631178ee74cd27185956a8f7dcb3e32 ("tipc: use generic
> SKB list APIs to manage link transmission queue") we replace all list
> traversal loops with the macros skb_queue_walk() or
> skb_queue_walk_safe(). While the previous loops were based on the
> assumption that the list was NULL-terminated, the standard macros
> stop when the iterator reaches the list head, which is non-NULL.
>
> In the function bclink_retransmit_pkt() this macro replacement has
> lead to a bug. When we receive a BCAST STATE_MSG we unconditionally
> call the function bclink_retransmit_pkt(), whether there really is
> anything to retransmit or not, assuming that the sequence number
> comparisons will lead to the correct behavior. However, if the
> transmission queue is empty, or if there are no eligible buffers in
> the transmission queue, we will by mistake pass the list head pointer
> to the function tipc_link_retransmit(). Since the list head is not a
> valid sk_buff, this leads to a crash.
>
> In this commit we fix this by only calling tipc_link_retransmit()
> if we actually found eligible buffers in the transmission queue.
>
> Reviewed-by: Ying Xue <ying.xue@windriver.com>
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Applied, thanks Jon.
^ permalink raw reply
* Re: [PATCH net-next] packet: make packet too small warning match condition
From: David Miller @ 2015-01-12 21:01 UTC (permalink / raw)
To: willemb; +Cc: netdev, jkmalinen, dborkman
In-Reply-To: <1420734558-30979-1-git-send-email-willemb@google.com>
From: Willem de Bruijn <willemb@google.com>
Date: Thu, 8 Jan 2015 11:29:18 -0500
> From: Willem de Bruijn <willemb@google.com>
>
> The expression in ll_header_truncated() tests less than or equal, but
> the warning prints less than. Update the warning.
>
> Reported-by: Jouni Malinen <jkmalinen@gmail.com>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
Yeah that could be really confusing. Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next v2] tg3: move init/deinit from open/close to probe/remove
From: David Miller @ 2015-01-12 20:59 UTC (permalink / raw)
To: ivecera; +Cc: netdev, prashant, mchan
In-Reply-To: <1420729987-18476-1-git-send-email-ivecera@redhat.com>
From: Ivan Vecera <ivecera@redhat.com>
Date: Thu, 8 Jan 2015 16:13:07 +0100
> Move init and deinit of PTP support from open/close functions
> to probe/remove funcs to avoid removing/re-adding of associated PTP
> device(s) during ifup/ifdown.
>
> v2: tg3_ptp_init call moved to correct place (thx. Prashant)
>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Applied, thank you.
^ permalink raw reply
* Re: [patch -next] net: eth: xgene: devm_ioremap() returns NULL on error
From: David Miller @ 2015-01-12 20:40 UTC (permalink / raw)
To: dan.carpenter
Cc: isubramanian, fkan, kchudgar, grant.likely, robh+dt, netdev,
kernel-janitors
In-Reply-To: <20150108105211.GB10597@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 8 Jan 2015 13:52:12 +0300
> devm_ioremap() returns NULL on failure, it doesn't return an ERR_PTR.
>
> Fixes: de7b5b3d790a ('net: eth: xgene: change APM X-Gene SoC platform ethernet to support ACPI')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH 1/1] update ip-sysctl.txt documentation (v2)
From: David Miller @ 2015-01-12 20:39 UTC (permalink / raw)
To: ani; +Cc: corbet, edumazet, linux-doc, linux-kernel, P, netdev, fruggeri
In-Reply-To: <1420674356-32210-1-git-send-email-ani@arista.com>
From: Ani Sinha <ani@arista.com>
Date: Wed, 7 Jan 2015 15:45:56 -0800
> Update documentation to reflect the fact that
> /proc/sys/net/ipv4/route/max_size is no longer used for ipv4.
>
> Signed-off-by: Ani Sinha <ani@arista.com>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH v4 2/4] can: kvaser_usb: Update error counters before exiting on OOM
From: Ahmed S. Darwish @ 2015-01-12 20:36 UTC (permalink / raw)
To: Marc Kleine-Budde
Cc: Olivier Sobrie, Oliver Hartkopp, Wolfgang Grandegger,
David S. Miller, Paul Gortmaker, Linux-CAN, netdev, LKML
In-Reply-To: <54B3AB6C.8020900@pengutronix.de>
On Mon, Jan 12, 2015 at 12:09:32PM +0100, Marc Kleine-Budde wrote:
> On 01/11/2015 09:15 PM, Ahmed S. Darwish wrote:
> > From: Ahmed S. Darwish <ahmed.darwish@valeo.com>
> >
> > Let the error counters be more accurate in case of Out of
> > Memory conditions.
>
> Please have a look at kvaser_usb_rx_error(), the whole state handling is
> omitted in case of OOM.
>
I see. Regarding kvaser_usb_rx_error(), would something like
below patch be acceptable?
Kindly note that separating recording interface state from
error frame packet building leads to duplication of a good
number of if-conditions. Meanwhile, it truly saves _all_
of the possible state before any ENOMEM -- the correct thing
to do.
Another solution was to allocate the can frame on the stack,
and thus avoiding any code duplication. But this only leads
to calls of "kvaser_usb_simple_msg_async", which can fail
with -ENOMEM by itself, returning to the very same problem
again.
If the patch is acceptable, I'll rebase my USBCAN-II driver
above it and re-submit the series (minus the merged patch).
Thanks,
-->
[ Patch is build-tested, but not _fully_ run-time tested.
It's based on linux-can/testing commit d642b49f6d84b94bd
"can: kvaser_usb: Don't dereference skb after a netif_rx" ]
Subject: [PATCH] can: kvaser_usb: Update net interface state
before exiting on OOM
From: Ahmed S. Darwish <ahmed.darwish@valeo.com>
Let the network interface can bus state and error counters be
more accurate in case of Out of Memory conditions.
Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Ahmed S. Darwish <ahmed.darwish@valeo.com>
---
drivers/net/can/usb/kvaser_usb.c | 182 +++++++++++++++++++++++----------------
1 file changed, 106 insertions(+), 76 deletions(-)
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c
index c32cd61..2d0ef76 100644
--- a/drivers/net/can/usb/kvaser_usb.c
+++ b/drivers/net/can/usb/kvaser_usb.c
@@ -273,6 +273,10 @@ struct kvaser_msg {
} u;
} __packed;
+struct kvaser_usb_error_summary {
+ u8 channel, status, txerr, rxerr, error_factor;
+};
+
struct kvaser_usb_tx_urb_context {
struct kvaser_usb_net_priv *priv;
u32 echo_index;
@@ -615,6 +619,57 @@ static void kvaser_usb_unlink_tx_urbs(struct kvaser_usb_net_priv *priv)
priv->tx_contexts[i].echo_index = MAX_TX_URBS;
}
+static void kvaser_usb_rx_error_update_state(struct kvaser_usb_net_priv *priv,
+ const struct kvaser_usb_error_summary *es)
+{
+ struct net_device_stats *stats;
+ unsigned int new_state;
+
+ stats = &priv->netdev->stats;
+ new_state = priv->can.state;
+
+ netdev_dbg(priv->netdev, "Error status: 0x%02x\n", es->status);
+
+ if (es->status & M16C_STATE_BUS_OFF) {
+ priv->can.can_stats.bus_off++;
+ new_state = CAN_STATE_BUS_OFF;
+ } else if (es->status & M16C_STATE_BUS_PASSIVE) {
+ if (priv->can.state != CAN_STATE_ERROR_PASSIVE) {
+ priv->can.can_stats.error_passive++;
+ }
+ new_state = CAN_STATE_ERROR_PASSIVE;
+ }
+
+ if (es->status == M16C_STATE_BUS_ERROR) {
+ if ((priv->can.state < CAN_STATE_ERROR_WARNING) &&
+ ((es->txerr >= 96) || (es->rxerr >= 96))) {
+ priv->can.can_stats.error_warning++;
+ new_state = CAN_STATE_ERROR_WARNING;
+ } else if (priv->can.state > CAN_STATE_ERROR_ACTIVE) {
+ new_state = CAN_STATE_ERROR_ACTIVE;
+ }
+ }
+
+ if (!es->status) {
+ new_state = CAN_STATE_ERROR_ACTIVE;
+ }
+
+ if (priv->can.restart_ms &&
+ (priv->can.state >= CAN_STATE_BUS_OFF) &&
+ (new_state < CAN_STATE_BUS_OFF)) {
+ priv->can.can_stats.restarts++;
+ }
+
+ if (es->error_factor) {
+ priv->can.can_stats.bus_error++;
+ stats->rx_errors++;
+ }
+
+ priv->bec.txerr = es->txerr;
+ priv->bec.rxerr = es->rxerr;
+ priv->can.state = new_state;
+}
+
static void kvaser_usb_rx_error(const struct kvaser_usb *dev,
const struct kvaser_msg *msg)
{
@@ -622,30 +677,30 @@ static void kvaser_usb_rx_error(const struct kvaser_usb *dev,
struct sk_buff *skb;
struct net_device_stats *stats;
struct kvaser_usb_net_priv *priv;
- unsigned int new_state;
- u8 channel, status, txerr, rxerr, error_factor;
+ struct kvaser_usb_error_summary es = { };
+ unsigned int new_state, old_state;
switch (msg->id) {
case CMD_CAN_ERROR_EVENT:
- channel = msg->u.error_event.channel;
- status = msg->u.error_event.status;
- txerr = msg->u.error_event.tx_errors_count;
- rxerr = msg->u.error_event.rx_errors_count;
- error_factor = msg->u.error_event.error_factor;
+ es.channel = msg->u.error_event.channel;
+ es.status = msg->u.error_event.status;
+ es.txerr = msg->u.error_event.tx_errors_count;
+ es.rxerr = msg->u.error_event.rx_errors_count;
+ es.error_factor = msg->u.error_event.error_factor;
break;
case CMD_LOG_MESSAGE:
- channel = msg->u.log_message.channel;
- status = msg->u.log_message.data[0];
- txerr = msg->u.log_message.data[2];
- rxerr = msg->u.log_message.data[3];
- error_factor = msg->u.log_message.data[1];
+ es.channel = msg->u.log_message.channel;
+ es.status = msg->u.log_message.data[0];
+ es.txerr = msg->u.log_message.data[2];
+ es.rxerr = msg->u.log_message.data[3];
+ es.error_factor = msg->u.log_message.data[1];
break;
case CMD_CHIP_STATE_EVENT:
- channel = msg->u.chip_state_event.channel;
- status = msg->u.chip_state_event.status;
- txerr = msg->u.chip_state_event.tx_errors_count;
- rxerr = msg->u.chip_state_event.rx_errors_count;
- error_factor = 0;
+ es.channel = msg->u.chip_state_event.channel;
+ es.status = msg->u.chip_state_event.status;
+ es.txerr = msg->u.chip_state_event.tx_errors_count;
+ es.rxerr = msg->u.chip_state_event.rx_errors_count;
+ es.error_factor = 0;
break;
default:
dev_err(dev->udev->dev.parent, "Invalid msg id (%d)\n",
@@ -653,122 +708,97 @@ static void kvaser_usb_rx_error(const struct kvaser_usb *dev,
return;
}
- if (channel >= dev->nchannels) {
+ if (es.channel >= dev->nchannels) {
dev_err(dev->udev->dev.parent,
- "Invalid channel number (%d)\n", channel);
+ "Invalid channel number (%d)\n", es.channel);
return;
}
- priv = dev->nets[channel];
+ priv = dev->nets[es.channel];
stats = &priv->netdev->stats;
- if (status & M16C_STATE_BUS_RESET) {
+ if (es.status & M16C_STATE_BUS_RESET) {
kvaser_usb_unlink_tx_urbs(priv);
return;
}
+ old_state = priv->can.state;
+ kvaser_usb_rx_error_update_state(priv, &es);
+ new_state = priv->can.state;
+
skb = alloc_can_err_skb(priv->netdev, &cf);
if (!skb) {
stats->rx_dropped++;
return;
}
- new_state = priv->can.state;
-
- netdev_dbg(priv->netdev, "Error status: 0x%02x\n", status);
-
- if (status & M16C_STATE_BUS_OFF) {
- cf->can_id |= CAN_ERR_BUSOFF;
-
- priv->can.can_stats.bus_off++;
+ if (es.status & M16C_STATE_BUS_OFF) {
if (!priv->can.restart_ms)
kvaser_usb_simple_msg_async(priv, CMD_STOP_CHIP);
-
netif_carrier_off(priv->netdev);
- new_state = CAN_STATE_BUS_OFF;
- } else if (status & M16C_STATE_BUS_PASSIVE) {
- if (priv->can.state != CAN_STATE_ERROR_PASSIVE) {
+ cf->can_id |= CAN_ERR_BUSOFF;
+ } else if (es.status & M16C_STATE_BUS_PASSIVE) {
+ if (old_state != CAN_STATE_ERROR_PASSIVE) {
cf->can_id |= CAN_ERR_CRTL;
- if (txerr || rxerr)
- cf->data[1] = (txerr > rxerr)
+ if (es.txerr || es.rxerr)
+ cf->data[1] = (es.txerr > es.rxerr)
? CAN_ERR_CRTL_TX_PASSIVE
: CAN_ERR_CRTL_RX_PASSIVE;
else
cf->data[1] = CAN_ERR_CRTL_TX_PASSIVE |
CAN_ERR_CRTL_RX_PASSIVE;
-
- priv->can.can_stats.error_passive++;
}
-
- new_state = CAN_STATE_ERROR_PASSIVE;
}
- if (status == M16C_STATE_BUS_ERROR) {
- if ((priv->can.state < CAN_STATE_ERROR_WARNING) &&
- ((txerr >= 96) || (rxerr >= 96))) {
+ if (es.status == M16C_STATE_BUS_ERROR) {
+ if ((old_state < CAN_STATE_ERROR_WARNING) &&
+ ((es.txerr >= 96) || (es.rxerr >= 96))) {
cf->can_id |= CAN_ERR_CRTL;
- cf->data[1] = (txerr > rxerr)
+ cf->data[1] = (es.txerr > es.rxerr)
? CAN_ERR_CRTL_TX_WARNING
: CAN_ERR_CRTL_RX_WARNING;
-
- priv->can.can_stats.error_warning++;
- new_state = CAN_STATE_ERROR_WARNING;
- } else if (priv->can.state > CAN_STATE_ERROR_ACTIVE) {
+ } else if (old_state > CAN_STATE_ERROR_ACTIVE) {
cf->can_id |= CAN_ERR_PROT;
cf->data[2] = CAN_ERR_PROT_ACTIVE;
-
- new_state = CAN_STATE_ERROR_ACTIVE;
}
}
- if (!status) {
+ if (!es.status) {
cf->can_id |= CAN_ERR_PROT;
cf->data[2] = CAN_ERR_PROT_ACTIVE;
-
- new_state = CAN_STATE_ERROR_ACTIVE;
}
if (priv->can.restart_ms &&
- (priv->can.state >= CAN_STATE_BUS_OFF) &&
+ (old_state >= CAN_STATE_BUS_OFF) &&
(new_state < CAN_STATE_BUS_OFF)) {
cf->can_id |= CAN_ERR_RESTARTED;
netif_carrier_on(priv->netdev);
-
- priv->can.can_stats.restarts++;
}
- if (error_factor) {
- priv->can.can_stats.bus_error++;
- stats->rx_errors++;
-
+ if (es.error_factor) {
cf->can_id |= CAN_ERR_BUSERROR | CAN_ERR_PROT;
- if (error_factor & M16C_EF_ACKE)
+ if (es.error_factor & M16C_EF_ACKE)
cf->data[3] |= (CAN_ERR_PROT_LOC_ACK);
- if (error_factor & M16C_EF_CRCE)
+ if (es.error_factor & M16C_EF_CRCE)
cf->data[3] |= (CAN_ERR_PROT_LOC_CRC_SEQ |
CAN_ERR_PROT_LOC_CRC_DEL);
- if (error_factor & M16C_EF_FORME)
+ if (es.error_factor & M16C_EF_FORME)
cf->data[2] |= CAN_ERR_PROT_FORM;
- if (error_factor & M16C_EF_STFE)
+ if (es.error_factor & M16C_EF_STFE)
cf->data[2] |= CAN_ERR_PROT_STUFF;
- if (error_factor & M16C_EF_BITE0)
+ if (es.error_factor & M16C_EF_BITE0)
cf->data[2] |= CAN_ERR_PROT_BIT0;
- if (error_factor & M16C_EF_BITE1)
+ if (es.error_factor & M16C_EF_BITE1)
cf->data[2] |= CAN_ERR_PROT_BIT1;
- if (error_factor & M16C_EF_TRE)
+ if (es.error_factor & M16C_EF_TRE)
cf->data[2] |= CAN_ERR_PROT_TX;
}
- cf->data[6] = txerr;
- cf->data[7] = rxerr;
-
- priv->bec.txerr = txerr;
- priv->bec.rxerr = rxerr;
-
- priv->can.state = new_state;
+ cf->data[6] = es.txerr;
+ cf->data[7] = es.rxerr;
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
@@ -792,6 +822,9 @@ static void kvaser_usb_rx_can_err(const struct kvaser_usb_net_priv *priv,
}
if (msg->u.rx_can.flag & MSG_FLAG_OVERRUN) {
+ stats->rx_over_errors++;
+ stats->rx_errors++;
+
skb = alloc_can_err_skb(priv->netdev, &cf);
if (!skb) {
stats->rx_dropped++;
@@ -801,9 +834,6 @@ static void kvaser_usb_rx_can_err(const struct kvaser_usb_net_priv *priv,
cf->can_id |= CAN_ERR_CRTL;
cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
- stats->rx_over_errors++;
- stats->rx_errors++;
-
stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;
netif_rx(skb);
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] net/at91_ether: prepare and unprepare clock
From: David Miller @ 2015-01-12 20:35 UTC (permalink / raw)
To: alexandre.belloni
Cc: nicolas.ferre, boris.brezillon, linux-arm-kernel, linux-kernel,
netdev
In-Reply-To: <1420671566-30784-1-git-send-email-alexandre.belloni@free-electrons.com>
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Date: Wed, 7 Jan 2015 23:59:26 +0100
> The clock is enabled without being prepared, this leads to:
>
> WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:889 __clk_enable+0x24/0xa8()
>
> and a non working ethernet interface.
>
> Use clk_prepare_enable() and clk_disable_unprepare() to handle the clock.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH RESEND] isdn: fix NUL (\0 or \x00) specification in string
From: David Miller @ 2015-01-12 20:32 UTC (permalink / raw)
To: me; +Cc: linux-kernel, dsterba, mac, isdn, netdev
In-Reply-To: <1420657812-19445-1-git-send-email-me@mortis.eu>
From: Giel van Schijndel <me@mortis.eu>
Date: Wed, 7 Jan 2015 20:10:12 +0100
> In C one can either use '\0' or '\x00' (or '\000') to add a NUL byte to
> a string. '\0x00' isn't part of these and will in fact result in a
> single NUL followed by "x00". This fixes that.
>
> Signed-off-by: Giel van Schijndel <me@mortis.eu>
> Reported-at: http://www.viva64.com/en/b/0299/
Applied, thank you.
^ permalink raw reply
* Re: [PATCH v5] can: Convert to runtime_pm
From: Marc Kleine-Budde @ 2015-01-12 19:52 UTC (permalink / raw)
To: Kedareswara rao Appana, wg, michal.simek, soren.brinkmann,
grant.likely, robh+dt
Cc: linux-can, netdev, linux-arm-kernel, linux-kernel, devicetree,
Kedareswara rao Appana
In-Reply-To: <baf987c11c0242c2bf87b81f9396b09d@BN1BFFO11FD018.protection.gbl>
[-- Attachment #1: Type: text/plain, Size: 12223 bytes --]
On 01/12/2015 04:04 PM, Kedareswara rao Appana wrote:
> Instead of enabling/disabling clocks at several locations in the driver,
> Use the runtime_pm framework. This consolidates the actions for runtime PM
> In the appropriate callbacks and makes the driver more readable and mantainable.
>
> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
> Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
FTBFS:
> drivers/net/can/xilinx_can.c:1064:9: error: undefined identifier 'SET_PM_RUNTIME_PM_OPS'
> CC [M] drivers/net/can/xilinx_can.o
> drivers/net/can/xilinx_can.c:1064:2: error: implicit declaration of function ‘SET_PM_RUNTIME_PM_OPS’ [-Werror=implicit-function-declaration]
> SET_PM_RUNTIME_PM_OPS(xcan_runtime_suspend, xcan_runtime_resume, NULL)
> ^
> drivers/net/can/xilinx_can.c:1065:1: error: initializer element is not constant
> };
> ^
> drivers/net/can/xilinx_can.c:1065:1: error: (near initialization for ‘xcan_dev_pm_ops.prepare’)
Have a look at commit 40bd62c6194bdee1bc6652b3b0aa28e34883f603:
More comments inline. Looks quite good now.
> PM: Remove the SET_PM_RUNTIME_PM_OPS() macro
>
> There're now no users left of the SET_PM_RUNTIME_PM_OPS() macro, since
> all have converted to use the SET_RUNTIME_PM_OPS() macro instead, so
> let's remove it.
> ---
> Changes for v5:
> - Updated with the review comments.
> Updated the remove fuction to use runtime_pm.
> Chnages for v4:
> - Updated with the review comments.
> Changes for v3:
> - Converted the driver to use runtime_pm.
> Changes for v2:
> - Removed the struct platform_device* from suspend/resume
> as suggest by Lothar.
>
> drivers/net/can/xilinx_can.c | 157 ++++++++++++++++++++++++++++-------------
> 1 files changed, 107 insertions(+), 50 deletions(-)
>
> diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
> index 6c67643..67aef00 100644
> --- a/drivers/net/can/xilinx_can.c
> +++ b/drivers/net/can/xilinx_can.c
> @@ -32,6 +32,7 @@
> #include <linux/can/dev.h>
> #include <linux/can/error.h>
> #include <linux/can/led.h>
> +#include <linux/pm_runtime.h>
>
> #define DRIVER_NAME "xilinx_can"
>
> @@ -138,7 +139,7 @@ struct xcan_priv {
> u32 (*read_reg)(const struct xcan_priv *priv, enum xcan_reg reg);
> void (*write_reg)(const struct xcan_priv *priv, enum xcan_reg reg,
> u32 val);
> - struct net_device *dev;
> + struct device *dev;
> void __iomem *reg_base;
> unsigned long irq_flags;
> struct clk *bus_clk;
> @@ -842,6 +843,13 @@ static int xcan_open(struct net_device *ndev)
> struct xcan_priv *priv = netdev_priv(ndev);
> int ret;
>
> + ret = pm_runtime_get_sync(priv->dev);
> + if (ret < 0) {
> + netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
> + __func__, ret);
> + return ret;
> + }
> +
> ret = request_irq(ndev->irq, xcan_interrupt, priv->irq_flags,
> ndev->name, ndev);
> if (ret < 0) {
> @@ -849,29 +857,17 @@ static int xcan_open(struct net_device *ndev)
> goto err;
> }
>
> - ret = clk_prepare_enable(priv->can_clk);
> - if (ret) {
> - netdev_err(ndev, "unable to enable device clock\n");
> - goto err_irq;
> - }
> -
> - ret = clk_prepare_enable(priv->bus_clk);
> - if (ret) {
> - netdev_err(ndev, "unable to enable bus clock\n");
> - goto err_can_clk;
> - }
> -
> /* Set chip into reset mode */
> ret = set_reset_mode(ndev);
> if (ret < 0) {
> netdev_err(ndev, "mode resetting failed!\n");
> - goto err_bus_clk;
> + goto err_irq;
> }
>
> /* Common open */
> ret = open_candev(ndev);
> if (ret)
> - goto err_bus_clk;
> + goto err_irq;
>
> ret = xcan_chip_start(ndev);
> if (ret < 0) {
> @@ -887,13 +883,11 @@ static int xcan_open(struct net_device *ndev)
>
> err_candev:
> close_candev(ndev);
> -err_bus_clk:
> - clk_disable_unprepare(priv->bus_clk);
> -err_can_clk:
> - clk_disable_unprepare(priv->can_clk);
> err_irq:
> free_irq(ndev->irq, ndev);
> err:
> + pm_runtime_put(priv->dev);
> +
> return ret;
> }
>
> @@ -910,12 +904,11 @@ static int xcan_close(struct net_device *ndev)
> netif_stop_queue(ndev);
> napi_disable(&priv->napi);
> xcan_chip_stop(ndev);
> - clk_disable_unprepare(priv->bus_clk);
> - clk_disable_unprepare(priv->can_clk);
> free_irq(ndev->irq, ndev);
> close_candev(ndev);
>
> can_led_event(ndev, CAN_LED_EVENT_STOP);
> + pm_runtime_put(priv->dev);
>
> return 0;
> }
> @@ -934,27 +927,20 @@ static int xcan_get_berr_counter(const struct net_device *ndev,
> struct xcan_priv *priv = netdev_priv(ndev);
> int ret;
>
> - ret = clk_prepare_enable(priv->can_clk);
> - if (ret)
> - goto err;
> -
> - ret = clk_prepare_enable(priv->bus_clk);
> - if (ret)
> - goto err_clk;
> + ret = pm_runtime_get_sync(priv->dev);
> + if (ret < 0) {
> + netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
> + __func__, ret);
> + return ret;
> + }
>
> bec->txerr = priv->read_reg(priv, XCAN_ECR_OFFSET) & XCAN_ECR_TEC_MASK;
> bec->rxerr = ((priv->read_reg(priv, XCAN_ECR_OFFSET) &
> XCAN_ECR_REC_MASK) >> XCAN_ESR_REC_SHIFT);
>
> - clk_disable_unprepare(priv->bus_clk);
> - clk_disable_unprepare(priv->can_clk);
> + pm_runtime_put(priv->dev);
>
> return 0;
> -
> -err_clk:
> - clk_disable_unprepare(priv->can_clk);
> -err:
> - return ret;
> }
>
>
> @@ -967,15 +953,45 @@ static const struct net_device_ops xcan_netdev_ops = {
>
> /**
> * xcan_suspend - Suspend method for the driver
> - * @dev: Address of the platform_device structure
> + * @dev: Address of the device structure
> *
> * Put the driver into low power mode.
> - * Return: 0 always
> + * Return: 0 on success and failure value on error
> */
> static int __maybe_unused xcan_suspend(struct device *dev)
> {
> - struct platform_device *pdev = dev_get_drvdata(dev);
> - struct net_device *ndev = platform_get_drvdata(pdev);
> + if (!device_may_wakeup(dev))
> + return pm_runtime_force_suspend(dev);
> +
> + return 0;
> +}
> +
> +/**
> + * xcan_resume - Resume from suspend
> + * @dev: Address of the device structure
> + *
> + * Resume operation after suspend.
> + * Return: 0 on success and failure value on error
> + */
> +static int __maybe_unused xcan_resume(struct device *dev)
> +{
> + if (!device_may_wakeup(dev))
> + return pm_runtime_force_resume(dev);
> +
> + return 0;
> +
> +}
> +
> +/**
> + * xcan_runtime_suspend - Runtime suspend method for the driver
> + * @dev: Address of the device structure
> + *
> + * Put the driver into low power mode.
> + * Return: 0 always
> + */
> +static int __maybe_unused xcan_runtime_suspend(struct device *dev)
> +{
> + struct net_device *ndev = dev_get_drvdata(dev);
> struct xcan_priv *priv = netdev_priv(ndev);
>
> if (netif_running(ndev)) {
> @@ -993,18 +1009,18 @@ static int __maybe_unused xcan_suspend(struct device *dev)
> }
>
> /**
> - * xcan_resume - Resume from suspend
> - * @dev: Address of the platformdevice structure
> + * xcan_runtime_resume - Runtime resume from suspend
> + * @dev: Address of the device structure
> *
> * Resume operation after suspend.
> * Return: 0 on success and failure value on error
> */
> -static int __maybe_unused xcan_resume(struct device *dev)
> +static int __maybe_unused xcan_runtime_resume(struct device *dev)
> {
> - struct platform_device *pdev = dev_get_drvdata(dev);
> - struct net_device *ndev = platform_get_drvdata(pdev);
> + struct net_device *ndev = dev_get_drvdata(dev);
> struct xcan_priv *priv = netdev_priv(ndev);
> int ret;
> + u32 isr, status;
>
> ret = clk_enable(priv->bus_clk);
> if (ret) {
> @@ -1014,15 +1030,28 @@ static int __maybe_unused xcan_resume(struct device *dev)
> ret = clk_enable(priv->can_clk);
> if (ret) {
> dev_err(dev, "Cannot enable clock.\n");
> - clk_disable_unprepare(priv->bus_clk);
> + clk_disable(priv->bus_clk);
> return ret;
> }
>
> priv->write_reg(priv, XCAN_MSR_OFFSET, 0);
> priv->write_reg(priv, XCAN_SRR_OFFSET, XCAN_SRR_CEN_MASK);
> - priv->can.state = CAN_STATE_ERROR_ACTIVE;
> + isr = priv->read_reg(priv, XCAN_ISR_OFFSET);
> + status = priv->read_reg(priv, XCAN_SR_OFFSET);
>
> if (netif_running(ndev)) {
> + if (isr & XCAN_IXR_BSOFF_MASK) {
> + priv->can.state = CAN_STATE_BUS_OFF;
> + priv->write_reg(priv, XCAN_SRR_OFFSET,
> + XCAN_SRR_RESET_MASK);
> + } else if ((status & XCAN_SR_ESTAT_MASK) ==
> + XCAN_SR_ESTAT_MASK) {
> + priv->can.state = CAN_STATE_ERROR_PASSIVE;
> + } else if (status & XCAN_SR_ERRWRN_MASK) {
> + priv->can.state = CAN_STATE_ERROR_WARNING;
> + } else {
> + priv->can.state = CAN_STATE_ERROR_ACTIVE;
> + }
> netif_device_attach(ndev);
> netif_start_queue(ndev);
> }
> @@ -1030,7 +1059,10 @@ static int __maybe_unused xcan_resume(struct device *dev)
> return 0;
> }
>
> -static SIMPLE_DEV_PM_OPS(xcan_dev_pm_ops, xcan_suspend, xcan_resume);
> +static const struct dev_pm_ops xcan_dev_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(xcan_suspend, xcan_resume)
> + SET_PM_RUNTIME_PM_OPS(xcan_runtime_suspend, xcan_runtime_resume, NULL)
> +};
>
> /**
> * xcan_probe - Platform registration call
> @@ -1071,7 +1103,7 @@ static int xcan_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> priv = netdev_priv(ndev);
> - priv->dev = ndev;
> + priv->dev = &pdev->dev;
> priv->can.bittiming_const = &xcan_bittiming_const;
> priv->can.do_set_mode = xcan_do_set_mode;
> priv->can.do_get_berr_counter = xcan_get_berr_counter;
> @@ -1137,6 +1169,16 @@ static int xcan_probe(struct platform_device *pdev)
>
> netif_napi_add(ndev, &priv->napi, xcan_rx_poll, rx_max);
>
> + pm_runtime_set_active(&pdev->dev);
> + pm_runtime_irq_safe(&pdev->dev);
> + pm_runtime_enable(&pdev->dev);
> + ret = pm_runtime_get_sync(&pdev->dev);
> + if (ret < 0) {
> + netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
> + __func__, ret);
> + goto err_pmdisable;
after err_pmdisable is a runtime_put(), your cleanup is broken.
> + }
> +
> ret = register_candev(ndev);
> if (ret) {
> dev_err(&pdev->dev, "fail to register failed (err=%d)\n", ret);
> goto err_unprepare_disable_busclk;
I think you have to adjust the jump label.
> }
>
> devm_can_led_init(ndev);
>
> pm_runtime_put(&pdev->dev);
> @@ -1144,15 +1186,19 @@ static int xcan_probe(struct platform_device *pdev)
> }
>
> devm_can_led_init(ndev);
> - clk_disable_unprepare(priv->bus_clk);
> - clk_disable_unprepare(priv->can_clk);
> +
> + pm_runtime_put(&pdev->dev);
> +
> netdev_dbg(ndev, "reg_base=0x%p irq=%d clock=%d, tx fifo depth:%d\n",
> priv->reg_base, ndev->irq, priv->can.clock.freq,
> priv->tx_max);
>
> return 0;
>
> +err_pmdisable:
> + pm_runtime_disable(&pdev->dev);
> err_unprepare_disable_busclk:
> + pm_runtime_put(priv->dev);
This cleanup is not correct.
> clk_disable_unprepare(priv->bus_clk);
> err_unprepare_disable_dev:
> clk_disable_unprepare(priv->can_clk);
> @@ -1173,12 +1219,23 @@ static int xcan_remove(struct platform_device *pdev)
> {
> struct net_device *ndev = platform_get_drvdata(pdev);
> struct xcan_priv *priv = netdev_priv(ndev);
> + int ret;
> +
> + ret = pm_runtime_get_sync(&pdev->dev);
> + if (ret < 0) {
> + netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n",
> + __func__, ret);
> + return ret;
> + }
>
> if (set_reset_mode(ndev) < 0)
> netdev_err(ndev, "mode resetting failed!\n");
>
> unregister_candev(ndev);
> + pm_runtime_disable(&pdev->dev);
> netif_napi_del(&priv->napi);
> + clk_disable_unprepare(priv->bus_clk);
> + clk_disable_unprepare(priv->can_clk);
> free_candev(ndev);
>
> return 0;
>
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 5/6] openvswitch: Allow for any level of nesting in flow attributes
From: Jesse Gross @ 2015-01-12 19:41 UTC (permalink / raw)
To: Thomas Graf
Cc: David Miller, Stephen Hemminger, Pravin Shelar, Tom Herbert,
Alexei Starovoitov, dev@openvswitch.org, netdev
In-Reply-To: <793586e5305017d914913df4d3502cada6f1f55f.1421064100.git.tgraf@suug.ch>
On Mon, Jan 12, 2015 at 4:26 AM, Thomas Graf <tgraf@suug.ch> wrote:
> diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
> index 8980d32..457ccf3 100644
> --- a/net/openvswitch/flow_netlink.c
> +++ b/net/openvswitch/flow_netlink.c
> +static const struct ovs_len_tbl ovs_tunnel_key_lens[OVS_TUNNEL_KEY_ATTR_MAX + 1] = {
> + [OVS_TUNNEL_KEY_ATTR_ID] = { .len = sizeof(u64) },
> + [OVS_TUNNEL_KEY_ATTR_IPV4_SRC] = { .len = sizeof(u32) },
> + [OVS_TUNNEL_KEY_ATTR_IPV4_DST] = { .len = sizeof(u32) },
> + [OVS_TUNNEL_KEY_ATTR_TOS] = { .len = 1 },
> + [OVS_TUNNEL_KEY_ATTR_TTL] = { .len = 1 },
> + [OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT] = { .len = 0 },
> + [OVS_TUNNEL_KEY_ATTR_CSUM] = { .len = 0 },
> + [OVS_TUNNEL_KEY_ATTR_TP_SRC] = { .len = sizeof(u16) },
> + [OVS_TUNNEL_KEY_ATTR_TP_DST] = { .len = sizeof(u16) },
> + [OVS_TUNNEL_KEY_ATTR_OAM] = { .len = 0 },
> + [OVS_TUNNEL_KEY_ATTR_GENEVE_OPTS] = { .len = OVS_ATTR_NESTED },
> +};
Geneve isn't really nested - maybe we should break it out into a
separate name? OVS_ATTR_VARIABLE? We shouldn't really try to traverse
it as netlink attributes anyways.
> +static const struct ovs_len_tbl ovs_key_lens[OVS_KEY_ATTR_MAX + 1] = {
> + [OVS_KEY_ATTR_ENCAP] = { .len = OVS_ATTR_NESTED },
This is not new but I think that encap isn't really handled correctly.
In theory, there could be multiple levels of nesting here (either
another encap or some other element) but there's no 'next' link.
However, I don't believe the situation arises today.
^ permalink raw reply
* [PATCH net-next] ipv6: directly include libc-compat.h in ipv6.h
From: Willem de Bruijn @ 2015-01-12 19:29 UTC (permalink / raw)
To: netdev; +Cc: davem, xiyou.wangcong, Willem de Bruijn
From: Willem de Bruijn <willemb@google.com>
Patch 3b50d9029809 ("ipv6: fix redefinition of in6_pktinfo ...")
fixed a libc compatibility issue in ipv6 structure definitions
as described in include/uapi/linux/libc-compat.h.
It relies on including linux/in6.h to include libc-compat.h itself.
Include that file directly to clearly communicate the dependency
(libc-compat.h: "This include must be as early as possible").
Signed-off-by: Willem de Bruijn <willemb@google.com>
----
As discussed in http://patchwork.ozlabs.org/patch/427384/
---
include/uapi/linux/ipv6.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index b9b1b7d..73cb02d 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -1,6 +1,7 @@
#ifndef _UAPI_IPV6_H
#define _UAPI_IPV6_H
+#include <linux/libc-compat.h>
#include <linux/types.h>
#include <linux/in6.h>
#include <asm/byteorder.h>
--
2.2.0.rc0.207.ga3a616c
^ 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