Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262085AbVBUUUq (ORCPT ); Mon, 21 Feb 2005 15:20:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262086AbVBUUUp (ORCPT ); Mon, 21 Feb 2005 15:20:45 -0500 Received: from fire.osdl.org ([65.172.181.4]:25574 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S262085AbVBUUUe (ORCPT ); Mon, 21 Feb 2005 15:20:34 -0500 Date: Mon, 21 Feb 2005 12:20:47 -0800 (PST) From: Linus Torvalds To: Russell King , Andrew Morton cc: Martin Drohmann , Kernel Mailing List Subject: Re: Why does printk helps PCMCIA card to initialise? In-Reply-To: <20050221091754.A28213@flint.arm.linux.org.uk> Message-ID: References: <42187819.5050808@uni-muenster.de> <20050220123817.A12696@flint.arm.linux.org.uk> <20050221091754.A28213@flint.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2382 Lines: 73 On Mon, 21 Feb 2005, Russell King wrote: > > In cs.c, alloc_io_space(), find the line: > > if (*base & ~(align-1)) { > > delete the ~ and rebuild. This may resolve your problem. Unlikely. The code is too broken for words. First off, setting align to zero makes no sense. An alignment cannot be zero, although some other parts of the system seem to consider a zero alignment to be the same as a maximum one (ie nonstatic_find_io_region()). Something like the appended has at least a snowballs chance in hell of being correct, although considering the amount of confusion in that single function, I'm not very optimistic. In particular, the initialization of "align" still has a case where it sets alignment to 0: align = (*base) ? (lines ? 1<features & SS_CAP_STATIC_MAP) && s->io_offset) { *base = s->io_offset | (*base & 0x0fff); @@ -766,7 +766,7 @@ potential conflicts, just the most obvious ones. */ for (i = 0; i < MAX_IO_WIN; i++) if ((s->io[i].NumPorts != 0) && - ((s->io[i].BasePort & (align-1)) == *base)) + ((s->io[i].BasePort & ~(align-1)) == *base)) return 1; for (i = 0; i < MAX_IO_WIN; i++) { if (s->io[i].NumPorts == 0) { - 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/