Lines 1104-1112
static int ata_scsi_dev_config(struct scsi_device *sdev,
Link Here
|
1104 |
struct request_queue *q = sdev->request_queue; |
1104 |
struct request_queue *q = sdev->request_queue; |
1105 |
void *buf; |
1105 |
void *buf; |
1106 |
|
1106 |
|
1107 |
/* set the min alignment and padding */ |
1107 |
sdev->sector_size = ATA_SECT_SIZE; |
1108 |
blk_queue_update_dma_alignment(sdev->request_queue, |
1108 |
|
1109 |
ATA_DMA_PAD_SZ - 1); |
1109 |
/* set DMA padding */ |
1110 |
blk_queue_update_dma_pad(sdev->request_queue, |
1110 |
blk_queue_update_dma_pad(sdev->request_queue, |
1111 |
ATA_DMA_PAD_SZ - 1); |
1111 |
ATA_DMA_PAD_SZ - 1); |
1112 |
|
1112 |
|
Lines 1120-1131
static int ata_scsi_dev_config(struct scsi_device *sdev,
Link Here
|
1120 |
|
1120 |
|
1121 |
blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN); |
1121 |
blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN); |
1122 |
} else { |
1122 |
} else { |
1123 |
/* ATA devices must be sector aligned */ |
1123 |
sdev->sector_size = ata_id_logical_sector_size(dev->id); |
1124 |
blk_queue_update_dma_alignment(sdev->request_queue, |
|
|
1125 |
ATA_SECT_SIZE - 1); |
1126 |
sdev->manage_start_stop = 1; |
1124 |
sdev->manage_start_stop = 1; |
1127 |
} |
1125 |
} |
1128 |
|
1126 |
|
|
|
1127 |
/* |
1128 |
* ata_pio_sectors() expects buffer for each sector to not cross |
1129 |
* page boundary. Enforce it by requiring buffers to be sector |
1130 |
* aligned, which works iff sector_size is not larger than |
1131 |
* PAGE_SIZE. ATAPI devices also need the alignment as |
1132 |
* IDENTIFY_PACKET is executed as ATA_PROT_PIO. |
1133 |
*/ |
1134 |
if (sdev->sector_size > PAGE_SIZE) |
1135 |
ata_dev_printk(dev, KERN_WARNING, |
1136 |
"sector_size=%u > PAGE_SIZE, PIO may malfunction\n", |
1137 |
sdev->sector_size); |
1138 |
|
1139 |
blk_queue_update_dma_alignment(sdev->request_queue, |
1140 |
sdev->sector_size - 1); |
1141 |
|
1129 |
if (dev->flags & ATA_DFLAG_AN) |
1142 |
if (dev->flags & ATA_DFLAG_AN) |
1130 |
set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); |
1143 |
set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); |
1131 |
|
1144 |
|