summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2007-10-13icside: use ide_tune_dma()Bartlomiej Zolnierkiewicz
* Add "good DMA drives" hack for icside to ide-dma.c::ide_find_dma_mode() (in the long-term it should be either removed or generalized for all hosts). * Use ide_tune_dma() in icside.c::icside_dma_check(). This results in the following changes in behavior: - pre-EIDE SWDMA modes are now also respected - drive->autodma is checked instead of hwif->autodma (doesn't really matter as icside sets both to "1") * Make ide-dma.c::__ide_dma_good_drive() static and drop "__" prefix. Cc: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: fix PIO setup and enable autotuneBenjamin Herrenschmidt
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: use ide_tune_dma() (take 2)Bartlomiej Zolnierkiewicz
* Add missing initialization of hwif->autodma and drive->autodma to pmac_ide_setup_dma(). * Use ide_tune_dma() in pmac_ide_dma_check(). While at it: * Fix pmac_ide_dma_check() return value if DMA mode is not programmed (should be "-1" otherwise ide_set_dma() will try to enable DMA). * Remove unnecessary drive->using_dma fiddling (->dma_off_quietly is always called before ide_set_dma() call and ide_set_dma() calls ->ide_dma_on if ->ide_dma_check returns "0"). v2: * No reason to blacklist all ide_floppy devices and the old code was always enabling DMA anyway (without even programming controller/device if the device was ide_floppy). Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: remove pmac_ide_do_setfeature() (take 2)Bartlomiej Zolnierkiewicz
Use ide_config_drive_speed() instead of pmac_ide_do_setfeature() and remove the latter, also ide-iops.c::__ide_wait_stat() could be static again. Since for IDE PMAC host driver IDE_CONTROL_REG is always true, device's ->quirk_list is always zero and ->ide_dma_host_{on,off} are nops than the only changes in behavior are: * if PIO mode is set then ->dma_off_queitly is called to disable DMA * if setting transfer mode fails ide_dump_status() is called to dump status v2: * IDE PMAC controllers allow separate PIO and DMA timings and PPC userland depends on this fact, and calls "hdparm -p" without calling "hdparm -d". Therefore to compensate for DMA being disabled by ide_config_drive_speed() for PIO modes: - add IDE_HFLAG_SET_PIO_MODE_KEEP_DMA flag and set it in PMAC host driver - add handling of the new flag to ide-io.c::do_special() Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: remove nIEN clearing from pmac_ide_do_setfeature()Bartlomiej Zolnierkiewicz
Upper layers are responsible for controlling nIEN so don't clear nIEN after command execution in pmac_ide_do_setfeature(). Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: use __ide_wait_stat()Bartlomiej Zolnierkiewicz
* Use __ide_wait_stat() instead of wait_for_ready() in pmac_ide_do_setfeature(). While at it do following changes to match __ide_wait_stat() call in ide_config_drive_speed(): * Wait WAIT_CMD time (20 sec) instead of 2 sec for device to clear BUSY_STAT. * Check DRQ_STAT bit (shouldn't be set for good device status). Also remove no longer needed wait_for_ready() from ide-iops.c. Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: remove extra good status wait from pmac_ide_do_setfeature()Bartlomiej Zolnierkiewicz
Don't check for good device status before executing the command in pmac_ide_do_setfeature() (ide_config_drive_speed() doesn't do this). It is a job of upper layers to guarantee that the device is ready to accept new command before we get here. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide: add __ide_wait_stat() helperBartlomiej Zolnierkiewicz
* Split off checking of the status register from ide_wait_stat() to __ide_wait_stat() helper. * Use the new helper in ide_config_drive_speed(). The only change in the functionality is that the function now fails if after 20 sec (WAIT_CMD) device is still busy (BUSY_STAT bit is set) while previously instead of failing the function continued with checking for the correct device status (which would give the device additional 10 usec to clear BUSY_STAT bit). * Remove stale comment for ide_config_drive_speed(). * Remove duplicate comment for ide_wait_stat() from <linux/ide.h>. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: remove pmac_ide_{m,u}dma_enable() (take 2)Bartlomiej Zolnierkiewicz
* Fix pmac_ide_dma_check() to use pmac_ide_tune_chipset() and remove no longer necessary pmac_ide_{m,u}dma_enable(). * While at it remove some dead code from pmac_ide_dma_check() (leftovers from conversion to use ide_max_dma_mode()). There should be no functionality changes caused by this patch. v2: * Fix compile by replacing "id" with "drive->id" in pmac_ide_dma_check() (Noticed by Ben). Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: remove control register messing from pmac_ide_dma_check()Bartlomiej Zolnierkiewicz
pmac_ide_do_setfeature() contains matching nIEN setting/clearing so this Device Control register messing in pmac_ide_dma_check() is totally unnecessary. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: fix set_timings_mdma()Bartlomiej Zolnierkiewicz
* Move adjusting of cycle time for devices providing explicit DMA cycle time from pmac_ide_mdma_enable() to set_timings_mdma(). * Remove no longer needed drive_cycle_time argument. * BUG() if unsupported speed argument value is passed (shouldn't happen). * Matching access/recovery timings always exist so remove redundant check. * Make set_timings_mdma() void. * Update pmac_ide_tune_chipset()'s comment. Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: pmac_ide_tune_chipset() fixesBartlomiej Zolnierkiewicz
* Don't check check for pmif == NULL (it should never be NULL if we got here). * Make a local copy of the timings and set the pmif->timings[] only after setting the transfer mode on the device (otherwise SELECT_DRIVE() call in pmac_ide_do_setfeature() will program new timings before the transfer mode is set on the device - this was pointed out by Sergei). This change makes pmac_ide_tune_chipset() behavior match this of pmac_ide_{m,u}dma_enable(). Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide-pmac: don't check kauai_lookup_timing() return valueBartlomiej Zolnierkiewicz
kauai_lookup_timing() should always return non-zero return value: * BUG() in kauai_lookup_timing() if the timing info cannot be found. * Remove code checking for zero return value from all callers. Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide: unexport ide_acpi_set_stateAdrian Bunk
This patch removes the unused EXPORT_SYMBOL_GPL(ide_acpi_set_state) Signed-off-by: Adrian Bunk <bunk@kernel.org> Cc: Shaohua Li <shaohua.li@intel.com> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13ide_platform: set hwif->chipsetBartlomiej Zolnierkiewicz
We need to set hwif->chipset or IDE PCI host drivers may try to claim our ide_hwifs[] slot. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2007-10-13Merge branch 'master' of ↵David Woodhouse
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
2007-10-13Merge Linux 2.6.23David Woodhouse
2007-10-13[MTD] [NAND] Blackfin on-chip NAND Flash Controller driverBryan Wu
This is the driver for latest Blackfin on-chip nand flash controller - use nand_chip and mtd_info common nand driver interface - provide both PIO and dma operation - compiled with ezkit bf548 configuration - use hardware 1-bit ECC - tested with YAFFS2 and can mount YAFFS2 filesystem as rootfs ChangeLog from try#1 - use hweight32() instead of count_bits() - replace bf54x with bf5xx and BF54X with BF5XX - compare against plat->page_size in 2 cases when enable hardware ECC ChangeLog from try#2 - passed nand_test suites - use cpu_relax() instead of busy wait loop - some coding style issue pointed out by Andrew Signed-off-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-10-13[MTD] [NOR] fix ctrl-alt-del can't reboot for intel flash bugKevin Hao
When we press ctrl-alt-del,kernel_restart_prepare will invoke cfi_intelext_reboot which will set flash to read array mode, but later when device_shutdown is invoked which may put current work queue to sleep and other process may be scheduled to running and programming flash in not FL_READY mode again. So we can't boot up if this flash is used for bootloader. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-10-13[MTD] [NAND] Fix compiler warning in Alauda driverakpm@linux-foundation.org
drivers/mtd/nand/alauda.c: In function 'alauda_bounce_read': drivers/mtd/nand/alauda.c:412: warning: comparison of distinct pointer types lacks a cast Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-10-13[MTD] [OneNAND] Fix typo related with recent commitKyungmin Park
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-10-13KVM: Skip pio instruction when it is emulated, not executedAvi Kivity
If we defer updating rip until pio instructions are executed, we have a problem with reset: a pio reset updates rip, and when the instruction completes we skip the emulated instruction, pointing rip somewhere completely unrelated. Fix by updating rip when we see decode the instruction, not after emulation. Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: x86 emulator: popfNitin A Kamble
Implement emulation of instruction: popf opcode: 0x9d Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: x86 emulator: fix src, dst value initializationNitin A Kamble
Some operand fetches are less than the machine word size and can result in stale bits if used together with operands of different sizes. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: x86 emulator: jmp absNitin A Kamble
Implement emulation of instruction: jump absolute r/m opcode: 0xff /4 Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: x86 emulator: leaNitin A Kamble
Implement emulation of instruction lea r16/r32, m opcode: 0x8d: Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: X86 emulator: jump conditional shortNitin A Kamble
Implement emulation of more jump conditional instructions jcc shortrel opcodes: 0x70 - 0x7f Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: x86 emulator: imlpement jump conditional relativeNitin A Kamble
Implement emulation of instruction: jump conditional rel opcodes: 0x0f 0x80 - 0x0f 0x8f Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: x86 emulator: sort opcodes into ascending orderNitin A Kamble
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Improve emulation failure reportingAvi Kivity
Report failed opcodes from all locations. Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: x86 emulator: pushfNitin A Kamble
Implement emulation of instruction pushf opcode: 0x9c Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: x86 emulator: call nearNitin A Kamble
Implement emulation of instruction opcode: 0xe8 call (near) Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: x86 emulator: push imm8Nitin A Kamble
Implement the instruction push imm8 opcode: 0x6a Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: VMX: Fix exit qualification width on i386He, Qing
According to Intel Software Developer's Manual, Vol. 3B, Appendix H.4.2, exit qualification should be of natural width. However, current code uses u64 as the data type for this register, which occasionally introduces invalid value to VMExit handling logics. This patch fixes this bug. I have tested Windows and Linux guest on i386 host, and they can boot successfully with this patch. Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Move main vcpu loop into subarch independent codeAvi Kivity
This simplifies adding new code as well as reducing overall code size. Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: VMX: Move vm entry failure handling to the exit handlerAvi Kivity
This will help moving the main loop to subarch independent code. Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: MMU: Don't do GFP_NOWAIT allocationsAvi Kivity
Before preempt notifiers, kvm needed to allocate memory with GFP_NOWAIT so as not to have to enable preemption and take a heavyweight exit. On oom, we'd fall back to a GFP_KERNEL allocation. With preemption notifiers, we can do a GFP_KERNEL allocation, and perform the heavyweight exit only if the kernel decides to put us to sleep. Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Rename kvm_arch_ops to kvm_x86_opsChristian Ehrhardt
This patch just renames the current (misnamed) _arch namings to _x86 to ensure better readability when a real arch layer takes place. Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Simplify memory allocationLaurent Vivier
The mutex->splinlock convertion alllows us to make some code simplifications. As we can keep the lock longer, we don't have to release it and then have to check if the environment has not been modified before re-taking it. We can remove kvm->busy and kvm->memory_config_version. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Hoist SVM's get_cs_db_l_bits into core code.Rusty Russell
SVM gets the DB and L bits for the cs by decoding the segment. This is in fact the completely generic code, so hoist it for kvm-lite to use. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Keep control regs in syncRusty Russell
We don't update the vcpu control registers in various places. We should do so. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Clean up unloved invlpg emulationRusty Russell
invlpg shouldn't fetch the "src" address, since it may not be valid, however SVM's "solution" which neuters emulation of all group 7 instruction is horrible and breaks kvm-lite. The simplest fix is to put a special check in for invlpg. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Remove the unused invlpg member of struct kvm_arch_ops.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Set the ET flag in CR0 after initializing FXAmit Shah
This was missed when moving stuff around in fbc4f2e Fixes Solaris guests and bug #1773613 Signed-off-by: Amit Shah <amit.shah@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: enable in-kernel APIC INIT/SIPI handlingHe, Qing
This patch enables INIT/SIPI handling using in-kernel APIC by introducing a ->mp_state field to emulate the SMP state transition. [avi: remove smp_processor_id() warning] Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Xin Li <xin.b.li@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: round robin for APIC lowest priority delivery modeHe, Qing
Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: deliver PIC interrupt only to vcpu0Qing He
This patch changes the PIC interrupts delivery. Now it is only delivered to vcpu0 when either condition is met (on vcpu0): 1. local APIC is hardware disabled 2. LVT0 is unmasked and configured to delivery mode ExtInt It fixes the 2x faster wall clock on x86_64 and SMP i386 Linux guests Signed-off-by: Eddie (Yaozu) Dong <eddie.dong@intel.com> Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: disable tpr/cr8 sync when in-kernel APIC is usedHe, Qing
Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Migrate lapic hrtimer when vcpu moves to another cpuEddie Dong
This reduces overhead by accessing cachelines from the wrong node, as well as simplifying locking. [Qing: fix for inactive or expired one-shot timer] Signed-off-by: Yaozu (Eddie) Dong <Eddie.Dong@intel.com> Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
2007-10-13KVM: Keep track of missed timer irq injectionsEddie Dong
APIC timer IRQ is set every time when a certain period expires at host time, but the guest may be descheduled at that time and thus the irq be overwritten by later fire. This patch keep track of firing irq numbers and decrease only when the IRQ is injected to guest or buffered in APIC. Signed-off-by: Yaozu (Eddie) Dong <Eddie.Dong@intel.com> Signed-off-by: Qing He <qing.he@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>