Skip to contentSkip to conversation

patches for FPGA

PATCH New Alan Tull 1 participant 6 messages Aug 2, 2017

Subsystems (2)
lore
Share & tools
lore

Alan Tull

author
#0 lore raw

cover patches for FPGA

Hi Greg,

Please take these patches for FPGA that have been reviewed on the mailing lists. All minor things including two bug fixes, an update to MAINTAINERS, and a couple other minor patches.

Thanks,
Alan

Gustavo A. R. Silva (1):
fpga: altera-hps2fpga: add NULL check on of_match_device() return
value

Ian Abbott (1):
fpga: altera-hps2fpga: fix multiple init of l3_remap_lock

Moritz Fischer (1):
MAINTAINERS: fpga: Update email and add patchwork URL

Philipp Zabel (1):
ARM: socfpga: explicitly request exclusive reset control

Rob Herring (1):
fpga: Convert to using %pOF instead of full_name

 MAINTAINERS                    |  3 ++-
 drivers/fpga/altera-hps2fpga.c | 12 ++++++++----
 drivers/fpga/fpga-region.c     |  4 ++--
 3 files changed, 12 insertions(+), 7 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/5 fpga: Convert to using %pOF instead of full_name

From: Rob Herring <[email protected]>

Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node.

---
 drivers/fpga/fpga-region.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/fpga/fpga-region.c +2 -2
index 3b6b2f4..d9ab7c7 100644
@@ -319,8 +319,8 @@ static int child_regions_with_firmware(struct device_node *overlay)
 	of_node_put(child_region);
 
 	if (ret)
-		pr_err("firmware-name not allowed in child FPGA region: %s",
-		       child_region->full_name);
+		pr_err("firmware-name not allowed in child FPGA region: %pOF",
+		       child_region);
 
 	return ret;
 }
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/5 ARM: socfpga: explicitly request exclusive reset control

In reply to Alan Tull

From: Philipp Zabel <[email protected]>

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed.

No functional changes.

---
 drivers/fpga/altera-hps2fpga.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/fpga/altera-hps2fpga.c +2 -1
index 3066b80..a18ff43 100644
@@ -145,7 +145,8 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev)
 	of_id = of_match_device(altera_fpga_of_match, dev);
 	priv = (struct altera_hps2fpga_data *)of_id->data;
 
-	priv->bridge_reset = of_reset_control_get_by_index(dev->of_node, 0);
+	priv->bridge_reset = of_reset_control_get_exclusive_by_index(dev->of_node,
+								     0);
 	if (IS_ERR(priv->bridge_reset)) {
 		dev_err(dev, "Could not get %s reset control\n", priv->name);
 		return PTR_ERR(priv->bridge_reset);
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/5 fpga: altera-hps2fpga: add NULL check on of_match_device() return value

In reply to Alan Tull

From: "Gustavo A. R. Silva" <[email protected]>

Check return value from call to of_match_device() in order to prevent a NULL pointer dereference.

In case of NULL print error message and return -ENODEV

---
 drivers/fpga/altera-hps2fpga.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/fpga/altera-hps2fpga.c +5 -0
index a18ff43..e6c948b 100644
@@ -143,6 +143,11 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev)
 	int ret;
 
 	of_id = of_match_device(altera_fpga_of_match, dev);
+	if (!of_id) {
+		dev_err(dev, "failed to match device\n");
+		return -ENODEV;
+	}
+
 	priv = (struct altera_hps2fpga_data *)of_id->data;
 
 	priv->bridge_reset = of_reset_control_get_exclusive_by_index(dev->of_node,
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 4/5 fpga: altera-hps2fpga: fix multiple init of l3_remap_lock

In reply to Alan Tull

From: Ian Abbott <[email protected]>

The global spinlock l3_remap_lock is reinitialized every time the "probe" function alt_fpga_bridge_probe() is called. It should only be initialized once. Use DEFINE_SPINLOCK() to initialize it statically.

Fixes e5f8efa5c8bf ("ARM: socfpga: fpga bridge driver support")
Cc <[email protected]> # 4.10+
---
 drivers/fpga/altera-hps2fpga.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/fpga/altera-hps2fpga.c +1 -3
index e6c948b..406d2f1 100644
@@ -66,7 +66,7 @@ static int alt_hps2fpga_enable_show(struct fpga_bridge *bridge)
 
 /* The L3 REMAP register is write only, so keep a cached value. */
 static unsigned int l3_remap_shadow;
-static spinlock_t l3_remap_lock;
+static DEFINE_SPINLOCK(l3_remap_lock);
 
 static int _alt_hps2fpga_enable_set(struct altera_hps2fpga_data *priv,
 				    bool enable)
@@ -177,8 +177,6 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev)
 		return -EBUSY;
 	}
 
-	spin_lock_init(&l3_remap_lock);
-
 	if (!of_property_read_u32(dev->of_node, "bridge-enable", &enable)) {
 		if (enable > 1) {
 			dev_warn(dev, "invalid bridge-enable %u > 1\n", enable);
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 5/5 MAINTAINERS: fpga: Update email and add patchwork URL

In reply to Alan Tull

From: Moritz Fischer <[email protected]>

Add Q: entry for patchwork and update my email address.

---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
MAINTAINERS +2 -1
index 4348288..4f3f2c6 100644
@@ -5357,10 +5357,11 @@ K:	fmc_d.*register
 
 FPGA MANAGER FRAMEWORK
 M:	Alan Tull <[email protected]>
-R:	Moritz Fischer <[email protected]>
+R:	Moritz Fischer <[email protected]>
 L:	[email protected]
 S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/atull/linux-fpga.git
+Q:	http://patchwork.kernel.org/project/linux-fpga/list/
 F:	Documentation/fpga/
 F:	Documentation/devicetree/bindings/fpga/
 F:	drivers/fpga/
Signature · 1 line
2.7.4