From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753296AbbFHOQ4 (ORCPT ); Mon, 8 Jun 2015 10:16:56 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:59938 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752980AbbFHOQq (ORCPT ); Mon, 8 Jun 2015 10:16:46 -0400 Date: Mon, 8 Jun 2015 15:16:41 +0100 From: Nariman Poushin To: Mark Brown Cc: patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH] regmap: make REGCACHE_NONE maps return error on regcache_sync Message-ID: <20150608141641.GA9236@opensource.wolfsonmicro.com> References: <20150508095537.GA15394@opensource.wolfsonmicro.com> <20150508102019.GX22845@sirena.org.uk> <20150508103454.GA13160@opensource.wolfsonmicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150508103454.GA13160@opensource.wolfsonmicro.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 08, 2015 at 11:34:54AM +0100, Nariman Poushin wrote: > On Fri, May 08, 2015 at 11:20:19AM +0100, Mark Brown wrote: > > On Fri, May 08, 2015 at 10:55:37AM +0100, Nariman Poushin wrote: > > > Signed-off-by: Nariman Poushin > > > --- > > > regcache currently causes a BUG_ON if cache_sync/sync_region is > > > called on a map with cache_type REGCACHE_NONE. This is not > > > consistent with the behaviour of regcache_read/write which > > > currently just return -ENOSYS and only throws a BUG_ON if > > > the cache_type is something that _should_ have cache ops, > > > but doesn't. Sure your device might not work, it but doesn't > > > seem right to panic the kernel. The other option I suppose > > > is to change it to a WARN_ON. > > > > Please submit patches in the format covered in SubmittingPatches, the > > changelog goes before the signoff. > > > > Will do, apologies. > > > The reason this is so loud is that while it's reasonable that generic > > code could end up triggering a write it's difficult to see any way in > > which a sync could be triggered on a device without a cache without it > > being an obvious bug. Since people frequently don't bother checking > > return codes loud log messages are our only real way of reporting this, > > given where syncs tend to happen it's not likely to happen in an obscure > > code path that won't get seen. > > Fair enough, that makes sense. In light of this: https://lkml.org/lkml/2015/6/7/193 Would it be prudent to now make these WARN_ON? It seems like it's not worth taking the kernel down in the case where you are trying to sync to a non-existent cache for a peripheral. Of course it could be that the particular write _not_ going in to the cache is catastrophic for some other reason, but it still seems a bit severe and given the discussion above not the intended usage for BUG_ON. It doesn't feel like this satisfies the test: "The *ONLY* acceptable reason for a BUG_ON() is if the machine is dead anyway because of some major internal corruption." Anyway, just a thought. Not sure if this constitutes a "content-less bump", I just read something that I thought may change our previous assumptions, if it does, apologies. Thanks Nariman > > Thanks > Nariman > _______________________________________________ > patches mailing list > patches@opensource.wolfsonmicro.com > http://opensource.wolfsonmicro.com/cgi-bin/mailman/listinfo/patches