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


Groups > linux.kernel > #1740885 > unrolled thread

[PATCH 1/1] fpga: region: release bridges in successful path

Started by"Vyacheslav V. Yurkov" <uvv.mail@gmail.com>
First post2017-09-27 18:50 +0200
Last post2017-09-27 20:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/1] fpga: region: release bridges in successful path "Vyacheslav V. Yurkov" <uvv.mail@gmail.com> - 2017-09-27 18:50 +0200
    Re: [PATCH 1/1] fpga: region: release bridges in successful path Alan Tull <atull@kernel.org> - 2017-09-27 20:50 +0200

#1740885 — [PATCH 1/1] fpga: region: release bridges in successful path

From"Vyacheslav V. Yurkov" <uvv.mail@gmail.com>
Date2017-09-27 18:50 +0200
Subject[PATCH 1/1] fpga: region: release bridges in successful path
Message-ID<uunH4-5Cm-13@gated-at.bofh.it>
From: Vyacheslav Yurkov <uvv.mail@gmail.com>

In case of successful FPGA reconfiguration bridges mutexes are not
unlocked properly.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
 drivers/fpga/fpga-region.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
index d9ab7c7..ed858e3 100644
--- a/drivers/fpga/fpga-region.c
+++ b/drivers/fpga/fpga-region.c
@@ -274,6 +274,7 @@ static int fpga_region_program_fpga(struct fpga_region *region,
 	}
 
 	fpga_mgr_put(mgr);
+	fpga_bridges_put(&region->bridge_list);
 	fpga_region_put(region);
 
 	return 0;
-- 
2.7.4

[toc] | [next] | [standalone]


#1740945

FromAlan Tull <atull@kernel.org>
Date2017-09-27 20:50 +0200
Message-ID<uupzb-6Km-11@gated-at.bofh.it>
In reply to#1740885
On Wed, Sep 27, 2017 at 11:43 AM, Vyacheslav V. Yurkov
<uvv.mail@gmail.com> wrote:

Hi Vyacheslav,

Thanks for the patch, but actually this is on purpose to prevent
someone disabling the bridges when a region has hardware running in
it.  The fpga_bridges_put happens when the device tree overlay is
removed in fpga_region_notify_post_remove().  When an overlay programs
a region, the region gets exclusive control of the bridges and
disables them before programming.  After programming, the region
re-enables the bridges and keeps exclusive control of them.  Some
drivers are loaded by device tree and are expecting those bridges to
stay enabled.  Later when the overlay is removed, the drivers are
unloaded first, the bridges are disable and put.

Alan

> From: Vyacheslav Yurkov <uvv.mail@gmail.com>
>
> In case of successful FPGA reconfiguration bridges mutexes are not
> unlocked properly.
>
> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> ---
>  drivers/fpga/fpga-region.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
> index d9ab7c7..ed858e3 100644
> --- a/drivers/fpga/fpga-region.c
> +++ b/drivers/fpga/fpga-region.c
> @@ -274,6 +274,7 @@ static int fpga_region_program_fpga(struct fpga_region *region,
>         }
>
>         fpga_mgr_put(mgr);
> +       fpga_bridges_put(&region->bridge_list);
>         fpga_region_put(region);
>
>         return 0;
> --
> 2.7.4
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web