Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4863894imm; Tue, 9 Oct 2018 06:27:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV63i7tYh0W5UIlFi2584LEl88cm/+wZlF+qAQnLDmBXMZV0i3p3mVxhOndcmRk5TabYvAFT3 X-Received: by 2002:a63:1f64:: with SMTP id q36-v6mr8115021pgm.88.1539091643981; Tue, 09 Oct 2018 06:27:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539091643; cv=none; d=google.com; s=arc-20160816; b=M29VYC/XgUM57AHE8ahPPEcdwS5EbOEdoXKezOCvcyWJsyQ7txVdDK4JBIyDD+3P8X PlvEh3hyVI/bnKSFwxAkPJsXWPELJm8/CFSbzMDv8c9fDxOoMHffUIOzNMahZ1/6NBoY bdLQ+M4S080yzgCLzuWtNEy4Pa2y/AGu832zx56UGIE/UXleM0WRHGrQC6Cgu2wUZw85 MuJ1y7mPX+mEehJS/YO+KOTYo+gtEz594kYQ4MLuuuVzmdPvUT514dXuTIea5rG1M3eG 0bmKL3983ybUNkOcKhdYQv6bOveBPo5Bs+IUOhxVFG7A4y/rZerX/mcKdfIB/uzbnQxY 2c/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+X8AkMvhaCh2A6t5uXBVRn35aMYZZ+/hh9Cwb5Qv+ts=; b=Js30elQknA7+RtiCdH1Kus4LkznoQPiKT+w0RzUDE/vaYZEjbAQmFL1se9dy8hziFZ mz4FIlyaLoq2Pz4hIr6/ZoyUXYyw8hTUqlNQ1NE1NkYYVttul7ZKUmw2ge9q3DdwTHjM gLIyjFcoAGjnDBdPTeIgynvYkemRgkTOhiuwGPavJknAcsN1vc2i2hBZhPF4RQEeh/Q4 aJ/2ZLN7QpiSq7ixcsFalUcpkLGmDfgIEzA0Y23SAvFf6aVZkeNy5Gp34rXU/ss5J7Nq g01N+gPBpvH0ixjhKMTLJuqFAffrytQ8iTVjL4Y9ElCZ2Kaedi+UlrqlPzAnIsUkgHq6 +qGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rpyLZ6Yv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3-v6si20721862plz.353.2018.10.09.06.27.09; Tue, 09 Oct 2018 06:27:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rpyLZ6Yv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727583AbeJIUnM (ORCPT + 99 others); Tue, 9 Oct 2018 16:43:12 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49592 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727477AbeJIUnK (ORCPT ); Tue, 9 Oct 2018 16:43:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+X8AkMvhaCh2A6t5uXBVRn35aMYZZ+/hh9Cwb5Qv+ts=; b=rpyLZ6YvZXHfiGUtIIrCY/qTI3 NbJFMlXogf9f9yqOcfRPbnZhcyu0MzTVOzBxq/9rnc7ArXxSu6Zjv07gqCTZS+pfOi3a5opVFMut5 R2HBm6b201wRWNUTC/xmvVRZLqZanoVvu5VbAmOgb8s2QERa9LBR0qTpEVBJmXTgNrXAQNae3/2tQ QUYwo68x4wPzlMOkbR4ukjwJN3SxuJTFdTQ1ocfY6d6tZW+P21kFrBQIGH1LyUXROGkqLNTpap1ga kZakTm2C41zhMHGd23oBHeyEWYzDYMFKao3HxrDenHxHyF0mXxB7f24YLHII5yKeTzYi96i2xHobh smXPsyoQ==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g9s13-0001CT-Uu; Tue, 09 Oct 2018 13:25:38 +0000 From: Christoph Hellwig To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/33] powerpc/powernv: remove pnv_pci_ioda_pe_single_vendor Date: Tue, 9 Oct 2018 15:24:42 +0200 Message-Id: <20181009132500.17643-16-hch@lst.de> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181009132500.17643-1-hch@lst.de> References: <20181009132500.17643-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function is completely bogus - the fact that two PCIe devices come from the same vendor has absolutely nothing to say about the DMA capabilities and characteristics. Signed-off-by: Christoph Hellwig --- arch/powerpc/platforms/powernv/pci-ioda.c | 28 ++--------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index cde710297a4e..913175ba1c10 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -1746,31 +1746,6 @@ static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *pdev */ } -static bool pnv_pci_ioda_pe_single_vendor(struct pnv_ioda_pe *pe) -{ - unsigned short vendor = 0; - struct pci_dev *pdev; - - if (pe->device_count == 1) - return true; - - /* pe->pdev should be set if it's a single device, pe->pbus if not */ - if (!pe->pbus) - return true; - - list_for_each_entry(pdev, &pe->pbus->devices, bus_list) { - if (!vendor) { - vendor = pdev->vendor; - continue; - } - - if (pdev->vendor != vendor) - return false; - } - - return true; -} - /* * Reconfigure TVE#0 to be usable as 64-bit DMA space. * @@ -1871,7 +1846,8 @@ static int pnv_pci_ioda_dma_set_mask(struct pci_dev *pdev, u64 dma_mask) */ if (dma_mask >> 32 && dma_mask > (memory_hotplug_max() + (1ULL << 32)) && - pnv_pci_ioda_pe_single_vendor(pe) && + /* pe->pdev should be set if it's a single device, pe->pbus if not */ + (pe->device_count == 1 || !pe->pbus) && phb->model == PNV_PHB_MODEL_PHB3) { /* Configure the bypass mode */ rc = pnv_pci_ioda_dma_64bit_bypass(pe); -- 2.19.0