summaryrefslogtreecommitdiffstats
path: root/drivers/block
Commit message (Collapse)AuthorAgeFilesLines
* kernel: remove CONFIG_USE_GENERIC_SMP_HELPERS cleanlyYuanhan Liu2013-11-221-4/+4
| | | | | | | | | | Remove CONFIG_USE_GENERIC_SMP_HELPERS left by commit 0a06ff068f12 ("kernel: remove CONFIG_USE_GENERIC_SMP_HELPERS"). Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* virtio-blk: virtqueue_kick() must be ordered with other virtqueue operationsShaohua Li2013-11-201-2/+3
| | | | | | | | | | | It isn't safe to call it without holding the vblk->vq_lock. Reported-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Shaohua Li <shli@fusionio.com> Fixed another condition of virtqueue_kick() not holding the lock. Signed-off-by: Jens Axboe <axboe@kernel.dk>
* Merge branch 'for-linus' of git://git.kernel.dk/linux-blockLinus Torvalds2013-11-161-257/+65Star
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull second round of block driver updates from Jens Axboe: "As mentioned in the original pull request, the bcache bits were pulled because of their dependency on the immutable bio vecs. Kent re-did this part and resubmitted it, so here's the 2nd round of (mostly) driver updates for 3.13. It contains: - The bcache work from Kent. - Conversion of virtio-blk to blk-mq. This removes the bio and request path, and substitutes with the blk-mq path instead. The end result almost 200 deleted lines. Patch is acked by Asias and Christoph, who both did a bunch of testing. - A removal of bootmem.h include from Grygorii Strashko, part of a larger series of his killing the dependency on that header file. - Removal of __cpuinit from blk-mq from Paul Gortmaker" * 'for-linus' of git://git.kernel.dk/linux-block: (56 commits) virtio_blk: blk-mq support blk-mq: remove newly added instances of __cpuinit bcache: defensively handle format strings bcache: Bypass torture test bcache: Delete some slower inline asm bcache: Use ida for bcache block dev minor bcache: Fix sysfs splat on shutdown with flash only devs bcache: Better full stripe scanning bcache: Have btree_split() insert into parent directly bcache: Move spinlock into struct time_stats bcache: Kill sequential_merge option bcache: Kill bch_next_recurse_key() bcache: Avoid deadlocking in garbage collection bcache: Incremental gc bcache: Add make_btree_freeing_key() bcache: Add btree_node_write_sync() bcache: PRECEDING_KEY() bcache: bch_(btree|extent)_ptr_invalid() bcache: Don't bother with bucket refcount for btree node allocations bcache: Debug code improvements ...
| * virtio_blk: blk-mq supportJens Axboe2013-11-141-257/+65Star
| | | | | | | | | | | | | | | | | | Switch virtio-blk from the dual support for old-style requests and bios to use the block-multiqueue. Acked-by: Asias He <asias@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Christoph Hellwig <hch@lst.de>
| * Merge branch 'for-3.13/post-mq-drivers' into for-linusJens Axboe2013-11-1421-357/+6362
| |\
* | \ Merge tag 'virtio-next-for-linus' of ↵Linus Torvalds2013-11-151-46/+37Star
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux Pull virtio updates from Rusty Russell: "Nothing really exciting: some groundwork for changing virtio endian, and some robustness fixes for broken virtio devices, plus minor tweaks" * tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: virtio_scsi: verify if queue is broken after virtqueue_get_buf() x86, asmlinkage, lguest: Pass in globals into assembler statement virtio: mmio: fix signature checking for BE guests virtio_ring: adapt to notify() returning bool virtio_net: verify if queue is broken after virtqueue_get_buf() virtio_console: verify if queue is broken after virtqueue_get_buf() virtio_blk: verify if queue is broken after virtqueue_get_buf() virtio_ring: add new function virtqueue_is_broken() virtio_test: verify if virtqueue_kick() succeeded virtio_net: verify if virtqueue_kick() succeeded virtio_ring: let virtqueue_{kick()/notify()} return a bool virtio_ring: change host notification API virtio_config: remove virtio_config_val virtio: use size-based config accessors. virtio_config: introduce size-based accessors. virtio_ring: plug kmemleak false positive. virtio: pm: use CONFIG_PM_SLEEP instead of CONFIG_PM
| * | | virtio_blk: verify if queue is broken after virtqueue_get_buf()Heinz Graalfs2013-10-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case virtqueue_get_buf() returned with a NULL pointer verify if the virtqueue is broken in order to leave while loop. Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
| * | | virtio: use size-based config accessors.Rusty Russell2013-10-171-44/+33Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lets the transport do endian conversion if necessary, and insulates the drivers from the difference. Most drivers can use the simple helpers virtio_cread() and virtio_cwrite(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
| * | | virtio: pm: use CONFIG_PM_SLEEP instead of CONFIG_PMAaron Lu2013-09-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The freeze and restore functions defined in virtio drivers are used for suspend and hibernate, so CONFIG_PM_SLEEP is more appropriate than CONFIG_PM. This patch replace all CONFIG_PM with CONFIG_PM_SLEEP for virtio drivers that implement freeze and restore callbacks. Signed-off-by: Aaron Lu <aaron.lu@intel.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* | | | tree-wide: use reinit_completion instead of INIT_COMPLETIONWolfram Sang2013-11-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | | | Merge branch 'for-3.13/drivers' of git://git.kernel.dk/linux-blockLinus Torvalds2013-11-1421-357/+6362
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ...
| * | | pktcdvd: debugfs functions return NULL on errorDan Carpenter2013-11-081-18/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My static checker complains correctly that this is potential NULL dereference because debugfs functions return NULL on error. They return an ERR_PTR if they are configured out. We don't need to check for ERR_PTR because if debugfs is stubbed out the dummy functions won't complain about that. We don't need to check the values before calling debugfs_remove() because that accepts ERR_PTRs and NULL pointers. We don't need to set pkt->dfs_f_info to NULL in pkt_debugfs_dev_new() because it was initialized with kzalloc() so I have removed that. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
| * | | xen-blkfront: restore the non-persistent data pathRoger Pau Monne2013-11-081-25/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When persistent grants were added they were always used, even if the backend doesn't have this feature (there's no harm in always using the same set of pages). This restores the old data path when the backend doesn't have persistent grants, removing the burden of doing a memcpy when it is not actually needed. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reported-by: Felipe Franciosi <felipe.franciosi@citrix.com> Cc: Felipe Franciosi <felipe.franciosi@citrix.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: David Vrabel <david.vrabel@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [v2: Fix up whitespace issues]
| * | | skd: fix formatting in skd_s1120.hBartlomiej Zolnierkiewicz2013-11-081-120/+110Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: reorder construct/destruct codeBartlomiej Zolnierkiewicz2013-11-081-164/+141Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reorder placement of skd_construct(), skd_cons_sg_list(), skd_destruct() and skd_free_sg_list() functions. Then remove no longer needed function prototypes. Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: cleanup skd_do_inq_page_da()Bartlomiej Zolnierkiewicz2013-11-081-26/+13Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | skdev->pdev and skdev->pdev->bus are always different than NULL in skd_do_inq_page_da() so simplify the code accordingly. Also cache skdev->pdev value in pdev variable while at it. Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: remove SKD_OMIT_FROM_SRC_DIST ifdefsBartlomiej Zolnierkiewicz2013-11-081-14/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SKD_OMIT_FROM_SRC_DIST is never defined. Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: remove redundant skdev->pdev assignment from skd_pci_probe()Bartlomiej Zolnierkiewicz2013-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | skdev->pdev is set to pdev twice in skd_pci_probe(), first time through skd_construct() call and the second time directly in the function. Remove the second assignment as it is not needed. Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: use <asm/unaligned.h>Bartlomiej Zolnierkiewicz2013-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use <asm/unaligned.h> instead of <asm-generic/unaligned.h>. Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: remove SCSI subsystem specific includesBartlomiej Zolnierkiewicz2013-11-081-3/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is not a SCSI host driver so remove SCSI subsystem specific includes. Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: register block device only if some devices are presentBartlomiej Zolnierkiewicz2013-11-081-21/+12Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Register block device in skd_pci_probe() instead of in skd_init() so it is registered only if some devices are present (currently it is always registered when the driver is loaded). Please note that this change depends on the fact that register_blkdev(0, ...) never returns 0. Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: fix error messages in skd_init()Bartlomiej Zolnierkiewicz2013-11-081-12/+9Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * change priority level from KERN_INFO to KERN_ERR * add "skd: " prefix * do minor CodingStyle fixes Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: fix error paths in skd_init()Bartlomiej Zolnierkiewicz2013-11-081-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: fix unregister_blkdev() placementBartlomiej Zolnierkiewicz2013-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | register_blkdev() is called before pci_register_driver() in skd_init() so unregister_blkdev() should be called after pci_unregister_driver() in skd_exit(). Fix it. Cc: Akhil Bhansali <abhansali@stec-inc.com> Cc: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: more removal of bio-based codeMike Snitzer2013-11-081-71/+20Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove skd_flush_cmd structure and skd_flush_slab. Remove skd_end_request wrapper around skd_end_request_blk. Remove skd_requeue_request, use blk_requeue_request directly. Cleanup some comments (remove "bio" info) and whitespace. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: cleanup the skd_*() function block wrappingJens Axboe2013-11-081-37/+15Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just call the block functions directly, don't wrap them in skd helpers. With only one queueing model enabled, there's no point in doing that. Also kill the ->start_time and ->bio from the skd_request_context, we don't use those anymore. Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: rip out bio pathJens Axboe2013-11-081-467/+62Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The skd driver has a selectable rq or bio based queueing model. For 3.14, we want to turn this into a single blk-mq interface instead. With the immutable biovecs being merged in 3.13, the bio model would need patches to even work. So rip it out, with a conversion pending for blk-mq in the next release. Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: fix error return code in skd_pci_probe()Wei Yongjun2013-11-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix to return -ENOMEM in the skd construct error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | cciss: return 0 from driver probe function on success, not 1Stephen M. Cameron2013-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A return value of 1 is interpreted as an error Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: Replaced custom debug PRINTKs with pr_debugrchinthekindi2013-11-081-284/+407
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced DPRINTK() and VPRINTK() with pr_debug(). Signed-off-by: Ramprasad C <ramprasad.chinthekindi@hgst.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | skd: Fix checkpatch ERRORS and removed unused functionsAkhil Bhansali2013-11-081-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes checkpatch.pl errors for assignment in if condition. It also removes unused readq / readl function calls. As Andrew had disabled the compilation of drivers for 32 bit, I have modified format specifiers in few VPRINTKs to avoid warnings during 64 bit compilation. Signed-off-by: Akhil Bhansali <abhansali@stec-inc.com> Reviewed-by: Ramprasad Chinthekindi <rchinthekindi@stec-inc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | rsxx: Fix possible kernel panic with invalid config.Philip J Kelleher2013-11-082-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a possible Kernel Panic on driver load if the configuration on the card is messed up or not yet set. The driver could possible give a 32 bit unsigned all Fs to the kernel as the device's block size. Now we only write the block size to the kernel if the configuration from the card is valid. Also, driver version is being updated. Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | rsxx: Disallow discards from being unmapped.Philip J Kelleher2013-11-082-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a bug in which discards were always calling pci_unmap_page. Discards should never call the pci_unmap_page function call because they are never mapped. This caused a race condition on PowerPC systems when issuing discards, writes, and reads all at the same time. The pci_map_page function would eventually map logical address 0 for a read or write. Discards are always assigned a DMA address of 0 because they are never mapped. So if pci_map_page mapped address 0 for a DMA and a discard was "unmapped" then the address would be freed and would cause an EEH event to occur when Hardware accesses the address. This was injected/uncovered in commit: b347f9cf0bc8d42ee95ba1d3837fd93045ab336b The pci_dma_mapping_error function declares -1 a DMA_ERROR not 0 like initially thought So before we would never unmap discards because they were considered NULL. This patch should fall on top of commit id: fc1967bb08a6184ed44ef990e1dd4389901b809c Also, the driver version is being up dated. Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | drbd: avoid to shrink max_bio_size due to peer re-configurationLars Ellenberg2013-11-082-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a long time, the receiving side has spread "too large" incoming requests over multiple bios. No need to shrink our max_bio_size (max_hw_sectors) if the peer is reconfigured to use a different storage. The problem manifests itself if we are not the top of the device stack (DRBD is used a LVM PV). A hardware reconfiguration on the peer may cause the supported max_bio_size to shrink, and the connection handshake would now unnecessarily shrink the max_bio_size on the active node. There is no way to notify upper layers that they have to "re-stack" their limits. So they won't notice at all, and may keep submitting bios that are suddenly considered "too large for device". We already check for compatibility and ignore changes on the peer, the code only was masked out unless we have a fully established connection. We just need to allow it a bit earlier during the handshake. Also consider max_hw_sectors in our merge bvec function, just in case. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | drbd: fix decoding of bitmap vli rle for device sizes > 64 TBLars Ellenberg2013-11-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symptoms: disconnect after bitmap exchange due to bitmap overflow (e:49731075554) while decoding bm RLE packet In the decoding step of the variable length integer run length encoding there was potentially an uncatched bitshift by wordsize (variable >> 64). The result of which is "undefined" :( (only "sometimes" the result is the desired 0) Fix: don't do any bit shift magic for shift == 64, just assign. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | drbd: Fix adding of new minors with freshly created meta dataPhilipp Reisner2013-11-082-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Online adding of new minors with freshly created meta data to an resource with an established connection failed, with a wrong state transition on one side on one side of the new minor. Freshly created meta-data has a la_size (last agreed size) of 0. When we online add such devices, the code wrongly got into the code path for resyncing new storage that was added while the disk was detached. Fixed that by making the GREW from ZERO a special case. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | drbd: Fix an connection drop issue after enabling allow-two-primariesPhilipp Reisner2013-11-081-23/+16Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since drbd-8.4.0 it is possible to change the allow-two-primaries network option while the connection is established. The sequence code used to partially order packets from the data socket with packets from the meta-data socket, still assued that the allow-two-primaries option is constant while the connection is established. I.e. On a node that has the RESOLVE_CONFLICTS bits set, after enabling allow-two-primaries, when receiving the next data packet it timed out while waiting for the necessary packets on the data socket to arrive (wait_for_and_update_peer_seq() function). Fixed that by always tracking the sequence number, but only waiting for it if allow-two-primaries is set. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | drbd: fix NULL pointer deref in module init error pathLars Ellenberg2013-11-081-10/+9Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we want to iterate over the (as of yet still empty) list in the cleanup path, we need to initialize the list before the first goto fail. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | block: disable cpqarray in KconfigJens Axboe2013-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mike writes: "cpqarray hasn't been used in over 12 years. It's doubtful that anyone still uses the board. It's time the driver was removed from the mainline kernel. The only updates these days are minor and mostly done by people outside of HP." If nobody yells, we'll remove it from the kernel tree completely for 3.15. Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | Add support for sTec's pci-e flash card KronosAkhil Bhansali2013-11-084-0/+6183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Akhil Bhansali <abhansali@stec-inc.com> Signed-off-by: Ramprasad Chinthekindi <rchinthekindi@stec-inc.com> Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Folded patch, contributions to clean up this driver from: Jens Axboe Dan Carpenter Andrew Morton Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | rsxx: Kernel Panic caused by mapping DiscardsPhilip J Kelleher2013-11-082-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a kernel panic injected by commit id 8d26750143341831bc312f61c5ed141eeb75b8d0 where discards are getting mapped through the pci_map_page function call. The driver will now start verifying that a dma is not a discard before issuing a the pci_map_page function call. Also, we are updating the driver version. Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | mtip32xx: dynamically allocate buffer in debugfs functionsDavid Milburn2013-11-081-10/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dynamically allocate buf to prevent warnings: drivers/block/mtip32xx/mtip32xx.c: In function ‘mtip_hw_read_device_status’: drivers/block/mtip32xx/mtip32xx.c:2823: warning: the frame size of 1056 bytes is larger than 1024 bytes drivers/block/mtip32xx/mtip32xx.c: In function ‘mtip_hw_read_registers’: drivers/block/mtip32xx/mtip32xx.c:2894: warning: the frame size of 1056 bytes is larger than 1024 bytes drivers/block/mtip32xx/mtip32xx.c: In function ‘mtip_hw_read_flags’: drivers/block/mtip32xx/mtip32xx.c:2917: warning: the frame size of 1056 bytes is larger than 1024 bytes Signed-off-by: David Milburn <dmilburn@redhat.com> Acked-by: Asai Thambi S P <asamymuthupa@micron.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | mtip32xx: Add SRSI supportAsai Thambi S P2013-11-082-182/+289
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch add support for SRSI(Surprise Removal Surprise Insertion). Approach: --------- Surprise Removal: ----------------- On surprise removal of the device, gendisk, request queue, device index, sysfs entries, etc are retained as long as device is in use - mounted filesystem, device opened by an application, etc. The service thread breaks out of the main while loop, waits for pci remove to exit, and then waits for device to become free. When there no holders of the device, service thread cleans up the block and device related stuff and returns. Surprise Insertion: ------------------- No change, this scenario follows the normal pci probe() function flow. Signed-off-by: Asai Thambi S P <asamymuthupa@micron.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | rsxx: Moving pci_map_page to prevent overflow.Philip J Kelleher2013-11-082-47/+28Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pci_map_page function has been moved into our issued workqueue to prevent an us running out of mappable addresses on non-HWWD PCIe x8 slots. The maximum amount that can possible be mapped at one time now is: 255 dmas X 4 dma channels X 4096 Bytes. Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | rsxx: Handling failed pci_map_page on PowerPC and double free.Philip J Kelleher2013-11-083-22/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rsxx driver was not checking the correct value during a pci_map_page failure. Fixing this also uncovered a double free if the bio was returned before it was broken up into indiviadual 4k dmas, that is also fixed here. Signed-off-by: Philip J Kelleher <pjk1939@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | loop: fix crash when using unassigned loop deviceMikulas Patocka2013-11-081-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the loop module is loaded, it creates 8 loop devices /dev/loop[0-7]. The devices have no request routine and thus, when they are used without being assigned, a crash happens. For example, these commands cause crash (assuming there are no used loop devices): Kernel Fault: Code=26 regs=000000007f420980 (Addr=0000000000000010) CPU: 1 PID: 50 Comm: kworker/1:1 Not tainted 3.11.0 #1 Workqueue: ksnaphd do_metadata [dm_snapshot] task: 000000007fcf4078 ti: 000000007f420000 task.ti: 000000007f420000 [ 116.319988] YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI PSW: 00001000000001001111111100001111 Not tainted r00-03 000000ff0804ff0f 00000000408bf5d0 00000000402d8204 000000007b7ff6c0 r04-07 00000000408a95d0 000000007f420950 000000007b7ff6c0 000000007d06c930 r08-11 000000007f4205c0 0000000000000001 000000007f4205c0 000000007f4204b8 r12-15 0000000000000010 0000000000000000 0000000000000000 0000000000000000 r16-19 000000001108dd48 000000004061cd7c 000000007d859800 000000000800000f r20-23 0000000000000000 0000000000000008 0000000000000000 0000000000000000 r24-27 00000000ffffffff 000000007b7ff6c0 000000007d859800 00000000408a95d0 r28-31 0000000000000000 000000007f420950 000000007f420980 000000007f4208e8 sr00-03 0000000000000000 0000000000000000 0000000000000000 0000000000303000 sr04-07 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 117.549988] IASQ: 0000000000000000 0000000000000000 IAOQ: 00000000402d82fc 00000000402d8300 IIR: 53820020 ISR: 0000000000000000 IOR: 0000000000000010 CPU: 1 CR30: 000000007f420000 CR31: ffffffffffffffff ORIG_R28: 0000000000000001 IAOQ[0]: generic_make_request+0x11c/0x1a0 IAOQ[1]: generic_make_request+0x120/0x1a0 RP(r2): generic_make_request+0x24/0x1a0 Backtrace: [<00000000402d83f0>] submit_bio+0x70/0x140 [<0000000011087c4c>] dispatch_io+0x234/0x478 [dm_mod] [<0000000011087f44>] sync_io+0xb4/0x190 [dm_mod] [<00000000110883bc>] dm_io+0x2c4/0x310 [dm_mod] [<00000000110bfcd0>] do_metadata+0x28/0xb0 [dm_snapshot] [<00000000401591d8>] process_one_work+0x160/0x460 [<0000000040159bc0>] worker_thread+0x300/0x478 [<0000000040161a70>] kthread+0x118/0x128 [<0000000040104020>] end_fault_vector+0x20/0x28 [<0000000040177220>] task_tick_fair+0x420/0x4d0 [<00000000401aa048>] invoke_rcu_core+0x50/0x60 [<00000000401ad5b8>] rcu_check_callbacks+0x210/0x8d8 [<000000004014aaa0>] update_process_times+0xa8/0xc0 [<00000000401ab86c>] rcu_process_callbacks+0x4b4/0x598 [<0000000040142408>] __do_softirq+0x250/0x2c0 [<00000000401789d0>] find_busiest_group+0x3c0/0xc70 [ 119.379988] Kernel panic - not syncing: Kernel Fault Rebooting in 1 seconds.. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: stable@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | xen/blkback: fix reference countingVegard Nossum2013-11-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the permission check fails, we drop a reference to the blkif without having taken it in the first place. The bug was introduced in commit 604c499cbbcc3d5fe5fb8d53306aa0fae1990109 (xen/blkback: Check device permissions before allowing OP_DISCARD). Cc: stable@vger.kernel.org Cc: Jan Beulich <JBeulich@suse.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | xen-blkfront: improve aproximation of required grants per requestRoger Pau Monne2013-11-081-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the calculation of required grants to process a request by using nr_phys_segments instead of always assuming a request is going to use all posible segments. nr_phys_segments contains the number of scatter-gather DMA addr+len pairs, which is basically what we put at every granted page. for_each_sg iterates over the DMA addr+len pairs and uses a grant page for each of them. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: David Vrabel <david.vrabel@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | xen-blkfront: revoke foreign access for grants not mapped by the backendRoger Pau Monne2013-11-081-4/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to keep the foreign access in a grant if it is not persistently mapped by the backend. This allows us to free grants that are not mapped by the backend, thus preventing blkfront from hoarding all grants. The main effect of this is that blkfront will only persistently map the same grants as the backend, and it will always try to use grants that are already mapped by the backend. Also the number of persistent grants in blkfront is the same as in blkback (and is controlled by the value in blkback). Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Matt Wilson <msw@amazon.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: David Vrabel <david.vrabel@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
| * | | mg_disk: remove deprecated IRQF_DISABLEDMichael Opdenacker2013-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch proposes to remove the use of the IRQF_DISABLED flag It's a NOOP since 2.6.35 and it will be removed one day. Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>