From patchwork Mon Sep 8 13:54:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 36983 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 18DBE20491 for ; Mon, 8 Sep 2014 13:57:17 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf77052754oag.4 for ; Mon, 08 Sep 2014 06:57:16 -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=lGia6DCbCRo6vwEbRuVN075VCOvyV4azWZWk+6glZ4M=; b=a7+gY6pkoDSSnhNlpGOVrLPWVPiHipeLrklAahKgX+HpUMy9sFWlfJVE+Y2OsAv5DR BEFQcrNYMJUQ5WiEVNZMQrJ6VlGWynn0hUHoFatvigaI+oDVpK1KC3JH/pKcJF7hOoqa 0bm1Dr9R/6dxA28BfozgnPaImsFd0fn/gGjtQyaLt5ySKCNKrawavEymR4RDZxAvoyVl gsz5ygVP5sooSIE9hy7ZqX78nyuqPuVgi48G90+NTdUb3X6TrM4ym8LQf/jY6iS76tec 6GpEOt2BUubVqmUTD0V7N52FWchPscRLpQjcPDevq1bNR5hT+dhWCVLm+Km1MH5qt+5P zDeA== X-Gm-Message-State: ALoCoQn486B0Sg4RYU25zpubzmoDwgFarvK/Z5NqJC1ZmbaNuPahhIoG3c5aeazDx+yyR2JxyyL4 X-Received: by 10.182.81.161 with SMTP id b1mr16734448oby.1.1410184636338; Mon, 08 Sep 2014 06:57:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.35 with SMTP id q32ls1744867qgq.50.gmail; Mon, 08 Sep 2014 06:57:16 -0700 (PDT) X-Received: by 10.52.146.17 with SMTP id sy17mr21515265vdb.29.1410184636095; Mon, 08 Sep 2014 06:57:16 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id ej9si3935503vcb.25.2014.09.08.06.57.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Sep 2014 06:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so15407725vcb.14 for ; Mon, 08 Sep 2014 06:57:16 -0700 (PDT) X-Received: by 10.52.97.233 with SMTP id ed9mr21431292vdb.16.1410184636012; Mon, 08 Sep 2014 06:57:16 -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.45.67 with SMTP id uj3csp137793vcb; Mon, 8 Sep 2014 06:57:15 -0700 (PDT) X-Received: by 10.70.48.208 with SMTP id o16mr48372757pdn.17.1410184634819; Mon, 08 Sep 2014 06:57:14 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yw3si12435158pac.41.2014.09.08.06.57.14 for ; Mon, 08 Sep 2014 06:57:14 -0700 (PDT) Received-SPF: none (google.com: devicetree-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 S1753848AbaIHN5M (ORCPT + 5 others); Mon, 8 Sep 2014 09:57:12 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:53654 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754005AbaIHN40 (ORCPT ); Mon, 8 Sep 2014 09:56:26 -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 s88DsW8E017520; Mon, 8 Sep 2014 14:54:33 +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 v10 01/10] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases. Date: Mon, 8 Sep 2014 14:54:23 +0100 Message-Id: <1410184472-17630-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1410184472-17630-1-git-send-email-Liviu.Dudau@arm.com> References: <1410184472-17630-1-git-send-email-Liviu.Dudau@arm.com> Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@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.169 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)