Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751467AbdGNGmi (ORCPT ); Fri, 14 Jul 2017 02:42:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:39880 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750799AbdGNGmh (ORCPT ); Fri, 14 Jul 2017 02:42:37 -0400 Subject: Re: [PATCH v3 3/7] libsas: Use new workqueue to run sas event To: Yijing Wang , jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: chenqilin2@huawei.com, hare@suse.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, chenxiang66@hisilicon.com, huangdaode@hisilicon.com, wangkefeng.wang@huawei.com, zhaohongjiang@huawei.com, dingtianhong@huawei.com, guohanjun@huawei.com, yanaijie@huawei.com, hch@lst.de, dan.j.williams@intel.com, emilne@redhat.com, thenzl@redhat.com, wefu@redhat.com, charles.chenxin@huawei.com, chenweilong@huawei.com, john.garry@huawei.com, Johannes Thumshirn References: <1499670369-44143-1-git-send-email-wangyijing@huawei.com> <1499670369-44143-4-git-send-email-wangyijing@huawei.com> From: Hannes Reinecke Message-ID: <3e53940a-0913-1d08-3719-c45ffa854db7@suse.de> Date: Fri, 14 Jul 2017 08:42:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <1499670369-44143-4-git-send-email-wangyijing@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1619 Lines: 41 On 07/10/2017 09:06 AM, Yijing Wang wrote: > Now all libsas works are queued to scsi host workqueue, > include sas event work post by LLDD and sas discovery > work, and a sas hotplug flow may be divided into several > works, e.g libsas receive a PORTE_BYTES_DMAED event, > now we process it as following steps: > sas_form_port --- run in work in shot workq > sas_discover_domain --- run in another work in shost workq > ... > sas_probe_devices --- run in new work in shost workq > We found during hot-add a device, libsas may need run several > works in same workqueue to add device in system, the process is > not atomic, it may interrupt by other sas event works, like > PHYE_LOSS_OF_SIGNAL. Finally, we would found lots unexpected > errors. This patch is preparation of execute libsas sas event > in sync. > > Signed-off-by: Yijing Wang > CC: John Garry > CC: Johannes Thumshirn > CC: Ewan Milne > CC: Christoph Hellwig > CC: Tomas Henzl > CC: Dan Williams > --- > drivers/scsi/libsas/sas_event.c | 4 ++-- > drivers/scsi/libsas/sas_init.c | 7 +++++++ > include/scsi/libsas.h | 1 + > 3 files changed, 10 insertions(+), 2 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)