Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754034AbYC0WhI (ORCPT ); Thu, 27 Mar 2008 18:37:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752324AbYC0Wgz (ORCPT ); Thu, 27 Mar 2008 18:36:55 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:41170 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751709AbYC0Wgy (ORCPT ); Thu, 27 Mar 2008 18:36:54 -0400 Date: Thu, 27 Mar 2008 15:34:41 -0700 (PDT) From: Linus Torvalds To: Ivan Kokshaysky cc: Gary Hade , Ingo Molnar , Thomas Meyer , Stefan Richter , Thomas Gleixner , "Rafael J. Wysocki" , LKML , Adrian Bunk , Andrew Morton , Natalie Protasevich , Benjamin Herrenschmidt , pm@debian.org Subject: Re: [patch] pci: revert "PCI: remove transparent bridge sizing" In-Reply-To: <20080327221851.GA9675@jurassic.park.msu.ru> Message-ID: References: <20080326135458.GA27621@elte.hu> <20080326180701.GA6249@us.ibm.com> <20080326203012.GB6249@us.ibm.com> <20080326205828.GA15225@jurassic.park.msu.ru> <20080326232922.GA15784@jurassic.park.msu.ru> <20080327221851.GA9675@jurassic.park.msu.ru> User-Agent: Alpine 1.00 (LFD 882 2007-12-20) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1070 Lines: 30 On Fri, 28 Mar 2008, Ivan Kokshaysky wrote: > > Sounds good to me. So here we go (completely untested, just for review). [...] > - /* The bridge resources are special, as their > - size != alignment. Sizing routines return > - required alignment in the "start" field. */ > - align = (resno < PCI_BRIDGE_RESOURCES) ? size : res->start; > + > + align = resource_alignment(res); > + BUG_ON(!align); Don't do the BUG_ON(). That would just cause a broken machine, and makes it much harder to report this issue. BUG_ON() should be used only for totally unfixable things. In this case, the easy thing to do is to just return an error, possibly with a printk() about bogus resources (ignoring it as a resource, the way we do it in pdev_sort_resource()). But other than that, the thing doesn't look horrible. Linus -- 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/