Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1767744rbb; Mon, 26 Feb 2024 23:45:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUpzEQd5RdpJqI+FnxK1/Hv1/v1SJSIFmoeEGRrmP5lXIuIVpYjj5DBix+O/Pv7nAClsPJxdmIdB16cUWZGc81H6qMWIeIEwofYLw1JEg== X-Google-Smtp-Source: AGHT+IFsXuJBcswx1OKCxTWpBQMXcJXfBZGXnt7WE1r/E1G7Gtn6h426eXoM2okdL11HZ7DnMI4m X-Received: by 2002:ac2:5fc1:0:b0:512:b075:4a25 with SMTP id q1-20020ac25fc1000000b00512b0754a25mr5331015lfg.41.1709019952711; Mon, 26 Feb 2024 23:45:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709019952; cv=pass; d=google.com; s=arc-20160816; b=mXHqH9ogdqqlcXdccdfKZDzffKw+7eTvsLshH/1thBGf3fEO1Gnn6oGwpvK/V9pF+8 MnxEpk6ceVFTK2pSxEEhO9FUmGtkSp8TtAcG2jsaKPzYk1xc8OkGXLgUWxGZhEoM5aR6 h8f4OA6VP/tHCz8DL8S6rFjos3sIPuEYKarUtfxY1jmgKcsAftopheU/kifjxbxd85SD Aa7A0Edp1leZ9Po1EwzQSqU6cb1usiL1ELJpcxNxQiiDfWITpmw/zr4dW2Yfq3rH4ka3 BHlSwkypfvUwmFxnLwqA9/ZdLdyb/d5XpfK1yO/dHjYicuTRM2BzOcN5BAuyAYxIihnj vxIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vz+b24keEy8SKVGT/zsCqIzqYg8F8QonmdaHU6M1RMQ=; fh=3g7UCD/fwQ2hVHNT6jzlykuoe29vV0rlSLNUl91MAek=; b=SXivFwVVNiUFW88Gy1mPo+bOfB1SchSOKzoP0AfH3SdBO/NxQAgyF7uUYBlD8uEGm6 x+7XVKGrgsQN1Q2Dr5AAVANA1O3wSaqfRpS1n/xvHgm7VFuIDm971CHmqTFnE1Crn0lT t3cfwKyDpTkgCWosvWqdZrw6NMONFFUr16POQ9fSC+2NNnEa/VOArLZdFYTEuYVR/EAM mqdC7tDaT6I3oAWy1wvFht14LYUNTA8Z6Zz9Yir3zpkQewuTt5qrvK/toqAurjmjVTvG wYBtxXmujolpj8IRJ3X2i/6nv0V99kwE6CIsnLvQVXKUvLXR99a+kl2lE8IsqCNy63eC oDqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uAzeuhSk; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-82821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f4-20020a170906048400b00a433a980127si478447eja.943.2024.02.26.23.45.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 23:45:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uAzeuhSk; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-82821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7683B1F23351 for ; Tue, 27 Feb 2024 07:45:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1D6A54FA6; Tue, 27 Feb 2024 07:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="uAzeuhSk" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 555BE54F83 for ; Tue, 27 Feb 2024 07:45:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709019943; cv=none; b=QKRDN1OvbcIfHEeW7/3y6BjUzoB6xMvzkIS3OG1AxO6N7lzRewu2JeKrfurzvPG74SHPQjAiew/sVDLC5Kba3EK7vd9m3v5pNuNqhy1dzSU7XElf63PB3VcYko9SWqloLZz+8BpICcKmYVPPb9PyFUsH7nzpY4NJjaoD+9wTuaQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709019943; c=relaxed/simple; bh=LHY1soh3TSDneqtCq2eVyxDXi8p5oUsCqKFJ1MDn28Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OiO5hTY6HqWhPFeWxcZjcshCOxf6BrXusNUFzHp9p6MOACOzx0uZTnQEkaj8DhNJ6uY4DvDpTL+vr17qwrW65icUnhC5urc3OED/sthqG/tUn7U/L16puj/pv7Rw+y0PGfsdLs+jPNmTgYArlrTR+IGHJG+Sb1ckn/UjkCVvga4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=uAzeuhSk; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d94b222a3aso40444525ad.2 for ; Mon, 26 Feb 2024 23:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709019942; x=1709624742; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=vz+b24keEy8SKVGT/zsCqIzqYg8F8QonmdaHU6M1RMQ=; b=uAzeuhSkOi5XC1Q0+LXKPKFqfcxiFqsB8qz0ePNLB5Ake664f9qZtlJr11kjCjTM3k 5XSJOvLPth+sySUqR76VsavJ38Ce2Wb77YyOw++TwqOkGmAs7n24lYUwfJPMOZfeTjUB jbVH1AKHaV/NlTPoPUnC5inlX0LGqhmIQao1TdsAoSoFrYF1D6OHK5cT+kflJzY5VdkJ /148x+GZ5g6WmLtcOPQVkpuEZRgH6EIiR1Tg1NZAnz03+ZWZ9YdUq+isPrk9d2fUVReK yHYMfKVXQ1qSFTdYD0MPAK8JaWLFrK6ceXpTVMJtVYCHdqTAVCf9ImO5iIRxAkjnUJH5 gvxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709019942; x=1709624742; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vz+b24keEy8SKVGT/zsCqIzqYg8F8QonmdaHU6M1RMQ=; b=eV+p6rI4EXKJvh6SdpjQWInw+87GsKdmrG1VQJwbBuSRPcc/wFAoEJFzALs8+MC6qJ D405MK1k5pEmH5MJ0RwIiy4C+J4vlmr2D/DIWNKcKgzNqiO+rVrMqeQsMFCZO6cYsLPN NUZhnamli1YW48L/SYVdxv7a64En/3CXgXqcU0oe2/ToUvMxVJH5rr8wTiCLuw66AAVQ 97JMKueH1EZ4Q1EaHlkwGC4dRJwSB3u6kRi80ebObCTDFYAKUB7Dj/eW1YM3U64eX9gR FITlr2EIoFyN7/OyknJ5NDtDeY3zhdVj7wdnQVInQuhS3IG9B9Njhu7yihVwnpHOgM7J BYCw== X-Forwarded-Encrypted: i=1; AJvYcCXHvoQVw8Zq28xzYn2D1nctwI+uR7J07hHMcefwVcZGqJqyh005abUupJ+HjnUNMHTBpiQc6RNcnasQ1r1sZum7ZHGEkPOBk5W7/WVb X-Gm-Message-State: AOJu0YyNrenPk9CfDrWZ/paXds7an169ce+DOkMC2khp8mXnFMLvqmyk Uzya2rR02Lr7ZKsoDq7y3TUlb2L9BTGabll1jr9fAte+I2z4BF3KCRrWv7KKoA== X-Received: by 2002:a17:902:db0e:b0:1dc:b77e:1973 with SMTP id m14-20020a170902db0e00b001dcb77e1973mr1593245plx.53.1709019941652; Mon, 26 Feb 2024 23:45:41 -0800 (PST) Received: from thinkpad ([117.213.97.177]) by smtp.gmail.com with ESMTPSA id l20-20020a170902e2d400b001d71729ec9csm884589plc.188.2024.02.26.23.45.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 23:45:41 -0800 (PST) Date: Tue, 27 Feb 2024 13:15:33 +0530 From: Manivannan Sadhasivam To: Frank Li Cc: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Marek Vasut , Yoshihiro Shimoda , Kishon Vijay Abraham I , Serge Semin , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev, Siddharth Vadapalli Subject: Re: [PATCH v3 3/5] PCI: dwc: Pass the eDMA mapping format flag directly from glue drivers Message-ID: <20240227074533.GH2587@thinkpad> References: <20240226-dw-hdma-v3-0-cfcb8171fc24@linaro.org> <20240226-dw-hdma-v3-3-cfcb8171fc24@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Mon, Feb 26, 2024 at 11:30:13AM -0500, Frank Li wrote: > On Mon, Feb 26, 2024 at 05:07:28PM +0530, Manivannan Sadhasivam wrote: > > Instead of maintaining a separate capability for glue drivers that cannot > > support auto detection of the eDMA mapping format, let's pass the mapping > > format directly from them. > > Sorry, what's mapping? is it register address layout? > Memory map containing the register layout for iATU, DMA etc... - Mani > Frank > > > > > This will simplify the code and also allow adding HDMA support that also > > doesn't support auto detection of mapping format. > > > > Suggested-by: Serge Semin > > Reviewed-by: Siddharth Vadapalli > > Signed-off-by: Manivannan Sadhasivam > > --- > > drivers/pci/controller/dwc/pcie-designware.c | 16 +++++++++------- > > drivers/pci/controller/dwc/pcie-designware.h | 5 ++--- > > drivers/pci/controller/dwc/pcie-rcar-gen4.c | 2 +- > > 3 files changed, 12 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c > > index ce273c3c5421..3e90b9947a13 100644 > > --- a/drivers/pci/controller/dwc/pcie-designware.c > > +++ b/drivers/pci/controller/dwc/pcie-designware.c > > @@ -894,18 +894,20 @@ static int dw_pcie_edma_find_mf(struct dw_pcie *pci) > > { > > u32 val; > > > > + /* > > + * Bail out finding the mapping format if it is already set by the glue > > + * driver. Also ensure that the edma.reg_base is pointing to a valid > > + * memory region. > > + */ > > + if (pci->edma.mf != EDMA_MF_EDMA_LEGACY) > > + return pci->edma.reg_base ? 0 : -ENODEV; > > + > > /* > > * Indirect eDMA CSRs access has been completely removed since v5.40a > > * thus no space is now reserved for the eDMA channels viewport and > > * former DMA CTRL register is no longer fixed to FFs. > > - * > > - * Note that Renesas R-Car S4-8's PCIe controllers for unknown reason > > - * have zeros in the eDMA CTRL register even though the HW-manual > > - * explicitly states there must FFs if the unrolled mapping is enabled. > > - * For such cases the low-level drivers are supposed to manually > > - * activate the unrolled mapping to bypass the auto-detection procedure. > > */ > > - if (dw_pcie_ver_is_ge(pci, 540A) || dw_pcie_cap_is(pci, EDMA_UNROLL)) > > + if (dw_pcie_ver_is_ge(pci, 540A)) > > val = 0xFFFFFFFF; > > else > > val = dw_pcie_readl_dbi(pci, PCIE_DMA_VIEWPORT_BASE + PCIE_DMA_CTRL); > > diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h > > index 26dae4837462..995805279021 100644 > > --- a/drivers/pci/controller/dwc/pcie-designware.h > > +++ b/drivers/pci/controller/dwc/pcie-designware.h > > @@ -51,9 +51,8 @@ > > > > /* DWC PCIe controller capabilities */ > > #define DW_PCIE_CAP_REQ_RES 0 > > -#define DW_PCIE_CAP_EDMA_UNROLL 1 > > -#define DW_PCIE_CAP_IATU_UNROLL 2 > > -#define DW_PCIE_CAP_CDM_CHECK 3 > > +#define DW_PCIE_CAP_IATU_UNROLL 1 > > +#define DW_PCIE_CAP_CDM_CHECK 2 > > > > #define dw_pcie_cap_is(_pci, _cap) \ > > test_bit(DW_PCIE_CAP_ ## _cap, &(_pci)->caps) > > diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c > > index e9166619b1f9..3c535ef5ea91 100644 > > --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c > > +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c > > @@ -255,7 +255,7 @@ static struct rcar_gen4_pcie *rcar_gen4_pcie_alloc(struct platform_device *pdev) > > rcar->dw.ops = &dw_pcie_ops; > > rcar->dw.dev = dev; > > rcar->pdev = pdev; > > - dw_pcie_cap_set(&rcar->dw, EDMA_UNROLL); > > + rcar->dw.edma.mf = EDMA_MF_EDMA_UNROLL; > > dw_pcie_cap_set(&rcar->dw, REQ_RES); > > platform_set_drvdata(pdev, rcar); > > > > > > -- > > 2.25.1 > > -- மணிவண்ணன் சதாசிவம்