diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 16:39:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 16:39:11 -0500 |
commit | 9228ff90387e276ad67b10c0eb525c9d6a57d5e9 (patch) | |
tree | e7c87b68daba7cf7ca4c342c6b52165bd78fbe16 /drivers/block/cciss.c | |
parent | 9360b53661a2c7754517b2925580055bacc8ec38 (diff) | |
parent | d2ec180c23a5a1bfe34d8638b0342a47c00cf70f (diff) |
Merge branch 'for-3.8/drivers' of git://git.kernel.dk/linux-block
Pull block driver update from Jens Axboe:
"Now that the core bits are in, here are the driver bits for 3.8. The
branch contains:
- A huge pile of drbd bits that were dumped from the 3.7 merge
window. Following that, it was both made perfectly clear that
there is going to be no more over-the-wall pulls and how the
situation on individual pulls can be improved.
- A few cleanups from Akinobu Mita for drbd and cciss.
- Queue improvement for loop from Lukas. This grew into adding a
generic interface for waiting/checking an even with a specific
lock, allowing this to be pulled out of md and now loop and drbd is
also using it.
- A few fixes for xen back/front block driver from Roger Pau Monne.
- Partition improvements from Stephen Warren, allowing partiion UUID
to be used as an identifier."
* 'for-3.8/drivers' of git://git.kernel.dk/linux-block: (609 commits)
drbd: update Kconfig to match current dependencies
drbd: Fix drbdsetup wait-connect, wait-sync etc... commands
drbd: close race between drbd_set_role and drbd_connect
drbd: respect no-md-barriers setting also when changed online via disk-options
drbd: Remove obsolete check
drbd: fixup after wait_even_lock_irq() addition to generic code
loop: Limit the number of requests in the bio list
wait: add wait_event_lock_irq() interface
xen-blkfront: free allocated page
xen-blkback: move free persistent grants code
block: partition: msdos: provide UUIDs for partitions
init: reduce PARTUUID min length to 1 from 36
block: store partition_meta_info.uuid as a string
cciss: use check_signature()
cciss: cleanup bitops usage
drbd: use copy_highpage
drbd: if the replication link breaks during handshake, keep retrying
drbd: check return of kmalloc in receive_uuids
drbd: Broadcast sync progress no more often than once per second
drbd: don't try to clear bits once the disk has failed
...
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index ca83f96756ad..6526157edafc 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -41,8 +41,9 @@ | |||
41 | #include <linux/spinlock.h> | 41 | #include <linux/spinlock.h> |
42 | #include <linux/compat.h> | 42 | #include <linux/compat.h> |
43 | #include <linux/mutex.h> | 43 | #include <linux/mutex.h> |
44 | #include <linux/bitmap.h> | ||
45 | #include <linux/io.h> | ||
44 | #include <asm/uaccess.h> | 46 | #include <asm/uaccess.h> |
45 | #include <asm/io.h> | ||
46 | 47 | ||
47 | #include <linux/dma-mapping.h> | 48 | #include <linux/dma-mapping.h> |
48 | #include <linux/blkdev.h> | 49 | #include <linux/blkdev.h> |
@@ -978,8 +979,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h) | |||
978 | i = find_first_zero_bit(h->cmd_pool_bits, h->nr_cmds); | 979 | i = find_first_zero_bit(h->cmd_pool_bits, h->nr_cmds); |
979 | if (i == h->nr_cmds) | 980 | if (i == h->nr_cmds) |
980 | return NULL; | 981 | return NULL; |
981 | } while (test_and_set_bit(i & (BITS_PER_LONG - 1), | 982 | } while (test_and_set_bit(i, h->cmd_pool_bits) != 0); |
982 | h->cmd_pool_bits + (i / BITS_PER_LONG)) != 0); | ||
983 | c = h->cmd_pool + i; | 983 | c = h->cmd_pool + i; |
984 | memset(c, 0, sizeof(CommandList_struct)); | 984 | memset(c, 0, sizeof(CommandList_struct)); |
985 | cmd_dma_handle = h->cmd_pool_dhandle + i * sizeof(CommandList_struct); | 985 | cmd_dma_handle = h->cmd_pool_dhandle + i * sizeof(CommandList_struct); |
@@ -1046,8 +1046,7 @@ static void cmd_free(ctlr_info_t *h, CommandList_struct *c) | |||
1046 | int i; | 1046 | int i; |
1047 | 1047 | ||
1048 | i = c - h->cmd_pool; | 1048 | i = c - h->cmd_pool; |
1049 | clear_bit(i & (BITS_PER_LONG - 1), | 1049 | clear_bit(i, h->cmd_pool_bits); |
1050 | h->cmd_pool_bits + (i / BITS_PER_LONG)); | ||
1051 | h->nr_frees++; | 1050 | h->nr_frees++; |
1052 | } | 1051 | } |
1053 | 1052 | ||
@@ -4268,10 +4267,7 @@ static void __devinit cciss_find_board_params(ctlr_info_t *h) | |||
4268 | 4267 | ||
4269 | static inline bool CISS_signature_present(ctlr_info_t *h) | 4268 | static inline bool CISS_signature_present(ctlr_info_t *h) |
4270 | { | 4269 | { |
4271 | if ((readb(&h->cfgtable->Signature[0]) != 'C') || | 4270 | if (!check_signature(h->cfgtable->Signature, "CISS", 4)) { |
4272 | (readb(&h->cfgtable->Signature[1]) != 'I') || | ||
4273 | (readb(&h->cfgtable->Signature[2]) != 'S') || | ||
4274 | (readb(&h->cfgtable->Signature[3]) != 'S')) { | ||
4275 | dev_warn(&h->pdev->dev, "not a valid CISS config table\n"); | 4271 | dev_warn(&h->pdev->dev, "not a valid CISS config table\n"); |
4276 | return false; | 4272 | return false; |
4277 | } | 4273 | } |
@@ -4812,8 +4808,7 @@ static __devinit int cciss_init_reset_devices(struct pci_dev *pdev) | |||
4812 | 4808 | ||
4813 | static __devinit int cciss_allocate_cmd_pool(ctlr_info_t *h) | 4809 | static __devinit int cciss_allocate_cmd_pool(ctlr_info_t *h) |
4814 | { | 4810 | { |
4815 | h->cmd_pool_bits = kmalloc( | 4811 | h->cmd_pool_bits = kmalloc(BITS_TO_LONGS(h->nr_cmds) * |
4816 | DIV_ROUND_UP(h->nr_cmds, BITS_PER_LONG) * | ||
4817 | sizeof(unsigned long), GFP_KERNEL); | 4812 | sizeof(unsigned long), GFP_KERNEL); |
4818 | h->cmd_pool = pci_alloc_consistent(h->pdev, | 4813 | h->cmd_pool = pci_alloc_consistent(h->pdev, |
4819 | h->nr_cmds * sizeof(CommandList_struct), | 4814 | h->nr_cmds * sizeof(CommandList_struct), |
@@ -5068,9 +5063,7 @@ reinit_after_soft_reset: | |||
5068 | pci_set_drvdata(pdev, h); | 5063 | pci_set_drvdata(pdev, h); |
5069 | /* command and error info recs zeroed out before | 5064 | /* command and error info recs zeroed out before |
5070 | they are used */ | 5065 | they are used */ |
5071 | memset(h->cmd_pool_bits, 0, | 5066 | bitmap_zero(h->cmd_pool_bits, h->nr_cmds); |
5072 | DIV_ROUND_UP(h->nr_cmds, BITS_PER_LONG) | ||
5073 | * sizeof(unsigned long)); | ||
5074 | 5067 | ||
5075 | h->num_luns = 0; | 5068 | h->num_luns = 0; |
5076 | h->highest_lun = -1; | 5069 | h->highest_lun = -1; |