* [PATCH 0/5] patches for FPGA
@ 2017-08-02 2:20 Alan Tull
2017-08-02 2:20 ` [PATCH 1/5] fpga: Convert to using %pOF instead of full_name Alan Tull
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Alan Tull @ 2017-08-02 2:20 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Moritz Fischer, Alan Tull, linux-kernel, linux-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(-)
--
2.7.4
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] fpga: Convert to using %pOF instead of full_name
2017-08-02 2:20 [PATCH 0/5] patches for FPGA Alan Tull
@ 2017-08-02 2:20 ` Alan Tull
2017-08-02 2:20 ` [PATCH 2/5] ARM: socfpga: explicitly request exclusive reset control Alan Tull
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Alan Tull @ 2017-08-02 2:20 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Moritz Fischer, Alan Tull, linux-kernel, linux-fpga, Rob Herring,
Moritz Fischer
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/5] ARM: socfpga: explicitly request exclusive reset control
2017-08-02 2:20 [PATCH 0/5] patches for FPGA Alan Tull
2017-08-02 2:20 ` [PATCH 1/5] fpga: Convert to using %pOF instead of full_name Alan Tull
@ 2017-08-02 2:20 ` Alan Tull
2017-08-02 2:20 ` [PATCH 3/5] fpga: altera-hps2fpga: add NULL check on of_match_device() return value Alan Tull
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Alan Tull @ 2017-08-02 2:20 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Moritz Fischer, Alan Tull, linux-kernel, linux-fpga,
Philipp Zabel, Moritz Fischer
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/5] fpga: altera-hps2fpga: add NULL check on of_match_device() return value
2017-08-02 2:20 [PATCH 0/5] patches for FPGA Alan Tull
2017-08-02 2:20 ` [PATCH 1/5] fpga: Convert to using %pOF instead of full_name Alan Tull
2017-08-02 2:20 ` [PATCH 2/5] ARM: socfpga: explicitly request exclusive reset control Alan Tull
@ 2017-08-02 2:20 ` Alan Tull
2017-08-02 2:20 ` [PATCH 4/5] fpga: altera-hps2fpga: fix multiple init of l3_remap_lock Alan Tull
2017-08-02 2:20 ` [PATCH 5/5] MAINTAINERS: fpga: Update email and add patchwork URL Alan Tull
4 siblings, 0 replies; 6+ messages in thread
From: Alan Tull @ 2017-08-02 2:20 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Moritz Fischer, Alan Tull, linux-kernel, linux-fpga,
Gustavo A. R. Silva
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] fpga: altera-hps2fpga: fix multiple init of l3_remap_lock
2017-08-02 2:20 [PATCH 0/5] patches for FPGA Alan Tull
` (2 preceding siblings ...)
2017-08-02 2:20 ` [PATCH 3/5] fpga: altera-hps2fpga: add NULL check on of_match_device() return value Alan Tull
@ 2017-08-02 2:20 ` Alan Tull
2017-08-02 2:20 ` [PATCH 5/5] MAINTAINERS: fpga: Update email and add patchwork URL Alan Tull
4 siblings, 0 replies; 6+ messages in thread
From: Alan Tull @ 2017-08-02 2:20 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Moritz Fischer, Alan Tull, linux-kernel, linux-fpga, Ian Abbott,
# 4 . 10+
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/5] MAINTAINERS: fpga: Update email and add patchwork URL
2017-08-02 2:20 [PATCH 0/5] patches for FPGA Alan Tull
` (3 preceding siblings ...)
2017-08-02 2:20 ` [PATCH 4/5] fpga: altera-hps2fpga: fix multiple init of l3_remap_lock Alan Tull
@ 2017-08-02 2:20 ` Alan Tull
4 siblings, 0 replies; 6+ messages in thread
From: Alan Tull @ 2017-08-02 2:20 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Moritz Fischer, Alan Tull, linux-kernel, linux-fpga
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-08-02 2:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-02 2:20 [PATCH 0/5] patches for FPGA Alan Tull
2017-08-02 2:20 ` [PATCH 1/5] fpga: Convert to using %pOF instead of full_name Alan Tull
2017-08-02 2:20 ` [PATCH 2/5] ARM: socfpga: explicitly request exclusive reset control Alan Tull
2017-08-02 2:20 ` [PATCH 3/5] fpga: altera-hps2fpga: add NULL check on of_match_device() return value Alan Tull
2017-08-02 2:20 ` [PATCH 4/5] fpga: altera-hps2fpga: fix multiple init of l3_remap_lock Alan Tull
2017-08-02 2:20 ` [PATCH 5/5] MAINTAINERS: fpga: Update email and add patchwork URL Alan Tull
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox