1. 24 Jun, 2020 22 commits
    • Calvin Johnson's avatar
      net/fsl: acpize xgmac_mdio · 229f4bb4
      Calvin Johnson authored
      Add ACPI support for xgmac MDIO bus registration while maintaining
      the existing DT support.
      
      The function mdiobus_register() inside of_mdiobus_register(), brings
      up all the PHYs on the mdio bus and attach them to the bus.
      Signed-off-by: default avatarJeremy Linton <jeremy.linton@arm.com>
      Signed-off-by: default avatarCalvin Johnson <calvin.johnson@oss.nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      229f4bb4
    • Jeremy Linton's avatar
      net: phy: Allow mdio buses to auto-probe c45 devices · 0cc8fecf
      Jeremy Linton authored
      The mdiobus_scan logic is currently hardcoded to only
      work with c22 devices. This works fairly well in most
      cases, but its possible that a c45 device doesn't respond
      despite being a standard phy. If the parent hardware
      is capable, it makes sense to scan for c22 devices before
      falling back to c45.
      
      As we want this to reflect the capabilities of the STA,
      lets add a field to the mii_bus structure to represent
      the capability. That way devices can opt into the extended
      scanning. Existing users should continue to default to c22
      only scanning as long as they are zero'ing the structure
      before use.
      Signed-off-by: default avatarJeremy Linton <jeremy.linton@arm.com>
      Signed-off-by: default avatarCalvin Johnson <calvin.johnson@oss.nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0cc8fecf
    • David S. Miller's avatar
      Merge branch 'ethernet-dec-tulip-use-generic-power-management' · 1c59bb6b
      David S. Miller authored
      Vaibhav Gupta says:
      
      ====================
      ethernet: dec: tulip: use generic power management
      
      Linux Kernel Mentee: Remove Legacy Power Management.
      
      The purpose of this patch series is to remove legacy power management
      callbacks and invocation of PCI helper functions, from tulip ethernet drivers.
      
      With legacy PM, drivers themselves are responsible for handling the device's
      power states. And they do this with the help of PCI helper functions like
      pci_enable/disable_device(), pci_set/restore_state(), pci_set_powr_state(), etc.
      which is not recommended.
      
      In generic PM, all the required tasks are handled by PCI core and drivers need
      to perform device-specific operations only.
      
      All patches are compile-tested only.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c59bb6b
    • Vaibhav Gupta's avatar
      tulip: uli526x: use generic power management · 6c3cb945
      Vaibhav Gupta authored
      With the support of generic PM callbacks, drivers no longer need to use
      legacy .suspend() and .resume() in which they had to maintain PCI states
      changes and device's power state themselves.
      
      Legacy PM involves usage of PCI helper functions like pci_enable_wake()
      which is no longer recommended.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c3cb945
    • Vaibhav Gupta's avatar
      tulip: tulip_core: use generic power management · 77eb16e9
      Vaibhav Gupta authored
      With the support of generic PM callbacks, drivers no longer need to use
      legacy .suspend() and .resume() in which they had to maintain PCI
      states changes and device's power state themselves.
      
      Earlier, .suspend() and .resume() were invoking pci_disable_device()
      and pci_enable_device() respectively to manage the device's power state.
      driver also invoked pci_save/restore_state() and pci_set_power_sitate().
      With generic PM, it is no longer needed. The driver is expected to just
      implement driver-specific operations and leave power transitions to PCI
      core.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77eb16e9
    • Vaibhav Gupta's avatar
      tulip: de2104x: use generic power management · 8cfa989a
      Vaibhav Gupta authored
      With the support of generic PM callbacks, drivers no longer need to use
      legacy .suspend() and .resume() in which they had to maintain PCI states
      changes and device's power state themselves.
      
      Earlier, .suspend() and .resume() were invoking pci_disable_device()
      and pci_enable_device() respectively to manage the device's power state.
      With generic PM, it is no longer needed. The driver is expected to just
      implement driver-specific operations and leave power transitions to PCI
      core.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8cfa989a
    • Vaibhav Gupta's avatar
      tulip: windbond-840: use generic power management · fc9aebfb
      Vaibhav Gupta authored
      With stable support of generic PM callbacks, drivers no longer need to use
      legacy .suspend() and .resume() in which they had to maintain PCI states
      changes and device's power state themselves.
      
      Earlier, .resume() was invoking pci_enable_device(). Drivers should not
      call PCI legacy helper functions, hence, it was removed. This should not
      change the behavior of the device as this function is called by PCI core
      if somehow pm_ops is not able to bind with the driver, else, required tasks
      are managed by the core itself.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc9aebfb
    • Vaibhav Gupta's avatar
      tulip: dmfe: use generic power management · f906d0f9
      Vaibhav Gupta authored
      With legacy PM hooks, it was the responsibility of a driver to manage PCI
      states and also the device's power state. The generic approach is to let the
      PCI core handle the work.
      
      The legacy suspend() and resume() were making use of
      pci_read/write_config_dword() to enable/disable wol. Driver editing
      configuration registers of a device is not recommended. Thus replace them
      all with device_wakeup_enable/disable().
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f906d0f9
    • David S. Miller's avatar
      Merge branch 'ethernet-amd-Convert-to-generic-power-management' · 39ea5d70
      David S. Miller authored
      Vaibhav Gupta says:
      
      ====================
      ethernet: amd: Convert to generic power management
      
      Linux Kernel Mentee: Remove Legacy Power Management.
      
      The purpose of this patch series is to remove legacy power management callbacks
      from amd ethernet drivers.
      
      The callbacks performing suspend() and resume() operations are still calling
      pci_save_state(), pci_set_power_state(), etc. and handling the power management
      themselves, which is not recommended.
      
      The conversion requires the removal of the those function calls and change the
      callback definition accordingly and make use of dev_pm_ops structure.
      
      All patches are compile-tested only.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      39ea5d70
    • Vaibhav Gupta's avatar
      amd-xgbe: Convert to generic power management · c6f0fb5d
      Vaibhav Gupta authored
      Use dev_pm_ops structure to call generic suspend() and resume() callbacks.
      
      Drivers should avoid saving device register and/or change power states
      using PCI helper functions. With the generic approach, all these are handled
      by PCI core.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c6f0fb5d
    • Vaibhav Gupta's avatar
      amd8111e: Convert to generic power management · 2caf751f
      Vaibhav Gupta authored
      Drivers should not save device registers and/or change the power state of
      the device. As per the generic PM approach, these are handled by PCI core.
      
      The driver should support dev_pm_ops callbacks and bind them to pci_driver.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2caf751f
    • Vaibhav Gupta's avatar
      pcnet32: Convert to generic power management · a86688fb
      Vaibhav Gupta authored
      Remove legacy PM callbacks and use generic operations. With legacy code,
      drivers were responsible for handling PCI PM operations like
      pci_save_state(). In generic code, all these are handled by PCI core.
      
      The generic suspend() and resume() are called at the same point the legacy
      ones were called. Thus, it does not affect the normal functioning of the
      driver.
      
      Compile-tested only.
      Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a86688fb
    • Gaurav Singh's avatar
      dn_route_rcv: remove redundant dev null check · f9215d6b
      Gaurav Singh authored
      dev cannot be NULL here since its already being accessed
      before. Remove the redundant null check.
      Signed-off-by: default avatarGaurav Singh <gaurav1086@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f9215d6b
    • Gaurav Singh's avatar
      dcb_doit: remove redundant skb check · 0cc55e69
      Gaurav Singh authored
      skb cannot be NULL here since its already being accessed
      before: sock_net(skb->sk). Remove the redundant null check.
      Signed-off-by: default avatarGaurav Singh <gaurav1086@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0cc55e69
    • Gustavo A. R. Silva's avatar
      net: ipv6: Use struct_size() helper and kcalloc() · 6f393457
      Gustavo A. R. Silva authored
      Make use of the struct_size() helper instead of an open-coded version
      in order to avoid any potential type mistakes. Also, remove unnecessary
      function ipv6_rpl_srh_alloc_size() and replace kzalloc() with kcalloc(),
      which has a 2-factor argument form for multiplication.
      
      This code was detected with the help of Coccinelle and, audited and
      fixed manually.
      Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6f393457
    • Gaurav Singh's avatar
      xirc2ps_cs: remove dev null check from do_reset(). · 5777cbba
      Gaurav Singh authored
      dev cannot be NULL here since its already being accessed
      before. Remove the redundant null check.
      Signed-off-by: default avatarGaurav Singh <gaurav1086@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5777cbba
    • David S. Miller's avatar
      Merge branch 'net-address-some-sparse-warnings' · 943d0118
      David S. Miller authored
      Eric Dumazet says:
      
      ====================
      net: address some sparse warnings
      
      This series adds missing declarations and move others to
      address W=1 C=1 warnings in tcp and udp.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      943d0118
    • Eric Dumazet's avatar
      udp: move gro declarations to net/udp.h · 6db69328
      Eric Dumazet authored
      This removes following warnings :
        CC      net/ipv4/udp_offload.o
      net/ipv4/udp_offload.c:504:17: warning: no previous prototype for 'udp4_gro_receive' [-Wmissing-prototypes]
        504 | struct sk_buff *udp4_gro_receive(struct list_head *head, struct sk_buff *skb)
            |                 ^~~~~~~~~~~~~~~~
      net/ipv4/udp_offload.c:584:29: warning: no previous prototype for 'udp4_gro_complete' [-Wmissing-prototypes]
        584 | INDIRECT_CALLABLE_SCOPE int udp4_gro_complete(struct sk_buff *skb, int nhoff)
            |                             ^~~~~~~~~~~~~~~~~
      
        CHECK   net/ipv6/udp_offload.c
      net/ipv6/udp_offload.c:115:16: warning: symbol 'udp6_gro_receive' was not declared. Should it be static?
      net/ipv6/udp_offload.c:148:29: warning: symbol 'udp6_gro_complete' was not declared. Should it be static?
        CC      net/ipv6/udp_offload.o
      net/ipv6/udp_offload.c:115:17: warning: no previous prototype for 'udp6_gro_receive' [-Wmissing-prototypes]
        115 | struct sk_buff *udp6_gro_receive(struct list_head *head, struct sk_buff *skb)
            |                 ^~~~~~~~~~~~~~~~
      net/ipv6/udp_offload.c:148:29: warning: no previous prototype for 'udp6_gro_complete' [-Wmissing-prototypes]
        148 | INDIRECT_CALLABLE_SCOPE int udp6_gro_complete(struct sk_buff *skb, int nhoff)
            |                             ^~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6db69328
    • Eric Dumazet's avatar
      net: move tcp gro declarations to net/tcp.h · 5521d95e
      Eric Dumazet authored
      This patch removes following (C=1 W=1) warnings for CONFIG_RETPOLINE=y :
      
      net/ipv4/tcp_offload.c:306:16: warning: symbol 'tcp4_gro_receive' was not declared. Should it be static?
      net/ipv4/tcp_offload.c:306:17: warning: no previous prototype for 'tcp4_gro_receive' [-Wmissing-prototypes]
      net/ipv4/tcp_offload.c:319:29: warning: symbol 'tcp4_gro_complete' was not declared. Should it be static?
      net/ipv4/tcp_offload.c:319:29: warning: no previous prototype for 'tcp4_gro_complete' [-Wmissing-prototypes]
        CHECK   net/ipv6/tcpv6_offload.c
      net/ipv6/tcpv6_offload.c:16:16: warning: symbol 'tcp6_gro_receive' was not declared. Should it be static?
      net/ipv6/tcpv6_offload.c:29:29: warning: symbol 'tcp6_gro_complete' was not declared. Should it be static?
        CC      net/ipv6/tcpv6_offload.o
      net/ipv6/tcpv6_offload.c:16:17: warning: no previous prototype for 'tcp6_gro_receive' [-Wmissing-prototypes]
         16 | struct sk_buff *tcp6_gro_receive(struct list_head *head, struct sk_buff *skb)
            |                 ^~~~~~~~~~~~~~~~
      net/ipv6/tcpv6_offload.c:29:29: warning: no previous prototype for 'tcp6_gro_complete' [-Wmissing-prototypes]
         29 | INDIRECT_CALLABLE_SCOPE int tcp6_gro_complete(struct sk_buff *skb, int thoff)
            |                             ^~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5521d95e
    • Eric Dumazet's avatar
      tcp: move ipv4_specific to tcp include file · 9b9e2f25
      Eric Dumazet authored
      Declare ipv4_specific once, in tcp.h were it belongs.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9b9e2f25
    • Eric Dumazet's avatar
      tcp: move ipv6_specific declaration to remove a warning · b03d2142
      Eric Dumazet authored
      ipv6_specific should be declared in tcp include files,
      not mptcp.
      
      This removes the following warning :
        CHECK   net/ipv6/tcp_ipv6.c
      net/ipv6/tcp_ipv6.c:78:42: warning: symbol 'ipv6_specific' was not declared. Should it be static?
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b03d2142
    • Eric Dumazet's avatar
      tcp: add declarations to avoid warnings · 243600ee
      Eric Dumazet authored
      Remove these errors:
      
      net/ipv6/tcp_ipv6.c:1550:29: warning: symbol 'tcp_v6_rcv' was not declared. Should it be static?
      net/ipv6/tcp_ipv6.c:1770:30: warning: symbol 'tcp_v6_early_demux' was not declared. Should it be static?
      
      net/ipv6/tcp_ipv6.c:1550:29: warning: no previous prototype for 'tcp_v6_rcv' [-Wmissing-prototypes]
       1550 | INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb)
            |                             ^~~~~~~~~~
      net/ipv6/tcp_ipv6.c:1770:30: warning: no previous prototype for 'tcp_v6_early_demux' [-Wmissing-prototypes]
       1770 | INDIRECT_CALLABLE_SCOPE void tcp_v6_early_demux(struct sk_buff *skb)
            |                              ^~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      243600ee
  2. 23 Jun, 2020 18 commits