Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754098Ab0KZJTj (ORCPT ); Fri, 26 Nov 2010 04:19:39 -0500 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:45336 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753760Ab0KZJTh (ORCPT ); Fri, 26 Nov 2010 04:19:37 -0500 Date: Fri, 26 Nov 2010 09:18:32 +0000 From: Russell King - ARM Linux To: Ohad Ben-Cohen Cc: Olof Johansson , Hari Kanigeri , Suman Anna , Benoit Cousson , Arnd Bergmann , Tony Lindgren , Greg KH , linux-kernel@vger.kernel.org, Grant Likely , Kevin Hilman , akpm@linux-foundation.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 1/4] drivers: hwspinlock: add generic framework Message-ID: <20101126091832.GE9310@n2100.arm.linux.org.uk> References: <1290526740-27624-1-git-send-email-ohad@wizery.com> <1290526740-27624-2-git-send-email-ohad@wizery.com> <20101126045912.GC6598@lixom.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1294 Lines: 33 On Fri, Nov 26, 2010 at 10:53:10AM +0200, Ohad Ben-Cohen wrote: > >> +int __hwspin_trylock(struct hwspinlock *hwlock, int mode, unsigned long *flags) > >> +{ > >> + ? ? int ret; > >> + > >> + ? ? if (unlikely(!hwlock)) { > >> + ? ? ? ? ? ? pr_err("invalid hwlock\n"); > > > > These kind of errors can get very spammy for buggy drivers. > > Yeah, but that's the purpose - I want to catch such egregious drivers > who try to crash the kernel. That can be better - because you get a backtrace, and it causes people to report the problem rather than just ignore it. It may also prevent the driver author releasing his code (as it won't work on their initial testing.) > > It's likely > > more useful to either do a WARN_ON(), and/or move them under a debug > > config option. > > Why would you prefer to compile out reporting of such extremely buggy > behavior ? If it's "extremely buggy behaviour" then the drivers deserve to crash. Such stuff should cause them not to get out the door. A simple printk with an error return can just be ignored. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/