diff options
author | Tejun Heo <htejun@gmail.com> | 2011-01-20 13:59:06 +0100 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2011-08-01 13:54:47 -0700 |
commit | 2f557bafe399f7e4c70e985eb1a864fabcd74c75 (patch) | |
tree | b4ac76c5c92054ac2b6a26a02a20d10b7d3b36c8 /net/can/raw.c | |
parent | 15d611d312597932f012f923a98871e7d1ba576c (diff) |
libata: set queue DMA alignment to sector size for ATAPI too
commit 729a6a300e628a48cf12bac93a964a535e83cd1d upstream.
ata_pio_sectors() expects buffer for each sector to be contained in a
single page; otherwise, it ends up overrunning the first page. This
is achieved by setting queue DMA alignment. If sector_size is smaller
than PAGE_SIZE and all buffers are sector_size aligned, buffer for
each sector is always contained in a single page.
This wasn't applied to ATAPI devices but IDENTIFY_PACKET is executed
as ATA_PROT_PIO and thus uses ata_pio_sectors(). Newer versions of
udev issue IDENTIFY_PACKET with unaligned buffer triggering the
problem and causing oops.
This patch fixes the problem by setting sdev->sector_size to
ATA_SECT_SIZE on ATATPI devices and always setting DMA alignment to
sector_size. While at it, add a warning for the unlikely but still
possible scenario where sector_size is larger than PAGE_SIZE, in which
case the alignment wouldn't be enough.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: John Stanley <jpsinthemix@verizon.net>
Tested-by: John Stanley <jpsinthemix@verizon.net>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'net/can/raw.c')
0 files changed, 0 insertions, 0 deletions