Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755461AbYAOBmN (ORCPT ); Mon, 14 Jan 2008 20:42:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752900AbYAOBl5 (ORCPT ); Mon, 14 Jan 2008 20:41:57 -0500 Received: from idcmail-mo1so.shaw.ca ([24.71.223.10]:29604 "EHLO pd3mo2so.prod.shaw.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751218AbYAOBl4 (ORCPT ); Mon, 14 Jan 2008 20:41:56 -0500 Date: Mon, 14 Jan 2008 19:41:53 -0600 From: Robert Hancock Subject: Re: PROBLEM REMAINS: [sata_nv ADMA breaks ATAPI] Crash on accessing DVD-RAM In-reply-to: <1200243102.3179.27.camel@localhost.localdomain> To: James Bottomley Cc: Alan Cox , Alexander , linux-kernel@vger.kernel.org, ide , Jeff Garzik , Tejun Heo Message-id: <478C0F61.7030002@shaw.ca> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7bit References: <478702C7.80401@shaw.ca> <47887982.6050805@mail.ru> <47891426.1020604@shaw.ca> <1200170117.3656.66.camel@localhost.localdomain> <47894785.2050508@shaw.ca> <1200180440.3656.76.camel@localhost.localdomain> <47896BA8.4030609@shaw.ca> <20080113133317.50ad4bda@lxorguk.ukuu.org.uk> <1200238725.3179.16.camel@localhost.localdomain> <20080113162959.01d519db@lxorguk.ukuu.org.uk> <1200243102.3179.27.camel@localhost.localdomain> User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2423 Lines: 43 James Bottomley wrote: > On Sun, 2008-01-13 at 16:29 +0000, Alan Cox wrote: >>> Yes, I concur for the short term. The other two possible courses of >>> action either involve long discussions (the different device one) or >>> you'll never quite be sure you got all the paths (the GFP_DMA32 one). >>> At least with this one, you know everything will work. >> The different device one is tricky because the PCI layer is involved in >> mapping on some systems so you can't just magic up a platform device for >> it. Putting a mask on the block queue might perhaps work as a model >> which avoids breaking stuff by suprise, with the device left at 32bit >> masking. > > Actually, you might be able to ... that's why I'm suggesting it. There > are two pieces of information the arch layer needs to know: what is the > dma_mask and where is the iommu/bridge/whatever. When we went to the > generic dma_map_ API on parisc, we found you simply get the one from > struct device and for the other you walk up the device tree until you > find what you're looking for. > > I'm not suggesting we invent a dummy pci_device ... I'm suggesting we > dma_map on the existing scsi_device, which is properly parented to the > pci_device. The problem with this approach will be any architecture > which blindly expects dma_map converts to pci_dma_map; however, I'm not > sure we have any of those left. I've tried the dumb solution of setting the mask on the PCI device (for both ports) whenever an ATAPI device is detected, and ran into problems with that. If we really need to keep the block queue bounce limit and DMA mask the same, then we then have to set the bounce limit on both ports as well. If you blindly do that from slave_config, though, then you blow up since on the first port's initial slave_config the block queue for the second port isn't allocated yet, so you'd have to detect that case somehow. And if it's done via hotplug after the other port is already in use, it'll be changing the limits on a port that's in active use, which seems like it could be a bit racy. So, any ideas? Maybe using the separate struct device is the easiest solution, if it'll work.. -- 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/