Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3447392imu; Thu, 29 Nov 2018 23:57:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/UF0FHhbXjixJJpJ9JrHZs2dG/PrBPFc/py6t6ZSseg0ZDkk4fioRKQTrOYgaEjVsaUv8S2 X-Received: by 2002:a63:3204:: with SMTP id y4mr3968539pgy.41.1543564652521; Thu, 29 Nov 2018 23:57:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543564652; cv=none; d=google.com; s=arc-20160816; b=hyLM/rMx6lnCbMpYuqF1dl1VhGSRXnzlHlrd5H8CM4ZvuLh3FDJqEttDzImz08riAq yTEUXAo80HIl8bZ5t93hvvgfCZIxW4DNT5DeU0RbAFv701sEJoEDXOzISqwT7QpeIFl1 QiQB+nOeipTuBKbWkXGuRZvJvRMYnKGXvFMDOr/bReb7b2WuwZUWPcWRD87OBfF3ajj+ fBfbDNUBQGbU716gPUOZJ8E06VwdaQ+O+PtHWYDhGmIoqKyG797bqvcGydh1jmO/irZG qHl1Hy5io8ZrLK9miNNLYS7fgIxOeV1lq57ngUTERdiwq6PJLSO73ml/qHARbV6UpZev e5Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=na5zDGLyApbNAyoZrV/oYAv6kT2vsD7Mq8YrVqxeGnc=; b=u61Ekq7KyXGHucOUOMFm8/izfdPBW5NJMcPqNzdIdP1YAkGFu/G919Zk2JvoUjwDIX B7ekTFgMqgsqNm0x18ErIxQ7FmCQv1ldPoGAXeuJV1GOwBSc8rdOghf7pniL8j+Q1aw5 9SmIgd2+R620ADprzW8/+UyejqhSEmPW3+o6SWWAqzLPip2xdg0LPlyFaMYTb3Dk+8U6 /BuNDtq0mF3V0ZaLrd6q10MFljDrn6FsEA1GMN3t/b14r49fu9ikfTVbt5K0To4rw5xA QsCeKUIL6KGn6Q2Ac9EYvYgxjOY63I23Wa4/44O9U7x3PbK8Dsb4CnCnI8jReh1p6txe Oaeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si4055002pgr.316.2018.11.29.23.57.17; Thu, 29 Nov 2018 23:57:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726877AbeK3TD4 (ORCPT + 99 others); Fri, 30 Nov 2018 14:03:56 -0500 Received: from 178.115.242.59.static.drei.at ([178.115.242.59]:35099 "EHLO mail.osadl.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726551AbeK3TD4 (ORCPT ); Fri, 30 Nov 2018 14:03:56 -0500 Received: by mail.osadl.at (Postfix, from userid 1001) id 3F7E25C099D; Fri, 30 Nov 2018 07:54:53 +0000 (UTC) Date: Fri, 30 Nov 2018 08:54:53 +0100 From: Nicholas Mc Guire To: Stephen Boyd Cc: Michael Turquette , Nicholas Mc Guire , Michal Simek , Rob Herring , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] clk: zynq: do not allow kmalloc failure Message-ID: <20181130075453.GB2456@osadl.at> References: <1542803310-32673-1-git-send-email-hofrat@osadl.org> <154353512315.88331.4548631955021366823@swboyd.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <154353512315.88331.4548631955021366823@swboyd.mtv.corp.google.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 29, 2018 at 03:45:23PM -0800, Stephen Boyd wrote: > Quoting Nicholas Mc Guire (2018-11-21 04:28:30) > > The kmalloc here is small (< 16 bytes) and occurs during initialization > > during system startup here (can not be built as module) thus if this > > kmalloc failed it is an indication of something more serious going on > > and it is fine to hang the system here rather than cause some harder > > to understand error by dereferencing NULL. > > > > Explicitly checking would not make that much sense here as the only > > possible reaction would be would BUG() here anyway. > > > > Signed-off-by: Nicholas Mc Guire > > Fixes: 0ee52b157b8e ("clk: zynq: Add clock controller driver") > > Acked-by: Michal Simek > > --- > > Nak. We don't have any __GFP_NOFAIL in drivers/clk and I don't see a > reason why we would want it here either. Just handle the failure, or > don't care if this is so critical to system boot. > It was not motivated by the criticality but by the low probability and cluttering the code for this case did not seem good to me. Effectively handling it here means BUG() - so more or less the same result that hanging it on __GFP_NOFAIL if allocation was not possible would cause. Not clear what the objection to __GFP_NOFAIL here is - my understanding was that it is intended precisely for cases like this - but I?ll send a V2 handling it with BUG_ON(!clk_name) if that is prefered. thx! hofrat