Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758619AbXIRW0Y (ORCPT ); Tue, 18 Sep 2007 18:26:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753292AbXIRW0Q (ORCPT ); Tue, 18 Sep 2007 18:26:16 -0400 Received: from smtp2.linux-foundation.org ([207.189.120.14]:33580 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753017AbXIRW0P (ORCPT ); Tue, 18 Sep 2007 18:26:15 -0400 Date: Tue, 18 Sep 2007 15:25:42 -0700 (PDT) From: Linus Torvalds To: Jeff Garzik cc: "Luis R. Rodriguez" , Alan Cox , linux-kernel , "John W. Linville" , linux-wireless Subject: Re: [PATCH] Clarify pci_iomap() usage for MMIO-only devices In-Reply-To: Message-ID: References: <43e72e890709171322x76ab6b70xd29bf97e3643c553@mail.gmail.com> <20070918113401.6a8a737f@the-village.bc.nu> <43e72e890709181146s604e0f9fl8b0c16627469c77f@mail.gmail.com> <43e72e890709181207j7c85dc29sb355a9f5a4207411@mail.gmail.com> <43e72e890709181312sf2b421cn49be3389b3786a2a@mail.gmail.com> <43e72e890709181402x7335d0acp306cf576fac6c070@mail.gmail.com> <46F04386.8010209@garzik.org> 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: 1386 Lines: 31 On Tue, 18 Sep 2007, Linus Torvalds wrote: > > I just think that proliferation of IO interfaces is a bad idea. Side note: just allowing readl/writel on the iomap'ed pointers obviously avoids that proliferation, but iomap really is architecture-specific, so not only will different architectures act very differently, it's not necessarily the case that iomap() will always have the same pointer as the old ioremap(), even though the routines in the *default* implementation in lib/iomap.c do that. In fact, for IO port accesses, we already do some debugging to make sure that people don't misuse the iomap() interfaces (ie the whole "Bad IO access.." thing). I could well see the same thing happening for MMIO under some debugging option, explicitly using some high bits in a 64-bit address as a cookie - and that would make using regular readl/writel on the cookie just fail spectacularly. That said, it does seem unlikely (ie if we added a cookie for MMIO pointers, we'd probably do it *both* for iomap and for ioremap(), and readl/writel would continue to work). So in practice the readl/writel probably works. 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/