From patchwork Fri Dec 8 17:16:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 121196 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp863103qgn; Fri, 8 Dec 2017 08:31:11 -0800 (PST) X-Google-Smtp-Source: AGs4zMY+ArDJiVmqbXmqeL7F7BlN75pXpo/ZatzqauxAWssxf8Z2TfIHQRA7+HH3eCN34asB0y+f X-Received: by 10.99.3.146 with SMTP id 140mr30488155pgd.275.1512750671347; Fri, 08 Dec 2017 08:31:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512750671; cv=none; d=google.com; s=arc-20160816; b=vrGQzlgVk0m7LlMJoyAdiUwhvg982pRPiDPDofYqut+r6SnAR73cN3wP4TAI/GqKGc aCMZdiowyTIdrilkL6l2WoiSCMr9y0DsKdZB6cGtkAK2BafWwthuy2g/kJYvqsr91uSs KNEmAJjbIsB1nDpUWEy3LH7cnYY9GPsF+zKrH1Ef0H9zFCuQUy/K4I72XSSkrgabl3P9 V3Da8hglTUlKbYok4tTCJXnb+feIxuVvCs6/8wZMt0KFotB8WPFtJtdzJ/4DJAE4wcMx lTVQdNNJiGrY5z0ZY8y7zvPdqtGnM7nE/9pxNP1FXX8pq7RZO65pfS9k7RdMkzrvpnGQ 1dbQ== 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=45YynZnIdKpj3B9tLAqK8kcCC/ckY+dDjh6hBlhA5mM=; b=xJ+FgQqTFNUcDoos/cYtqkKeq2KT5Vodg5K+7Ki+/4QIP7/dujigt55A0nHP+aEksy dTmTf/skJFp+PQW9EDw74SPuZgv/P4uWWyygNh5Vqb2FHRgZvdg1rin6uV69FRLHDJeP Mj8j5cri/Dox9qNiiK7vUaAop/iXskk6G5I+YZ1Cc4xGn4oH1C5oJHQKAj7tZ/uI1K40 AfNVy4xnNwUkuIQQkMEoRsyInw/yctb2001qpO182DzCXR5Gamag4SI3OiPPPh5fkV08 O8oW71r4lLiPGB2iB4gjSYyN7rR7UvyYKq7eCyEi+DwGYtayRbIR/C/Jrwbbhl0dw/DF wXZQ== 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 o6si2289947pls.300.2017.12.08.08.31.11; Fri, 08 Dec 2017 08:31:11 -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 S1754594AbdLHQbI (ORCPT + 1 other); Fri, 8 Dec 2017 11:31:08 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:36074 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754199AbdLHQbD (ORCPT ); Fri, 8 Dec 2017 11:31:03 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 878BA8326B2B6; Sat, 9 Dec 2017 00:30:50 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.361.1; Sat, 9 Dec 2017 00:30:41 +0800 From: John Garry To: , CC: , , , Xiang Chen , Xiaofei Tan , John Garry Subject: [PATCH 17/19] scsi: hisi_sas: fix SAS_QUEUE_FULL problem while running IO Date: Sat, 9 Dec 2017 01:16:48 +0800 Message-ID: <1512753410-50924-18-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1512753410-50924-1-git-send-email-john.garry@huawei.com> References: <1512753410-50924-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-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiang Chen This patch fix SAS_QUEUE_FULL problem. The test situation is close port while running IO. In sas_eh_handle_sas_errors(), SCSI EH will free sas_task of the device if lldd_I_T_nexus_reset() return TMF_RESP_FUNC_COMPLETE or -ENODEV. But in our SAS driver, we only free slots of the device when the return value is TMF_RESP_FUNC_COMPLETE. So if the return value is -ENODEV, the slot resource will not free any more. As an solution, we should also free slots of the device in lldd_I_T_nexus_reset() if the return value is -ENODEV. Signed-off-by: Xiaofei Tan Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index 302da84..9bd98e5 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -1308,7 +1308,7 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device) rc = hisi_sas_debug_I_T_nexus_reset(device); - if (rc == TMF_RESP_FUNC_COMPLETE) { + if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV)) { spin_lock_irqsave(&hisi_hba->lock, flags); hisi_sas_release_task(hisi_hba, device); spin_unlock_irqrestore(&hisi_hba->lock, flags);