Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754494AbZA0JhY (ORCPT ); Tue, 27 Jan 2009 04:37:24 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751152AbZA0JhJ (ORCPT ); Tue, 27 Jan 2009 04:37:09 -0500 Received: from sh.osrg.net ([192.16.179.4]:41327 "EHLO sh.osrg.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751124AbZA0JhI (ORCPT ); Tue, 27 Jan 2009 04:37:08 -0500 Date: Tue, 27 Jan 2009 18:36:47 +0900 To: stefanr@s5r6.in-berlin.de Cc: fujita.tomonori@lab.ntt.co.jp, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Subject: Re: swiotlb default size (64 MB) too small? From: FUJITA Tomonori In-Reply-To: <20090127165508L.fujita.tomonori@lab.ntt.co.jp> References: <20090121074339N.fujita.tomonori@lab.ntt.co.jp> <4976D52F.5090109@s5r6.in-berlin.de> <20090127165508L.fujita.tomonori@lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20090127183723W.fujita.tomonori@lab.ntt.co.jp> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1916 Lines: 48 On Tue, 27 Jan 2009 16:54:30 +0900 FUJITA Tomonori wrote: > > *) The report does not sound like there was a DMA mappig leak caused by > > copying between usb-storage and firewire-sbp2. Else he would have hit > > the problem again even with increased swiotlb default size. > > Maybe the reporter doesn't copy enough to hit the deadlock. Hmm, we don't have leak here? = From: FUJITA Tomonori Subject: [PATCH] fw-sbp2: fix dma mapping leak on the failure path Signed-off-by: FUJITA Tomonori --- drivers/firewire/fw-sbp2.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index e88d506..d40910d 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c @@ -1491,8 +1491,18 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done) orb->base.request_bus = dma_map_single(device->card->device, &orb->request, sizeof(orb->request), DMA_TO_DEVICE); - if (dma_mapping_error(device->card->device, orb->base.request_bus)) + if (dma_mapping_error(device->card->device, orb->base.request_bus)) { + if (scsi_sg_count(cmd)) { + dma_unmap_sg(device->card->device, scsi_sglist(cmd), + scsi_sg_count(cmd), + cmd->sc_data_direction); + dma_unmap_single(device->card->device, + orb->page_table_bus, + sizeof(orb->page_table), + DMA_TO_DEVICE); + } goto out; + } sbp2_send_orb(&orb->base, lu, lu->tgt->node_id, generation, lu->command_block_agent_address + SBP2_ORB_POINTER); -- 1.6.0.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/