From patchwork Tue Sep 23 19:01:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 37758 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E183620970 for ; Tue, 23 Sep 2014 20:01:00 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id q1sf4717295lam.6 for ; Tue, 23 Sep 2014 13:00:59 -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=JV3pV/61ST71N/M09bBKdOduUeLpVdsiiG+0IhGlHMItfommeMeJn+Y19Bh5Q1TQxe LFDnQyQWA5WgcZHgRugcYnqLIKpVoSx6uiZILDBJkb+ZNpd2fKvyH2piPjhCJKmEsyDL lFuh/ts0QspNOu2k9Gv+08IFZpYYZNrcVzT80bdf+X0PSuricRfkf3rMw54DJ55RdU4F TLztHRhSIJypO1DaR0t6FWOCs/T5P04zTZ0I7NjRE5AVHOLa92fv2BeeduFteFN/qovy vy5FDJZvypR+Y+Rc5WldAwbNvHym4/uTb7w3Q4CXNZc9z1CuVFG+Qneeks+F/CHtQN49 WH+w== X-Gm-Message-State: ALoCoQlr1rrnhO1igUuFe2PCubH6vBRWg+DicGPtxPlilCTKAQqQ7OrZKd1BtBTcZV8EZ9GsedxL X-Received: by 10.112.145.136 with SMTP id su8mr267281lbb.9.1411502459595; Tue, 23 Sep 2014 13:00:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.169 with SMTP id k9ls95165laa.91.gmail; Tue, 23 Sep 2014 13:00:59 -0700 (PDT) X-Received: by 10.112.149.2 with SMTP id tw2mr1704130lbb.21.1411502459306; Tue, 23 Sep 2014 13:00:59 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com [209.85.215.43]) by mx.google.com with ESMTPS id b8si20088320lbv.65.2014.09.23.13.00.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Sep 2014 13:00:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by mail-la0-f43.google.com with SMTP id gi9so9432524lab.16 for ; Tue, 23 Sep 2014 13:00:59 -0700 (PDT) X-Received: by 10.112.53.230 with SMTP id e6mr1728372lbp.100.1411502458913; Tue, 23 Sep 2014 13:00:58 -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 of9csp476638lbb; Tue, 23 Sep 2014 13:00:58 -0700 (PDT) X-Received: by 10.67.23.136 with SMTP id ia8mr2377863pad.125.1411502457259; Tue, 23 Sep 2014 13:00:57 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pc10si22675436pac.99.2014.09.23.13.00.56 for ; Tue, 23 Sep 2014 13:00:57 -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 S1756704AbaIWUAy (ORCPT + 27 others); Tue, 23 Sep 2014 16:00:54 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:54448 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754279AbaIWUAv (ORCPT ); Tue, 23 Sep 2014 16:00: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 s8NJ1Egw027659; Tue, 23 Sep 2014 20:01:21 +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 v12 01/12] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases. Date: Tue, 23 Sep 2014 20:01:03 +0100 Message-Id: <1411498874-9864-2-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411498874-9864-1-git-send-email-Liviu.Dudau@arm.com> References: <1411498874-9864-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.43 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)