Skip to content

Commit 5eea9be

Browse files
committed
Merge branch 'for-3.13/drivers' of git://git.kernel.dk/linux-block
Pull block driver updates from Jens Axboe: "This is the block driver pull request for 3.13. As with the core pull request just sent out, this was rebased on top of the core branch again after the immutable series was pulled. This also means that bcache gets to sit the initial pull over. I will send a second driver pull request in the merge window to get those fixes in, once they have been rebased and tested on top of the non-immutable stack. This pull request contains: - Add support for the sTec Kronos pci-e flash card from sTec. Also has various cleanups for this driver, from myself, Bart, Mike Snizter, and Wei Yongjun. - Add surprise removal support for the micron mtip32xx driver from Micron. - Floppy documentation fix from Ben Harris. - debugfs bug fix for pktcdvd from Dan Carpenter. - Fix for the mtip32xx driver stack usage in the debugfs path, dynamically allocating those buffers instead. From David Milburn. - Disable cpqarray in Kconfig. The plan is to remove it on request of HP, but lets disable it for a few revisions just to see if anyone yells. - drbd fixes from Lars Ellenberg and Philipp Reisner. - Elevator switch fix for the s390 block driver from Heiko Carstens. - loop crash fix on IO to unassigned device from Mikulas Patocka. - A series of bug fixes for the IBM rsxx pci-e flash driver from Philip J Kelleher. - cciss probe fix from Stephen Cameron. - Xen block front/back fixes from Roger Pau Monne and Vegard Nossum" * 'for-3.13/drivers' of git://git.kernel.dk/linux-block: (41 commits) floppy: Correct documentation of driver options when used as a module. pktcdvd: debugfs functions return NULL on error xen-blkfront: restore the non-persistent data path skd: fix formatting in skd_s1120.h skd: reorder construct/destruct code skd: cleanup skd_do_inq_page_da() skd: remove SKD_OMIT_FROM_SRC_DIST ifdefs skd: remove redundant skdev->pdev assignment from skd_pci_probe() skd: use <asm/unaligned.h> skd: remove SCSI subsystem specific includes skd: register block device only if some devices are present skd: fix error messages in skd_init() skd: fix error paths in skd_init() skd: fix unregister_blkdev() placement skd: more removal of bio-based code skd: cleanup the skd_*() function block wrapping skd: rip out bio path skd: fix error return code in skd_pci_probe() s390/dasd: hold request queue sysfs lock when calling elevator_init() cciss: return 0 from driver probe function on success, not 1 ...
2 parents 0910c0b + f7cb20f commit 5eea9be

23 files changed

Lines changed: 6369 additions & 364 deletions

File tree

‎Documentation/blockdev/floppy.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ Module configuration options
3939
============================
4040

4141
If you use the floppy driver as a module, use the following syntax:
42-
modprobe floppy <options>
42+
modprobe floppy floppy="<options>"
4343

4444
Example:
45-
modprobe floppy omnibook messages
45+
modprobe floppy floppy="omnibook messages"
4646

4747
If you need certain options enabled every time you load the floppy driver,
4848
you can put:
4949

50-
options floppy omnibook messages
50+
options floppy floppy="omnibook messages"
5151

5252
in a configuration file in /etc/modprobe.d/.
5353

‎drivers/block/Kconfig‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ source "drivers/block/mtip32xx/Kconfig"
110110

111111
config BLK_CPQ_DA
112112
tristate "Compaq SMART2 support"
113-
depends on PCI && VIRT_TO_BUS
113+
depends on PCI && VIRT_TO_BUS && 0
114114
help
115115
This is the driver for Compaq Smart Array controllers. Everyone
116116
using these boards should say Y here. See the file
@@ -319,6 +319,16 @@ config BLK_DEV_NVME
319319
To compile this driver as a module, choose M here: the
320320
module will be called nvme.
321321

322+
config BLK_DEV_SKD
323+
tristate "STEC S1120 Block Driver"
324+
depends on PCI
325+
depends on 64BIT
326+
---help---
327+
Saying Y or M here will enable support for the
328+
STEC, Inc. S1120 PCIe SSD.
329+
330+
Use device /dev/skd$N amd /dev/skd$Np$M.
331+
322332
config BLK_DEV_OSD
323333
tristate "OSD object-as-blkdev support"
324334
depends on SCSI_OSD_ULD

‎drivers/block/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ obj-$(CONFIG_CDROM_PKTCDVD) += pktcdvd.o
2323
obj-$(CONFIG_MG_DISK) += mg_disk.o
2424
obj-$(CONFIG_SUNVDC) += sunvdc.o
2525
obj-$(CONFIG_BLK_DEV_NVME) += nvme.o
26+
obj-$(CONFIG_BLK_DEV_SKD) += skd.o
2627
obj-$(CONFIG_BLK_DEV_OSD) += osdblk.o
2728

2829
obj-$(CONFIG_BLK_DEV_UMEM) += umem.o
@@ -44,4 +45,5 @@ obj-$(CONFIG_BLK_DEV_RSXX) += rsxx/
4445
obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk.o
4546

4647
nvme-y := nvme-core.o nvme-scsi.o
48+
skd-y := skd_main.o
4749
swim_mod-y := swim.o swim_asm.o

‎drivers/block/cciss.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5183,7 +5183,7 @@ static int cciss_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
51835183
rebuild_lun_table(h, 1, 0);
51845184
cciss_engage_scsi(h);
51855185
h->busy_initializing = 0;
5186-
return 1;
5186+
return 0;
51875187

51885188
clean4:
51895189
cciss_free_cmd_pool(h);

‎drivers/block/drbd/drbd_int.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,8 @@ enum determine_dev_size {
14741474
DS_ERROR = -1,
14751475
DS_UNCHANGED = 0,
14761476
DS_SHRUNK = 1,
1477-
DS_GREW = 2
1477+
DS_GREW = 2,
1478+
DS_GREW_FROM_ZERO = 3,
14781479
};
14791480
extern enum determine_dev_size
14801481
drbd_determine_dev_size(struct drbd_conf *, enum dds_flags, struct resize_parms *) __must_hold(local);

‎drivers/block/drbd/drbd_main.c‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,13 +2750,6 @@ int __init drbd_init(void)
27502750
return err;
27512751
}
27522752

2753-
err = drbd_genl_register();
2754-
if (err) {
2755-
printk(KERN_ERR "drbd: unable to register generic netlink family\n");
2756-
goto fail;
2757-
}
2758-
2759-
27602753
register_reboot_notifier(&drbd_notifier);
27612754

27622755
/*
@@ -2767,6 +2760,15 @@ int __init drbd_init(void)
27672760
drbd_proc = NULL; /* play safe for drbd_cleanup */
27682761
idr_init(&minors);
27692762

2763+
rwlock_init(&global_state_lock);
2764+
INIT_LIST_HEAD(&drbd_tconns);
2765+
2766+
err = drbd_genl_register();
2767+
if (err) {
2768+
printk(KERN_ERR "drbd: unable to register generic netlink family\n");
2769+
goto fail;
2770+
}
2771+
27702772
err = drbd_create_mempools();
27712773
if (err)
27722774
goto fail;
@@ -2778,9 +2780,6 @@ int __init drbd_init(void)
27782780
goto fail;
27792781
}
27802782

2781-
rwlock_init(&global_state_lock);
2782-
INIT_LIST_HEAD(&drbd_tconns);
2783-
27842783
retry.wq = create_singlethread_workqueue("drbd-reissue");
27852784
if (!retry.wq) {
27862785
printk(KERN_ERR "drbd: unable to create retry workqueue\n");

‎drivers/block/drbd/drbd_nl.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ drbd_determine_dev_size(struct drbd_conf *mdev, enum dds_flags flags, struct res
955955
}
956956

957957
if (size > la_size_sect)
958-
rv = DS_GREW;
958+
rv = la_size_sect ? DS_GREW : DS_GREW_FROM_ZERO;
959959
if (size < la_size_sect)
960960
rv = DS_SHRUNK;
961961

@@ -1132,9 +1132,9 @@ void drbd_reconsider_max_bio_size(struct drbd_conf *mdev)
11321132
/* We may ignore peer limits if the peer is modern enough.
11331133
Because new from 8.3.8 onwards the peer can use multiple
11341134
BIOs for a single peer_request */
1135-
if (mdev->state.conn >= C_CONNECTED) {
1135+
if (mdev->state.conn >= C_WF_REPORT_PARAMS) {
11361136
if (mdev->tconn->agreed_pro_version < 94)
1137-
peer = min( mdev->peer_max_bio_size, DRBD_MAX_SIZE_H80_PACKET);
1137+
peer = min(mdev->peer_max_bio_size, DRBD_MAX_SIZE_H80_PACKET);
11381138
/* Correct old drbd (up to 8.3.7) if it believes it can do more than 32KiB */
11391139
else if (mdev->tconn->agreed_pro_version == 94)
11401140
peer = DRBD_MAX_SIZE_H80_PACKET;

‎drivers/block/drbd/drbd_receiver.c‎

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,29 +1890,11 @@ static u32 seq_max(u32 a, u32 b)
18901890
return seq_greater(a, b) ? a : b;
18911891
}
18921892

1893-
static bool need_peer_seq(struct drbd_conf *mdev)
1894-
{
1895-
struct drbd_tconn *tconn = mdev->tconn;
1896-
int tp;
1897-
1898-
/*
1899-
* We only need to keep track of the last packet_seq number of our peer
1900-
* if we are in dual-primary mode and we have the resolve-conflicts flag set; see
1901-
* handle_write_conflicts().
1902-
*/
1903-
1904-
rcu_read_lock();
1905-
tp = rcu_dereference(mdev->tconn->net_conf)->two_primaries;
1906-
rcu_read_unlock();
1907-
1908-
return tp && test_bit(RESOLVE_CONFLICTS, &tconn->flags);
1909-
}
1910-
19111893
static void update_peer_seq(struct drbd_conf *mdev, unsigned int peer_seq)
19121894
{
19131895
unsigned int newest_peer_seq;
19141896

1915-
if (need_peer_seq(mdev)) {
1897+
if (test_bit(RESOLVE_CONFLICTS, &mdev->tconn->flags)) {
19161898
spin_lock(&mdev->peer_seq_lock);
19171899
newest_peer_seq = seq_max(mdev->peer_seq, peer_seq);
19181900
mdev->peer_seq = newest_peer_seq;
@@ -1972,22 +1954,31 @@ static int wait_for_and_update_peer_seq(struct drbd_conf *mdev, const u32 peer_s
19721954
{
19731955
DEFINE_WAIT(wait);
19741956
long timeout;
1975-
int ret;
1957+
int ret = 0, tp;
19761958

1977-
if (!need_peer_seq(mdev))
1959+
if (!test_bit(RESOLVE_CONFLICTS, &mdev->tconn->flags))
19781960
return 0;
19791961

19801962
spin_lock(&mdev->peer_seq_lock);
19811963
for (;;) {
19821964
if (!seq_greater(peer_seq - 1, mdev->peer_seq)) {
19831965
mdev->peer_seq = seq_max(mdev->peer_seq, peer_seq);
1984-
ret = 0;
19851966
break;
19861967
}
1968+
19871969
if (signal_pending(current)) {
19881970
ret = -ERESTARTSYS;
19891971
break;
19901972
}
1973+
1974+
rcu_read_lock();
1975+
tp = rcu_dereference(mdev->tconn->net_conf)->two_primaries;
1976+
rcu_read_unlock();
1977+
1978+
if (!tp)
1979+
break;
1980+
1981+
/* Only need to wait if two_primaries is enabled */
19911982
prepare_to_wait(&mdev->seq_wait, &wait, TASK_INTERRUPTIBLE);
19921983
spin_unlock(&mdev->peer_seq_lock);
19931984
rcu_read_lock();
@@ -2228,8 +2219,10 @@ static int receive_Data(struct drbd_tconn *tconn, struct packet_info *pi)
22282219
}
22292220
goto out_interrupted;
22302221
}
2231-
} else
2222+
} else {
2223+
update_peer_seq(mdev, peer_seq);
22322224
spin_lock_irq(&mdev->tconn->req_lock);
2225+
}
22332226
list_add(&peer_req->w.list, &mdev->active_ee);
22342227
spin_unlock_irq(&mdev->tconn->req_lock);
22352228

@@ -4132,7 +4125,11 @@ recv_bm_rle_bits(struct drbd_conf *mdev,
41324125
(unsigned int)bs.buf_len);
41334126
return -EIO;
41344127
}
4135-
look_ahead >>= bits;
4128+
/* if we consumed all 64 bits, assign 0; >> 64 is "undefined"; */
4129+
if (likely(bits < 64))
4130+
look_ahead >>= bits;
4131+
else
4132+
look_ahead = 0;
41364133
have -= bits;
41374134

41384135
bits = bitstream_get_bits(&bs, &tmp, 64 - have);

‎drivers/block/drbd/drbd_req.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,13 +1306,16 @@ int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct
13061306
int backing_limit;
13071307

13081308
if (bio_size && get_ldev(mdev)) {
1309+
unsigned int max_hw_sectors = queue_max_hw_sectors(q);
13091310
struct request_queue * const b =
13101311
mdev->ldev->backing_bdev->bd_disk->queue;
13111312
if (b->merge_bvec_fn) {
13121313
backing_limit = b->merge_bvec_fn(b, bvm, bvec);
13131314
limit = min(limit, backing_limit);
13141315
}
13151316
put_ldev(mdev);
1317+
if ((limit >> 9) > max_hw_sectors)
1318+
limit = max_hw_sectors << 9;
13161319
}
13171320
return limit;
13181321
}

‎drivers/block/loop.c‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -894,13 +894,6 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
894894

895895
bio_list_init(&lo->lo_bio_list);
896896

897-
/*
898-
* set queue make_request_fn, and add limits based on lower level
899-
* device
900-
*/
901-
blk_queue_make_request(lo->lo_queue, loop_make_request);
902-
lo->lo_queue->queuedata = lo;
903-
904897
if (!(lo_flags & LO_FLAGS_READ_ONLY) && file->f_op->fsync)
905898
blk_queue_flush(lo->lo_queue, REQ_FLUSH);
906899

@@ -1618,6 +1611,8 @@ static int loop_add(struct loop_device **l, int i)
16181611
if (!lo)
16191612
goto out;
16201613

1614+
lo->lo_state = Lo_unbound;
1615+
16211616
/* allocate id, if @id >= 0, we're requesting that specific id */
16221617
if (i >= 0) {
16231618
err = idr_alloc(&loop_index_idr, lo, i, i + 1, GFP_KERNEL);
@@ -1635,6 +1630,12 @@ static int loop_add(struct loop_device **l, int i)
16351630
if (!lo->lo_queue)
16361631
goto out_free_idr;
16371632

1633+
/*
1634+
* set queue make_request_fn
1635+
*/
1636+
blk_queue_make_request(lo->lo_queue, loop_make_request);
1637+
lo->lo_queue->queuedata = lo;
1638+
16381639
disk = lo->lo_disk = alloc_disk(1 << part_shift);
16391640
if (!disk)
16401641
goto out_free_queue;

0 commit comments

Comments
 (0)