From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: [PATCH] [3/21] Pass gfp to scsi_allocate_command Date: Sun, 16 Nov 2008 23:21:17 +0100 Message-ID: <20081116222117.GD6703@one.firstfloor.org> References: <200811161211.212948789@firstfloor.org> <20081115231103.59DC93E661B@basil.firstfloor.org> <1226849345.3556.7.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from one.firstfloor.org ([213.235.205.2]:56670 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752595AbYKPWLl (ORCPT ); Sun, 16 Nov 2008 17:11:41 -0500 Content-Disposition: inline In-Reply-To: <1226849345.3556.7.camel@localhost.localdomain> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: James Bottomley Cc: Andi Kleen , axboe@kernel.dk, linux-scsi@vger.kernel.org On Sun, Nov 16, 2008 at 09:29:05AM -0600, James Bottomley wrote: > On Sun, 2008-11-16 at 00:11 +0100, Andi Kleen wrote: > > -static void scsi_put_host_cmd_pool(gfp_t gfp_mask) > > +static void scsi_put_host_cmd_pool(struct Scsi_Host *shost) > > { > > struct scsi_host_cmd_pool *pool; > > > > mutex_lock(&host_cmd_pool_mutex); > > - pool = (gfp_mask & __GFP_DMA) ? &scsi_cmd_dma_pool : > > + pool = (shost && shost->unchecked_isa_dma) ? > > &scsi_cmd_dma_pool : > > &scsi_cmd_pool; > > There's a conceptual problem with this: The API is designed to be used > on host setup (i.e. when allocating a host based command for the driver) > so the scsi_host may not be available (or at least not fully set up) > when this is called. I think it wasn't a problem on the ISA drivers I changed. > > What about making it take a mask instead? That should always be known > by the driver. Ok. -Andi