From patchwork Mon Aug 6 12:20:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 175332 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CA2862C00A3 for ; Mon, 6 Aug 2012 22:21:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756086Ab2HFMUw (ORCPT ); Mon, 6 Aug 2012 08:20:52 -0400 Received: from co1ehsobe003.messaging.microsoft.com ([216.32.180.186]:45423 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756055Ab2HFMUv (ORCPT ); Mon, 6 Aug 2012 08:20:51 -0400 Received: from mail71-co1-R.bigfish.com (10.243.78.241) by CO1EHSOBE016.bigfish.com (10.243.66.79) with Microsoft SMTP Server id 14.1.225.23; Mon, 6 Aug 2012 12:20:50 +0000 Received: from mail71-co1 (localhost [127.0.0.1]) by mail71-co1-R.bigfish.com (Postfix) with ESMTP id 5F9E274006E; Mon, 6 Aug 2012 12:20:50 +0000 (UTC) X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null); IPV:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI X-SpamScore: -7 X-BigFish: VPS-7(zz98dI179dNzz1202hzz8275bhz2dh668h839h944hd25he5bhf0ah) Received: from mail71-co1 (localhost.localdomain [127.0.0.1]) by mail71-co1 (MessageSwitch) id 1344255648756369_13472; Mon, 6 Aug 2012 12:20:48 +0000 (UTC) Received: from CO1EHSMHS017.bigfish.com (unknown [10.243.78.240]) by mail71-co1.bigfish.com (Postfix) with ESMTP id ACA7E800044; Mon, 6 Aug 2012 12:20:48 +0000 (UTC) Received: from ausb3twp01.amd.com (163.181.249.108) by CO1EHSMHS017.bigfish.com (10.243.66.27) with Microsoft SMTP Server id 14.1.225.23; Mon, 6 Aug 2012 12:20:48 +0000 X-WSS-ID: 0M8C2AM-01-3SL-02 X-M-MSG: Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com [163.181.249.73]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Axway MailGate 3.8.1) with ESMTP id 2E6E91028005; Mon, 6 Aug 2012 07:20:46 -0500 (CDT) Received: from SAUSEXDAG01.amd.com (163.181.55.1) by sausexedgep02.amd.com (163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.192.1; Mon, 6 Aug 2012 07:20:51 -0500 Received: from storexhtp02.amd.com (172.24.4.4) by sausexdag01.amd.com (163.181.55.1) with Microsoft SMTP Server (TLS) id 14.1.323.3; Mon, 6 Aug 2012 07:20:46 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp02.amd.com (172.24.4.4) with Microsoft SMTP Server id 8.3.213.0; Mon, 6 Aug 2012 08:20:45 -0400 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id D625349C2B0; Mon, 6 Aug 2012 13:20:44 +0100 (BST) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id 363F71018A0; Mon, 6 Aug 2012 14:20:53 +0200 (CEST) Date: Mon, 6 Aug 2012 14:20:53 +0200 From: Joerg Roedel To: Alex Williamson CC: , , , , Subject: Re: [PATCH 0/2] Fix ACS path checking Message-ID: <20120806122053.GL1996@amd.com> References: <20120804180155.6144.83332.stgit@bling.home> <20120806105010.GK1996@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120806105010.GK1996@amd.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginatorOrg: amd.com Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Mon, Aug 06, 2012 at 12:50:10PM +0200, Joerg Roedel wrote: > On Sat, Aug 04, 2012 at 12:08:46PM -0600, Alex Williamson wrote: > Hmm, tried it here, At least pci_request_acs() still gets called. How do > you detect if ACS is really enabled? Okay, I found a problem. pci_request_acs needs to be called before PCI probing. Does the attached patch help? From 87a4363be30d5d015a984a60769f29b0607fc5fb Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Mon, 6 Aug 2012 14:18:42 +0200 Subject: [PATCH] iommu/amd: Fix pci_request_acs() call-place The pci_request_acs() function needs to be called before PCI probing to be effective. So move it to another call-place to ensure that. Signed-off-by: Joerg Roedel Tested-by: Alex Williamson --- drivers/iommu/amd_iommu_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 500e7f1..0a2ea31 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c @@ -1131,9 +1131,6 @@ static int __init amd_iommu_init_pci(void) break; } - /* Make sure ACS will be enabled */ - pci_request_acs(); - ret = amd_iommu_init_devices(); print_iommu_info(); @@ -1652,6 +1649,9 @@ static bool detect_ivrs(void) early_acpi_os_unmap_memory((char __iomem *)ivrs_base, ivrs_size); + /* Make sure ACS will be enabled during PCI probe */ + pci_request_acs(); + return true; }