Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752030AbdFNJSK (ORCPT ); Wed, 14 Jun 2017 05:18:10 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2090 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750770AbdFNJR0 (ORCPT ); Wed, 14 Jun 2017 05:17:26 -0400 Subject: Re: [PATCH v2 2/2] libsas: Enhance libsas hotplug To: Johannes Thumshirn , , References: <1497425597-18799-1-git-send-email-wangyijing@huawei.com> <1497425597-18799-3-git-send-email-wangyijing@huawei.com> <1fa27c30-aad7-2f19-4715-0ec02ef1a976@suse.de> CC: , , , , , , , , , , , , , , , , , From: wangyijing Message-ID: <5940FEBF.3020009@huawei.com> Date: Wed, 14 Jun 2017 17:15:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1fa27c30-aad7-2f19-4715-0ec02ef1a976@suse.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.23.4] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.5940FF22.00C8,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e68805adc2aedf85d5c5daa51b4a6bef Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1573 Lines: 28 >> In this patch, we try to solve these issues in following steps: >> 1. create a new workqueue used to run sas event work, instead of scsi host workqueue, >> because we may block sas event work, we cannot block the normal scsi works. >> When libsas receive a phy down event, sas_deform_port would be called, and now we >> block sas_deform_port and wait for destruction work finish, in sas_destruct_devices, >> we may wait ata error handler, it would take a long time, so if do all stuff in scsi >> host workq, libsas may block other scsi works too long. >> 2. create a new workqueue used to run sas discovery events work, instead of scsi host >> workqueue, because in some cases, eg. in revalidate domain event, we may unregister >> a sas device and discover new one, we must sync the execution, wait the remove process >> finish, then start a new discovery. So we must put the probe and destruct discovery >> events in a new workqueue to avoid deadlock. >> 3. introudce a asd_sas_port level wait-complete and a sas_discovery level wait-complete >> we use former wait-complete to achieve a sas event atomic process and use latter to >> make a sas discovery sync. >> 4. remove disco_mutex in sas_revalidate_domain, since now sas_revalidate_domain sync >> the destruct discovery event execution, it's no need to lock disco mutex there. > > The way you've written the changelog suggests this patch should be split > into 4 patches, each one taking care of one of your change items. I will split it in next version. Thanks! Yijing. >