From patchwork Thu Sep 18 01:30: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: 37570 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 58A292054D for ; Thu, 18 Sep 2014 01:32:53 +0000 (UTC) Received: by mail-we0-f197.google.com with SMTP id w61sf83428wes.4 for ; Wed, 17 Sep 2014 18:32:52 -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=jFshxr4Y0WWC/KduvZgtQtn9j9hJP0jHKPnnQY8cBKo=; b=mZiZ14kOMf32CnYPsbmA9qEIzVoqT3fzJVIsXAXCJB68m6XeL9iY+WdiYjzf+pu3OO LBv9WLlTltKN7WzEiGdFhcbYbCGhocG+XP9jkiKkreBdBUqBJTJNe/cHZZFNmJdptQ5/ l50Ycrg8xZIKY5DWqKgVbagz6zglRiXS9lYbiq8Y3qHLtcjDc7e1nqGkgw2dshJE/R/L P3jOPqK2/jN1cr5AFwpDi4OX7ssO20wzz5/v35TdF19CmtrL9GSfdWpVlf8MBSQ9qLu7 URoxJnVYLMrdBJBbSTGWndmbbuZwi0bgKn1AMEX9siKtrkZEMNyhBg/m6MggM0iJU6IQ ZG5g== X-Gm-Message-State: ALoCoQmklMnfsGNeIOszzlrQRRF5k3QeZgO44jeBAPuAU5JVnsK0Q9nj1Vn1e4SGAb6flMSmiDeS X-Received: by 10.180.198.172 with SMTP id jd12mr8316016wic.6.1411003972570; Wed, 17 Sep 2014 18:32:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.167 with SMTP id z7ls159647laj.95.gmail; Wed, 17 Sep 2014 18:32:52 -0700 (PDT) X-Received: by 10.152.10.203 with SMTP id k11mr1335113lab.30.1411003972087; Wed, 17 Sep 2014 18:32:52 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by mx.google.com with ESMTPS id mn8si374944lbb.102.2014.09.17.18.32.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Sep 2014 18:32:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id el20so203279lab.33 for ; Wed, 17 Sep 2014 18:32:52 -0700 (PDT) X-Received: by 10.112.52.68 with SMTP id r4mr840644lbo.31.1411003971975; Wed, 17 Sep 2014 18:32:51 -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.112.130.169 with SMTP id of9csp679621lbb; Wed, 17 Sep 2014 18:32:51 -0700 (PDT) X-Received: by 10.68.241.230 with SMTP id wl6mr1535938pbc.1.1411003970426; Wed, 17 Sep 2014 18:32:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g14si37300883pdm.118.2014.09.17.18.32.49 for ; Wed, 17 Sep 2014 18:32:50 -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 S932317AbaIRBcn (ORCPT + 27 others); Wed, 17 Sep 2014 21:32:43 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:54524 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756983AbaIRBcF (ORCPT ); Wed, 17 Sep 2014 21:32:05 -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 s8I1UPl5003595; Thu, 18 Sep 2014 02:30:28 +0100 From: Liviu Dudau To: Bjorn Helgaas , Arnd Bergmann , Rob Herring , Jason Gunthorpe , Benjamin Herrenschmidt , Catalin Marinas , Will Deacon , Russell King , linux-pci , Linus Walleij Cc: Tanmay Inamdar , Grant Likely , Sinan Kaya , Jingoo Han , Kukjin Kim , Suravee Suthikulanit , linux-arch , LKML , Device Tree ML , LAKML Subject: [PATCH v11 01/10] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases. Date: Thu, 18 Sep 2014 02:30:16 +0100 Message-Id: <1411003825-21521-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411003825-21521-1-git-send-email-Liviu.Dudau@arm.com> References: <1411003825-21521-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.215.46 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 Reviewed-by: Catalin Marinas 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)