Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1064136rdb; Fri, 9 Feb 2024 09:10:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCDuh71WBBfK8JF2rwUj+N06Bj3DTUGscpPK2Tv2uzfgwrsM4FkoB47VVQMs/dZMpjopLR X-Received: by 2002:a67:e218:0:b0:46b:1a1d:1c33 with SMTP id g24-20020a67e218000000b0046b1a1d1c33mr1909778vsa.9.1707498650978; Fri, 09 Feb 2024 09:10:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707498650; cv=pass; d=google.com; s=arc-20160816; b=0W5PSk5J13O8yCgP7EWpTUlzfZT5eszi85m/AfaG/8H3LY/Y+Y38pWut60BwUciLDK Ybyefbeeb+pOOlcPvbyKwsuJxIlztnn9G4KukYMRw4HEMllLFHfm2przFSQMbNXEapgY LlzffywKZh9Ov6Dmxi1bpHSJcggeT5JC5Kv6b1gjPDkjFpcPdv+QIH5e05bSXXI5jw0S Y7jCA8ndaTwzQizFMRp8n5FlbYXT7DxLzAgdKLlGjQaoNZ43TlGgHGbbtz0s5wKMNe6M 200fMseaueKT5kvpl0mWxNkIYNwzmHLtYvPaxjxf0fFEFVHepgEQHb6Q176RODQiat0U mLLQ== 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:message-id:subject:cc:to:from :date:dkim-signature; bh=Owr7uTXDB7dSx3vhdEO5+gnw7ewgyGqLC551VN2yBj0=; fh=ZsPT48SCVdQXsdtGHy8w6ymu0JxcC8Px/UjL2Gq8HfU=; b=KpEiOuZX6QR9c7gyrAlQEb71wOQIW6oaTMbn9t1wyB+L1eUDyZtsZMIOYkeD2PAXjb xylh+O1tEje5w8Spk2rYonDR03ckU0rrDrHYtX5v7xv8Iwdewq5Oy7eGehx3U/2guLyo 0GX3Hy2tQOzqVeEzJKRLY8cL4Y8DzoFk8oE/STsNnioNrNf771wn+FdphiVzKV5PP1s3 sleJDiASAkIBc2k7NBIqPLW2vY4jxgtoE6Dgj0FfT2sjsg+Q8vKaHfHlrsGEiyY3tg88 /ms4A8lqQ8uFwi+NeEPf95FCBA1f//TJ4m/BTaWrCXifcXEHHtj1v/Y698ICShfJ9uui 2q6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b/Ntb0GA"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59702-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59702-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWmzDttGVF/T7/kAVMBMA6qma6WOdemFh9IjZVYmKBkswDRq/i99DePaCQGM8gRry8cRSGX+SULyVn/cbGaDu9ZBzUmxLAVNG9NVpsHcA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j5-20020a67ef05000000b0046b057c1e2esi348011vsr.245.2024.02.09.09.10.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 09:10:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59702-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b/Ntb0GA"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-59702-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59702-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D5A8D1C2087C for ; Fri, 9 Feb 2024 17:10:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C0037BB02; Fri, 9 Feb 2024 17:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b/Ntb0GA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B52FE6DD18; Fri, 9 Feb 2024 17:10:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707498634; cv=none; b=qIWDCNk4BJM14cIAZks0epRFB+I7z0jAJF+Yi/OzrSFJxIFRjH+imfjx7SESsFih/wbGlsc0hosQ+F0y7tjz5d1P2vJmT+b9bFiD4ybK7cJP8Ts69uTBlwVYsR/BdONA2L8Ia/2e9YDiwAxr2DGBf6hbq+PbeKJ59H+8O4Xn8sI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707498634; c=relaxed/simple; bh=1DJyQGZWkyINk+0P2VsSNjoETpjN/mE2UKBByCakbuc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=QUdFuQXXx0oV0s4UARDZryBv8s0GSm54hMEbICMBL6PopFWdsVL+BEIT6enDcPOxFZ1MD4nf3hHvTu7IImAyCVZrJhXg35jHyO3lpBp/83BMh6Fzmxi1XHfl5skZ+C458d8oFhqEhLpWTp6ULvVEdFWBOEENG+sC6N2oEVkXRzI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b/Ntb0GA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2009C433F1; Fri, 9 Feb 2024 17:10:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707498634; bh=1DJyQGZWkyINk+0P2VsSNjoETpjN/mE2UKBByCakbuc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=b/Ntb0GAdQuPhorZNPOqkKxNKtS8/IC3CPaCzUNDjuhbYzgUQQpN1nmdSRvATUagt qR9FDSA7njDGtlOYo+Zr0LP43Yo+UHHd20nwenjRUDNlOxOJcwoh4KlYQ5IGHF6Vdu niQeED7H47m8v8MBn/PUy5rKWUTsf6A1c1IKtB0fAm75YTEE+pqEhfcoe67FWUJlZN FJlS+9EPDJKcR+ZnaskzZ3CYg7565Pehp9v35jt2ROMid1UdTUNQX0yBUEfpo5VObV v86ez5zUEaMr2Ym5FD/N5JAAciRcNcGrxxCM3Kn+eU0e5awsgmKEyLUo5ltCbxn+NR qlATClLOoxEzA== Date: Fri, 9 Feb 2024 11:10:32 -0600 From: Bjorn Helgaas To: Serge Semin Cc: Mrinmay Sarkar , vkoul@kernel.org, jingoohan1@gmail.com, conor+dt@kernel.org, konrad.dybcio@linaro.org, manivannan.sadhasivam@linaro.org, robh+dt@kernel.org, quic_shazhuss@quicinc.com, quic_nitegupt@quicinc.com, quic_ramkri@quicinc.com, quic_nayiluri@quicinc.com, dmitry.baryshkov@linaro.org, quic_krichai@quicinc.com, quic_vbadigan@quicinc.com, quic_parass@quicinc.com, quic_schintav@quicinc.com, quic_shijjose@quicinc.com, Gustavo Pimentel , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Kishon Vijay Abraham I , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev Subject: Re: [PATCH v1 3/6] PCI: dwc: Add HDMA support Message-ID: <20240209171032.GA1004885@bhelgaas> 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: On Sat, Feb 03, 2024 at 12:40:39AM +0300, Serge Semin wrote: > On Fri, Jan 19, 2024 at 06:30:19PM +0530, Mrinmay Sarkar wrote: > > From: Manivannan Sadhasivam > > > > Hyper DMA (HDMA) is already supported by the dw-edma dmaengine driver. > > Unlike it's predecessor Embedded DMA (eDMA), HDMA supports only the > > unrolled mapping format. So the platform drivers need to provide a valid > > base address of the CSRs. Also, there is no standard way to auto detect > > the number of available read/write channels in a platform. So the platform > > drivers has to provide that information as well. > ... > Basically this change defines two versions of the eDMA info > initialization procedure: > 1. use pre-defined CSRs mapping format and amount of channels, > 2. auto-detect CSRs mapping and the amount of channels. > The second version also supports the optional CSRs mapping format > detection procedure by means of the DW_PCIE_CAP_EDMA_UNROLL flag > semantics. Thus should this patch is accepted there will be the > functionality duplication. I suggest to make things a bit more > flexible than that. Instead of creating the two types of the > init-methods selectable based on the mapping format, let's split up > the already available DW eDMA engine detection procedure into the next > three stages: > 1. initialize DW eDMA data, > 2. auto-detect the CSRs mapping format, > 3. auto-detect the amount of channels. > and convert the later two to being optional. They will be skipped in case > if the mapping format or the amount of channels have been pre-defined > by the platform drivers. Thus we can keep the eDMA data init procedure > more linear thus easier to read, drop redundant DW_PCIE_CAP_EDMA_UNROLL flag > and use the new functionality for the Renesas R-Car S4-8's PCIe > controller (for which the auto-detection didn't work), for HDMA with compat > and _native_ CSRs mapping. See the attached patches for details: I am still bound by the opinion of Google's legal team that I cannot accept the code changes that were attached here. I think it's fair to read the review comments (thank you for those), but I suggest not reading the patches that were attached. Bjorn