From patchwork Mon Mar 3 17:33:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 25624 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f199.google.com (mail-ie0-f199.google.com [209.85.223.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2AFEA20E1E for ; Mon, 3 Mar 2014 17:37:19 +0000 (UTC) Received: by mail-ie0-f199.google.com with SMTP id rl12sf14919325iec.2 for ; Mon, 03 Mar 2014 09:37:18 -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=cA2MF4nEZ9ZRritNy2j3i7FbiGLkWRWfBJk7tzzN28U=; b=XQ+qGf+YHMuDS3ouRETiCVekf3La9APjRI/x/M5ThnePDJdRLkWzyS/PDv4qu7SZTS s0KFSOBPOBw7SWC9UPDMJuIha3oYb206YN/csxtLy6XpEZ7paz8D/8UyKaS34XsxtZ4N e7ZfME5W4b9nu6BnzpvFexSJP13aVWyNyWYhGsP3FWVuBQ3UtK4eYjBAYsI3OXfJE4L2 PDjo1+1ME5VI8v93o/42Q4O9lu1ejcWaQS4E42Xh3z9mmbAcnOYNxp6oWdHngxz47nLC pkCJtjf1rh+BHV/75VYALUlXbDyTph5u5FBGN1C1aDZG3XKbFHDkYinrGylJ/gnqiep5 aByA== X-Gm-Message-State: ALoCoQk0Qq5Tl6aRamXPfdAlC8lBiTCxKJnlY97IpicZHB00z+dK9QJSOa71WEhSfw6q3W1g3jdO X-Received: by 10.182.216.200 with SMTP id os8mr14705319obc.0.1393868238671; Mon, 03 Mar 2014 09:37:18 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.52 with SMTP id j49ls2236113qge.7.gmail; Mon, 03 Mar 2014 09:37:18 -0800 (PST) X-Received: by 10.52.89.230 with SMTP id br6mr531294vdb.20.1393868238502; Mon, 03 Mar 2014 09:37:18 -0800 (PST) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id sl9si3378004veb.135.2014.03.03.09.37.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Mar 2014 09:37:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id lf12so3956840vcb.3 for ; Mon, 03 Mar 2014 09:37:18 -0800 (PST) X-Received: by 10.58.229.4 with SMTP id sm4mr18426412vec.10.1393868238413; Mon, 03 Mar 2014 09:37:18 -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.130.193 with SMTP id u1csp70031vcs; Mon, 3 Mar 2014 09:37:17 -0800 (PST) X-Received: by 10.68.216.133 with SMTP id oq5mr21001850pbc.72.1393868218483; Mon, 03 Mar 2014 09:36:58 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tg2si11356600pbc.323.2014.03.03.09.36.57; Mon, 03 Mar 2014 09:36:57 -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 S1754672AbaCCRgf (ORCPT + 26 others); Mon, 3 Mar 2014 12:36:35 -0500 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:53754 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754082AbaCCReK (ORCPT ); Mon, 3 Mar 2014 12:34:10 -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 s23HXXBs016091; Mon, 3 Mar 2014 17:33:33 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 Subject: [PATCH v4 1/3] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases. Date: Mon, 3 Mar 2014 17:33:31 +0000 Message-Id: <1393868013-32345-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1393868013-32345-1-git-send-email-Liviu.Dudau@arm.com> References: <1393868013-32345-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.172 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 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)