From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933658AbdDFJAn (ORCPT ); Thu, 6 Apr 2017 05:00:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53622 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755972AbdDFIpq (ORCPT ); Thu, 6 Apr 2017 04:45:46 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Brodkin , Vineet Gupta Subject: [PATCH 4.10 45/81] ARCv2: SLC: Make sure busy bit is set properly on SLC flushing Date: Thu, 6 Apr 2017 10:38:37 +0200 Message-Id: <20170406083626.134363360@linuxfoundation.org> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170406083624.322941631@linuxfoundation.org> References: <20170406083624.322941631@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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexey Brodkin commit c70c473396cbdec1168a6eff60e13029c0916854 upstream. As reported in STAR 9001165532, an SLC control reg read (for checking busy state) right after SLC invalidate command may incorrectly return NOT busy causing software to NOT spin-wait while operation is underway. (and for some reason this only happens if L1 cache is also disabled - as required by IOC programming model) Suggested workaround is to do an additional Control Reg read, which ensures the 2nd read gets the right status. Signed-off-by: Alexey Brodkin [vgupta: reworte changelog a bit] Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman --- arch/arc/mm/cache.c | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/arc/mm/cache.c +++ b/arch/arc/mm/cache.c @@ -633,6 +633,9 @@ noinline static void slc_entire_op(const write_aux_reg(ARC_REG_SLC_INVALIDATE, 1); + /* Make sure "busy" bit reports correct stataus, see STAR 9001165532 */ + read_aux_reg(r); + /* Important to wait for flush to complete */ while (read_aux_reg(r) & SLC_CTRL_BUSY); }