Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp870010pxb; Tue, 1 Feb 2022 12:07:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVioq21Euq1sFbps4aLyrwmZbnaa2Ab6NQn9EtJWcUQnoC0HVwlXsUMi3T8ENprTRebPQW X-Received: by 2002:a17:90a:34cc:: with SMTP id m12mr4281243pjf.24.1643746030996; Tue, 01 Feb 2022 12:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643746030; cv=none; d=google.com; s=arc-20160816; b=uLRJWW0+Cxpt8DkNrjE4iEIOVq1qdaWc1DzC1BjRQLzThJtW9LLuZUiCxlUpj8i9ol Yx+cpJiVcEi0zt4JNjtQqO93qOWK9EDjhpbiI6PT55atveLjDk62X3n8V5JlZA4bbDJo vdK7g7XnefLy5CNWCj3XZHwmG6jaXuXAGDiAG43+yjgLMX2OcdLQUaYqdmg3t1wp23WU 72LWj8xs3dxit1f23q+s1CpDZQ+kCO/4Ngsbb/jgm/BlmK3GrkGXYOsRsYksf55OoGwW /ypkGHtSxxUj5ThsgQ84+N9EZzMcrOXzIWG08nzPZYosPbA8upY9rcofnFsUYqVgSO1A LIEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=hofYlNsAYjxyz+jVbuGJpGPU623ucrq7ld8um7yDd00=; b=MELj+8FLxZh3pSGFH3z2CSNbMW4D9056LFWet+MNECU0mwoZYiPXeqXLgb/myQHSZ+ rS0Oidtb01rn5T+f01g9n5iz4LPgL635ZXD89WbTf9MM9yY+fsBHbz9f1bN/Dp9FE+4g tyC/2tYiSJfN04BH6R6G6xAnT5szWPcl/65w9lrTQR3iKnVtg5RQ3RpG498jkF50vgXp UA8NNP0jnzsMDFC+yGnsiUH4XaUQkz4CZVZVN9AIdauo5by4+3Y40Y6ZcFOMD9cr5NgZ 1jPGOTt+BD+MiTg8U+wR+CnCtRhvl5ZKyj/8lRaDNkfJ0PQF2RGLcEqF9csEjRMG9FEX kKnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d14si20178193plh.219.2022.02.01.12.06.59; Tue, 01 Feb 2022 12:07:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359690AbiAaL1S (ORCPT + 99 others); Mon, 31 Jan 2022 06:27:18 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4559 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377699AbiAaLSv (ORCPT ); Mon, 31 Jan 2022 06:18:51 -0500 Received: from fraeml705-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JnQXm0rh8z67xg8; Mon, 31 Jan 2022 19:18:16 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml705-chm.china.huawei.com (10.206.15.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Mon, 31 Jan 2022 12:18:46 +0100 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 31 Jan 2022 11:18:44 +0000 From: John Garry To: , CC: , , , John Garry Subject: [PATCH] scsi: hisi_sas: Fix setting of hisi_sas_slot.is_internal Date: Mon, 31 Jan 2022 19:13:27 +0800 Message-ID: <1643627607-138785-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The hisi_sas_slot.is_internal member is not set properly for ATA commands which the driver sends directly. A TMF struct pointer is normally used as a test to set this, but it is NULL for those commands. It's not ideal, but pass an empty TMF struct to set that member properly. Fixes: dc313f6b125b ("scsi: hisi_sas: Factor out task prep and delivery code") Reported-by: Xiang Chen Signed-off-by: John Garry --- Please consider this change for v5.17, thanks! diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 2f53a2ee024a..ebf5ec38891b 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -400,8 +400,7 @@ void hisi_sas_task_deliver(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot, struct hisi_sas_dq *dq, struct hisi_sas_device *sas_dev, - struct hisi_sas_internal_abort *abort, - struct hisi_sas_tmf_task *tmf) + struct hisi_sas_internal_abort *abort) { struct hisi_sas_cmd_hdr *cmd_hdr_base; int dlvry_queue_slot, dlvry_queue; @@ -427,8 +426,6 @@ void hisi_sas_task_deliver(struct hisi_hba *hisi_hba, cmd_hdr_base = hisi_hba->cmd_hdr[dlvry_queue]; slot->cmd_hdr = &cmd_hdr_base[dlvry_queue_slot]; - slot->tmf = tmf; - slot->is_internal = tmf; task->lldd_task = slot; memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr)); @@ -587,7 +584,7 @@ static int hisi_sas_task_exec(struct sas_task *task, gfp_t gfp_flags, slot->is_internal = tmf; /* protect task_prep and start_delivery sequence */ - hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev, NULL, tmf); + hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev, NULL); return 0; @@ -1380,12 +1377,13 @@ static int hisi_sas_softreset_ata_disk(struct domain_device *device) struct hisi_hba *hisi_hba = dev_to_hisi_hba(device); struct device *dev = hisi_hba->dev; int s = sizeof(struct host_to_dev_fis); + struct hisi_sas_tmf_task tmf = {}; ata_for_each_link(link, ap, EDGE) { int pmp = sata_srst_pmp(link); hisi_sas_fill_ata_reset_cmd(link->device, 1, pmp, fis); - rc = hisi_sas_exec_internal_tmf_task(device, fis, s, NULL); + rc = hisi_sas_exec_internal_tmf_task(device, fis, s, &tmf); if (rc != TMF_RESP_FUNC_COMPLETE) break; } @@ -1396,7 +1394,7 @@ static int hisi_sas_softreset_ata_disk(struct domain_device *device) hisi_sas_fill_ata_reset_cmd(link->device, 0, pmp, fis); rc = hisi_sas_exec_internal_tmf_task(device, fis, - s, NULL); + s, &tmf); if (rc != TMF_RESP_FUNC_COMPLETE) dev_err(dev, "ata disk %016llx de-reset failed\n", SAS_ADDR(device->sas_addr)); @@ -2067,7 +2065,7 @@ hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba, int device_id, slot->port = port; slot->is_internal = true; - hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev, abort, NULL); + hisi_sas_task_deliver(hisi_hba, slot, dq, sas_dev, abort); return 0; -- 2.26.2