aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/sata_nv.c2
-rw-r--r--drivers/block/DAC960.c2
-rw-r--r--drivers/block/cciss.c5
-rw-r--r--drivers/block/cpqarray.c5
-rw-r--r--drivers/block/drbd/drbd_nl.c3
-rw-r--r--drivers/block/paride/pf.c3
-rw-r--r--drivers/block/pktcdvd.c4
-rw-r--r--drivers/block/ps3disk.c3
-rw-r--r--drivers/block/ps3vram.c3
-rw-r--r--drivers/block/sunvdc.c3
-rw-r--r--drivers/block/sx8.c3
-rw-r--r--drivers/block/ub.c3
-rw-r--r--drivers/block/viodasd.c3
-rw-r--r--drivers/block/xen-blkfront.c3
-rw-r--r--drivers/cdrom/gdrom.c2
-rw-r--r--drivers/cdrom/viocd.c3
-rw-r--r--drivers/ide/ide-probe.c3
-rw-r--r--drivers/md/raid5.c2
-rw-r--r--drivers/memstick/core/mspro_block.c3
-rw-r--r--drivers/message/i2o/i2o_block.c3
-rw-r--r--drivers/mmc/card/queue.c6
-rw-r--r--drivers/s390/block/dasd.c3
-rw-r--r--drivers/s390/char/tape_block.c3
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c4
-rw-r--r--drivers/scsi/scsi_lib.c4
-rw-r--r--drivers/scsi/sg.c6
-rw-r--r--drivers/scsi/st.c3
-rw-r--r--drivers/staging/hv/blkvsc_drv.c5
28 files changed, 33 insertions, 62 deletions
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 0c82d335c55d..684fe04dbbb7 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -772,7 +772,7 @@ static int nv_adma_slave_config(struct scsi_device *sdev)
772 } 772 }
773 773
774 blk_queue_segment_boundary(sdev->request_queue, segment_boundary); 774 blk_queue_segment_boundary(sdev->request_queue, segment_boundary);
775 blk_queue_max_hw_segments(sdev->request_queue, sg_tablesize); 775 blk_queue_max_segments(sdev->request_queue, sg_tablesize);
776 ata_port_printk(ap, KERN_INFO, 776 ata_port_printk(ap, KERN_INFO,
777 "DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n", 777 "DMA mask 0x%llX, segment boundary 0x%lX, hw segs %hu\n",
778 (unsigned long long)*ap->host->dev->dma_mask, 778 (unsigned long long)*ap->host->dev->dma_mask,
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 1c0cd35e1913..459f1bc25a7b 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -2534,7 +2534,7 @@ static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
2534 blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit); 2534 blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit);
2535 RequestQueue->queuedata = Controller; 2535 RequestQueue->queuedata = Controller;
2536 blk_queue_max_hw_segments(RequestQueue, Controller->DriverScatterGatherLimit); 2536 blk_queue_max_hw_segments(RequestQueue, Controller->DriverScatterGatherLimit);
2537 blk_queue_max_phys_segments(RequestQueue, Controller->DriverScatterGatherLimit); 2537 blk_queue_max_segments(RequestQueue, Controller->DriverScatterGatherLimit);
2538 blk_queue_max_hw_sectors(RequestQueue, Controller->MaxBlocksPerCommand); 2538 blk_queue_max_hw_sectors(RequestQueue, Controller->MaxBlocksPerCommand);
2539 disk->queue = RequestQueue; 2539 disk->queue = RequestQueue;
2540 sprintf(disk->disk_name, "rd/c%dd%d", Controller->ControllerNumber, n); 2540 sprintf(disk->disk_name, "rd/c%dd%d", Controller->ControllerNumber, n);
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 030e52d72254..a29e69418a03 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1797,10 +1797,7 @@ static int cciss_add_disk(ctlr_info_t *h, struct gendisk *disk,
1797 blk_queue_bounce_limit(disk->queue, h->pdev->dma_mask); 1797 blk_queue_bounce_limit(disk->queue, h->pdev->dma_mask);
1798 1798
1799 /* This is a hardware imposed limit. */ 1799 /* This is a hardware imposed limit. */
1800 blk_queue_max_hw_segments(disk->queue, h->maxsgentries); 1800 blk_queue_max_segments(disk->queue, h->maxsgentries);
1801
1802 /* This is a limit in the driver and could be eliminated. */
1803 blk_queue_max_phys_segments(disk->queue, h->maxsgentries);
1804 1801
1805 blk_queue_max_hw_sectors(disk->queue, h->cciss_max_sectors); 1802 blk_queue_max_hw_sectors(disk->queue, h->cciss_max_sectors);
1806 1803
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 6422651ec364..91d11631cec9 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -448,11 +448,8 @@ static int __init cpqarray_register_ctlr( int i, struct pci_dev *pdev)
448 blk_queue_bounce_limit(q, hba[i]->pci_dev->dma_mask); 448 blk_queue_bounce_limit(q, hba[i]->pci_dev->dma_mask);
449 449
450 /* This is a hardware imposed limit. */ 450 /* This is a hardware imposed limit. */
451 blk_queue_max_hw_segments(q, SG_MAX); 451 blk_queue_max_segments(q, SG_MAX);
452 452
453 /* This is a driver limit and could be eliminated. */
454 blk_queue_max_phys_segments(q, SG_MAX);
455
456 init_timer(&hba[i]->timer); 453 init_timer(&hba[i]->timer);
457 hba[i]->timer.expires = jiffies + IDA_TIMER; 454 hba[i]->timer.expires = jiffies + IDA_TIMER;
458 hba[i]->timer.data = (unsigned long)hba[i]; 455 hba[i]->timer.data = (unsigned long)hba[i];
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 9b55e64196fc..4df3b40b1057 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -710,8 +710,7 @@ void drbd_setup_queue_param(struct drbd_conf *mdev, unsigned int max_seg_s) __mu
710 max_seg_s = min(queue_max_sectors(b) * queue_logical_block_size(b), max_seg_s); 710 max_seg_s = min(queue_max_sectors(b) * queue_logical_block_size(b), max_seg_s);
711 711
712 blk_queue_max_hw_sectors(q, max_seg_s >> 9); 712 blk_queue_max_hw_sectors(q, max_seg_s >> 9);
713 blk_queue_max_phys_segments(q, max_segments ? max_segments : MAX_PHYS_SEGMENTS); 713 blk_queue_max_segments(q, max_segments ? max_segments : BLK_MAX_SEGMENTS);
714 blk_queue_max_hw_segments(q, max_segments ? max_segments : MAX_HW_SEGMENTS);
715 blk_queue_max_segment_size(q, max_seg_s); 714 blk_queue_max_segment_size(q, max_seg_s);
716 blk_queue_logical_block_size(q, 512); 715 blk_queue_logical_block_size(q, 512);
717 blk_queue_segment_boundary(q, PAGE_SIZE-1); 716 blk_queue_segment_boundary(q, PAGE_SIZE-1);
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c
index ea54ea393553..ddb4f9abd480 100644
--- a/drivers/block/paride/pf.c
+++ b/drivers/block/paride/pf.c
@@ -956,8 +956,7 @@ static int __init pf_init(void)
956 return -ENOMEM; 956 return -ENOMEM;
957 } 957 }
958 958
959 blk_queue_max_phys_segments(pf_queue, cluster); 959 blk_queue_max_segments(pf_queue, cluster);
960 blk_queue_max_hw_segments(pf_queue, cluster);
961 960
962 for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) { 961 for (pf = units, unit = 0; unit < PF_UNITS; pf++, unit++) {
963 struct gendisk *disk = pf->disk; 962 struct gendisk *disk = pf->disk;
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 6e1daa24da2f..b72935b8f203 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -950,14 +950,14 @@ static void pkt_iosched_process_queue(struct pktcdvd_device *pd)
950static int pkt_set_segment_merging(struct pktcdvd_device *pd, struct request_queue *q) 950static int pkt_set_segment_merging(struct pktcdvd_device *pd, struct request_queue *q)
951{ 951{
952 if ((pd->settings.size << 9) / CD_FRAMESIZE 952 if ((pd->settings.size << 9) / CD_FRAMESIZE
953 <= queue_max_phys_segments(q)) { 953 <= queue_max_segments(q)) {
954 /* 954 /*
955 * The cdrom device can handle one segment/frame 955 * The cdrom device can handle one segment/frame
956 */ 956 */
957 clear_bit(PACKET_MERGE_SEGS, &pd->flags); 957 clear_bit(PACKET_MERGE_SEGS, &pd->flags);
958 return 0; 958 return 0;
959 } else if ((pd->settings.size << 9) / PAGE_SIZE 959 } else if ((pd->settings.size << 9) / PAGE_SIZE
960 <= queue_max_phys_segments(q)) { 960 <= queue_max_segments(q)) {
961 /* 961 /*
962 * We can handle this case at the expense of some extra memory 962 * We can handle this case at the expense of some extra memory
963 * copies during write operations 963 * copies during write operations
diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c
index 9cd1a4a542b8..bc95469d33c1 100644
--- a/drivers/block/ps3disk.c
+++ b/drivers/block/ps3disk.c
@@ -482,8 +482,7 @@ static int __devinit ps3disk_probe(struct ps3_system_bus_device *_dev)
482 blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH, 482 blk_queue_ordered(queue, QUEUE_ORDERED_DRAIN_FLUSH,
483 ps3disk_prepare_flush); 483 ps3disk_prepare_flush);
484 484
485 blk_queue_max_phys_segments(queue, -1); 485 blk_queue_max_segments(queue, -1);
486 blk_queue_max_hw_segments(queue, -1);
487 blk_queue_max_segment_size(queue, dev->bounce_size); 486 blk_queue_max_segment_size(queue, dev->bounce_size);
488 487
489 gendisk = alloc_disk(PS3DISK_MINORS); 488 gendisk = alloc_disk(PS3DISK_MINORS);
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index 6416b262934b..83ebb390b164 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -751,8 +751,7 @@ static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
751 priv->queue = queue; 751 priv->queue = queue;
752 queue->queuedata = dev; 752 queue->queuedata = dev;
753 blk_queue_make_request(queue, ps3vram_make_request); 753 blk_queue_make_request(queue, ps3vram_make_request);
754 blk_queue_max_phys_segments(queue, MAX_PHYS_SEGMENTS); 754 blk_queue_max_segments(queue, BLK_MAX_HW_SEGMENTS);
755 blk_queue_max_hw_segments(queue, MAX_HW_SEGMENTS);
756 blk_queue_max_segment_size(queue, BLK_MAX_SEGMENT_SIZE); 755 blk_queue_max_segment_size(queue, BLK_MAX_SEGMENT_SIZE);
757 blk_queue_max_hw_sectors(queue, BLK_SAFE_MAX_SECTORS); 756 blk_queue_max_hw_sectors(queue, BLK_SAFE_MAX_SECTORS);
758 757
diff --git a/drivers/block/sunvdc.c b/drivers/block/sunvdc.c
index dd30cddd0f7f..48e8fee9f2d4 100644
--- a/drivers/block/sunvdc.c
+++ b/drivers/block/sunvdc.c
@@ -691,8 +691,7 @@ static int probe_disk(struct vdc_port *port)
691 691
692 port->disk = g; 692 port->disk = g;
693 693
694 blk_queue_max_hw_segments(q, port->ring_cookies); 694 blk_queue_max_segments(q, port->ring_cookies);
695 blk_queue_max_phys_segments(q, port->ring_cookies);
696 blk_queue_max_hw_sectors(q, port->max_xfer_size); 695 blk_queue_max_hw_sectors(q, port->max_xfer_size);
697 g->major = vdc_major; 696 g->major = vdc_major;
698 g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT; 697 g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT;
diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
index 7bd7b2f83116..b70f0fca9a42 100644
--- a/drivers/block/sx8.c
+++ b/drivers/block/sx8.c
@@ -1518,8 +1518,7 @@ static int carm_init_disks(struct carm_host *host)
1518 break; 1518 break;
1519 } 1519 }
1520 disk->queue = q; 1520 disk->queue = q;
1521 blk_queue_max_hw_segments(q, CARM_MAX_REQ_SG); 1521 blk_queue_max_segments(q, CARM_MAX_REQ_SG);
1522 blk_queue_max_phys_segments(q, CARM_MAX_REQ_SG);
1523 blk_queue_segment_boundary(q, CARM_SG_BOUNDARY); 1522 blk_queue_segment_boundary(q, CARM_SG_BOUNDARY);
1524 1523
1525 q->queuedata = port; 1524 q->queuedata = port;
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index 352ea24d66e8..2e889838e819 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -2320,8 +2320,7 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
2320 disk->queue = q; 2320 disk->queue = q;
2321 2321
2322 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH); 2322 blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH);
2323 blk_queue_max_hw_segments(q, UB_MAX_REQ_SG); 2323 blk_queue_max_segments(q, UB_MAX_REQ_SG);
2324 blk_queue_max_phys_segments(q, UB_MAX_REQ_SG);
2325 blk_queue_segment_boundary(q, 0xffffffff); /* Dubious. */ 2324 blk_queue_segment_boundary(q, 0xffffffff); /* Dubious. */
2326 blk_queue_max_hw_sectors(q, UB_MAX_SECTORS); 2325 blk_queue_max_hw_sectors(q, UB_MAX_SECTORS);
2327 blk_queue_logical_block_size(q, lun->capacity.bsize); 2326 blk_queue_logical_block_size(q, lun->capacity.bsize);
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index d44ece7d7b7c..c12b31362ac6 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -471,8 +471,7 @@ retry:
471 } 471 }
472 472
473 d->disk = g; 473 d->disk = g;
474 blk_queue_max_hw_segments(q, VIOMAXBLOCKDMA); 474 blk_queue_max_segments(q, VIOMAXBLOCKDMA);
475 blk_queue_max_phys_segments(q, VIOMAXBLOCKDMA);
476 blk_queue_max_hw_sectors(q, VIODASD_MAXSECTORS); 475 blk_queue_max_hw_sectors(q, VIODASD_MAXSECTORS);
477 g->major = VIODASD_MAJOR; 476 g->major = VIODASD_MAJOR;
478 g->first_minor = dev_no << PARTITION_SHIFT; 477 g->first_minor = dev_no << PARTITION_SHIFT;
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index f9861aaa1fef..9c09694b2520 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -353,8 +353,7 @@ static int xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size)
353 blk_queue_max_segment_size(rq, PAGE_SIZE); 353 blk_queue_max_segment_size(rq, PAGE_SIZE);
354 354
355 /* Ensure a merged request will fit in a single I/O ring slot. */ 355 /* Ensure a merged request will fit in a single I/O ring slot. */
356 blk_queue_max_phys_segments(rq, BLKIF_MAX_SEGMENTS_PER_REQUEST); 356 blk_queue_max_segments(rq, BLKIF_MAX_SEGMENTS_PER_REQUEST);
357 blk_queue_max_hw_segments(rq, BLKIF_MAX_SEGMENTS_PER_REQUEST);
358 357
359 /* Make sure buffer addresses are sector-aligned. */ 358 /* Make sure buffer addresses are sector-aligned. */
360 blk_queue_dma_alignment(rq, 511); 359 blk_queue_dma_alignment(rq, 511);
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index e789e6c9a422..03c71f7698cb 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -741,7 +741,7 @@ static int __devinit probe_gdrom_setupqueue(void)
741{ 741{
742 blk_queue_logical_block_size(gd.gdrom_rq, GDROM_HARD_SECTOR); 742 blk_queue_logical_block_size(gd.gdrom_rq, GDROM_HARD_SECTOR);
743 /* using DMA so memory will need to be contiguous */ 743 /* using DMA so memory will need to be contiguous */
744 blk_queue_max_hw_segments(gd.gdrom_rq, 1); 744 blk_queue_max_segments(gd.gdrom_rq, 1);
745 /* set a large max size to get most from DMA */ 745 /* set a large max size to get most from DMA */
746 blk_queue_max_segment_size(gd.gdrom_rq, 0x40000); 746 blk_queue_max_segment_size(gd.gdrom_rq, 0x40000);
747 gd.disk->queue = gd.gdrom_rq; 747 gd.disk->queue = gd.gdrom_rq;
diff --git a/drivers/cdrom/viocd.c b/drivers/cdrom/viocd.c
index b1dfd23eb832..cc435be0bc13 100644
--- a/drivers/cdrom/viocd.c
+++ b/drivers/cdrom/viocd.c
@@ -616,8 +616,7 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
616 gendisk->first_minor = deviceno; 616 gendisk->first_minor = deviceno;
617 strncpy(gendisk->disk_name, c->name, 617 strncpy(gendisk->disk_name, c->name,
618 sizeof(gendisk->disk_name)); 618 sizeof(gendisk->disk_name));
619 blk_queue_max_hw_segments(q, 1); 619 blk_queue_max_segments(q, 1);
620 blk_queue_max_phys_segments(q, 1);
621 blk_queue_max_hw_sectors(q, 4096 / 512); 620 blk_queue_max_hw_sectors(q, 4096 / 512);
622 gendisk->queue = q; 621 gendisk->queue = q;
623 gendisk->fops = &viocd_fops; 622 gendisk->fops = &viocd_fops;
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 1ec8b31277bd..f8c1ae6ad74c 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -790,8 +790,7 @@ static int ide_init_queue(ide_drive_t *drive)
790 max_sg_entries >>= 1; 790 max_sg_entries >>= 1;
791#endif /* CONFIG_PCI */ 791#endif /* CONFIG_PCI */
792 792
793 blk_queue_max_hw_segments(q, max_sg_entries); 793 blk_queue_max_segments(q, max_sg_entries);
794 blk_queue_max_phys_segments(q, max_sg_entries);
795 794
796 /* assign drive queue */ 795 /* assign drive queue */
797 drive->queue = q; 796 drive->queue = q;
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index ceb24afdc147..509c8f3dd9a5 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3739,7 +3739,7 @@ static int bio_fits_rdev(struct bio *bi)
3739 if ((bi->bi_size>>9) > queue_max_sectors(q)) 3739 if ((bi->bi_size>>9) > queue_max_sectors(q))
3740 return 0; 3740 return 0;
3741 blk_recount_segments(q, bi); 3741 blk_recount_segments(q, bi);
3742 if (bi->bi_phys_segments > queue_max_phys_segments(q)) 3742 if (bi->bi_phys_segments > queue_max_segments(q))
3743 return 0; 3743 return 0;
3744 3744
3745 if (q->merge_bvec_fn) 3745 if (q->merge_bvec_fn)
diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c
index 44d4178c4c15..972b87069d55 100644
--- a/drivers/memstick/core/mspro_block.c
+++ b/drivers/memstick/core/mspro_block.c
@@ -1227,8 +1227,7 @@ static int mspro_block_init_disk(struct memstick_dev *card)
1227 1227
1228 blk_queue_bounce_limit(msb->queue, limit); 1228 blk_queue_bounce_limit(msb->queue, limit);
1229 blk_queue_max_hw_sectors(msb->queue, MSPRO_BLOCK_MAX_PAGES); 1229 blk_queue_max_hw_sectors(msb->queue, MSPRO_BLOCK_MAX_PAGES);
1230 blk_queue_max_phys_segments(msb->queue, MSPRO_BLOCK_MAX_SEGS); 1230 blk_queue_max_segments(msb->queue, MSPRO_BLOCK_MAX_SEGS);
1231 blk_queue_max_hw_segments(msb->queue, MSPRO_BLOCK_MAX_SEGS);
1232 blk_queue_max_segment_size(msb->queue, 1231 blk_queue_max_segment_size(msb->queue,
1233 MSPRO_BLOCK_MAX_PAGES * msb->page_size); 1232 MSPRO_BLOCK_MAX_PAGES * msb->page_size);
1234 1233
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c
index d033cfdb516f..2658b1484a2c 100644
--- a/drivers/message/i2o/i2o_block.c
+++ b/drivers/message/i2o/i2o_block.c
@@ -1065,9 +1065,8 @@ static int i2o_block_probe(struct device *dev)
1065 queue = gd->queue; 1065 queue = gd->queue;
1066 queue->queuedata = i2o_blk_dev; 1066 queue->queuedata = i2o_blk_dev;
1067 1067
1068 blk_queue_max_phys_segments(queue, I2O_MAX_PHYS_SEGMENTS);
1069 blk_queue_max_hw_sectors(queue, max_sectors); 1068 blk_queue_max_hw_sectors(queue, max_sectors);
1070 blk_queue_max_hw_segments(queue, i2o_sg_tablesize(c, body_size)); 1069 blk_queue_max_segments(queue, i2o_sg_tablesize(c, body_size));
1071 1070
1072 osm_debug("max sectors = %d\n", queue->max_sectors); 1071 osm_debug("max sectors = %d\n", queue->max_sectors);
1073 osm_debug("phys segments = %d\n", queue->max_phys_segments); 1072 osm_debug("phys segments = %d\n", queue->max_phys_segments);
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
index 09b633d5657b..381fe032caa1 100644
--- a/drivers/mmc/card/queue.c
+++ b/drivers/mmc/card/queue.c
@@ -155,8 +155,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
155 if (mq->bounce_buf) { 155 if (mq->bounce_buf) {
156 blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_ANY); 156 blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_ANY);
157 blk_queue_max_hw_sectors(mq->queue, bouncesz / 512); 157 blk_queue_max_hw_sectors(mq->queue, bouncesz / 512);
158 blk_queue_max_phys_segments(mq->queue, bouncesz / 512); 158 blk_queue_max_segments(mq->queue, bouncesz / 512);
159 blk_queue_max_hw_segments(mq->queue, bouncesz / 512);
160 blk_queue_max_segment_size(mq->queue, bouncesz); 159 blk_queue_max_segment_size(mq->queue, bouncesz);
161 160
162 mq->sg = kmalloc(sizeof(struct scatterlist), 161 mq->sg = kmalloc(sizeof(struct scatterlist),
@@ -182,8 +181,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
182 blk_queue_bounce_limit(mq->queue, limit); 181 blk_queue_bounce_limit(mq->queue, limit);
183 blk_queue_max_hw_sectors(mq->queue, 182 blk_queue_max_hw_sectors(mq->queue,
184 min(host->max_blk_count, host->max_req_size / 512)); 183 min(host->max_blk_count, host->max_req_size / 512));
185 blk_queue_max_phys_segments(mq->queue, host->max_phys_segs); 184 blk_queue_max_segments(mq->queue, host->max_hw_segs);
186 blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
187 blk_queue_max_segment_size(mq->queue, host->max_seg_size); 185 blk_queue_max_segment_size(mq->queue, host->max_seg_size);
188 186
189 mq->sg = kmalloc(sizeof(struct scatterlist) * 187 mq->sg = kmalloc(sizeof(struct scatterlist) *
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 14b1e25b9dcf..8831e9308d05 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -2130,8 +2130,7 @@ static void dasd_setup_queue(struct dasd_block *block)
2130 blk_queue_logical_block_size(block->request_queue, block->bp_block); 2130 blk_queue_logical_block_size(block->request_queue, block->bp_block);
2131 max = block->base->discipline->max_blocks << block->s2b_shift; 2131 max = block->base->discipline->max_blocks << block->s2b_shift;
2132 blk_queue_max_hw_sectors(block->request_queue, max); 2132 blk_queue_max_hw_sectors(block->request_queue, max);
2133 blk_queue_max_phys_segments(block->request_queue, -1L); 2133 blk_queue_max_segments(block->request_queue, -1L);
2134 blk_queue_max_hw_segments(block->request_queue, -1L);
2135 /* with page sized segments we can translate each segement into 2134 /* with page sized segments we can translate each segement into
2136 * one idaw/tidaw 2135 * one idaw/tidaw
2137 */ 2136 */
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c
index 509ed056fddd..097da8ce6be6 100644
--- a/drivers/s390/char/tape_block.c
+++ b/drivers/s390/char/tape_block.c
@@ -223,8 +223,7 @@ tapeblock_setup_device(struct tape_device * device)
223 223
224 blk_queue_logical_block_size(blkdat->request_queue, TAPEBLOCK_HSEC_SIZE); 224 blk_queue_logical_block_size(blkdat->request_queue, TAPEBLOCK_HSEC_SIZE);
225 blk_queue_max_hw_sectors(blkdat->request_queue, TAPEBLOCK_MAX_SEC); 225 blk_queue_max_hw_sectors(blkdat->request_queue, TAPEBLOCK_MAX_SEC);
226 blk_queue_max_phys_segments(blkdat->request_queue, -1L); 226 blk_queue_max_segments(blkdat->request_queue, -1L);
227 blk_queue_max_hw_segments(blkdat->request_queue, -1L);
228 blk_queue_max_segment_size(blkdat->request_queue, -1L); 227 blk_queue_max_segment_size(blkdat->request_queue, -1L);
229 blk_queue_segment_boundary(blkdat->request_queue, -1L); 228 blk_queue_segment_boundary(blkdat->request_queue, -1L);
230 229
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 87b536a97cb4..732f6d35b4a8 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -4195,7 +4195,7 @@ static void ibmvfc_tgt_add_rport(struct ibmvfc_target *tgt)
4195 if (tgt->service_parms.class3_parms[0] & 0x80000000) 4195 if (tgt->service_parms.class3_parms[0] & 0x80000000)
4196 rport->supported_classes |= FC_COS_CLASS3; 4196 rport->supported_classes |= FC_COS_CLASS3;
4197 if (rport->rqst_q) 4197 if (rport->rqst_q)
4198 blk_queue_max_hw_segments(rport->rqst_q, 1); 4198 blk_queue_max_segments(rport->rqst_q, 1);
4199 } else 4199 } else
4200 tgt_dbg(tgt, "rport add failed\n"); 4200 tgt_dbg(tgt, "rport add failed\n");
4201 spin_unlock_irqrestore(vhost->host->host_lock, flags); 4201 spin_unlock_irqrestore(vhost->host->host_lock, flags);
@@ -4669,7 +4669,7 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
4669 } 4669 }
4670 4670
4671 if (shost_to_fc_host(shost)->rqst_q) 4671 if (shost_to_fc_host(shost)->rqst_q)
4672 blk_queue_max_hw_segments(shost_to_fc_host(shost)->rqst_q, 1); 4672 blk_queue_max_segments(shost_to_fc_host(shost)->rqst_q, 1);
4673 dev_set_drvdata(dev, vhost); 4673 dev_set_drvdata(dev, vhost);
4674 spin_lock(&ibmvfc_driver_lock); 4674 spin_lock(&ibmvfc_driver_lock);
4675 list_add_tail(&vhost->queue, &ibmvfc_head); 4675 list_add_tail(&vhost->queue, &ibmvfc_head);
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index ac3cca74bdfb..f8fbf47377ae 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1624,8 +1624,8 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,
1624 /* 1624 /*
1625 * this limit is imposed by hardware restrictions 1625 * this limit is imposed by hardware restrictions
1626 */ 1626 */
1627 blk_queue_max_hw_segments(q, shost->sg_tablesize); 1627 blk_queue_max_segments(q, min_t(unsigned short, shost->sg_tablesize,
1628 blk_queue_max_phys_segments(q, SCSI_MAX_SG_CHAIN_SEGMENTS); 1628 SCSI_MAX_SG_CHAIN_SEGMENTS));
1629 1629
1630 blk_queue_max_hw_sectors(q, shost->max_sectors); 1630 blk_queue_max_hw_sectors(q, shost->max_sectors);
1631 blk_queue_bounce_limit(q, scsi_calculate_bounce_limit(shost)); 1631 blk_queue_bounce_limit(q, scsi_calculate_bounce_limit(shost));
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 040f751809ea..c996d98636f3 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -287,8 +287,7 @@ sg_open(struct inode *inode, struct file *filp)
287 if (list_empty(&sdp->sfds)) { /* no existing opens on this device */ 287 if (list_empty(&sdp->sfds)) { /* no existing opens on this device */
288 sdp->sgdebug = 0; 288 sdp->sgdebug = 0;
289 q = sdp->device->request_queue; 289 q = sdp->device->request_queue;
290 sdp->sg_tablesize = min(queue_max_hw_segments(q), 290 sdp->sg_tablesize = queue_max_segments(q);
291 queue_max_phys_segments(q));
292 } 291 }
293 if ((sfp = sg_add_sfp(sdp, dev))) 292 if ((sfp = sg_add_sfp(sdp, dev)))
294 filp->private_data = sfp; 293 filp->private_data = sfp;
@@ -1376,8 +1375,7 @@ static Sg_device *sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
1376 sdp->device = scsidp; 1375 sdp->device = scsidp;
1377 INIT_LIST_HEAD(&sdp->sfds); 1376 INIT_LIST_HEAD(&sdp->sfds);
1378 init_waitqueue_head(&sdp->o_excl_wait); 1377 init_waitqueue_head(&sdp->o_excl_wait);
1379 sdp->sg_tablesize = min(queue_max_hw_segments(q), 1378 sdp->sg_tablesize = queue_max_segments(q);
1380 queue_max_phys_segments(q));
1381 sdp->index = k; 1379 sdp->index = k;
1382 kref_init(&sdp->d_ref); 1380 kref_init(&sdp->d_ref);
1383 1381
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index d04ea9a6f673..f67d1a159aad 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -3983,8 +3983,7 @@ static int st_probe(struct device *dev)
3983 return -ENODEV; 3983 return -ENODEV;
3984 } 3984 }
3985 3985
3986 i = min(queue_max_hw_segments(SDp->request_queue), 3986 i = queue_max_segments(SDp->request_queue);
3987 queue_max_phys_segments(SDp->request_queue));
3988 if (st_max_sg_segs < i) 3987 if (st_max_sg_segs < i)
3989 i = st_max_sg_segs; 3988 i = st_max_sg_segs;
3990 buffer = new_tape_buffer((SDp->host)->unchecked_isa_dma, i); 3989 buffer = new_tape_buffer((SDp->host)->unchecked_isa_dma, i);
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 62b282844a53..45d908114d11 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -363,10 +363,7 @@ static int blkvsc_probe(struct device *device)
363 blkdev->gd->queue = blk_init_queue(blkvsc_request, &blkdev->lock); 363 blkdev->gd->queue = blk_init_queue(blkvsc_request, &blkdev->lock);
364 364
365 blk_queue_max_segment_size(blkdev->gd->queue, PAGE_SIZE); 365 blk_queue_max_segment_size(blkdev->gd->queue, PAGE_SIZE);
366 blk_queue_max_phys_segments(blkdev->gd->queue, 366 blk_queue_max_segments(blkdev->gd->queue, MAX_MULTIPAGE_BUFFER_COUNT);
367 MAX_MULTIPAGE_BUFFER_COUNT);
368 blk_queue_max_hw_segments(blkdev->gd->queue,
369 MAX_MULTIPAGE_BUFFER_COUNT);
370 blk_queue_segment_boundary(blkdev->gd->queue, PAGE_SIZE-1); 367 blk_queue_segment_boundary(blkdev->gd->queue, PAGE_SIZE-1);
371 blk_queue_bounce_limit(blkdev->gd->queue, BLK_BOUNCE_ANY); 368 blk_queue_bounce_limit(blkdev->gd->queue, BLK_BOUNCE_ANY);
372 blk_queue_dma_alignment(blkdev->gd->queue, 511); 369 blk_queue_dma_alignment(blkdev->gd->queue, 511);