[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200901210017.19038.arnd@arndb.de>
Date: Wed, 21 Jan 2009 00:17:18 +0100
From: Arnd Bergmann <arnd@...db.de>
To: David Miller <davem@...emloft.net>
Cc: ceggers@....de, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH] usb/mcs7830: Don't use buffers from stack for USB transfers
On Tuesday 20 January 2009, David Miller wrote:
> You cannot DMA from/to the kernel stack, because it might not be in
> the aliased linear mapping of physical memory. It could even be
> vmalloc()'d memory on some platforms.
Ok, I see. It seems a bit of a waste to do a kmalloc for something
that is guaranteed to be just a few bytes, but allocating the
buffer per-device would mean another mutex, which has about the
same overhead, so I'm basically ok with the patch.
> + buffer = kmalloc(size, GFP_NOIO);
GFP_NOIO seems out of place in a network driver: there is nothing
wrong with waiting for I/O here, so plain GFP_KERNEL should be fine.
> + if (buffer == NULL)
> + return -ENOMEM;
I'd prefer to write
if (!buffer)
here, as I do elsewhere in the driver.
Otherwise,
Acked-by: Arnd Bergmann <arnd@...db.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists