David S. Miller [Fri, 12 Oct 2007 09:59:40 +0000 (02:59 -0700)]
[SPARC64]: Make IVEC pointers 64-bit.
Currently we chain IVEC entries using 32-bit "pointers"
because we know that the ivector_table is in the main
kernel image, thus below 4GB.
This uses proper 64-bit pointers instead.
Whilst this bloats up the kernel image size, this sets
the infrastructure necessary to significantly shrink the
kernel size by using physical addresses and dynamically
allocating the ivector table.
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 11 Oct 2007 10:16:13 +0000 (03:16 -0700)]
[SPARC64]: Consolidate MSI support code.
This also makes us use the MSI queues correctly.
Each MSI queue is serviced by a normal sun4u/sun4v INO interrupt
handler. This handler runs the MSI queue and dispatches the
virtual interrupts indicated by arriving MSIs in that MSI queue.
All of the common logic is placed in pci_msi.c, with callbacks to
handle the PCI controller specific aspects of the operations.
This common infrastructure will make it much easier to add MSG
support.
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 10 Oct 2007 03:56:31 +0000 (20:56 -0700)]
[SPARC64]: Fix bugs in SYSV IPC handling in 64-bit processes.
Thanks to Tom Callaway for the excellent bug report and
test case.
sys_ipc() has several problems, most to due with semaphore
call handling:
1) 'err' return should be a 'long'
2) "union semun" is passed in a register on 64-bit compared
to 32-bit which provides it on the stack and therefore
by reference
3) Second and third arguments to SEMCTL are swapped compared
to 32-bit.
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Rothwell [Thu, 27 Sep 2007 20:21:43 +0000 (13:21 -0700)]
[SPARC/64]: Prepare to remove of_platform_driver name.
The name field of of_platform_driver is just copied into the
included device_driver. By not overriding an already initialised
device_driver name, we can convert the drivers over time to stop using
the of_platform_driver name.
Also we were not copying the owner field from of_platform_driver, so do
the same with it.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Robert Reif [Thu, 27 Sep 2007 20:15:31 +0000 (13:15 -0700)]
[SPARC32]: Add irqflags.h to sparc32 and use it from generic code.
Added asm-sparc/irqflags.h and moved irq related code from system.h to it.
Renamed local_irq functions to raw_local_irq in irq.c.
Modified system.h to include linux/irqflags.h which includes asm/irqflags.h.
Added TRACE_IRQFLAGS_SUPPORT to Kconfig.debug.
This is the first step in adding IRQ-flags state tracing as outlined in
Documentation/irqflags-tracing.txt. These changes should be harmless
because they just move things around and rename them.
The next step is making the lowlevel entry code modifications which
to be honest are beyond my capabilities at this point.
Boot tested on an ss20 running an SMP kernel.
Signed-off-by: Robert Reif <reif@earthlink.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Sam Ravnborg [Tue, 18 Sep 2007 02:02:30 +0000 (19:02 -0700)]
[SPARC]: beautify vmlinux.lds
Make vmlinux.lds almost readable.
When going through the file fixed the following:
- Use PAGE_SIZE as replacement for hardcoded 4096
- Moves label definitions inside {} to avoid ld alignment
that may be added between label and section
Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 31 Aug 2007 05:33:25 +0000 (22:33 -0700)]
[SPARC64]: Enable MSI on sun4u Fire PCI-E controllers.
The support code is identical to the hypervisor sun4v stuff,
just replacing the hypervisor calls with register reads and
writes in the Fire controller.
Signed-off-by: David S. Miller <davem@davemloft.net>
Krzysztof Helt [Mon, 6 Aug 2007 01:04:18 +0000 (18:04 -0700)]
[CG6]: code cleanup
This patch:
- corrects coding style errors pointed by Lindent and checkpatch
- replaces space chunks with tabs
- removes one redundant include
- improves indentations of defines
- removes from comments leftovers from skeletonfb
- adds __devinit attribute to two init functions
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Oleg Ryjkov [Sat, 13 Oct 2007 21:56:33 +0000 (23:56 +0200)]
i2c-nforce2: Abort the transaction on error
This patch is to add an abort function that will bring back the MCP51/55
controller if it was blocked by a block-read operation, in particular.
(When a slave sends a wrong byte count on a byte read, the host gets
locked up). I've only tested it on an MCP51 and MCP55. However, I'm
almost certain it will also work on MCP65, I just did not have the board
to test it on. Thus for now the abort function will only be called
if an MCP51/55 was detected.
Signed-off-by: Oleg Ryjkov <olegr@olegr.ca> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Oleg Ryjkov [Sat, 13 Oct 2007 21:56:33 +0000 (23:56 +0200)]
i2c-nforce2: Move status checking to a separate function
This is the first part of the patch that adds a function to reset the
nvidia MCP51/55 i2c controller, if something bad happens to it (e.g.
a slave sends a wrong byte count during a block transaction).
This patch just adds nforce2_check_status function. It was originally
written by Hans-Frieder Vogt.
The reason that I'm the one sending it is:
- I relied on it for the second part of the patch,
- It makes the driver code cleaner/better.
Signed-off-by: Oleg Ryjkov <olegr@olegr.ca> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Chris David [Sat, 13 Oct 2007 21:56:33 +0000 (23:56 +0200)]
i2c-au1550: Fix a misused register problem
Fix a "mis-used register" problem on the AMD MIPS Alchemy au1550
I2C interface.
In summary, the programmable serial controller seems to hang the kernel
when I send a single 'address' byte on the I2C bus. The patch
essentially uses the PSC_SMBSTAT register's TE (transmit FIFO empty)
bit to check when the transmit FIFO is empty, instead of using the
PSC_SMBEVNT register's TU (transmit underflow) bit. Using the TE bit
fixed the hang problem.
Signed-off-by: Chris David <cd@chrisdavid.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
David Brownell [Sat, 13 Oct 2007 21:56:33 +0000 (23:56 +0200)]
i2c: Rename the PEC functionality bit
Rename I2C_FUNC_SMBUS_HWPEC_CALC as I2C_FUNC_SMBUS_PEC, and list that
functionality as always available through the software implementation.
Update documentation accordingly (and list similar requirements).
The way it's currently packaged doesn't present the capability in a
useful way.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
David Brownell [Sat, 13 Oct 2007 21:56:32 +0000 (23:56 +0200)]
i2c: Move i2c-dev interfaces to i2c-dev.h
Move the i2c-dev support into <linux/i2c-dev.h> where it should always
have lived. Now <linux/i2c.h> no longer holds stuff related to the
optional userspace /dev/i2c-X interface. Improve the descriptions
for these ioctl requests.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
David Brownell [Sat, 13 Oct 2007 21:56:31 +0000 (23:56 +0200)]
i2c-dev: Reject I2C_M_RECV_LEN
The I2C_M_RECV_LEN calling convention for i2c_mesg.flags involves
playing games with reported buffer lengths. (They start out less
than their actual size, and the length is then modified to reflect
how many bytes were delivered ... which one hopes is less than the
presumed actual size.) Refuse to play such error prone games across
the boundary between userspace and kernel.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Francis Moreau [Sat, 13 Oct 2007 21:56:31 +0000 (23:56 +0200)]
i2c-bfin-twi: Remove useless twi_lock mutex
Remove this unneeded mutex. Indeed it was used to serialize access to
the hardware, but this is already done by the i2c-core layer, see
'bus_lock' mutex used by i2c_transfer().
Signed-off-by: Francis Moreau <francis.moro@gmail.com> Acked-by: Bryan Wu <bryan.wu@analog.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Vladimir Barinov [Sat, 13 Oct 2007 21:56:30 +0000 (23:56 +0200)]
i2c: Add DaVinci I2C controller support
Signed-off-by: Vladimir Barinov <vbarinov@ru.mvista.com> Acked-by: Trilok Soni <soni.trilok@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
David Brownell [Sat, 13 Oct 2007 21:56:30 +0000 (23:56 +0200)]
i2c/tps65010: New-style driver updates, part 1
Prepare to convert tps65010 driver to "new style" driver by changing
how it references the i2c_client. This lets the eventual patch with
driver and platform updates be smaller.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
David Brownell [Sat, 13 Oct 2007 21:56:29 +0000 (23:56 +0200)]
i2c: New-style devices can support driver model wakeup flags
We need to be able to flag I2C devices, such as RTCs, which can issue wake
events (usually through IRQ lines). This adds an i2c_board_info.flags bit,
and uses it to initialize the i2c device node. (And shrinks a few lines
that were overly long.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Jean Delvare [Sat, 13 Oct 2007 21:56:29 +0000 (23:56 +0200)]
i2c: Kill struct i2c_device_id
I2C devices do not have any form of ID as PCI or USB devices have.
No driver uses "MODULE_DEVICE_TABLE(i2c, ...)" because it doesn't
make sense. So we can get rid of struct i2c_device_id and the
associated support code.
Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Greg KH <greg@kroah.com>
Roland Dreier [Sat, 13 Oct 2007 21:10:50 +0000 (14:10 -0700)]
mlx4_core: Fix infinite loop on device initialization
Commit 3d73c288 ("mlx4_core: Fix section mismatches") introduced a
stupid bug in device init: when some of mlx4_init_one() was split off
into __mlx4_init_one(), the call from the main mlx4_init_one()
function was back to mlx4_init_one() rather than to __mlx4_init_one(),
which leads to an obvious infinite loop if the function is every
called.
Dave Kleikamp [Sat, 13 Oct 2007 17:58:00 +0000 (12:58 -0500)]
JFS: Bio cleanup: Replace missing return statements
commit e30408b2a99cb7b8bf529c7dc2328a19d71894cf ("JFS: fix bio-related
build breakage") removed some "return 0;" statements, rather than
changing them to null returns.
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: Randy Dunlap <randy.dunlap@oracle.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sat, 13 Oct 2007 17:02:11 +0000 (10:02 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (106 commits)
KVM: Replace enum by #define
KVM: Skip pio instruction when it is emulated, not executed
KVM: x86 emulator: popf
KVM: x86 emulator: fix src, dst value initialization
KVM: x86 emulator: jmp abs
KVM: x86 emulator: lea
KVM: X86 emulator: jump conditional short
KVM: x86 emulator: imlpement jump conditional relative
KVM: x86 emulator: sort opcodes into ascending order
KVM: Improve emulation failure reporting
KVM: x86 emulator: pushf
KVM: x86 emulator: call near
KVM: x86 emulator: push imm8
KVM: VMX: Fix exit qualification width on i386
KVM: Move main vcpu loop into subarch independent code
KVM: VMX: Move vm entry failure handling to the exit handler
KVM: MMU: Don't do GFP_NOWAIT allocations
KVM: Rename kvm_arch_ops to kvm_x86_ops
KVM: Simplify memory allocation
KVM: Hoist SVM's get_cs_db_l_bits into core code.
...
Dave Jones [Sat, 13 Oct 2007 01:10:53 +0000 (21:10 -0400)]
Delete filenames in comments.
Since the x86 merge, lots of files that referenced their own filenames
are no longer correct. Rather than keep them up to date, just delete
them, as they add no real value.
Additionally:
- fix up comment formatting in scx200_32.c
- Remove a credit from myself in setup_64.c from a time when we had no SCM
- remove longwinded history from tsc_32.c which can be figured out from
git.
Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Sat, 13 Oct 2007 07:40:24 +0000 (08:40 +0100)]
fix sparc32 breakage (result of vmlinux.lds.S bug)
In commit 4665079cbb2a3e17de82f2ab2940b9f97f37d65e ("[NETNS]: Move some
code into __init section when CONFIG_NET_NS=n") we got a new section -
.exit.text.refok (more of 'let's tell modpost that some bogus calls are
not bogus', a-la text.init.refok).
Unfortunately, the commit in question forgot to add it to TEXT_TEXT,
with rather amusing results.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Al Viro [Sat, 13 Oct 2007 07:16:04 +0000 (08:16 +0100)]
minimal build fixes for uml (fallout from x86 merge)
a) include/asm-um/arch can't just point to include/asm-$(SUBARCH) now
b) arch/{i386,x86_64}/crypto are merged now
c) subarch-obj needed changes
d) cpufeature_64.h should pull "cpufeature_32.h", not <asm/cpufeature_32.h>
since it can be included from asm-um/cpufeature.h
e) in case of uml-i386 we need CONFIG_X86_32 for make and gcc, but not
for Kconfig
f) sysctl.c shouldn't do vdso_enabled for uml-i386 (actually, that one
should be registered from corresponding arch/*/kernel/*, with ifdef
going away; that's a separate patch, though).
With that and with Stephen's patch ("[PATCH net-2.6] uml: hard_header fix")
we have uml allmodconfig building both on i386 and amd64.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Randy Dunlap [Sat, 13 Oct 2007 04:17:49 +0000 (21:17 -0700)]
net core: fix kernel-doc for new function parameters
Fix networking code kernel-doc for newly added parameters.
Warning(linux-2.6.23-git2//net/core/sock.c:879): No description found for parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:570): No description found for parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:594): No description found for parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:617): No description found for parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:641): No description found for parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:667): No description found for parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:722): No description found for parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:959): No description found for parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:1195): No description found for parameter 'dev'
Warning(linux-2.6.23-git2//net/core/dev.c:2105): No description found for parameter 'n'
Warning(linux-2.6.23-git2//net/core/dev.c:3272): No description found for parameter 'net'
Warning(linux-2.6.23-git2//net/core/dev.c:3445): No description found for parameter 'net'
Warning(linux-2.6.23-git2//include/linux/netdevice.h:1301): No description found for parameter 'cpu'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh64-2.6:
sh64: mach-cayman: Build fixes.
sh64: Symbol export fixups.
sh64: linker script tidying and alignment fixups.
sh64: Set KBUILD_IMAGE to make the rpm target happy.
sh64: Kill off obsolete linux/blk.h reference.
sh64: cleanup struct irqaction initializers.
sh64: Kill off dead gdb stub symbol.
sh64: alphanumeric display only on Cayman.
sh64: Add defconfigs for mach-sim and mach-harp.
sh64: update cayman defconfig.
sh64: Tidy up Kconfig dependencies.
sh64: Move consistent DMA routines to arch/sh64/mm/.
sh64: Some symbol exports and build fixes.
sh64: mach-sim: Build fixes.
sh64: mach-harp: Build fixes.
sh64: Kill off duplicate frame pointer option.
sh64: Kill off dead ROM-RAM and generic boards.
sh64: Tidy up includes for Cayman board.
sh64: Move *_p() I/O routine variants to io.h.
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (124 commits)
sh: allow building for both r2d boards in same binary.
sh: fix r2d board detection
sh: Discard .exit.text/.exit.data at runtime.
sh: Fix up some section alignments in linker script.
sh: Fix SH-4 DMAC CHCR masking.
sh: Rip out left-over nommu cond syscall cruft.
sh: Make kgdb i-cache flushing less inept.
sh: kgdb section mismatches and tidying.
sh: cleanup struct irqaction initializers.
sh: early_printk tidying.
video: pvr2fb: Add TV (RGB) support to Dreamcast PVR driver.
sh: Conditionalize gUSA support.
sh: Follow gUSA preempt changes in __switch_to().
sh: Tidy up gUSA preempt handling.
sh: __copy_user() optimizations for small copies.
sh: clkfwk: Support multi-level clock propagation.
sh: Fix URAM start address on SH7785.
sh: Use boot_cpu_data for CPU probe.
sh: Support extended mode TLB on SH-X3.
sh: Bump MAX_ACTIVE_REGIONS for SH7785.
...
linux/drivers/ssb/main.c: In function 'ssb_ssb_read16':
linux/drivers/ssb/main.c:518: error: implicit declaration of function 'readw'
linux/drivers/ssb/main.c: In function 'ssb_ssb_read32':
linux/drivers/ssb/main.c:526: error: implicit declaration of function 'readl'
linux/drivers/ssb/main.c: In function 'ssb_ssb_write16':
linux/drivers/ssb/main.c:534: error: implicit declaration of function 'writew'
linux/drivers/ssb/main.c: In function 'ssb_ssb_write32':
linux/drivers/ssb/main.c:542: error: implicit declaration of function 'writel'
linux/drivers/net/wireless/b43/pio.h: In function 'b43_pio_write':
linux/drivers/net/wireless/b43/pio.h:89: error: implicit declaration of function 'mmiowb'
linux/drivers/net/wireless/b43/phy.c: In function 'b43_phy_write':
linux/drivers/net/wireless/b43/phy.c:301: error: implicit declaration of function 'mmiowb'
linuxdrivers/net/wireless/b43/sysfs.c: In function 'b43_attr_interfmode_store':
linuxdrivers/net/wireless/b43/sysfs.c:147: error: implicit declaration of function 'mmiowb'
emc_endio returns void:
linux/drivers/md/dm-emc.c: In function 'emc_endio':
linux/drivers/md/dm-emc.c:58: warning: 'return' with a value, in function returning void
m68k: Atari input drivers cleanup:
- memleak on failed init/register of input devices fixed
- correct keycodes table (Atari keycodes are almost, but not entirely, equal
to Linux keycodes).
init_dma_ali15x3() guarantees that hwif->dma_base will never be set for
m5229_revision < 0x20 so remove redundant m5229_revision >= 0x20 check from
init_hwif_common_ali15x3().
Set hwif->atapi_dma/{ultra,mwdma}_mask and drive->autodma after checking that
->dma_base exists. If ->dma_base is not set (== PCI BAR4 cannot be reserved)
then DMA hooks shouldn't be initialized or bad things will happen.
OTOH hwif->set_{pio,dma}_mode hooks should be set even if hwif->dma_base == 0.
Set hwif->ide_dma_{check,on} and hwif->autodma to 1 after checking that
->dma_base exists. If ->dma_base is not set (== PCI BAR4 cannot be reserved)
then DMA hooks shouldn't be initialized or bad things will happen.
Devices which don't set word 93 validation bit should be now handled by
ide-iops.c::ivb_list[] and for debugging purposes cable detection can be
completely overriden with "idex=ata66" parameter.
ide: move ide_config_drive_speed() calls to upper layers (take 2)
* Convert {ide_hwif_t,ide_pci_device_t}->host_flag to be u16.
* Add IDE_HFLAG_POST_SET_MODE host flag to indicate the need to program
the host for the transfer mode after programming the device. Set it
in au1xxx-ide, amd74xx, cs5530, cs5535, pdc202xx_new, sc1200, pmac
and via82cxxx host drivers.
* Add IDE_HFLAG_NO_SET_MODE host flag to indicate the need to completely
skip programming of host/device for the transfer mode ("smart" hosts).
Set it in it821x host driver and check it in ide_tune_dma().
* Add ide_set_pio_mode()/ide_set_dma_mode() helpers and convert all
direct ->set_pio_mode/->speedproc users to use these helpers.
* Move ide_config_drive_speed() calls from ->set_pio_mode/->speedproc
methods to callers.
* Rename ->speedproc method to ->set_dma_mode, make it void and update
all implementations accordingly.
* Update ide_set_xfer_rate() comments.
* Unexport ide_config_drive_speed().
v2:
* Fix issues noticed by Sergei:
- export ide_set_dma_mode() instead of moving ->set_pio_mode abuse wrt
to setting DMA modes from sc1200_set_pio_mode() to do_special()
- check IDE_HFLAG_NO_SET_MODE in ide_tune_dma()
- check for (hwif->set_pio_mode) == NULL in ide_set_pio_mode()
- check for (hwif->set_dma_mode) == NULL in ide_set_dma_mode()
- return -1 from ide_set_{pio,dma}_mode() if ->set_{pio,dma}_mode == NULL
- don't set ->set_{pio,dma}_mode on it821x in "smart" mode
- fix build problem in pmac.c
- minor fixes in au1xxx-ide.c/cs5530.c/siimage.c
- improve patch description
Changes in behavior caused by this patch:
- HDIO_SET_PIO_MODE ioctl would now return -ENOSYS for attempts to change
PIO mode if it821x controller is in "smart" mode
- removal of two debugging printk-s (from cs5530.c and sc1200.c)
- transfer modes 0x00-0x07 passed from user space may be programmed twice on
the device (not really an issue since 0x00 is not supported correctly by
any host driver ATM, 0x01 is not supported at all and 0x02-0x07 are invalid)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
amd74xx/via82cxxx: check ide_config_drive_speed() return value
* Check ide_config_drive_speed() return value.
* While at also call ide_config_drive_speed() if the transfer mode is
XFER_PIO_SLOW (this case happens iff the transfer mode has already been
set on the device by ide-proc.c::set_xfer_rate()) and remove redundant
setting of ->{init,current}_speed.
* Bump driver version.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* 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>
* 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>
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>
* 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>
ide-pmac: remove control register messing from pmac_ide_dma_check()
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>
* 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>
Adrian Bunk [Sat, 13 Oct 2007 15:47:48 +0000 (17:47 +0200)]
ide: unexport ide_acpi_set_state
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>
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>
Kevin Hao [Tue, 2 Oct 2007 20:56:04 +0000 (13:56 -0700)]
[MTD] [NOR] fix ctrl-alt-del can't reboot for intel flash bug
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>