From patchwork Tue Aug 12 16:25:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 35289 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9D5B203C5 for ; Tue, 12 Aug 2014 16:27:06 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id et14sf72502955pad.6 for ; Tue, 12 Aug 2014 09:27:06 -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=tofPbOyqrRQUDhD93YQk9+ifykYnzteieMUCW9/Afpo=; b=lPrUAPaFVknB1hz4tzt7Qy/BQ50mfZ6xckkLhmiv5HmJMrIPicb8AlNDWcTEtHwuH9 o+4hOwEV6Wq2wsnmc7eNVB8lv+qJnMfuF1gfSFCscR16eJTMqO2VXFIdllYiL6Y349Cb /svq85e59Df0Ke4jw+fq7E9AHAQmWzBxEv4uu38b1Qq0TO96UGMJtGGGKXneZ48b8yOW vqUcFDdbnNkfA6crl1GOXb0A6JZhzjE5B39lZ7d93dmRnvf1CCXBUEZNjSAY/0xeGoay Z3mHsuV1SY4Wcdvq3Oxaa2Oj77a+9gmkg4ChfIUZp3u+cAmaEWuJzsDgSgbIxuKqxDiF GS5w== X-Gm-Message-State: ALoCoQn0UT39u+vGbs8EeU0+LNH9B4rbwuxDkI24hii22e8h39E78x9T6LkUWIDB4JLxC5keh0dH X-Received: by 10.68.135.99 with SMTP id pr3mr974043pbb.9.1407860826164; Tue, 12 Aug 2014 09:27:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.36.148 with SMTP id p20ls208286qgp.50.gmail; Tue, 12 Aug 2014 09:27:06 -0700 (PDT) X-Received: by 10.52.246.198 with SMTP id xy6mr24740858vdc.7.1407860826049; Tue, 12 Aug 2014 09:27:06 -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 es2si8526510vcb.107.2014.08.12.09.27.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 09:27:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so13434136vcb.21 for ; Tue, 12 Aug 2014 09:27:05 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr2198049vcb.48.1407860825842; Tue, 12 Aug 2014 09:27:05 -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 tc5csp262551vcb; Tue, 12 Aug 2014 09:27:05 -0700 (PDT) X-Received: by 10.68.201.68 with SMTP id jy4mr5258491pbc.64.1407860824933; Tue, 12 Aug 2014 09:27:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wi3si16366204pbc.166.2014.08.12.09.27.04 for ; Tue, 12 Aug 2014 09:27:04 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754133AbaHLQ1C (ORCPT + 26 others); Tue, 12 Aug 2014 12:27:02 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:54727 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753387AbaHLQ0v (ORCPT ); Tue, 12 Aug 2014 12:26:51 -0400 Received: from e106497-lin.cambridge.arm.com (e106497-lin.cambridge.arm.com [10.1.195.53]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s7CGPPgV026280; Tue, 12 Aug 2014 17:25:27 +0100 From: Liviu Dudau To: Bjorn Helgaas , Catalin Marinas , Will Deacon , Benjamin Herrenschmidt , Arnd Bergmann , Russell King , Tanmay Inamdar , Grant Likely , Sinan Kaya , Jingoo Han , Kukjin Kim , Suravee Suthikulanit , linux-pci Cc: linux-arch , LKML , Device Tree ML , LAKML Subject: [PATCH v9 01/12] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases. Date: Tue, 12 Aug 2014 17:25:14 +0100 Message-Id: <1407860725-25202-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1407860725-25202-1-git-send-email-Liviu.Dudau@arm.com> References: <1407860725-25202-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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 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 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 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)