1. 19 11月, 2019 7 次提交
  2. 17 11月, 2019 18 次提交
  3. 16 11月, 2019 15 次提交
    • R
      mlx5: Reject requests to enable time stamping on both edges. · ca12cf5a
      Richard Cochran 提交于
      This driver enables rising edge or falling edge, but not both, and so
      this patch validates that the request contains only one of the two
      edges.
      Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
      Reviewed-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ca12cf5a
    • R
      igb: Reject requests that fail to enable time stamping on both edges. · 5a450eb3
      Richard Cochran 提交于
      This hardware always time stamps rising and falling edges, and so this
      patch validates that the request does contains both edges.
      Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a450eb3
    • R
      dp83640: Reject requests to enable time stamping on both edges. · 9289252b
      Richard Cochran 提交于
      This driver enables rising edge or falling edge, but not both, and so
      this patch validates that the request contains only one of the two
      edges.
      Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9289252b
    • R
      mv88e6xxx: Reject requests to enable time stamping on both edges. · c019b4be
      Richard Cochran 提交于
      This driver enables rising edge or falling edge, but not both, and so
      this patch validates that the request contains only one of the two
      edges.
      Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c019b4be
    • R
      ptp: Introduce strict checking of external time stamp options. · 6138e687
      Richard Cochran 提交于
      User space may request time stamps on rising edges, falling edges, or
      both.  However, the particular mode may or may not be supported in the
      hardware or in the driver.  This patch adds a "strict" flag that tells
      drivers to ensure that the requested mode will be honored.
      Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6138e687
    • J
      renesas: reject unsupported external timestamp flags · 592025a0
      Jacob Keller 提交于
      Fix the renesas PTP support to explicitly reject any future flags that
      get added to the external timestamp request ioctl.
      
      In order to maintain currently functioning code, this patch accepts all
      three current flags. This is because the PTP_RISING_EDGE and
      PTP_FALLING_EDGE flags have unclear semantics and each driver seems to
      have interpreted them slightly differently.
      
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NRichard Cochran <richardcochran@gmail.com>
      Reviewed-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      592025a0
    • J
      mlx5: reject unsupported external timestamp flags · 2e0645a0
      Jacob Keller 提交于
      Fix the mlx5 core PTP support to explicitly reject any future flags that
      get added to the external timestamp request ioctl.
      
      In order to maintain currently functioning code, this patch accepts all
      three current flags. This is because the PTP_RISING_EDGE and
      PTP_FALLING_EDGE flags have unclear semantics and each driver seems to
      have interpreted them slightly differently.
      
      [ RC: I'm not 100% sure what this driver does, but if I'm not wrong it
            follows the dp83640:
      
        flags                                                 Meaning
        ----------------------------------------------------  --------------------------
        PTP_ENABLE_FEATURE                                    Time stamp rising edge
        PTP_ENABLE_FEATURE|PTP_RISING_EDGE                    Time stamp rising edge
        PTP_ENABLE_FEATURE|PTP_FALLING_EDGE                   Time stamp falling edge
        PTP_ENABLE_FEATURE|PTP_RISING_EDGE|PTP_FALLING_EDGE   Time stamp falling edge
      ]
      
      Cc: Feras Daoud <ferasda@mellanox.com>
      Cc: Eugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NRichard Cochran <richardcochran@gmail.com>
      Reviewed-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e0645a0
    • J
      igb: reject unsupported external timestamp flags · 6edd110b
      Jacob Keller 提交于
      Fix the igb PTP support to explicitly reject any future flags that
      get added to the external timestamp request ioctl.
      
      In order to maintain currently functioning code, this patch accepts all
      three current flags. This is because the PTP_RISING_EDGE and
      PTP_FALLING_EDGE flags have unclear semantics and each driver seems to
      have interpreted them slightly differently.
      
      This HW always time stamps both edges:
      
        flags                                                 Meaning
        ----------------------------------------------------  --------------------------
        PTP_ENABLE_FEATURE                                    Time stamp both edges
        PTP_ENABLE_FEATURE|PTP_RISING_EDGE                    Time stamp both edges
        PTP_ENABLE_FEATURE|PTP_FALLING_EDGE                   Time stamp both edges
        PTP_ENABLE_FEATURE|PTP_RISING_EDGE|PTP_FALLING_EDGE   Time stamp both edges
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6edd110b
    • J
      dp83640: reject unsupported external timestamp flags · e8e9c98d
      Jacob Keller 提交于
      Fix the dp83640 PTP support to explicitly reject any future flags that
      get added to the external timestamp request ioctl.
      
      In order to maintain currently functioning code, this patch accepts all
      three current flags. This is because the PTP_RISING_EDGE and
      PTP_FALLING_EDGE flags have unclear semantics and each driver seems to
      have interpreted them slightly differently.
      
      For the record, the semantics of this driver are:
      
        flags                                                 Meaning
        ----------------------------------------------------  --------------------------
        PTP_ENABLE_FEATURE                                    Time stamp rising edge
        PTP_ENABLE_FEATURE|PTP_RISING_EDGE                    Time stamp rising edge
        PTP_ENABLE_FEATURE|PTP_FALLING_EDGE                   Time stamp falling edge
        PTP_ENABLE_FEATURE|PTP_RISING_EDGE|PTP_FALLING_EDGE   Time stamp falling edge
      
      Cc: Stefan Sørensen <stefan.sorensen@spectralink.com>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8e9c98d
    • J
      mv88e6xxx: reject unsupported external timestamp flags · 7d9465eb
      Jacob Keller 提交于
      Fix the mv88e6xxx PTP support to explicitly reject any future flags that
      get added to the external timestamp request ioctl.
      
      In order to maintain currently functioning code, this patch accepts all
      three current flags. This is because the PTP_RISING_EDGE and
      PTP_FALLING_EDGE flags have unclear semantics and each driver seems to
      have interpreted them slightly differently.
      
      For the record, the semantics of this driver are:
      
        flags                                                 Meaning
        ----------------------------------------------------  --------------------------
        PTP_ENABLE_FEATURE                                    Time stamp falling edge
        PTP_ENABLE_FEATURE|PTP_RISING_EDGE                    Time stamp rising edge
        PTP_ENABLE_FEATURE|PTP_FALLING_EDGE                   Time stamp falling edge
        PTP_ENABLE_FEATURE|PTP_RISING_EDGE|PTP_FALLING_EDGE   Time stamp rising edge
      
      Cc: Brandon Streiff <brandon.streiff@ni.com>
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Reviewed-by: NRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7d9465eb
    • J
      net: reject PTP periodic output requests with unsupported flags · 7f9048f1
      Jacob Keller 提交于
      Commit 823eb2a3 ("PTP: add support for one-shot output") introduced
      a new flag for the PTP periodic output request ioctl. This flag is not
      currently supported by any driver.
      
      Fix all drivers which implement the periodic output request ioctl to
      explicitly reject any request with flags they do not understand. This
      ensures that the driver does not accidentally misinterpret the
      PTP_PEROUT_ONE_SHOT flag, or any new flag introduced in the future.
      
      This is important for forward compatibility: if a new flag is
      introduced, the driver should reject requests to enable the flag until
      the driver has actually been modified to support the flag in question.
      
      Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Christopher Hall <christopher.s.hall@intel.com>
      Signed-off-by: NJacob Keller <jacob.e.keller@intel.com>
      Signed-off-by: NRichard Cochran <richardcochran@gmail.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Reviewed-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7f9048f1
    • P
      tun: fix data-race in gro_normal_list() · c39e342a
      Petar Penkov 提交于
      There is a race in the TUN driver between napi_busy_loop and
      napi_gro_frags. This commit resolves the race by adding the NAPI struct
      via netif_tx_napi_add, instead of netif_napi_add, which disables polling
      for the NAPI struct.
      
      KCSAN reported:
      BUG: KCSAN: data-race in gro_normal_list.part.0 / napi_busy_loop
      
      write to 0xffff8880b5d474b0 of 4 bytes by task 11205 on cpu 0:
       gro_normal_list.part.0+0x77/0xb0 net/core/dev.c:5682
       gro_normal_list net/core/dev.c:5678 [inline]
       gro_normal_one net/core/dev.c:5692 [inline]
       napi_frags_finish net/core/dev.c:5705 [inline]
       napi_gro_frags+0x625/0x770 net/core/dev.c:5778
       tun_get_user+0x2150/0x26a0 drivers/net/tun.c:1976
       tun_chr_write_iter+0x79/0xd0 drivers/net/tun.c:2022
       call_write_iter include/linux/fs.h:1895 [inline]
       do_iter_readv_writev+0x487/0x5b0 fs/read_write.c:693
       do_iter_write fs/read_write.c:970 [inline]
       do_iter_write+0x13b/0x3c0 fs/read_write.c:951
       vfs_writev+0x118/0x1c0 fs/read_write.c:1015
       do_writev+0xe3/0x250 fs/read_write.c:1058
       __do_sys_writev fs/read_write.c:1131 [inline]
       __se_sys_writev fs/read_write.c:1128 [inline]
       __x64_sys_writev+0x4e/0x60 fs/read_write.c:1128
       do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      read to 0xffff8880b5d474b0 of 4 bytes by task 11168 on cpu 1:
       gro_normal_list net/core/dev.c:5678 [inline]
       napi_busy_loop+0xda/0x4f0 net/core/dev.c:6126
       sk_busy_loop include/net/busy_poll.h:108 [inline]
       __skb_recv_udp+0x4ad/0x560 net/ipv4/udp.c:1689
       udpv6_recvmsg+0x29e/0xe90 net/ipv6/udp.c:288
       inet6_recvmsg+0xbb/0x240 net/ipv6/af_inet6.c:592
       sock_recvmsg_nosec net/socket.c:871 [inline]
       sock_recvmsg net/socket.c:889 [inline]
       sock_recvmsg+0x92/0xb0 net/socket.c:885
       sock_read_iter+0x15f/0x1e0 net/socket.c:967
       call_read_iter include/linux/fs.h:1889 [inline]
       new_sync_read+0x389/0x4f0 fs/read_write.c:414
       __vfs_read+0xb1/0xc0 fs/read_write.c:427
       vfs_read fs/read_write.c:461 [inline]
       vfs_read+0x143/0x2c0 fs/read_write.c:446
       ksys_read+0xd5/0x1b0 fs/read_write.c:587
       __do_sys_read fs/read_write.c:597 [inline]
       __se_sys_read fs/read_write.c:595 [inline]
       __x64_sys_read+0x4c/0x60 fs/read_write.c:595
       do_syscall_64+0xcc/0x370 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Reported by Kernel Concurrency Sanitizer on:
      CPU: 1 PID: 11168 Comm: syz-executor.0 Not tainted 5.4.0-rc6+ #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
      
      Fixes: 94317099 ("tun: enable NAPI for TUN/TAP driver")
      Signed-off-by: NPetar Penkov <ppenkov@google.com>
      Reported-by: Nsyzbot <syzkaller@googlegroups.com>
      Reviewed-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c39e342a
    • C
      net: ep93xx_eth: fix mismatch of request_mem_region in remove · 3df70afe
      Chuhong Yuan 提交于
      The driver calls release_resource in remove to match request_mem_region
      in probe, which is incorrect.
      Fix it by using the right one, release_mem_region.
      Signed-off-by: NChuhong Yuan <hslester96@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3df70afe
    • V
      net: dsa: ocelot: add driver for Felix switch family · 56051948
      Vladimir Oltean 提交于
      This supports an Ethernet switching core from Vitesse / Microsemi /
      Microchip (VSC9959) which is part of the Ocelot family (a brand name),
      and whose code name is Felix. The switch can be (and is) integrated on
      different SoCs as a PCIe endpoint device.
      
      The functionality is provided by the core of the Ocelot switch driver
      (drivers/net/ethernet/mscc). In this regard, the current driver is an
      instance of Microsemi's Ocelot core driver, with a DSA front-end. It
      inherits its name from VSC9959's code name, to distinguish itself from
      the switchdev ocelot driver.
      
      The patch adds the logic for probing a PCI device and defines the
      register map for the VSC9959 switch core, since it has some differences
      in register addresses and bitfield mappings compared to the other Ocelot
      switches (VSC7511, VSC7512, VSC7513, VSC7514).
      
      The Felix driver declares the register map as part of the "instance
      table". Currently the VSC9959 inside NXP LS1028A is the only instance,
      but presumably it can support other switches in the Ocelot family, when
      used in DSA mode (Linux running on the external CPU, and not on the
      embedded MIPS).
      
      In a few cases, some h/w operations have to be done differently on
      VSC9959 due to missing bitfields.  This is the case for the switch core
      reset and init.  Because for this operation Ocelot uses some bits that
      are not present on Felix, the latter has to use a register from the
      global registers block (GCB) instead.
      
      Although it is a PCI driver, it relies on DT bindings for compatibility
      with DSA (CPU port link, PHY library). It does not have any custom
      device tree bindings, since we would like to minimize its dependency on
      device tree though.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      56051948
    • V
      net: mscc: ocelot: publish ocelot_sys.h to include/soc/mscc · a030dfe1
      Vladimir Oltean 提交于
      The Felix DSA driver needs to write to SYS_RAM_INIT_RAM_INIT for its own
      chip initialization process.
      
      Also update the MAINTAINERS file such that the headers exported by the
      ocelot driver are under the same maintainers' umbrella as the driver
      itself.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a030dfe1