From patchwork Wed Mar 20 10:21:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 160657 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp102406jan; Wed, 20 Mar 2019 03:21:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfSPp4Pzwz0MNrn8imEfEjqmWiA+9NOFndrPHkwO9wcmz2H6HK9okip4+a+PubysMn+dUg X-Received: by 2002:a17:902:50e3:: with SMTP id c32mr3992835plj.57.1553077311487; Wed, 20 Mar 2019 03:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553077311; cv=none; d=google.com; s=arc-20160816; b=HPIOvSEZ80JoBg3w65yKt625+QHSSm7Y9xGPB3cgAY7obydRd4vee7V2RZk6+W81Dr uMahsJvN6Fqsk8hxHIFIbaIhh50kr0DK9abZmMeK0tPj5JfH49EM72A3dNXPekXoNkCn JfiO03xWAXYHxH+lQWg/79286/3bzTSH3lfaMyOsz/DQtq9++eoCXVWNHXIx192wWGN5 Nf6bDFABo7XCIQRsghuUBOqXkcAeGtlDOyzcC/xRTA8Q9hSVpdSom/jM2Sxhydqcoouy fuRCGO87YvW+ZxKMIG1JS+RwRe85CFTjXkax3W6Tg13X6gtfPFGh2u2sbGbDZvZl+Kld 8exg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=dVhy3dAl6+O9IELnIYKtH1k3m0T9QAMX7gNsJZ6Qy1Q=; b=ALc+xvCFJS9sXM8oAv6sKsM/DIvsHlwIclwgEWamFZOzuPwR8HcK9y+sr8yjrZW+Vh lCiOmuGGC2FC4wMMsFRBY9kGXQr9qcNE5XnLh6J/L5FUrM/ZMFoGxSZP4eTYDIg6ypOI hyMyuvYkPmgF/5T3hwBLDdF3H/J88dpLqmnA5pro77ghyRYU0WuK6Zemt56m5fEFD1dg sf/ftmuDWyIPI6Eie8aHx9HehMmHZ9t4o5y3FqdAyxhc0aLFfHJBiZiQJKe/7L7ojBwX Sn5uv59pgbCquU5kaIwjWG1QLhlw8Z+C8iC9+CihTyWFg98Gz7oevIYGM3GCABmMgaTi Cxag== 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 u10si1315416pgr.112.2019.03.20.03.21.51; Wed, 20 Mar 2019 03:21:51 -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 S1727681AbfCTKVt (ORCPT + 31 others); Wed, 20 Mar 2019 06:21:49 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5713 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727529AbfCTKVs (ORCPT ); Wed, 20 Mar 2019 06:21:48 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D42F4F35A92E9DDB29AB; Wed, 20 Mar 2019 18:21:45 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.408.0; Wed, 20 Mar 2019 18:21:37 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH] scsi: hisi_sas: Add softreset in hisi_sas_I_T_nexus_reset() Date: Wed, 20 Mar 2019 18:21:34 +0800 Message-ID: <1553077294-129863-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luo Jiaxing We found out that for v2 hw, a SATA disk can not be written to after the system comes up. In commit ffb1c820b8b6 ("scsi: hisi_sas: remove the check of sas_dev status in hisi_sas_I_T_nexus_reset()"), we introduced a path where we may issue an internal abort for a SATA device, but without following it with a softreset. We need to always follow an internal abort with a software reset, as per HW programming flow, so add this. Fixes: ffb1c820b8b6 ("scsi: hisi_sas: remove the check of sas_dev status in hisi_sas_I_T_nexus_reset()") Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- Hi James, Martin, Please consider this patch for 5.1 fixes. It's fixes a big regression, where we can no longer access SATA disks, like here: https://storage.kernelci.org/next/master/next-20190213/arm64/defconfig/gcc-7/lab-collabora/boot-hip07-d05.html Thanks, John -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 3c3cf89f713f..14bac4966c87 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1801,6 +1801,12 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device) } hisi_sas_dereg_device(hisi_hba, device); + if (dev_is_sata(device)) { + rc = hisi_sas_softreset_ata_disk(device); + if (rc) + return TMF_RESP_FUNC_FAILED; + } + rc = hisi_sas_debug_I_T_nexus_reset(device); if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV))