From patchwork Fri Feb 28 13:08:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 25543 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f200.google.com (mail-ie0-f200.google.com [209.85.223.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A915120567 for ; Fri, 28 Feb 2014 13:10:03 +0000 (UTC) Received: by mail-ie0-f200.google.com with SMTP id to1sf13829688ieb.3 for ; Fri, 28 Feb 2014 05:10:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=dAmJ7sl4Df6CUbMSCg27LticadlrFjzLKQ8Rmq4dGCo=; b=TInCQL+2YKxmEnow5mONZqX2+Y+XNAoZyiwkR4tpQJ7ezqD8VowZHgO8nAX4ZCZNBn VIXJjKJwqsR5vgr6xvA+Zgxu2QeprwEspF6Ys5qjog0fhyIn3OAAe23KimDKWIOEUGVJ zZpBUfdD9xNZruaH9uWt0JVhbB9E55ybfmqiDXHhOLh0lf37ocbiKnje6tiR4thmrrW9 smhXBOmGOzVlKfhgSBiSBbLbBxhCSp+Q4cSLdZY/MTS3gKIa0OzipnA/Ra0W5fm41/yr VFyOwNcIYQTIl2Ls/HaK26Tb/vB8FbuJRk1xJNU4upeMiZOlW/GAShkFlJXZ3QpASN7f Vqcw== X-Gm-Message-State: ALoCoQnk8+6yzm/cuA7SJrZuk4r2ucOkf3UTOmcKEOtbbXKbz/Xrm691tKsmkT3Obve5RN6YK62R X-Received: by 10.50.20.71 with SMTP id l7mr1655804ige.5.1393593002641; Fri, 28 Feb 2014 05:10:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.25.212 with SMTP id 78ls1180997qgt.30.gmail; Fri, 28 Feb 2014 05:10:02 -0800 (PST) X-Received: by 10.220.191.134 with SMTP id dm6mr2573918vcb.16.1393593002515; Fri, 28 Feb 2014 05:10:02 -0800 (PST) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id dc20si240588vec.42.2014.02.28.05.10.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Feb 2014 05:10:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id lf12so691724vcb.3 for ; Fri, 28 Feb 2014 05:10:02 -0800 (PST) X-Received: by 10.221.37.1 with SMTP id tc1mr2507230vcb.32.1393593002246; Fri, 28 Feb 2014 05:10:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.130.193 with SMTP id u1csp52487vcs; Fri, 28 Feb 2014 05:10:01 -0800 (PST) X-Received: by 10.66.146.229 with SMTP id tf5mr3479107pab.50.1393593001211; Fri, 28 Feb 2014 05:10:01 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id io5si1989001pbc.294.2014.02.28.05.10.00; Fri, 28 Feb 2014 05:10:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752335AbaB1NJO (ORCPT + 26 others); Fri, 28 Feb 2014 08:09:14 -0500 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:53739 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752285AbaB1NJJ (ORCPT ); Fri, 28 Feb 2014 08:09:09 -0500 Received: from e106497-lin.cambridge.arm.com (e106497-lin.cambridge.arm.com [10.1.195.170]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s1SD8Xdr023082; Fri, 28 Feb 2014 13:08:33 GMT From: Liviu Dudau To: linux-pci , Bjorn Helgaas , Catalin Marinas , Will Deacon , linaro-kernel Cc: Benjamin Herrenschmidt , LKML , "devicetree@vger.kernel.org" , LAKML Subject: [PATCH v3 1/3] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases. Date: Fri, 28 Feb 2014 13:08:31 +0000 Message-Id: <1393592913-24796-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1393592913-24796-1-git-send-email-Liviu.Dudau@arm.com> References: <1393592913-24796-1-git-send-email-Liviu.Dudau@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: liviu.dudau@arm.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The inline version of ioport_map() that gets used when !CONFIG_GENERIC_IOMAP is wrong. It returns a mapped (i.e. virtual) address that can start from zero and completely ignores the PCI_IOBASE and IO_SPACE_LIMIT that most architectures that use !CONFIG_GENERIC_MAP define. Signed-off-by: Liviu Dudau diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index d5afe96..df72051 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -331,7 +331,7 @@ static inline void iounmap(void __iomem *addr) #ifndef CONFIG_GENERIC_IOMAP static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) { - return (void __iomem *) port; + return (void __iomem *)(PCI_IOBASE + (port & IO_SPACE_LIMIT)); } static inline void ioport_unmap(void __iomem *p)