Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4535298imm; Mon, 17 Sep 2018 16:03:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZVenCFtgfUwHvy6U62vufHvMtyfGMLFCXdEDMQjE/9MLMjjcglkjwU1sgGdxdxabcwkoHv X-Received: by 2002:a62:b0e:: with SMTP id t14-v6mr27539608pfi.36.1537225398635; Mon, 17 Sep 2018 16:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537225398; cv=none; d=google.com; s=arc-20160816; b=vRdfTNNTVBAkPzcQCep+LpVYAh35Lun+Y7FauCNea7YhU7z3CyMKXBT6TW+DnmAm7h iQt5Trx41OjDerdMPhaj4lxLc/W29+i3H+IqrAXrO4Pc4+fFnV291gvS0Q+mgZALBSKc 9JIBAHR6KTvMWwQLN2WNd57I/Z+0N3D6ZMa73B0F0OHvGR36++cZ4g0UEJVNIFtraCF1 JU6/MP5Wb6AEup9AziUKanJqAG26ZugZVnVvL1IwvOX08CNlxneYbUoT0DYOnN+Kd/Tg DIWyhWygos/jAKVx1NcFjY/x7+JTnH5FN2W7UlhrewZ1H7qpdD9dT6G41HnUBMBw67D5 wExA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=k+N+qv1VZ+UwtIAxPm3rspnqd833jsD8mB2rMEjiL/g=; b=nICeuwGyTIDrUeHcfjwQzg8YOQfyTdH0yOOSrGpUxgJdrVzxpRijElRe77S5mpSH8y Cr56ue0bZqDCzpguJX6zi91cFWW4G2KHftU2cDV65i7OYN+MH3Xo8aLsSTcT9kGji1es uNUqmFidRmKaPj0/uFmqtD50BwBGIWDnfmi+Z0vJiCkikcd16J6UNMsMNiz2MmB5HTs3 puolDeFkSZwpHKxDTxd0XU4MIBnQEBZrhGSd9QBTSe4y2tvA1Vl3kD9riFrtfZZHiVdw IKUjxfoouSAkc6nIt/RNJsc9MBBoB/4BSLMEHlIOrViXjxhATIYEPFkVQWk5WjG4ekJf 2TzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12-v6si16105320plp.464.2018.09.17.16.03.03; Mon, 17 Sep 2018 16:03:18 -0700 (PDT) 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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730428AbeIREcB (ORCPT + 99 others); Tue, 18 Sep 2018 00:32:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48494 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727088AbeIREcA (ORCPT ); Tue, 18 Sep 2018 00:32:00 -0400 Received: from localhost (li1825-44.members.linode.com [172.104.248.44]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8F452C03; Mon, 17 Sep 2018 23:02:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Burton , James Hogan , Ralf Baechle , linux-mips@linux-mips.org, Vladimir Kondratiev , Sasha Levin Subject: [PATCH 4.14 056/126] MIPS: Fix ISA virt/bus conversion for non-zero PHYS_OFFSET Date: Tue, 18 Sep 2018 00:41:44 +0200 Message-Id: <20180917211708.156626486@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180917211703.481236999@linuxfoundation.org> References: <20180917211703.481236999@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Burton [ Upstream commit 0494d7ffdcebc6935410ea0719b24ab626675351 ] isa_virt_to_bus() & isa_bus_to_virt() claim to treat ISA bus addresses as being identical to physical addresses, but they fail to do so in the presence of a non-zero PHYS_OFFSET. Correct this by having them use virt_to_phys() & phys_to_virt(), which consolidates the calculations to one place & ensures that ISA bus addresses do indeed match physical addresses. Signed-off-by: Paul Burton Patchwork: https://patchwork.linux-mips.org/patch/20047/ Cc: James Hogan Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: Vladimir Kondratiev Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/io.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -141,14 +141,14 @@ static inline void * phys_to_virt(unsign /* * ISA I/O bus memory addresses are 1:1 with the physical address. */ -static inline unsigned long isa_virt_to_bus(volatile void * address) +static inline unsigned long isa_virt_to_bus(volatile void *address) { - return (unsigned long)address - PAGE_OFFSET; + return virt_to_phys(address); } -static inline void * isa_bus_to_virt(unsigned long address) +static inline void *isa_bus_to_virt(unsigned long address) { - return (void *)(address + PAGE_OFFSET); + return phys_to_virt(address); } #define isa_page_to_bus page_to_phys