1. 10 12月, 2021 1 次提交
    • R
      net: phylink: add legacy_pre_march2020 indicator · 3e5b1fec
      Russell King (Oracle) 提交于
      Add a boolean to phylink_config to indicate whether a driver has not
      been updated for the changes in commit 7cceb599 ("net: phylink:
      avoid mac_config calls"), and thus are reliant on the old behaviour.
      
      We were currently keying the phylink behaviour on the presence of a
      PCS, but this is sub-optimal for modern drivers that may not have a
      PCS.
      
      This commit merely introduces the new flag, but does not add any use,
      since we need all legacy drivers to set this flag before it can be
      used. Once these legacy drivers have been updated, we can remove this
      flag.
      Signed-off-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      3e5b1fec
  2. 09 12月, 2021 3 次提交
    • S
      net: wwan: make debugfs optional · 283e6f5a
      Sergey Ryazanov 提交于
      Debugfs interface is optional for the regular modem use. Some distros
      and users will want to disable this feature for security or kernel
      size reasons. So add a configuration option that allows to completely
      disable the debugfs interface of the WWAN devices.
      
      A primary considered use case for this option was embedded firmwares.
      For example, in OpenWrt, you can not completely disable debugfs, as a
      lot of wireless stuff can only be configured and monitored with the
      debugfs knobs. At the same time, reducing the size of a kernel and
      modules is an essential task in the world of embedded software.
      Disabling the WWAN and IOSM debugfs interfaces allows us to save 50K
      (x86-64 build) of space for module storage. Not much, but already
      considerable when you only have 16MB of storage.
      
      So it is hard to just disable whole debugfs. Users need some fine
      grained set of options to control which debugfs interface is important
      and should be available and which is not.
      
      The new configuration symbol is enabled by default and is hidden under
      the EXPERT option. So a regular user would not be bothered by another
      one configuration question. While an embedded distro maintainer will be
      able to a little more reduce the final image size.
      Signed-off-by: NSergey Ryazanov <ryazanov.s.a@gmail.com>
      Reviewed-by: NLeon Romanovsky <leonro@nvidia.com>
      Reviewed-by: NLoic Poulain <loic.poulain@linaro.org>
      Acked-by: NM Chetan Kumar <m.chetan.kumar@intel.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      283e6f5a
    • V
      net: dsa: keep the bridge_dev and bridge_num as part of the same structure · d3eed0e5
      Vladimir Oltean 提交于
      The main desire behind this is to provide coherent bridge information to
      the fast path without locking.
      
      For example, right now we set dp->bridge_dev and dp->bridge_num from
      separate code paths, it is theoretically possible for a packet
      transmission to read these two port properties consecutively and find a
      bridge number which does not correspond with the bridge device.
      
      Another desire is to start passing more complex bridge information to
      dsa_switch_ops functions. For example, with FDB isolation, it is
      expected that drivers will need to be passed the bridge which requested
      an FDB/MDB entry to be offloaded, and along with that bridge_dev, the
      associated bridge_num should be passed too, in case the driver might
      want to implement an isolation scheme based on that number.
      
      We already pass the {bridge_dev, bridge_num} pair to the TX forwarding
      offload switch API, however we'd like to remove that and squash it into
      the basic bridge join/leave API. So that means we need to pass this
      pair to the bridge join/leave API.
      
      During dsa_port_bridge_leave, first we unset dp->bridge_dev, then we
      call the driver's .port_bridge_leave with what used to be our
      dp->bridge_dev, but provided as an argument.
      
      When bridge_dev and bridge_num get folded into a single structure, we
      need to preserve this behavior in dsa_port_bridge_leave: we need a copy
      of what used to be in dp->bridge.
      
      Switch drivers check bridge membership by comparing dp->bridge_dev with
      the provided bridge_dev, but now, if we provide the struct dsa_bridge as
      a pointer, they cannot keep comparing dp->bridge to the provided
      pointer, since this only points to an on-stack copy. To make this
      obvious and prevent driver writers from forgetting and doing stupid
      things, in this new API, the struct dsa_bridge is provided as a full
      structure (not very large, contains an int and a pointer) instead of a
      pointer. An explicit comparison function needs to be used to determine
      bridge membership: dsa_port_offloads_bridge().
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NAlvin Šipraga <alsi@bang-olufsen.dk>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      d3eed0e5
    • V
      net: dsa: make dp->bridge_num one-based · 3f9bb030
      Vladimir Oltean 提交于
      I have seen too many bugs already due to the fact that we must encode an
      invalid dp->bridge_num as a negative value, because the natural tendency
      is to check that invalid value using (!dp->bridge_num). Latest example
      can be seen in commit 1bec0f05 ("net: dsa: fix bridge_num not
      getting cleared after ports leaving the bridge").
      
      Convert the existing users to assume that dp->bridge_num == 0 is the
      encoding for invalid, and valid bridge numbers start from 1.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NAlvin Šipraga <alsi@bang-olufsen.dk>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      3f9bb030
  3. 08 12月, 2021 5 次提交
  4. 07 12月, 2021 10 次提交
  5. 04 12月, 2021 2 次提交
  6. 03 12月, 2021 1 次提交
    • A
      net/mlx5: Dynamically resize flow counters query buffer · b247f32a
      Avihai Horon 提交于
      The flow counters bulk query buffer is allocated once during
      mlx5_fc_init_stats(). For PFs and VFs this buffer usually takes a little
      more than 512KB of memory, which is aligned to the next power of 2, to
      1MB. For SFs, this buffer is reduced and takes around 128 Bytes.
      
      The buffer size determines the maximum number of flow counters that
      can be queried at a time. Thus, having a bigger buffer can improve
      performance for users that need to query many flow counters.
      
      There are cases that don't use many flow counters and don't need a big
      buffer (e.g. SFs, VFs). Since this size is critical with large scale,
      in these cases the buffer size should be reduced.
      
      In order to reduce memory consumption while maintaining query
      performance, change the query buffer's allocation scheme to the
      following:
      - First allocate the buffer with small initial size.
      - If the number of counters surpasses the initial size, resize the
        buffer to the maximum size.
      
      The buffer only grows and isn't shrank, because users with many flow
      counters don't care about the buffer size and we don't want to add
      resize overhead if the current number of counters drops.
      
      This solution is preferable to the current one, which is less accurate
      and only addresses SFs.
      Signed-off-by: NAvihai Horon <avihaih@nvidia.com>
      Reviewed-by: NMark Bloch <mbloch@nvidia.com>
      Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com>
      b247f32a
  7. 02 12月, 2021 2 次提交
    • E
      net: annotate data-races on txq->xmit_lock_owner · 7a10d8c8
      Eric Dumazet 提交于
      syzbot found that __dev_queue_xmit() is reading txq->xmit_lock_owner
      without annotations.
      
      No serious issue there, let's document what is happening there.
      
      BUG: KCSAN: data-race in __dev_queue_xmit / __dev_queue_xmit
      
      write to 0xffff888139d09484 of 4 bytes by interrupt on cpu 0:
       __netif_tx_unlock include/linux/netdevice.h:4437 [inline]
       __dev_queue_xmit+0x948/0xf70 net/core/dev.c:4229
       dev_queue_xmit_accel+0x19/0x20 net/core/dev.c:4265
       macvlan_queue_xmit drivers/net/macvlan.c:543 [inline]
       macvlan_start_xmit+0x2b3/0x3d0 drivers/net/macvlan.c:567
       __netdev_start_xmit include/linux/netdevice.h:4987 [inline]
       netdev_start_xmit include/linux/netdevice.h:5001 [inline]
       xmit_one+0x105/0x2f0 net/core/dev.c:3590
       dev_hard_start_xmit+0x72/0x120 net/core/dev.c:3606
       sch_direct_xmit+0x1b2/0x7c0 net/sched/sch_generic.c:342
       __dev_xmit_skb+0x83d/0x1370 net/core/dev.c:3817
       __dev_queue_xmit+0x590/0xf70 net/core/dev.c:4194
       dev_queue_xmit+0x13/0x20 net/core/dev.c:4259
       neigh_hh_output include/net/neighbour.h:511 [inline]
       neigh_output include/net/neighbour.h:525 [inline]
       ip6_finish_output2+0x995/0xbb0 net/ipv6/ip6_output.c:126
       __ip6_finish_output net/ipv6/ip6_output.c:191 [inline]
       ip6_finish_output+0x444/0x4c0 net/ipv6/ip6_output.c:201
       NF_HOOK_COND include/linux/netfilter.h:296 [inline]
       ip6_output+0x10e/0x210 net/ipv6/ip6_output.c:224
       dst_output include/net/dst.h:450 [inline]
       NF_HOOK include/linux/netfilter.h:307 [inline]
       ndisc_send_skb+0x486/0x610 net/ipv6/ndisc.c:508
       ndisc_send_rs+0x3b0/0x3e0 net/ipv6/ndisc.c:702
       addrconf_rs_timer+0x370/0x540 net/ipv6/addrconf.c:3898
       call_timer_fn+0x2e/0x240 kernel/time/timer.c:1421
       expire_timers+0x116/0x240 kernel/time/timer.c:1466
       __run_timers+0x368/0x410 kernel/time/timer.c:1734
       run_timer_softirq+0x2e/0x60 kernel/time/timer.c:1747
       __do_softirq+0x158/0x2de kernel/softirq.c:558
       __irq_exit_rcu kernel/softirq.c:636 [inline]
       irq_exit_rcu+0x37/0x70 kernel/softirq.c:648
       sysvec_apic_timer_interrupt+0x3e/0xb0 arch/x86/kernel/apic/apic.c:1097
       asm_sysvec_apic_timer_interrupt+0x12/0x20
      
      read to 0xffff888139d09484 of 4 bytes by interrupt on cpu 1:
       __dev_queue_xmit+0x5e3/0xf70 net/core/dev.c:4213
       dev_queue_xmit_accel+0x19/0x20 net/core/dev.c:4265
       macvlan_queue_xmit drivers/net/macvlan.c:543 [inline]
       macvlan_start_xmit+0x2b3/0x3d0 drivers/net/macvlan.c:567
       __netdev_start_xmit include/linux/netdevice.h:4987 [inline]
       netdev_start_xmit include/linux/netdevice.h:5001 [inline]
       xmit_one+0x105/0x2f0 net/core/dev.c:3590
       dev_hard_start_xmit+0x72/0x120 net/core/dev.c:3606
       sch_direct_xmit+0x1b2/0x7c0 net/sched/sch_generic.c:342
       __dev_xmit_skb+0x83d/0x1370 net/core/dev.c:3817
       __dev_queue_xmit+0x590/0xf70 net/core/dev.c:4194
       dev_queue_xmit+0x13/0x20 net/core/dev.c:4259
       neigh_resolve_output+0x3db/0x410 net/core/neighbour.c:1523
       neigh_output include/net/neighbour.h:527 [inline]
       ip6_finish_output2+0x9be/0xbb0 net/ipv6/ip6_output.c:126
       __ip6_finish_output net/ipv6/ip6_output.c:191 [inline]
       ip6_finish_output+0x444/0x4c0 net/ipv6/ip6_output.c:201
       NF_HOOK_COND include/linux/netfilter.h:296 [inline]
       ip6_output+0x10e/0x210 net/ipv6/ip6_output.c:224
       dst_output include/net/dst.h:450 [inline]
       NF_HOOK include/linux/netfilter.h:307 [inline]
       ndisc_send_skb+0x486/0x610 net/ipv6/ndisc.c:508
       ndisc_send_rs+0x3b0/0x3e0 net/ipv6/ndisc.c:702
       addrconf_rs_timer+0x370/0x540 net/ipv6/addrconf.c:3898
       call_timer_fn+0x2e/0x240 kernel/time/timer.c:1421
       expire_timers+0x116/0x240 kernel/time/timer.c:1466
       __run_timers+0x368/0x410 kernel/time/timer.c:1734
       run_timer_softirq+0x2e/0x60 kernel/time/timer.c:1747
       __do_softirq+0x158/0x2de kernel/softirq.c:558
       __irq_exit_rcu kernel/softirq.c:636 [inline]
       irq_exit_rcu+0x37/0x70 kernel/softirq.c:648
       sysvec_apic_timer_interrupt+0x8d/0xb0 arch/x86/kernel/apic/apic.c:1097
       asm_sysvec_apic_timer_interrupt+0x12/0x20
       kcsan_setup_watchpoint+0x94/0x420 kernel/kcsan/core.c:443
       folio_test_anon include/linux/page-flags.h:581 [inline]
       PageAnon include/linux/page-flags.h:586 [inline]
       zap_pte_range+0x5ac/0x10e0 mm/memory.c:1347
       zap_pmd_range mm/memory.c:1467 [inline]
       zap_pud_range mm/memory.c:1496 [inline]
       zap_p4d_range mm/memory.c:1517 [inline]
       unmap_page_range+0x2dc/0x3d0 mm/memory.c:1538
       unmap_single_vma+0x157/0x210 mm/memory.c:1583
       unmap_vmas+0xd0/0x180 mm/memory.c:1615
       exit_mmap+0x23d/0x470 mm/mmap.c:3170
       __mmput+0x27/0x1b0 kernel/fork.c:1113
       mmput+0x3d/0x50 kernel/fork.c:1134
       exit_mm+0xdb/0x170 kernel/exit.c:507
       do_exit+0x608/0x17a0 kernel/exit.c:819
       do_group_exit+0xce/0x180 kernel/exit.c:929
       get_signal+0xfc3/0x1550 kernel/signal.c:2852
       arch_do_signal_or_restart+0x8c/0x2e0 arch/x86/kernel/signal.c:868
       handle_signal_work kernel/entry/common.c:148 [inline]
       exit_to_user_mode_loop kernel/entry/common.c:172 [inline]
       exit_to_user_mode_prepare+0x113/0x190 kernel/entry/common.c:207
       __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline]
       syscall_exit_to_user_mode+0x20/0x40 kernel/entry/common.c:300
       do_syscall_64+0x50/0xd0 arch/x86/entry/common.c:86
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      value changed: 0x00000000 -> 0xffffffff
      
      Reported by Kernel Concurrency Sanitizer on:
      CPU: 1 PID: 28712 Comm: syz-executor.0 Tainted: G        W         5.16.0-rc1-syzkaller #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Link: https://lore.kernel.org/r/20211130170155.2331929-1-eric.dumazet@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      7a10d8c8
    • M
      kprobes: Limit max data_size of the kretprobe instances · 6bbfa441
      Masami Hiramatsu 提交于
      The 'kprobe::data_size' is unsigned, thus it can not be negative.  But if
      user sets it enough big number (e.g. (size_t)-8), the result of 'data_size
      + sizeof(struct kretprobe_instance)' becomes smaller than sizeof(struct
      kretprobe_instance) or zero. In result, the kretprobe_instance are
      allocated without enough memory, and kretprobe accesses outside of
      allocated memory.
      
      To avoid this issue, introduce a max limitation of the
      kretprobe::data_size. 4KB per instance should be OK.
      
      Link: https://lkml.kernel.org/r/163836995040.432120.10322772773821182925.stgit@devnote2
      
      Cc: stable@vger.kernel.org
      Fixes: f47cd9b5 ("kprobes: kretprobe user entry-handler")
      Reported-by: Nzhangyue <zhangyue1@kylinos.cn>
      Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
      6bbfa441
  8. 01 12月, 2021 1 次提交
  9. 30 11月, 2021 2 次提交
    • B
      net: stmmac: Add platform level debug register dump feature · 4047b9db
      Bhupesh Sharma 提交于
      dwmac-qcom-ethqos currently exposes a mechanism to dump rgmii registers
      after the 'stmmac_dvr_probe()' returns. However with commit
      5ec55823 ("net: stmmac: add clocks management for gmac driver"),
      we now let 'pm_runtime_put()' disable the clocks before returning from
      'stmmac_dvr_probe()'.
      
      This causes a crash when 'rgmii_dump()' register dumps are enabled,
      as the clocks are already off.
      
      Since other dwmac drivers (possible future users as well) might
      require a similar register dump feature, introduce a platform level
      callback to allow the same.
      
      This fixes the crash noticed while enabling rgmii_dump() dumps in
      dwmac-qcom-ethqos driver as well. It also allows future changes
      to keep a invoking the register dump callback from the correct
      place inside 'stmmac_dvr_probe()'.
      
      Fixes: 5ec55823 ("net: stmmac: add clocks management for gmac driver")
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NBhupesh Sharma <bhupesh.sharma@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4047b9db
    • A
      siphash: use _unaligned version by default · f7e5b9bf
      Arnd Bergmann 提交于
      On ARM v6 and later, we define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
      because the ordinary load/store instructions (ldr, ldrh, ldrb) can
      tolerate any misalignment of the memory address. However, load/store
      double and load/store multiple instructions (ldrd, ldm) may still only
      be used on memory addresses that are 32-bit aligned, and so we have to
      use the CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS macro with care, or we
      may end up with a severe performance hit due to alignment traps that
      require fixups by the kernel. Testing shows that this currently happens
      with clang-13 but not gcc-11. In theory, any compiler version can
      produce this bug or other problems, as we are dealing with undefined
      behavior in C99 even on architectures that support this in hardware,
      see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100363.
      
      Fortunately, the get_unaligned() accessors do the right thing: when
      building for ARMv6 or later, the compiler will emit unaligned accesses
      using the ordinary load/store instructions (but avoid the ones that
      require 32-bit alignment). When building for older ARM, those accessors
      will emit the appropriate sequence of ldrb/mov/orr instructions. And on
      architectures that can truly tolerate any kind of misalignment, the
      get_unaligned() accessors resolve to the leXX_to_cpup accessors that
      operate on aligned addresses.
      
      Since the compiler will in fact emit ldrd or ldm instructions when
      building this code for ARM v6 or later, the solution is to use the
      unaligned accessors unconditionally on architectures where this is
      known to be fast. The _aligned version of the hash function is
      however still needed to get the best performance on architectures
      that cannot do any unaligned access in hardware.
      
      This new version avoids the undefined behavior and should produce
      the fastest hash on all architectures we support.
      
      Link: https://lore.kernel.org/linux-arm-kernel/20181008211554.5355-4-ard.biesheuvel@linaro.org/
      Link: https://lore.kernel.org/linux-crypto/CAK8P3a2KfmmGDbVHULWevB0hv71P2oi2ZCHEAqT=8dQfa0=cqQ@mail.gmail.com/Reported-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Fixes: 2c956a60 ("siphash: add cryptographically secure PRF")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Acked-by: NArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      f7e5b9bf
  10. 29 11月, 2021 1 次提交
  11. 27 11月, 2021 2 次提交
  12. 26 11月, 2021 1 次提交
  13. 25 11月, 2021 1 次提交
  14. 24 11月, 2021 2 次提交
  15. 23 11月, 2021 2 次提交
  16. 22 11月, 2021 4 次提交
    • K
      skbuff: Switch structure bounds to struct_group() · 03f61041
      Kees Cook 提交于
      In preparation for FORTIFY_SOURCE performing compile-time and run-time
      field bounds checking for memcpy(), memmove(), and memset(), avoid
      intentionally writing across neighboring fields.
      
      Replace the existing empty member position markers "headers_start" and
      "headers_end" with a struct_group(). This will allow memcpy() and sizeof()
      to more easily reason about sizes, and improve readability.
      
      "pahole" shows no size nor member offset changes to struct sk_buff.
      "objdump -d" shows no object code changes (outside of WARNs affected by
      source line number changes).
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NGustavo A. R. Silva <gustavoars@kernel.org>
      Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> # drivers/net/wireguard/*
      Link: https://lore.kernel.org/lkml/20210728035006.GD35706@embeddedorSigned-off-by: NDavid S. Miller <davem@davemloft.net>
      03f61041
    • K
      skbuff: Move conditional preprocessor directives out of struct sk_buff · fba84957
      Kees Cook 提交于
      In preparation for using the struct_group() macro in struct sk_buff,
      move the conditional preprocessor directives out of the region of struct
      sk_buff that will be enclosed by struct_group(). While GCC and Clang are
      happy with conditional preprocessor directives here, sparse is not, even
      under -Wno-directive-within-macro[1], as would be seen under a C=1 build:
      
      net/core/filter.c: note: in included file (through include/linux/netlink.h, include/linux/sock_diag.h):
      ./include/linux/skbuff.h:820:1: warning: directive in macro's argument list
      ./include/linux/skbuff.h:822:1: warning: directive in macro's argument list
      ./include/linux/skbuff.h:846:1: warning: directive in macro's argument list
      ./include/linux/skbuff.h:848:1: warning: directive in macro's argument list
      
      Additionally remove empty macro argument definitions and usage.
      
      "objdump -d" shows no object code differences.
      
      [1] https://www.spinics.net/lists/linux-sparse/msg10857.htmlSigned-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fba84957
    • M
      net: wwan: common debugfs base dir for wwan device · c4804670
      M Chetan Kumar 提交于
      This patch set brings in a common debugfs base directory
      i.e. /sys/kernel/debugfs/wwan/ in WWAN Subsystem for a
      WWAN device instance. So that it avoids driver polluting
      debugfs root with unrelated directories & possible name
      collusion.
      
      Having a common debugfs base directory for WWAN drivers
      eases user to match control devices with debugfs entries.
      
      WWAN Subsystem creates dentry (/sys/kernel/debugfs/wwan)
      on module load & removes dentry on module unload.
      
      When driver registers a new wwan device, dentry (wwanX)
      is created for WWAN device instance & on driver unregister
      dentry is removed.
      
      New API is introduced to return the wwan device instance
      dentry so that driver can create debugfs entries under it.
      Signed-off-by: NM Chetan Kumar <m.chetan.kumar@linux.intel.com>
      Reviewed-by: NLoic Poulain <loic.poulain@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c4804670
    • S
      net: phylink: Add helpers for c22 registers without MDIO · 291dcae3
      Sean Anderson 提交于
      Some devices expose memory-mapped c22-compliant PHYs. Because these
      devices do not have an MDIO bus, we cannot use the existing helpers.
      Refactor the existing helpers to allow supplying the values for c22
      registers directly, instead of using MDIO to access them. Only get_state
      and set_advertisement are converted, since they contain the most complex
      logic. Because set_advertisement is never actually used outside
      phylink_mii_c22_pcs_config, move the MDIO-writing part into that
      function. Because some modes do not need the advertisement register set
      at all, we use -EINVAL for this purpose.
      
      Additionally, a new function phylink_pcs_enable_an is provided to
      determine whether to enable autonegotiation.
      Signed-off-by: NSean Anderson <sean.anderson@seco.com>
      Reviewed-by: NRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      291dcae3