diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-13 13:21:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-13 13:21:33 -0400 |
commit | 80f506918fdaaca6b574ba931536a58ce015c7be (patch) | |
tree | 938bddf32e8c5dca114cb1a5f3ca2a62960accc8 /drivers | |
parent | a3bafbbbb5ac49355aa35e6a722eac6ef1dff19a (diff) | |
parent | 2ec24ff1d1875defa742c76c9c7d74dca06b7e1f (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
cciss: Add cciss_allow_hpsa module parameter
cciss: Fix multiple calls to pci_release_regions
blk-settings: fix function parameter kernel-doc notation
writeback: kill space in debugfs item name
writeback: account IO throttling wait as iowait
elv_iosched_store(): fix strstrip() misuse
cfq-iosched: avoid probable slice overrun when idling
cfq-iosched: apply bool value where we return 0/1
cfq-iosched: fix think time allowed for seekers
cfq-iosched: fix the slice residual sign
cfq-iosched: abstract out the 'may this cfqq dispatch' logic
block: use proper BLK_RW_ASYNC in blk_queue_start_tag()
block: Seperate read and write statistics of in_flight requests v2
block: get rid of kblock_schedule_delayed_work()
cfq-iosched: fix possible problem with jiffies wraparound
cfq-iosched: fix issue with rq-rq merging and fifo list ordering
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/cciss.c | 79 | ||||
-rw-r--r-- | drivers/md/dm.c | 16 |
2 files changed, 47 insertions, 48 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index fb5be2d95d52..6399e5090df4 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -68,6 +68,12 @@ MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400" | |||
68 | MODULE_VERSION("3.6.20"); | 68 | MODULE_VERSION("3.6.20"); |
69 | MODULE_LICENSE("GPL"); | 69 | MODULE_LICENSE("GPL"); |
70 | 70 | ||
71 | static int cciss_allow_hpsa; | ||
72 | module_param(cciss_allow_hpsa, int, S_IRUGO|S_IWUSR); | ||
73 | MODULE_PARM_DESC(cciss_allow_hpsa, | ||
74 | "Prevent cciss driver from accessing hardware known to be " | ||
75 | " supported by the hpsa driver"); | ||
76 | |||
71 | #include "cciss_cmd.h" | 77 | #include "cciss_cmd.h" |
72 | #include "cciss.h" | 78 | #include "cciss.h" |
73 | #include <linux/cciss_ioctl.h> | 79 | #include <linux/cciss_ioctl.h> |
@@ -101,8 +107,6 @@ static const struct pci_device_id cciss_pci_device_id[] = { | |||
101 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3249}, | 107 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3249}, |
102 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x324A}, | 108 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x324A}, |
103 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x324B}, | 109 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x324B}, |
104 | {PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | ||
105 | PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0}, | ||
106 | {0,} | 110 | {0,} |
107 | }; | 111 | }; |
108 | 112 | ||
@@ -123,8 +127,6 @@ static struct board_type products[] = { | |||
123 | {0x409D0E11, "Smart Array 6400 EM", &SA5_access}, | 127 | {0x409D0E11, "Smart Array 6400 EM", &SA5_access}, |
124 | {0x40910E11, "Smart Array 6i", &SA5_access}, | 128 | {0x40910E11, "Smart Array 6i", &SA5_access}, |
125 | {0x3225103C, "Smart Array P600", &SA5_access}, | 129 | {0x3225103C, "Smart Array P600", &SA5_access}, |
126 | {0x3223103C, "Smart Array P800", &SA5_access}, | ||
127 | {0x3234103C, "Smart Array P400", &SA5_access}, | ||
128 | {0x3235103C, "Smart Array P400i", &SA5_access}, | 130 | {0x3235103C, "Smart Array P400i", &SA5_access}, |
129 | {0x3211103C, "Smart Array E200i", &SA5_access}, | 131 | {0x3211103C, "Smart Array E200i", &SA5_access}, |
130 | {0x3212103C, "Smart Array E200", &SA5_access}, | 132 | {0x3212103C, "Smart Array E200", &SA5_access}, |
@@ -132,6 +134,10 @@ static struct board_type products[] = { | |||
132 | {0x3214103C, "Smart Array E200i", &SA5_access}, | 134 | {0x3214103C, "Smart Array E200i", &SA5_access}, |
133 | {0x3215103C, "Smart Array E200i", &SA5_access}, | 135 | {0x3215103C, "Smart Array E200i", &SA5_access}, |
134 | {0x3237103C, "Smart Array E500", &SA5_access}, | 136 | {0x3237103C, "Smart Array E500", &SA5_access}, |
137 | /* controllers below this line are also supported by the hpsa driver. */ | ||
138 | #define HPSA_BOUNDARY 0x3223103C | ||
139 | {0x3223103C, "Smart Array P800", &SA5_access}, | ||
140 | {0x3234103C, "Smart Array P400", &SA5_access}, | ||
135 | {0x323D103C, "Smart Array P700m", &SA5_access}, | 141 | {0x323D103C, "Smart Array P700m", &SA5_access}, |
136 | {0x3241103C, "Smart Array P212", &SA5_access}, | 142 | {0x3241103C, "Smart Array P212", &SA5_access}, |
137 | {0x3243103C, "Smart Array P410", &SA5_access}, | 143 | {0x3243103C, "Smart Array P410", &SA5_access}, |
@@ -140,7 +146,6 @@ static struct board_type products[] = { | |||
140 | {0x3249103C, "Smart Array P812", &SA5_access}, | 146 | {0x3249103C, "Smart Array P812", &SA5_access}, |
141 | {0x324A103C, "Smart Array P712m", &SA5_access}, | 147 | {0x324A103C, "Smart Array P712m", &SA5_access}, |
142 | {0x324B103C, "Smart Array P711m", &SA5_access}, | 148 | {0x324B103C, "Smart Array P711m", &SA5_access}, |
143 | {0xFFFF103C, "Unknown Smart Array", &SA5_access}, | ||
144 | }; | 149 | }; |
145 | 150 | ||
146 | /* How long to wait (in milliseconds) for board to go into simple mode */ | 151 | /* How long to wait (in milliseconds) for board to go into simple mode */ |
@@ -3754,7 +3759,27 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3754 | __u64 cfg_offset; | 3759 | __u64 cfg_offset; |
3755 | __u32 cfg_base_addr; | 3760 | __u32 cfg_base_addr; |
3756 | __u64 cfg_base_addr_index; | 3761 | __u64 cfg_base_addr_index; |
3757 | int i, err; | 3762 | int i, prod_index, err; |
3763 | |||
3764 | subsystem_vendor_id = pdev->subsystem_vendor; | ||
3765 | subsystem_device_id = pdev->subsystem_device; | ||
3766 | board_id = (((__u32) (subsystem_device_id << 16) & 0xffff0000) | | ||
3767 | subsystem_vendor_id); | ||
3768 | |||
3769 | for (i = 0; i < ARRAY_SIZE(products); i++) { | ||
3770 | /* Stand aside for hpsa driver on request */ | ||
3771 | if (cciss_allow_hpsa && products[i].board_id == HPSA_BOUNDARY) | ||
3772 | return -ENODEV; | ||
3773 | if (board_id == products[i].board_id) | ||
3774 | break; | ||
3775 | } | ||
3776 | prod_index = i; | ||
3777 | if (prod_index == ARRAY_SIZE(products)) { | ||
3778 | dev_warn(&pdev->dev, | ||
3779 | "unrecognized board ID: 0x%08lx, ignoring.\n", | ||
3780 | (unsigned long) board_id); | ||
3781 | return -ENODEV; | ||
3782 | } | ||
3758 | 3783 | ||
3759 | /* check to see if controller has been disabled */ | 3784 | /* check to see if controller has been disabled */ |
3760 | /* BEFORE trying to enable it */ | 3785 | /* BEFORE trying to enable it */ |
@@ -3778,11 +3803,6 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3778 | return err; | 3803 | return err; |
3779 | } | 3804 | } |
3780 | 3805 | ||
3781 | subsystem_vendor_id = pdev->subsystem_vendor; | ||
3782 | subsystem_device_id = pdev->subsystem_device; | ||
3783 | board_id = (((__u32) (subsystem_device_id << 16) & 0xffff0000) | | ||
3784 | subsystem_vendor_id); | ||
3785 | |||
3786 | #ifdef CCISS_DEBUG | 3806 | #ifdef CCISS_DEBUG |
3787 | printk("command = %x\n", command); | 3807 | printk("command = %x\n", command); |
3788 | printk("irq = %x\n", pdev->irq); | 3808 | printk("irq = %x\n", pdev->irq); |
@@ -3868,14 +3888,9 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3868 | * leave a little room for ioctl calls. | 3888 | * leave a little room for ioctl calls. |
3869 | */ | 3889 | */ |
3870 | c->max_commands = readl(&(c->cfgtable->CmdsOutMax)); | 3890 | c->max_commands = readl(&(c->cfgtable->CmdsOutMax)); |
3871 | for (i = 0; i < ARRAY_SIZE(products); i++) { | 3891 | c->product_name = products[prod_index].product_name; |
3872 | if (board_id == products[i].board_id) { | 3892 | c->access = *(products[prod_index].access); |
3873 | c->product_name = products[i].product_name; | 3893 | c->nr_cmds = c->max_commands - 4; |
3874 | c->access = *(products[i].access); | ||
3875 | c->nr_cmds = c->max_commands - 4; | ||
3876 | break; | ||
3877 | } | ||
3878 | } | ||
3879 | if ((readb(&c->cfgtable->Signature[0]) != 'C') || | 3894 | if ((readb(&c->cfgtable->Signature[0]) != 'C') || |
3880 | (readb(&c->cfgtable->Signature[1]) != 'I') || | 3895 | (readb(&c->cfgtable->Signature[1]) != 'I') || |
3881 | (readb(&c->cfgtable->Signature[2]) != 'S') || | 3896 | (readb(&c->cfgtable->Signature[2]) != 'S') || |
@@ -3884,27 +3899,6 @@ static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev) | |||
3884 | err = -ENODEV; | 3899 | err = -ENODEV; |
3885 | goto err_out_free_res; | 3900 | goto err_out_free_res; |
3886 | } | 3901 | } |
3887 | /* We didn't find the controller in our list. We know the | ||
3888 | * signature is valid. If it's an HP device let's try to | ||
3889 | * bind to the device and fire it up. Otherwise we bail. | ||
3890 | */ | ||
3891 | if (i == ARRAY_SIZE(products)) { | ||
3892 | if (subsystem_vendor_id == PCI_VENDOR_ID_HP) { | ||
3893 | c->product_name = products[i-1].product_name; | ||
3894 | c->access = *(products[i-1].access); | ||
3895 | c->nr_cmds = c->max_commands - 4; | ||
3896 | printk(KERN_WARNING "cciss: This is an unknown " | ||
3897 | "Smart Array controller.\n" | ||
3898 | "cciss: Please update to the latest driver " | ||
3899 | "available from www.hp.com.\n"); | ||
3900 | } else { | ||
3901 | printk(KERN_WARNING "cciss: Sorry, I don't know how" | ||
3902 | " to access the Smart Array controller %08lx\n" | ||
3903 | , (unsigned long)board_id); | ||
3904 | err = -ENODEV; | ||
3905 | goto err_out_free_res; | ||
3906 | } | ||
3907 | } | ||
3908 | #ifdef CONFIG_X86 | 3902 | #ifdef CONFIG_X86 |
3909 | { | 3903 | { |
3910 | /* Need to enable prefetch in the SCSI core for 6400 in x86 */ | 3904 | /* Need to enable prefetch in the SCSI core for 6400 in x86 */ |
@@ -4254,7 +4248,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
4254 | mutex_init(&hba[i]->busy_shutting_down); | 4248 | mutex_init(&hba[i]->busy_shutting_down); |
4255 | 4249 | ||
4256 | if (cciss_pci_init(hba[i], pdev) != 0) | 4250 | if (cciss_pci_init(hba[i], pdev) != 0) |
4257 | goto clean0; | 4251 | goto clean_no_release_regions; |
4258 | 4252 | ||
4259 | sprintf(hba[i]->devname, "cciss%d", i); | 4253 | sprintf(hba[i]->devname, "cciss%d", i); |
4260 | hba[i]->ctlr = i; | 4254 | hba[i]->ctlr = i; |
@@ -4391,13 +4385,14 @@ clean2: | |||
4391 | clean1: | 4385 | clean1: |
4392 | cciss_destroy_hba_sysfs_entry(hba[i]); | 4386 | cciss_destroy_hba_sysfs_entry(hba[i]); |
4393 | clean0: | 4387 | clean0: |
4388 | pci_release_regions(pdev); | ||
4389 | clean_no_release_regions: | ||
4394 | hba[i]->busy_initializing = 0; | 4390 | hba[i]->busy_initializing = 0; |
4395 | 4391 | ||
4396 | /* | 4392 | /* |
4397 | * Deliberately omit pci_disable_device(): it does something nasty to | 4393 | * Deliberately omit pci_disable_device(): it does something nasty to |
4398 | * Smart Array controllers that pci_enable_device does not undo | 4394 | * Smart Array controllers that pci_enable_device does not undo |
4399 | */ | 4395 | */ |
4400 | pci_release_regions(pdev); | ||
4401 | pci_set_drvdata(pdev, NULL); | 4396 | pci_set_drvdata(pdev, NULL); |
4402 | free_hba(i); | 4397 | free_hba(i); |
4403 | return -1; | 4398 | return -1; |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 23e76fe0d359..376f1ab48a24 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -130,7 +130,7 @@ struct mapped_device { | |||
130 | /* | 130 | /* |
131 | * A list of ios that arrived while we were suspended. | 131 | * A list of ios that arrived while we were suspended. |
132 | */ | 132 | */ |
133 | atomic_t pending; | 133 | atomic_t pending[2]; |
134 | wait_queue_head_t wait; | 134 | wait_queue_head_t wait; |
135 | struct work_struct work; | 135 | struct work_struct work; |
136 | struct bio_list deferred; | 136 | struct bio_list deferred; |
@@ -453,13 +453,14 @@ static void start_io_acct(struct dm_io *io) | |||
453 | { | 453 | { |
454 | struct mapped_device *md = io->md; | 454 | struct mapped_device *md = io->md; |
455 | int cpu; | 455 | int cpu; |
456 | int rw = bio_data_dir(io->bio); | ||
456 | 457 | ||
457 | io->start_time = jiffies; | 458 | io->start_time = jiffies; |
458 | 459 | ||
459 | cpu = part_stat_lock(); | 460 | cpu = part_stat_lock(); |
460 | part_round_stats(cpu, &dm_disk(md)->part0); | 461 | part_round_stats(cpu, &dm_disk(md)->part0); |
461 | part_stat_unlock(); | 462 | part_stat_unlock(); |
462 | dm_disk(md)->part0.in_flight = atomic_inc_return(&md->pending); | 463 | dm_disk(md)->part0.in_flight[rw] = atomic_inc_return(&md->pending[rw]); |
463 | } | 464 | } |
464 | 465 | ||
465 | static void end_io_acct(struct dm_io *io) | 466 | static void end_io_acct(struct dm_io *io) |
@@ -479,8 +480,9 @@ static void end_io_acct(struct dm_io *io) | |||
479 | * After this is decremented the bio must not be touched if it is | 480 | * After this is decremented the bio must not be touched if it is |
480 | * a barrier. | 481 | * a barrier. |
481 | */ | 482 | */ |
482 | dm_disk(md)->part0.in_flight = pending = | 483 | dm_disk(md)->part0.in_flight[rw] = pending = |
483 | atomic_dec_return(&md->pending); | 484 | atomic_dec_return(&md->pending[rw]); |
485 | pending += atomic_read(&md->pending[rw^0x1]); | ||
484 | 486 | ||
485 | /* nudge anyone waiting on suspend queue */ | 487 | /* nudge anyone waiting on suspend queue */ |
486 | if (!pending) | 488 | if (!pending) |
@@ -1785,7 +1787,8 @@ static struct mapped_device *alloc_dev(int minor) | |||
1785 | if (!md->disk) | 1787 | if (!md->disk) |
1786 | goto bad_disk; | 1788 | goto bad_disk; |
1787 | 1789 | ||
1788 | atomic_set(&md->pending, 0); | 1790 | atomic_set(&md->pending[0], 0); |
1791 | atomic_set(&md->pending[1], 0); | ||
1789 | init_waitqueue_head(&md->wait); | 1792 | init_waitqueue_head(&md->wait); |
1790 | INIT_WORK(&md->work, dm_wq_work); | 1793 | INIT_WORK(&md->work, dm_wq_work); |
1791 | init_waitqueue_head(&md->eventq); | 1794 | init_waitqueue_head(&md->eventq); |
@@ -2088,7 +2091,8 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible) | |||
2088 | break; | 2091 | break; |
2089 | } | 2092 | } |
2090 | spin_unlock_irqrestore(q->queue_lock, flags); | 2093 | spin_unlock_irqrestore(q->queue_lock, flags); |
2091 | } else if (!atomic_read(&md->pending)) | 2094 | } else if (!atomic_read(&md->pending[0]) && |
2095 | !atomic_read(&md->pending[1])) | ||
2092 | break; | 2096 | break; |
2093 | 2097 | ||
2094 | if (interruptible == TASK_INTERRUPTIBLE && | 2098 | if (interruptible == TASK_INTERRUPTIBLE && |