Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1284943rbb; Mon, 26 Feb 2024 04:58:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXQy25g2MRX8MfRxQd6agFSuilvYfB05QjdCPSYVW3p+7Q9XRmCKxf1wqM+AydiqMKtFR79vA58AGNdP0C28nwGGLnWNZcGOIvqWbB3xQ== X-Google-Smtp-Source: AGHT+IGoQBqChqrjYWtREUC12YgrcfcgEUefT1GO7BDwKn59ZBJigM+K+GDprTRYf/XKV1a/jIZp X-Received: by 2002:a17:906:4f95:b0:a3f:52dc:6a21 with SMTP id o21-20020a1709064f9500b00a3f52dc6a21mr4606238eju.14.1708952323205; Mon, 26 Feb 2024 04:58:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708952323; cv=pass; d=google.com; s=arc-20160816; b=D7AVuR6GjWT+LQVIG+Jn3S7g5FEnlrjkzBUubA3dnq0URBnDf0j3HcyJ/Q8zxmFtME t3dav0r7qyRDmocZpjks0l7xjDmYV+a9Dfz37PJ81x5oOLcEG3bA6QbpKpSVRmqVG4t5 lWBtv7L4muibtcOFjZ61bA7bruKh1hXOcBp/V1WcdqIZ24AmEF3XnNWQEJuJr6ATmxb6 J6kaRqlgUmeK7DwAT9Ut2kp8Xre9bXESmL/QQFLg2L16CgMaYpeso23Gw1XPM0qw/xEX f392ljSod0eWVXI47keBSyVOQF41E7FPoCtYebH7yu/q6oIn80n7judo2nMPMD9p0nRv r5gA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=+sQQr+peYYEnOXswFiNkUeMsy99OfbYwShKLJaoetgw=; fh=mWw303S13Qi57x4F7inQ4Prk5BF9rVy99vMKW2j1ESI=; b=oZ5JRW/fkPeIus+veATJgNkilUxm9E4pWQvNrcqW1G1x11NKe9ThWpiEFfkVUlwevJ VP7LkGePLcnQsAFQvFp4r0vmBSn070TL/+xqsUws+uiQAMSqCDJyo8lUxuxd/6lunGh5 xB27gZjc9osd5tFpqtbQjyoeIwkIfZaklRfQgBe6SPbEKWd4fOFSGSJoujlz5rnYYlg6 MRvGooMb6qczKR4sSWPjwuaLmn488OoJTLUigtoEiboZC4m6UYAIdvqSD9fPvBCtBv5w We6ysdnvKOz7NcwkYDvrf6XPx42NGCTIQ+bMPaXj8Yj8FM8nMBIpmxr/LYPpbHWK71l2 hkXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="ks/Xtufv"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-81426-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b11-20020a170906d10b00b00a3e5650df1esi2082731ejz.981.2024.02.26.04.58.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:58:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81426-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="ks/Xtufv"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-81426-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 C6C921F28094 for ; Mon, 26 Feb 2024 12:58:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 84F8C84FCA; Mon, 26 Feb 2024 12:57:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ks/Xtufv" Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 542E97F7F7; Mon, 26 Feb 2024 12:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708952271; cv=none; b=ZNt8mEkc9FPhREvCG2zqepMyge5f1URMi6X3L6QTSnqysXXCvmp84bx0dLIyEczqSzbxNwiWFAUlDj7sAxD06M3xXadTmFmlmyirXYYGyBEqZrAlLxEQsmqYwrw8BYhFS3SBnRPRTBYXIlR2ve/V3hjFDRpmN1lNOnSjsA7NoMw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708952271; c=relaxed/simple; bh=Mu6QlX+1l3Wib4QH76J5+NqbSv2MEuWWAtN2RdipG2Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BMa6Smut3ZhSTB9LdktZ7kcMPusbHpjbQzM+w51FuKUoiRPVv/QSDanScKrlgEqG4yKtceMFucotYV3lVGQ00Hdyja7I79XUtF8mwyuY2QA27L1EX6LE29XO+Sy2jjN1krdwt1qZdxwbJrNB2A5o/gQgdba4HsDdWbmmCiehZUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ks/Xtufv; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2d09cf00214so47607961fa.0; Mon, 26 Feb 2024 04:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708952267; x=1709557067; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+sQQr+peYYEnOXswFiNkUeMsy99OfbYwShKLJaoetgw=; b=ks/XtufvvBwX83l6OXUfBi5nNyvBrZW4aP/6oES1sBqMSYQesEl4o4F8E0cL9y+Kuj xbzFJ8pWIBsZ58nMaB7nh4MP8eRJ/u4XQ965d/vzO8NtO/2ebZUSg/SM1ngiTO6q9U8I JkGMmi0h3ZAjPRriWxHVOlgoAwRhhX5YNVBqHRxDpau6kckpUovYaDS3NgACdUJ2gXr1 PK0DCrRn3lngH35RQVHOQ9LLbuU4JopjkmfwjGhG2AX+Hy6SRa1piFtGN8UauULv3OkV VobOvkDXtBECNddiACjLTEf16uYmmTqXwDluaM+7+Cw3tq7/XzssoTjMqq5w8nw2DsUW tpYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708952267; x=1709557067; h=in-reply-to: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=+sQQr+peYYEnOXswFiNkUeMsy99OfbYwShKLJaoetgw=; b=CeMfjnrxNel66pDVa67pc6JEddZ6BDTwEmVCN6pAwo3b84kVyc7j68U9p6lwFhcSJE ljQe0TBihVf1Phv57dc7v6qCftLGKin3XqSrwJ9lqFyZJS4gJdXd7DEEFWHmLqCy1E8H Racn4DjfOcL1l9cWtLwcCOJbZwnxhnjCI3gh15V9E8hoE0FbQ8E4wZmu4mA1yLdlLiUy gGHlAdzOQ4vnoE8V9uAkPy9S2wzmaw4ImJEklVk8i4j/2z/V3FoaeacDGNyG1H8h93At 4oSga3PHkptCN17VABDfiJWTTg3i3MyPXPCBLyWxCzS2MZiT/MJAd2Hv67hO3HOy1UgY aQ8Q== X-Forwarded-Encrypted: i=1; AJvYcCUW4OYaPfBFO+o+106VFDvyEd4IUDhdFzXSb2F3O/IK3z/aschcnuU9mIE2pwr3QgCIkdYggsuhrH0ztYzwKDTV/BmVe1KFTaoc8SDcMap8y8JAssxzm/MoD+PI0V0x4VOSC/MprMsmVif4Jqf/V2OUahK/R5c7bk/HbnhJ1GTbHqO2y0YOOluhH7cEumOLVF9h/og1Qkz9d8wKUICDo0mcLv2Dyvby0mjg X-Gm-Message-State: AOJu0Yya3G592pDrjlc7hHpPLk0iv03Fk3bGZxXHGnAK+BB1/R34rGg/ Wuzwls2yGBMOPmFul77kavUq1pgiVp+FQTjt6hxRx50St9o7jRvm X-Received: by 2002:a2e:9b94:0:b0:2d2:4465:113e with SMTP id z20-20020a2e9b94000000b002d24465113emr4137164lji.20.1708952267164; Mon, 26 Feb 2024 04:57:47 -0800 (PST) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id e21-20020a2e9855000000b002d0b33c1571sm870921ljj.26.2024.02.26.04.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:57:46 -0800 (PST) Date: Mon, 26 Feb 2024 15:57:44 +0300 From: Serge Semin To: Manivannan Sadhasivam 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 , 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: 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=us-ascii Content-Disposition: inline In-Reply-To: <20240226-dw-hdma-v3-3-cfcb8171fc24@linaro.org> 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. > > 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 Reviewed-by: Serge Semin -Serge(y) > --- > 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 >