aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2007-10-12[SCSI] kmalloc + memset conversion to kzallocMariusz Kozlowski1-2/+1
In NCR_D700, a4000t, aic7xxx_old, bvme6000, dpt_i2o, gdth, lpfc, megaraid, mvme16x osst, pluto, qla2xxx, zorro7xx Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-04[SCSI] megaraid_old: fix READ_CAPACITYFUJITA Tomonori1-0/+8
The bulk transfer mode got eleminated by 3f6270ef76f2ce5c134615a470685d6c2a66c07e. Unfortunately, this mode is required for READ_CAPACITY commands on certain cards, so put it back again. This fixes a boot failure regression reported by Burton Windle. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-31[SCSI] megaraid_old: convert to use the data buffer accessorsFUJITA Tomonori1-106/+25
- remove the unnecessary map_single path. - convert to use the new accessors for the sg lists and the parameters. Jens Axboe <jens.axboe@oracle.com> did the for_each_sg cleanup. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Sumant Patro <sumant.patro@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-26[SCSI] megaraid: fix compiler warningsMartin Bligh1-5/+5
The user ioctl mailbox can only support a 32 bit address for the commands structure. This is fine, since the area it's pointing to is allocated with pci_alloc_consistent(), so it should be physically < 4GB. Thus kill the ptr to u32 conversion warnings on 64 bit. Signed-off-by: Martin J. Bligh <mbligh@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: "Patro, Sumant" <Sumant.Patro@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-08[SCSI] megaraid: replace yield() with cond_resched()Amol Lad1-1/+2
For this driver cond_resched() seems to be a better alternative Signed-off-by: Amol Lad <amol@verismonetworks.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-08[SCSI] megaraid: fix warnings when CONFIG_PROC_FS=nwalter harms1-6/+11
drivers/scsi/megaraid.c: In function 'megaraid_probe_one': drivers/scsi/megaraid.c:4893: warning: implicit declaration of function 'mega_create_proc_entry' drivers/scsi/megaraid.c: In function 'megaraid_remove_one': drivers/scsi/megaraid.c:4968: warning: unused variable 'buf' Fix by adding #defines Signed-off-by: walter harms <wharms@bfs.de> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-02PCI: Convert to alloc_pci_dev()Michael Ellerman1-1/+1
Convert code that allocs a struct pci_dev to use alloc_pci_dev(). Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-02-16[SCSI] megaraid: pci_module_init to pci_register_driverRichard Knutsson1-1/+1
Convert pci_module_init() to pci_register_driver(). Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se> Acked-by: "Patro, Sumant" <Sumant.Patro@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-02-12[PATCH] mark struct file_operations const 6Arjan van de Ven1-1/+1
Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2006-12-05[SCSI] megaraid: fix MMIO castsJeff Garzik1-5/+8
megaraid's MMIO RD*/WR* macros directly call readl() and writel() with an 'unsigned long' argument. This throws a warning, but is otherwise OK because the 'unsigned long' is really the result of ioremap(). This setup is also OK because the variable can hold an ioremap cookie /or/ a PCI I/O port (PIO). However, to fix the warning thrown when readl() and writel() are passed an unsigned long cookie, I introduce 'void __iomem *mmio_base', holding the same value as 'base'. This will silence the warnings, and also cause an oops whenever these MMIO-only functions are ever accidentally passed an I/O address. Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells1-4/+2
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-09-23[SCSI] megaraid: Make megaraid_ioctl() check copy_to_user() return valueJesper Juhl1-2/+3
Check copy_to_user() return value in drivers/scsi/megaraid.c::megadev_ioctl() This gets rid of this little warning: drivers/scsi/megaraid.c:3661: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: "Ju, Seokmann" <Seokmann.Ju@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-08-06[SCSI] Improve inquiry printingMatthew Wilcox1-3/+1
- Replace scsi_device_types array API with scsi_device_type function API. Gets rid of a lot of common code, as well as being easier to use. - Add the new device types in SPC4 r05a, and rename some of the older ones. - Reformat the printing of inquiry data; now fits on one line and includes PQ. I think I've addressed all the feedback from the previous versions. My current test box prints: scsi 2:0:1:0: Direct access HP 18.2G ATLAS10K3_18_SCA HP05 PQ: 0 ANSI: 2 Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-07-02[PATCH] irq-flags: scsi: Use the new IRQF_ constantsThomas Gleixner1-1/+1
Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: "David S. Miller" <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: James Bottomley <James.Bottomley@steeleye.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-23[PATCH] More BUG_ON conversionEric Sesterhenn1-1/+1
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: James Bottomley <James.Bottomley@steeleye.com> Acked-by: "Salyzyn, Mark" <mark_salyzyn@adaptec.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-10Merge ../linux-2.6James Bottomley1-1/+0
2006-06-06[SCSI] fix up request buffer reference in various scsi driversChristoph Hellwig1-2/+2
Various scsi drivers use scsi_cmnd.buffer and scsi_cmnd.bufflen in their queuecommand functions. Those fields are internal storage for the midlayer only and are used to restore the original payload after request_buffer and request_bufflen have been overwritten for EH. Using the buffer and bufflen fields means they do very broken things in error handling. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-04-19[SCSI] megaraid: unused variableAndrew Morton1-1/+0
drivers/scsi/megaraid.c: In function `mega_internal_command': drivers/scsi/megaraid.c:4474: warning: unused variable `flags' Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-03-28[PATCH] Replace 0xff.. with correct DMA_xBIT_MASKMatthias Gehre1-3/+4
Replace all occurences of 0xff.. in calls to function pci_set_dma_mask() and pci_set_consistant_dma_mask() with the corresponding DMA_xBIT_MASK from linux/dma-mapping.h. Signed-off-by: Matthias Gehre <M.Gehre@gmx.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-12[SCSI] megaraid_legacy: kobject_register failureJu, Seokmann1-1/+1
Attached patch fixes problem that cause kobject_register failure during loading. Kobject_register would fail when there are more than 1 module with same module name. This patch will change module name of megaraid_legacy from 'megaraid' to 'megaraid_legacy'. Signed-Off-by: Seokmann Ju <seokmann.ju@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-01-12[SCSI] turn most scsi semaphores into mutexesArjan van de Ven1-3/+3
the scsi layer is using semaphores in a mutex way, this patch converts these into using mutexes instead Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-15Merge by hand (conflicts in scsi_lib.c)James Bottomley1-1/+1
This merge is pretty extensive. The conflict is over the new req->retries parameter, so I had to change the prototype to scsi_setup_blk_pc_cmnd() and the usage in sd, sr and st. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-13[SCSI] megaraid_legacy: removed PCI ID overlap from the driv erJu, Seokmann1-18/+9
This patch fixes - PCI ID overlap issue - node name changed to 'megaraid_legacy' I hope this patch addresses concerns brought by Daniel Drake. Signed-off by: Seokmann Ju <seokmann.ju@enginio.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-12-08[SCSI] Fix incorrect pointer in megaraid.c MODE_SENSE emulationMark Lord1-1/+1
The SCSI megaraid drive goes to great effort to kmap the scatterlist buffer (if used), but then uses the wrong pointer when copying to it afterward. Signed-off-by: Mark Lord <lkml@rtr.ca> Acked by: Ju, Seokmann <Seokmann.Ju@engenio.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-11-29[PATCH] fix megaraid.c lockingChristoph Hellwig1-15/+14
This fixes locking in megaraid.c, namely: (1) make sure megaraid_queue release the adapter lock by changing the code to have a single return (2) remove the errornous scsi_assign_lock call Testing by Burton Windle. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Burton Windle <bwindle@fint.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-09[SCSI] remove Scsi_Pointer typedefChristoph Hellwig1-1/+1
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-11-06[SCSI] megaraid (legacy): remove scsi_assign_lock usageChristoph Hellwig1-19/+13
just take the adapter lock in megaraid_queue. Additional benefit is that we can get rid of the awkward conditional locking in mega_internal_command. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-10-03[SCSI] Legacy MegaRAID: Fix READ CAPACITYJames Bottomley1-20/+50
Some Legacy megaraid cards can't actually cope with the scatter/gather version of the READ CAPACITY command (which is what we now send them since altering all SCSI internal I/O to go via the block layer). Fix this (and a few other broken megaraid driver assumptions) by sending the non-sg version of the command if the sg list only has a single element. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-07-26Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-for-linus-2.6Linus Torvalds1-39/+8
2005-06-27[PATCH] PCI: make drivers use the pci shutdown callback instead of the driver core callback.Greg Kroah-Hartman1-5/+3
Now we can change the pci core to always set this pointer, as pci drivers should use it, not the driver core callback. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-06-26[SCSI] remove scsi_cmnd->stateChristoph Hellwig1-22/+4
We never look at it except for the old megaraid driver that abuses it for sending internal commands. That usage can be fixed easily because those internal commands are single-threaded by a mutex and we can easily use a completion there. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-26[SCSI] megaraid: fix compilation after eh locking changesJames Bottomley1-17/+4
From: Christoph Hellwig <hch@lst.de> Patch fixed up and Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-06-21[PATCH] megaraid build fixbobl1-1/+1
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-17[SCSI] allow sleeping in ->eh_device_reset_handler()Jeff Garzik1-1/+13
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+5122
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!