BUG at drivers/iommu/amd_iommu.c:1436!

2016-11-17 Thread Mark Hounschell
Kernel version is 4.8.0. No failure when the IOMMU is disabled. This is an out of tree GPL driver using pci_alloc_consistent/pci_free_consistent. The free causes this. The commit is: 2d4c515bf06c9bce87b546279413621f847ef6a3 is the first bad commit commit 2d4c515bf06c9bce87b546279413621f847ef6a3

Re: BUG at drivers/iommu/amd_iommu.c:1436!

2016-11-17 Thread Mark Hounschell
On 11/17/2016 04:41 PM, Joerg Roedel wrote: Hi Mark, On Thu, Nov 17, 2016 at 02:13:59PM -0500, Mark Hounschell wrote: Kernel version is 4.8.0. No failure when the IOMMU is disabled. This is an out of tree GPL driver using pci_alloc_consistent/pci_free_consistent. The free causes this. Can

Re: BUG at drivers/iommu/amd_iommu.c:1436!

2016-11-18 Thread Mark Hounschell
On 11/17/2016 05:00 PM, Joerg Roedel wrote: On Thu, Nov 17, 2016 at 04:53:24PM -0500, Mark Hounschell wrote: On 11/17/2016 04:41 PM, Joerg Roedel wrote: Hi Mark, On Thu, Nov 17, 2016 at 02:13:59PM -0500, Mark Hounschell wrote: Kernel version is 4.8.0. No failure when the IOMMU is disabled

Re: BUG at drivers/iommu/amd_iommu.c:1436!

2016-11-21 Thread Mark Hounschell
On 11/21/2016 10:32 AM, Joerg Roedel wrote: > On Fri, Nov 18, 2016 at 09:04:05AM -0500, Mark Hounschell wrote: >> OK. It's attached. > >> [ 45.033715] WARNING: CPU: 0 PID: 0 at lib/dma-debug.c:1158 >> check_unmap+0x4ef/0x990 >> [ 45.037651] 3c59x :04:

Re: BUG at drivers/iommu/amd_iommu.c:1436!

2016-11-22 Thread Mark Hounschell
On 11/22/2016 03:45 AM, Joerg Roedel wrote: On Mon, Nov 21, 2016 at 04:47:59PM -0500, Mark Hounschell wrote: OK, I did get this message before the reported BUG message. gpiohsd gpiohsd: DMA-API: device driver tries to free DMA memory it has not allocated [device address=0xffee8000

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-01-13 Thread Mark Hounschell
On 01/12/2016 10:09 PM, Baoquan He wrote: Seems 0f:00.0 is not attached to a group so that it get a domain. Can you also paste your "lspci -t" and "lspci -vvv" output? Here 0f:00.0 should be a pci bridge which need set the same domain with its peripheral :0f:04.0. Please apply this patch and

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-01-14 Thread Mark Hounschell
On 01/13/2016 07:05 PM, Baoquan He wrote: > On 01/13/16 at 09:42am, Mark Hounschell wrote: >> First, attached are the 2 lspci outputs you asked for. >> >> After the patch I was still unable to bring the system up but it was >> much better. 2 of the 8 Sata disks do not

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-01-20 Thread Mark Hounschell
On 01/20/2016 07:31 AM, Joerg Roedel wrote: Hi Baoquan, On Wed, Jan 13, 2016 at 11:09:50AM +0800, Baoquan He wrote: Seems 0f:00.0 is not attached to a group so that it get a domain. Can you also paste your "lspci -t" and "lspci -vvv" output? Here 0f:00.0 should be a pci bridge which need set th

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-01-20 Thread Mark Hounschell
On 01/20/2016 10:38 AM, Joerg Roedel wrote: On Thu, Jan 14, 2016 at 09:04:08AM -0500, Mark Hounschell wrote: OK, I verified the 2 disks are hanging off the Marvel chips. Here is the dmesg from booting with your patch and the 2 disks not showing up. Does it boot with iommu=soft? Yes. It

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-01-20 Thread Mark Hounschell
On 01/20/2016 10:46 AM, Joerg Roedel wrote: On Wed, Jan 20, 2016 at 04:38:23PM +0100, Joerg Roedel wrote: On Thu, Jan 14, 2016 at 09:04:08AM -0500, Mark Hounschell wrote: OK, I verified the 2 disks are hanging off the Marvel chips. Here is the dmesg from booting with your patch and the 2 disks

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-01-20 Thread Mark Hounschell
On 01/20/2016 11:19 AM, Joerg Roedel wrote: On Wed, Jan 20, 2016 at 11:04:35AM -0500, Mark Hounschell wrote: amd_iommu=fullflush does not help. iommu=soft allows it to boot Okay, good to know, so it is not an issue with stale TLB entries in the IOMMU. Thanks, Joerg Would you

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-01-20 Thread Mark Hounschell
On 01/20/2016 01:26 PM, Joerg Roedel wrote: On Wed, Jan 20, 2016 at 01:19:52PM -0500, Mark Hounschell wrote: Would you like me to do anything more right now? Would be great if you find the time to bisect the issue. To speed thing up you can test commit b67ad2f and use it as the bad one if

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-01-21 Thread Mark Hounschell
On 01/20/2016 01:26 PM, Joerg Roedel wrote: On Wed, Jan 20, 2016 at 01:19:52PM -0500, Mark Hounschell wrote: Would you like me to do anything more right now? Would be great if you find the time to bisect the issue. To speed thing up you can test commit b67ad2f and use it as the bad one if

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-01-21 Thread Mark Hounschell
On 01/21/2016 09:50 AM, Mark Hounschell wrote: On 01/20/2016 01:26 PM, Joerg Roedel wrote: On Wed, Jan 20, 2016 at 01:19:52PM -0500, Mark Hounschell wrote: Would you like me to do anything more right now? Would be great if you find the time to bisect the issue. To speed thing up you can

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-02-02 Thread Mark Hounschell
On 01/21/2016 05:39 PM, Joerg Roedel wrote: On Thu, Jan 21, 2016 at 09:58:41AM -0500, Mark Hounschell wrote: Here ya go. 150952f96941cb13371770ce0cf47906647d8bba is the first bad commit commit 150952f96941cb13371770ce0cf47906647d8bba Author: Joerg Roedel Date: Tue Oct 20 17:33:35 2015 +0200

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-02-16 Thread Mark Hounschell
On 02/16/2016 11:24 AM, Joerg Roedel wrote: On Tue, Feb 02, 2016 at 10:49:11AM -0500, Mark Hounschell wrote: Just wondering if this issue is still being considered? Yes it is, I just went through a move and have a few other issues on the plate. But I this is still on the list. Thanks

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-02-26 Thread Mark Hounschell
On 02/26/2016 11:23 AM, Joerg Roedel wrote: > Can you please boot a v4.5-rc5 kernel with iommu enabled and > 'amd_iommu_dump' on the kernel command line and send me dmesg after > boot again? > > Here ya go Joerg, See ata7 and ata8 failure messages. These are the 2 disks that don't come up. Th

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-02-29 Thread Mark Hounschell
On 02/29/2016 12:42 PM, Joerg Roedel wrote: Hi Mark, On Fri, Feb 26, 2016 at 02:20:05PM -0500, Mark Hounschell wrote: On 02/26/2016 11:23 AM, Joerg Roedel wrote: Can you please boot a v4.5-rc5 kernel with iommu enabled and 'amd_iommu_dump' on the kernel command line and send me d

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-03-18 Thread Mark Hounschell
On 02/29/2016 12:52 PM, Mark Hounschell wrote: On 02/29/2016 12:42 PM, Joerg Roedel wrote: Hi Mark, On Fri, Feb 26, 2016 at 02:20:05PM -0500, Mark Hounschell wrote: On 02/26/2016 11:23 AM, Joerg Roedel wrote: Can you please boot a v4.5-rc5 kernel with iommu enabled and 'amd_iommu_dum

Re: Can't boot new 4.4 kernel with IOMMU enabled

2016-04-11 Thread Mark Hounschell
On 04/11/2016 09:54 AM, Joerg Roedel wrote: Hi Mark, On Fri, Mar 18, 2016 at 01:24:27PM -0400, Mark Hounschell wrote: Should I submit a kernel bug report on this? I just fixed a regression in v4.4. Can you please try the attached patch and report if it fixes your problem too? The patch is

dma_alloc_coherent - cma - and IOMMU question

2015-01-30 Thread Mark Hounschell
I've posted the following email to vger.kernel.org but got no response. I am trying to adapt some of our out of kernel GPL drivers to use the AMD IOMMU. Here is what I posted to LKML "start quote" Sorry for the noise. I've read everything DMA in the kernel Doc dir and searched the web to no avail

Re: dma_alloc_coherent - cma - and IOMMU question

2015-01-30 Thread Mark Hounschell
On 01/30/2015 03:11 PM, Alex Williamson wrote: > On Fri, 2015-01-30 at 19:12 +0000, Mark Hounschell wrote: >> I've posted the following email to vger.kernel.org but got no response. I am >> trying to adapt some of our out of kernel GPL drivers to use the AMD IOMMU. >> Her

Re: dma_alloc_coherent - cma - and IOMMU question

2015-02-02 Thread Mark Hounschell
On 01/30/2015 04:51 PM, Alex Williamson wrote: On Fri, 2015-01-30 at 16:07 -0500, Mark Hounschell wrote: On 01/30/2015 03:11 PM, Alex Williamson wrote: On Fri, 2015-01-30 at 19:12 +, Mark Hounschell wrote: I've posted the following email to vger.kernel.org but got no response. I am t

Re: dma_alloc_coherent - cma - and IOMMU question

2015-02-02 Thread Mark Hounschell
On 02/02/2015 12:35 PM, Alex Williamson wrote: [cc +joerg] On Mon, 2015-02-02 at 11:01 -0500, Mark Hounschell wrote: On 01/30/2015 04:51 PM, Alex Williamson wrote: On Fri, 2015-01-30 at 16:07 -0500, Mark Hounschell wrote: On 01/30/2015 03:11 PM, Alex Williamson wrote: On Fri, 2015-01-30 at

Re: dma_alloc_coherent - cma - and IOMMU question

2015-02-04 Thread Mark Hounschell
On 02/02/2015 12:35 PM, Alex Williamson wrote: [cc +joerg] On Mon, 2015-02-02 at 11:01 -0500, Mark Hounschell wrote: On 01/30/2015 04:51 PM, Alex Williamson wrote: On Fri, 2015-01-30 at 16:07 -0500, Mark Hounschell wrote: On 01/30/2015 03:11 PM, Alex Williamson wrote: On Fri, 2015-01-30 at

Re: dma_alloc_coherent - cma - and IOMMU question

2015-02-04 Thread Mark Hounschell
On 02/04/2015 09:15 AM, Joerg Roedel wrote: On Mon, Feb 02, 2015 at 10:35:36AM -0700, Alex Williamson wrote: [cc +joerg] On Mon, 2015-02-02 at 11:01 -0500, Mark Hounschell wrote: From what I understand of CMA, and it seems provable to me, is that dma_alloc_coherent allocates my 8MB buffer

Kernel Oops: iommu related?

2015-02-12 Thread Mark Hounschell
This happens immediately after unloading one of our out of kernel GPL drivers. The driver has done NOTHING other than load at bootup. I'm running a 3.18.7 kernel (x86_64) on an AMD platform. I can't see anything obviously wrong in our driver. It works fine when the iommu is disabled. This particul

Re: Kernel Oops: iommu related?

2015-02-12 Thread Mark Hounschell
On 02/12/2015 01:08 PM, Joerg Roedel wrote: On Thu, Feb 12, 2015 at 12:53:42PM -0500, Mark Hounschell wrote: This happens immediately after unloading one of our out of kernel GPL drivers. The driver has done NOTHING other than load at bootup. I'm running a 3.18.7 kernel (x86_64) on a

Re: Kernel Oops: iommu related?

2015-02-12 Thread Mark Hounschell
On 02/12/2015 01:25 PM, Mark Hounschell wrote: On 02/12/2015 01:08 PM, Joerg Roedel wrote: On Thu, Feb 12, 2015 at 12:53:42PM -0500, Mark Hounschell wrote: This happens immediately after unloading one of our out of kernel GPL drivers. The driver has done NOTHING other than load at bootup. I&#

Re: Kernel Oops: iommu related?

2015-02-12 Thread Mark Hounschell
On 02/12/2015 02:37 PM, Mark Hounschell wrote: On 02/12/2015 01:25 PM, Mark Hounschell wrote: On 02/12/2015 01:08 PM, Joerg Roedel wrote: On Thu, Feb 12, 2015 at 12:53:42PM -0500, Mark Hounschell wrote: This happens immediately after unloading one of our out of kernel GPL drivers. The driver

Re: Kernel Oops: iommu related?

2015-02-13 Thread Mark Hounschell
On 02/12/2015 04:13 PM, Joerg Roedel wrote: On Thu, Feb 12, 2015 at 02:37:34PM -0500, Mark Hounschell wrote: [0.00] Command line: BOOT_IMAGE=/vmlinuz-3.18.7-lcrs root=/dev/disk/by-id/ata-ST3160815AS_6RACD7A6-part5 splash=verbose showopts video=1600x1200 noresume apm=off vmalloc=256M

IOMMU/DMA API inquiry

2015-02-17 Thread Mark Hounschell
I've searched the Doc tree and web to no avail. I was hoping I might get some answers to a couple of questions that have arisen as a result of actually trying to take advantage of the IOMMU in our out of tree GPL drivers. The AMD IOMMU in particular. I'm currently using the 3.18.x kernel versi

Re: IOMMU/DMA API inquiry

2015-02-19 Thread Mark Hounschell
Hi Joerg, Thanks for the response. On 02/18/2015 01:19 PM, j...@8bytes.org >> Joerg Roedel wrote: Hi Mark, On Tue, Feb 17, 2015 at 02:48:03PM -0500, Mark Hounschell wrote: I understand that AMD IOMMU support is not available for 32-bit kernels. I believe the INTEL IOMMU is supported

Re: BUG: SCSI aic7xxx driver and AMD IOMMU

2015-03-03 Thread Mark Hounschell
Hi Joerg, It looks like this problem is NOT a bug with the SCSI aic7xxx driver after all. I can duplicate this BUG very easily with other hardware. Simply removing a driver module (whether it its self, has actually used any of the DMA API or not) that is sitting on the same pci bus as a card

Re: BUG: SCSI aic7xxx driver and AMD IOMMU

2015-03-24 Thread Mark Hounschell
On 03/23/2015 11:03 AM, Joerg Roedel wrote: Hi Mark, On Tue, Mar 03, 2015 at 02:36:19PM -0500, Mark Hounschell wrote: It looks like this problem is NOT a bug with the SCSI aic7xxx driver after all. I can duplicate this BUG very easily with other hardware. Simply removing a driver module

Re: BUG: SCSI aic7xxx driver and AMD IOMMU

2015-03-25 Thread Mark Hounschell
On 03/25/2015 11:13 AM, Joerg Roedel wrote: Hi again, On Wed, Mar 25, 2015 at 02:59:37PM +0100, Joerg Roedel wrote: On Tue, Mar 24, 2015 at 07:57:49AM -0400, Mark Hounschell wrote: I'll be happy to test it. Okay, here you go: git://git.kernel.org/pub/scm/linux/kernel/git

Re: BUG: SCSI aic7xxx driver and AMD IOMMU

2015-03-26 Thread Mark Hounschell
Hi Joerg, On 03/26/2015 08:45 AM, Joerg Roedel wrote: > On Wed, Mar 25, 2015 at 12:36:34PM -0400, Mark Hounschell wrote: >> BTW, so far the first 2 patches are working well. I was going to >> wait until the end of the day to report but so far I have been >> unable to produ

Re: BUG: SCSI aic7xxx driver and AMD IOMMU

2015-03-26 Thread Mark Hounschell
On 03/26/2015 11:52 AM, Joerg Roedel wrote: Hi Mark, On Thu, Mar 26, 2015 at 10:58:15AM -0400, Mark Hounschell wrote: Sorry but CMA was still badly broken. I have a patch below that works. In which way is it broken? What happens when you try to allocate memory with dma_alloc_coherent? I

Re: [PATCH 0/6] IOMMU/DMA map_resource support for peer-to-peer

2015-05-08 Thread Mark Hounschell
On 05/08/2015 04:21 PM, Konrad Rzeszutek Wilk wrote: On Fri, May 01, 2015 at 01:32:12PM -0500, wda...@nvidia.com wrote: From: Will Davis Hi, This patch series adds DMA APIs to map and unmap a struct resource to and from a PCI device's IOVA domain, and implements the AMD, Intel, and nommu vers

Re: [PATCH v2 4/7] DMA-API: Add dma_(un)map_resource() documentation

2015-05-20 Thread Mark Hounschell
On 05/19/2015 07:43 PM, Bjorn Helgaas wrote: [+cc Dave, Jonathan] On Mon, May 18, 2015 at 01:25:01PM -0500, wda...@nvidia.com wrote: From: Will Davis Add references to both the general API documentation as well as the HOWTO. Signed-off-by: Will Davis --- Documentation/DMA-API-HOWTO.txt |

Re: [PATCH v2 4/7] DMA-API: Add dma_(un)map_resource() documentation

2015-05-20 Thread Mark Hounschell
On 05/20/2015 01:30 PM, William Davis wrote: -Original Message- From: Mark Hounschell [mailto:ma...@compro.net] Sent: Wednesday, May 20, 2015 7:11 AM To: Bjorn Helgaas; William Davis Cc: j...@8bytes.org; iommu@lists.linux-foundation.org; linux- p...@vger.kernel.org; Terence Ripperda

Re: [PATCH v2 4/7] DMA-API: Add dma_(un)map_resource() documentation

2015-05-20 Thread Mark Hounschell
On 05/20/2015 03:51 PM, William Davis wrote: -Original Message- From: Mark Hounschell [mailto:ma...@compro.net] Sent: Wednesday, May 20, 2015 2:16 PM To: William Davis; Bjorn Helgaas Cc: j...@8bytes.org; iommu@lists.linux-foundation.org; linux- p...@vger.kernel.org; Terence Ripperda

Re: [PATCH v2 4/7] DMA-API: Add dma_(un)map_resource() documentation

2015-07-07 Thread Mark Hounschell
Hi Bjorn. On 07/07/2015 11:15 AM, Bjorn Helgaas wrote: [+cc Alex] Hi Mark, On Wed, May 20, 2015 at 08:11:17AM -0400, Mark Hounschell wrote: Most currently available hardware doesn't allow reads but will allow writes on PCIe peer-to-peer transfers. All current AMD chipsets are this way

Re: [PATCH v2 4/7] DMA-API: Add dma_(un)map_resource() documentation

2015-07-07 Thread Mark Hounschell
On 07/07/2015 01:28 PM, Alex Williamson wrote: On Tue, 2015-07-07 at 13:14 -0400, Mark Hounschell wrote: Hi Bjorn. On 07/07/2015 11:15 AM, Bjorn Helgaas wrote: [+cc Alex] Hi Mark, On Wed, May 20, 2015 at 08:11:17AM -0400, Mark Hounschell wrote: Most currently available hardware doesn&#

Re: [PATCH v2 4/7] DMA-API: Add dma_(un)map_resource() documentation

2015-07-08 Thread Mark Hounschell
On 07/08/2015 11:11 AM, Bjorn Helgaas wrote: [+cc Rafael] On Tue, Jul 07, 2015 at 01:14:27PM -0400, Mark Hounschell wrote: On 07/07/2015 11:15 AM, Bjorn Helgaas wrote: On Wed, May 20, 2015 at 08:11:17AM -0400, Mark Hounschell wrote: Most currently available hardware doesn't allow read

Re: [PATCH v6 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-10-30 Thread Mark Hounschell
On 10/30/2015 10:09 AM, Joerg Roedel wrote: On Fri, Oct 30, 2015 at 09:17:52AM +0800, Daniel Kurtz wrote: Hmm, I thought the DMA API maps a (possibly) non-contiguous set of memory pages into a contiguous block in device memory address space. This would allow passing a dma mapped buffer to device

Re: Regression in kernel 4.2.3+ (relative to 4.1.10) on AMD 990FX system with IOMMU enabled

2015-11-05 Thread Mark Hounschell
On 11/04/2015 04:08 PM, Alex Williamson wrote: On Wed, 2015-11-04 at 12:24 -0500, Laine Stump wrote: Last week I upgraded my Fedora 22 AMD 990FX system from kernel 4.1.10 to 4.2.3 (standard Fedora builds) and multiple devices stopped working: * 00:14.2 Audio device: Advanced Micro Devices, Inc.