From patchwork Thu Jan 10 13:32:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 155158 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1898306jaa; Thu, 10 Jan 2019 05:31:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN6pn01EqYyQxNSIbExCEpG5mnTjan6VDLI/wzqEICl9flF2GmYtFGfPsq7wBZsV0o0aSsm8 X-Received: by 2002:a17:902:be0e:: with SMTP id r14mr9751382pls.124.1547127115637; Thu, 10 Jan 2019 05:31:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547127115; cv=none; d=google.com; s=arc-20160816; b=qfKLpC2+S60QLnF1eBn6e7RqbbMdkretnPlJmnMtTJ1FfkZ1TFmYqEIbLFvDIR1BXC gTQ0qYV+85ILmZeNehXbA6ueVEUe0pqEHSy2FSuUEzNPJnF4RiMT0OAplARBAHjEEA8i NLCFpnPEnDRzThK/knXMEmvEaOKZktsByKgdIDWME/PfOOVDrrkI0ZH083W3tiYF1oge LnxLjEo9GiaJhcrdJRkfUpsnPlUFSYDlsQ5LwX97St+WNoG14WW2ruCfcCPP+27KuxMv +54w+3kCBqajcForsC6kdefvOpZUZqMr6Yl/uSksvlaouFUVr4UpPEDM9E57R2Z/luRv ZI1A== 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=F7djFO4JQoSKe6DYvIE82HwH9Ccj3xBuSGCy2iZnhV0=; b=DtXwHHptFvSZ1zuzGemk2cFv9tTP1/iNxU2hIIAOEO/YEyi31iVPIM2g0FFKLekI7r r3Kg5wJh8laE9i5eFu+T92EvSKuH7i4KmQfevo+KTa1SJ2RPBYg8BbrWOUDkzo18Em6+ kmmKs4wD7Rd9Ka7LFtDqnnkn8f5ZKMpXwLcg0bK6HfBWfj6W0xbwNKygp/XGo+fK9Kj6 vINI6izvBA5L+MPBe4UQzNKdP6JHAaFrX0s0AWz7ylOyqQQOle8FVngZmZD8upVD6nKu /K4g80DE4FazwsnqbLw+eHHue2O+Yufvdq3WXPt4mkUC0bT2xMjWxJcfOLtmwIXItO4D 1X+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 91si16322866ply.214.2019.01.10.05.31.55; Thu, 10 Jan 2019 05:31:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728872AbfAJNby (ORCPT + 1 other); Thu, 10 Jan 2019 08:31:54 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:57686 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728702AbfAJNby (ORCPT ); Thu, 10 Jan 2019 08:31:54 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id B3F73597EFA230B72652; Thu, 10 Jan 2019 21:31:51 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.408.0; Thu, 10 Jan 2019 21:31:45 +0800 From: John Garry To: , CC: , , , John Garry Subject: [PATCH] scsi: hisi_sas: Set protection parameters prior to adding SCSI host Date: Thu, 10 Jan 2019 21:32:41 +0800 Message-ID: <1547127161-213124-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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Currently we set the protection parameters after calling scsi_add_host() for v3 hw. They should be set beforehand, so make this change. Appearantly this fixes our DIX issue (not mainline yet) also, but more testing required. Fixes: d6a9000b81be ("scsi: hisi_sas: Add support for DIF feature for v2 hw") Signed-off-by: John Garry -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index b780b52..18d1f2cb 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2675,6 +2675,12 @@ static void debugfs_snapshot_restore_v3_hw(struct hisi_hba *hisi_hba) if (hisi_sas_debugfs_enable) hisi_sas_debugfs_init(hisi_hba); + if (hisi_hba->prot_mask) { + dev_info(dev, "Registering for DIF/DIX prot_mask=0x%x\n", + prot_mask); + scsi_host_set_prot(hisi_hba->shost, prot_mask); + } + rc = scsi_add_host(shost, dev); if (rc) goto err_out_ha; @@ -2687,12 +2693,6 @@ static void debugfs_snapshot_restore_v3_hw(struct hisi_hba *hisi_hba) if (rc) goto err_out_register_ha; - if (hisi_hba->prot_mask) { - dev_info(dev, "Registering for DIF/DIX prot_mask=0x%x\n", - prot_mask); - scsi_host_set_prot(hisi_hba->shost, prot_mask); - } - scsi_scan_host(shost); return 0;