Received: by 10.223.164.202 with SMTP id h10csp193377wrb; Mon, 13 Nov 2017 05:04:32 -0800 (PST) X-Google-Smtp-Source: AGs4zMZHK/3v17n1Mok/3LQafl+T1pHsqYuvAbuVER8Vo7+WioDIwtwgetfmV9XGUOHx9M+Hv9NW X-Received: by 10.99.176.72 with SMTP id z8mr8475173pgo.175.1510578272611; Mon, 13 Nov 2017 05:04:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510578272; cv=none; d=google.com; s=arc-20160816; b=ocskwmI8iNH/hUPzMwS29mvZuIs6HLy85VBiYhfEp2dOSgRNdDjPkp9vUSmueFb7Pg 8T1ju2kBmEPZS4tjOcWMcuxnpThjVHFmZDXMzaV3zWutXhe/U0XuEIBKCu0G8lLh4EMS NNmzj+izcY5m0Nb8HNnxIkSTKeQVfyvp6+TDpanNvfShj0eaj3BP42s+WXHtrcQCUbdr OuoFLX0wL+0dW/1zQS9tqlyOeu3LlCssytd+Ts0jrQGu6MABvHUQJUTf9+IQXHyZAJxU kWM+3/4CB8crDmhy8ICRJKu1ZCrMSdsGxg9EDtFpXb3x0N5HtHgEn2v/9Z2J0rCUxZf5 ibtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=kKAx3y0P1QpXCRBpzwtd4PUCA38Ad/oe4ohc4eflc4g=; b=h2XnA1K278K91j2mlwGZ4wqBRb+gEkv1Le+ZXxBRvJpBCS4bZfE5qTcqRMi7JIogSR bp/XgCFrxrsef2A0zmAhQh+pQHXnrT2GFyTL5y7vwdR0AVkk7C692OM5pQjajbclCc9u sVnMEFrPSFxNvkb09+/fl5OnlCb2xaeTyFfvVCGa74CnA/opJef/WP1BcjVsTZ+8C2S6 y/kj4x3RyWg7Y3zwpJu2ilFItvfVL8YvxhG70rE9csK4y9urbBKVZT4DZJYjlnK3SaPk PbAkeJr3jkLrXXde0MTXH+FCw+9SvTiJKIsowk7bCiNvUf25c5KSZaqTZlMEgRhFqNYz OXKw== 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 y11si13696610pgr.323.2017.11.13.05.04.18; Mon, 13 Nov 2017 05:04:32 -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; 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 S1754994AbdKMNDA (ORCPT + 95 others); Mon, 13 Nov 2017 08:03:00 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51318 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932089AbdKMNC5 (ORCPT ); Mon, 13 Nov 2017 08:02:57 -0500 Received: from localhost (LFbn-1-12253-150.w90-92.abo.wanadoo.fr [90.92.67.150]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 91604AB5; Mon, 13 Nov 2017 13:02:56 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Burton , Matt Redfearn , James Hogan , Ralf Baechle , linux-mips@linux-mips.org Subject: [PATCH 4.9 66/87] MIPS: Fix CM region target definitions Date: Mon, 13 Nov 2017 13:56:23 +0100 Message-Id: <20171113125621.313640034@linuxfoundation.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113125615.304035578@linuxfoundation.org> References: <20171113125615.304035578@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Burton commit 6a6cba1d945a7511cdfaf338526871195e420762 upstream. The default CM target field in the GCR_BASE register is encoded with 0 meaning memory & 1 being reserved. However the definitions we use for those bits effectively get these two values backwards - likely because they were copied from the definitions for the CM regions where the target is encoded differently. This results in use setting up GCR_BASE with the reserved target value by default, rather than targeting memory as intended. Although we currently seem to get away with this it's not a great idea to rely upon. Fix this by changing our macros to match the documentated target values. The incorrect encoding became used as of commit 9f98f3dd0c51 ("MIPS: Add generic CM probe & access code") in the Linux v3.15 cycle, and was likely carried forwards from older but unused code introduced by commit 39b8d5254246 ("[MIPS] Add support for MIPS CMP platform.") in the v2.6.26 cycle. Fixes: 9f98f3dd0c51 ("MIPS: Add generic CM probe & access code") Signed-off-by: Paul Burton Reported-by: Matt Redfearn Reviewed-by: James Hogan Cc: Matt Redfearn Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: # v3.15+ Patchwork: https://patchwork.linux-mips.org/patch/17562/ Signed-off-by: James Hogan [jhogan@kernel.org: Backported 3.15..4.13] Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/mips-cm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/mips/include/asm/mips-cm.h +++ b/arch/mips/include/asm/mips-cm.h @@ -239,8 +239,8 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80) #define CM_GCR_BASE_GCRBASE_MSK (_ULCAST_(0x1ffff) << 15) #define CM_GCR_BASE_CMDEFTGT_SHF 0 #define CM_GCR_BASE_CMDEFTGT_MSK (_ULCAST_(0x3) << 0) -#define CM_GCR_BASE_CMDEFTGT_DISABLED 0 -#define CM_GCR_BASE_CMDEFTGT_MEM 1 +#define CM_GCR_BASE_CMDEFTGT_MEM 0 +#define CM_GCR_BASE_CMDEFTGT_RESERVED 1 #define CM_GCR_BASE_CMDEFTGT_IOCU0 2 #define CM_GCR_BASE_CMDEFTGT_IOCU1 3 From 1584032064216130841@xxx Tue Nov 14 09:11:36 +0000 2017 X-GM-THRID: 1584032064216130841 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread