From patchwork Tue Nov 17 16:50:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 56812 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2045313lbb; Tue, 17 Nov 2015 08:36:51 -0800 (PST) X-Received: by 10.68.175.193 with SMTP id cc1mr65629321pbc.16.1447778210368; Tue, 17 Nov 2015 08:36:50 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pu7si59145394pbb.156.2015.11.17.08.36.50; Tue, 17 Nov 2015 08:36:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754049AbbKQQgs (ORCPT + 28 others); Tue, 17 Nov 2015 11:36:48 -0500 Received: from szxga01-in.huawei.com ([58.251.152.64]:37284 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751966AbbKQQgm (ORCPT ); Tue, 17 Nov 2015 11:36:42 -0500 Received: from 172.24.1.49 (EHLO szxeml422-hub.china.huawei.com) ([172.24.1.49]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CZG01730; Wed, 18 Nov 2015 00:36:32 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by szxeml422-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.235.1; Wed, 18 Nov 2015 00:36:23 +0800 From: John Garry To: , , , , , , CC: , , , , , , , , Subject: [PATCH v5 13/32] scsi: hisi_sas: add hisi_hba workqueue Date: Wed, 18 Nov 2015 00:50:40 +0800 Message-ID: <1447779059-136143-14-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447779059-136143-1-git-send-email-john.garry@huawei.com> References: <1447779059-136143-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.564B5791.0033, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 5f1d03dbe94b803df42598a7c0d09eb3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas.h | 1 + drivers/scsi/hisi_sas/hisi_sas_main.c | 8 ++++++++ 2 files changed, 9 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h index c50384f..62bc6f3 100644 --- a/drivers/scsi/hisi_sas/hisi_sas.h +++ b/drivers/scsi/hisi_sas/hisi_sas.h @@ -72,6 +72,7 @@ struct hisi_hba { int n_phy; + struct workqueue_struct *wq; int slot_index_count; unsigned long *slot_index_tags; diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c index d7d9516..7f32c6b 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_main.c +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c @@ -150,6 +150,12 @@ static int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost) hisi_sas_slot_index_init(hisi_hba); + hisi_hba->wq = create_singlethread_workqueue(dev_name(dev)); + if (!hisi_hba->wq) { + dev_err(dev, "sas_alloc: failed to create workqueue\n"); + goto err_out; + } + return 0; err_out: return -ENOMEM; @@ -207,6 +213,8 @@ static void hisi_sas_free(struct hisi_hba *hisi_hba) hisi_hba->sata_breakpoint, hisi_hba->sata_breakpoint_dma); + if (hisi_hba->wq) + destroy_workqueue(hisi_hba->wq); } static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,