From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5728AC433EF for ; Mon, 20 Jun 2022 07:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Y2xxsdZJtcaJT0irCz7ju8xkWHKsKyYETbzTW87XBQU=; b=TL2r1LLvrutrhx gCzgpncjeqyv4qMw1IwjaQxeWkzjp9/2jR4Fajg8LGpKCCIQlMDG6V0eZE91iOLnwGaO2nDPIKDcM 1eD+4BTFQrCMMIZvIiW5K1iDUkan1KdBU105zJULuX/FLWsiWCPt03ne0nilNdKyv7CwoQcllKpKA VwSzB30vdgX5guhJjUDI+BwhOnYASrFb2GGW7T+Bvv7hHdD5mMx8sqPQbICxBx1hja3GN6E21DGvw aWRWR6wgVnXxo/YnVaizHVSc59Jags+PrDDv/CzQOn+/A/tsqczM3DZIkwHea6j2My3LLnknKcOyr ikF9hGw2N4i7k05875Ug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3C3H-00GimR-Po; Mon, 20 Jun 2022 07:42:27 +0000 Received: from mga07.intel.com ([134.134.136.100]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o3C3E-00GilU-3o for linux-arm-kernel@lists.infradead.org; Mon, 20 Jun 2022 07:42:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655710944; x=1687246944; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=afrJTMQEPzFgwJo2gc0m4jjaI4R+MO4SngaxX75mOmk=; b=cnGZ3y862oLBeFZTkCoId53TrgupoPf+SGzh7+ij0xSzfInKoFswG//g is/XnmjZY2sN7IbOiy9YnVstzsuEM2SQ1uY6ewnxanbpPa2SToKBVv4b1 +xljcqYLqlsvcyilPL3aQLRVFBCREdPgFwy5YX1ffYJPpmwVBRHpfReKp SnP0yoOGaumrhuHS6vBCw6MfmqU91nJZUgAEn5gi+8JYRYJb+W7Gtd7vr 0gqXaTOwdmPNm4dJyfEh17joYBIQnuwhOIppk/8PseQ7Ml/djjduuN+Df exK5KyqA7dwwTO/1tnhzR4WfXnZWhOc6EtoWwCTmee/+CZCmCXgkh4Te3 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="343822113" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="343822113" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2022 00:42:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="676419073" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by FMSMGA003.fm.intel.com with ESMTP; 20 Jun 2022 00:42:18 -0700 Date: Mon, 20 Jun 2022 15:34:12 +0800 From: Xu Yilun To: "Manne, Nava kishore" Cc: Nava kishore Manne , "mdf@kernel.org" , "hao.wu@intel.com" , "trix@redhat.com" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "Simek, Michal" , "linux-fpga@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , git Subject: Re: [PATCH v2 3/3] fpga: region: Add runtime PM support Message-ID: <20220620073412.GA1319418@yilunxu-OptiPlex-7050> References: <20220523134517.4056873-1-nava.manne@xilinx.com> <20220523134517.4056873-4-nava.manne@xilinx.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220620_004224_275977_849F1410 X-CRM114-Status: GOOD ( 26.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > > Sent: Monday, May 23, 2022 7:15 PM > > To: mdf@kernel.org; hao.wu@intel.com; yilun.xu@intel.com; > > trix@redhat.com; robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org; > > Michal Simek ; Nava kishore Manne > > ; linux-fpga@vger.kernel.org; > > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm- > > kernel@lists.infradead.org; git > > 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 > > --- > > 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 > > #include > > #include > > +#include > > > > 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 = ®ion->dev; > > + > > fpga_bridges_disable(®ion->bridge_list); > > fpga_bridges_put(®ion->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, ®ion- > > >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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel