From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754243Ab2IIPcU (ORCPT ); Sun, 9 Sep 2012 11:32:20 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:59754 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752199Ab2IIPcT (ORCPT ); Sun, 9 Sep 2012 11:32:19 -0400 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 X-Google-Sender-Auth: WYlA3RVICaPUyn3uNwR9fHrXpBo Message-ID: Subject: Re: mtd: kernel BUG at arch/x86/mm/pat.c:279! 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 Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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