From patchwork Thu Apr 18 15:30:03 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: 2461311 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 477E63FCA5 for ; Thu, 18 Apr 2013 15:30:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967210Ab3DRPaS (ORCPT ); Thu, 18 Apr 2013 11:30:18 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:34151 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966982Ab3DRPaQ (ORCPT ); Thu, 18 Apr 2013 11:30:16 -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=bR4IDq0iV2FPcKcWyYGiqw7FGOGDsz7W/VbdD4jK4qE=; b=FXqTEJHQRzL+S8dVipdhVZ6fn9iK2wzrlh1fSt8N2UZku00ClS8IvDqaR81Ed4jUhhSKAPG3S3QAFajeEPRmY7HFlRABipB2omWYDZFRRanSK/s38BxhAnVHRwsWm0/jT8aEe0fArWRdeZJwllYF85YZjghvMb4NCDdzLGoHhng=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:55840) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1USqml-0005OG-3t; Thu, 18 Apr 2013 16:30:07 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1USqmi-0004FZ-Qe; Thu, 18 Apr 2013 16:30:04 +0100 Date: Thu, 18 Apr 2013 16:30:03 +0100 From: Russell King - ARM Linux To: Kukjin Kim Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Abraham Subject: Re: [PATCH 1/2] ARM: EXYNOS: Add a platform bus notifier to set dma masks for Exynos5440 Message-ID: <20130418153003.GW14496@n2100.arm.linux.org.uk> References: <1365072704-4568-1-git-send-email-kgene.kim@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1365072704-4568-1-git-send-email-kgene.kim@samsung.com> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org On Thu, Apr 04, 2013 at 07:51:43PM +0900, Kukjin Kim wrote: > +static u64 dma_mask64 = DMA_BIT_MASK(64); ... > + if (event != BUS_NOTIFY_ADD_DEVICE) > + return NOTIFY_DONE; > + > + dev->dma_mask = &dma_mask64; Sharing the dma mask in this way is a potential issue should you have a device driver use dma_set_mask() - which can write to this value. A better solution would be: and then in your function do: struct platform_device *pdev = to_platform_device(dev); ... pdev->dev.dma_mask = &pdev->arch_data.dma_mask; pdev->arch_data.dma_mask = DMA_BIT_MASK(64); However... are all your devices really DMA capable? Normally on a SoC, it's only the DMA engine which is DMA capable and everything else is not, and in that case you really only want to set the DMA masks up for the DMA capable devices. --- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" 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