Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3305328rwd; Sat, 3 Jun 2023 02:47:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7onk12aIYybLpFpp21G7kYo9Jow3+D/GwJYkAnvd/1y+z1Ej/FqhTsitmc46d5phjZsIYK X-Received: by 2002:a05:6808:5c1:b0:396:40c4:a2ef with SMTP id d1-20020a05680805c100b0039640c4a2efmr2765825oij.11.1685785632092; Sat, 03 Jun 2023 02:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685785632; cv=none; d=google.com; s=arc-20160816; b=dn080/Qm87fgHC1y24ruVx3rX4Ua3gGDDoDSIVim1EnK4EEBnljZZFLZvW3ErOADsN /n5d+QBTcx6kX91MgwkTEoMpyDYGJxCxHE/JnTls9CoGx55GabX2CKJUo9DvREFZ6+YI fZN8YqGjSR+KfJ9P2ZWEu5dcQBXTgM7SPTlYPaXTMhjfV2EuBrkQDDrWEln0ln+RsUQG q+9nOaZl9PoUBKPRItqPbQEQxmC5AtWhIHgqwCiMJ+R22+tPlP48knfUcrIYI6oHW5xi IFh+rlauzBIuwxJfIsPQBiUk4+R4O06MQI6nzWEINYYtTBoB8PounTXJ1uq5XD92QmVB eXHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QgL1HOYnmZvm7T8Xr1kDerP/an2pgnrv3pO/G/c6JbQ=; b=tk/EI03LymHTsULE6XLxdPtwx37bU/nnQNvwpTodxgCIR7fNJxgn/dc9oSYuP2W96+ EdV0xl7FdEgDFdU7U0aC33ga7OlSHBktIqpzqPZeAg6IgvJvb5YCiyYJ0TL2/NDgbs+s tCVtDfsveewlx17UA+NhZKw6yhVKmbiIQ6CpxHNAi8bEfBBVEFpLkqHySzSKMyZqDXfy 9ZKGVxZGaJnz14nwjIbwRBDY8UZ2uRWdwVHbG9YzZcOfyFiqmxx9KPAOAo/rptSdyNPg B3pWSrXG1AZAXYH41uboThrXAFoxNJ5MGS7+c0I+qOXTKWR7Cs1tzAxe9HDfMaDihPWn J3JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nlUSMCNM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a170902d89100b001ac4e2d2b58si2311180plz.112.2023.06.03.02.46.55; Sat, 03 Jun 2023 02:47:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=nlUSMCNM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbjFCJ14 (ORCPT + 99 others); Sat, 3 Jun 2023 05:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbjFCJ1z (ORCPT ); Sat, 3 Jun 2023 05:27:55 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE3F9E48; Sat, 3 Jun 2023 02:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685784473; x=1717320473; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=pdvmuC2wyW2a7AD5zT1/NjQSBP98ch0K0/460XXGMZU=; b=nlUSMCNMMY0ehLsukjtWCFfY6oPBtq533ee84WI6/bp5JYwF0kxJBVpZ 8SVvqwTLkA/DtaZ2KpdxOcXBbvLKQbZXqQ1khnkrYYJ+Wo+xY/LR1Dhxq vJYC69zkx8/YBMaceq1zigpulxl76sgBkuYi6gcNV+RHDkPA4xD1KTict zf4ZyBLtTqRY4r0nAXSIro7AATMsT64RI1iRo2o5GnJ61FDLPARB3BHMM F/vAvNyt3Cq/liOrraBvpaj0GI/RmzIqr45S11zTYCElr07Qqc4y8Kbjb jOcD6Pp5xGvUOEMlUjfHB7LA4SWoN5/aHp5N4Tt2TvQyD6TpGp1+1HxW+ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10729"; a="419591916" X-IronPort-AV: E=Sophos;i="6.00,215,1681196400"; d="scan'208";a="419591916" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2023 02:27:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10729"; a="658529048" X-IronPort-AV: E=Sophos;i="6.00,215,1681196400"; d="scan'208";a="658529048" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by orsmga003.jf.intel.com with ESMTP; 03 Jun 2023 02:27:51 -0700 Date: Sun, 4 Jun 2023 01:27:21 +0800 From: Xu Yilun To: Nava kishore Manne Cc: mdf@kernel.org, hao.wu@intel.com, trix@redhat.com, michal.simek@amd.com, linux-fpga@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alfonso Rodriguez Subject: Re: [PATCH v2] fpga: zynq-fpga: Ensure proper xCAP interface switch Message-ID: References: <20230531095624.1802757-1-nava.kishore.manne@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230531095624.1802757-1-nava.kishore.manne@amd.com> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-05-31 at 15:26:24 +0530, Nava kishore Manne wrote: > From: Alfonso Rodriguez > > The Zynq platform has PCAP, ICAP and JTAG interfaces for configuring > programmable logic (PL). The existing driver implementation uses the > PCAP interface to configure the PL. Before switching the PL configuration > interface from PCAP to ICAP make sure that all outstanding Transactions > relevant to the PL configuration should be completed by the PCAP interface > otherwise it may lead to PL configuration issues. > > This patch provides a required fix to ensure that all existing PL > transactions are completed before switching from PCAP to ICAP. > > For detailed information relevant to PL configuration interfaces refer > Zynq 7000 TRM (section 6.5.1). > Link: https://docs.xilinx.com/v/u/en-US/ug585-Zynq-7000-TRM > > Signed-off-by: Alfonso Rodriguez > Signed-off-by: Nava kishore Manne > --- > Changes for v2: > - Updated commit message and added Doc link as suggested by Yilun. > > drivers/fpga/zynq-fpga.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c > index ae0da361e6c6..88db9ac36887 100644 > --- a/drivers/fpga/zynq-fpga.c > +++ b/drivers/fpga/zynq-fpga.c > @@ -493,15 +493,16 @@ static int zynq_fpga_ops_write_complete(struct fpga_manager *mgr, > if (err) > return err; > > - /* Release 'PR' control back to the ICAP */ > - zynq_fpga_write(priv, CTRL_OFFSET, > - zynq_fpga_read(priv, CTRL_OFFSET) & ~CTRL_PCAP_PR_MASK); > - > err = zynq_fpga_poll_timeout(priv, INT_STS_OFFSET, intr_status, > intr_status & IXR_PCFG_DONE_MASK, > INIT_POLL_DELAY, > INIT_POLL_TIMEOUT); > > + /* Release 'PR' control back to the ICAP */ > + zynq_fpga_write(priv, CTRL_OFFSET, > + zynq_fpga_read(priv, CTRL_OFFSET) > + & ~CTRL_PCAP_PR_MASK); Don't put the & at the beginning of the line: zynq_fpga_read(priv, CTRL_OFFSET) & ~CTRL_PCAP_PR_MASK); or just: zynq_fpga_read(priv, CTRL_OFFSET) & ~CTRL_PCAP_PR_MASK); 80 lines is not a must now. Others look good to me. Thanks, Yilun > + > clk_disable(priv->clk); > > if (err) > -- > 2.25.1 >