1. 03 Feb, 2017 4 commits
    • Andrey Vagin's avatar
      unix: add ioctl to open a unix socket file with O_PATH · ba94f308
      Andrey Vagin authored
      This ioctl opens a file to which a socket is bound and
      returns a file descriptor. The caller has to have CAP_NET_ADMIN
      in the socket network namespace.
      
      Currently it is impossible to get a path and a mount point
      for a socket file. socket_diag reports address, device ID and inode
      number for unix sockets. An address can contain a relative path or
      a file may be moved somewhere. And these properties say nothing about
      a mount namespace and a mount point of a socket file.
      
      With the introduced ioctl, we can get a path by reading
      /proc/self/fd/X and get mnt_id from /proc/self/fdinfo/X.
      
      In CRIU we are going to use this ioctl to dump and restore unix socket.
      
      Here is an example how it can be used:
      
      $ strace -e socket,bind,ioctl ./test /tmp/test_sock
      socket(AF_UNIX, SOCK_STREAM, 0)         = 3
      bind(3, {sa_family=AF_UNIX, sun_path="test_sock"}, 11) = 0
      ioctl(3, SIOCUNIXFILE, 0)           = 4
      ^Z
      
      $ ss -a | grep test_sock
      u_str  LISTEN     0      1      test_sock 17798                 * 0
      
      $ ls -l /proc/760/fd/{3,4}
      lrwx------ 1 root root 64 Feb  1 09:41 3 -> 'socket:[17798]'
      l--------- 1 root root 64 Feb  1 09:41 4 -> /tmp/test_sock
      
      $ cat /proc/760/fdinfo/4
      pos:	0
      flags:	012000000
      mnt_id:	40
      
      $ cat /proc/self/mountinfo | grep "^40\s"
      40 19 0:37 / /tmp rw shared:23 - tmpfs tmpfs rw
      Signed-off-by: default avatarAndrei Vagin <avagin@openvz.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba94f308
    • David S. Miller's avatar
      Merge branch 'mv88e6390-missing-phy-ID' · 2a7b6216
      David S. Miller authored
      Andrew Lunn says:
      
      ====================
      Work around missing PHY prodcut ID in mv88e6390
      
      The internal PHYs of the MV88E6390 have a Marvell OUI, but the product
      ID is zero. Work around this by trapping reads to the ID, and if it is
      zero, return the MV88E6390 family ID.
      
      v2: Move the workaround into the central mdio read function.
          Enable the temperature sensor, even though it does not work on the 6390,
          but it does on the 6341, which has the same ID problem.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a7b6216
    • Andrew Lunn's avatar
      net: phy: Marvell: Add mv88e6390 internal PHY · e4cf8a38
      Andrew Lunn authored
      The mv88e6390 Ethernet switch has internal PHYs. These PHYs don't have
      an model ID in the ID2 register. So the MDIO driver in the switch
      intercepts reads to this register, and returns the switch family ID.
      Extend the Marvell PHY driver by including this ID, and treat the PHY
      as a 88E1540.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4cf8a38
    • Andrew Lunn's avatar
      net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390 · da9f3301
      Andrew Lunn authored
      The internal PHYs of the mv88e6390 do not have a model ID. Trap any
      calls to the ID register, and if it is zero, return the ID for the
      mv88e6390. The Marvell PHY driver can then bind to this ID.
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da9f3301
  2. 02 Feb, 2017 2 commits
    • Arnd Bergmann's avatar
      xgene_enet: remove bogus forward declarations · 1f3d6209
      Arnd Bergmann authored
      The device match tables for both the xgene_enet driver and its phy driver
      have forward declarations that declare an array without a length, leading
      to a clang warning when they are not followed by an actual defitinition:
      
      drivers/net/ethernet/apm/xgene/../../../phy/mdio-xgene.h:135:34: warning: tentative array definition assumed to have one element
      drivers/net/ethernet/apm/xgene/xgene_enet_main.c:33:36: warning: tentative array definition assumed to have one element
      
      The declarations for the mdio driver are even in a header file, so they
      cause duplicate definitions of the tables for each file that includes
      them.
      
      This removes all four forward declarations and moves the actual
      definitions up a little, so they are in front of their first user. For
      the OF match tables, this means having to remove the #ifdef around them,
      and passing the actual structure into of_match_device(). This has no
      effect on the generated object code though, as the of_match_device
      function has an empty stub that does not evaluate its argument, and
      the symbol gets dropped either way.
      
      Fixes: 43b3cf66 ("drivers: net: phy: xgene: Add MDIO driver")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f3d6209
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · e2160156
      David S. Miller authored
      All merge conflicts were simple overlapping changes.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e2160156
  3. 01 Feb, 2017 26 commits
  4. 31 Jan, 2017 8 commits