lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220620073412.GA1319418@yilunxu-OptiPlex-7050>
Date:   Mon, 20 Jun 2022 15:34:12 +0800
From:   Xu Yilun <yilun.xu@...el.com>
To:     "Manne, Nava kishore" <nava.kishore.manne@....com>
Cc:     Nava kishore Manne <nava.manne@...inx.com>,
        "mdf@...nel.org" <mdf@...nel.org>,
        "hao.wu@...el.com" <hao.wu@...el.com>,
        "trix@...hat.com" <trix@...hat.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "krzysztof.kozlowski+dt@...aro.org" 
        <krzysztof.kozlowski+dt@...aro.org>,
        "Simek, Michal" <michal.simek@....com>,
        "linux-fpga@...r.kernel.org" <linux-fpga@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>, git <git@...inx.com>
Subject: Re: [PATCH v2 3/3] fpga: region: Add runtime PM support

On Mon, Jun 20, 2022 at 05:38:13AM +0000, Manne, Nava kishore wrote:
> Ping!

Sorry I missed this one. Will try to catch up.

Thanks,
Yilun

> 
> > -----Original Message-----
> > From: Nava kishore Manne <nava.manne@...inx.com>
> > Sent: Monday, May 23, 2022 7:15 PM
> > To: mdf@...nel.org; hao.wu@...el.com; yilun.xu@...el.com;
> > trix@...hat.com; robh+dt@...nel.org; krzysztof.kozlowski+dt@...aro.org;
> > Michal Simek <michals@...inx.com>; Nava kishore Manne
> > <navam@...inx.com>; linux-fpga@...r.kernel.org;
> > devicetree@...r.kernel.org; linux-kernel@...r.kernel.org; linux-arm-
> > kernel@...ts.infradead.org; git <git@...inx.com>
> > Subject: [PATCH v2 3/3] fpga: region: Add runtime PM support
> > 
> > Add support to handle FPGA/PL power domain. With this patch, the PL
> > power domain will be turned on before loading the bitstream into the
> > targeted region and turned off while removing/unloading the bitstream from
> > the targeted region using overlays. This can be achieved by adding the
> > runtime PM support to the fpga regions.
> > 
> > Signed-off-by: Nava kishore Manne <nava.manne@...inx.com>
> > ---
> > Changes for v2:
> >               - Updated commit message.
> >               - Updated runtime PM handling logic to fix the PM ref count
> >                 imbalance issues.
> > 
> >  drivers/fpga/of-fpga-region.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/drivers/fpga/of-fpga-region.c b/drivers/fpga/of-fpga-region.c
> > index ae82532fc127..f14bb5916d97 100644
> > --- a/drivers/fpga/of-fpga-region.c
> > +++ b/drivers/fpga/of-fpga-region.c
> > @@ -15,6 +15,7 @@
> >  #include <linux/of_platform.h>
> >  #include <linux/slab.h>
> >  #include <linux/spinlock.h>
> > +#include <linux/pm_runtime.h>
> > 
> >  static const struct of_device_id fpga_region_of_match[] = {
> >  	{ .compatible = "fpga-region", },
> > @@ -301,10 +302,17 @@ static int of_fpga_region_notify_pre_apply(struct
> > fpga_region *region,
> >  		return -EINVAL;
> >  	}
> > 
> > +	ret = pm_runtime_resume_and_get(dev->parent);
> > +	if (ret < 0) {
> > +		fpga_image_info_free(info);
> > +		return ret;
> > +	}
> > +
> >  	region->info = info;
> >  	ret = fpga_region_program_fpga(region);
> >  	if (ret) {
> >  		/* error; reject overlay */
> > +		pm_runtime_put_sync(dev->parent);
> >  		fpga_image_info_free(info);
> >  		region->info = NULL;
> >  	}
> > @@ -324,10 +332,13 @@ static int of_fpga_region_notify_pre_apply(struct
> > fpga_region *region,  static void of_fpga_region_notify_post_remove(struct
> > fpga_region *region,
> >  					      struct of_overlay_notify_data
> > *nd)  {
> > +	struct device *dev = &region->dev;
> > +
> >  	fpga_bridges_disable(&region->bridge_list);
> >  	fpga_bridges_put(&region->bridge_list);
> >  	fpga_image_info_free(region->info);
> >  	region->info = NULL;
> > +	pm_runtime_put_sync(dev->parent);
> >  }
> > 
> >  /**
> > @@ -411,6 +422,8 @@ static int of_fpga_region_probe(struct
> > platform_device *pdev)
> >  		goto eprobe_mgr_put;
> >  	}
> > 
> > +	pm_runtime_enable(&pdev->dev);
> > +
> >  	of_platform_populate(np, fpga_region_of_match, NULL, &region-
> > >dev);
> >  	platform_set_drvdata(pdev, region);
> > 
> > @@ -430,6 +443,7 @@ static int of_fpga_region_remove(struct
> > platform_device *pdev)
> > 
> >  	fpga_region_unregister(region);
> >  	fpga_mgr_put(mgr);
> > +	pm_runtime_disable(region->dev.parent);
> > 
> >  	return 0;
> >  }
> > --
> > 2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ