Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1701631 > unrolled thread

[PATCH 0/5] patches for FPGA

Started byAlan Tull <atull@kernel.org>
First post2017-08-02 04:30 +0200
Last post2017-08-02 04:30 +0200
Articles 6 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/5] patches for FPGA Alan Tull <atull@kernel.org> - 2017-08-02 04:30 +0200
    [PATCH 5/5] MAINTAINERS: fpga: Update email and add patchwork URL Alan Tull <atull@kernel.org> - 2017-08-02 04:30 +0200
    [PATCH 1/5] fpga: Convert to using %pOF instead of full_name Alan Tull <atull@kernel.org> - 2017-08-02 04:30 +0200
    [PATCH 3/5] fpga: altera-hps2fpga: add NULL check on of_match_device() return value Alan Tull <atull@kernel.org> - 2017-08-02 04:30 +0200
    [PATCH 2/5] ARM: socfpga: explicitly request exclusive reset control Alan Tull <atull@kernel.org> - 2017-08-02 04:30 +0200
    [PATCH 4/5] fpga: altera-hps2fpga: fix multiple init of l3_remap_lock Alan Tull <atull@kernel.org> - 2017-08-02 04:30 +0200

#1701631 — [PATCH 0/5] patches for FPGA

FromAlan Tull <atull@kernel.org>
Date2017-08-02 04:30 +0200
Subject[PATCH 0/5] patches for FPGA
Message-ID<u9RA5-3Rb-3@gated-at.bofh.it>
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(-)

-- 
2.7.4

[toc] | [next] | [standalone]


#1701633 — [PATCH 5/5] MAINTAINERS: fpga: Update email and add patchwork URL

FromAlan Tull <atull@kernel.org>
Date2017-08-02 04:30 +0200
Subject[PATCH 5/5] MAINTAINERS: fpga: Update email and add patchwork URL
Message-ID<u9RA5-3Rb-7@gated-at.bofh.it>
In reply to#1701631
From: Moritz Fischer <mdf@kernel.org>

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

Signed-off-by: Moritz Fischer <mdf@kernel.org>
Acked-By: Alan Tull <atull@kernel.org>
Cc: Alan Tull <atull@kernel.org>
Cc: linux-fpga@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 4348288..4f3f2c6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5357,10 +5357,11 @@ K:	fmc_d.*register
 
 FPGA MANAGER FRAMEWORK
 M:	Alan Tull <atull@kernel.org>
-R:	Moritz Fischer <moritz.fischer@ettus.com>
+R:	Moritz Fischer <mdf@kernel.org>
 L:	linux-fpga@vger.kernel.org
 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/
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1701634 — [PATCH 1/5] fpga: Convert to using %pOF instead of full_name

FromAlan Tull <atull@kernel.org>
Date2017-08-02 04:30 +0200
Subject[PATCH 1/5] fpga: Convert to using %pOF instead of full_name
Message-ID<u9RA5-3Rb-9@gated-at.bofh.it>
In reply to#1701631
From: Rob Herring <robh@kernel.org>

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.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Alan Tull <atull@kernel.org>
Cc: Moritz Fischer <moritz.fischer@ettus.com>
Cc: linux-fpga@vger.kernel.org
Acked-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Alan Tull <atull@kernel.org>
---
 drivers/fpga/fpga-region.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
index 3b6b2f4..d9ab7c7 100644
--- a/drivers/fpga/fpga-region.c
+++ b/drivers/fpga/fpga-region.c
@@ -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;
 }
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1701635 — [PATCH 3/5] fpga: altera-hps2fpga: add NULL check on of_match_device() return value

FromAlan Tull <atull@kernel.org>
Date2017-08-02 04:30 +0200
Subject[PATCH 3/5] fpga: altera-hps2fpga: add NULL check on of_match_device() return value
Message-ID<u9RA6-3Rb-11@gated-at.bofh.it>
In reply to#1701631
From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>

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

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Alan Tull <atull@kernel.org>
---
 drivers/fpga/altera-hps2fpga.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c
index a18ff43..e6c948b 100644
--- a/drivers/fpga/altera-hps2fpga.c
+++ b/drivers/fpga/altera-hps2fpga.c
@@ -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,
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1701637 — [PATCH 2/5] ARM: socfpga: explicitly request exclusive reset control

FromAlan Tull <atull@kernel.org>
Date2017-08-02 04:30 +0200
Subject[PATCH 2/5] ARM: socfpga: explicitly request exclusive reset control
Message-ID<u9RA6-3Rb-21@gated-at.bofh.it>
In reply to#1701631
From: Philipp Zabel <p.zabel@pengutronix.de>

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.

Cc: Alan Tull <atull@kernel.org>
Cc: Moritz Fischer <moritz.fischer@ettus.com>
Cc: linux-fpga@vger.kernel.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-By: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Alan Tull <atull@kernel.org>
---
 drivers/fpga/altera-hps2fpga.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c
index 3066b80..a18ff43 100644
--- a/drivers/fpga/altera-hps2fpga.c
+++ b/drivers/fpga/altera-hps2fpga.c
@@ -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);
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1701639 — [PATCH 4/5] fpga: altera-hps2fpga: fix multiple init of l3_remap_lock

FromAlan Tull <atull@kernel.org>
Date2017-08-02 04:30 +0200
Subject[PATCH 4/5] fpga: altera-hps2fpga: fix multiple init of l3_remap_lock
Message-ID<u9RA6-3Rb-27@gated-at.bofh.it>
In reply to#1701631
From: Ian Abbott <abbotti@mev.co.uk>

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: <stable@vger.kernel.org> # 4.10+
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-By: Moritz Fischer <mdf@kernel.org>
Signed-off-by: Alan Tull <atull@kernel.org>
---
 drivers/fpga/altera-hps2fpga.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c
index e6c948b..406d2f1 100644
--- a/drivers/fpga/altera-hps2fpga.c
+++ b/drivers/fpga/altera-hps2fpga.c
@@ -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);
-- 
2.7.4

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web