aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-01-16net: remove prototype of qdisc_lookup_class()Gravatar Jakub Kicinski 1-1/+0
Looks like qdisc_lookup_class() never existed in the tree in the git era. Remove the prototype from the header. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16tipc: fix race condition at topology server receiveGravatar Jon Maloy 3-46/+51
We have identified a race condition during reception of socket events and messages in the topology server. - The function tipc_close_conn() is releasing the corresponding struct tipc_subscriber instance without considering that there may still be items in the receive work queue. When those are scheduled, in the function tipc_receive_from_work(), they are using the subscriber pointer stored in struct tipc_conn, without first checking if this is valid or not. This will sometimes lead to crashes, as the next call of tipc_conn_recvmsg() will access the now deleted item. We fix this by making the usage of this pointer conditional on whether the connection is active or not. I.e., we check the condition test_bit(CF_CONNECTED) before making the call tipc_conn_recvmsg(). - Since the two functions may be running on different cores, the condition test described above is not enough. tipc_close_conn() may come in between and delete the subscriber item after the condition test is done, but before tipc_conn_recv_msg() is finished. This happens less frequently than the problem described above, but leads to the same symptoms. We fix this by using the existing sk_callback_lock for mutual exclusion in the two functions. In addition, we have to move a call to tipc_conn_terminate() outside the mentioned lock to avoid deadlock. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16Merge branch 'aquantia-next'Gravatar David S. Miller 26-2334/+2385
Igor Russkikh says: ==================== Aquantia atlantic driver update 2018/01 This patch is a set of cleanups and bugfixes in preparation to new Aquantia hardware support. Standard ARRAY_SIZE is now used through all the code, some unused abstraction structures removed and cleaned up, duplicate declarations removed. Also two large declaration styling fixes: - Hardware register set defines are lined up with kernel style - Hardware access functions were not prefixed, now already defined hw_atl prefix is used. patch v2 changes: - patch reorganized because of its big size. New HW support will be submitted as a separate patchset. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Fix internal stats calculation on rxGravatar Igor Russkikh 1-2/+2
skb len should be fetched before gro_receive - otherwise we may get wrong or even outdated skb data. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Prepend hw access functions declarations with prefixGravatar Igor Russkikh 5-840/+922
Internal functions for registers and HW access were not prefixed. This introduce noise in global kernel symbols. Here we add explicit prefix 'hw_atl' to all the HW access layer functions. Alignment and styling were fixed as well. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Fix register definitions to linux styleGravatar Igor Russkikh 3-1139/+1173
Original driver code had internal registers and masks declarations in low case and without any prefix. Here we make all these uppercase and add already used HW_ATL prefix to recognize these. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Eliminate aq_nic structure abstractionGravatar Igor Russkikh 10-54/+46
aq_nic_s was hidden in aq_nic_internal.h, that made it difficult to access nic fields and structures from other modules. This change moves aq_nic_s struct into aq_nic.h and thus makes it available to other driver modules, mainly pci module and hw related module. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Simplify dependencies between pci modulesGravatar Igor Russkikh 6-106/+113
Eliminate useless passing of net_device_ops and ethtools_ops through deep chain of calls. Move all pci related code into aq_pci_func module. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Add const qualifiers for hardware ops tablesGravatar Igor Russkikh 14-20/+21
Hardware operations and capabilities tables are constants and never changed. Declare these as constants. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Remove duplicate hardware descriptors declarationsGravatar Igor Russkikh 3-62/+31
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Cleanup hardware access modulesGravatar Igor Russkikh 8-97/+71
Use direct aq_hw_s *self reference where possible Eliminate useless abstraction PHAL, duplicated structures definitions, Simplify nic config structure creation and management. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Cleanup status flags accessesGravatar Igor Russkikh 9-17/+11
Usage of aq_obj_s structure is noop, here we remove it replacing access to flags filed directly. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: aquantia: Eliminate AQ_DIMOF, replace with ARRAY_SIZEGravatar Igor Russkikh 5-6/+4
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16Merge branch 'net-thunderx-add-support-for-PTP-clock'Gravatar David S. Miller 13-6/+782
Aleksey Makarov says: ==================== net: thunderx: add support for PTP clock This series adds support for IEEE 1588 Precision Time Protocol to Cavium ethernet driver. The first patch adds support for the Precision Time Protocol Clocks and Timestamping coprocessor (PTP) found on Cavium processors. It registers a new PTP clock in the PTP core and provides functions to use the counter in BGX, TNS, GTI, and NIC blocks. The second patch introduces support for the PTP protocol to the Cavium ThunderX ethernet driver. v6: - check if ptp_clock_register() returns NULL (Richard Cochran) - fix doc comment for cavium_ptp_enable() (Richard Cochran) - fix a function call formatting; use defined constant (Richard Cochran) - add comments for `tx_ptp_skbs` and `ptp_skb` (Richard Cochran) - use adjfine() instead of adjfreq() (Richard Cochran) - add Acked-by: Philippe Ombredanne <pombredanne@nexb.com> v5: https://lkml.kernel.org/r/20171211141435.2915-1-aleksey.makarov@cavium.com - fix the file headers (add SPDX tags, remove advertisment) (Philippe Ombredanne) - use "imply" instead of "select" (Richard Cochran) - add some code in cavium_ptp_get() for the case when the PTP driver has not been registered with the PTP core v4: https://lkml.kernel.org/r/20171208103442.19354-1-aleksey.makarov@cavium.com - use IS_ENABLED. This fixes compilation of the ptp as a module (David Miller) - select PTP_1588_CLOCK, not depend on it. This fixes a build warning. - change u64 to __be64. This fixes the sparse warning "warning: cast to restricted __be64" - make nicvf_config_hwtstamp() static. This fixes the sparse warning "warning: symbol 'nicvf_config_hwtstamp' was not declared. Should it be static?" v3: https://lkml.kernel.org/r/20171206133100.26436-1-aleksey.makarov@cavium.com - rebase to net-next v2: https://lkml.kernel.org/r/20171117134909.8954-1-aleksey.makarov@cavium.com - use readq()/writeq() in place of cavium_ptp_reg_read()/cavium_ptp_reg_write(), don't use readq_relaxed()/writeq_relaxed() (David Daney) v1: https://lkml.kernel.org/r/20171107190704.15458-1-aleksey.makarov@cavium.com ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: thunderx: add timestamping supportGravatar Sunil Goutham 9-6/+345
This adds timestamping support for both receive and transmit paths. On the receive side no filters are supported i.e either all pkts will get a timestamp appended infront of the packet or none. On the transmit side HW doesn't support timestamp insertion but only generates a separate CQE with transmitted packet's timestamp. Also HW supports only one packet at a time for timestamping on the transmit side. Signed-off-by: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: Aleksey Makarov <aleksey.makarov@cavium.com> Acked-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16net: add support for Cavium PTP coprocessorGravatar Radoslaw Biernacki 5-0/+437
This patch adds support for the Precision Time Protocol Clocks and Timestamping hardware found on Cavium ThunderX processors. Signed-off-by: Radoslaw Biernacki <rad@semihalf.com> Signed-off-by: Aleksey Makarov <aleksey.makarov@cavium.com> Acked-by: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16mlxsw: spectrum: qdiscs: Make function mlxsw_sp_qdisc_prio_unoffload staticGravatar Wei Yongjun 1-1/+1
Fixes the following sparse warning: drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c:464:1: warning: symbol 'mlxsw_sp_qdisc_prio_unoffload' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16Merge branch 'devlink-resource'Gravatar David S. Miller 12-134/+1213
Jiri Pirko says: ==================== devlink: Add support for resource abstraction Arkadi says: Many of the ASIC's internal resources are limited and are shared between several hardware procedures. For example, unified hash-based memory can be used for many lookup purposes, like FDB and LPM. In many cases the user can provide a partitioning scheme for such a resource in order to perform fine tuning for his application. In such cases performing driver reload is needed for the changes to take place, thus this patchset also adds support for hot reload. Such an abstraction can be coupled with devlink's dpipe interface, which models the ASIC's pipeline as a graph of match/action tables. By modeling the hardware resource object, and by coupling it to several dpipe tables, further visibility can be achieved in order to debug ASIC-wide issues. The proposed interface will provide the user the ability to understand the limitations of the hardware, and receive notification regarding its occupancy. Furthermore, monitoring the resource occupancy can be done in real-time and can be useful in many cases. --- v2->v3 - Mix/Max/Gran attributes. - Add resource consumption per table. - Change basic resource unit to 'entry'. - ABI documentation. v1->v2 - Add resource size attribute. - Fix split bug. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16mlxsw: documentation: Add resources ABI documentationGravatar Arkadi Sharshevsky 1-0/+33
Add resources ABI documentation. Signed-off-by: Arkadi Sharhsevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16mlxsw: core: Add support for reloadGravatar Arkadi Sharshevsky 4-23/+65
Add support for hot reload. First, all the driver/core resources are released but the PCI and devlink instances, then reset is performed through the PCI interface. Finally the driver performs initialization. In case of reload failure the driver is left in a partially initialized state. Special care is taken during the driver removal in order to properly handle this state. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16mlxsw: pci: Add support for getting resource through devlinkGravatar Arkadi Sharshevsky 4-30/+92
Up until now the KVD partition was static. This patch introduces the ability to get the resource sizes via devlink. In case the resource is not available the default configuration is used. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16mlxsw: spectrum: Add support for getting kvdl occupancyGravatar Arkadi Sharshevsky 3-0/+36
Add support for getting the kvdl occupancy through the resource interface. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16mlxsw: spectrum_dpipe: Connect dpipe tables to resourcesGravatar Arkadi Sharshevsky 1-12/+69
Connect current dpipe tables to resources. The tables are connected in the following fashion: 1. IPv4 host -> KVD hash single 2. IPv6 host -> KVD hash double 3. Adjacency -> KVD linear Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16mlxsw: spectrum: Register KVD resources with devlinkGravatar Arkadi Sharshevsky 4-0/+205
Register the KVD resources with devlink. The KVD is a memory resource which is subdivided into three partitions which are the linear, hash single and hash double. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16mlxsw: pci: Add support for performing bus resetGravatar Arkadi Sharshevsky 2-13/+41
This is a preparation stage before introducing hot reload. During the reload process the ASIC should be resetted by accessing the PCI BAR due to unavailability of the mailbox/emad interfaces. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16devlink: Add relation between dpipe and resourceGravatar Arkadi Sharshevsky 3-0/+56
The hardware processes which are modeled via dpipe commonly use some internal hardware resources. Such relation can improve the understanding of hardware limitations. The number of resource's unit consumed per table's entry are also provided for each table. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16devlink: Add support for reloadGravatar Arkadi Sharshevsky 3-0/+53
Add support for performing driver hot reload. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16devlink: Add support for resource abstractionGravatar Arkadi Sharshevsky 3-0/+488
Add support for hardware resource abstraction over devlink. Each resource is identified via id, furthermore it contains information regarding its size and its related sub resources. Each resource can also provide its current occupancy. In some cases the sizes of some resources can be changed, yet for those changes to take place a hot driver reload may be needed. The reload capability will be introduced in the next patch. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16devlink: Add per devlink instance lockGravatar Arkadi Sharshevsky 2-59/+78
This is a preparation before introducing resources and hot reload support. Currently there are two global lock where one protects all devlink access, and the second one protects devlink port access. This patch adds per devlink instance lock which protects the internal members which are the sb/dpipe/ resource/ports. By introducing this lock the global devlink port lock can be discarded. Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16phy: realtek: use new helpers for paged register accessGravatar Heiner Kallweit 1-45/+14
Make use of the new helpers for paged register access. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16Merge branch 'phy-add-helpers-for-setting-clearing-bits-in-PHY-registers'Gravatar David S. Miller 2-2/+51
Heiner Kallweit says: ==================== phy: add helpers for setting/clearing bits in PHY registers Based on the recent introduction of phy_modify add helpers for setting and clearing bits in PHY registers. First user is phylib. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16phy: use new helpers phy_set_bits/phy_clear_bits in phylibGravatar Heiner Kallweit 1-2/+2
Use new helpers phy_set_bits / phy_clear_bits in phylib. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-16phy: add helpers for setting/clearing bits in PHY registersGravatar Heiner Kallweit 1-0/+49
Based on the recent introduction of phy_modify add helpers for setting and clearing bits in PHY registers. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15Merge tag 'linux-can-next-for-4.16-20180105' of ↵Gravatar David S. Miller 12-34/+32
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2017-12-01,Re: pull-request: can-next this is a pull request of 7 patches for net-next/master. All patches are by me. Patch 6 is for the "can_raw" protocol and add error checking to the bind() function. All other patches clean up the coding style and remove unused parameters in various CAN drivers and infrastructure. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15Merge branch 'sh_eth-simplify-TSU-initialization'Gravatar David S. Miller 1-14/+9
Sergei Shtylyov says: ==================== sh_eth: simplify TSU initialization Here's a set of 2 patches against DaveM's 'net-next.git' repo. With those, I'm somewhat simplifying the TSU init code in the driver probe() method... ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15sh_eth: get Ether port # only when neededGravatar Sergei Shtylyov 1-8/+5
The dual-port Ether configurations always have a shared TSU to e.g. pass the packets between those ports. With the TSU init. code gathered under the single *if*, we now can only get the port # from 'platform_device::id' only when we actually need it (and not recalculate it each time)... Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15sh_eth: gather all TSU init code in one placeGravatar Sergei Shtylyov 1-7/+5
The sh_eth_cpu_data::chip_reset() method always resets using ARSTR and this register is always located at the start of the TSU register region. Therefore, we can only call this method if we know TSU is there and thus simplify the probing code a bit... Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15Merge tag 'wireless-drivers-next-for-davem-2018-01-13' of ↵Gravatar David S. Miller 152-2152/+6840
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 4.16 Here are patches which have been accumulating over the holidays and after the New Year. Business as usual and nothing special really standing out. But what's noteworthy here is that Larry Finger is stepping down as the rtlwifi maintainer. He has been maintaining rtlwifi since it was applied back in 2010 in commit 0c8173385e54 ("rtl8192ce: Add new driver") and it has been no easy role trying to juggle between the vendor, demanding upstream community and users. So big thank you to Larry for all his efforts! ath10k * more preparation work for wcn3990 support * add memory dump to firmware coredump files wil6210 * support scheduled scan * support 40-bit DMA addresses qtnfmac * support MAC address based access control * support for radar detection and Channel Availibility Check (CAC) mwifiex * firmware coredump for usb devices rtlwifi * Larry Finger steps down as the maintainer and Ping-Ke Shih becomes the new maintainer * add debugfs interfaces to dump register and btcoex status, and also write registers and h2c ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15net: ethernet: Add a driver for Gemini gigabit ethernetGravatar Linus Walleij 7-0/+3581
The Gemini ethernet has been around for years as an out-of-tree patch used with the NAS boxen and routers built on StorLink SL3512 and SL3516, later Storm Semiconductor, later Cortina Systems. These ASICs are still being deployed and brand new off-the-shelf systems using it can easily be acquired. The full name of the IP block is "Net Engine and Gigabit Ethernet MAC" commonly just called "GMAC". The hardware block contains a common TCP Offload Enginer (TOE) that can be used by both MACs. The current driver does not use it. Cc: Tobias Waldvogel <tobias.waldvogel@gmail.com> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15net: ethernet: Add DT bindings for the Gemini ethernetGravatar Linus Walleij 1-0/+92
This adds the device tree bindings for the Gemini ethernet controller. It is pretty straight-forward, using standard bindings and modelling the two child ports as child devices under the parent ethernet controller device. Cc: devicetree@vger.kernel.org Cc: Tobias Waldvogel <tobias.waldvogel@gmail.com> Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15ipv6: Fix build with gcc-4.4.5Gravatar Ido Schimmel 1-2/+6
Emil reported the following compiler errors: net/ipv6/route.c: In function `rt6_sync_up`: net/ipv6/route.c:3586: error: unknown field `nh_flags` specified in initializer net/ipv6/route.c:3586: warning: missing braces around initializer net/ipv6/route.c:3586: warning: (near initialization for `arg.<anonymous>`) net/ipv6/route.c: In function `rt6_sync_down_dev`: net/ipv6/route.c:3695: error: unknown field `event` specified in initializer net/ipv6/route.c:3695: warning: missing braces around initializer net/ipv6/route.c:3695: warning: (near initialization for `arg.<anonymous>`) Problem is with the named initializers for the anonymous union members. Fix this by adding curly braces around the initialization. Fixes: 4c981e28d373 ("ipv6: Prepare to handle multiple netdev events") Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reported-by: Emil S Tantilov <emils.tantilov@gmail.com> Tested-by: Emil S Tantilov <emils.tantilov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15tipc: fix bug during lookup of multicast destination nodesGravatar Jon Maloy 3-8/+4
In commit 232d07b74a33 ("tipc: improve groupcast scope handling") we inadvertently broke non-group multicast transmission when changing the parameter 'domain' to 'scope' in the function tipc_nametbl_lookup_dst_nodes(). We missed to make the corresponding change in the calling function, with the result that the lookup always fails. A closer anaysis reveals that this parameter is not needed at all. Non-group multicast is hard coded to use CLUSTER_SCOPE, and in the current implementation this will be delivered to all matching destinations except those which are published with NODE_SCOPE on other nodes. Since such publications never will be visible on the sending node anyway, it makes no sense to discriminate by scope at all. We now remove this parameter altogether. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15net: Convert atomic_t net::count to refcount_tGravatar Kirill Tkhai 5-14/+14
Since net could be obtained from RCU lists, and there is a race with net destruction, the patch converts net::count to refcount_t. This provides sanity checks for the cases of incrementing counter of already dead net, when maybe_get_net() has to used instead of get_net(). Drivers: allyesconfig and allmodconfig are OK. Suggested-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15sctp: removed unused var from sctp_make_authGravatar Marcelo Ricardo Leitner 1-2/+1
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Reviewed-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15net: phy: remove parameter new_link from phy_mac_interrupt()Gravatar Heiner Kallweit 3-11/+8
I see two issues with parameter new_link: 1. It's not needed. See also phy_interrupt(), works w/o this parameter. phy_mac_interrupt sets the state to PHY_CHANGELINK and triggers the state machine which then calls phy_read_status. And phy_read_status updates the link state. 2. phy_mac_interrupt is used in interrupt context and getting the link state may sleep (at least when having to access the PHY registers via MDIO bus). So let's remove it. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15tipc: fix a potental access after delete in tipc_sk_join()Gravatar Jon Maloy 1-0/+1
In commit d12d2e12cec2 "tipc: send out join messages as soon as new member is discovered") we added a call to the function tipc_group_join() without considering the case that the preceding tipc_sk_publish() might have failed, and the group item already deleted. We fix this by returning from tipc_sk_join() directly after the failed tipc_sk_publish. Reported-by: syzbot+e3eeae78ea88b8d6d858@syzkaller.appspotmail.com Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15Merge branch 'dsa-lan9303-check-error-value-from-devm_gpiod_get_optional'Gravatar David S. Miller 1-10/+12
Phil Reid says: ==================== net: dsa: lan9303: check error value from devm_gpiod_get_optional() Errors need to be prograted back from probe. Note: I have only compile tested the code as I don't have the hardware. Egil Hjelmeland <privat@egil-hjelmeland.no> has tested it but I haven't added at Test-by: wasn't in the standard form. Not sure if that's ok or not. Changes from v1: - rebased on net-next ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15net: dsa: lan9303: check error value from devm_gpiod_get_optional()Gravatar Phil Reid 1-4/+10
devm_gpiod_get_optional() can return an error in addition to a NULL ptr. Check for error and propagate that to the probe function. Check return value in probe. This will now handle EPROBE_DEFER for the reset gpio. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15net: dsa: lan9303: make lan9303_handle_reset() a void functionGravatar Phil Reid 1-7/+3
lan9303_handle_reset never returns anything other than success. So there's not need for it to return an error code. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2018-01-15net: phy: Have __phy_modify return 0 on successGravatar Andrew Lunn 1-7/+6
__phy_modify would return the old value of the register before it was modified. Thus on success, it does not return 0, but a positive value. Thus functions using phy_modify, which is a wrapper around __phy_modify, can start returning > 0 on success, rather than 0. As a result, breakage has been noticed in various places, where 0 was assumed. Code inspection does not find any current location where the return of the old value is currently used. So have __phy_modify return 0 on success. When there is a real need for the old value, either a new accessor can be added, or an additional parameter passed. Fixes: fea23fb591cc ("net: phy: convert read-modify-write to phy_modify()") Fixes: 2b74e5be17d2 ("net: phy: add phy_modify() accessor") Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Niklas Cassel <niklas.cassel@axis.com> Signed-off-by: David S. Miller <davem@davemloft.net>