Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754481AbbHOUGI (ORCPT ); Sat, 15 Aug 2015 16:06:08 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:60194 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753281AbbHOUGG (ORCPT ); Sat, 15 Aug 2015 16:06:06 -0400 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: Duc Dang , Russell King - ARM Linux , Feng Kan , Mark Langsdorf , mathias.nyman@intel.com, Greg KH , USB list , patches , Linux Kernel Mailing List , Loc Ho Subject: Re: [PATCH v5 1/2] usb: make xhci platform driver use 64 bit or 32 bit DMA Date: Sat, 15 Aug 2015 22:05:09 +0200 Message-ID: <1643536.i8Q5EFEN01@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <20150808092252.GJ7557@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:v3Ti85ip3R+tqwM9Dur9KaSqyLa5JfiQy6U91NTHuohedfAnu9Z xcGZ1D1PSF74L9q/IPyM9dpHrPdLGvh7WMhV/olv3AE5GwTQFeYFp4V2REcfGbK/Qcrr9Ny JozdLmjuI7zg/UGCX7qGTv07YDOzZXG4AX0PWp+rn7bkP3lagUsOgjk4UdnFb7VnXEG2fW0 L8EZWuYN3hWEEnEOsEWGQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:PPM1BH8jg1M=:MLuP+rvH1lHMcfxIqveoSc PFMQUwsJYSanlvcdU99ljmcZJNVvNx5EMn0/6Zyma9nRO33NUc0dQPWNjpuuVAAC0nGEykJIQ HMOwO9WIbojcGcPE17yEdLEdLF+L1k232nY5eBYWzYBFRwYYyx2qneL01aHWu3u1rJc9gqNVX 3PRbyl91O6UfU54kayEbE70bgrobRKYlaSq94Oz74Vba6iNXaa/n21eewkaXqWFALlnRg1ZIt j8RhREknovuBCEE2uO5UMBq6qLVCcxK/beQJFR063+KSARxIwKAZ6nSuajWae7UdVDXuL0Zj4 bJNoxCLFzezdWeJekro/ZEAS9kA0D4oEq8BNprQiSqmhzTyvHVzieMpPmwtk1WuCldzyLvWJp 7+HBh/q1466d48r7HuLyQhQVZZo/fF8aDpgKdbYmo3g67PPQj/bTBSZSvCPLHoyr2XUOzUzne 602LZ38Q4/dd8JbUFfpq2J9AkQFOgV76kyQ77AZlqup3c9/bck3yjYLgw08iK7aSnHsoWLfR0 E9OxJiC0gOFm/oifdbMGVGP7pg/P9jZWioOTVeJWEyXdyrLETLw5XG3UrNIc/gVDobCDVx94t f5gJD2nAmRLTQ/jgbvDsOpKsMZDsgdpK6GqTrRgg5tKtvPwSZvGiyQaWtxcm0eO4CTEVDt2N3 Rs5re6vNr3WgvPHIXNUbXqIG7phWIS3tITItL2BX8HpvaUoOvC5sdi81WAE5t9kivFbsn8Fw7 vX/1YhP/3zR+PVkA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1372 Lines: 30 On Saturday 08 August 2015 13:31:02 Duc Dang wrote: > > > > If we know that pdev->dev.dma_mask will always be initialised at this > > point, then the above change is fine. If not, it's introducing a > > regression - dma_set_mask_and_coherent() will fail if pdev->dev.dma_mask > > is NULL (depending on the architectures implementation of dma_set_mask()). > > > > Prefixing the above change with the two lines I mention above would > > ensure equivalent behaviour. Even if we do want to get rid of this, > > I'd advise to do it as a separate patch after this change, which can > > be independently reverted if there's problems with its removal. > > > Hi Russell, > > I will add the 2 lines you mentioned back to next version of the > patch. It is safer to do it that way as I do not see > pdev->dev.dma_mask gets initialized before the call > dma_set_mask_and_coherent inside this xhci_plat.c file. It would be good to add a WARN_ON() to the case where dma_mask is a NULL pointer at the least. That way, we will at least find out if there are some broken platforms that do not correctly initialize the mask pointer. 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/