1. 24 8月, 2022 1 次提交
  2. 23 8月, 2022 7 次提交
    • M
      net: ipvtap - add __init/__exit annotations to module init/exit funcs · 4b2e3a17
      Maciej Żenczykowski 提交于
      Looks to have been left out in an oversight.
      
      Cc: Mahesh Bandewar <maheshb@google.com>
      Cc: Sainath Grandhi <sainath.grandhi@intel.com>
      Fixes: 235a9d89 ('ipvtap: IP-VLAN based tap driver')
      Signed-off-by: NMaciej Żenczykowski <maze@google.com>
      Link: https://lore.kernel.org/r/20220821130808.12143-1-zenczykowski@gmail.comSigned-off-by: NPaolo Abeni <pabeni@redhat.com>
      4b2e3a17
    • J
      bonding: 3ad: make ad_ticks_per_sec a const · f2e44dff
      Jonathan Toppins 提交于
      The value is only ever set once in bond_3ad_initialize and only ever
      read otherwise. There seems to be no reason to set the variable via
      bond_3ad_initialize when setting the global variable will do. Change
      ad_ticks_per_sec to a const to enforce its read-only usage.
      Signed-off-by: NJonathan Toppins <jtoppins@redhat.com>
      Acked-by: NJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      f2e44dff
    • J
      bonding: 802.3ad: fix no transmission of LACPDUs · d745b506
      Jonathan Toppins 提交于
      This is caused by the global variable ad_ticks_per_sec being zero as
      demonstrated by the reproducer script discussed below. This causes
      all timer values in __ad_timer_to_ticks to be zero, resulting
      in the periodic timer to never fire.
      
      To reproduce:
      Run the script in
      `tools/testing/selftests/drivers/net/bonding/bond-break-lacpdu-tx.sh` which
      puts bonding into a state where it never transmits LACPDUs.
      
      line 44: ip link add fbond type bond mode 4 miimon 200 \
                  xmit_hash_policy 1 ad_actor_sys_prio 65535 lacp_rate fast
      setting bond param: ad_actor_sys_prio
      given:
          params.ad_actor_system = 0
      call stack:
          bond_option_ad_actor_sys_prio()
          -> bond_3ad_update_ad_actor_settings()
             -> set ad.system.sys_priority = bond->params.ad_actor_sys_prio
             -> ad.system.sys_mac_addr = bond->dev->dev_addr; because
                  params.ad_actor_system == 0
      results:
           ad.system.sys_mac_addr = bond->dev->dev_addr
      
      line 48: ip link set fbond address 52:54:00:3B:7C:A6
      setting bond MAC addr
      call stack:
          bond->dev->dev_addr = new_mac
      
      line 52: ip link set fbond type bond ad_actor_sys_prio 65535
      setting bond param: ad_actor_sys_prio
      given:
          params.ad_actor_system = 0
      call stack:
          bond_option_ad_actor_sys_prio()
          -> bond_3ad_update_ad_actor_settings()
             -> set ad.system.sys_priority = bond->params.ad_actor_sys_prio
             -> ad.system.sys_mac_addr = bond->dev->dev_addr; because
                  params.ad_actor_system == 0
      results:
           ad.system.sys_mac_addr = bond->dev->dev_addr
      
      line 60: ip link set veth1-bond down master fbond
      given:
          params.ad_actor_system = 0
          params.mode = BOND_MODE_8023AD
          ad.system.sys_mac_addr == bond->dev->dev_addr
      call stack:
          bond_enslave
          -> bond_3ad_initialize(); because first slave
             -> if ad.system.sys_mac_addr != bond->dev->dev_addr
                return
      results:
           Nothing is run in bond_3ad_initialize() because dev_addr equals
           sys_mac_addr leaving the global ad_ticks_per_sec zero as it is
           never initialized anywhere else.
      
      The if check around the contents of bond_3ad_initialize() is no longer
      needed due to commit 5ee14e6d ("bonding: 3ad: apply ad_actor settings
      changes immediately") which sets ad.system.sys_mac_addr if any one of
      the bonding parameters whos set function calls
      bond_3ad_update_ad_actor_settings(). This is because if
      ad.system.sys_mac_addr is zero it will be set to the current bond mac
      address, this causes the if check to never be true.
      
      Fixes: 5ee14e6d ("bonding: 3ad: apply ad_actor settings changes immediately")
      Signed-off-by: NJonathan Toppins <jtoppins@redhat.com>
      Acked-by: NJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      d745b506
    • S
      net: moxa: get rid of asymmetry in DMA mapping/unmapping · 0ee7828d
      Sergei Antonov 提交于
      Since priv->rx_mapping[i] is maped in moxart_mac_open(), we
      should unmap it from moxart_mac_stop(). Fixes 2 warnings.
      
      1. During error unwinding in moxart_mac_probe(): "goto init_fail;",
      then moxart_mac_free_memory() calls dma_unmap_single() with
      priv->rx_mapping[i] pointers zeroed.
      
      WARNING: CPU: 0 PID: 1 at kernel/dma/debug.c:963 check_unmap+0x704/0x980
      DMA-API: moxart-ethernet 92000000.mac: device driver tries to free DMA memory it has not allocated [device address=0x0000000000000000] [size=1600 bytes]
      CPU: 0 PID: 1 Comm: swapper Not tainted 5.19.0+ #60
      Hardware name: Generic DT based system
       unwind_backtrace from show_stack+0x10/0x14
       show_stack from dump_stack_lvl+0x34/0x44
       dump_stack_lvl from __warn+0xbc/0x1f0
       __warn from warn_slowpath_fmt+0x94/0xc8
       warn_slowpath_fmt from check_unmap+0x704/0x980
       check_unmap from debug_dma_unmap_page+0x8c/0x9c
       debug_dma_unmap_page from moxart_mac_free_memory+0x3c/0xa8
       moxart_mac_free_memory from moxart_mac_probe+0x190/0x218
       moxart_mac_probe from platform_probe+0x48/0x88
       platform_probe from really_probe+0xc0/0x2e4
      
      2. After commands:
       ip link set dev eth0 down
       ip link set dev eth0 up
      
      WARNING: CPU: 0 PID: 55 at kernel/dma/debug.c:570 add_dma_entry+0x204/0x2ec
      DMA-API: moxart-ethernet 92000000.mac: cacheline tracking EEXIST, overlapping mappings aren't supported
      CPU: 0 PID: 55 Comm: ip Not tainted 5.19.0+ #57
      Hardware name: Generic DT based system
       unwind_backtrace from show_stack+0x10/0x14
       show_stack from dump_stack_lvl+0x34/0x44
       dump_stack_lvl from __warn+0xbc/0x1f0
       __warn from warn_slowpath_fmt+0x94/0xc8
       warn_slowpath_fmt from add_dma_entry+0x204/0x2ec
       add_dma_entry from dma_map_page_attrs+0x110/0x328
       dma_map_page_attrs from moxart_mac_open+0x134/0x320
       moxart_mac_open from __dev_open+0x11c/0x1ec
       __dev_open from __dev_change_flags+0x194/0x22c
       __dev_change_flags from dev_change_flags+0x14/0x44
       dev_change_flags from devinet_ioctl+0x6d4/0x93c
       devinet_ioctl from inet_ioctl+0x1ac/0x25c
      
      v1 -> v2:
      Extraneous change removed.
      
      Fixes: 6c821bd9 ("net: Add MOXA ART SoCs ethernet driver")
      Signed-off-by: NSergei Antonov <saproj@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Link: https://lore.kernel.org/r/20220819110519.1230877-1-saproj@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      0ee7828d
    • X
      net: phy: Don't WARN for PHY_READY state in mdio_bus_phy_resume() · 6dbe852c
      Xiaolei Wang 提交于
      For some MAC drivers, they set the mac_managed_pm to true in its
      ->ndo_open() callback. So before the mac_managed_pm is set to true,
      we still want to leverage the mdio_bus_phy_suspend()/resume() for
      the phy device suspend and resume. In this case, the phy device is
      in PHY_READY, and we shouldn't warn about this. It also seems that
      the check of mac_managed_pm in WARN_ON is redundant since we already
      check this in the entry of mdio_bus_phy_resume(), so drop it.
      
      Fixes: 744d23c7 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")
      Signed-off-by: NXiaolei Wang <xiaolei.wang@windriver.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Link: https://lore.kernel.org/r/20220819082451.1992102-1-xiaolei.wang@windriver.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      6dbe852c
    • A
      net: ipa: don't assume SMEM is page-aligned · b8d43803
      Alex Elder 提交于
      In ipa_smem_init(), a Qualcomm SMEM region is allocated (if needed)
      and then its virtual address is fetched using qcom_smem_get().  The
      physical address associated with that region is also fetched.
      
      The physical address is adjusted so that it is page-aligned, and an
      attempt is made to update the size of the region to compensate for
      any non-zero adjustment.
      
      But that adjustment isn't done properly.  The physical address is
      aligned twice, and as a result the size is never actually adjusted.
      
      Fix this by *not* aligning the "addr" local variable, and instead
      making the "phys" local variable be the adjusted "addr" value.
      
      Fixes: a0036bb4 ("net: ipa: define SMEM memory region for IPA")
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Link: https://lore.kernel.org/r/20220818134206.567618-1-elder@linaro.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      b8d43803
    • V
      net: dsa: microchip: keep compatibility with device tree blobs with no phy-mode · 5fbb08eb
      Vladimir Oltean 提交于
      DSA has multiple ways of specifying a MAC connection to an internal PHY.
      One requires a DT description like this:
      
      	port@0 {
      		reg = <0>;
      		phy-handle = <&internal_phy>;
      		phy-mode = "internal";
      	};
      
      (which is IMO the recommended approach, as it is the clearest
      description)
      
      but it is also possible to leave the specification as just:
      
      	port@0 {
      		reg = <0>;
      	}
      
      and if the driver implements ds->ops->phy_read and ds->ops->phy_write,
      the DSA framework "knows" it should create a ds->slave_mii_bus, and it
      should connect to a non-OF-based internal PHY on this MDIO bus, at an
      MDIO address equal to the port address.
      
      There is also an intermediary way of describing things:
      
      	port@0 {
      		reg = <0>;
      		phy-handle = <&internal_phy>;
      	};
      
      In case 2, DSA calls phylink_connect_phy() and in case 3, it calls
      phylink_of_phy_connect(). In both cases, phylink_create() has been
      called with a phy_interface_t of PHY_INTERFACE_MODE_NA, and in both
      cases, PHY_INTERFACE_MODE_NA is translated into phy->interface.
      
      It is important to note that phy_device_create() initializes
      dev->interface = PHY_INTERFACE_MODE_GMII, and so, when we use
      phylink_create(PHY_INTERFACE_MODE_NA), no one will override this, and we
      will end up with a PHY_INTERFACE_MODE_GMII interface inherited from the
      PHY.
      
      All this means that in order to maintain compatibility with device tree
      blobs where the phy-mode property is missing, we need to allow the
      "gmii" phy-mode and treat it as "internal".
      
      Fixes: 2c709e0b ("net: dsa: microchip: ksz8795: add phylink support")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=216320Reported-by: NCraig McQueen <craig@mcqueen.id.au>
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Reviewed-by: NAlvin Šipraga <alsi@bang-olufsen.dk>
      Tested-by: NRasmus Villemoes <rasmus.villemoes@prevas.dk>
      Link: https://lore.kernel.org/r/20220818143250.2797111-1-vladimir.oltean@nxp.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      5fbb08eb
  3. 22 8月, 2022 3 次提交
  4. 20 8月, 2022 2 次提交
  5. 19 8月, 2022 4 次提交
  6. 18 8月, 2022 17 次提交
  7. 16 8月, 2022 6 次提交