1. 18 7月, 2020 9 次提交
  2. 17 7月, 2020 10 次提交
    • J
      Merge branch 'net-sched-do-not-drop-root-lock-in-tcf_qevent_handle' · 4291dc1a
      Jakub Kicinski 提交于
      Petr Machata says:
      
      ====================
      net: sched: Do not drop root lock in tcf_qevent_handle()
      
      Mirred currently does not mix well with blocks executed after the qdisc
      root lock is taken. This includes classification blocks (such as in PRIO,
      ETS, DRR qdiscs) and qevents. The locking caused by the packet mirrored by
      mirred can cause deadlocks: either when the thread of execution attempts to
      take the lock a second time, or when two threads end up waiting on each
      other's locks.
      
      The qevent patchset attempted to not introduce further badness of this
      sort, and dropped the lock before executing the qevent block. However this
      lead to too little locking and races between qdisc configuration and packet
      enqueue in the RED qdisc.
      
      Before the deadlock issues are solved in a way that can be applied across
      many qdiscs reasonably easily, do for qevents what is done for the
      classification blocks and just keep holding the root lock.
      
      That is done in patch #1. Patch #2 then drops the now unnecessary root_lock
      argument from Qdisc_ops.enqueue.
      ====================
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      4291dc1a
    • P
      Revert "net: sched: Pass root lock to Qdisc_ops.enqueue" · ac5c66f2
      Petr Machata 提交于
      This reverts commit aebe4426.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      ac5c66f2
    • P
      net: sched: Do not drop root lock in tcf_qevent_handle() · 55f656cd
      Petr Machata 提交于
      Mirred currently does not mix well with blocks executed after the qdisc
      root lock is taken. This includes classification blocks (such as in PRIO,
      ETS, DRR qdiscs) and qevents. The locking caused by the packet mirrored by
      mirred can cause deadlocks: either when the thread of execution attempts to
      take the lock a second time, or when two threads end up waiting on each
      other's locks.
      
      The qevent patchset attempted to not introduce further badness of this
      sort, and dropped the lock before executing the qevent block. However this
      lead to too little locking and races between qdisc configuration and packet
      enqueue in the RED qdisc.
      
      Before the deadlock issues are solved in a way that can be applied across
      many qdiscs reasonably easily, do for qevents what is done for the
      classification blocks and just keep holding the root lock.
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      55f656cd
    • V
      net: mscc: ocelot: rethink Kconfig dependencies again · 89e35f66
      Vladimir Oltean 提交于
      Having the users of MSCC_OCELOT_SWITCH_LIB depend on REGMAP_MMIO was a
      bad idea, since that symbol is not user-selectable. So we should have
      kept a 'select REGMAP_MMIO'.
      
      When we do that, we run into 2 more problems:
      
      - By depending on GENERIC_PHY, we are causing a recursive dependency.
        But it looks like GENERIC_PHY has no other dependencies, and other
        drivers select it, so we can select it too:
      
      drivers/of/Kconfig:69:error: recursive dependency detected!
      drivers/of/Kconfig:69:  symbol OF_IRQ depends on IRQ_DOMAIN
      kernel/irq/Kconfig:68:  symbol IRQ_DOMAIN is selected by REGMAP
      drivers/base/regmap/Kconfig:7:  symbol REGMAP default is visible depending on REGMAP_MMIO
      drivers/base/regmap/Kconfig:39: symbol REGMAP_MMIO is selected by MSCC_OCELOT_SWITCH_LIB
      drivers/net/ethernet/mscc/Kconfig:15:   symbol MSCC_OCELOT_SWITCH_LIB is selected by MSCC_OCELOT_SWITCH
      drivers/net/ethernet/mscc/Kconfig:22:   symbol MSCC_OCELOT_SWITCH depends on GENERIC_PHY
      drivers/phy/Kconfig:8:  symbol GENERIC_PHY is selected by PHY_BCM_NS_USB3
      drivers/phy/broadcom/Kconfig:41:        symbol PHY_BCM_NS_USB3 depends on MDIO_BUS
      drivers/net/phy/Kconfig:13:     symbol MDIO_BUS depends on MDIO_DEVICE
      drivers/net/phy/Kconfig:6:      symbol MDIO_DEVICE is selected by PHYLIB
      drivers/net/phy/Kconfig:254:    symbol PHYLIB is selected by ARC_EMAC_CORE
      drivers/net/ethernet/arc/Kconfig:19:    symbol ARC_EMAC_CORE is selected by ARC_EMAC
      drivers/net/ethernet/arc/Kconfig:25:    symbol ARC_EMAC depends on OF_IRQ
      
      - By depending on PHYLIB, we are causing a recursive dependency. PHYLIB
        only has a single dependency, "depends on NETDEVICES", which we are
        already depending on, so we can again hack our way into conformance by
        turning the PHYLIB dependency into a select.
      
      drivers/of/Kconfig:69:error: recursive dependency detected!
      drivers/of/Kconfig:69:  symbol OF_IRQ depends on IRQ_DOMAIN
      kernel/irq/Kconfig:68:  symbol IRQ_DOMAIN is selected by REGMAP
      drivers/base/regmap/Kconfig:7:  symbol REGMAP default is visible depending on REGMAP_MMIO
      drivers/base/regmap/Kconfig:39: symbol REGMAP_MMIO is selected by MSCC_OCELOT_SWITCH_LIB
      drivers/net/ethernet/mscc/Kconfig:15:   symbol MSCC_OCELOT_SWITCH_LIB is selected by MSCC_OCELOT_SWITCH
      drivers/net/ethernet/mscc/Kconfig:22:   symbol MSCC_OCELOT_SWITCH depends on PHYLIB
      drivers/net/phy/Kconfig:254:    symbol PHYLIB is selected by ARC_EMAC_CORE
      drivers/net/ethernet/arc/Kconfig:19:    symbol ARC_EMAC_CORE is selected by ARC_EMAC
      drivers/net/ethernet/arc/Kconfig:25:    symbol ARC_EMAC depends on OF_IRQ
      
      Fixes: f4d0323b ("net: mscc: ocelot: convert MSCC_OCELOT_SWITCH into a library")
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      89e35f66
    • J
      af_packet: TPACKET_V3: replace busy-wait loop · 632ca50f
      John Ogness 提交于
      A busy-wait loop is used to implement waiting for bits to be copied
      from the skb to the kernel buffer before retiring a block. This is
      a problem on PREEMPT_RT because the copying task could be preempted
      by the busy-waiting task and thus live lock in the busy-wait loop.
      
      Replace the busy-wait logic with an rwlock_t. This provides lockdep
      coverage and makes the code RT ready.
      Signed-off-by: NJohn Ogness <john.ogness@linutronix.de>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      632ca50f
    • J
      Merge branch 'net-fec-a-few-improvements' · 999cf8ae
      Jakub Kicinski 提交于
      Sergey Organov says:
      
      ====================
      net: fec: a few improvements
      
      This is a collection of simple improvements that reduce and/or
      simplify code. They got developed out of attempt to use DP83640 PTP
      PHY connected to built-in FEC (that has its own PTP support) of the
      iMX 6SX micro-controller. The primary bug-fix was now submitted
      separately, and this is the rest of the changes.
      
      NOTE: the patches are developed and tested on 4.9.146, and rebased on
      top of recent 'net-next/master', where, besides visual inspection, I
      only tested that they do compile.
      ====================
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      999cf8ae
    • S
      net: fec: replace snprintf() with strlcpy() in fec_ptp_init() · 31bb1a56
      Sergey Organov 提交于
      No need to use snprintf() on a constant string, nor using magic
      constant in the fixed code was a good idea.
      Signed-off-by: NSergey Organov <sorganov@gmail.com>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      31bb1a56
    • S
      net: fec: get rid of redundant code in fec_ptp_set() · 2b803088
      Sergey Organov 提交于
      Code of the form "if(x) x = 0" replaced with "x = 0".
      
      Code of the form "if(x == a) x = a" removed.
      Signed-off-by: NSergey Organov <sorganov@gmail.com>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      2b803088
    • S
      net: fec: initialize clock with 0 rather than current kernel time · 19956034
      Sergey Organov 提交于
      Initializing with 0 makes it much easier to identify time stamps from
      otherwise uninitialized clock.
      
      Initialization of PTP clock with current kernel time makes little sense as
      PTP time scale differs from UTC time scale that kernel time represents.
      It only leads to confusion when no actual PTP initialization happens, as
      these time scales differ in a small integer number of seconds (37 at the
      time of writing.)
      Signed-off-by: NSergey Organov <sorganov@gmail.com>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      19956034
    • S
      net: fec: enable to use PPS feature without time stamping · e53a57e5
      Sergey Organov 提交于
      PPS feature could be useful even when hardware time stamping
      of network packets is not in use, so remove offending check
      for this condition from fec_ptp_enable_pps().
      Signed-off-by: NSergey Organov <sorganov@gmail.com>
      Acked-by: NFugang Duan <fugang.duan@nxp.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      e53a57e5
  3. 16 7月, 2020 21 次提交