Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3508219pxb; Fri, 4 Feb 2022 09:58:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKIep7sR+vNYU3PTuKHkQRobJad01PtDmaLexfDwXUHQi5gJD5eiExkrTRuBjAp7crYiFM X-Received: by 2002:a17:90a:ad4a:: with SMTP id w10mr67663pjv.169.1643997533373; Fri, 04 Feb 2022 09:58:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643997533; cv=none; d=google.com; s=arc-20160816; b=CIR3Qhx/v/DYnc0YNmn2a6BmVHuKyGnbY54y/U1KbFb2oWzrGOf/lK/2SRQcMlKKSO tXMQmcBLs3mRIyNd+byNyRgev3vXbXHvHMD+NDnPrMkxzj5yxord1INMz5SAR72ocnkJ qbesBAFvsFGch4Rp8mb9Lt8ZQbPn0DFhDiMCEEBjd7WQaYdeeM5ZSU4/kOo0a4Ctmo+c qwNkvJfHt1LuDjkqzcMj9dgWgDv+aeXxrFe8tM813T71Ag5O5pEaujRkfZMtNcDgXcX1 aHZottM0B47+qCNoAcDGiMIljbwAv8pMfMEs+wLb68sUZkVpOWPehLhVJIjxau5CF/aA Orfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id; bh=CjkMdoTMh6yg71dviZLg7tNhC27DhlpQe3pbC8tQF+Q=; b=PIUW94U1MruQT8nbK6pxczlSu0Ej0CE8Fqa5ggFy6oM6q7/0CZ1zz6fNrGvyyN0Hfw mjXaZl0KF1MB8We9wf154d0+TLhMcfbIjn4SgGaGa+Sve/sHdQNDTl5hFMNBttT7V8ef oQaWcXYI+iPEZaBOYtGNrGHhavxzaIqyBd3g8Ne/aK1+NNjpKtr1kB1V6byQJDjxzOfX LZtOfS1QE+QxGMwdFdFoMciqPCqMD8jZzZrs7LLiRpAo2l6BswNrP1fZee9+m4wUiV4U +/+qJvGfIdeGRg8igtRAcDZ6oNm4M6H6WGBK+YNi/ACNTUxcV3JHrVgy8CdYfu2b2Jxa I4Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t17si2485935plr.512.2022.02.04.09.58.42; Fri, 04 Feb 2022 09:58:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1358494AbiBDLu6 (ORCPT + 99 others); Fri, 4 Feb 2022 06:50:58 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4671 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241452AbiBDLu5 (ORCPT ); Fri, 4 Feb 2022 06:50:57 -0500 Received: from fraeml739-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Jqtz42Yn2z67VnM; Fri, 4 Feb 2022 19:46:08 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml739-chm.china.huawei.com (10.206.15.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 4 Feb 2022 12:50:55 +0100 Received: from [10.47.87.24] (10.47.87.24) 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; Fri, 4 Feb 2022 11:50:47 +0000 Content-Type: multipart/mixed; boundary="------------Om3S7qykNY4xaw3MSzqO7tsA" Message-ID: Date: Fri, 4 Feb 2022 11:50:43 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 00/16] scsi: libsas and users: Factor out LLDD TMF code To: Damien Le Moal , , , , , , CC: , , , , , , References: <1643110372-85470-1-git-send-email-john.garry@huawei.com> <1893d9ef-042b-af3b-74ea-dd4d0210c493@opensource.wdc.com> <14df160f-c0f2-cc9f-56d4-8eda67969e0b@huawei.com> <49da4d80-5cc3-35c3-ccaa-6def8165eb65@huawei.com> <59a198a8-1d87-bc09-d2d8-2d495ed74c16@opensource.wdc.com> <098f988e-1f12-c412-3111-60393dfe0f0b@huawei.com> <62e56609-7026-93a1-a446-a6fd68328653@opensource.wdc.com> <2bd15f44-0b56-b6e0-8ef8-c33ba9ee7caa@opensource.wdc.com> From: John Garry In-Reply-To: <2bd15f44-0b56-b6e0-8ef8-c33ba9ee7caa@opensource.wdc.com> X-Originating-IP: [10.47.87.24] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) 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 --------------Om3S7qykNY4xaw3MSzqO7tsA Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit On 04/02/2022 11:27, Damien Le Moal wrote: >> As I mentioned, having this fail is a red flag. If I was pushed to guess >> what has happened, I'd say the FW is faulting due to some erroneous >> driver behaviour. > I am still thinking that there is something wrong with the handling of > NCQ NON DATA command. There are several places where the code determines > non-data vs pio vs dma vs fpdma (ncq), and NCQ NON DATA always falls in > the fpdma bucket, which is wrong. > Ok, I will have a look at this. We made some libsas changes related to this not so long ago to "fix" something, see: 53de092f47f ("scsi: libsas: Set data_dir as DMA_NONE if libata marks qc as NODATA") 176ddd89171d ("scsi: libsas: Reset num_scatter if libata marks qc as NODATA") >>> This is the submission path, not completion. The code is: >>> >>> (gdb) list *(pm8001_queue_command+0x842) >>> 0x3d42 is in pm8001_queue_command (drivers/scsi/pm8001/pm8001_sas.c:491). >>> 486 atomic_dec(&pm8001_dev->running_req); >>> 487 goto err_out_tag; >>> 488 } >>> 489 /* TODO: select normal or high priority */ >>> 490 spin_lock(&t->task_state_lock); >>> 491 t->task_state_flags |= SAS_TASK_AT_INITIATOR; >>> 492 spin_unlock(&t->task_state_lock); >>> 493 } while (0); >>> 494 rc = 0; >>> 495 goto out_done; >>> >>> So the task is already completed when the submission path tries to set >>> the state flag ? Debugging... >> Yeah, that's how it looks. >> >> I already mentioned this problem here: >> >> https://lore.kernel.org/linux-scsi/0cc0c435-b4f2-9c76-258d-865ba50a29dd@huawei.com/ >> >> Maybe we should just fix it now to rule it out of possibly causing other >> issues... I was reluctant to fix it as many places seems to need to be >> touched. Let me check it. > Here is my current fix: > > diff --git a/drivers/scsi/pm8001/pm8001_sas.c > b/drivers/scsi/pm8001/pm8001_sas.c > index 1b95c73d12d1..16c101577dd3 100644 > --- a/drivers/scsi/pm8001/pm8001_sas.c > +++ b/drivers/scsi/pm8001/pm8001_sas.c > @@ -453,13 +453,18 @@ int pm8001_queue_command(struct sas_task *task, > gfp_t gfp_flags) > ccb->ccb_tag = tag; > ccb->task = t; > ccb->device = pm8001_dev; > + > + /* TODO: select normal or high priority */ > + atomic_inc(&pm8001_dev->running_req); > + spin_lock(&t->task_state_lock); > + t->task_state_flags |= SAS_TASK_AT_INITIATOR; > + spin_unlock(&t->task_state_lock); > + > switch (task_proto) { > case SAS_PROTOCOL_SMP: > - atomic_inc(&pm8001_dev->running_req); > rc = pm8001_task_prep_smp(pm8001_ha, ccb); > break; > case SAS_PROTOCOL_SSP: > - atomic_inc(&pm8001_dev->running_req); > if (is_tmf) > rc = pm8001_task_prep_ssp_tm(pm8001_ha, > ccb, tmf); > @@ -468,7 +473,6 @@ int pm8001_queue_command(struct sas_task *task, > gfp_t gfp_flags) > break; > case SAS_PROTOCOL_SATA: > case SAS_PROTOCOL_STP: > - atomic_inc(&pm8001_dev->running_req); > rc = pm8001_task_prep_ata(pm8001_ha, ccb); > break; > default: > @@ -480,13 +484,12 @@ int pm8001_queue_command(struct sas_task *task, > gfp_t gfp_flags) > > if (rc) { > pm8001_dbg(pm8001_ha, IO, "rc is %x\n", rc); > + spin_lock(&t->task_state_lock); > + t->task_state_flags &= ~SAS_TASK_AT_INITIATOR; > + spin_unlock(&t->task_state_lock); > atomic_dec(&pm8001_dev->running_req); > goto err_out_tag; > } > - /* TODO: select normal or high priority */ > - spin_lock(&t->task_state_lock); > - t->task_state_flags |= SAS_TASK_AT_INITIATOR; > - spin_unlock(&t->task_state_lock); > } while (0); > rc = 0; > goto out_done; > > With this, No KASAN complaint. I will send a proper patch ASAP. I had just prepared a patch, but different, attached. > > Of note is that I cannot see what the flag SAS_TASK_AT_INITIATOR is for. > It is set and unset only, never tested anywhere in libsas nor pm8001 > driver. This flag seems totally useless to me, unless this is something > that the HW can see ? Right, it is only checked by isci AFAIC. And it is not something which HW can see. Since libsas does not check it the semantics are ill-defined. However I think that it's worth setting it completeness; I thought it was better setting it just before the command is delivered to HW, but the implementation touches more SW. Simpler approach may be better since it aligns with how this flag may be cleared in pm8001_chip_sata_req() under asusmption it is already set. Thanks, John --------------Om3S7qykNY4xaw3MSzqO7tsA Content-Type: text/plain; charset="UTF-8"; name="0001-scsi-pm8001-Set-SAS_TASK_AT_INITIATOR-before-deliver.patch" Content-Disposition: attachment; filename*0="0001-scsi-pm8001-Set-SAS_TASK_AT_INITIATOR-before-deliver.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSAxYWVhNWQ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