From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755453AbcI0PQX (ORCPT ); Tue, 27 Sep 2016 11:16:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:56863 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752183AbcI0PQP (ORCPT ); Tue, 27 Sep 2016 11:16:15 -0400 Subject: Re: [Question] Calling request_firmware under the spinlocks in file advansys.c To: Vaishali Thakkar , Matthew Wilcox , Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <57D7C470.5070505@oracle.com> <57EA5769.1080807@oracle.com> From: Hannes Reinecke Message-ID: <8ec2185d-203e-71fa-c274-65faf338820f@suse.de> Date: Tue, 27 Sep 2016 17:16:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <57EA5769.1080807@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/27/2016 01:26 PM, Vaishali Thakkar wrote: > > > On Tuesday 13 September 2016 02:48 PM, Vaishali Thakkar wrote: >> Hi, >> >> In the file drivers/scsi/advansys.c we are calling function AdvISR at 2 instances >> [in the function advansys_reset and advansys_interrupt] while holding spinlock. >> Function AdvISR eventually calls request_firmware following this sequence of >> routines: >> >> AdvISR -> adv_async_callback -> AdvResetChipAndSB -> AdvInitAsc3550Driver -> >> request_firmware >> >> According to the definition of request_firmware it should be called from user >> context where sleeping is allowed. And usually sleeping under the spin lock is >> not allowed. Is it really necessary to call AdvISR under spinlocks here? Are >> we taking care of sleeping related concern of request_firmware or am I >> overlooking something here? > > Hi, > > Any comments on this? > AdvISR is the main interrupt handling routine, for which we definitely will want to have interupts disabled. Plus the SCSI parallel drivers (ab-) use the interrupt routine to do all sorts of things, and are thereby well versed to keep interrupts disabled for an extented amount of time. However, we don't really have a good way of handling a request firmware here; we probably would need to implement a workqueue to handle this properly ... 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)