aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2010-08-07block: push down BKL into .locked_ioctlArnd Bergmann
As a preparation for the removal of the big kernel lock in the block layer, this removes the BKL from the common ioctl handling code, moving it into every single driver still using it. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07scsi/i2o_block: cleanup ioctl handlingArnd Bergmann
This fixes the ioctl function of the i2o_block driver, which has multiple problems: * The BLKI2OSRSTRAT and BLKI2OSWSTRAT commands always return -ENOTTY on success, where they should return 0. * Support for 32 bit compat is missing * The driver should use the .ioctl function and because .locked_ioctl is going away. The use of the big kernel lock remains for now, but gets made explictit in the ioctl function. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07scsi: fix discard page leakFUJITA Tomonori
We leak a page allocated for discard on some error conditions (e.g. scsi_prep_state_check returns BLKPREP_DEFER in scsi_setup_blk_pc_cmnd). We unprep on requests that weren't prepped in the error path of scsi_init_io. It makes the error path to clean up scsi commands messy. Let's strictly apply the rule that we can't unprep on a request that wasn't prepped. Calling just scsi_put_command() in the error path of scsi_init_io() is enough. We don't set REQ_DONTPREP yet. scsi_setup_discard_cmnd can safely free a page on the error case with the above rule. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07scsi: need to reset unprep_rq_fn in sd_removeFUJITA Tomonori
This is for block's for-2.6.36. We need to reset q->unprep_rq_fn in sd_remove. Otherwise we hit kernel oops if we access to a scsi disk device via sg after removing scsi disk module. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07block: remove q->prepare_flush_fn completelyFUJITA Tomonori
This removes q->prepare_flush_fn completely (changes the blk_queue_ordered API). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07ide: stop using q->prepare_flush_fnFUJITA Tomonori
use REQ_FLUSH flag instead. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: David S. Miller <davem@davemloft.net> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07virtio_blk: stop using q->prepare_flush_fnFUJITA Tomonori
use REQ_FLUSH flag instead. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07dm: stop using q->prepare_flush_fnFUJITA Tomonori
use REQ_FLUSH flag instead. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Alasdair G Kergon <agk@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07ps3disk: stop using q->prepare_flush_fnFUJITA Tomonori
REQ_FLUSH flag enables us to kill ps3disk_prepare_flush(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07osdblk: stop using q->prepare_flush_fnFUJITA Tomonori
use REQ_FLUSH flag instead. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07scsi: stop using q->prepare_flush_fnFUJITA Tomonori
scsi-ml builds flush requests via q->prepare_flush_fn(), however, builds discard requests via q->prep_rq_fn. Using two different mechnisms for the similar requests (building commands in SCSI ULD) doesn't make sense. Handing both via q->prep_rq_fn makes the code design simpler. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: James Bottomley <James.Bottomley@suse.de> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07scsi: remove unused free discard page in sd_doneFUJITA Tomonori
- sd_done isn't called for pc request so we never call the code. - we use sd_unprep to free discard page now. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07scsi: add sd_unprep_fn to free discard pageFUJITA Tomonori
This fixes discard page leak by using q->unprep_rq_fn facility. q->unprep_rq_fn is called when all the data buffer (req->bio and scsi_data_buffer) in the request is freed. sd_unprep() uses rq->buffer to free discard page allocated in sd_prepare_discard(). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07block: implement an unprep function corresponding directly to prepJames Bottomley
Reviewed-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07drivers/cdrom: use pr_<level>Joe Perches
- add pr_fmt. - convert printks to pr_<level> - add if (0) and printf argument checking to cdinfo - coalesce consecutive printks to single pr_ - fix a typo "back ground" to "background" - convert printks without level to pr_info - remove VIOCD_ prefixes and use pr_fmt/pr_<level> - add a missing newline to an OS/400 message Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Folded in tab indentation fix from Andrew. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07block/xd.c: fix brace typoRandy Dunlap
Fix extra brace typo that is causing build errors. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07block: don't allocate a payload for discard requestChristoph Hellwig
Allocating a fixed payload for discard requests always was a horrible hack, and it's not coming to byte us when adding support for discard in DM/MD. So change the code to leave the allocation of a payload to the lowlevel driver. Unfortunately that means we'll need another hack, which allows us to update the various block layer length fields indicating that we have a payload. Instead of hiding this in sd.c, which we already partially do for UNMAP support add a documented helper in the core block layer for it. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07block: fix some more cmd_type cleanup falloutChristoph Hellwig
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07virtio_blk: add default case to cmd type switchJens Axboe
On compilation, gcc correctly detects that we do not handle all types: In function ‘blk_done’: warning: enumeration value ‘REQ_TYPE_FS’ not handled in switch warning: enumeration value ‘REQ_TYPE_SENSE’ not handled in switch warning: enumeration value ‘REQ_TYPE_PM_SUSPEND’ not handled in switch warning: enumeration value ‘REQ_TYPE_PM_RESUME’ not handled in switch warning: enumeration value ‘REQ_TYPE_PM_SHUTDOWN’ not handled in switch warning: enumeration value ‘REQ_TYPE_LINUX_BLOCK’ not handled in switch warning: enumeration value ‘REQ_TYPE_ATA_TASKFILE’ not handled in switch warning: enumeration value ‘REQ_TYPE_ATA_PC’ not handled in switch which is a bit pointless since this is at the end of the request processessing. Add a default case that just breaks out. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07block: unify flags for struct bio and struct requestChristoph Hellwig
Remove the current bio flags and reuse the request flags for the bio, too. This allows to more easily trace the type of I/O from the filesystem down to the block driver. There were two flags in the bio that were missing in the requests: BIO_RW_UNPLUG and BIO_RW_AHEAD. Also I've renamed two request flags that had a superflous RW in them. Note that the flags are in bio.h despite having the REQ_ name - as blkdev.h includes bio.h that is the only way to go for now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07block: remove wrappers for request type/flagsChristoph Hellwig
Remove all the trivial wrappers for the cmd_type and cmd_flags fields in struct requests. This allows much easier grepping for different request types instead of unwinding through macros. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07aha1532: remove ISA_DMA_THRESHOLD usageFUJITA Tomonori
We can safely remove ISA_DMA_THRESHOLD usage in aha1542. aha1542 uses ISA_DMA_THRESHOLD to see if: - the buffers in scatter/list are below 16MB. - scsi_host is below 16MB. Both checkings were added in the ancient times but aren't necessary nowadays since we properly bounce the buffers and allocate scsi_host below 16MB with non-zero unchecked_isa_dma. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07floppy: use warning macrosStephen Hemminger
Convert assertions to use WARN(). There are several error checks in the code for things that should never happen. Convert them to standard warnings so kerneloops.org will see them. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07floppy: use wait_event_interruptibleStephen Hemminger
Convert wait loops to use wait_event_ macros. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07floppy: fix signed/unsigned warningsStephen Hemminger
Ioctl cmd value is unsigned, so change normalize_ioctl Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07floppy: cmos attribute should be staticStephen Hemminger
As reported by sparse, cmos attribute is local. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07floppy: use atomic type for usage_countStephen Hemminger
The usage_count was being protected by a lock which was only there to create an atomic counter. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07floppy: silence warning during disk testStephen Hemminger
The first thing the floppy does is read block 0 to test geometry and to test for disk presence. If disk is not present this causes a console warning message about failed I/O. Set flag to silence. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07floppy: remove unnecessary inlinesStephen Hemminger
These routines are all big enough that is better to let the compiler decide to inline or not. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07floppy: initialize debug jiffies offsetStephen Hemminger
Set debug jiffies offset at initialization. Avoids wierd values showing up if debugging enabled. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: change pad value from 32 to 0Mike Miller
Change the command padding on 32-bit systems to 0 since setting it to 32 has the identical effect. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: remove errant debug codeMike Miller
Remove a debug statement left behind by accident Ths debug statement got left behind. It was commented out after use but not deleted. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: move next_command function from ifdefMike Miller
The definition of next_command also ended up in wrong place It ended up inside an "#ifdef CONFIG_PROCFS". Already caught by Randy Dunlap and a couple others. Tried to put it somewhere that made sense. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: fix call to put_controller_in_performant_modeMike Miller
call to put_controller_in_performant_mode was in the wrong place The call inadvertently ended up in an error path. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: make sure we request the performant mode irqMike Miller
Make sure we register the performant mode interrupt Another blunder. Seemed to work because the call to put_controller_into_performant_mode was never called. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: new controller support and bump driver versionMike Miller
Add support for new controllers due out next year. HP must continue to support new controllers in older distros. All vendors require support be upstream. These controllers support only 16 commands in simple mode but can support up to 1024 in performant mode. See patch 5/6/ We have no marketing names yet. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: add performant mode support for Stars/SiriusMike Miller
Add a mode of controller operation called Performant Mode. Even though cciss has been deprecated in favor of hpsa there are new controllers due out next year that HP must support in older vendor distros. Vendors require all fixes/features be upstream. These new controllers support only 16 commands in simple mode but support up to 1024 in performant mode. This requires us to add this support at this late date. The performant mode transport minimizes host PCI accesses by performinf many completions per read. PCI writes are posted so the host can write then immediately get off the bus not waiting for the writwe to complete to the target. In the context of performant mode the host read out to a controller pulls all posted writes into host memory ensuring the reply queue is coherent. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: make interrupt access methods return type boolMike Miller
Change the return type of our interrupt access routines to bool from unsigned long. It makes more sense that way. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: check for msi in interrupt_not_for_usMike Miller
Check to see if h->msi[x]_vector is set. We need this for a following patch. Without this check we process one interrupt then stop because in msi[x] mode the interrupt pending bit is not set. Not sure why we didn't encounter this before. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: clean up interrupt handlerMike Miller
Simplify the interrupt handler code to more closely match hpsa and to hopefully make it easier to follow. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-08-07cciss: enqueue and submit ioMike Miller
Clean up some code where we subit our io. The same 5 lines appeared several times. Also helps for a following patch. Signed-off-by: Mike Miller <mike.miller@hp.com> Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-07-30Merge master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds
* master.kernel.org:/home/rmk/linux-2.6-arm: cyber2000fb: fix console in truecolor modes cyber2000fb: fix machine hang on module load SA1111: Eliminate use after free ARM: Fix Versatile/Realview/VExpress MMC card detection sense ARM: 6279/1: highmem: fix SMP preemption bug in kmap_high_l1_vipt ARM: Add barriers to io{read,write}{8,16,32} accessors as well ARM: 6273/1: Add barriers to the I/O accessors if ARM_DMA_MEM_BUFFERABLE ARM: 6272/1: Convert L2x0 to use the IO relaxed operations ARM: 6271/1: Introduce *_relaxed() I/O accessors ARM: 6275/1: ux500: don't use writeb() in uncompress.h ARM: 6270/1: clean files in arch/arm/boot/compressed/ ARM: Fix csum_partial_copy_from_user()
2010-07-30Merge branch 'drm-fixes' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm/edid: Fix the HDTV hack sync adjustment drm/radeon/kms: fix radeon mid power profile reporting
2010-07-30cyber2000fb: fix console in truecolor modesOndrej Zary
Return value was not set to 0 in setcolreg() with truecolor modes. This causes fb_set_cmap() to abort after first color, resulting in blank palette - and blank console in 24bpp and 32bpp modes. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-07-30cyber2000fb: fix machine hang on module loadOndrej Zary
I was testing two CyberPro 2000 based PCI cards on x86 and the machine always hanged completely when the cyber2000fb module was loaded. It seems that the card hangs when some registers are accessed too quickly after writing RAMDAC control register. With this patch, both card work. Add delay after RAMDAC control register write to prevent hangs on module load. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-07-30ARM: Fix Versatile/Realview/VExpress MMC card detection senseRussell King
The MMC card detection sense has become really confused with negations at various levels, leading to some platforms not detecting inserted cards. Fix this by converting everything to positive logic throughout, thereby getting rid of these negations. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-07-29drm/edid: Fix the HDTV hack sync adjustmentAdam Jackson
We're adjusting horizontal timings only here, moving vsync was just a slavish translation of a typo in the X server. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-29drm/radeon/kms: fix radeon mid power profile reportingDaniel J Blueman
Fix incorrectly reporting 'default' power profile, when it is set to 'mid'. Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-07-28Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: [SCSI] ibmvscsi: Fix oops when an interrupt is pending during probe [SCSI] zfcp: Update status read mempool [SCSI] zfcp: Do not wait for SBALs on stopped queue [SCSI] zfcp: Fix check whether unchained ct_els is possible [SCSI] ipr: fix resource path display and formatting
2010-07-28Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6: davinci: da850/omap-l138 evm: account for DEFDCDC{2,3} being tied high regulator: tps6507x: allow driver to use DEFDCDC{2,3}_HIGH register wm8350-regulator: fix wm8350_register_regulator error handling ab3100: fix off-by-one value range checking for voltage selector