David Chinner [Thu, 6 Mar 2008 02:45:35 +0000 (13:45 +1100)]
[XFS] Use atomic counters for ktrace buffer indexes
ktrace_enter() is consuming vast amounts of CPU time due to the use of a
single global lock for protecting buffer index increments. Change it to
use per-buffer atomic counters - this reduces ktrace_enter() overhead
during a trace intensive test on a 4p machine from 58% of all CPU time to
12% and halves test runtime.
SGI-PV: 977546
SGI-Modid: xfs-linux-melb:xfs-kern:30537a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
David Chinner [Thu, 6 Mar 2008 02:45:29 +0000 (13:45 +1100)]
[XFS] Update c/mtime correctly on truncates
XFS changes the c/mtime of an inode when truncating it to the same size.
The c/mtime is only supposed to change if the size is changed. Not to be
confused with ftruncate, where the c/mtime is supposed to be changed even
if the size is not changed.
The Linux VFS encodes this semantic difference in the flags it sends down
to ->setattr, which XFS currently ignores. We need to make XFS pay
attention to the VFS flags and hence Do The Right Thing.
SGI-PV: 977547
SGI-Modid: xfs-linux-melb:xfs-kern:30536a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Christoph Hellwig [Thu, 6 Mar 2008 02:45:16 +0000 (13:45 +1100)]
[XFS] don't encode parent in nfs filehandles unless nessecary
As Dave pointed out after the export ops changes we now always encode the
parent into the filehandle for regular files, but it's not actually needed
when the filesystem is export with no_subtree_check. This one-liner fixes
xfs_fs_encode_fh to skip encoding the parent unless nessecary.
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30535a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Christoph Hellwig [Thu, 6 Mar 2008 02:44:57 +0000 (13:44 +1100)]
[XFS] kill xfs_rwlock/xfs_rwunlock
We can just use xfs_ilock/xfs_iunlock instead and get rid of the ugly
bhv_vrwlock_t.
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30533a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Christoph Hellwig [Thu, 6 Mar 2008 02:44:50 +0000 (13:44 +1100)]
[XFS] kill xfs_get_dir_entry
Instead of of xfs_get_dir_entry use a macro to get the xfs_inode from the
dentry in the callers and grab the reference manually.
Only grab the reference once as it's fine to keep it over the dmapi calls.
(And even that reference is actually superflous in Linux but I'll leave
that for another patch)
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30531a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Christoph Hellwig [Thu, 6 Mar 2008 02:44:41 +0000 (13:44 +1100)]
[XFS] vnode cleanup in xfs_fs_subr.c
Cleanup the unneeded intermediate vnode step in the flushing helpers and
go directly from the xfs_inode to the struct address_space.
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30530a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Christoph Hellwig [Thu, 6 Mar 2008 02:44:35 +0000 (13:44 +1100)]
[XFS] cleanup xfs_vn_mknod
- use proper goto based unwinding instead of the current mess of
multiple conditionals
- rename ip to inode because that's the normal convention for Linux
inodes while ip is the convention for xfs_inodes
- remove unlikely checks for the default_acl - branches marked unlikely
might lead to extreme branch bredictor slowdons if taken and for some
workloads a default acl is quite common
- properly indent the switch statements
- remove xfs_has_fs_struct as nfsd has a fs_struct in any semi-recent
kernel
SGI-PV: 976035
SGI-Modid: xfs-linux-melb:xfs-kern:30529a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
David Chinner [Thu, 6 Mar 2008 02:44:14 +0000 (13:44 +1100)]
[XFS] Use atomics for iclog reference counting
Now that we update the log tail LSN less frequently on transaction
completion, we pass the contention straight to the global log state lock
(l_iclog_lock) during transaction completion.
We currently have to take this lock to decrement the iclog reference
count. there is a reference count on each iclog, so we need to take þhe
global lock for all refcount changes.
When large numbers of processes are all doing small trnasctions, the iclog
reference counts will be quite high, and the state change that absolutely
requires the l_iclog_lock is the except rather than the norm.
Change the reference counting on the iclogs to use atomic_inc/dec so that
we can use atomic_dec_and_lock during transaction completion and avoid the
need for grabbing the l_iclog_lock for every reference count decrement
except the one that matters - the last.
SGI-PV: 975671
SGI-Modid: xfs-linux-melb:xfs-kern:30505a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
David Chinner [Thu, 6 Mar 2008 02:44:06 +0000 (13:44 +1100)]
[XFS] Prevent AIL lock contention during transaction completion
When hundreds of processors attempt to commit transactions at the same
time, they can contend on the AIL lock when updating the tail LSN held in
the in-core log structure.
At the moment, the tail LSN is only needed when actually writing out an
iclog, so it really does not need to be updated on every single
transaction completion - only those that result in switching iclogs and
flushing them to disk.
The result is that we reduce the number of times we need to grab the AIL
lock and the log grant lock by up to two orders of magnitude on large
processor count machines. The problem has previously been hidden by AIL
lock contention walking the AIL list which was recently solved and
uncovered this issue.
SGI-PV: 975671
SGI-Modid: xfs-linux-melb:xfs-kern:30504a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
David Chinner [Thu, 6 Mar 2008 02:43:59 +0000 (13:43 +1100)]
[XFS] Use xfs_inode_clean() in more places
Remove open coded checks for the whether the inode is clean and replace
them with an inlined function.
SGI-PV: 977461
SGI-Modid: xfs-linux-melb:xfs-kern:30503a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
David Chinner [Thu, 6 Mar 2008 02:43:49 +0000 (13:43 +1100)]
[XFS] Remove the xfs_icluster structure
Remove the xfs_icluster structure and replace with a radix tree lookup.
We don't need to keep a list of inodes in each cluster around anymore as
we can look them up quickly when we need to. The only time we need to do
this now is during inode writeback.
Factor the inode cluster writeback code out of xfs_iflush and convert it
to use radix_tree_gang_lookup() instead of walking a list of inodes built
when we first read in the inodes.
This remove 3 pointers from each xfs_inode structure and the xfs_icluster
structure per inode cluster. Hence we reduce the cache footprint of the
xfs_inodes by between 5-10% depending on cluster sparseness.
To be truly efficient we need a radix_tree_gang_lookup_range() call to
stop searching once we are past the end of the cluster instead of trying
to find a full cluster's worth of inodes.
Before (ia64):
$ cat /sys/slab/xfs_inode/object_size 536
After:
$ cat /sys/slab/xfs_inode/object_size 512
SGI-PV: 977460
SGI-Modid: xfs-linux-melb:xfs-kern:30502a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
David Chinner [Thu, 6 Mar 2008 02:43:42 +0000 (13:43 +1100)]
[XFS] Don't block pdflush when writing back inodes
When pdflush is writing back inodes, it can get stuck on inode cluster
buffers that are currently under I/O. This occurs when we write data to
multiple inodes in the same inode cluster at the same time.
Effectively, delayed allocation marks the inode dirty during the data
writeback. Hence if the inode cluster was flushed during the writeback of
the first inode, the writeback of the second inode will block waiting for
the inode cluster write to complete before writing it again for the newly
dirtied inode.
Basically, we want to avoid this from happening so we don't block pdflush
and slow down all of writeback. Hence we introduce a non-blocking async
inode flush flag that pdflush uses. If this flag is set, we use
non-blocking operations (e.g. try locks) whereever we can to avoid
blocking or extra I/O being issued.
SGI-PV: 970925
SGI-Modid: xfs-linux-melb:xfs-kern:30501a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
David Chinner [Thu, 6 Mar 2008 02:43:34 +0000 (13:43 +1100)]
[XFS] Factor xfs_itobp() and xfs_inotobp().
The only difference between the functions is one passes an inode for the
lookup, the other passes an inode number. However, they don't do the same
validity checking or set all the same state on the buffer that is returned
yet they should.
Factor the functions into a common implementation.
SGI-PV: 970925
SGI-Modid: xfs-linux-melb:xfs-kern:30500a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Lachlan McIlroy [Thu, 6 Mar 2008 02:43:27 +0000 (13:43 +1100)]
[XFS] Fix regression due to refcache removal
SGI-PV: 971186
SGI-Modid: xfs-linux-melb:xfs-kern:30490a
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Donald Douwsma <donaldd@sgi.com>
Donald Douwsma [Thu, 6 Mar 2008 02:43:20 +0000 (13:43 +1100)]
[XFS] Remove the xfs_refcache
Remove the xfs_refcache, it was only needed while we were still
building for 2.4 kernels.
SGI-PV: 971186
SGI-Modid: xfs-linux-melb:xfs-kern:30472a
Signed-off-by: Donald Douwsma <donaldd@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Lachlan McIlroy [Thu, 6 Mar 2008 02:43:11 +0000 (13:43 +1100)]
[XFS] make inode reclaim synchronise with xfs_iflush_done()
On a forced shutdown, xfs_finish_reclaim() will skip flushing the inode.
If the inode flush lock is not already held and there is an outstanding
xfs_iflush_done() then we might free the inode prematurely. By acquiring
and releasing the flush lock we will synchronise with xfs_iflush_done().
SGI-PV: 909874
SGI-Modid: xfs-linux-melb:xfs-kern:30468a
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: David Chinner <dgc@sgi.com>
Niv Sardi [Thu, 6 Mar 2008 02:43:03 +0000 (13:43 +1100)]
[XFS] actually check error returned by xfs_flush_pages, clean up and
bailout if fails.
SGI-PV: 973041
SGI-Modid: xfs-linux-melb:xfs-kern:30462a
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:35 +0000 (00:46 +0200)]
ide: remove ide_init_default_irq() macro
* Use ide_default_irq() instead of ide_init_default_irq() in
ide_generic host driver (so the correct IRQ is always set
regardless of CONFIG_PCI / CONFIG_BLK_DEV_IDEPCI).
* Remove no longer needed ide_init_default_irq() macro.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:35 +0000 (00:46 +0200)]
ide: move default IDE ports setup to ide_generic host driver
* Make CONFIG_IDE_GENERIC depended on CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS.
* Move default IDE ports setup from init_ide_data() to ide_generic.
* Use ide_init_port_hw() in ide_generic.
* Remove no longer needed CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:35 +0000 (00:46 +0200)]
ide: remove obsoleted "idex=noprobe" kernel parameter (take 2)
* Remove obsoleted "idex=noprobe" kernel parameter.
* Remove no longer needed hwif->noprobe quirk from ide_hwif_configure()
and hwif->noprobe checking from cmd640.c.
v2:
* "ide?=noprobe" -> "ide?=ata66" in Documentation/kernel-parameters.txt.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:35 +0000 (00:46 +0200)]
ide: remove needless hwif->irq check from ide_hwif_configure()
ide_init_default_irq() is always zero for CONFIG_PCI=y so hwif->irq
check in ide_hwif_configure() can be safely removed.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:35 +0000 (00:46 +0200)]
ide: init hwif->{io_ports,irq} explicitly in legacy VLB host drivers
Do explicit port setup in legacy VLB host drivers instead of depending
on init_ide_data(). This way hwif->io_ports[] and hwif->irq are always
correctly set regardless of CONFIG_PCI / CONFIG_BLK_DEV_IDEPCI.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:35 +0000 (00:46 +0200)]
ide: limit legacy VLB host drivers to alpha, x86 and mips
These host drivers indirectly depend on CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS=y
which is defined only on alpha, x86, ia64, m32r, mips and ppc32.
Moreover:
- on ia64 there is no ISA
- m32r is too new for VLB
- on ppc32 ISA is available only on PPC_CHRP (no default IDE ports)
and PPC_PREP (marked as BROKEN)
[ the common sense tells me that VLB was only used on x86 but there
are urban legends that one of these host drivers was needed on some
other arch - thus the extra care ]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:34 +0000 (00:46 +0200)]
cmd640: init hwif->{io_ports,irq} explicitly
Do explicit port setup instead of depending on init_ide_data().
This way hwif->io_ports[] and hwif->irq are always correctly set
regardless of CONFIG_PCI / CONFIG_BLK_DEV_IDEPCI.
While at it fix printk().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:34 +0000 (00:46 +0200)]
cmd640: cleanup setup_device_ptrs()
This loop is no longer needed.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:34 +0000 (00:46 +0200)]
ide: add ide-4drives host driver (take 3)
CONFIG_BLK_DEV_4DRIVES deserves its own host driver:
* Add drivers/ide/legacy/ide-4drives.c and move "4drives" support there.
* Add ide-4drives.o in the link order after all other legacy host
drivers enabled by "ide0=" options (they all are mutually exclusive).
* Make ide-4drives host driver probe itself for IDE devices instead of
indirectly depending on ide_generic host driver.
* Add "probe" module parameter to ide-4drives and update documentation.
v2:
* s/paramater/parameter/ in ide.txt. (Noticed by Randy Dunlap)
v3:
* s/ide_4drives.probe/ide-4drives.probe/ in help entry.
(Noticed by Sergei Shtylyov)
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:34 +0000 (00:46 +0200)]
ide: remove ppc ifdef from init_ide_data()
On PPC32 ide_init_default_irq() is non-zero only for PPLUS and PPC_PREP
(the latter marked as BROKEN currently) so this ifdef can be removed.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:34 +0000 (00:46 +0200)]
ide: remove ide_default_io_ctl() macro
It is always == '((base) + 0x206)' if CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS=y
and it is not needed otherwise (arm, blackfin, parisc, ppc64, sh, sparc[64]).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:33 +0000 (00:46 +0200)]
ide: remove CONFIG_IDE_ARCH_OBSOLETE_INIT
* Use CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS instead of
CONFIG_IDE_ARCH_OBSOLETE_INIT in init_ide_data().
* Remove no longer needed CONFIG_IDE_ARCH_OBSOLETE_INIT.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:33 +0000 (00:46 +0200)]
ide: add CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS (take 2)
* Add CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS to drivers/ide/Kconfig and use
it instead of defining IDE_ARCH_OBSOLETE_DEFAULTS in <arch/ide.h>.
v2:
* Define ide_default_irq() in ide-probe.c/ns87415.c if not already defined
and drop defining ide_default_irq() for CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS=n.
[ Thanks to Stephen Rothwell and David Miller for noticing the problem. ]
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:32 +0000 (00:46 +0200)]
ppc/pmac: remove no longer needed IDE quirk
IDE PMAC host driver and all IDE PCI host drivers use pci_enable_device()
nowadays so the following quirk in pmac_pcibios_after_init() can be removed.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:32 +0000 (00:46 +0200)]
ppc: don't include <linux/ide.h>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:32 +0000 (00:46 +0200)]
ppc: remove ppc_ide_md
* Add special cases for pplus and prep to ide_default_{irq,io_base}()
(+ FIXMEs about the need to use IDE platform host driver instead).
* Remove no longer needed ppc_ide_md and struct ide_machdep_calls.
* Then remove <linux/ide.h> include from:
- arch/powerpc/kernel/setup_32.c
- arch/ppc/kernel/ppc_ksyms.c
- arch/ppc/kernel/setup.c
- arch/ppc/platforms/pplus.c
- arch/ppc/platforms/prep_setup.c
There should be no functional changes caused by this patch.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:31 +0000 (00:46 +0200)]
ppc/pplus: remove ppc_ide_md.ide_init_hwif hook
* Call ide_init_default_irq() for pplus in init_ide_data().
* Remove no longer needed pplus_ide_init_hwif_ports().
There should be no functional changes caused by this patch.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:30 +0000 (00:46 +0200)]
ppc/sandpoint: remove ppc_ide_md hooks
* Add IDE_HFLAG_FORCE_LEGACY_IRQS host flag for Motorola-Sandpoint platform
to sl82c105 host driver.
* Disable ide_generic host driver in arch/ppc/configs/sandpoint_defconfig
and enable sl82c105 one.
* Remove ppc_ide_md hooks from arch/ppc/platforms/sandpoint.c - no need for
them (sl82c105 host driver takes care of all this setup).
* Then remove no longer needed <linux/ide.h> include.
* Also update arch/ppc/platforms/sandpoint.h.
Unfortunately (unlike lopec's case) sl82c105 host driver was not enabled
in defconfing so there is a funcionality change.
[ Not a big deal since sl82c105 is superior over ide_generic. ]
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:29 +0000 (00:46 +0200)]
ppc/lopec: remove ppc_ide_md hooks
* Add IDE_HFLAG_FORCE_LEGACY_IRQS host flag for Motorola-LoPEC platform
to sl82c105 host driver.
* Remove ppc_ide_md hooks from arch/ppc/platforms/lopec.c - no need for
them (sl82c105 host driver takes care of all this setup).
* Then remove no longer needed <linux/ide.h> include.
Looking at arch/ppc/configs/lopec_defconfig:
...
CONFIG_IDE_GENERIC=y
CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_IDEPCI_SHARE_IRQ is not set
# CONFIG_BLK_DEV_OFFBOARD is not set
CONFIG_BLK_DEV_GENERIC=y
# CONFIG_BLK_DEV_OPTI621 is not set
CONFIG_BLK_DEV_SL82C105=y
...
there should be no functional changes unless somebody preferred to disable
sl82c105 host driver and use only ide_generic one (but why would anybody
want to do such thing :-).
PS It seems that lopec_defconfig hasn't been updated for ages but if somebody
is going to do it please look into disabling IDE_GENERIC and BLK_DEV_GENERIC
config options. Thanks.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:29 +0000 (00:46 +0200)]
ppc/mpc8xx: remove ppc_ide_md hooks
* Initialize IDE ports in mpc8xx_ide_probe().
* Remove m8xx_ide_init() and ppc_ide_md hooks - no need for them
(IDE mpc8xx host driver takes care of all this setup).
* Remove needless 'if (irq)' and 'if (data_port >= MAX_HWIFS)' checks
from m8xx_ide_init_hwif_ports().
* Remove 'ctrl_port' and 'irq' arguments from m8xx_ide_init_hwif_ports().
* Rename m8xx_ide_init_hwif_ports() to m8xx_ide_init_ports().
* Add __init tag to m8xx_ide_init_ports().
This patch fixes hwif->irq always being overriden to 0 (== auto-probe, is
this even working on PPC?) because of ide_init_default_irq() call in ide.c.
There should be no other functional changes.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Vitaly Bordug <vitb@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:29 +0000 (00:46 +0200)]
ppc/pmac: remove ppc_ide_md hooks
* Add pmac_ide_init_ports() helper and use it instead of
pmac_ide_init_hwif_ports().
* Remove ppc_ide_md hooks - no need for them
(IDE pmac host driver takes care of all this setup).
* Then remove no longer needed <linux/ide.h> include
from arch/powerpc/platforms/powermac/pmac.h.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:28 +0000 (00:46 +0200)]
ppc/ppc4xx: remove ppc_ide_md hooks
There are no "default" IDE ports on PPC4xx so ppc4xx_ide_init_hwif_ports() is
unnecessary, remove it. Also remove no longer needed <linux/ide.h> include.
There should be no functional changes caused by this patch.
Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:28 +0000 (00:46 +0200)]
ppc/hdpu: remove dead IDE code
Also remove now not needed <linux/ide.h> include.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:28 +0000 (00:46 +0200)]
ide-pmac: remove dead code
Remove unused pmac_ide_{check_base,get_irq}() and pmac_find_ide_boot(),
then remove no longer needed ide_majors[] and pmac_ide_count.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:27 +0000 (00:46 +0200)]
ide-scsi: do non-atomic pc->flags testing
...also, convert ide-scsi to using the generic pc->flags defines.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:27 +0000 (00:46 +0200)]
ide: use generic ATAPI packet command flags in ide-{floppy,tape}
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:27 +0000 (00:46 +0200)]
ide-floppy: rename end_request handler properly
mv idefloppy_do_end_request -> idefloppy_end_request as is the case with ide-cd
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:27 +0000 (00:46 +0200)]
ide-scsi: convert driver to using generic ide_atapi_pc
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:27 +0000 (00:46 +0200)]
ide-floppy: convert driver to using generic ide_atapi_pc
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:27 +0000 (00:46 +0200)]
ide-tape: convert driver to using generic ide_atapi_pc
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:26 +0000 (00:46 +0200)]
ide: add generic packet command representation ide_atapi_pc
This new struct unifies ide{-floppy,-tape,-scsi}'s view of a packet command. For now,
it represents the common denominator between the three drivers while adding driver-
specific members at the end of the struct which will be merged/simplified into the
generic ATAPI handling code in later steps, or removed completely.
Bart:
- move struct ide_atapi_pc outside of #ifdef/#endif CONFIG_IDE_PROC_FS
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:26 +0000 (00:46 +0200)]
ide-tape: remove atomic test/set macros for packet commands
Removing the atomic tests for pc's is unobjectionable. Since this driver will
probably go to /dev/null soon, the atomic tests for tape->flags are left in
place for there are some situations where they're needed (chrdev DSC handling,
low level pipeline operation and so on). While at it, rename all test/set flag
bit defines explicitly to *_FLAG_* for clarity.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:26 +0000 (00:46 +0200)]
ide-tape: move all struct and other defs at the top
Bart:
- no need to move defines for tape flags around
(they are completely rewritten by the next patch)
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:26 +0000 (00:46 +0200)]
ide: remove IDE_*_REG macros
* Add IDE_{ALTSTATUS,IREASON,BCOUNTL,BCOUNTH}_OFFSET defines.
* Remove IDE_*_REG macros - this results in more readable
and slightly smaller code.
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:26 +0000 (00:46 +0200)]
ide: add ide_atapi_{discard_data,write_zeros} inline helpers
Add ide_atapi_{discard_data,write_zeros} inline helpers to <linux/ide.h>
and use them instead of home-brewn helpers in ide-{floppy,tape,scsi}.
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Thu, 17 Apr 2008 22:46:25 +0000 (00:46 +0200)]
ide-floppy: remove struct idefloppy_id_gcw
Bart:
- minor fixups
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Akira Iguchi [Thu, 17 Apr 2008 22:46:25 +0000 (00:46 +0200)]
scc_pata.c: do setup itself instead of ide_setup_pci_device()
scc_pata has the different BAR configuration and using ide_setup_pci_device()
is inappropriate.
(ide_setup_pci_device() expects a normal PCI IDE controller with
BAR0..BAR3 either non-existant or being primary/secondary port bases
in I/O space.)
This patch do all needed setup itself instead of calling ide_setup_pci_device().
[bart: minor checkpatch.pl fixes]
Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Signed-off-by: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:25 +0000 (00:46 +0200)]
ide: remove ide_init_hwif_ports()
ide_init_hwif_ports() is only used by init_ide_data() now, inline it there.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:25 +0000 (00:46 +0200)]
ide: remove init_hwif_default()
init_hwif_default() is only used by init_ide_data() now, inline it there.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:24 +0000 (00:46 +0200)]
ide: remove ->hold field from ide_hwif_t (take 2)
->hold is write-only now, remove it.
v2:
* v1 missed bast-ide, palm_bk3710, ide-cs and delkin_cb host drivers.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:24 +0000 (00:46 +0200)]
ide: remove broken/dangerous HDIO_[UNREGISTER,SCAN]_HWIF ioctls (take 3)
hdparm explicitely marks HDIO_[UNREGISTER,SCAN]_HWIF ioctls as DANGEROUS
and given the number of bugs we can assume that there are no real users:
* DMA has no chance of working because DMA resources are released by
ide_unregister() and they are never allocated again.
* Since ide_init_hwif_ports() is used for ->io_ports[] setup the ioctls
don't work for almost all hosts with "non-standard" (== non ISA-like)
layout of IDE taskfile registers (there is a lot of such host drivers).
* ide_port_init_devices() is not called when probing IDE devices so:
- drive->autotune is never set and IDE host/devices are not programmed
for the correct PIO/DMA transfer modes (=> possible data corruption)
- host specific I/O 32-bit and IRQ unmasking settings are not applied
(=> possible data corruption)
- host specific ->port_init_devs method is not called (=> no luck with
ht6560b, qd65xx and opti621 host drivers)
* ->rw_disk method is not preserved (=> no HPT3xxN chipsets support).
* ->serialized flag is not preserved (=> possible data corruption when
using icside, aec62xx (ATP850UF chipset), cmd640, cs5530, hpt366
(HPT3xxN chipsets), rz1000, sc1200, dtc2278 and ht6560b host drivers).
* ->ack_intr method is not preserved (=> needed by ide-cris, buddha,
gayle and macide host drivers).
* ->sata_scr[] and sata_misc[] is cleared by ide_unregister() and it
isn't initialized again (SiI3112 support needs them).
* To issue an ioctl() there need to be at least one IDE device present
in the system.
* ->cable_detect method is not preserved + it is not called when probing
IDE devices so cable detection is broken (however since DMA support is
also broken it doesn't really matter ;-).
* Some objects which may have already been freed in ide_unregister()
are restored by ide_hwif_restore() (i.e. ->hwgroup).
* ide_register_hw() may unregister unrelated IDE ports if free ide_hwifs[]
slot cannot be found.
* When IDE host drivers are modular unregistered port may be re-used by
different host driver that owned it first causing subtle bugs.
Since we now have a proper warm-plug support remove these ioctls,
then remove no longer needed:
- ide_register_hw() and ide_hwif_restore() functions
- 'init_default' and 'restore' arguments of ide_unregister()
- zeroeing of hwif->{dma,extra}_* fields in ide_unregister()
As an added bonus IDE core code size shrinks by ~3kB (x86-32).
v2:
* fix ide_unregister() arguments in cleanup_module() (Andrew Morton).
v3:
* fix ide_unregister() arguments in palm_bk3710.c.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:24 +0000 (00:46 +0200)]
ide: remove obsoleted "idex=base[,ctl[,irq]]" kernel parameters (take 2)
* Remove obsoleted "idex=base[,ctl[,irq]]" kernel parameters
and update Documentation/ide/ide.txt.
* Remove no longer needed ide_forced chipset type.
v2:
* is_chipset_set[] -> is_chipset_set in ide.c.
* Documentation/ide/ide.txt fix.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:24 +0000 (00:46 +0200)]
ide: remove CONFIG_BLK_DEV_HD_IDE config option (take 2)
* Remove CONFIG_BLK_DEV_HD hack from init_hwif_default()
("hda=noprobe hdb=noprobe" kernel parameters should be used
instead if somebody wishes to use the old "hd" driver).
* Make CONFIG_BLK_DEV_HD_ONLY config option available also when
IDE subsystem is used and update help entry.
* Remove no longer needed CONFIG_BLK_DEV_HD_IDE config option.
v2:
* Update documentation to suggest "hda=noprobe hdb=noprobe"
instead of obsoleted "ide0=noprobe".
* Update Documentation/ide/ide.txt.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:23 +0000 (00:46 +0200)]
ide: remove needless CONFIG_BLK_DEV_HD hack from init_hwif()
request_irq() will fail if there is already another IRQ handler
registered and IRQ flags are mismatched.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:23 +0000 (00:46 +0200)]
ide-generic: add ide_generic class and attribute for adding new interfaces
* Add ide_generic_sysfs_init() helper registering 'ide_generic' class
(together with ide_generic_class_release() ->class_release method)
and use it in ide_generic_init().
* Add "add" class attribute to 'ide_generic' class for adding new interfaces
(it is intended to be a replacement for obsoleted "idex=base[,ctl[,irq]]"
kernel parameters).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:23 +0000 (00:46 +0200)]
ide: add warm-plug support for IDE devices (take 2)
* Add 'struct class ide_port_class' ('ide_port' class) and a 'struct
device *portdev' ('ide_port' class device) in ide_hwif_t.
* Register 'ide_port' class in ide_init() and unregister it in
cleanup_module().
* Create ->portdev in ide_register_port () and unregister it in
ide_unregister().
* Add "delete_devices" class device attribute for unregistering IDE devices
on a port and "scan" one for probing+registering IDE devices on a port.
* Add ide_sysfs_register_port() helper for registering "delete_devices"
and "scan" attributes with ->portdev. Call it in ide_device_add_all().
* Document IDE warm-plug support in Documentation/ide/warm-plug-howto.txt.
v2:
* Convert patch from using 'struct class_device' to use 'struct device'.
(thanks to Kay Sievers for doing it)
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:23 +0000 (00:46 +0200)]
ide: remove dead/obsolete ->busproc method
->busproc method is used by HDIO_SET_BUSSTATE ioctl but it has no chance
of working as intended (in 2.4.x days) because to issue an ioctl there
is a device node needed and:
- for BUSSTATE_TRISTATE+OFF it is too late (devices are already gone)
- for BUSSTATE_TRISTATE+ON it is too early (devices are not registered yet)
Just remove ->busproc method for now (it was only implemented by hpt366,
siimage and tc86c001 host drivers).
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:23 +0000 (00:46 +0200)]
ide: rework PowerMac media-bay support (take 2)
Rework PowerMac media-bay support in such way that instead of
un/registering the IDE interface we un/register IDE devices:
* Add ide_port_scan() helper for probing+registerering devices on a port.
* Rename ide_port_unregister_devices() to __ide_port_unregister_devices().
* Add ide_port_unregister_devices() helper for unregistering devices on a port.
* Add 'ide_hwif_t *cd_port' to 'struct media_bay_info', pass 'hwif' instead
of hwif->index to media_bay_set_ide_infos() and use it to setup 'cd_port'.
* Use ide_port_unregister_devices() instead of ide_unregister()
and ide_port_scan() instead of ide_register_hw() in media_bay_step().
* Unexport ide_register_hw() and make it static.
v2:
* Fix build by adding <linux/ide.h> include to <asm-powerpc/mediabay.h>.
(Reported by Michael/Kamalesh/Andrew).
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Michael Ellerman <michael@ellerman.id.au>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:22 +0000 (00:46 +0200)]
ide: move ide_port_setup_devices() call to ide_device_add_all()
Add ide_cfg_mtx lock/unlock to ide_port_setup_devices() and then move
ide_port_setup_devices() call from init_irq() to ide_device_add_all().
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:22 +0000 (00:46 +0200)]
ide: factor out devices init from ide_init_port_data()
* Factor out devices init from ide_init_port_data() to
ide_port_init_devices_data().
While at it:
* Add explicit clearing of IDE device structure.
There should be no functionality changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:22 +0000 (00:46 +0200)]
ide: factor out code unregistering devices from ide_unregister()
Factor out code unregistering devices from ide_unregister() to
ide_port_unregister_devices().
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:22 +0000 (00:46 +0200)]
ide: remove IDE devices from /proc/ide/ before unregistering them
IDE devices need to be removed from /proc/ide/ _before_ being unregistered:
* Drop 'ide_hwif_t *hwif' argument from destroy_proc_ide_device()
and use drive->hwif instead.
* Rename destroy_proc_ide_device() to ide_proc_unregister_device().
* Call ide_proc_unregister_device() in drive_release_dev().
* Remove no longer needed destroy_proc_ide_drives().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:22 +0000 (00:46 +0200)]
ide: factor out cable detection from ide_init_port()
* Factor out cable detection from ide_init_port() to ide_port_cable_detect().
* Move ide_port_cable_detect() call to ide_device_add_all().
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:21 +0000 (00:46 +0200)]
ide-acpi: add missing drive->acpidata zeroing
There should be no functionality changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:21 +0000 (00:46 +0200)]
ide: use ide_find_port() instead of ide_deprecated_find_port()
* Use ide_find_port() instead of ide_deprecated_find_port() in bast-ide/
palm_bk3710/ide-cs/delkin_cb host drivers and in ide_register_hw().
* Remove no longer needed ide_deprecated_find_port().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:21 +0000 (00:46 +0200)]
ide: fix ide_find_port()
* Instead of checking for '->io_ports[IDE_DATA_OFFSET] == 0' check for
'->chipset == ide_unknown' when looking for an empty ide_hwifs[] slot.
* Do ide-pnp initialization after ide-generic when IDE is built-in
(ide-pnp is the only user of ide_find_port() which needs such fixup).
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz [Thu, 17 Apr 2008 22:46:21 +0000 (00:46 +0200)]
ide-generic: set hwif->chipset
This hwif->chipset fixup is already present in ide_device_add_all()
but for warm-plug support we also need to reserve not currently present
interfaces.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Greg Kroah-Hartman [Thu, 17 Apr 2008 22:46:20 +0000 (00:46 +0200)]
IDE: remove ide=reverse IDE core
This option is obsolete and can be removed safely.
It allows us to remove the pci_get_device_reverse() function from the
PCI core.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Dan Williams [Fri, 18 Apr 2008 03:17:26 +0000 (20:17 -0700)]
dmaengine: ack to flags: make use of the unused bits in the 'ack' field
'ack' is currently a simple integer that flags whether or not a client is done
touching fields in the given descriptor. It is effectively just a single bit
of information. Converting this to a flags parameter allows the other bits to
be put to use to control completion actions, like dma-unmap, and capture
results, like xor-zero-sum == 0.
Changes are one of:
1/ convert all open-coded ->ack manipulations to use async_tx_ack
and async_tx_test_ack.
2/ set the ack bit at prep time where possible
3/ make drivers store the flags at prep time
4/ add flags to the device_prep_dma_interrupt prototype
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams [Fri, 18 Apr 2008 03:17:26 +0000 (20:17 -0700)]
iop-adma: remove the workaround for missed interrupts on iop3xx
This workaround was covering the dependency submission bug in async_tx.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams [Fri, 18 Apr 2008 03:17:26 +0000 (20:17 -0700)]
async_tx: kill ->device_dependency_added
DMA drivers no longer need to be notified of dependency submission
events as async_tx_run_dependencies and async_tx_channel_switch will
handle the scheduling and execution of dependent operations.
[sfr@canb.auug.org.au: extend this for fsldma]
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Dan Williams [Fri, 18 Apr 2008 03:17:25 +0000 (20:17 -0700)]
async_tx: fix multiple dependency submission
Shrink struct dma_async_tx_descriptor and introduce
async_tx_channel_switch to properly inject a channel switch interrupt in
the descriptor stream. This simplifies the locking model as drivers no
longer need to handle dma_async_tx_descriptor.lock.
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Zhang Wei [Fri, 18 Apr 2008 03:17:25 +0000 (20:17 -0700)]
fsldma: Split the MPC83xx event from MPC85xx and refine irq codes.
Split MPC83xx EOCDI event from MPC85xx EOLNI event, which is
also need to update cookie and start the next transfer.
The DMA channel irq handler function code is refined.
The patch is tested on MPC8377MDS board.
Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by; Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Zhang Wei [Fri, 18 Apr 2008 03:17:25 +0000 (20:17 -0700)]
fsldma: Remove CONFIG_FSL_DMA_SELFTEST, keep fsl_dma_self_test() running always.
Always enabling the fsl_dma_self_test() to ensure the DMA controller
should works well after the driver probed.
Signed-off-by: Zhang Wei <wei.zhang@freescale.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Shaohua Li [Tue, 25 Mar 2008 08:50:45 +0000 (16:50 +0800)]
ata-acpi: don't call _GTF for disabled drive
I got below log after a S3 resume in a ASUS A6VC laptop. The system has
only one IDE drive. It appears there is no reason calling _GTF for
disabled drive.
ACPI Error (dsopcode-0483): Attempt to CreateField of length zero [
20070126]
ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.RATA] (Node
df822a7c), AE_AML_OPERAND_VALUE
ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.CHN1.DRV0._GTF] (Node
df822bd0), AE_AML_OPERAND_VALUE
ata2.00: _GTF evaluation failed (AE 0x3006)
ACPI Error (dsopcode-0483): Attempt to CreateField of length zero [
20070126]
ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.RATA] (Node
df822a7c), AE_AML_OPERAND_VALUE
ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.IDE0.CHN1.DRV1._GTF] (Node
df822b94), AE_AML_OPERAND_VALUE
ata2.01: _GTF evaluation failed (AE 0x3006)
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Mark Lord [Wed, 16 Apr 2008 19:01:19 +0000 (15:01 -0400)]
sata_mv add temporary 3 second init delay for SiliconImage PMs
sata_mv does not yet fully support hotplug (coming soon, though).
This means that the driver may not find a Silicon Image port-multiplier
when first loaded, because those devices take in exceess of 3 seconds
to sync up the SATA PHY (most devices do this in mere microseconds).
So, as a short-term interim measure, here we insert a 3-second pause
on initial driver load, once per controller board (not once per port!),
to allow the Silicon Image port-multipliers to be detected later.
This will be removed again (soon!) once hotplug is fully implemented/working.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Mark Lord [Wed, 16 Apr 2008 19:00:17 +0000 (15:00 -0400)]
sata_mv remove redundant edma init code
Remove unnecessary edma init code from port_start.
This sequence gets done later on the first I/O to the port.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Mark Lord [Wed, 16 Apr 2008 18:59:07 +0000 (14:59 -0400)]
sata_mv add basic port multiplier support
Add basic port-multiplier support to sata_mv.
This works in Command-based-switching mode for Gen-II chipsets,
and in FIS-based-switching mode for Gen-IIe chipsets.
Error handling remains at the primary port level for now
(works okay, but not great). This will get fixed in a subsequent
patch series for IRQ/EH handling fixes. There are also some
known NCQ/PMP errata to be dealt with in the near future,
once we have this basic PMP support in place.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Mark Lord [Wed, 16 Apr 2008 18:58:13 +0000 (14:58 -0400)]
sata_mv fix SOC flags, enable NCQ on SOC
The System-On-Chip (SOC) core supports all of the same
features as the other recent Marvell chips,
including NCQ and IRQ coalescing.
Fix the chip_soc flags to enable these capabilities
(note that the driver currently does nothing special
for IRQ coalescing, though).
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Mark Lord [Wed, 16 Apr 2008 18:57:25 +0000 (14:57 -0400)]
sata_mv disable hotplug for now
Disable hot plug/unplug detection in sata_mv for now.
It is currently broken, and also interferes with PMP support.
This will get fixed in a subsequent patch series.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Mark Lord [Wed, 16 Apr 2008 18:56:51 +0000 (14:56 -0400)]
sata_mv cosmetics
More cosmetic cleanups to unclutter the changes needed for PMP support.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Mark Lord [Wed, 16 Apr 2008 18:56:12 +0000 (14:56 -0400)]
sata_mv hardreset rework
Rework and simplify sata_mv's hardreset code to take advantage of
libata improvements since it was first coded.
Also, get rid of the now unnecessary prereset, postreset, and phy_reset
functions.
This patch also paves the way for subsequent pmp support patches,
which will follow once this one passes muster.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Jeff Garzik [Thu, 17 Apr 2008 19:55:24 +0000 (15:55 -0400)]
[libata] improve Kconfig help text for new PMP, SFF options
Tejun Heo [Wed, 30 Jan 2008 09:18:26 +0000 (18:18 +0900)]
libata: make EH fail gracefully if no reset method is available
When no reset method is available, libata currently oopses. Although
the condition can't happen unless there's a bug in a low level driver,
oopsing isn't the best way to report the error condition. Complain,
dump stack and fail reset instead.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Alan Cox [Tue, 8 Apr 2008 15:36:44 +0000 (16:36 +0100)]
libata: Be a bit more slack about early devices
We have a certain number of 'ATA' emulations often on CF or other flash
devices that are at best "loosely based" on the CF 1.1 standard. These
devices report themselves as disk but don't support the ATA minimal
command set only the CF 1.1 set.
Relax the PIO checking for devices reporting ATA rev 0, or no iordy
support, or CFA. Rework the code a bit as it was already messy and this
made it quite ugly.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Alan Cox [Tue, 8 Apr 2008 15:37:50 +0000 (16:37 +0100)]
libata: cable logic
The cable detect isolation patch inadvertently removed 40 wire short
cable handling. Put it back
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Tejun Heo [Mon, 7 Apr 2008 16:46:56 +0000 (01:46 +0900)]
libata: move link onlineness check out of softreset methods
Currently, SATA softresets should do link onlineness check before
actually performing SRST protocol but it doesn't really belong to
softreset.
This patch moves onlineness check in softreset to ata_eh_reset() and
ata_eh_followup_srst_needed() to clean up code and help future sata_mv
changes which need clear separation between SCR and TF accesses.
sata_fsl is peculiar in that its softreset really isn't softreset but
combination of hardreset and softreset. This patch adds dummy private
->prereset to keep the current behavior but the driver really should
implement separate hard and soft resets and return -EAGAIN from
hardreset if it should be follwed by softreset.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Tejun Heo [Mon, 7 Apr 2008 16:25:35 +0000 (01:25 +0900)]
libata: kill dead code paths in reset path
Some code paths which had been made obsolete by recent reset
simplification were still around. Kill them.
* ata_eh_reset() checked for ATA_DEV_UNKNOWN to determine
classification failure. This is no longer applicable.
* ata_do_reset() should convert ATA_DEV_UNKNOWN to ATA_DEV_NONE
regardless of reset result (e.g. -EAGAIN).
* LLDs don't need to convert ATA_DEV_UNKNOWN to ATA_DEV_NONE.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Stephen Rothwell [Wed, 9 Apr 2008 03:34:40 +0000 (13:34 +1000)]
pata_scc: fix build breakage
drivers/ata/pata_scc.c: In function 'scc_bus_softreset':
drivers/ata/pata_scc.c:594: error: 'deadlien' undeclared (first use in this function)
drivers/ata/pata_scc.c:594: error: (Each undeclared identifier is reported only once
drivers/ata/pata_scc.c:594: error: for each function it appears in.)
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Tejun Heo [Mon, 7 Apr 2008 13:47:22 +0000 (22:47 +0900)]
libata: make PMP support optional
Make PMP support optional by adding CONFIG_SATA_PMP and leaving out
libata-pmp.c if it isn't set. PMP helpers return constant values if
PMP support is not enabled and PMP declarations alias non-PMP
counterparts. This makes the compiler to leave out PMP related part
out and LLDs to use non-PMP counterparts automatically.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Tejun Heo [Mon, 7 Apr 2008 13:47:22 +0000 (22:47 +0900)]
libata: implement PMP helpers
Implement helpers to test whether PMP is supported, attached and
determine pmp number to use when issuing SRST to a link. While at it,
move ata_is_host_link() so that it's together with the two new PMP
helpers.
This change simplifies LLDs and helps making PMP support optional.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Tejun Heo [Mon, 7 Apr 2008 13:47:21 +0000 (22:47 +0900)]
libata: separate PMP support code from core code
Most of PMP support code is already in libata-pmp.c. All that are in
libata-core.c are sata_pmp_port_ops and EXPORTs. Move them to
libata-pmp.c. Also, collect PMP related prototypes and declarations
in header files and move them right above of SFF stuff.
This change is to make PMP support optional.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Tejun Heo [Mon, 7 Apr 2008 13:47:21 +0000 (22:47 +0900)]
libata: make SFF support optional
Now that SFF support is completely separated out from the core layer,
it can be made optional. Add CONFIG_ATA_SFF and let SFF drivers
depend on it. If CONFIG_ATA_SFF isn't set, all codes in libata-sff.c
and data structures for SFF support are disabled. This saves good
number of bytes for small systems.
Signed-off-by: Tejun Heo <htejun@gmail.com>