From patchwork Tue Jul 1 18:43:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 32928 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B0AD9203C0 for ; Tue, 1 Jul 2014 18:46:02 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id uz6sf60512160obc.0 for ; Tue, 01 Jul 2014 11:46:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=2xcu/o/9p3ZzS+JB8yHN4d8oLQr6a1Pw/cw9nv19TFo=; b=fplp4372gUo7F6EJI0WO7cNYYg7Wml3s5wDDqFTiHx1PBSQBmhjjRddd1kLnfEuFW5 5HxOSUhkeD+mY3sS2dIHt/wvQ2jn7PYWzbig4wjNFabyim27s6SAf1c07btPmPzI+z6J WBk2r505yBTbqpiVGPSaQ3iKv3McxQEb+8QcsjebYKA78T1wCkMxu0RIwqpsni8vXSPv V6i7vrHsxICE5J9m/lut+gNt/D6JilqPr/0CcWzBuEFnt29Ltn6eKwMKYv94Teow4LaR 3VrGhZcqp+HkInkADMiVRFwXfGKSXz7BlsWBu2a99mMwJeOz/+Y4bSZDTyzfQ5zbVjLO 5CPw== X-Gm-Message-State: ALoCoQnjeYYLpcgZZlZaph2JQTfIzZ6dzeDhZnN64B/qJxpXwrBdow8abifqNhOh/YBiRx6X2Y4l X-Received: by 10.182.49.136 with SMTP id u8mr18058822obn.32.1404240362338; Tue, 01 Jul 2014 11:46:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.74 with SMTP id w68ls2059008qgw.53.gmail; Tue, 01 Jul 2014 11:46:02 -0700 (PDT) X-Received: by 10.58.94.13 with SMTP id cy13mr17054veb.72.1404240362220; Tue, 01 Jul 2014 11:46:02 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id b8si11789540vcf.7.2014.07.01.11.46.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Jul 2014 11:46:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id jz11so10064456veb.2 for ; Tue, 01 Jul 2014 11:46:02 -0700 (PDT) X-Received: by 10.220.44.141 with SMTP id a13mr117763vcf.71.1404240362120; Tue, 01 Jul 2014 11:46:02 -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.221.37.5 with SMTP id tc5csp236972vcb; Tue, 1 Jul 2014 11:46:01 -0700 (PDT) X-Received: by 10.68.194.229 with SMTP id hz5mr62708380pbc.91.1404240360303; Tue, 01 Jul 2014 11:46:00 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id lq2si27821221pab.168.2014.07.01.11.45.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Jul 2014 11:46:00 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X232d-0006jk-Sf; Tue, 01 Jul 2014 18:44:31 +0000 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21] helo=cam-smtp0.cambridge.arm.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X232R-0006ae-FQ for linux-arm-kernel@lists.infradead.org; Tue, 01 Jul 2014 18:44:20 +0000 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 s61IhYJV027921; Tue, 1 Jul 2014 19:43:37 +0100 From: Liviu Dudau To: linux-pci , Bjorn Helgaas , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Arnd Bergmann , linaro-kernel , Tanmay Inamdar , Grant Likely , Sinan Kaya , Jingoo Han , Kukjin Kim , Suravee Suthikulanit Subject: [PATCH v8 1/9] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases. Date: Tue, 1 Jul 2014 19:43:26 +0100 Message-Id: <1404240214-9804-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1404240214-9804-1-git-send-email-Liviu.Dudau@arm.com> References: <1404240214-9804-1-git-send-email-Liviu.Dudau@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140701_114419_866123_2E526BB8 X-CRM114-Status: UNSURE ( 9.43 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [217.140.96.21 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record Cc: Device Tree ML , LKML , LAKML X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: liviu.dudau@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.171 as permitted sender) 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 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 975e1cc..2e2161b 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)