lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210814025003.2449143-9-colin.foster@in-advantage.com>
Date:   Fri, 13 Aug 2021 19:50:01 -0700
From:   Colin Foster <colin.foster@...advantage.com>
To:     colin.foster@...advantage.com, andrew@...n.ch,
        vivien.didelot@...il.com, f.fainelli@...il.com, olteanv@...il.com,
        davem@...emloft.net, kuba@...nel.org, robh+dt@...nel.org,
        claudiu.manoil@....com, alexandre.belloni@...tlin.com,
        UNGLinuxDriver@...rochip.com, hkallweit1@...il.com,
        linux@...linux.org.uk
Cc:     netdev@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [RFC PATCH v3 net-next 08/10] net: mscc: ocelot: felix: add ability to enable a CPU / NPI port

For the vsc7512 ocelot SPI driver, the CPU interface port needs to be enabled,
but can't be enabled via ocelot_adjust_link since it doesn't have a phylink.
This adds a hook so the port can be manually enabled.

Signed-off-by: Colin Foster <colin.foster@...advantage.com>
---
 drivers/net/dsa/ocelot/felix.c | 5 +++++
 drivers/net/dsa/ocelot/felix.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 77644deb4a35..33c0c7bc3e58 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -492,8 +492,13 @@ static void felix_teardown_tag_8021q(struct dsa_switch *ds, int cpu)
  */
 static void felix_npi_port_init(struct ocelot *ocelot, int port)
 {
+	struct felix *felix = ocelot_to_felix(ocelot);
+
 	ocelot->npi = port;
 
+	if (felix->info->enable_npi_port)
+		felix->info->enable_npi_port(ocelot);
+
 	ocelot_write(ocelot, QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK_M |
 		     QSYS_EXT_CPU_CFG_EXT_CPU_PORT(port),
 		     QSYS_EXT_CPU_CFG);
diff --git a/drivers/net/dsa/ocelot/felix.h b/drivers/net/dsa/ocelot/felix.h
index 25f664ef4947..c872705115bc 100644
--- a/drivers/net/dsa/ocelot/felix.h
+++ b/drivers/net/dsa/ocelot/felix.h
@@ -47,6 +47,7 @@ struct felix_info {
 					u32 speed);
 	struct regmap *(*init_regmap)(struct ocelot *ocelot,
 				      struct resource *res);
+	void	(*enable_npi_port)(struct ocelot *ocelot);
 };
 
 extern const struct dsa_switch_ops felix_switch_ops;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ