From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752824AbbKPNeB (ORCPT ); Mon, 16 Nov 2015 08:34:01 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:31439 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752554AbbKPNd7 (ORCPT ); Mon, 16 Nov 2015 08:33:59 -0500 From: John Garry To: , , , , , , CC: , , , , , , , , Subject: [PATCH v4 13/32] scsi: hisi_sas: add hisi_hba workqueue Date: Mon, 16 Nov 2015 21:05:59 +0800 Message-ID: <1447679178-220222-14-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447679178-220222-1-git-send-email-john.garry@huawei.com> References: <1447679178-220222-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.5649D9C0.00BE,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: a169b8b4a64b03b2268efca19f9d670c Sender: linux-kernel-owner@vger.kernel.org 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(+) 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, -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Garry Subject: [PATCH v4 13/32] scsi: hisi_sas: add hisi_hba workqueue Date: Mon, 16 Nov 2015 21:05:59 +0800 Message-ID: <1447679178-220222-14-git-send-email-john.garry@huawei.com> References: <1447679178-220222-1-git-send-email-john.garry@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1447679178-220222-1-git-send-email-john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: JBottomley-wo1vFcy6AUs@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, pawel.moll-5wv7dgnIgG8@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org Cc: linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org, john.garry2-s/0ZXS5h9803lw97EnAbAg@public.gmane.org, hare-l3A5Bk7waGM@public.gmane.org, xuwei5-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org, zhangfei.gao-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, john.garry-hv44wF8Li93QT0dZR+AlfA@public.gmane.org List-Id: devicetree@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(+) 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, -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html