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 X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5696CC433E0 for ; Fri, 22 Jan 2021 05:16:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 204C72376F for ; Fri, 22 Jan 2021 05:16:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726094AbhAVFQB (ORCPT ); Fri, 22 Jan 2021 00:16:01 -0500 Received: from mail-pf1-f177.google.com ([209.85.210.177]:34442 "EHLO mail-pf1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbhAVFP5 (ORCPT ); Fri, 22 Jan 2021 00:15:57 -0500 Received: by mail-pf1-f177.google.com with SMTP id m6so2965576pfk.1; Thu, 21 Jan 2021 21:15:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=w2BUoSFxpHPMOrylOUmPX8q+87J66EYimkKpLqnA9D0=; b=J8oPajG17GVN5MLPB9FQe8FiHeGMwPmTerCnqWiD/ub7wbmpRjAgOgtJq0uMLQc0ds KIQSQQCIcIKlFIvEyXuIKxF3EaB8u2aSmuoPs8M3hmyAu3yXJrxzfgs1iim91OFpAL3V 4TONfUp6rBkYARPzAeM+/ezeaTTpwtn8Pv9ms3xY9gtU2/QaTnjn9B0C68j/Fm5OO43k mx4bs3kTuw0XYn4v5RkbIzIsUJ5XJctemqmX+c8DX5edSKIL5rLb/GRt8Gmw+Tf7Ruos oqqAevlAxcm5RPVZttURjhi+rkmrXcotPlRTI95ycdDPlCvlgzQ3gTVwU1YlCvNwQklu gM0Q== X-Gm-Message-State: AOAM5329tLO0YI7dPOIKaw3V+8zhL+vvlYy5FfwMq55x6DBu16toAukO 3vmb/L/ow5HmQwSLt7fGmrkrveO6UztaPQ== X-Google-Smtp-Source: ABdhPJwwCT/KQcIsUg8IFsTLdderKKnMglqlaCXjA6kzauEIBMwS6qd4OmSK9/GFYMf4CQBpKf77RQ== X-Received: by 2002:a62:800d:0:b029:1bc:9cd1:8ee1 with SMTP id j13-20020a62800d0000b02901bc9cd18ee1mr3276232pfd.69.1611292515962; Thu, 21 Jan 2021 21:15:15 -0800 (PST) Received: from localhost ([2601:647:5b00:1162:1ac0:17a6:4cc6:d1ef]) by smtp.gmail.com with ESMTPSA id e5sm7040733pfc.76.2021.01.21.21.15.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 21:15:15 -0800 (PST) Date: Thu, 21 Jan 2021 21:15:12 -0800 From: Moritz Fischer To: Nava kishore Manne Cc: Moritz Fischer , "trix@redhat.com" , "robh+dt@kernel.org" , Michal Simek , "linux-fpga@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , git , "chinnikishore369@gmail.com" Subject: Re: [PATCH 2/2] fpga: Add support for Xilinx DFX AXI Shutdown manager Message-ID: References: <20210115013431.27667-1-nava.manne@xilinx.com> <20210115013431.27667-2-nava.manne@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 19, 2021 at 06:34:54AM +0000, Nava kishore Manne wrote: > Hi Moritz, > > Thanks for the review. > Please find my response inline. > > > -----Original Message----- > > From: Moritz Fischer > > Sent: Saturday, January 16, 2021 8:28 AM > > To: Nava kishore Manne > > Cc: mdf@kernel.org; trix@redhat.com; robh+dt@kernel.org; Michal Simek > > ; linux-fpga@vger.kernel.org; > > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux- > > kernel@vger.kernel.org; git ; chinnikishore369@gmail.com > > Subject: Re: [PATCH 2/2] fpga: Add support for Xilinx DFX AXI Shutdown > > manager > > > > Hi, > > > > On Fri, Jan 15, 2021 at 07:04:31AM +0530, Nava kishore Manne wrote: > > > This patch adds support for Xilinx Dynamic Function eXchange(DFX) AXI > > > shutdown manager IP. It can be used to safely handling the AXI traffic > > > on a Reconfigurable Partition when it is undergoing dynamic > > > reconfiguration and there by preventing system deadlock that may occur > > > if AXI transactions are interrupted during reconfiguration. > > > > > > PR-Decoupler and AXI shutdown manager are completely different IPs. > > > But both the IP registers are compatible and also both belong to the > > > same sub-system (fpga-bridge).So using same driver for both IP's. > > > > I'm a bit confused, the whole goal here is to give the thing a different name? > > > Both the PR Decoupler and AXI Shutdown IP manager IP's are follows same register spec. > Most of the code is common so we thought of reusing same driver for AXI shutdown manager as well. What are the differences, though other than it shows a different name? > > > > > > > Signed-off-by: Nava kishore Manne > > > --- > > > drivers/fpga/xilinx-pr-decoupler.c | 35 > > > ++++++++++++++++++++++++++---- > > > 1 file changed, 31 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/fpga/xilinx-pr-decoupler.c > > > b/drivers/fpga/xilinx-pr-decoupler.c > > > index 7d69af230567..c95f3d065ccb 100644 > > > --- a/drivers/fpga/xilinx-pr-decoupler.c > > > +++ b/drivers/fpga/xilinx-pr-decoupler.c > > > @@ -19,10 +19,15 @@ > > > #define CTRL_OFFSET 0 > > > > > > struct xlnx_pr_decoupler_data { > > > + const struct xlnx_config_data *ipconfig; > > > void __iomem *io_base; > > > struct clk *clk; > > > }; > > > > > > +struct xlnx_config_data { > > > + char *name; > > > +}; > > > + > > > static inline void xlnx_pr_decoupler_write(struct xlnx_pr_decoupler_data > > *d, > > > u32 offset, u32 val) > > > { > > > @@ -76,15 +81,28 @@ static const struct fpga_bridge_ops > > xlnx_pr_decoupler_br_ops = { > > > .enable_show = xlnx_pr_decoupler_enable_show, }; > > > > > > +static const struct xlnx_config_data decoupler_config = { > > > + .name = "Xilinx PR Decoupler", > > > +}; > > > + > > > +static const struct xlnx_config_data shutdown_config = { > > > + .name = "Xilinx DFX AXI shutdown mgr", }; > > > > If it's just the strings, why not store them as is? > > In order to differentiate the IP's at probe time we are using this name filed. > > > > + > > > static const struct of_device_id xlnx_pr_decoupler_of_match[] = { > > > - { .compatible = "xlnx,pr-decoupler-1.00", }, > > > - { .compatible = "xlnx,pr-decoupler", }, > > > + { .compatible = "xlnx,pr-decoupler-1.00", .data = &decoupler_config > > }, > > > + { .compatible = "xlnx,pr-decoupler", .data = &decoupler_config }, > > > + { .compatible = "xlnx,dfx-axi-shutdown-manager-1.00", > > > + .data = &shutdown_config }, > > > + { .compatible = "xlnx,dfx-axi-shutdown-manager", > > > + .data = &shutdown_config }, > > > {}, > > > }; > > > MODULE_DEVICE_TABLE(of, xlnx_pr_decoupler_of_match); > > > > > > static int xlnx_pr_decoupler_probe(struct platform_device *pdev) { > > > + struct device_node *np = pdev->dev.of_node; > > > struct xlnx_pr_decoupler_data *priv; > > > struct fpga_bridge *br; > > > int err; > > > @@ -94,6 +112,14 @@ static int xlnx_pr_decoupler_probe(struct > > platform_device *pdev) > > > if (!priv) > > > return -ENOMEM; > > > > > > + if (np) { > > > + const struct of_device_id *match; > > > + > > > + match = of_match_node(xlnx_pr_decoupler_of_match, np); > > > + if (match && match->data) > > > + priv->ipconfig = match->data; > > > + } > > > + > > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > > priv->io_base = devm_ioremap_resource(&pdev->dev, res); > > > if (IS_ERR(priv->io_base)) > > > @@ -114,7 +140,7 @@ static int xlnx_pr_decoupler_probe(struct > > > platform_device *pdev) > > > > > > clk_disable(priv->clk); > > > > > > - br = devm_fpga_bridge_create(&pdev->dev, "Xilinx PR Decoupler", > > > + br = devm_fpga_bridge_create(&pdev->dev, priv->ipconfig->name, > > > &xlnx_pr_decoupler_br_ops, priv); > > > if (!br) { > > > err = -ENOMEM; > > > @@ -125,7 +151,8 @@ static int xlnx_pr_decoupler_probe(struct > > > platform_device *pdev) > > > > > > err = fpga_bridge_register(br); > > > if (err) { > > > - dev_err(&pdev->dev, "unable to register Xilinx PR > > Decoupler"); > > > + dev_err(&pdev->dev, "unable to register %s", > > > + priv->ipconfig->name); > > > goto err_clk; > > > } > > > > > > -- > > > 2.18.0 > > > > > > > Regards, > Navakishore. - Moritz 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 X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CAA5C433DB for ; Fri, 22 Jan 2021 05:17:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2EBC23381 for ; Fri, 22 Jan 2021 05:17:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2EBC23381 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=HdVRdAvFNdkdYQRpE60jTS971uWhmNIc+5syjaG9q3U=; b=sgi6lj4pxs5xVwLwlE2Zoww/i gVM6cPA4bcnRhxdIzWf5EUQ+gt7VUscF/Ev35/qOWEj4cwwZDHKnxViqIopImSjmi7D1v8DUznClm B2TDIhSXkYY8G+wEZoP/w+4O8b3txORDWHYpTHPIji30l7MDJj3u+X+dF4KbFz08LgRUtrjq/LKX6 8aS2GrlkX/W3I3c424mLq9kOW0vBPx5iV1lpVcOnqNWn7haScUFUVIx5iiDNLJgsDJ+GpUOK9AZh0 kgakW8EYfIj2emFAqph3qV7xwzxPLjLFMQuwGEI1YT2mC/L9gghQY/NZlQNC3juw02LVcWuXVmQpv eIJLLri6A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2on4-0001d3-SF; Fri, 22 Jan 2021 05:15:22 +0000 Received: from mail-pf1-f170.google.com ([209.85.210.170]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2on2-0001cD-MK for linux-arm-kernel@lists.infradead.org; Fri, 22 Jan 2021 05:15:22 +0000 Received: by mail-pf1-f170.google.com with SMTP id m6so2945011pfm.6 for ; Thu, 21 Jan 2021 21:15:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=w2BUoSFxpHPMOrylOUmPX8q+87J66EYimkKpLqnA9D0=; b=m2s+O+gKdXiKwjuP/VrRiuCeDN/THangyzfWcLWCybDfz88XA4If4CwxKHjOT2sfmF XURE7cP/O6UMppSvqo6tKCvuay5ixgbO2Pbj9vYMwZEyS2wblCK0HydQ2DEcQXLXDfP6 G8+os6k+DZvvzvxm+DWmkBrjYwpwGvnVlE6IqzcSmvD+48CBYSqhMBb10coPyc2NuKiU kfBszACXcN93I1h32Gotfd5K7903fICmSHx6bFUJul54Tmp1hcbJdB9p2fi/GT63JHHG 2BuDEr9wLrv7jC3yRiSCvXsmaQnkRAJhpiH6G3teAlU6tH6ZqsS/DexXLVFlmZtQCLPK MJ0w== X-Gm-Message-State: AOAM533oupSSKsZVYW1E25Gta7sXA73myQHJeQBS4W4tGn1QhpU9nmxq Mu4pj7Nlx2T48GU80qKjL5s= X-Google-Smtp-Source: ABdhPJwwCT/KQcIsUg8IFsTLdderKKnMglqlaCXjA6kzauEIBMwS6qd4OmSK9/GFYMf4CQBpKf77RQ== X-Received: by 2002:a62:800d:0:b029:1bc:9cd1:8ee1 with SMTP id j13-20020a62800d0000b02901bc9cd18ee1mr3276232pfd.69.1611292515962; Thu, 21 Jan 2021 21:15:15 -0800 (PST) Received: from localhost ([2601:647:5b00:1162:1ac0:17a6:4cc6:d1ef]) by smtp.gmail.com with ESMTPSA id e5sm7040733pfc.76.2021.01.21.21.15.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 21:15:15 -0800 (PST) Date: Thu, 21 Jan 2021 21:15:12 -0800 From: Moritz Fischer To: Nava kishore Manne Subject: Re: [PATCH 2/2] fpga: Add support for Xilinx DFX AXI Shutdown manager Message-ID: References: <20210115013431.27667-1-nava.manne@xilinx.com> <20210115013431.27667-2-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-20210122_001521_028580_A1390243 X-CRM114-Status: GOOD ( 34.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "devicetree@vger.kernel.org" , "trix@redhat.com" , "linux-fpga@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , Moritz Fischer , git , Michal Simek , "linux-arm-kernel@lists.infradead.org" , "chinnikishore369@gmail.com" 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 Tue, Jan 19, 2021 at 06:34:54AM +0000, Nava kishore Manne wrote: > Hi Moritz, > > Thanks for the review. > Please find my response inline. > > > -----Original Message----- > > From: Moritz Fischer > > Sent: Saturday, January 16, 2021 8:28 AM > > To: Nava kishore Manne > > Cc: mdf@kernel.org; trix@redhat.com; robh+dt@kernel.org; Michal Simek > > ; linux-fpga@vger.kernel.org; > > devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux- > > kernel@vger.kernel.org; git ; chinnikishore369@gmail.com > > Subject: Re: [PATCH 2/2] fpga: Add support for Xilinx DFX AXI Shutdown > > manager > > > > Hi, > > > > On Fri, Jan 15, 2021 at 07:04:31AM +0530, Nava kishore Manne wrote: > > > This patch adds support for Xilinx Dynamic Function eXchange(DFX) AXI > > > shutdown manager IP. It can be used to safely handling the AXI traffic > > > on a Reconfigurable Partition when it is undergoing dynamic > > > reconfiguration and there by preventing system deadlock that may occur > > > if AXI transactions are interrupted during reconfiguration. > > > > > > PR-Decoupler and AXI shutdown manager are completely different IPs. > > > But both the IP registers are compatible and also both belong to the > > > same sub-system (fpga-bridge).So using same driver for both IP's. > > > > I'm a bit confused, the whole goal here is to give the thing a different name? > > > Both the PR Decoupler and AXI Shutdown IP manager IP's are follows same register spec. > Most of the code is common so we thought of reusing same driver for AXI shutdown manager as well. What are the differences, though other than it shows a different name? > > > > > > > Signed-off-by: Nava kishore Manne > > > --- > > > drivers/fpga/xilinx-pr-decoupler.c | 35 > > > ++++++++++++++++++++++++++---- > > > 1 file changed, 31 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/fpga/xilinx-pr-decoupler.c > > > b/drivers/fpga/xilinx-pr-decoupler.c > > > index 7d69af230567..c95f3d065ccb 100644 > > > --- a/drivers/fpga/xilinx-pr-decoupler.c > > > +++ b/drivers/fpga/xilinx-pr-decoupler.c > > > @@ -19,10 +19,15 @@ > > > #define CTRL_OFFSET 0 > > > > > > struct xlnx_pr_decoupler_data { > > > + const struct xlnx_config_data *ipconfig; > > > void __iomem *io_base; > > > struct clk *clk; > > > }; > > > > > > +struct xlnx_config_data { > > > + char *name; > > > +}; > > > + > > > static inline void xlnx_pr_decoupler_write(struct xlnx_pr_decoupler_data > > *d, > > > u32 offset, u32 val) > > > { > > > @@ -76,15 +81,28 @@ static const struct fpga_bridge_ops > > xlnx_pr_decoupler_br_ops = { > > > .enable_show = xlnx_pr_decoupler_enable_show, }; > > > > > > +static const struct xlnx_config_data decoupler_config = { > > > + .name = "Xilinx PR Decoupler", > > > +}; > > > + > > > +static const struct xlnx_config_data shutdown_config = { > > > + .name = "Xilinx DFX AXI shutdown mgr", }; > > > > If it's just the strings, why not store them as is? > > In order to differentiate the IP's at probe time we are using this name filed. > > > > + > > > static const struct of_device_id xlnx_pr_decoupler_of_match[] = { > > > - { .compatible = "xlnx,pr-decoupler-1.00", }, > > > - { .compatible = "xlnx,pr-decoupler", }, > > > + { .compatible = "xlnx,pr-decoupler-1.00", .data = &decoupler_config > > }, > > > + { .compatible = "xlnx,pr-decoupler", .data = &decoupler_config }, > > > + { .compatible = "xlnx,dfx-axi-shutdown-manager-1.00", > > > + .data = &shutdown_config }, > > > + { .compatible = "xlnx,dfx-axi-shutdown-manager", > > > + .data = &shutdown_config }, > > > {}, > > > }; > > > MODULE_DEVICE_TABLE(of, xlnx_pr_decoupler_of_match); > > > > > > static int xlnx_pr_decoupler_probe(struct platform_device *pdev) { > > > + struct device_node *np = pdev->dev.of_node; > > > struct xlnx_pr_decoupler_data *priv; > > > struct fpga_bridge *br; > > > int err; > > > @@ -94,6 +112,14 @@ static int xlnx_pr_decoupler_probe(struct > > platform_device *pdev) > > > if (!priv) > > > return -ENOMEM; > > > > > > + if (np) { > > > + const struct of_device_id *match; > > > + > > > + match = of_match_node(xlnx_pr_decoupler_of_match, np); > > > + if (match && match->data) > > > + priv->ipconfig = match->data; > > > + } > > > + > > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > > priv->io_base = devm_ioremap_resource(&pdev->dev, res); > > > if (IS_ERR(priv->io_base)) > > > @@ -114,7 +140,7 @@ static int xlnx_pr_decoupler_probe(struct > > > platform_device *pdev) > > > > > > clk_disable(priv->clk); > > > > > > - br = devm_fpga_bridge_create(&pdev->dev, "Xilinx PR Decoupler", > > > + br = devm_fpga_bridge_create(&pdev->dev, priv->ipconfig->name, > > > &xlnx_pr_decoupler_br_ops, priv); > > > if (!br) { > > > err = -ENOMEM; > > > @@ -125,7 +151,8 @@ static int xlnx_pr_decoupler_probe(struct > > > platform_device *pdev) > > > > > > err = fpga_bridge_register(br); > > > if (err) { > > > - dev_err(&pdev->dev, "unable to register Xilinx PR > > Decoupler"); > > > + dev_err(&pdev->dev, "unable to register %s", > > > + priv->ipconfig->name); > > > goto err_clk; > > > } > > > > > > -- > > > 2.18.0 > > > > > > > Regards, > Navakishore. - Moritz _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel