All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org,
	dwmw2@infradead.org, linux-kernel@vger.kernel.org,
	dsahern@gmail.com
Subject: Re: [PATCH 0/2] Fix ACS path checking
Date: Mon, 06 Aug 2012 08:23:10 -0600	[thread overview]
Message-ID: <1344262990.3441.13.camel@ul30vt.home> (raw)
In-Reply-To: <20120806122053.GL1996@amd.com>

On Mon, 2012-08-06 at 14:20 +0200, Joerg Roedel wrote:
> 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 <joerg.roedel@amd.com>
> 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 <joerg.roedel@amd.com>
> ---
>  drivers/iommu/amd_iommu_init.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)


Yes, that's it.  Before and after:

00:04.0 PCI bridge: Advanced Micro Devices [AMD] nee ATI RD890 PCI to PCI bridge (PCI express gpp port D) (prog-if 00 [Normal decode])
	Capabilities: [190] Access Control Services
		ACSCap:	SrcValid+ TransBlk+ ReqRedir+ CmpltRedir+ UpstreamFwd+ EgressCtrl- DirectTrans+
		ACSCtl:	SrcValid- TransBlk- ReqRedir- CmpltRedir- UpstreamFwd- EgressCtrl- DirectTrans-

	Capabilities: [190] Access Control Services
		ACSCap:	SrcValid+ TransBlk+ ReqRedir+ CmpltRedir+ UpstreamFwd+ EgressCtrl- DirectTrans+
		ACSCtl:	SrcValid+ TransBlk- ReqRedir+ CmpltRedir+ UpstreamFwd+ EgressCtrl- DirectTrans-

The former makes iommu grouping put all my VFs in a single group below
this device.  Correct given the ACS state, but not very useful.  Thanks,

Alex

Tested-by: Alex Williamson <alex.williamson@redhat.com>

> 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;
>  }
>  




  reply	other threads:[~2012-08-06 14:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-04 18:08 [PATCH 0/2] Fix ACS path checking Alex Williamson
2012-08-04 18:08 ` Alex Williamson
2012-08-04 18:08 ` [PATCH 1/2] intel-iommu: " Alex Williamson
2012-08-04 18:08   ` Alex Williamson
2012-08-06  4:51   ` David Ahern
2012-08-04 18:09 ` [PATCH 2/2] amd-iommu: " Alex Williamson
2012-08-04 18:09   ` Alex Williamson
2012-08-06 10:50 ` [PATCH 0/2] " Joerg Roedel
2012-08-06 10:50   ` Joerg Roedel
2012-08-06 12:20   ` Joerg Roedel
2012-08-06 12:20     ` Joerg Roedel
2012-08-06 14:23     ` Alex Williamson [this message]
2012-08-06 17:41 ` Joerg Roedel
2012-08-06 17:41   ` Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344262990.3441.13.camel@ul30vt.home \
    --to=alex.williamson@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.