Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4827290ybl; Wed, 22 Jan 2020 05:29:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyXPrEKUjxV5HwNMc8CU/cxaHmUWi8LeTKxatPEIp8NmCoUDOoes4KZI2ygHceyfKJQCfE4 X-Received: by 2002:a05:6808:b24:: with SMTP id t4mr3054478oij.63.1579699763780; Wed, 22 Jan 2020 05:29:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699763; cv=none; d=google.com; s=arc-20160816; b=xF+e7yO/dL0FAF/4T+3VCUTcfLr097P5W0jkP9tQ3eEI4tX3miwZtB+4PpYQOdY9Ll rsV7NgZ1RVqvr9kK9UewziN9GSl5Z30AJ4ufB7FCvBlRugD3VRADV+0HsSwm9SnbMENA XoGCyANJVrpQF3S9T8xHdRwXWU1VnSSsNFXf+C34+RldHtgX+l4vBD990szyqvaK2vN+ WAMGff+F7/oKakYDEmt4m76XhYJvbK0NNlFwhI5/u8ibgY21O1hxXXqBnjf3zlSGiqNu tQY8Q2EZ4SMj/iHABjgOFpwe3qJkk6+NSAHC8oDJxBl917FNrcE8+J10KGjXb61q2hYZ sNdQ== 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:dkim-signature; bh=xYwmucinf46UykRutV9wZdFyNs+pSOKpX0z7e2kGfxM=; b=QMuavymIYQUqhV4h+KqoaioCLT2GMqZhUGlnm/bQ+dnjdUyzc3nn6QLsDlQpW2Xqpj bLzI3QM+MSDgHTrcV0+kE7uJKWXFNTXaWUgFEH0vmS8dd5WJDDEYqD0KwX4vC6FuNbIO IQ1mJya+v6fvlO8239OjR8jci0h6Ji4wsTzsXuBmrZwtUYNsTtdhMe15RIaYqNGPAxgn 8gzB/3WQXh31QRzAGbn9h1p/xTLPlMzySKtGx6rs4iFgx+Q6XfA/ZTif3UzrtSvvjewN rcGXe8pi/CJgLxiCMqrFq1RQcK3VSJMwABCOoD51AkSp/I9q8lHA7JBEpt/2HM20WwN4 uZ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uTd54wRX; 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 r4si23928220otq.188.2020.01.22.05.29.12; Wed, 22 Jan 2020 05:29:23 -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; dkim=pass header.i=@kernel.org header.s=default header.b=uTd54wRX; 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 S1729093AbgAVN1N (ORCPT + 99 others); Wed, 22 Jan 2020 08:27:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:48326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729332AbgAVN1H (ORCPT ); Wed, 22 Jan 2020 08:27:07 -0500 Received: from localhost (unknown [84.241.205.26]) (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 8D24624685; Wed, 22 Jan 2020 13:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699627; bh=bVmEqRxthyQil9CBv5ZYY8CyvuaiSbMYuOTK0Pqlna8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uTd54wRXV6BsZrBhfS+h798QhvtQE2JK7yTBQiGw/iwdv733NEAIceuClo9TPjFbM 3DXGLRJB1DstvtkuAR156FEMw2i2sZkNVWBVAPXotYa8W18rhftN69hGMJnLw3LLZH uwByTeKqEp79ul0HGLUM6iCr3mVm1s5T2SenLx6E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiang Chen , John Garry , "Martin K. Petersen" Subject: [PATCH 5.4 201/222] scsi: hisi_sas: Set the BIST init value before enabling BIST Date: Wed, 22 Jan 2020 10:29:47 +0100 Message-Id: <20200122092848.097671225@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Xiang Chen commit 65a3b8bd56942dc988b8c05615bd3f510a10012b upstream. If set the BIST init value after enabling BIST, there may be still some few error bits. According to the process, need to set the BIST init value before enabling BIST. Fixes: 97b151e75861 ("scsi: hisi_sas: Add BIST support for phy loopback") Link: https://lore.kernel.org/r/1571926105-74636-3-git-send-email-john.garry@huawei.com Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -3022,11 +3022,6 @@ static int debugfs_set_bist_v3_hw(struct hisi_sas_phy_write32(hisi_hba, phy_id, SAS_PHY_BIST_CTRL, reg_val); - mdelay(100); - reg_val |= (CFG_RX_BIST_EN_MSK | CFG_TX_BIST_EN_MSK); - hisi_sas_phy_write32(hisi_hba, phy_id, - SAS_PHY_BIST_CTRL, reg_val); - /* set the bist init value */ hisi_sas_phy_write32(hisi_hba, phy_id, SAS_PHY_BIST_CODE, @@ -3035,6 +3030,11 @@ static int debugfs_set_bist_v3_hw(struct SAS_PHY_BIST_CODE1, SAS_PHY_BIST_CODE1_INIT); + mdelay(100); + reg_val |= (CFG_RX_BIST_EN_MSK | CFG_TX_BIST_EN_MSK); + hisi_sas_phy_write32(hisi_hba, phy_id, + SAS_PHY_BIST_CTRL, reg_val); + /* clear error bit */ mdelay(100); hisi_sas_phy_read32(hisi_hba, phy_id, SAS_BIST_ERR_CNT);