Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751774AbbKJIkB (ORCPT ); Tue, 10 Nov 2015 03:40:01 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:56107 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899AbbKJIj5 (ORCPT ); Tue, 10 Nov 2015 03:39:57 -0500 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Sinan Kaya , Abhijit Mahajan , Nagalakshmi Nandigama , linux-scsi@vger.kernel.org, jcm@redhat.com, timur@codeaurora.org, "James E.J. Bottomley" , linux-kernel@vger.kernel.org, Sreekanth Reddy , Praveen Krishnamoorthy , cov@codeaurora.org, linux-arm-msm@vger.kernel.org, agross@codeaurora.org, MPT-FusionLinux.pdl@avagotech.com, Hannes Reinecke Subject: Re: [PATCH V2 1/3] scsi: mptxsas: try 64 bit DMA when 32 bit DMA fails Date: Tue, 10 Nov 2015 09:38:32 +0100 Message-ID: <5349261.sTnZTFhKWB@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <56412AAE.80004@codeaurora.org> References: <1447034266-28003-1-git-send-email-okaya@codeaurora.org> <6940177.lD0iNnWRJy@wuerfel> <56412AAE.80004@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:wTS++t6lBmOEytdMUf7/M2p1ohpNiWKDMhSOhZXfdnAJkgKo2MO s/JlH140amuGtV3JTEVVpoU1712dYm4iXbVFcmmQDs9Phk0UtJoPxVdkGM7nOgpFXzjqC/2 Dt5GXdBy6dRh5Dte3A0PHmK6c+DOsETASzUn1l+9j9f/MukKVJNrntWD+U0iA/TTiENKQZy 5uTmYssbeAPILVKQaYsVA== X-UI-Out-Filterresults: notjunk:1;V01:K0:LXRCcESpyMc=:1/GK1ip7VLImJOlVbkaU+S fgJcUxcK1rqnnGaDy/pwmh2YrW1gE1ptnazGzqxhMBSNUEbcXDH5IHTeJdzzrueWHcHnlI3Gd rJAJNk88l/KDVFP6f2BP1yO4N44uEr3F8btz4/XoYjK5mUW/cyzrKx0bhJadKPo1n8qrL9Vch vynqkN6Mq16SSGAw3H16BuuFjr/ADFgDSh+omkBnzgANrRSI09RsRk0OQQPGXPMnZYGDkPuAC QIzpPdlnyLYbN08RF4Hn2TyBodLq1ZQGNKIgPqXhs7PRtwwK62fTgFcoEChtuP1R8rlGL64w9 mjrMDxzLHYBHVWoANk/cQ4EFix18LUJA5BG8dRWD3z/NzA24G31+N18YKVq/scgv0HdttiLib K9q8rXsHdMjL67nfGOSBeX5EJFLXP0P62dqjU79pXN+lhaW36S0ZuhETQR3taj/w3HfuVuCzz vEsPX52X2kDPfOWsOkdHQjEEqLFmRxJMtLtROowZedfXnybNSJX/lmvOM0QWzQYoVREcajyKY YnLd0UsQdQVYTmfAQeERB39XVhgYO4t62gT9V3GXDFuPs/W/7r7d2t1AEd9Dr978+hZE9WBU2 YkogeHV4TLc+kOow3TyRzwBHIKLFcT9Wq/4eFs59G1Ipb0RzLtjihKPvwmcqlaGy0UTGN2uZS ef/TmvD00hiOsUUQCI92AF4W6ha2k2bpX8UvUeL8A8guwgGlQH+EHXAmt66WMTtWEVJEA6KPz ObCrn3yrcj/RMxqu Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1476 Lines: 37 On Monday 09 November 2015 18:22:22 Sinan Kaya wrote: > On 11/9/2015 9:33 AM, Arnd Bergmann wrote: > > On Monday 09 November 2015 09:07:36 Sinan Kaya wrote: > >> On 11/9/2015 3:59 AM, Arnd Bergmann wrote: > > ioc->dma_mask is 0 and the driver is trying to use 32 bit even though 64 > bit supported by the platform. Ok, makes sense. > I think the proper fix is to pass the required_mask back to > consistent_dma_mask rather than using ioc->dma_mask and guessing. > > pci_set_consistent_dma_mask(pdev, required_mask) > > My code was just a band aid for broken code. > No, as Timur found, the driver is correct and it intentionally sets the 32-bit mask, and that is guaranteed to work on all sane hardware. Don't change the driver but find a better platform for your workload, or talk to the people that are responsible for the platform and get them to fix it. If the platform also doesn't have an IOMMU, you can probably work around it by setting up the dma-ranges property of the PCI host to map the low PCI addresses to the start of RAM. This will also require changes in the bootloader to set up the PCI outbound translation, and it will require implementing the DMA offset on ARM64, which I was hoping to avoid. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/