Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1689394rdb; Tue, 20 Feb 2024 04:17:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVty8hfqoCtAB8KCQBZGKM0uhT6m3kKJ2oiLZdZiTcFQOo2QOigZSk8hVUXet1YsFQPeyS2I8UY3uKNSm4cFZoqc5Gw2uQh34aa+XQpng== X-Google-Smtp-Source: AGHT+IGbLOJiZaIru8neJeiryRuFM/Y4KfEQ3ovWUchd/+9V9ZTXfaiHUSQMYcBYr/BECzK+dtwa X-Received: by 2002:ac8:5904:0:b0:42d:ca01:b34b with SMTP id 4-20020ac85904000000b0042dca01b34bmr16704913qty.63.1708431435098; Tue, 20 Feb 2024 04:17:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708431435; cv=pass; d=google.com; s=arc-20160816; b=U5DZ26Zxc6M/yqDTvHmNI6l95BUKhoj9qLCIlCAAK6H5lltuXjtFvdfsHrGY1D3RO4 HrBnVuZTvTD2C7jO9kzAJE/gcciiodbHIdIvn2ygNcgz7kglqfSV/oYUELFmoo1DqSpo NYwD59KOIVmQn1SyE3nP5TbDHetTFaPADzbErtTrasXmiRDnY2GoYUJpuJjC2SyEBdHd vEU0WZicHESB7uMobtF6qr178NsnoWg8NXsloDVJB/awTzlbwZlguaLAcRORYJZfjMJQ hmWSG9l6WSya/6mUEHyF2kMmNkBguNPXsVVwKi4m9Hi7Lxq+p1Kz/omS2VL1qAkOYtN5 GfzQ== 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=f49BhYgJyLuE/o45+NLSNDNwUWoJs76kpw5ZamvBdI8=; fh=83KLdB8erCI9iH5W+nzbdFVAV5008SJOKhAMYJM3aPk=; b=gEAMTaPSXY5HUtaMEqG+X00KvBl2fsDSENstHQCAUNi0+7r2+PcQwq+9EZxOG3QFie jtcdEYHSTZvHNw76OKuUulaNzGGxbTePaH2xgCesfD9TTDPUwvV/orP6eYu4Gm37o6F3 RzCVqVLeE+3LanllzQOuh4DONQaGZvZwWsKOUhE/cuWu4dBM8KPi5l/TRLGjZDH00MjD eZTh6nMaLeuj3+jeVXUq3xbyWmgp+cGqFxlWLXqkDB8KJKLbG3N5Uu4bli5JVIQvEZfE d6aiN/EpIheoL3u0XeFqW8jQlNw3/yCrzoBbWWkP3ss8v62f6sG6sVA6Mkgt+Ho+o+4J P7QA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="yk/5uJXi"; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-72994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72994-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id fp9-20020a05622a508900b0042db20aba5bsi8001989qtb.750.2024.02.20.04.17.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 04:17:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72994-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=@ti.com header.s=ti-com-17Q1 header.b="yk/5uJXi"; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-72994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72994-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D0A811C21D9F for ; Tue, 20 Feb 2024 12:17:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 971EC67C71; Tue, 20 Feb 2024 12:17:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="yk/5uJXi" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 DCCCD67A0F; Tue, 20 Feb 2024 12:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708431425; cv=none; b=INOxaw0zDLwvdGdvKvKEPSrwrdUrD5mMWsxFSdXyGzRs2pWGkgFyCM2ALH3e130XFV5syr0g2CsbK+m2A/ZnIlqbYm+bx/WsQIVsANcVIFQH8WVQJH6p7z3M3aMEW+BqmpCX5ISeiq9NQ5cfyAe8vLMzJJ76z0vyyU7s59tEps0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708431425; c=relaxed/simple; bh=gLdMUU/DtoOkFhFk5vOIoxTOqsoaoZsnPHQ0hzOm94I=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e57Ccoqmcmdl76sIDdePcQSOr297r4ytGx8DINrFes2Sa0Tm8knAKW2o3SSUM4BnzwQ1ZaEnJ88UPFnKLZqkt64jtbbCQIWP6XTsHFuRe6xA6B3F0CHdj7MraS0xoXYDX8MCa9Il1tDV7cCV8lnf5OeNX8HFRt8fnLitzh42Tgk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=yk/5uJXi; arc=none smtp.client-ip=198.47.23.249 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41KCGlLa107974; Tue, 20 Feb 2024 06:16:47 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1708431407; bh=f49BhYgJyLuE/o45+NLSNDNwUWoJs76kpw5ZamvBdI8=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=yk/5uJXixC9+KE/eyWkJlF4kPqmkLCGLICmkyQZdKUYY/30Aj0nxd5cd9NIqT++fl y5RRr9scvM1rv16BDsNwD4zoq/5LkMdFfeTh/qv+3tvdDZmXSMAq7eOsPHafTuUfSt 1Q3n1DWuZu9I/K15mCo014kiCsbT+fzDnYxqnKc0= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41KCGllf033330 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 20 Feb 2024 06:16:47 -0600 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 20 Feb 2024 06:16:46 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 20 Feb 2024 06:16:46 -0600 Received: from localhost (uda0492258.dhcp.ti.com [172.24.227.9]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 41KCGk1i082096; Tue, 20 Feb 2024 06:16:46 -0600 Date: Tue, 20 Feb 2024 17:46:45 +0530 From: Siddharth Vadapalli 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 , Serge Semin , , , , , , Subject: Re: [PATCH v2 2/5] PCI: dwc: Skip finding eDMA channels count if glue drivers have passed them Message-ID: References: <20240216-dw-hdma-v2-0-b42329003f43@linaro.org> <20240216-dw-hdma-v2-2-b42329003f43@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: <20240216-dw-hdma-v2-2-b42329003f43@linaro.org> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 On 24/02/16 11:04PM, Manivannan Sadhasivam wrote: > In the case of Hyper DMA (HDMA) present in DWC controllers, there is no way > the drivers can auto detect the number of read/write channels as like its > predecessor embedded DMA (eDMA). So the glue drivers making use of HDMA > have to pass the channels count during probe. > > To accommodate that, let's skip finding the channels if the channels count > were already passed by glue drivers. If the channels count passed were > wrong in any form, then the existing sanity check will catch it. > > Suggested-by: Serge Semin > Signed-off-by: Manivannan Sadhasivam Reviewed-by: Siddharth Vadapalli Regards, Siddharth. > --- > drivers/pci/controller/dwc/pcie-designware.c | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c > index 3a26dfc5368f..d07747b75947 100644 > --- a/drivers/pci/controller/dwc/pcie-designware.c > +++ b/drivers/pci/controller/dwc/pcie-designware.c > @@ -927,13 +927,15 @@ static int dw_pcie_edma_find_channels(struct dw_pcie *pci) > { > u32 val; > > - if (pci->edma.mf == EDMA_MF_EDMA_LEGACY) > - val = dw_pcie_readl_dbi(pci, PCIE_DMA_VIEWPORT_BASE + PCIE_DMA_CTRL); > - else > - val = dw_pcie_readl_dma(pci, PCIE_DMA_CTRL); > - > - pci->edma.ll_wr_cnt = FIELD_GET(PCIE_DMA_NUM_WR_CHAN, val); > - pci->edma.ll_rd_cnt = FIELD_GET(PCIE_DMA_NUM_RD_CHAN, val); > + if (!pci->edma.ll_wr_cnt || !pci->edma.ll_rd_cnt) { > + if (pci->edma.mf == EDMA_MF_EDMA_LEGACY) > + val = dw_pcie_readl_dbi(pci, PCIE_DMA_VIEWPORT_BASE + PCIE_DMA_CTRL); > + else > + val = dw_pcie_readl_dma(pci, PCIE_DMA_CTRL); > + > + pci->edma.ll_wr_cnt = FIELD_GET(PCIE_DMA_NUM_WR_CHAN, val); > + pci->edma.ll_rd_cnt = FIELD_GET(PCIE_DMA_NUM_RD_CHAN, val); > + } > > /* Sanity check the channels count if the mapping was incorrect */ > if (!pci->edma.ll_wr_cnt || pci->edma.ll_wr_cnt > EDMA_MAX_WR_CH || > > -- > 2.25.1 > >