From patchwork Wed Jul 18 14:14:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 142284 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp594223ljj; Wed, 18 Jul 2018 07:16:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcd2Z1eEnskUaC9F3bXes8a8Sl6vWRTsxJhgjL2RaGWxN+fzhaOzZxaYd4Hu3uKilt12t0g X-Received: by 2002:a62:cac5:: with SMTP id y66-v6mr5356007pfk.187.1531923391052; Wed, 18 Jul 2018 07:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531923391; cv=none; d=google.com; s=arc-20160816; b=E5K29buJnD/ybWl4o5wWD07SJ5yEhxRB8z+paIfGdqv8Tz9zEzDR2vcHMeWur4s+u1 qgCrC/n18n7V++t4PJD6u8PadEEiyMYJGzdIeUArodsmZqy79HadXA+cPDMLeqf+grNw 5XJjLP33hwonG549q3eaq3DIREtWybzArWX8HGJwc9unuM2529vI6ByxvjmQ8o4U4XQl hh6Y3TOtm2LqQAnoQU8OQ9cmQbah3NF3F+L/nq7ERsv4MDWykh3j8tUWsRUUfixfvZ3y dEwq/CtEHTlilCx6LkFC349hvX1tRgXjnXQWvJYKPwAOl0Nvy/+DymdVjgHsDdiAINvo dOPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=OE4k+14CEYXAP3hbmNPKWpXxRVbhSYT7UtfBIQV6gO0=; b=vfbwyJS9UoT9V8/wPVZgD+d6dsD55qAWKTag7EuyckDkDWcxemSMZdIjTiRvqArY26 B8xFIhxe3jl4Xpu1QH4rVFtX1xSgJXH0Q8j72GXTbx2yNeopfT//VrnvlpGJTzw4e23c Birla/wqTqUD6YNeUwrSD+gSQPzwDaYlctUdb0G5TNL6Mvu+98W6uzUd19mTdcPn7xRh d1Jv1CVwYal6eUhaM3wcWx3nXRETNn/4W/EQK31M2OZYMKVZ42PGwPaz0a1rZkKpz+yy C1wOrdTtsyCWwC2YAf2WfG3jzHVHcJYcXUdE2st5paXlE/kRnqIPXOSsgEE5zLQNZqOE dngw== 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 1-v6si3310991plz.379.2018.07.18.07.16.30; Wed, 18 Jul 2018 07:16:31 -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 S1731438AbeGROyf (ORCPT + 31 others); Wed, 18 Jul 2018 10:54:35 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9698 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730869AbeGROye (ORCPT ); Wed, 18 Jul 2018 10:54:34 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 3572F1F098290; Wed, 18 Jul 2018 22:16:04 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.382.0; Wed, 18 Jul 2018 22:15:58 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 9/9] scsi: hisi_sas: Add SATA FIS check for v3 hw Date: Wed, 18 Jul 2018 22:14:33 +0800 Message-ID: <1531923273-193768-10-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1531923273-193768-1-git-send-email-john.garry@huawei.com> References: <1531923273-193768-1-git-send-email-john.garry@huawei.com> 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: Xiang Chen Add a check ERR bit of status to decide whether there is something wrong with initial register-D2H FIS. If error exist, PHY link reset the channel to restart OOB. Directly call work HISI_PHYE_LINK_RESET replacing disable_phy_vx_hw() and enable_phy_vx_hw(). Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 3 +-- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 5a3d6a7..9c5c5a6 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -3240,8 +3240,7 @@ static irqreturn_t sata_int_v2_hw(int irq_no, void *p) if (fis->status & ATA_ERR) { dev_warn(dev, "sata int: phy%d FIS status: 0x%x\n", phy_no, fis->status); - disable_phy_v2_hw(hisi_hba, phy_no); - enable_phy_v2_hw(hisi_hba, phy_no); + hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET); res = IRQ_NONE; goto end; } diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 70e2299..08b503e2 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1191,6 +1191,16 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba) dev_info(dev, "phyup: phy%d link_rate=%d(sata)\n", phy_no, link_rate); initial_fis = &hisi_hba->initial_fis[phy_no]; fis = &initial_fis->fis; + + /* check ERR bit of Status Register */ + if (fis->status & ATA_ERR) { + dev_warn(dev, "sata int: phy%d FIS status: 0x%x\n", + phy_no, fis->status); + hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET); + res = IRQ_NONE; + goto end; + } + sas_phy->oob_mode = SATA_OOB_MODE; attached_sas_addr[0] = 0x50; attached_sas_addr[7] = phy_no;