From patchwork Wed Jul 27 14:41:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Darren Stevens X-Patchwork-Id: 653405 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rzzsd5pq5z9t1c for ; Thu, 28 Jul 2016 01:48:05 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rzzsd517xzDrLh for ; Thu, 28 Jul 2016 01:48:05 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.73]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rzzr75QZKzDqd7 for ; Thu, 28 Jul 2016 01:46:47 +1000 (AEST) Received: from [127.0.0.1] ([86.156.212.61]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0M5qIb-1b4IVO0TtJ-00xvTI; Wed, 27 Jul 2016 17:41:31 +0200 From: Darren Stevens To: linuxppc-dev@lists.ozlabs.org Date: Wed, 27 Jul 2016 15:41:29 +0100 (BST) Message-ID: <488c970c5ae.f93db6b@auth.smtp.1and1.co.uk> User-Agent: YAM/2.9p1 (AmigaOS4; PPC; rv:20140418r7798) Subject: [PATCH] pasemi: Fix coherent_dma_mask for dma engine MIME-Version: 1.0 Content-type: multipart/mixed; boundary="--=_BOUNDARY.6c707e401f754ac2.5c" X-Provags-ID: V03:K0:X84XZqKTeeDa+WmuSOpel9Rty0YmjBxAqfZMEXLpmdmF0kwSWAH cncsGOWS+BAuLiJiTyOCWfa9GKAtsOG5kVktrvkvJKpPzo5LVU0xp+ZxC83Cohb6D4wh7tq R3aVLMuRFI5It7F7v7eIefxq53keYaewZ5Hvuqbv+SM/og+2iBMvKk0R7Tg2hKwwyESC3yk cZix3O1h3R/wSYRVeC/HQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:0XFVVxnnakc=:+zI2CZFepkRZJc8iVnCVL2 X93c090EJolKLKn3OHZ/YAlRix1IuHHOkwEgHO59nFAbR3Zs3OZ7AuVqoHkjBlbOqVQzVXvJG p2XI2uA3K/egsynkFDwP14Xz+YnBI/wB8OYtg2upKTVNLC3ve7wRG0oKwUO538+UG+hs95bRt GxB1u47JXjGKG80b5ZQnOmgjD98Y5gr1GVwtxLNylp7oNfdwXEBaXOIhB17df7pnjJi8rGBXm BjnIYn5woXA9BeUSgeZTh6vpxIDpfEcP3SvZVo7pqKKNPuLDiueFkO/3he0Yn4VG4o0kHbXoW Q1bQffDnd3K4vNi0PQsL2C0uKXfIz1cjLUzfmYzmt7cjXOY//NuPLkl148t/MnOoQWuixZIMH P7eWRjPzrHtflDooT+5305jLT4AwODh86xD9DwvqmCUC0o0V8I5p9sZCr9m547tjr2EeTdOpP NNZQdb9RF8MPoDA+zapUmAHJ0bUbuIp06g7T47W8fyA+WwHvZghWlRV5dADQSBMLE2jZL3tBy KYav6S3tmKQx1RiLXTO9ltV3VQXr+LqOAmiM3ZZuC6j7mCtgmt27NgB/OGSy+/WXAfijwHqU4 i6kGC9lw1ZWaxSQx8FJdp8uL5ISDKhvQeI4O/gHFhsqqpSvAxsfQz3PGl8lBGyp6YFny0ezud HIjPw70euS98pKC60MiHWhH8PkOCSRmWdByTA0Zy6ehNplXd06nhtvUiO+rhvSOkMVhc= X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: olof@lixom.net, Christian Zigotzky Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Commit 817820b0226a ("powerpc/iommu: Support "hybrid" iommu/direct DMA ops for coherent_mask < dma_mask) adds a check of coherent_dma_mask for dma allocations. Unfortunately current PASemi code does not set this value for the DMA engine, which ends up with the default value of 0xffffffff, the result is on a PASemi system with >2Gb ram and iommu enabled the the onboard ethernet stops working due to an inability to allocate memory. Add an initialisation to pci_dma_dev_setup_pasemi() Signed-off-by: Darren Stevens diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c index c929644..81b334a 100644 --- a/arch/powerpc/platforms/pasemi/iommu.c +++ b/arch/powerpc/platforms/pasemi/iommu.c @@ -187,6 +187,11 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev) if (dev->vendor == 0x1959 && dev->device == 0xa007 && !firmware_has_feature(FW_FEATURE_LPAR)) { dev->dev.archdata.dma_ops = &dma_direct_ops; + /* + * Set the coherent DMA mask to prevent the iommu + * being used unnecessarily + */ + dev->dev.coherent_dma_mask = DMA_BIT_MASK(44); return; } #endif