From patchwork Sat Oct 19 05:52:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 3070831 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7A008BF924 for ; Sat, 19 Oct 2013 06:01:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 83C51201D3 for ; Sat, 19 Oct 2013 06:01:15 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC659204E7 for ; Sat, 19 Oct 2013 06:01:11 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VXPaZ-0008Ga-Q8; Sat, 19 Oct 2013 06:00:39 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VXPaX-0007Uu-CM; Sat, 19 Oct 2013 06:00:37 +0000 Received: from mail-pb0-f48.google.com ([209.85.160.48]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VXPaU-0007UQ-E2 for linux-arm-kernel@lists.infradead.org; Sat, 19 Oct 2013 06:00:35 +0000 Received: by mail-pb0-f48.google.com with SMTP id ma3so4683574pbc.7 for ; Fri, 18 Oct 2013 23:00:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=jZuh2Gv5KKHcAY6pDf5pGys12c5naBfXu624ndp0+x8=; b=TaZvDzNIFDL8CdRvIPlJPRNEegUur15dHj1QRPo2ApJ1zqicQJQWa0TK9AXdCGvbV9 t3ajIRFfxzH1cvX3auZekk8qz7KFDjOqu4SPoRp6T9XBqSeuND/e/jLbe4mVRRxSkxvq OxZ2XJQ3qJS+ZjPKUT3U8YX5fkld3orkF60mQYSEyR2DjUlQqrNcgQTlve0Gh79MQ56t /HmpasPu94MeFit1j+PN6kGT2iczcR+bbYj5GIxdcWKaJbcJ3eQVJsGEnZ//rhuKtF6J kLLeJ8jSgniS1V4FfUeoleCmj3zW1p6ECf0STiWXr4vsUMFVBWWAwMLq9PvLEUkNlq/q 6Cgg== X-Gm-Message-State: ALoCoQmcExUBuBKgqs3AajHshCUMr1ViQAkpKRJvm0dDcCaGCsJVLyzTDM5ND0RsPWOyRg7D4Ng/ X-Received: by 10.68.195.233 with SMTP id ih9mr153207pbc.160.1382161968603; Fri, 18 Oct 2013 22:52:48 -0700 (PDT) Received: from localhost (c-24-19-7-36.hsd1.wa.comcast.net. [24.19.7.36]) by mx.google.com with ESMTPSA id gg10sm6331157pbc.46.2013.10.18.22.52.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 22:52:47 -0700 (PDT) From: Kevin Hilman To: Greg KH Subject: Re: [RFC PATCH] device: Add kernel standard devm_k.alloc functions References: <1381296747.2040.17.camel@joe-AO722> <20131011131138.3bc5b2acf60df3a5d79d0d24@linux-foundation.org> <20131018225702.GA13090@kroah.com> Date: Fri, 18 Oct 2013 22:52:46 -0700 In-Reply-To: <20131018225702.GA13090@kroah.com> (Greg KH's message of "Fri, 18 Oct 2013 15:57:02 -0700") Message-ID: <8761stu7rl.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131019_020034_565023_86546191 X-CRM114-Status: GOOD ( 23.62 ) X-Spam-Score: -2.6 (--) Cc: Sangjung Woo , Olof Johansson , LKML , Tejun Heo , Thierry Reding , linux-arm-kernel , Joe Perches , Andrew Morton , Guenter Roeck X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Greg KH writes: > On Fri, Oct 18, 2013 at 10:04:11AM -0700, Kevin Hilman wrote: >> > A handful of boot panics on ARM platforms were bisected to point at >> > the version of this commit that's in linux-next (commit >> > 64c862a839a8db2c02bbaa88b923d13e1208919d). Reverting this commit >> > makes things happy again. >> > >> > Upon further digging, it seems that users of devres_alloc() are >> > relying on the previous behavior of having the memory zero'd which is >> > no longer the case after $SUBJECT patch. The change below on top of >> > -next makes these ARM boards happy again. >> >> Oops, it should've fixed __devres_alloc() also. Updated patch below. > > Can you send this in a format that I can apply it in? It was whitespace > damaged. hmm, sorry about that. This one should work, though I wonder if Andrew should pick this up since I think the patch that causes the breakage came through his tree. Kevin ---------------8<---------------------------------------------------- From a1962ed4a999fb630a48f75a5ecaf84401d5dbfc Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Fri, 18 Oct 2013 09:41:39 -0700 Subject: [PATCH] devres: restore zeroing behavior of devres_alloc() commit 64c862a8 (devres: add kernel standard devm_k.alloc functions) changed the default behavior of alloc_dr() to no longer zero the allocated memory. However, only the devm.k.alloc() function were modified to pass in __GFP_ZERO which leaves any users of devres_alloc() or __devres_alloc() with potentially wrong assumptions about memory being zero'd upon allocation. To fix, add __GFP_ZERO to devres_alloc() calls to preserve previous behavior of zero'ing memory upon allocation. Signed-off-by: Kevin Hilman Signed-off-by: Joe Perches Acked-by: Olof Johansson --- drivers/base/devres.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/devres.c b/drivers/base/devres.c index 37e67a2..545c4de 100644 --- a/drivers/base/devres.c +++ b/drivers/base/devres.c @@ -111,7 +111,7 @@ void * __devres_alloc(dr_release_t release, size_t size, gfp_t gfp, { struct devres *dr; - dr = alloc_dr(release, size, gfp); + dr = alloc_dr(release, size, gfp | __GFP_ZERO); if (unlikely(!dr)) return NULL; set_node_dbginfo(&dr->node, name, size); @@ -136,7 +136,7 @@ void * devres_alloc(dr_release_t release, size_t size, gfp_t gfp) { struct devres *dr; - dr = alloc_dr(release, size, gfp); + dr = alloc_dr(release, size, gfp | __GFP_ZERO); if (unlikely(!dr)) return NULL; return dr->data;