From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx117.postini.com [74.125.245.117]) by kanga.kvack.org (Postfix) with SMTP id 190996B0062 for ; Sun, 9 Sep 2012 11:32:20 -0400 (EDT) Received: by wgbdq12 with SMTP id dq12so954967wgb.26 for ; Sun, 09 Sep 2012 08:32:18 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1347202600.5876.7.camel@sbsiddha-ivb> References: <1340959739.2936.28.camel@lappy> <1347057778.26695.68.camel@sbsiddha-desk.sc.intel.com> <1347062045.26695.82.camel@sbsiddha-desk.sc.intel.com> <1347202600.5876.7.camel@sbsiddha-ivb> From: Linus Torvalds Date: Sun, 9 Sep 2012 08:31:57 -0700 Message-ID: Subject: Re: mtd: kernel BUG at arch/x86/mm/pat.c:279! Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: suresh.b.siddha@intel.com Cc: Sasha Levin , Andrew Morton , dwmw2@infradead.org, "linux-kernel@vger.kernel.org" , linux-mtd@lists.infradead.org, linux-mm , Dave Jones On Sun, Sep 9, 2012 at 7:56 AM, Suresh Siddha wrote: > > yes but that is not a valid range I think because of the supported > physical address bit limits of the processor and also the max > architecture limit of 52 address bits. But how could the caller possibly know that? None of those internal PAT limits are exposed anywhere. So doing the BUG_ON() is wrong. I'd suggest changing it to an EINVAL. In fact, BUG_ON() is *always* wrong, unless it's a "my internal data structures are so messed up that I cannot continue". Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org