From patchwork Thu May 9 21:33:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 2545931 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 25ADD3FD4E for ; Thu, 9 May 2013 21:35:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753843Ab3EIVfl (ORCPT ); Thu, 9 May 2013 17:35:41 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:47657 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753652Ab3EIVfk (ORCPT ); Thu, 9 May 2013 17:35:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=aS24qFUH03+JjVseFPVGk0gAhCWuWzYoHFPRdB02kB8=; b=Bf9gKpmmksK5E2DZ9vNtVD+MMqwJ53vh6wOk5biqGcXh+PF6UvLDpex8r/Nk1aC7DOSeyLyMEY5/u3IgY2Q50XzxjDS8NDYJUYyo9X56WOFyvfw4u9vnKzsVt9jGjCkI6OHgNvHiqJAdCwjHlq7ODwEACDl7roPtSRDd+gdLkVE=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:39876) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1UaYTG-0000xG-Uh; Thu, 09 May 2013 22:33:51 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1UaYTF-0004PI-Mk; Thu, 09 May 2013 22:33:49 +0100 Date: Thu, 9 May 2013 22:33:49 +0100 From: Russell King - ARM Linux To: Arnd Bergmann Cc: Greg Kroah-Hartman , Stephen Warren , Stephen Warren , Alexander Shishkin , linux-usb@vger.kernel.org, Felipe Balbi , Alan Stern , linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] USB: set device dma_mask without reference to global data Message-ID: <20130509213349.GN21614@n2100.arm.linux.org.uk> References: <1367967232-10128-1-git-send-email-swarren@wwwdotorg.org> <20130507230445.GC9105@kroah.com> <201305080142.12025.arnd@arndb.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201305080142.12025.arnd@arndb.de> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org On Wed, May 08, 2013 at 01:42:11AM +0200, Arnd Bergmann wrote: > On Wednesday 08 May 2013, Greg Kroah-Hartman wrote: > > On Tue, May 07, 2013 at 04:53:52PM -0600, Stephen Warren wrote: > > > From: Stephen Warren > > > > Suggested-by: Arnd Bergmann > > > Signed-off-by: Stephen Warren > > > > So this needs to go in for 3.10, right? Any older kernels as well? If > > so, which ones? > > The fix should definitely go into 3.10, but I'd suggest waiting with > the backport for a couple of -rc releases to avoid possible regressions. > We know that the current code is broken, but few people fully understand > what is going on with coherent_dma_mask, so it might cause new problems > in combination with some other unknown bug, and I don't see this as > urgent: none of the ARM defconfigs build this driver as a loadable > module and there is no bug in the built-in case. For some reason, only > the ARM back-end drivers are broken. > > The first occurence was apparently in 3.3, but only in ehci-tegra.c, > while the other drivers subsequently copied the bug. I've already suggested this approach: --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/include/asm/device.h b/arch/arm/include/asm/device.h index dc662fc..51bb740 100644 --- a/arch/arm/include/asm/device.h +++ b/arch/arm/include/asm/device.h @@ -22,6 +22,7 @@ struct dev_archdata { struct omap_device; struct pdev_archdata { + u64 dma_mask; #ifdef CONFIG_ARCH_OMAP struct omap_device *od; #endif And then we can have dev->dma_mask pointed at that instead, which fully eliminates any possible problems of things like dma_set_mask() interfering with dma_set_coherent_mask(). Even better - because this is a common problem - would be to make 'dma_mask' be a member of struct platform_device so that all arches can sort this out once and for all (correction: generic code/drivers can in an arch- independent way.) IOW: diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 9abf1db..121c74c 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -26,6 +26,7 @@ struct platform_device { struct device dev; u32 num_resources; struct resource *resource; + u64 dma_mask; const struct platform_device_id *id_entry;