From patchwork Fri Mar 14 15:34:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 26262 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 46C1B2036C for ; Fri, 14 Mar 2014 15:35:30 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id up15sf6322649pbc.2 for ; Fri, 14 Mar 2014 08:35:29 -0700 (PDT) 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=xMg0H2Wskn7JQP+nblsPPRqyxdjdrJCgvocYE0G6lck=; b=leoKljOhZIxcY2oKs4xytHXyy09KofIJ42YdLOsplu0cGoxlk9C9F0Y29CksRqd3RO qPwuOfjLabQJxFgh5BJ8X5lYcMjI2WcR99ZLM7mDF/ur0M00p7FuKKVhLjVvIzQZS18C gcqc8e1Mr1/11DqrNfd0/LKOajV8Dj8cKzx8s3Efe71u8ZwvrWjfDslABcmL/scQaZkR P6FTuY4uMtMMDNh02vSHn9rY6glg96PA38+F5TbQ65/D2HlPI85Mmu7oiEACiEulA7Ll Va2kpsJbOgdpwBD9AuDyQ3mXZdMV3hJxuh5e6lIOBBun16jSnny6kUkCZsf9FyDoB+VV yRGw== X-Gm-Message-State: ALoCoQllflWC0EN0OyCLe3pc+wae0G+5tP9tY/aVaF5PjXxZQR2o5lZ4mA7v5h6+uEAtp/yLVtUF X-Received: by 10.68.230.193 with SMTP id ta1mr3422709pbc.6.1394811329351; Fri, 14 Mar 2014 08:35:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.134 with SMTP id b6ls782409qgb.91.gmail; Fri, 14 Mar 2014 08:35:29 -0700 (PDT) X-Received: by 10.220.10.2 with SMTP id n2mr1419769vcn.26.1394811329252; Fri, 14 Mar 2014 08:35:29 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id tz5si2234439vdc.59.2014.03.14.08.35.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Mar 2014 08:35:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 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.176; Received: by mail-vc0-f176.google.com with SMTP id lc6so2906242vcb.35 for ; Fri, 14 Mar 2014 08:35:29 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr6790487vcb.2.1394811329168; Fri, 14 Mar 2014 08:35:29 -0700 (PDT) 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.78.9 with SMTP id i9csp27829vck; Fri, 14 Mar 2014 08:35:28 -0700 (PDT) X-Received: by 10.66.146.229 with SMTP id tf5mr9973602pab.50.1394811327978; Fri, 14 Mar 2014 08:35:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uc9si4076437pac.294.2014.03.14.08.35.26; Fri, 14 Mar 2014 08:35:26 -0700 (PDT) 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 S1755477AbaCNPfK (ORCPT + 26 others); Fri, 14 Mar 2014 11:35:10 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:50866 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755143AbaCNPfD (ORCPT ); Fri, 14 Mar 2014 11:35:03 -0400 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 s2EFYIpV003952; Fri, 14 Mar 2014 15:34:19 GMT From: Liviu Dudau To: linux-pci , Bjorn Helgaas , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , linaro-kernel , Arnd Bergmann Cc: LKML , "devicetree@vger.kernel.org" , LAKML , Tanmay Inamdar , Grant Likely Subject: [PATCH v7 1/3] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases. Date: Fri, 14 Mar 2014 15:34:16 +0000 Message-Id: <1394811258-1500-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1394811258-1500-1-git-send-email-Liviu.Dudau@arm.com> References: <1394811258-1500-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.176 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 Acked-by: Arnd Bergmann Tested-by: Tanmay Inamdar --- include/asm-generic/io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)