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


Groups > linux.kernel > #1636727 > unrolled thread

Re: [PATCH v2 08/16] fpga: region: check for child regions before allocing image info

Started byMoritz Fischer <mdf@kernel.org>
First post2017-05-05 23:00 +0200
Last post2017-05-08 23:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 08/16] fpga: region: check for child regions before  allocing image info Moritz Fischer <mdf@kernel.org> - 2017-05-05 23:00 +0200
    Re: [PATCH v2 08/16] fpga: region: check for child regions before  allocing image info Alan Tull <atull@kernel.org> - 2017-05-08 23:10 +0200

#1636727 — Re: [PATCH v2 08/16] fpga: region: check for child regions before allocing image info

FromMoritz Fischer <mdf@kernel.org>
Date2017-05-05 23:00 +0200
SubjectRe: [PATCH v2 08/16] fpga: region: check for child regions before allocing image info
Message-ID<tDSuu-6OQ-9@gated-at.bofh.it>
On Thu, Apr 20, 2017 at 7:09 AM, Alan Tull <atull@kernel.org> wrote:
> During a device tree overlay pre-apply notification, the check
> for child FPGA regions can happen slightly earlier.  This saves
> us from allocating the FPGA image info that just gets thrown
> away.
>
> This is a baby step in refactoring the FPGA region code to
> separate out common FPGA region code from FPGA region
> Device Tree overlay support.
>
> Signed-off-by: Alan Tull <atull@kernel.org>
Acked-by: Moritz Fischer <mdf@kernel.org>
> ---
> v2: split out from another patch
> ---
>  drivers/fpga/fpga-region.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
> index 7ff5426..c2730a8 100644
> --- a/drivers/fpga/fpga-region.c
> +++ b/drivers/fpga/fpga-region.c
> @@ -355,15 +355,19 @@ static int fpga_region_notify_pre_apply(struct fpga_region *region,
>         const char *firmware_name;
>         int ret;
>
> -       info = fpga_image_info_alloc(&region->dev);
> -       if (!info)
> -               return -ENOMEM;
> -
> -       /* Reject overlay if child FPGA Regions have firmware-name property */
> +       /*
> +        * Reject overlay if child FPGA Regions added in the overlay have
> +        * firmware-name property (would mean that an FPGA region that has
> +        * not been added to the live tree yet is doing FPGA programming).
> +        */
>         ret = child_regions_with_firmware(nd->overlay);
>         if (ret)
>                 return ret;
>
> +       info = fpga_image_info_alloc(dev);
> +       if (!info)
> +               return -ENOMEM;
> +
>         /* Read FPGA region properties from the overlay */
>         if (of_property_read_bool(nd->overlay, "partial-fpga-config"))
>                 info->flags |= FPGA_MGR_PARTIAL_RECONFIG;
> --
> 2.7.4
>

[toc] | [next] | [standalone]


#1637719

FromAlan Tull <atull@kernel.org>
Date2017-05-08 23:10 +0200
Message-ID<tEY4O-I2-19@gated-at.bofh.it>
In reply to#1636727
On Fri, May 5, 2017 at 3:59 PM, Moritz Fischer <mdf@kernel.org> wrote:
> On Thu, Apr 20, 2017 at 7:09 AM, Alan Tull <atull@kernel.org> wrote:
>> During a device tree overlay pre-apply notification, the check
>> for child FPGA regions can happen slightly earlier.  This saves
>> us from allocating the FPGA image info that just gets thrown
>> away.
>>
>> This is a baby step in refactoring the FPGA region code to
>> separate out common FPGA region code from FPGA region
>> Device Tree overlay support.
>>
>> Signed-off-by: Alan Tull <atull@kernel.org>
> Acked-by: Moritz Fischer <mdf@kernel.org>

Thanks!

Alan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web