1. 06 4月, 2019 1 次提交
    • R
      net: marvell: mvpp2: fix stuck in-band SGMII negotiation · a78aae93
      Russell King 提交于
      [ Upstream commit 316734fdcf70900a83065360cff11a5826919067 ]
      
      It appears that the mvpp22 can get stuck with SGMII negotiation.  The
      symptoms are that in-band negotiation never completes and the partner
      (eg, PHY) never reports SGMII link up, or if it supports negotiation
      bypass, goes into negotiation bypass mode (which will happen when the
      PHY sees that the MAC is alive but gets no response.)
      
      Triggering the PHY end of the link to re-negotiate results in the
      bypass bit clearing on the PHY, and then re-setting - indicating that
      the problem is at the mvpp22 GMAC end.
      
      Asserting the GMAC reset and de-asserting it resolves the issue.
      Arrange to assert the GMAC reset at probe time, and deassert it only
      after we have configured the GMAC for the appropriate mode.  This
      resolves the issue.
      Tested-by: NSven Auhagen <sven.auhagen@voleatech.de>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      a78aae93
  2. 10 1月, 2019 2 次提交
  3. 21 12月, 2018 2 次提交
  4. 06 10月, 2018 1 次提交
  5. 19 9月, 2018 1 次提交
  6. 17 9月, 2018 1 次提交
    • A
      net: mvpp2: let phylink manage the carrier state · 41948ccb
      Antoine Tenart 提交于
      Net drivers using phylink shouldn't mess with the link carrier
      themselves and should let phylink manage it. The mvpp2 driver wasn't
      following this best practice as the mac_config() function made calls to
      change the link carrier state. This led to wrongly reported carrier link
      state which then triggered other issues. This patch fixes this
      behaviour.
      
      But the PPv2 driver relied on this misbehaviour in two cases: for fixed
      links and when not using phylink (ACPI mode). The later was fixed by
      adding an explicit call to link_up(), which when the ACPI mode will use
      phylink should be removed.
      
      The fixed link case was relying on the mac_config() function to set the
      link up, as we found an issue in phylink_start() which assumes the
      carrier is off. If not, the link_up() function is never called. To fix
      this, a call to netif_carrier_off() is added just before phylink_start()
      so that we do not introduce a regression in the driver.
      
      Fixes: 4bb04326 ("net: mvpp2: phylink support")
      Reported-by: NRussell King <linux@armlinux.org.uk>
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41948ccb
  7. 30 8月, 2018 1 次提交
    • B
      net: mvpp2: initialize port of_node pointer · c4053ef3
      Baruch Siach 提交于
      Without a valid of_node in struct device we can't find the mvpp2 port
      device by its DT node. Specifically, this breaks
      of_find_net_device_by_node().
      
      For example, the Armada 8040 based Clearfog GT-8K uses Marvell 88E6141
      switch connected to the &cp1_eth2 port:
      
      &cp1_mdio {
      	...
      
      	switch0: switch0@4 {
      		compatible = "marvell,mv88e6085";
      		...
      
      		ports {
      			...
      
      			port@5 {
      				reg = <5>;
      				label = "cpu";
      				ethernet = <&cp1_eth2>;
      			};
      		};
      	};
      };
      
      Without this patch, dsa_register_switch() returns -EPROBE_DEFER because
      of_find_net_device_by_node() can't find the device_node of the &cp1_eth2
      device.
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NBaruch Siach <baruch@tkos.co.il>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c4053ef3
  8. 16 7月, 2018 2 次提交
    • M
      net: mvpp2: add a debugfs interface for the Header Parser · 21da57a2
      Maxime Chevallier 提交于
      Marvell PPv2 Packer Header Parser has a TCAM based filter, that is not
      trivial to configure and debug. Being able to dump TCAM entries from
      userspace can be really helpful to help development of new features
      and debug existing ones.
      
      This commit adds a basic debugfs interface for the PPv2 driver, focusing
      on TCAM related features.
      
      <mnt>/mvpp2/ --- f2000000.ethernet
                    \- f4000000.ethernet --- parser --- 000 ...
                                          |          \- 001
                                          |          \- ...
                                          |          \- 255 --- ai
                                          |                  \- header_data
                                          |                  \- lookup_id
                                          |                  \- sram
                                          |                  \- valid
                                          \- eth1 ...
                                          \- eth2 --- mac_filter
                                                   \- parser_entries
                                                   \- vid_filter
      
      There's one directory per PPv2 instance, named after pdev->name to make
      sure names are uniques. In each of these directories, there's :
      
       - one directory per interface on the controller, each containing :
      
         - "mac_filter", which lists all filtered addresses for this port
           (based on TCAM, not on the kernel's uc / mc lists)
      
         - "parser_entries", which lists the indices of all valid TCAM
            entries that have this port in their port map
      
         - "vid_filter", which lists the vids allowed on this port, based on
           TCAM
      
       - one "parser" directory (the parser is common to all ports), containing :
      
         - one directory per TCAM entry (256 of them, from 0 to 255), each
           containing :
      
           - "ai" : Contains the 1 byte Additional Info field from TCAM, and
      
           - "header_data" : Contains the 8 bytes Header Data extracted from
             the packet
      
           - "lookup_id" : Contains the 4 bits LU_ID
      
           - "sram" : contains the raw SRAM data, which is the result of the TCAM
      		lookup. This readonly at the moment.
      
           - "valid" : Indicates if the entry is valid of not.
      
      All entries are read-only, and everything is output in hex form.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      21da57a2
    • A
      net: mvpp2: switch to SPDX identifiers · f1e37e31
      Antoine Tenart 提交于
      Use the appropriate SPDX license identifiers and drop the license text.
      This patch is only cosmetic.
      Signed-off-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f1e37e31
  9. 13 7月, 2018 8 次提交
  10. 30 6月, 2018 2 次提交
  11. 04 6月, 2018 1 次提交
  12. 01 6月, 2018 1 次提交
    • M
      net: mvpp2: Split the PPv2 driver to a dedicated directory · db9d7d36
      Maxime Chevallier 提交于
      As the mvpp2 driver is growing, move this driver to a dedicated
      directory and split it into several files.
      
      Since this driver has a lot of register defines and structure
      definitions, it can benefit from having all of this into a dedicated
      header file, named mvpp2.h.
      
      A good chunk of the mvpp2 code is dedicated to Header Parser handling, so
      we introduce mvpp2_prs.h where all Header Parser definitions are located,
      and mvpp2_prs.c containing the related code.
      
      In the same way, mvpp2_cls.h and mvpp2_cls.c are created to contain
      Classifier and RSS related code.
      
      The former 'mvpp2.c' file is renamed 'mvpp2_main.c' so that we can keep
      the driver binary named 'mvpp2'.
      
      This commit is only about spliting the driver into multiple files and
      doesn't introduce any new function, feature or fix besides removing
      'static' keywords when needed.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Tested-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db9d7d36
  13. 20 5月, 2018 1 次提交
  14. 19 5月, 2018 1 次提交
  15. 18 5月, 2018 7 次提交
  16. 27 4月, 2018 2 次提交
  17. 20 4月, 2018 1 次提交
  18. 16 4月, 2018 1 次提交
    • M
      net: mvpp2: Fix TCAM filter reserved range · 982e0500
      Maxime Chevallier 提交于
      Marvell's PPv2 controller has a Packet Header parser, which uses a
      fixed-size TCAM array of filter entries.
      
      The mvpp2 driver reserves some ranges among the 256 TCAM entries to
      perform MAC and VID filtering. The rest of the TCAM ids are freely usable
      for other features, such as IPv4 proto matching.
      
      This commit fixes the MVPP2_PE_LAST_FREE_TID define that sets the end of
      the "free range", which included the MAC range. This could therefore allow
      some other features to use entries dedicated to MAC filtering,
      lowering the number of unicast/multicast addresses that could be allowed
      before switching to promiscuous mode.
      
      Fixes: 10fea26c ("net: mvpp2: Add support for unicast filtering")
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      982e0500
  19. 06 4月, 2018 1 次提交
  20. 28 3月, 2018 1 次提交
  21. 27 3月, 2018 2 次提交
    • M
      net: mvpp2: Don't use dynamic allocs for local variables · 0c6d9b44
      Maxime Chevallier 提交于
      Some helper functions that search for given entries in the TCAM filter
      on PPv2 controller make use of dynamically alloced temporary variables,
      allocated with GFP_KERNEL. These functions can be called in atomic
      context, and dynamic alloc is not really needed in these cases anyways.
      
      This commit gets rid of dynamic allocs and use stack allocation in the
      following functions, and where they're used :
       - mvpp2_prs_flow_find
       - mvpp2_prs_vlan_find
       - mvpp2_prs_double_vlan_find
       - mvpp2_prs_mac_da_range_find
      
      For all these functions, instead of returning an temporary object
      representing the TCAM entry, we simply return the TCAM id that matches
      the requested entry.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c6d9b44
    • M
      net: mvpp2: Make mvpp2_prs_hw_read a parser entry init function · 47e0e14e
      Maxime Chevallier 提交于
      The mvpp2_prs_hw_read function uses the 'index' field of the struct
      mvpp2_prs_entry to initialize the rest of the fields. This makes it
      unclear from a caller's perspective, who needs to manipulate a struct
      that is not entirely initialized.
      
      This commit makes it an init function for prs_entry, by passing it the
      index as a parameter. The function now zeroes the entry, and sets the
      index field before doing all other init from HW.
      
      The function is renamed 'mvpp2_prs_init_from_hw' to make that clear.
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      47e0e14e