From patchwork Wed Mar 5 11:49:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 25758 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 01CFE203C3 for ; Wed, 5 Mar 2014 11:50:15 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf3276879oag.0 for ; Wed, 05 Mar 2014 03:50:15 -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=xMg0H2Wskn7JQP+nblsPPRqyxdjdrJCgvocYE0G6lck=; b=eoh2CRPtj167K6y+bL0uQdf7PjzzKcOdHaYSExbyZYys4ezaEB/H4n2gnNlgZz48IY RfOQmJC8m0ayPj4Bm/yebP7ucCoVacqyAbQ+J5ws3n0l3AnN2KoogkcrTAFz5BM723L/ 2mJrwuPSDpZqUfo+Lejekp/s3NeYwDlo98J93TmutYBhd2mSGynt3YD80BVLS1HpihUw c5t0TZUQOvVd10gZrvtxiFOaG1//YM5cSV5s0hlOw6Ym01z1zbuxnhSAlZ7Eu1ouXhKy /kn1Jx6I3je3mAux7MAfQZOiFKhPeG/WYQIBLb7r8XqTNU0jYmx4ewGcwyKERt4Yw8bn qY+Q== X-Gm-Message-State: ALoCoQndPFwDXFMaYa0tabZuriH09DVimcPhgXtndjuo0l+F4kIDn5nH5pC61jbniq4QzPVaPPyQ X-Received: by 10.182.19.231 with SMTP id i7mr1135029obe.25.1394020215495; Wed, 05 Mar 2014 03:50:15 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.85 with SMTP id y79ls231362qgy.92.gmail; Wed, 05 Mar 2014 03:50:15 -0800 (PST) X-Received: by 10.52.171.68 with SMTP id as4mr3570756vdc.0.1394020215318; Wed, 05 Mar 2014 03:50:15 -0800 (PST) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id a5si608085vez.82.2014.03.05.03.50.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Mar 2014 03:50:15 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id im17so891064vcb.33 for ; Wed, 05 Mar 2014 03:50:15 -0800 (PST) X-Received: by 10.58.211.8 with SMTP id my8mr39736vec.80.1394020215143; Wed, 05 Mar 2014 03:50:15 -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.78.9 with SMTP id i9csp12435vck; Wed, 5 Mar 2014 03:50:14 -0800 (PST) X-Received: by 10.67.3.40 with SMTP id bt8mr6340682pad.78.1394020214128; Wed, 05 Mar 2014 03:50:14 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tu7si2192283pac.338.2014.03.05.03.50.13; Wed, 05 Mar 2014 03:50:13 -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 S1756107AbaCELtu (ORCPT + 26 others); Wed, 5 Mar 2014 06:49:50 -0500 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:51621 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755531AbaCELtr (ORCPT ); Wed, 5 Mar 2014 06:49:47 -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 s25BnA5A028915; Wed, 5 Mar 2014 11:49:10 GMT From: Liviu Dudau To: linux-pci , Bjorn Helgaas , Catalin Marinas , Will Deacon , linaro-kernel Cc: Benjamin Herrenschmidt , LKML , "devicetree@vger.kernel.org" , LAKML , Tanmay Inamdar , Arnd Bergmann Subject: [PATCH v6 1/3] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases. Date: Wed, 5 Mar 2014 11:49:08 +0000 Message-Id: <1394020150-1875-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1394020150-1875-1-git-send-email-Liviu.Dudau@arm.com> References: <1394020150-1875-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.174 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)