From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE8FB12AAF0; Tue, 26 Mar 2024 06:13:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711433621; cv=none; b=F2X02SC8kCwFOuhlICHXaBkEk+NOAHd80XiTucQrBX7U2C1nspYf+XTtI79LIFEqPBuJyDgZ2EdxKqtDxz9FQdkKW2bTrYSgrOImOKIgQFnCxFPfpvRMQwxEMst1Ok/+4GAoUf0UnD88T7j9pJabOWegK73QaljfavQeLNWtJGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711433621; c=relaxed/simple; bh=DcNGe9Tk16HHRAoWEdPOBl5gcDCsDZwYgrSCwCtlhAw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VJJMAxgwzPjl5coCQLY5tl2iVFl+pZHAiAZDkDKrUBk4jHhQbVXVFn/v4MIgbEYZo+mhOg/PeQEZjR9DVFKgECaF1a3twvHWLG/X2pNJQqW5YkVEnb+FlYK6pwkexXf4vKBmC3soJ0Qbp36DIuF6j0T8WzMO3jWvP5wGFb8+vis= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id AEBC068D45; Tue, 26 Mar 2024 07:13:35 +0100 (CET) Date: Tue, 26 Mar 2024 07:13:35 +0100 From: Christoph Hellwig To: Damien Le Moal Cc: Christoph Hellwig , Jens Axboe , "Martin K. Petersen" , Niklas Cassel , Takashi Sakamoto , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , "Juergen E. Fischer" , Xiang Chen , HighPoint Linux Team , Tyrel Datwyler , Brian King , Lee Duncan , Chris Leech , Mike Christie , John Garry , Jason Yan , Kashyap Desai , Sumit Saxena , Shivasharan S , Chandrakanth patil , Jack Wang , Nilesh Javali , GR-QLogic-Storage-Upstream@marvell.com, Greg Kroah-Hartman , Alim Akhtar , Avri Altman , Bart Van Assche , Krzysztof Kozlowski , Alan Stern , linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux1394-devel@lists.sourceforge.net, MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, open-iscsi@googlegroups.com, megaraidlinux.pdl@broadcom.com, mpi3mr-linuxdrv.pdl@broadcom.com, linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net Subject: Re: [PATCH 10/23] scsi: add a device_configure method to the host template Message-ID: <20240326061335.GE7108@lst.de> References: <20240324235448.2039074-1-hch@lst.de> <20240324235448.2039074-11-hch@lst.de> <6199c70e-f0a9-4756-b3fb-106985c41ebf@kernel.org> Precedence: bulk X-Mailing-List: linux-ide@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6199c70e-f0a9-4756-b3fb-106985c41ebf@kernel.org> User-Agent: Mutt/1.5.17 (2007-11-01) On Mon, Mar 25, 2024 at 04:38:43PM +0900, Damien Le Moal wrote: > > + if (hostt->device_configure) > > + ret = hostt->device_configure(sdev, &lim); > > + else if (hostt->slave_configure) > > + ret = hostt->slave_configure(sdev); > > + > > + ret2 = queue_limits_commit_update(sdev->request_queue, &lim); > > Why do this if ->device_configure() or ->slave_configure() failed ? > Shouldn't the "if (ret) goto fail" hunk be moved above this call ? queue_limits_commit_update unlocks the limits lock, which we'd otherwise leak. We could have a queue_limits_commit_abort, but it seems a bit pointless. > > + * > > + * Note: slave_configure is the legacy version, use device_configure for > > + * all new code. > > Maybe explictly mention that both *cannot* be defined here ? Will do.