GitHub/LineageOS/G12/android_kernel_amlogic_linux-4.9.git
16 years ago[POWERPC] spufs: fix concurrent delivery of class 0 & 1 exceptions
Luke Browning [Sun, 27 Apr 2008 18:41:55 +0000 (18:41 +0000)]
[POWERPC] spufs: fix concurrent delivery of class 0 & 1 exceptions

SPU class 0 & 1 exceptions may occur in parallel, so we may end up
overwriting csa.dsisr.

This change adds dedicated fields for each class to the spu and the spu
context so that fault data is not overwritten.

Signed-off-by: Luke Browning <lukebr@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: try to route SPU interrupts to local node
Luke Browning [Mon, 28 Apr 2008 04:32:34 +0000 (14:32 +1000)]
[POWERPC] spufs: try to route SPU interrupts to local node

Currently, we re-route SPU interrupts to the current cpu, which may be
on a remote node. In the case of time slicing, all spu interrupts will
end up routed to the same cpu, where the spusched_tick occurs.

This change routes mfc interrupts to the cpu where the controlling
thread last ran, provided that cpu is on the same node as the spu
(otherwise don't reroute interrupts).

This should improve performance and provide a more predictable
environment for processing spu exceptions. In the past we have seen
concurrent delivery of spu exceptions to two cpus. This eliminates that
concern.

Signed-off-by: Luke Browning <lukebr@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: set SPU_CONTEXT_SWITCH_PENDING before synchronising SPU irqs
Luke Browning [Fri, 25 Apr 2008 04:00:00 +0000 (14:00 +1000)]
[POWERPC] spufs: set SPU_CONTEXT_SWITCH_PENDING before synchronising SPU irqs

synchronize_irq() provides the serialization for
SPU_CONTEXT_SWITCH_PENDING which is read with a simple load. This
routine guarantees that the relevant interrupt handlers are not running,
so that the next time they do run they will see the update
memory value.

This must be done correctly so that exception handling code does not
restart the mfc in the middle of a context switch while we are trying
to atomically stop it and save state.

Signed-off-by: Luke Browning <lukebr@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: don't acquire state_mutex interruptible while performing callback
Jeremy Kerr [Wed, 23 Apr 2008 06:02:10 +0000 (16:02 +1000)]
[POWERPC] spufs: don't acquire state_mutex interruptible while performing callback

There's currently no way to tell if spu_process_callback has
returned with the state mutex held, as -EINTR may be returned
by either the syscall or the spu_acquire fail case.

Instead, just do a non-interruptible mutex_lock here.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: update master runcntl with context lock held
Jeremy Kerr [Wed, 23 Apr 2008 04:24:27 +0000 (14:24 +1000)]
[POWERPC] spufs: update master runcntl with context lock held

Currently, we update the SPU master run control bit (ie,
spu_enable_spu) in spufs_run_spu before we grab the context mutex. This
can result in races with other processes accessing this context's
resources.

This change moves the spu_enable_spu to after we have acquired the
context lock.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: fix post-stopped update of MFC_CNTL register
Jeremy Kerr [Thu, 24 Apr 2008 08:15:40 +0000 (18:15 +1000)]
[POWERPC] spufs: fix post-stopped update of MFC_CNTL register

We currently have two issues with the MFC save code:

 * save_mfc_decr doesn't handle a transition of 1 -> 0 of the Ds bit
 * The Q bit may be stale in the CSA

This change fixes the first issue by clearing the relevant bits from
the MFC_CNTL value in the CSA before or-ing in the updated status.
Also, we add the Q bit to the updated status.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: fix save of mfc_cntl register
Jeremy Kerr [Wed, 9 Apr 2008 05:24:22 +0000 (15:24 +1000)]
[POWERPC] spufs: fix save of mfc_cntl register

Currently, we can introduce invalid entries into the MFC queues:

1) context starts a DMA

2) context gets scheduled out during a DMA
  - kernel saves MFC queue to CSA
  - kernel saves 0x0 in csa->mfc_control_RW

3) context gets scheduled in
  - csa->mfc_control[Q] ('queues empty') isn't set, so DMA queues are
    restored from the CSA

4) context's DMA is completed

5) context gets scheduled out again, no DMA occuring this time
  - kernel sees that MFC_CNTL[Q] ('queues empty') is set, so doesn't
    touch saved queue data in CSA
  - kernel saves 0x0 in csa->mfc_control_RW

6) context gets scheduled in
  - csa->mfc_control[Q] ('queues empty') isn't set (we saved is as 0!),
    so DMA queues are restored from the CSA

In this last restore, we've restored the queue status from step 2,
which are now invalid.

This change makes save_mfc_cntl() closer to the save/restore sequence,
as specified in the CBE handbook.

With changes from Luke Browning.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: don't touch suspend bits when purging DMA queue
Jeremy Kerr [Mon, 7 Apr 2008 07:42:36 +0000 (17:42 +1000)]
[POWERPC] spufs: don't touch suspend bits when purging DMA queue

When we issue a MFC purge request, we may inadvertantly clear the
suspended status.

This change adds the MFC_CNTL_SUSPEND_MASK when we issue a purge
request, so that the suspend bit is masked out.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] cell: Fix lost interrupts due to fasteoi handler
Jeremy Kerr [Fri, 4 Apr 2008 06:55:28 +0000 (17:55 +1100)]
[POWERPC] cell: Fix lost interrupts due to fasteoi handler

We may currently lose interrupts during SPE context switch, as we alter
the INT_Route register. Because the IIC uses a per-thread priority
status, changing the interrupt routing to a different thread means that
the IRQ is no longer masked by the priority status, so we end up with
two fasteoi IRQ handlers executing for the one irq_desc. The fasteoi
handler doesn't handle multiple IRQs, so drops the second one.

Fix this by using our own flow handler. This is based on
handle_edge_irq, but issues an eoi after IRQs are handled, and doesn't
do any mask/unmasking.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] Bolt in SLB entry for kernel stack on secondary cpus
Paul Mackerras [Fri, 2 May 2008 04:29:12 +0000 (14:29 +1000)]
[POWERPC] Bolt in SLB entry for kernel stack on secondary cpus

This fixes a regression reported by Kamalesh Bulabel where a POWER4
machine would crash because of an SLB miss at a point where the SLB
miss exception was unrecoverable.  This regression is tracked at:

http://bugzilla.kernel.org/show_bug.cgi?id=10082

SLB misses at such points shouldn't happen because the kernel stack is
the only memory accessed other than things in the first segment of the
linear mapping (which is mapped at all times by entry 0 of the SLB).
The context switch code ensures that SLB entry 2 covers the kernel
stack, if it is not already covered by entry 0.  None of entries 0
to 2 are ever replaced by the SLB miss handler.

Where this went wrong is that the context switch code assumes it
doesn't have to write to SLB entry 2 if the new kernel stack is in the
same segment as the old kernel stack, since entry 2 should already be
correct.  However, when we start up a secondary cpu, it calls
slb_initialize, which doesn't set up entry 2.  This is correct for
the boot cpu, where we will be using a stack in the kernel BSS at this
point (i.e. init_thread_union), but not necessarily for secondary
cpus, whose initial stack can be allocated anywhere.  This doesn't
cause any immediate problem since the SLB miss handler will just
create an SLB entry somewhere else to cover the initial stack.

In fact it's possible for the cpu to go quite a long time without SLB
entry 2 being valid.  Eventually, though, the entry created by the SLB
miss handler will get overwritten by some other entry, and if the next
access to the stack is at an unrecoverable point, we get the crash.

This fixes the problem by making slb_initialize create a suitable
entry for the kernel stack, if we are on a secondary cpu and the stack
isn't covered by SLB entry 0.  This requires initializing the
get_paca()->kstack field earlier, so I do that in smp_create_idle
where the current field is initialized.  This also abstracts a bit of
the computation that mk_esid_data in slb.c does so that it can be used
in slb_initialize.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Update ps3_defconfig
Geoff Levand [Wed, 30 Apr 2008 22:25:36 +0000 (08:25 +1000)]
[POWERPC] PS3: Update ps3_defconfig

Update ps3_defconfig.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Remove unsupported wakeup sources
Geoff Levand [Wed, 30 Apr 2008 22:25:30 +0000 (08:25 +1000)]
[POWERPC] PS3: Remove unsupported wakeup sources

Other OS wakeup is not supported from the IR controller,
the bluetooth controller nor the RTC.  Remove references
to these in the PS3 sys-manager source.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Make ps3_virq_setup and ps3_virq_destroy static
Geert Uytterhoeven [Wed, 30 Apr 2008 22:25:18 +0000 (08:25 +1000)]
[POWERPC] PS3: Make ps3_virq_setup and ps3_virq_destroy static

The routines ps3_virq_setup() and ps3_virq_destroy() are used
in only one file, so make them static.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] PS3: Add time include to lpm
FUJITA Tomonori [Wed, 30 Apr 2008 22:25:09 +0000 (08:25 +1000)]
[POWERPC] PS3: Add time include to lpm

Add an include <asm/time.h> statement for get_tb().

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix slb.c compile warnings
Geoff Levand [Wed, 30 Apr 2008 22:24:58 +0000 (08:24 +1000)]
[POWERPC] Fix slb.c compile warnings

Arrange for a syntax check to always be done on the powerpc/mm/slb.c
DBG() macro by defining it to pr_debug() for non-debug builds.

Also, fix these related compile warnings:

  slb.c:273: warning: format '%04x' expects type 'unsigned int', but argument 2 has type 'long unsigned int
  slb.c:274: warning: format '%04x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoMerge branch 'powerpc-next' of master.kernel.org:/pub/scm/linux/kernel/git/galak...
Paul Mackerras [Fri, 2 May 2008 04:45:50 +0000 (14:45 +1000)]
Merge branch 'powerpc-next' of /linux/kernel/git/galak/powerpc

16 years ago[POWERPC] Xilinx: Fix compile warnings
Kumar Gala [Wed, 30 Apr 2008 15:24:44 +0000 (10:24 -0500)]
[POWERPC] Xilinx: Fix compile warnings

arch/powerpc/sysdev/xilinx_intc.c: In function 'xilinx_intc_init':
arch/powerpc/sysdev/xilinx_intc.c:111: warning: format '%08X' expects type 'unsigned int', but argument 2 has type 'resource_size_t'
drivers/char/xilinx_hwicap/xilinx_hwicap.c: In function 'hwicap_setup':
drivers/char/xilinx_hwicap/xilinx_hwicap.c:626: warning: cast to pointer from integer of different size
drivers/char/xilinx_hwicap/xilinx_hwicap.c:646: warning: format '%x' expects type 'unsigned int', but argument 6 has type 'resource_size_t'

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Squash build warning for print of resource_size_t in fsl_soc.c
Becky Bruce [Thu, 1 May 2008 23:15:45 +0000 (18:15 -0500)]
[POWERPC] Squash build warning for print of resource_size_t in fsl_soc.c

When resource_size_t is larger than an int, the current code
generates a build warning.  Kill it.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[RAPIDIO] fix current kernel-doc notation
Randy Dunlap [Wed, 30 Apr 2008 23:45:58 +0000 (16:45 -0700)]
[RAPIDIO] fix current kernel-doc notation

Fix current (-git16) missing docbook/kernel-doc notation in RapidIO files.

Warning(linux-2.6.25-git16//include/linux/rio.h:187): No description found for parameter 'sys_size'
Warning(linux-2.6.25-git16//include/linux/rio.h:187): No description found for parameter 'phy_type'

Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:188): No description found for parameter 'mport'
Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:224): No description found for parameter 'mport'
Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:245): No description found for parameter 'mport'
Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:270): No description found for parameter 'mport'
Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:311): No description found for parameter 'mport'
Warning(linux-2.6.25-git16//arch/powerpc/sysdev/fsl_rio.c:996): No description found for parameter 'dev'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] 86xx: mpc8610_hpcd: add support for PCI Express x8 slot
Anton Vorontsov [Tue, 29 Apr 2008 16:41:12 +0000 (20:41 +0400)]
[POWERPC] 86xx: mpc8610_hpcd: add support for PCI Express x8 slot

This patch adds pcie node which is resposible for PCI-E x8 slot
functioning. Though, this was tested using only x1 SKY2 NIC.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agoFix a potential issue in mpc52xx uart driver
Andrew Liu [Tue, 29 Apr 2008 07:36:25 +0000 (17:36 +1000)]
Fix a potential issue in mpc52xx uart driver

mpc52xx_uart_int and __uart_put_char both try to acquire the
port->lock. Therefore the function sequence of:

mpc52xx_uart_int--> ...-->flush_to_ldisc-->...-->__uart_put_char

can potentially trigger a deadlock. To avoid this deadlock a fix
similar to that found in the 8250.c serial driver is applied. The
deadlock is avoided by releasing the lock before pushing a buffer
and reacquiring it when completed.

Signed-off-by: Andrew Liu <shengping.liu@windriver.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years ago[POWERPC] mpc5200: Allow for fixed speed MII configurations
Grant Likely [Thu, 1 May 2008 17:05:58 +0000 (11:05 -0600)]
[POWERPC] mpc5200: Allow for fixed speed MII configurations

Various improvements for configuring the MPC5200 MII link from the
device tree:
* Look for 'current-speed' property for fixed speed MII links
* Look for 'fsl,7-wire-mode' property for boards using the 7 wire mode
* move definition of private data structure out of the header file

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
16 years ago[POWERPC] 86xx: Fix the wrong serial1 interrupt for 8610 board
Jason Jin [Sat, 19 Apr 2008 07:07:56 +0000 (15:07 +0800)]
[POWERPC] 86xx: Fix the wrong serial1 interrupt for 8610 board

Signed-off-by: Jason Jin <Jason.jin@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years ago[POWERPC] Fix crashkernel= handling when no crashkernel= specified
Michael Ellerman [Wed, 30 Apr 2008 04:47:12 +0000 (14:47 +1000)]
[POWERPC] Fix crashkernel= handling when no crashkernel= specified

Commit edd8ce67436851a62f99f1d9707b40ea6a8e5323 (Use extended crashkernel
command line on ppc64), changed the logic in reserve_crashkernel()
which deals with the crashkernel= command line option.

This introduced a bug in the case when there is no crashkernel= option,
or it is incorrect.  We would fall through and calculate the crash_size
based on the existing values in crashk_res.  If both start and end are 0,
the default, we calculate the crash_size as 1 byte - which is wrong.

Rework the logic so that we use crashk_res, regardless of whether it's
set by the command line or via the device tree (see prom.c).  Then check
if we have an empty range (end == start), and if so make sure to set
both end and start to zero (this is checked in machine_kexec_64.c).  Then
we calculate the crash_size once we know we have a non-zero range.

Finally we always want to warn the user if they specify a base != 32MB,
so remove the special case for that in the command line parsing case.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Make emergency stack safe for current_thread_info() use
Michael Ellerman [Wed, 30 Apr 2008 03:21:45 +0000 (13:21 +1000)]
[POWERPC] Make emergency stack safe for current_thread_info() use

The current_thread_info() macro, used by preempt_count(), assumes the
base address and size of the stack are THREAD_SIZE aligned.

The emergency stack currently isn't either of these things, which
could potentially cause problems anytime we're running on the
emergency stack.  That includes when we detect a bad kernel stack
pointer, and also during early_setup_secondary().

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jk/spufs
Paul Mackerras [Wed, 30 Apr 2008 06:53:17 +0000 (16:53 +1000)]
Merge git://git./pub/scm/linux/kernel/git/jk/spufs

16 years ago[POWERPC] spufs: add .gitignore for spu_save_dump.h & spu_restore_dump.h
Kumar Gala [Fri, 25 Apr 2008 01:03:03 +0000 (11:03 +1000)]
[POWERPC] spufs: add .gitignore for spu_save_dump.h & spu_restore_dump.h

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: trace spu_acquire_saved events
Julio M. Merino Vidal [Wed, 30 Apr 2008 05:21:17 +0000 (15:21 +1000)]
[POWERPC] spufs: trace spu_acquire_saved events

The sputrace module contained a trace entry for spu_acquire_saved, but
this marker was not placed anywhere. Fix this by adding a marker to the
routine.

Signed-off-by: Julio M. Merino Vidal <jmerino@ac.upc.edu>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: fix marker name for find_victim
Julio M. Merino Vidal [Wed, 30 Apr 2008 05:16:14 +0000 (15:16 +1000)]
[POWERPC] spufs: fix marker name for find_victim

Fix a typo in the marker for the find_victim function, which prevented
it from being traced. It previously read find_vitim.

Signed-off-by: Julio M. Merino Vidal <jmerino@ac.upc.edu>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: add marker for destroy_spu_context
Julio M. Merino Vidal [Wed, 30 Apr 2008 05:12:30 +0000 (15:12 +1000)]
[POWERPC] spufs: add marker for destroy_spu_context

The sputrace module contained a reference to a marker for
destroy_spu_context, but this marker did not appear in the code. Fix
this by adding a marker in the function.

Signed-off-by: Julio M. Merino Vidal <jmerino@ac.upc.edu>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: add sputrace marker parameter names
Julio M. Merino Vidal [Wed, 30 Apr 2008 05:06:39 +0000 (15:06 +1000)]
[POWERPC] spufs: add sputrace marker parameter names

The markers facility defines the marker parameters to be of the form
'name %format'. Add parameter names to sputrace, to specify the context
and %spu paramerters,  instead of just specifying the '%format' part.

Signed-off-by: Julio M. Merino Vidal <jmerino@ac.upc.edu>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] spufs: add context switch notification log
Christoph Hellwig [Tue, 29 Apr 2008 07:08:38 +0000 (17:08 +1000)]
[POWERPC] spufs: add context switch notification log

There are userspace instrumentation tools that need to monitor spu
context switches. This patch adds a new file called 'switch_log' to
each spufs context directory that can be used to monitor the context
switches.

Context switch in/out and exit from spu_run are monitored after the
file was first opened and can be read from it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
16 years ago[POWERPC] mpc5200: defconfigs for CM5200, Lite5200B, Motion-PRO and TQM5200
Bartlomiej Sieka [Tue, 15 Apr 2008 10:36:36 +0000 (20:36 +1000)]
[POWERPC] mpc5200: defconfigs for CM5200, Lite5200B, Motion-PRO and TQM5200

Board-specific defconfigs based on current mpc5200_defconfig, archival
lite5200_defconfig, and [cm5200|motionpro|tqm5200]_defconfig from the
linux-2.6-denx tree. Kernels build using these defconfigs were verified
to boot with root filesystem mounted over NFS on Motion-PRO, TQM5200
and Lite5200B boards. CM5200 target was not tested due to hardware
unavailability.

Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years ago[POWERPC] mpc5200: Switch mpc5200 dts files to dts-v1 format
Grant Likely [Tue, 29 Apr 2008 13:19:07 +0000 (07:19 -0600)]
[POWERPC] mpc5200: Switch mpc5200 dts files to dts-v1 format

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years ago[POWERPC] mpc5200: Fix FEC error handling on FIFO errors
Sascha Hauer [Tue, 15 Apr 2008 15:44:39 +0000 (01:44 +1000)]
[POWERPC] mpc5200: Fix FEC error handling on FIFO errors

The error handling for the mpc5200 fec interrupt is broken. The intended
behaviour is like this:

* If one of FEC_IEVENT_RFIFO_ERROR and FEC_IEVENT_XFIFO_ERROR happens,
  the datasheet says (MPC5200B User's Guide R1.2, p. 14-13): "When this
  occurs, software must ensure both the FIFO Controller and BestComm are
  soft-reset".

* On any other error (non-TFINT) interrupt, just issue a debug message.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years ago[POWERPC] mpc5200: add Phytec pcm030 board support
s.hauer@pengutronix.de [Fri, 25 Apr 2008 13:48:05 +0000 (23:48 +1000)]
[POWERPC] mpc5200: add Phytec pcm030 board support

Add board support for the Phytec pcm030 mpc5200b based board. It
does not need any platform specific fixups and as such is handled
as a mpc5200 simple platform.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years ago[POWERPC] mpc5200: add gpiolib support for mpc5200
s.hauer@pengutronix.de [Fri, 25 Apr 2008 10:56:04 +0000 (20:56 +1000)]
[POWERPC] mpc5200: add gpiolib support for mpc5200

This patch adds gpiolib support for mpc5200 SOCs.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years ago[POWERPC] mpc5200: add interrupt type function
Sascha Hauer [Tue, 15 Apr 2008 15:29:54 +0000 (01:29 +1000)]
[POWERPC] mpc5200: add interrupt type function

Add a set_type function for external (GPIO) interrupts.

Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years ago[POWERPC] mpc5200: Fix unterminated of_device_id table
Grant Likely [Tue, 29 Apr 2008 12:40:37 +0000 (06:40 -0600)]
[POWERPC] mpc5200: Fix unterminated of_device_id table

If CONFIG_PPC_MPC5121 is not set, then the of_device_id table for the
mpc5200 serial driver will not get terminated with a NULL entry.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
16 years ago[RAPIDIO] Change RapidIO doorbell source and target ID field to 16-bit
Zhang Wei [Fri, 18 Apr 2008 20:33:48 +0000 (13:33 -0700)]
[RAPIDIO] Change RapidIO doorbell source and target ID field to 16-bit

Change RapidIO doorbell source and target ID field to 16-bit for
support large system size, which max rio devid is 65535.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Add RapidIO connection info print out and re-training for broken connections
Zhang Wei [Fri, 18 Apr 2008 20:33:44 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO connection info print out and re-training for broken connections

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Add serial RapidIO controller support, which includes MPC8548, MPC8641
Zhang Wei [Fri, 18 Apr 2008 20:33:44 +0000 (13:33 -0700)]
[RAPIDIO] Add serial RapidIO controller support, which includes MPC8548, MPC8641

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Add RapidIO node probing into MPC86xx_HPCN board id table
Zhang Wei [Fri, 18 Apr 2008 20:33:43 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO node probing into MPC86xx_HPCN board id table

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Add RapidIO node into MPC8641HPCN dts file
Zhang Wei [Fri, 18 Apr 2008 20:33:42 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO node into MPC8641HPCN dts file

This adds properties describing the RapidIO controller to the
device-tree source for the MPC8641HPCN board.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Auto-probe the RapidIO system size
Zhang Wei [Fri, 18 Apr 2008 20:33:42 +0000 (13:33 -0700)]
[RAPIDIO] Auto-probe the RapidIO system size

The RapidIO system size will auto probe in RIO setup.  The route table
and rionet_active in rionet.c are changed to be allocated dynamically
according to the size of the system.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Add OF-tree support to RapidIO controller driver
Zhang Wei [Fri, 18 Apr 2008 20:33:41 +0000 (13:33 -0700)]
[RAPIDIO] Add OF-tree support to RapidIO controller driver

This initializes the RapidIO controller driver using addresses and
interrupt numbers obtained from the firmware device tree, rather than
using hardcoded constants.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Add RapidIO multi mport support
Zhang Wei [Fri, 18 Apr 2008 20:33:41 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO multi mport support

The original RapidIO driver suppose there is only one mpc85xx RIO controller
in system.  So, some data structures are defined as mpc85xx_rio global, such
as 'regs_win', 'dbell_ring', 'msg_tx_ring'.  Now, I changed them to mport's
private members.  And you can define multi RIO OF-nodes in dts file for multi
RapidIO controller in one processor, such as PCI/PCI-Ex host controllers in
Freescale's silicon.  And the mport operation function declaration should be
changed to know which RapidIO controller is target.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Move include/asm-ppc/rio.h to asm-powerpc
Zhang Wei [Fri, 18 Apr 2008 20:33:40 +0000 (13:33 -0700)]
[RAPIDIO] Move include/asm-ppc/rio.h to asm-powerpc

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Add RapidIO option to kernel configuration
Zhang Wei [Fri, 18 Apr 2008 20:33:39 +0000 (13:33 -0700)]
[RAPIDIO] Add RapidIO option to kernel configuration

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[RAPIDIO] Change RIO function mpc85xx_ to fsl_
Zhang Wei [Fri, 18 Apr 2008 20:33:38 +0000 (13:33 -0700)]
[RAPIDIO] Change RIO function mpc85xx_ to fsl_

The driver is suitable for the Freescale MPC8641 processor as well as
85xx processors, so this changes the mpc85xx prefix to fsl.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Provide walk_memory_resource() for powerpc
Badari Pulavarty [Fri, 18 Apr 2008 20:33:53 +0000 (13:33 -0700)]
[POWERPC] Provide walk_memory_resource() for powerpc

Provide walk_memory_resource() for 64-bit powerpc.  PowerPC maintains
logical memory region mapping in the lmb.memory structure.  Walk
through these structures and do the callbacks for the contiguous
chunks.

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Update lmb data structures for hotplug memory add/remove
Badari Pulavarty [Fri, 18 Apr 2008 20:33:52 +0000 (13:33 -0700)]
[POWERPC] Update lmb data structures for hotplug memory add/remove

The powerpc kernel maintains information about logical memory blocks
in the lmb.memory structure, which is initialized and updated at boot
time, but not when memory is added or removed while the kernel is
running.

This adds a hotplug memory notifier which updates lmb.memory when
memory is added or removed.  This information is useful for eHEA
driver to find out the memory layout and holes.

NOTE: No special locking is needed for lmb_add() and lmb_remove().
Calls to these are serialized by caller. (pSeries_reconfig_chain).

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Hotplug memory remove notifications for powerpc
Badari Pulavarty [Fri, 18 Apr 2008 20:33:50 +0000 (13:33 -0700)]
[POWERPC] Hotplug memory remove notifications for powerpc

Hotplug memory remove notifier for 64-bit powerpc.  This gets invoked
by writing to /proc/ppc64/ofdt the string "remove_node " followed by
the firmware device tree pathname of the node that needs to be removed.

In response, this adjusts the sections and removes sysfs entries by
calling __remove_pages().  Then it calls arch-specific code to get rid
of the hardware MMU mappings for the section of memory.

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Reviewed-by: Michael Ellerman <michael@ellerman.id.au>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] windfarm: Add PowerMac 12,1 support
Étienne Bersac [Tue, 29 Apr 2008 05:39:55 +0000 (15:39 +1000)]
[POWERPC] windfarm: Add PowerMac 12,1 support

This implements a new driver named windfarm_pm121, which drives the
fans on PowerMac 12,1 machines : iMac G5 iSight (rev C) 17" and
20".  It's based on the windfarm_pm81 driver from Benjamin
Herrenschmidt.

This includes fixes from David Woodhouse correcting the names of some
of the sensors.

Signed-off-by: Étienne Bersac <bersace@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Fix building of pmac32 when CONFIG_NVRAM=m
Tony Breeds [Tue, 29 Apr 2008 01:42:32 +0000 (11:42 +1000)]
[POWERPC] Fix building of pmac32 when CONFIG_NVRAM=m

Kamalesh Babulal (kamalesh@linux.vnet.ibm.com) reports that CONFIG_NVRAM=m
is valid in terms of Kconfig but fails to build with:
  Building modules, stage 2.
  MODPOST 1401 modules
ERROR: "pmac_newworld" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
ERROR: "__alloc_bootmem" [arch/powerpc/platforms/powermac/nvram.ko] undefined!
make[1]: *** [__modpost] Error

The arch/powerpc/platforms/powermac/nvram.c code really needs to be
builtin, but as its compilation is dependent on a generic Kconfig
symbol we force nvram.c to be builtin if CONFIG_NVRAM is 'y' or 'm'.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add IRQSTACKS support on ppc32
Kumar Gala [Mon, 28 Apr 2008 06:21:22 +0000 (16:21 +1000)]
[POWERPC] Add IRQSTACKS support on ppc32

This makes it possible to use separate stacks for hard and soft IRQs
on 32-bit powerpc as well as on 64-bit.  The code for 32-bit is just
the 32-bit analog of the 64-bit code.

* Added allocation and initialization of the irq stacks.  We limit the
  stacks to be in lowmem for ppc32.
* Implemented ppc32 versions of call_do_softirq() and call_handle_irq()
  to switch the stack pointers
* Reworked how we do stack overflow detection.  We now keep around the
  limit of the stack in the thread_struct and compare against the limit
  to see if we've overflowed.  We can now use this on ppc64 if desired.

[ paulus@samba.org: Fixed bug on 6xx where we need to reload r9 with the
  thread_info pointer. ]

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Use __always_inline for xchg* and cmpxchg*
Paul Mackerras [Mon, 28 Apr 2008 04:44:08 +0000 (14:44 +1000)]
[POWERPC] Use __always_inline for xchg* and cmpxchg*

This changes the definitions of the xchg and cmpxchg families of
functions in include/asm-powerpc/system.h to be marked __always_inline
rather than __inline__.  The reason for doing this is that we rely on
the compiler inlining them in order to eliminate the references to
__xchg_called_with_bad_pointer and __cmpxchg_called_with_bad_pointer,
which are deliberately left undefined.  Thus this change will enable
us to make the inline keyword be just a hint rather than a directive.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years ago[POWERPC] Add fast little-endian switch system call
Paul Mackerras [Mon, 28 Apr 2008 03:52:31 +0000 (13:52 +1000)]
[POWERPC] Add fast little-endian switch system call

This adds a system call on 64-bit platforms for switching between
little-endian and big-endian modes that is much faster than doing a
prctl call.  This system call is handled as a special case right at
the start of the system call entry code, and because it is a special
case, it uses a system call number which is out of the range of
normal system calls, namely 0x1ebe.

Measurements with lmbench on a 4.2GHz POWER6 showed no measurable
change in the speed of normal system calls with this patch.

Switching endianness with this new system call takes around 60ns on a
4.2GHz POWER6, compared with around 300ns to switch endian mode with a
prctl.  This can provide a significant performance advantage for
emulators for little-endian architectures that want to switch between
big-endian and little-endian mode frequently, e.g. because they are
generating instructions sequences on the fly and they want to run
those sequences in little-endian mode.

The other thing about this system call is that it doesn't clobber as
many registers as a normal system call.  It only clobbers r12.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agodrivers: fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 23:50:04 +0000 (16:50 -0700)]
drivers: fix integer as NULL pointer warnings

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomedia: fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 23:50:03 +0000 (16:50 -0700)]
media: fix integer as NULL pointer warnings

drivers/media/video/v4l2-common.c:719:16: warning: Using plain integer as NULL pointer
drivers/media/video/au0828/au0828-dvb.c:122:19: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1101:22: warning: Using plain integer as NULL pointer
drivers/media/video/ivtv/ivtv-yuv.c:1102:23: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-audio.c:78:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-video-v4l.c:84:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-v4l2.c:1264:9: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-context.c:197:28: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c:126:39: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:133:32: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:145:31: warning: Using plain integer as NULL pointer
drivers/media/video/pvrusb2/pvrusb2-dvb.c:177:55: warning: Using plain integer as NULL pointer
drivers/media/video/videobuf-core.c:100:9: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoscsi: fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 23:50:03 +0000 (16:50 -0700)]
scsi: fix integer as NULL pointer warnings

drivers/scsi/aic7xxx/aic7770_osm.c:53:58: warning: Using plain integer as NULL pointer
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:355:47: warning: Using plain integer as NULL pointer
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:372:55: warning: Using plain integer as NULL pointer
drivers/scsi/aha152x.c:997:28: warning: Using plain integer as NULL pointer
drivers/scsi/aha152x.c:1003:28: warning: Using plain integer as NULL pointer
drivers/scsi/aha152x.c:1165:46: warning: Using plain integer as NULL pointer
drivers/scsi/fdomain.c:1446:40: warning: Using plain integer as NULL pointer
drivers/scsi/sym53c8xx_2/sym_hipd.c:1650:51: warning: Using plain integer as NULL pointer
drivers/scsi/sym53c8xx_2/sym_hipd.c:3171:42: warning: Using plain integer as NULL pointer
drivers/scsi/sym53c8xx_2/sym_hipd.c:5732:52: warning: Using plain integer as NULL pointer
drivers/scsi/ncr53c8xx.c:8189:31: warning: Using plain integer as NULL pointer
drivers/scsi/ncr53c8xx.c:8225:34: warning: Using plain integer as NULL pointer
drivers/scsi/dpt_i2o.c:156:32: warning: Using plain integer as NULL pointer
drivers/scsi/ultrastor.c:954:42: warning: Using plain integer as NULL pointer
drivers/scsi/ultrastor.c:1104:18: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Tue, 29 Apr 2008 00:30:26 +0000 (17:30 -0700)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (35 commits)
  siimage: coding style cleanup (take 2)
  ide-cd: clean up cdrom_analyze_sense_data()
  ide-cd: fix test unsigned var < 0
  ide: add TSSTcorp CDDVDW SH-S202H to ivb_list[]
  piix: add Asus Eee 701 controller to short cable list
  ARM: always select HAVE_IDE
  remove the broken ETRAX_IDE driver
  ide: remove ->dma_prdtable field from ide_hwif_t
  ide: remove ->dma_vendor{1,3} fields from ide_hwif_t
  scc_pata: add ->dma_host_set and ->dma_start methods
  ide: skip "VLB sync" if host uses MMIO
  ide: add ide_pad_transfer() helper
  ide: remove ->INW and ->OUTW methods
  ide: use IDE I/O helpers directly in ide_tf_{load,read}()
  ns87415: add ->tf_read method
  scc_pata: add ->tf_{load,read} methods
  ide-h8300: add ->tf_{load,read} methods
  ide-cris: add ->tf_{load,read} methods
  ide: add ->tf_load and ->tf_read methods
  ide: move ide_tf_{load,read} to ide-iops.c
  ...

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Linus Torvalds [Tue, 29 Apr 2008 00:29:43 +0000 (17:29 -0700)]
Merge git://git./linux/kernel/git/sam/kbuild

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kconfig: add named choice group
  kconfig: fix choice dependency check
  kconifg: 'select' considered less evil
  dontdiff: ignore timeconst.h
  dontdiff: add modules.order
  kbuild: fix unportability in gen_initramfs_list.sh
  kbuild: fix help output to show correct arch
  kbuild: show defconfig subdirs in make help
  kconfig: reversed borderlines in inputbox

16 years agodrivers: atm, char fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 21:13:20 +0000 (14:13 -0700)]
drivers: atm, char fix integer as NULL pointer warnings

drivers/atm/nicstar.c:418:25: warning: Using plain integer as NULL pointer
drivers/char/drm/r128_cce.c:820:25: warning: Using plain integer as NULL pointer
drivers/char/tty_io.c:1183:10: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomm: fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 21:13:19 +0000 (14:13 -0700)]
mm: fix integer as NULL pointer warnings

mm/hugetlb.c:207:11: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agokernel: fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 21:13:19 +0000 (14:13 -0700)]
kernel: fix integer as NULL pointer warnings

kernel/cpuset.c:1268:52: warning: Using plain integer as NULL pointer
kernel/pid_namespace.c:95:24: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Reviewed-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinit: fix integer as NULL pointer warnings
Harvey Harrison [Mon, 28 Apr 2008 21:13:14 +0000 (14:13 -0700)]
init: fix integer as NULL pointer warnings

init/do_mounts_rd.c:215:13: warning: Using plain integer as NULL pointer
init/do_mounts_md.c:136:45: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosiimage: coding style cleanup (take 2)
Sergei Shtylyov [Mon, 28 Apr 2008 21:44:44 +0000 (23:44 +0200)]
siimage: coding style cleanup (take 2)

Fix 18 errors and several warnings given by checkpatch.pl:

- use of C99 // comments;

- trailing whitespace;

- 'switch' and 'case' not at the same indentation level;

- no space before the open parenthesis of the 'if' and 'switch' statements;

- space between function name and open parenthesis (though I have introduced
  such warnins in some places since the code looks prettier with the spaces);

- including <asm/io.h> instead of <linux/io.h>;

- line over 80 characters.

In addition to these changes, also do the following:

- make the arrays in sil_set_pio_mode() 'static', and make the arrays in
  sil_set_dma_mode() 'static const';

- change the string of the 'if' statements into the 'switch' statement in
  sil_pata_udma_filter();

- drop the needless '==' operators from the 'if' statements where a condition
  is a mere bit test;

- remove needless initializer for the 'tmp' variable in init_chipset_siimage();

- beautify groups of the variable initializers and assignment operators;

- add new line after variable definitions;

- remove new line between the comment and the statements it refers to;

- remove needless curly braces and parentheses;

- fix typos, capitalize acronyms, etc. in the comments...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: clean up cdrom_analyze_sense_data()
Roel Kluin [Mon, 28 Apr 2008 21:44:43 +0000 (23:44 +0200)]
ide-cd: clean up cdrom_analyze_sense_data()

[bart: fix handling of bio_sectors(failed_command->bio) == 0]

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fix test unsigned var < 0
Roel Kluin [Mon, 28 Apr 2008 21:44:43 +0000 (23:44 +0200)]
ide-cd: fix test unsigned var < 0

valid is unsigned and cannot be below 0.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add TSSTcorp CDDVDW SH-S202H to ivb_list[]
Alexander Smal [Mon, 28 Apr 2008 21:44:43 +0000 (23:44 +0200)]
ide: add TSSTcorp CDDVDW SH-S202H to ivb_list[]

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agopiix: add Asus Eee 701 controller to short cable list
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:43 +0000 (23:44 +0200)]
piix: add Asus Eee 701 controller to short cable list

Based on ata_piix patch by Dan McGee.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoARM: always select HAVE_IDE
Adrian Bunk [Mon, 28 Apr 2008 21:44:43 +0000 (23:44 +0200)]
ARM: always select HAVE_IDE

It's plain wrong for PCMCIA to select HAVE_IDE that implies e.g. the
availability of an asm/ide.h

It turns out this was done for ARM, and we can simply always select
HAVE_IDE on ARM instead of manually tracking which platforms might
possible have an IDE controller directly or indirectly.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoremove the broken ETRAX_IDE driver
Adrian Bunk [Mon, 28 Apr 2008 21:44:42 +0000 (23:44 +0200)]
remove the broken ETRAX_IDE driver

ETRAX_IDE was marked as broken last year with the comment
"it doesn't even compile currently".

Remove it since it won't get fixed in the near future.

On Mon, Apr 14, 2008 at 02:50:19PM +0200, Mikael Starvik wrote:
> You can remove it for now and we will resubmit a new if/when we get around
> to fix it.

[bart: ported it over IDE tree]

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Cc: Jesper Nilsson <Jesper.Nilsson@axis.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ->dma_prdtable field from ide_hwif_t
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:42 +0000 (23:44 +0200)]
ide: remove ->dma_prdtable field from ide_hwif_t

* Use 'hwif->dma_base + {4,8}' instead of hwif->dma_prdtable in
  {ide,scc}_dma_setup().

* Remove no longer needed ->dma_prdtable field from ide_hwif_t.

While at it:

* Use ATA_DMA_TABLE_OFS define.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ->dma_vendor{1,3} fields from ide_hwif_t
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:42 +0000 (23:44 +0200)]
ide: remove ->dma_vendor{1,3} fields from ide_hwif_t

* Use 'hwif->dma_base + {1,3}' instead of hwif->dma_vendor{1,3} in
  pdc202xx_new host driver.

* Remove no longer needed ->dma_vendor{1,3} fields from ide_hwif_t.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoscc_pata: add ->dma_host_set and ->dma_start methods
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:41 +0000 (23:44 +0200)]
scc_pata: add ->dma_host_set and ->dma_start methods

Add ->dma_host_set and ->dma_start methods (+ __scc_dma_end() helper)
so scc_ide_{in,out}b() can be used directly.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: skip "VLB sync" if host uses MMIO
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:41 +0000 (23:44 +0200)]
ide: skip "VLB sync" if host uses MMIO

* Skip "VLB sync" in ata_{in,out}put_data() if host uses MMIO.

* Use I/O ops directly in ata_vlb_sync() an drop no longer needed
  'ide_drive_t *drive' argument.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_pad_transfer() helper
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:41 +0000 (23:44 +0200)]
ide: add ide_pad_transfer() helper

* Add ide_pad_transfer() helper (which uses ->{in,out}put_data methods
  internally so the transfer is also padded to drive+host requirements)
  and use it instead of ide_atapi_{write_zeros,discard_data}().

* Remove no longer needed ide_atapi_{write_zeros,discard_data}().

Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ->INW and ->OUTW methods
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:41 +0000 (23:44 +0200)]
ide: remove ->INW and ->OUTW methods

* Remove no longer used ->INW and ->OUTW methods.

While at it:

* scc_pata.c: scc_ide_{out,in}w() is called only in scc_tf_{load,read}()
  so inline it there.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use IDE I/O helpers directly in ide_tf_{load,read}()
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:41 +0000 (23:44 +0200)]
ide: use IDE I/O helpers directly in ide_tf_{load,read}()

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agons87415: add ->tf_read method
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:40 +0000 (23:44 +0200)]
ns87415: add ->tf_read method

Add ->tf_read method so out{b,w}(), in{b,w}() and superio_ide_inb()
can be used directly.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoscc_pata: add ->tf_{load,read} methods
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:40 +0000 (23:44 +0200)]
scc_pata: add ->tf_{load,read} methods

Add ->tf_{load,read} methods so scc_ide_{outb,outw,inb,inw}()
can be used directly.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-h8300: add ->tf_{load,read} methods
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:40 +0000 (23:44 +0200)]
ide-h8300: add ->tf_{load,read} methods

Add ->tf_{load,read} methods so outb()/inb() and mm_outw()/mm_inw()
can be used directly.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cris: add ->tf_{load,read} methods
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:40 +0000 (23:44 +0200)]
ide-cris: add ->tf_{load,read} methods

Add ->tf_{load,read} methods so cris_ide_{outb,outw,inb,inw}()
can be used directly.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ->tf_load and ->tf_read methods
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:40 +0000 (23:44 +0200)]
ide: add ->tf_load and ->tf_read methods

* Add ->tf_load and ->tf_read methods to ide_hwif_t and set the default
  methods in default_hwif_transport().

* Use ->tf_{load,read} instead o calling ide_tf_{load,read}() directly.

* Make ide_tf_{load,read}() static.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: move ide_tf_{load,read} to ide-iops.c
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:39 +0000 (23:44 +0200)]
ide: move ide_tf_{load,read} to ide-iops.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: factor out debugging code from ide_tf_load()
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:39 +0000 (23:44 +0200)]
ide: factor out debugging code from ide_tf_load()

Factor out debugging code from ide_tf_load() to ide_tf_dump() helper
and update ide_tf_load() users accordingly.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_execute_pkt_cmd() helper
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:39 +0000 (23:44 +0200)]
ide: add ide_execute_pkt_cmd() helper

Add ide_execute_pkt_cmd() helper for executing PACKET command,
then convert ATAPI device drivers to use it.

As a nice side-effect this fixes ide-{floppy,tape,scsi} w.r.t.
ide_lock taking (ide-cd was OK).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-{floppy,tape,scsi}: 400ns delay is required after executing the command
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:39 +0000 (23:44 +0200)]
ide-{floppy,tape,scsi}: 400ns delay is required after executing the command

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: always use ->OUTBSYNC method for executing commands
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:38 +0000 (23:44 +0200)]
ide: always use ->OUTBSYNC method for executing commands

Always use ->OUTBSYNC method for executing commands so the posting is done
if needed (this affects only pmac and scc_pata host drivers at the moment).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agosiimage: remove proc_reports_siimage()
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:38 +0000 (23:44 +0200)]
siimage: remove proc_reports_siimage()

* proc_reports_siimage() is now only called by init_chipset_siimage()
  so inline it there.

* Use array instead of switch statement for reporting clock modes.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agosiimage: add sil_* I/O ops
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:38 +0000 (23:44 +0200)]
siimage: add sil_* I/O ops

Add sil_iowrite{8,16,32}() and sil_ioread{8,16}() helpers, then use them to
merge code accessing configuration registers through PCI and MMIO together.

[ because of this SATA initialization bits from setup_mmio_siimage() are
  moved to init_chipset_siimage() ]

This also cuts code size a bit:

   text    data     bss     dec     hex filename
   4437     164       0    4601    11f9 drivers/ide/pci/siimage.o.before
   3979     164       0    4143    102f drivers/ide/pci/siimage.o.after

While at it:

* Use I/O ops directly instead of using ->IN{B,W} and ->OUT{B,W}.

* Fixup CodingStyle in setup_mmio_siimage().

* Rename 'tmpbyte' variable to 'tmp' in init_chipset_siimage().

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agosiimage: do clocking register posting earlier in setup_mmio_siimage()
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:38 +0000 (23:44 +0200)]
siimage: do clocking register posting earlier in setup_mmio_siimage()

Do clocking register posting earlier in setup_mmio_siimage()
to match code in init_chipset_siimage().

This is a preparation for the next patch which merges PCI and MMIO
code paths together.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove ->INS{W,L} and ->OUTS{W,L} methods
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:37 +0000 (23:44 +0200)]
ide: remove ->INS{W,L} and ->OUTS{W,L} methods

* Use ins{w,l}()/outs{w,l}() and __ide_mm_ins{w,l}()/__ide_mm_outs{w,l}()
  directly in ata_{in,out}put_data() (by using IDE_HFLAG_MMIO host flag to
  decide which I/O ops are required).

* Remove no longer needed ->INS{W,L} and ->OUTS{W,L} methods (ide-h8300,
  au1xxx-ide and scc_pata implement their own ->{in,out}put_data methods).

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add IDE_HFLAG_MMIO host flag (take 2)
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:37 +0000 (23:44 +0200)]
ide: add IDE_HFLAG_MMIO host flag (take 2)

* Add IDE_HFLAG_MMIO host flag and set it for hosts which use
  default_hwif_mmiops().

v2:
* Fix kernel panic in pmac host driver (',' should be '|').

  Thanks to Kamalesh for reporting it + testing the fix
  and to Andrew for hinting me about the source of the issue.

Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-h8300: add ->{in,out}put_data methods (take 2)
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:37 +0000 (23:44 +0200)]
ide-h8300: add ->{in,out}put_data methods (take 2)

v2:

* Update ->{in,out}_data methods to take 'struct request *rq' argument.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoau1xxx-ide: add ->{in,out}put_data methods (take 2)
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:37 +0000 (23:44 +0200)]
au1xxx-ide: add ->{in,out}put_data methods (take 2)

v2:

* Update ->{in,out}_data methods to take 'struct request *rq' argument.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoscc_pata: add ->{in,out}put_data methods (take 2)
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:36 +0000 (23:44 +0200)]
scc_pata: add ->{in,out}put_data methods (take 2)

v2:

* Update ->{in,out}_data methods to take 'struct request *rq' argument
  (thanks to Stephen Rothwell for catching it).

There should be no functional changes caused by this patch.

Cc: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Cc: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: merge ->atapi_*put_bytes and ->ata_*put_data methods
Bartlomiej Zolnierkiewicz [Mon, 28 Apr 2008 21:44:36 +0000 (23:44 +0200)]
ide: merge ->atapi_*put_bytes and ->ata_*put_data methods

* Merge ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods
  into new ->{in,out}put_data methods which take number of bytes to
  transfer as an argument and always do padding.

While at it:

* Use 'hwif' or 'drive->hwif' instead of 'HWIF(drive)'.

There should be no functional changes caused by this patch (all users
of ->ata_{in,out}put_data methods were using multiply-of-4 word counts).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>