Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2196971imm; Mon, 28 May 2018 03:44:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo0e7MTERII0hd5kXtk1iaXRZoTAjV4LJqjpW1Hy4Owi2VlBRtPysEmnPByckxuXJYQKelK X-Received: by 2002:a17:902:6e08:: with SMTP id u8-v6mr12969194plk.96.1527504283042; Mon, 28 May 2018 03:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527504283; cv=none; d=google.com; s=arc-20160816; b=hsMQLfDPLSgusuES42SjRA4gnag9y1Z8k+hJcYTLHSosiiq+BaGHXnjMj+7ziwc+nU tIIz0sD2zDOS0bUIexxA94tJ3uwtddB0aiparSk3+Uaqe3jEVxpwFkDUDXnQnUgJCZYT Qssrbk1qYvH/k5Hx6pqLbpD/gABy4KSuXayKry34i7nb/zQ0u0AfDofKDnoMNEg2/eGw Nriwu4NWsXA5UNKTd1q9Kbv5HrXwKHu5YtH2yuSTg+H8/ttsiRVtY4o9ervTQ2Dh6Sol 70rrnj4FqpRUu5m0mMCQYJ86QA1Cd8GazcWYcUff5Uu6mxh60TCcfJSUc+OjJg+h+DSR 0KMg== 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:dkim-signature :arc-authentication-results; bh=YSHFQW28KJyUdAMlZLdDXZpx+SmwY96T92K4eiK51BY=; b=oWQYijBfqw0QYlP4aIJ+YhlvGQlmo6PPBP922oMYivPO8/XEiSk70OJWEH9zSC0YF8 XvnF3xQvhgLB/A+3nqTn5BNU5PTU6JlNvqr2V7eKXZ2hCJIOYfvOC92f27co/HcixdGG xzHyMiHyeoZKuMqmqFK3ytLFWqn7g3D1Nox1oIRMJ6ifQ7XeZnR5slSswHtsaKVOLkfB Yx0mGei7ypZR8KiKPIncglvtP+GlhxIgT1kUt4xpKsOAWcO/V5cdTO3wQdVoadehx+Q9 0TOUkTPKIcozX2+OdH97gmrtF8x0X84IdrqIMRUSmqaZvANot4iWGc1rwOcgdzcCHEuy eT+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rqkp/bxl; 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 s83-v6si30277023pfg.175.2018.05.28.03.44.28; Mon, 28 May 2018 03:44:43 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Rqkp/bxl; 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 S968925AbeE1KoX (ORCPT + 99 others); Mon, 28 May 2018 06:44:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:35036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937443AbeE1KoN (ORCPT ); Mon, 28 May 2018 06:44:13 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7AE4720660; Mon, 28 May 2018 10:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504253; bh=8aATHoMJM5vEpVE9AQJ8F+P5224Poeuphje26F2RN6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rqkp/bxlt6d/JqBm1sRAwakZWOMNS3hnFx0k1TTV+q7zTky3uwyVvHjilY8Gh/yjR V+1H61F4dQXpnZc0o6N1XLx7bPEqjl+f7cO8wUAIKvL3bMUX+wQ2TLb54OY4ue69RM +EM+M1ZVTPJpjwo+YECsk1sV5oY9UnhbQc2i28GI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, greg@kroah.com Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , Mauricio Faria de Oliveira Subject: [PATCH 4.14 037/496] powerpc/rfi-flush: Move the logic to avoid a redo into the debugfs code Date: Mon, 28 May 2018 11:57:02 +0200 Message-Id: <20180528100321.207562099@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Ellerman commit 1e2a9fc7496955faacbbed49461d611b704a7505 upstream. rfi_flush_enable() includes a check to see if we're already enabled (or disabled), and in that case does nothing. But that means calling setup_rfi_flush() a 2nd time doesn't actually work, which is a bit confusing. Move that check into the debugfs code, where it really belongs. Signed-off-by: Michael Ellerman Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/setup_64.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -822,9 +822,6 @@ static void do_nothing(void *unused) void rfi_flush_enable(bool enable) { - if (rfi_flush == enable) - return; - if (enable) { do_rfi_flush_fixups(enabled_flush_types); on_each_cpu(do_nothing, NULL, 1); @@ -878,13 +875,19 @@ void __init setup_rfi_flush(enum l1d_flu #ifdef CONFIG_DEBUG_FS static int rfi_flush_set(void *data, u64 val) { + bool enable; + if (val == 1) - rfi_flush_enable(true); + enable = true; else if (val == 0) - rfi_flush_enable(false); + enable = false; else return -EINVAL; + /* Only do anything if we're changing state */ + if (enable != rfi_flush) + rfi_flush_enable(enable); + return 0; }