From patchwork Tue Jan 26 11:04:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 370620 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4909593jam; Tue, 26 Jan 2021 04:14:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwE/Ojx6RYMlg2mK985jz3DlNrITegXWLUvR0Qq58H15wyo+NyfYvhk9KCRH0rJtIj/+Q0t X-Received: by 2002:a05:6402:558:: with SMTP id i24mr4354603edx.141.1611663244585; Tue, 26 Jan 2021 04:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611663244; cv=none; d=google.com; s=arc-20160816; b=OVqjNV0aNe1dSEjSJWQ4+b3+khnnnsSHu0UjEjQ3K6Ayu2l+SDsnB6UvP0ZD22DOf+ uxLJCaLttFW0nogObxP9yduHe53ZH+HkcOpIysA9aiFImiEflHiHPUO9r/18lFrN5R1r Jvi9LXHimymu27l5+aXwkXXQ+GRoX9KICHSnwkoWF3m3FeSCtkpf1lA/PmMxLSLzhQdD qQGoX1Af70XbZFpQTrakIFupA2ogECnjNVR5MBNzWjqdcrIZcWh8h+/uIMcGjrySkSsS aEnjS5VwzodrN0MxCTt3rfFtQZIU3UbbYWBf3u/QYvdlPiQRHHE//yd2JCswd83rfS6q fcsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=LuhonrBX64qPUHH7K8KW51SOOZiSvI04poCNhMgQ+gw=; b=YJE1Vls+SW6L0NnD33laql4txpswXsE1UCC+oXkohOYQSGPoJMwuIhGPk5YXWvEgKC WmEqmmY3+S8PpSVQa3ihDlOvJA0I8QXwFXT2Gxxv33PzyN3d74Em3qfzEblZNqk4cZy9 r8az4rSnsCVZyuiga82tGuV18dtDLaXG2pKqxiQ0oO9nB6dmKKyDgGZIiH/rmJ0+/uid I2tiwUG3cqDRR+tx35niSlqZMkvBmbR8uLwQOZAC20GrclsY43e2QuKaJDM7zdfVBekX DjrH6hOW4qSKnZ845+pfJAd51ns70u9kcTLspFUbca3gpPKsb8wF+CkKWV0OytpdSmEm thsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a73si8889453edf.23.2021.01.26.04.14.04 for ; Tue, 26 Jan 2021 04:14:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405444AbhAZMNx (ORCPT ); Tue, 26 Jan 2021 07:13:53 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:11883 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404902AbhAZLJS (ORCPT ); Tue, 26 Jan 2021 06:09:18 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DQ3pw3Ky8z7bL0; Tue, 26 Jan 2021 19:07:20 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Tue, 26 Jan 2021 19:08:25 +0800 From: John Garry To: , CC: , , , Luo Jiaxing , John Garry Subject: [PATCH 4/5] scsi: hisi_sas: Flush workqueue in hisi_sas_v3_remove() Date: Tue, 26 Jan 2021 19:04:27 +0800 Message-ID: <1611659068-131975-5-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1611659068-131975-1-git-send-email-john.garry@huawei.com> References: <1611659068-131975-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Luo Jiaxing If the controller reset occurs at the same time as driver removal, it may be possible that the interrupts have been released prior to the host softreset, and calling pci_irq_vector() there causes a WARN: WARNING: CPU: 37 PID: 1542 /pci/msi.c:1275 pci_irq_vector+0xc0/0xd0 Call trace: pci_irq_vector+0xc0/0xd0 disable_host_v3_hw+0x58/0x5b0 [hisi_sas_v3_hw] soft_reset_v3_hw+0x40/0xc0 [hisi_sas_v3_hw] hisi_sas_controller_reset+0x150/0x260 [hisi_sas_main] hisi_sas_rst_work_handler+0x3c/0x58 [hisi_sas_main] To fix, flush the driver workqueue prior to releasing the interrupts to ensure any resets have been completed. Signed-off-by: Luo Jiaxing Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 1 + 1 file changed, 1 insertion(+) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index e91df469e36b..4cc344ca121c 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -4572,6 +4572,7 @@ static void hisi_sas_v3_remove(struct pci_dev *pdev) del_timer(&hisi_hba->timer); sas_unregister_ha(sha); + flush_workqueue(hisi_hba->wq); sas_remove_host(sha->core.shost); hisi_sas_v3_destroy_irqs(pdev, hisi_hba);