aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/cciss.c
AgeCommit message (Collapse)Author
2010-02-05cciss: Make cciss_seq_show handle holes in the h->drv[] arrayStephen M. Cameron
It is possible (and expected) for there to be holes in the h->drv[] array, that is, some elements may be NULL pointers. cciss_seq_show needs to be made aware of this possibility to avoid an Oops. To reproduce the Oops which this fixes: 1) Create two "arrays" in the Array Configuratino Utility and several logical drives on each array. 2) cat /proc/driver/cciss/cciss* in an infinite loop 3) delete some of the logical drives in the first "array." Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Cc: stable@kernel.org Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-23cciss: fix scatter gather cleanup problemsStephen M. Cameron
On driver unload, only free up the extra scatter gather data if they were allocated in the first place (the controller supports it) and don't forget to free up the sg_cmd_list array of pointers. Signed-off-by: Don Brace <brace@beardog.cce.hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: Fix weird usage of ENXIO in cciss_scsi.cStephen M. Cameron
cciss: Fix weird usage of ENXIO in cciss_scsi.c Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: Add enhanced scatter-gather support.Don Brace
cciss: Add enhanced scatter-gather support. For controllers which supported, more than 512 scatter-gather elements per command may be used, and the max transfer size can be increased to 8192 blocks. Signed-off-by: Don Brace <brace@beardog.cce.hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: Do not automatically rescan on UNIT ATTENTION/LUN DATA CHANGEDStephen M. Cameron
cciss: Do not automatically rescan on UNIT ATTENTION/LUN DATA CHANGED There are problems with doing this. If, say, several logical drives are deleted at once, several such UNIT ATTENTIONS will be encountered, often during the rescan triggered by the first such UNIT ATTENTION. The block layer may be in the midst of trying to add logical drives which were just deleted (resulting in the subsequent UNIT ATTENTION(s).) Making the rescan code robust enough to tolerate this kind of thing is too complicated for the moment. So, for now, we just don't do it. Note: This UNIT ATTENTION/LUN DATA CHANGED situation only occurs on the MSA2012. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: Remove unnecessary check in scan_threadStephen M. Cameron
cciss: Remove unnecessary check in scan_thread Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: remove sendcmd() as it is no longer used.Stephen M. Cameron
cciss: remove sendcmd() as it is no longer used. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: clean up code in cciss_shutdownStephen M. Cameron
cciss: clean up code in cciss_shutdown. Send the flush cache command down with interrupts still enabled, and do not do DMA from the stack. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: Remove the "withirq" parameter from various functions where possibleStephen M. Cameron
cciss: Remove the "withirq" parameter from various functions where possible Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: Retry driver initiated cmds with unit attention conditionStephen M. Cameron
cciss: Retry driver initiated cmds with unit attention condition Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: Fix problem with remove_from_scan_list on driver unloadStephen M. Cameron
cciss: Fix problem with remove_from_scan_list that on driver unload it doesn't remove the controller from the scan list correctly if the controller is currently being scanned for new devices. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-11-13cciss: Make device attributes staticAlex Chiang
cciss: Make device attributes static Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Alex Chiang <achiang@hp.com> Acked-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-13cciss: Add cciss_allow_hpsa module parameterStephen M. Cameron
Add cciss_allow_hpsa module parameter. This parameter causes the cciss driver to ignore any Smart Array devices known to be supported by the hpsa driver. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-13cciss: Fix multiple calls to pci_release_regionsStephen M. Cameron
Fix multiple calls to pci_release_regions. If cciss_pci_init fails, it already does any necessary call to pci_release_regions, so this does not need to be done again in cciss_init_one in that case. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-04Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-blockLinus Torvalds
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: (41 commits) Revert "Seperate read and write statistics of in_flight requests" cfq-iosched: don't delay async queue if it hasn't dispatched at all block: Topology ioctls cfq-iosched: use assigned slice sync value, not default cfq-iosched: rename 'desktop' sysfs entry to 'low_latency' cfq-iosched: implement slower async initiate and queue ramp up cfq-iosched: delay async IO dispatch, if sync IO was just done cfq-iosched: add a knob for desktop interactiveness Add a tracepoint for block request remapping block: allow large discard requests block: use normal I/O path for discard requests swapfile: avoid NULL pointer dereference in swapon when s_bdev is NULL fs/bio.c: move EXPORT* macros to line after function Add missing blk_trace_remove_sysfs to be in pair with blk_trace_init_sysfs cciss: fix build when !PROC_FS block: Do not clamp max_hw_sectors for stacking devices block: Set max_sectors correctly for stacking devices cciss: cciss_host_attr_groups should be const cciss: Dynamically allocate the drive_info_struct for each logical drive. cciss: Add usage_count attribute to each logical drive in /sys ...
2009-10-01const: constify remaining file_operationsAlexey Dobriyan
[akpm@linux-foundation.org: fix KVM] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-10-01cciss: fix build when !PROC_FSAlexander Beregalov
Fix these build errors when CONFIG_PROC_FS is not set: drivers/block/cciss.c: In function 'cciss_show_raid_level': drivers/block/cciss.c:623: error: 'RAID_UNKNOWN' undeclared (first use in this function) drivers/block/cciss.c:626: error: 'raid_label' undeclared (first use in this function) drivers/block/cciss.c: In function 'cciss_geometry_inquiry': drivers/block/cciss.c:2696: error: 'RAID_UNKNOWN' undeclared (first use in this function) Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: cciss_host_attr_groups should be constJens Axboe
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Dynamically allocate the drive_info_struct for each logical drive.Stephen M. Cameron
cciss: Dynamically allocate the drive_info_struct for each logical drive. This reduces the size of the per-hba ctlr_info structure from 106936 bytes to 8132 bytes. That's on 32-bit systems. On 64-bit systems, the improvement is even bigger. Without this, the ctlr_info struct is so big that the driver won't even load on a 64 bit system if CISS_MAX_LUN was at it's current setting of 1024 logical drives. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Add usage_count attribute to each logical drive in /sysStephen M. Cameron
Add usage_count attribute to each logical drive at /sys/devices/<dev>/ccissX/cXdY/usage_count for controller X, logical drive Y. The usage count is the number of times the device has currently been opened. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Add a "raid_level" attribute to each logical drive in /sysStephen M. Cameron
and change get rid of some magic numbers in raid lavel decoding. Add raid_level attribute to each logical drive at /sys/devices/<dev>/ccissX/cXdY/raid_level for controller X, logical drive Y Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: fix some magic numbers in the raid-level decodingStephen M. Cameron
cciss: fix some magic numbers in the raid-level decoding Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Add lunid attribute to each logical drive in /sysStephen M. Cameron
Add lunid attribute to each logical drive at /sys/devices/<dev>/ccissX/cXdY/lunid for controller X, logical drive Y Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Don't check h->busy_initializing in cciss_open().Stephen M. Cameron
Don't check h->busy_initializing in cciss_open(). Open won't be called before things are ready, but h->busy_initializing won't be unset until after the initial rebuild_lun_table is finished. But, to read the partitions, cciss_open will be called for each logical drive during rebuild_lun_table. If cciss_open checks h->busy_initializing, then the reading of the partition information during the initial rebuild_lun_table will fail, which is especially bad news if it happens to be your boot device. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Preserve all 8 bytes of LUN ID for logical drives.Stephen M. Cameron
Preserve all 8 bytes of the LunID field returned by CCISS_REPORT_LOGICAL instead of only saving 4 bytes. This fixes a bug with logical volume addressing encountered on an MSA2012. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Silence noisy per-disk messages output by cciss_read_capacityStephen M. Cameron
Silence noisy per-disk messages output by cciss_read_capacity Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Fix excessive gendisk freeing bug on driver unload.Stephen M. Cameron
Fix bug that free_hba was calling put_disk for all gendisk[] pointers -- all 1024 of them -- regardless of whether the were used or not (NULL). This bug could cause rmmod to oops if logical drives had been deleted during the driver's lifetime. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Fix usage_count check in rebuild_lun_table when triggered via sysfs.Stephen M. Cameron
When rebuild_lun_table is reached via sysfs, the usage count that is checked prior to messing with c0d0 has different constraints (must be zero) than if rebuild_lun_table is reached via ioctl (must be one.) Fix rebuild_lun_table to take that into account. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Clear all sysfs-exposed data for deleted logical drives.Stephen M. Cameron
When removing a logical drive, clear all the information that is now exposed by sysfs (e.g. vendor, model, serial number.) Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Handle special case for sysfs attributes of the first logical drive.Stephen M. Cameron
For c0dx where x is not 0, we handle deletion and addition simply, but for c0d0, there is the special case that even when there's no disk, the device node exists so that the controller may be accessed. So, for c0d0, we only create the sysfs entries once, when a controller is added, and only remove them once, when a controller is being taken down. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Handle cases when cciss_add_disk fails.Stephen M. Cameron
Handle cases when cciss_add_disk fails. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Handle failure of blk_init_queue gracefully in cciss_add_disk.Stephen M. Cameron
Handle failure of blk_init_queue gracefully in cciss_add_disk. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Rearrange logical drive sysfs code to make the "changing a disk" path ↵Stephen M. Cameron
work. Rearrange logical drive sysfs code to make the "changing a disk" path work. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Dynamically allocate struct device for each logical drive as needed.Stephen M. Cameron
Dynamically allocate struct device for each logical drive as needed instead of allocating the maximum we would ever need at driver init time. Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Remove some unused code in rebuild_lun_table()Stephen M. Cameron
Remove some unused code in rebuild_lun_table() Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Allow triggering of rescan of logical drive topology via sysfs entryAndrew Patterson
Added /sys/bus/pci/devices/<dev>/ccissX/rescan sysfs entry used to kick off a rescan that discovers logical drive topology changes. Signed-off-by: Andrew Patterson <andrew.patterson@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Acked-by: Mike Miller <mike.miller@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Use one scan thread per controller and fix hang during rmmodAndrew Patterson
Replace the use of one scan kthread per controller with one per driver. Use a queue to hold a list of controllers that need to be rescanned with routines to add and remove controllers from the queue. Fix locking and completion handling to prevent a hang during rmmod. Signed-off-by: Andrew Patterson <andrew.patterson@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Acked-by: Mike Miller <mike.miller@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: Remove sysfs entries for logical drives on driver cleanup.Andrew Patterson
Sysfs entries for logical drives need to be removed when a drive is deleted during driver cleanup. Signed-off-by: Andrew Patterson <andrew.patterson@hp.com> Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Acked-by: Mike Miller <mike.miller@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-01cciss: fix schedule_timeout() parametersRandy Dunlap
Change schedule_timeout() parameter to not be specific to HZ=1000. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Acked-by: Mike Miller <mike.miller@hp.com> Cc: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: "Cameron, Steve" <Steve.Cameron@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-09-23seq_file: constify seq_operationsJames Morris
Make all seq_operations structs const, to help mitigate against revectoring user-triggerable function pointers. This is derived from the grsecurity patch, although generated from scratch because it's simpler than extracting the changes from there. Signed-off-by: James Morris <jmorris@namei.org> Acked-by: Serge Hallyn <serue@us.ibm.com> Acked-by: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-22const: make block_device_operations constAlexey Dobriyan
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-15driver model: constify attribute groupsDavid Brownell
Let attribute group vectors be declared "const". We'd like to let most attribute metadata live in read-only sections... this is a start. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-11cciss: memory leak in cciss_init_one()Eric Dumazet
commit 22bece00dc1f28dd3374c55e464c9f02eb642876 (cciss: fix regression firmware not displayed in procfs) added a small memory leak in cciss_init_one() Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-07-12headers: smp_lock.h reduxAlexey Dobriyan
* Remove smp_lock.h from files which don't need it (including some headers!) * Add smp_lock.h to files which do need it * Make smp_lock.h include conditional in hardirq.h It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT This will make hardirq.h inclusion cheaper for every PREEMPT=n config (which includes allmodconfig/allyesconfig, BTW) Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-03cciss: Ignore stale commands after rebootHannes Reinecke
When doing an unexpected shutdown like kexec the cciss firmware might still have some commands in flight, which it is trying to complete. The driver is doing it's best on resetting the HBA, but sadly there's a firmware issue causing the firmware _not_ to abort or drop old commands. So the firmware will send us commands which we haven't accounted for, causing the driver to panic. With this patch we're just ignoring these commands as there is nothing we could be doing with them anyway. Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Mike Miller <mike.miller@hp.com> Signed-off-by: Jens Axboe <axboe@carl.(none)>
2009-06-16block: remove some includings of blktrace_api.hLi Zefan
When porting blktrace to tracepoints, we changed to trace/block.h for trace prober declarations. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-06-09cciss: Remove no longer needed sendcmd reject processing codescameron@beardog.cca.cpqcorp.net
Now that the cciss SCSI error handling routines operate with interrupts enabled, we no longer need to maintain the list of command completions that sendcmd() might inadvertantly scoop up, since now it only runs at driver init time, and there won't be any other commands for it to scoop up. So we can remove that list and the code that adds to it and processes it. Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-06-09cciss: change SCSI error handling routines to work with interrupts enabled.scameron@beardog.cca.cpqcorp.net
Change cciss scsi error handling routines to work with interrupts enabled. Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-06-09cciss: separate error processing and command retrying code in ↵scameron@beardog.cca.cpqcorp.net
sendcmd_withirq_core() Separate the error processing from sendcmd_withirq_core from the code which retries commands. The rationale for this is that the SCSI error handling code can then be made to use sendcmd_withirq_core, but avoid retrying commands. Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-06-09cciss: factor out fix target status processing code from sendcmd functionsscameron@beardog.cca.cpqcorp.net
Factor out code to process target status of completed commands in sendcmd() and sendcmd_withirq_core(), and fix problem that bad target status was ignored in sendcmd_withirq_core. Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>