2019-01-24 20:46:24

by Alan Tull

[permalink] [raw]
Subject: [PATCH 0/3] patches for 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



2019-01-24 20:46:30

by Alan Tull

[permalink] [raw]
Subject: [PATCH 2/3] fpga: altera_freeze_bridge: remove restriction to socfpga

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 <[email protected]>
Reviewed-by: Moritz Fischer <[email protected]>
---
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


2019-01-24 20:47:00

by Alan Tull

[permalink] [raw]
Subject: [PATCH 3/3] fpga: mgr: altera-ps-spi: make array dummy static, shrinks object size

From: Colin Ian King <[email protected]>

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 <[email protected]>
Acked-by: Alan Tull <[email protected]>
Acked-by: Moritz Fischer <[email protected]>
---
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


2019-01-24 20:48:35

by Alan Tull

[permalink] [raw]
Subject: [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function

From: Nicolas Saenz Julienne <[email protected]>

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 <[email protected]>
Acked-by: Alan Tull <[email protected]>
Acked-by: Moritz Fischer <[email protected]>
---
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


2019-01-26 16:29:59

by Alan Tull

[permalink] [raw]
Subject: Re: [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function

On Thu, Jan 24, 2019 at 2:46 PM Alan Tull <[email protected]> wrote:
>
> From: Nicolas Saenz Julienne <[email protected]>
>
> 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 <[email protected]>
> Acked-by: Alan Tull <[email protected]>
> Acked-by: Moritz Fischer <[email protected]>
> ---
> 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
>