Re: [PATCH] dc395x: Fix support for highmem

2005-04-22 Thread Jens Axboe
On Thu, Apr 21 2005, Guennadi Liakhovetski wrote: +static void *dc390_kmap_atomic_sg(struct scatterlist *sg, int sg_count, size_t offset, size_t *len) +{ + int i; + size_t sg_len = 0; + + for (i = 0; i sg_count; i++) { + sg_len += sg[i].length; + if

Re: [PATCH] dc395x: Fix support for highmem

2005-04-09 Thread Guennadi Liakhovetski
On Thu, 31 Mar 2005 [EMAIL PROTECTED] wrote: On Wed, 30 Mar 2005, James Bottomley wrote: On Wed, 2005-03-30 at 23:22 +0200, Guennadi Liakhovetski wrote: What is going to happen to this stuff? The current Linus' tree contains a broken (by me:-() dc395x, other drivers (including tmscsim)

Re: [PATCH] dc395x: Fix support for highmem

2005-03-21 Thread Jens Axboe
On Mon, Mar 21 2005, [EMAIL PROTECTED] wrote: On Mon, 21 Mar 2005, Jens Axboe wrote: On Sun, Mar 20 2005, Guennadi Liakhovetski wrote: char *kmap_atomic_sg(struct scatterlist *sg, unsigned int offset, int *mapped); void kunmap_atomic_sg(struct scatterlist *sg, int mapped);

Re: [PATCH] dc395x: Fix support for highmem

2005-03-21 Thread gl
On Mon, 21 Mar 2005, Jens Axboe wrote: On Mon, Mar 21 2005, [EMAIL PROTECTED] wrote: On Mon, 21 Mar 2005, Jens Axboe wrote: easily doable. I made a suggestion earlier in the thread, you need to do something ala sg_map_each_entry(sglist, entries, sg, ouput_ptr, flags) {

Re: [PATCH] dc395x: Fix support for highmem

2005-03-20 Thread Guennadi Liakhovetski
On Sun, 20 Mar 2005, Christoph Hellwig wrote: On Wed, Mar 16, 2005 at 06:04:17PM +0100, Jens Axboe wrote: On Wed, Mar 16 2005, Christoph Hellwig wrote: On Wed, Mar 16, 2005 at 05:53:39PM +0100, Jens Axboe wrote: The list doesn't really need dma mapping at that point, the problem here

Re: [PATCH] dc395x: Fix support for highmem

2005-03-20 Thread Jens Axboe
On Sun, Mar 20 2005, Guennadi Liakhovetski wrote: On Sun, 20 Mar 2005, Christoph Hellwig wrote: On Wed, Mar 16, 2005 at 06:04:17PM +0100, Jens Axboe wrote: On Wed, Mar 16 2005, Christoph Hellwig wrote: On Wed, Mar 16, 2005 at 05:53:39PM +0100, Jens Axboe wrote: The list doesn't

Re: [PATCH] dc395x: Fix support for highmem

2005-03-17 Thread gl
Hi On Thu, 17 Mar 2005, Jens Axboe wrote: On Wed, Mar 16 2005, Guennadi Liakhovetski wrote: On Wed, 16 Mar 2005, Jens Axboe wrote: The kmap() isn't just inefficient, it's a problem to iterate over the sg list and kmap all the pages. That is illegal. Hm, what do you mean illegal?

Re: [PATCH] dc395x: Fix support for highmem

2005-03-17 Thread gl
On Thu, 17 Mar 2005, Jens Axboe wrote: See the kmap implementation, mm/highmem.c:map_new_virtual() to be precise. If you run out of entries while processing your sglist, you will end up waiting on a free kmap entry for an sg entry that will not become available before your previous kmaps are

Re: [PATCH] dc395x: Fix support for highmem

2005-03-17 Thread Guennadi Liakhovetski
Hi Here's a fixed patch - thanks to everybody for reviewing and commenting! However, if it is decided to implement helper functions, as suggested by Christoph and others, feel free to drop it. There, probably, was only 1 user of this card with highmem and he retired his card too:-) Thanks

Re: [PATCH] dc395x: Fix support for highmem

2005-03-16 Thread James Bottomley
On Wed, 2005-03-16 at 08:58 +0100, Jens Axboe wrote: Guys, who reviewed this? It looks completely bogus, using kmap() for tha entire sg list is just wrong and can deadlock easily. The proper way is of course to skip the virtual address requirement and dma map the sg array properly. I suppose

Re: [PATCH] dc395x: Fix support for highmem

2005-03-16 Thread Jens Axboe
On Wed, Mar 16 2005, James Bottomley wrote: On Wed, 2005-03-16 at 08:58 +0100, Jens Axboe wrote: Guys, who reviewed this? It looks completely bogus, using kmap() for tha entire sg list is just wrong and can deadlock easily. The proper way is of course to skip the virtual address requirement

Re: [PATCH] dc395x: Fix support for highmem

2005-03-16 Thread Matthew Wilcox
On Wed, Mar 16, 2005 at 05:04:47PM +0100, Jens Axboe wrote: The kmap() isn't just inefficient, it's a problem to iterate over the sg list and kmap all the pages. That is illegal. But it's not so tricky to get right, if the punting just happens in the isr. Basically just iterate over every sg

Re: [PATCH] dc395x: Fix support for highmem

2005-03-16 Thread Jens Axboe
On Wed, Mar 16 2005, Matthew Wilcox wrote: On Wed, Mar 16, 2005 at 05:04:47PM +0100, Jens Axboe wrote: The kmap() isn't just inefficient, it's a problem to iterate over the sg list and kmap all the pages. That is illegal. But it's not so tricky to get right, if the punting just happens

Re: [PATCH] dc395x: Fix support for highmem

2005-03-16 Thread Christoph Hellwig
On Wed, Mar 16, 2005 at 05:53:39PM +0100, Jens Axboe wrote: The list doesn't really need dma mapping at that point, the problem here is that the driver needs to punt to pio mode because of foo. So calling pci/dma_map_* is pointless, since the CPU will have to do the transfer anyways. What the

Re: [PATCH] dc395x: Fix support for highmem

2005-03-16 Thread Mike Christie
Jens Axboe wrote: On Wed, Mar 16 2005, Christoph Hellwig wrote: On Wed, Mar 16, 2005 at 05:53:39PM +0100, Jens Axboe wrote: The list doesn't really need dma mapping at that point, the problem here is that the driver needs to punt to pio mode because of foo. So calling pci/dma_map_* is pointless,

Re: [PATCH] dc395x: Fix support for highmem

2005-03-16 Thread Guennadi Liakhovetski
Hi Thanks for reviewing this patch! On Wed, 16 Mar 2005, Jens Axboe wrote: On Wed, Mar 16 2005, James Bottomley wrote: ... I agree the kmap is inefficient. The efficient alternative is to do dma_map_sg() and use kmap_atomic() in the interrupt routine where we do the PIO cleanup---I'm

Re: [PATCH] dc395x: Fix support for highmem

2005-03-16 Thread Jens Axboe
On Wed, Mar 16 2005, Guennadi Liakhovetski wrote: Hi Thanks for reviewing this patch! On Wed, 16 Mar 2005, Jens Axboe wrote: On Wed, Mar 16 2005, James Bottomley wrote: ... I agree the kmap is inefficient. The efficient alternative is to do dma_map_sg() and use kmap_atomic() in

Re: [PATCH] dc395x: Fix support for highmem

2005-03-15 Thread Jens Axboe
On Thu, Mar 03 2005, Linux Kernel Mailing List wrote: ChangeSet 1.1982.29.77, 2005/03/03 10:41:40+02:00, [EMAIL PROTECTED] [PATCH] dc395x: Fix support for highmem From: Guennadi Liakhovetski [EMAIL PROTECTED] Removes the page_to_virt and maps sg lists