From patchwork Fri Jan 18 01:39:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 213427 X-Patchwork-Delegate: galak@kernel.crashing.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 125CB2C02B5 for ; Fri, 18 Jan 2013 12:41:20 +1100 (EST) Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 74B912C0085 for ; Fri, 18 Jan 2013 12:40:15 +1100 (EST) Received: by mail-we0-f180.google.com with SMTP id t57so571645wey.39 for ; Thu, 17 Jan 2013 17:40:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=9mHokKB2XRe4Sm3VYU+Qi30nlU+jasjhrPcyzBglW08=; b=dVuIw+RAkFgdVibdqGhLpWZCbcGRISz8CCrta27/9NhHt3D5PGrpnsSjtADRu28wLp q4EQeEsNfmAnBwkdTE0QPI9bqTKawk4MiJbtqmPmDOO6GewiHoT1mu8k3Maz608t8YVN zjGxHUCPGCh3ZskdcGni3+Qtx/UbkBXa7HdvtKIandznrn0inr5dUlUchPtkT/CfaAoR EYfg99wv95x1XW14FwN4mjwZJySANj6rRDkCGsshBcTTBAouUbQt3MUhWazBoGcd7q2f tfztEgTMo/FIJR4JdAjB+a02X2hJqhs1XG/h9cFQIhVImpCv9bv01R3Cup5+7pqlHBdC UolQ== X-Received: by 10.194.235.6 with SMTP id ui6mr11568633wjc.12.1358473208805; Thu, 17 Jan 2013 17:40:08 -0800 (PST) Received: from localhost (host86-129-74-173.range86-129.btcentralplus.com. [86.129.74.173]) by mx.google.com with ESMTPS id bd7sm1326660wib.8.2013.01.17.17.40.06 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jan 2013 17:40:07 -0800 (PST) Received: by localhost (Postfix, from userid 1000) id 29DC43E0C3A; Fri, 18 Jan 2013 01:40:05 +0000 (GMT) From: Grant Likely To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] powerpc/5200: Fix size to request_mem_region() call Date: Fri, 18 Jan 2013 01:39:59 +0000 Message-Id: <1358473200-17886-1-git-send-email-grant.likely@secretlab.ca> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmUBQdTjhBotyJBDLmlWqMFqAomsOLl+pwiwzM8Yz7uY7/wu+KMuCA2u+ykGzTzsaSfzpHT Cc: Anatolij Gustschin X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The Bestcomm driver requests a memory region larger than the one described in the device tree. This is due to an extra undocumented field in the bestcomm register structure. This hasn't been a problem up to now, but there is a patch pending to make the DT platform_bus support code use platform_device_add() which tightens the rules and provides extra checks for drivers to stay within the specified register regions. Alternately, I could have removed the extra field from the structure, but I'm not sure if it is still needed for resume to work. Better be safe and leave it in. Signed-off-by: Grant Likely Cc: Benjamin Herrenschmidt Cc: Anatolij Gustschin --- arch/powerpc/sysdev/bestcomm/bestcomm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c b/arch/powerpc/sysdev/bestcomm/bestcomm.c index d913063..81c3314 100644 --- a/arch/powerpc/sysdev/bestcomm/bestcomm.c +++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c @@ -414,7 +414,7 @@ static int mpc52xx_bcom_probe(struct platform_device *op) goto error_sramclean; } - if (!request_mem_region(res_bcom.start, sizeof(struct mpc52xx_sdma), + if (!request_mem_region(res_bcom.start, resource_size(&res_bcom), DRIVER_NAME)) { printk(KERN_ERR DRIVER_NAME ": " "Can't request registers region\n");