Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4841194imj; Wed, 13 Feb 2019 01:56:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IbdshxctveRrcAVdzE4VEOecOvALIMM0cm9un21gMyhFTL7KgGB1LlYakV6kxH5gsalyrVV X-Received: by 2002:a65:4807:: with SMTP id h7mr8012955pgs.15.1550051793646; Wed, 13 Feb 2019 01:56:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550051793; cv=none; d=google.com; s=arc-20160816; b=JE+L8p+rBhp9Hrp7ZPgux9WJXYmUebTcmp1MClZ+g1Eyo1DasS4DC4Rdq82xoCnxCg AUwBfm5zeJOi4gar2mj4QpiWRF13qIM/ykJ6njes7yrJp9NUW9mWQilsjjHOBPTtQ/Bx ja/w18VRg7Nge+C0iMglbj/Y9zs8nfE8+wMjy+ItdCiB82AQ8X9hAOSoFaiMOB6d7XhZ vshsQsigRiEWrhdLgYh5v9eQxnK3CBH0xbObeA9r+DAWbI9fosj+Wm2jmv7SFgYVoLXH A9VibOrPW2ZbSFn25YAY5kh5pHQ8AaFg2NtY2YZbwTm5Ym1D86upVioLwysP1P8sHWS5 lXiQ== 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=oftqg/DLnlA4XOQDc02Y6qXG24fb6uUpb//RA0foQtI=; b=FAxVFF09zO1kGFGxvhZ0Hg3fIhk8xibW9FfZ0GA1NNYCr7tmQ4aNWRPdTFUkFuHSPb D87pVOKfWdm4kFr/jB5PFohNtpD6e8hYbeuGItjm6m8pSLeGZ3ekooLkn9JNMeFZ+CYK xUsEOEwme3w/eRRr3ZubNKlnW+N4sKZnOtjuhXUhbmx9ASiQWpyB/IAJ6VKkeYUvz38B xvARSBSlXDTeLwCpZucyxvKzKq5GZ2ZNfTX7XFBzRSJe2HK0rf0q0uFMAelwYlIvN02V V3ND0v9XW+i4ZXILadtwxvqx8lKfeJQHmBQQ/HRsRePaU4YjkScTEe3SvrW0XNYy2jB5 MnYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tmiq2Erq; 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 b1si6425857plc.332.2019.02.13.01.56.17; Wed, 13 Feb 2019 01:56:33 -0800 (PST) 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=tmiq2Erq; 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 S2387606AbfBMHEN (ORCPT + 99 others); Wed, 13 Feb 2019 02:04:13 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:51094 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387584AbfBMHCY (ORCPT ); Wed, 13 Feb 2019 02:02:24 -0500 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=oftqg/DLnlA4XOQDc02Y6qXG24fb6uUpb//RA0foQtI=; b=tmiq2Erql840y6jWpuiCtwJ5l/ 9KYy8hJZZR47nCaUAldopA4uOgw5koo/sMGnt+yyGvvfiyccbUc5OqEywjKRKCPLcc0kBx7iQK5VH RXJzk2dWMyXOmEvZQIcdq/u2eKVtY43cLPrTLKNvMF38iK8d0M/aAKxEuPB+GjTa1h94/QO58HJtG PSyr8ywq56Cq8zPkphAY9h22CJ9fpv76N3encArGpl37j0M3TQsRFr6+Ut5zId18GQsB/UpuokzC/ XlE93qfoNCom58JvVNQ6gPBhLwH4grGWvSss59ESbg2r436Kp9t0/C6X9w8ZV0MQpkSNeo2AnrnUL /AQGEnOw==; Received: from 089144210182.atnat0019.highway.a1.net ([89.144.210.182] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtoYS-0000IR-Oz; Wed, 13 Feb 2019 07:02:01 +0000 From: Christoph Hellwig To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Olof Johansson Cc: linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/32] powerpc/powernv: remove pnv_pci_ioda_pe_single_vendor Date: Wed, 13 Feb 2019 08:01:12 +0100 Message-Id: <20190213070133.11259-12-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213070133.11259-1-hch@lst.de> References: <20190213070133.11259-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 53982f887a7f..d9060a0f4c8e 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -1756,31 +1756,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. * @@ -1881,7 +1856,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.20.1