* [PATCH 0/3] patches for FPGA
@ 2019-01-24 20:45 Alan Tull
2019-01-24 20:45 ` [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function Alan Tull
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Alan Tull @ 2019-01-24 20:45 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Moritz Fischer, Dinh Nguyen, Alan Tull, linux-kernel, linux-fpga
Hi Greg,
Please take these patches for fpga. They have been reviewed on
the mailing list and apply cleanly on current linux-next.
The "fpga: stratix10-soc: fix wrong of_node_put() in init function"
is a bug fix, sorry it's late. It will only affect the
Stratix10 platform.
The other two can go in whenever is appropriate.
Thanks,
Alan
Alan Tull (1):
fpga: altera_freeze_bridge: remove restriction to socfpga
Colin Ian King (1):
fpga: mgr: altera-ps-spi: make array dummy static, shrinks object size
Nicolas Saenz Julienne (1):
fpga: stratix10-soc: fix wrong of_node_put() in init function
drivers/fpga/Kconfig | 2 +-
drivers/fpga/altera-ps-spi.c | 2 +-
drivers/fpga/stratix10-soc.c | 2 --
3 files changed, 2 insertions(+), 4 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function
2019-01-24 20:45 [PATCH 0/3] patches for FPGA Alan Tull
@ 2019-01-24 20:45 ` Alan Tull
2019-01-26 16:29 ` Alan Tull
2019-01-24 20:45 ` [PATCH 2/3] fpga: altera_freeze_bridge: remove restriction to socfpga Alan Tull
2019-01-24 20:45 ` [PATCH 3/3] fpga: mgr: altera-ps-spi: make array dummy static, shrinks object size Alan Tull
2 siblings, 1 reply; 5+ messages in thread
From: Alan Tull @ 2019-01-24 20:45 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Moritz Fischer, Dinh Nguyen, Alan Tull, linux-kernel, linux-fpga,
Nicolas Saenz Julienne
From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
After finding a "firmware" dt node stratix10 tries to match it's
compatible string with it. To do so it's calling of_find_matching_node()
which already takes care of decreasing the refcount on the "firmware"
node. We are then incorrectly decreasing the refcount on that node
again.
This patch removes the unwarranted call to of_node_put().
Fixes: e7eef1d7633a ("fpga: add intel stratix10 soc fpga manager driver")
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: Alan Tull <atull@kernel.org>
Acked-by: Moritz Fischer <mdf@kernel.org>
---
drivers/fpga/stratix10-soc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c
index a1a09e0..e75dbe5 100644
--- a/drivers/fpga/stratix10-soc.c
+++ b/drivers/fpga/stratix10-soc.c
@@ -509,13 +509,11 @@ static int __init s10_init(void)
np = of_find_matching_node(fw_np, s10_of_match);
if (!np) {
- of_node_put(fw_np);
return -ENODEV;
}
of_node_put(np);
ret = of_platform_populate(fw_np, s10_of_match, NULL, NULL);
- of_node_put(fw_np);
if (ret)
return ret;
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] fpga: altera_freeze_bridge: remove restriction to socfpga
2019-01-24 20:45 [PATCH 0/3] patches for FPGA Alan Tull
2019-01-24 20:45 ` [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function Alan Tull
@ 2019-01-24 20:45 ` Alan Tull
2019-01-24 20:45 ` [PATCH 3/3] fpga: mgr: altera-ps-spi: make array dummy static, shrinks object size Alan Tull
2 siblings, 0 replies; 5+ messages in thread
From: Alan Tull @ 2019-01-24 20:45 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Moritz Fischer, Dinh Nguyen, Alan Tull, linux-kernel, linux-fpga
The Altera Freeze Bridge should not be restricted to ARCH_SOCFPGA
since it can be used on other platforms such as Stratix10.
Signed-off-by: Alan Tull <atull@kernel.org>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
---
drivers/fpga/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
index 0bb7b5c..c20445b 100644
--- a/drivers/fpga/Kconfig
+++ b/drivers/fpga/Kconfig
@@ -104,7 +104,7 @@ config SOCFPGA_FPGA_BRIDGE
config ALTERA_FREEZE_BRIDGE
tristate "Altera FPGA Freeze Bridge"
- depends on ARCH_SOCFPGA && FPGA_BRIDGE
+ depends on FPGA_BRIDGE && HAS_IOMEM
help
Say Y to enable drivers for Altera FPGA Freeze bridges. A
freeze bridge is a bridge that exists in the FPGA fabric to
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] fpga: mgr: altera-ps-spi: make array dummy static, shrinks object size
2019-01-24 20:45 [PATCH 0/3] patches for FPGA Alan Tull
2019-01-24 20:45 ` [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function Alan Tull
2019-01-24 20:45 ` [PATCH 2/3] fpga: altera_freeze_bridge: remove restriction to socfpga Alan Tull
@ 2019-01-24 20:45 ` Alan Tull
2 siblings, 0 replies; 5+ messages in thread
From: Alan Tull @ 2019-01-24 20:45 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Moritz Fischer, Dinh Nguyen, Alan Tull, linux-kernel, linux-fpga,
Colin Ian King
From: Colin Ian King <colin.king@canonical.com>
Don't populate the const array dummy on the stack but instead
make it static. Makes the object code smaller by 26 bytes:
Before:
text data bss dec hex filename
7371 2032 0 9403 24bb drivers/fpga/altera-ps-spi.o
After:
text data bss dec hex filename
7281 2096 0 9377 24a1 drivers/fpga/altera-ps-spi.o
(gcc version 8.2.0 x86_64)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Alan Tull <atull@kernel.org>
Acked-by: Moritz Fischer <mdf@kernel.org>
---
drivers/fpga/altera-ps-spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fpga/altera-ps-spi.c b/drivers/fpga/altera-ps-spi.c
index 8c18bee..678d011 100644
--- a/drivers/fpga/altera-ps-spi.c
+++ b/drivers/fpga/altera-ps-spi.c
@@ -205,7 +205,7 @@ static int altera_ps_write_complete(struct fpga_manager *mgr,
struct fpga_image_info *info)
{
struct altera_ps_conf *conf = mgr->priv;
- const char dummy[] = {0};
+ static const char dummy[] = {0};
int ret;
if (gpiod_get_value_cansleep(conf->status)) {
--
2.7.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function
2019-01-24 20:45 ` [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function Alan Tull
@ 2019-01-26 16:29 ` Alan Tull
0 siblings, 0 replies; 5+ messages in thread
From: Alan Tull @ 2019-01-26 16:29 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Moritz Fischer, Dinh Nguyen, linux-kernel, linux-fpga,
Nicolas Saenz Julienne
On Thu, Jan 24, 2019 at 2:46 PM Alan Tull <atull@kernel.org> wrote:
>
> From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>
> After finding a "firmware" dt node stratix10 tries to match it's
> compatible string with it. To do so it's calling of_find_matching_node()
> which already takes care of decreasing the refcount on the "firmware"
> node. We are then incorrectly decreasing the refcount on that node
> again.
>
> This patch removes the unwarranted call to of_node_put().
>
> Fixes: e7eef1d7633a ("fpga: add intel stratix10 soc fpga manager driver")
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> Acked-by: Alan Tull <atull@kernel.org>
> Acked-by: Moritz Fischer <mdf@kernel.org>
> ---
> drivers/fpga/stratix10-soc.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c
> index a1a09e0..e75dbe5 100644
> --- a/drivers/fpga/stratix10-soc.c
> +++ b/drivers/fpga/stratix10-soc.c
> @@ -509,13 +509,11 @@ static int __init s10_init(void)
>
> np = of_find_matching_node(fw_np, s10_of_match);
> if (!np) {
> - of_node_put(fw_np);
> return -ENODEV;
> }
This leaves unnecessary braces around a single statement. I had said
in the code review that I was going to clean that up. Arg! I'll
resubmit this patch.
Alan
>
> of_node_put(np);
> ret = of_platform_populate(fw_np, s10_of_match, NULL, NULL);
> - of_node_put(fw_np);
> if (ret)
> return ret;
>
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-01-26 16:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 20:45 [PATCH 0/3] patches for FPGA Alan Tull
2019-01-24 20:45 ` [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function Alan Tull
2019-01-26 16:29 ` Alan Tull
2019-01-24 20:45 ` [PATCH 2/3] fpga: altera_freeze_bridge: remove restriction to socfpga Alan Tull
2019-01-24 20:45 ` [PATCH 3/3] fpga: mgr: altera-ps-spi: make array dummy static, shrinks object size Alan Tull
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).