GitHub/LineageOS/android_kernel_motorola_exynos9610.git
17 years agolib: percpu_counter_set
Peter Zijlstra [Wed, 17 Oct 2007 06:25:44 +0000 (23:25 -0700)]
lib: percpu_counter_set

Provide a method to set a percpu counter to a specified value.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agolib: make percpu_counter_add take s64
Peter Zijlstra [Wed, 17 Oct 2007 06:25:43 +0000 (23:25 -0700)]
lib: make percpu_counter_add take s64

percpu_counter is a s64 counter, make _add consitent.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agolib: percpu_counter variable batch
Peter Zijlstra [Wed, 17 Oct 2007 06:25:43 +0000 (23:25 -0700)]
lib: percpu_counter variable batch

Because the current batch setup has an quadric error bound on the counter,
allow for an alternative setup.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agolib: percpu_counter_sub
Peter Zijlstra [Wed, 17 Oct 2007 06:25:42 +0000 (23:25 -0700)]
lib: percpu_counter_sub

Hugh spotted that some code does:
  percpu_counter_add(&counter, -unsignedlong)

which, when the amount argument is of type s32, sort-of works thanks to
two's-complement. However when we'd change the type to s64 this breaks on 32bit
machines, because the promotion rules zero extend the unsigned number.

Provide percpu_counter_sub() to hide the s64 cast. That is:
  percpu_counter_sub(&counter, foo)
is equal to:
  percpu_counter_add(&counter, -(s64)foo);

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agolib: percpu_counter_add
Peter Zijlstra [Wed, 17 Oct 2007 06:25:42 +0000 (23:25 -0700)]
lib: percpu_counter_add

 s/percpu_counter_mod/percpu_counter_add/

Because its a better name, _mod implies modulo.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agonfs: remove congestion_end()
Peter Zijlstra [Wed, 17 Oct 2007 06:25:41 +0000 (23:25 -0700)]
nfs: remove congestion_end()

These patches aim to improve balance_dirty_pages() and directly address three
issues:
  1) inter device starvation
  2) stacked device deadlocks
  3) inter process starvation

1 and 2 are a direct result from removing the global dirty limit and using
per device dirty limits. By giving each device its own dirty limit is will
no longer starve another device, and the cyclic dependancy on the dirty limit
is broken.

In order to efficiently distribute the dirty limit across the independant
devices a floating proportion is used, this will allocate a share of the total
limit proportional to the device's recent activity.

3 is done by also scaling the dirty limit proportional to the current task's
recent dirty rate.

This patch:

nfs: remove congestion_end().  It's redundant, clear_bdi_congested() already
wakes the waiters.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agopowerpc: add Altivec/VMX state to coredumps
Mark Nelson [Wed, 17 Oct 2007 06:25:40 +0000 (23:25 -0700)]
powerpc: add Altivec/VMX state to coredumps

Update dump_task_altivec() (which has so far never been put to use) so that
it dumps the Altivec/VMX registers (VR[0] - VR[31], VSCR and VRSAVE) in the
same format as the ptrace get_vrregs(), and add the appropriate glue
typedef and #defines to make it work.

A new note type of NT_PPC_VMX was chosen to be 0x100 (arbitrarily) because
it allows the low range values to be used for more generic purposes and
0x100 seems an adequate starting point for PowerPC extensions.

Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agox86: replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define
Mark Nelson [Wed, 17 Oct 2007 06:25:39 +0000 (23:25 -0700)]
x86: replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE #define

Replace NT_PRXFPREG with ELF_CORE_XFPREG_TYPE in the coredump code which
allows for more flexibility in the note type for the state of 'extended
floating point' implementations in coredumps.  New note types can now be
added with an appropriate #define.

This does #define ELF_CORE_XFPREG_TYPE to be NT_PRXFPREG in all
current users so there's are no change in behaviour.

This will let us use different note types on powerpc for the Altivec/VMX
state that some PowerPC cpus have (G4, PPC970, POWER6) and for the SPE
(signal processing extension) state that some embedded PowerPC cpus from
Freescale have.

Signed-off-by: Mark Nelson <markn@au1.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Andi Kleen <ak@suse.de>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agopartially fix up the lookup_one_noperm mess
Christoph Hellwig [Wed, 17 Oct 2007 06:25:38 +0000 (23:25 -0700)]
partially fix up the lookup_one_noperm mess

Try to fix the mess created by sysfs braindamage.

 - refactor code internal to fs/namei.c a little to avoid too much
   duplication:
o __lookup_hash_kern is renamed back to __lookup_hash
o the old __lookup_hash goes away, permission checks moves to
  the two callers
o useless inline qualifiers on above functions go away
 - lookup_one_len_kern loses it's last argument and is renamed to
   lookup_one_noperm to make it's useage a little more clear
 - added kerneldoc comments to describe lookup_one_len aswell as
   lookup_one_noperm and make it very clear that no one should use
   the latter ever.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Wed, 17 Oct 2007 02:06:48 +0000 (19:06 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  WOL bugfix for 3c59x.c
  skge 1.12
  skge: add a debug interface
  skge: eeprom support
  skge: internal stats
  skge: XM PHY handling fixes
  skge: changing MTU while running causes problems
  skge: fix ram buffer size calculation
  gianfar: Fix compile regression caused by 09f75cd7
  net: Fix new EMAC driver for NAPI changes
  bonding: two small fixes for IPoIB support
  e1000e: don't poke PHY registers to retreive link status
  e1000e: fix error checks
  e1000e: Fix debug printk macro
  tokenring/3c359.c: fixed array index problem
  [netdrvr] forcedeth: remove in-driver copy of net_device_stats
  [netdrvr] forcedeth: improved probe info; dev_printk() cleanups
  forcedeth: fix NAPI rx poll function

17 years agomissing include in mmc
Al Viro [Wed, 17 Oct 2007 00:09:07 +0000 (01:09 +0100)]
missing include in mmc

AFAICS, fallout from repacing include of blkdev.h with include of bio.h.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agofix adbhid mismerge
Al Viro [Wed, 17 Oct 2007 00:02:46 +0000 (01:02 +0100)]
fix adbhid mismerge

This fixes a lost 'key' variable declaration that went missing in a
mismerge (commit b981d8b3f5e008ff10d993be633ad00564fc22cd)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoWOL bugfix for 3c59x.c
Steffen Klassert [Tue, 16 Oct 2007 21:24:09 +0000 (14:24 -0700)]
WOL bugfix for 3c59x.c

Some NICs (3c905B) can not generate PME in power state PCI_D0, while others
like 3c905C can.  Call pci_enable_wake() with PCI_D3hot should give proper
WOL for 3c905B.

Signed-off-by: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
Tested-by: Harry Coin <hcoin@n4comm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge 1.12
Stephen Hemminger [Tue, 16 Oct 2007 19:15:55 +0000 (12:15 -0700)]
skge 1.12

version update

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: add a debug interface
Stephen Hemminger [Tue, 16 Oct 2007 19:15:54 +0000 (12:15 -0700)]
skge: add a debug interface

Add a debugfs interface to look at internal ring state.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: eeprom support
Stephen Hemminger [Tue, 16 Oct 2007 19:15:53 +0000 (12:15 -0700)]
skge: eeprom support

Add ability to read/write EEPROM

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: internal stats
Stephen Hemminger [Tue, 16 Oct 2007 19:15:52 +0000 (12:15 -0700)]
skge: internal stats

Use internal stats structure

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: XM PHY handling fixes
Stephen Hemminger [Tue, 16 Oct 2007 19:15:51 +0000 (12:15 -0700)]
skge: XM PHY handling fixes

Change how PHY is managed on SysKonnect fibre based boards.
Poll for PHY coming up 1 per second, but use interrupt to detect loss.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: changing MTU while running causes problems
Stephen Hemminger [Tue, 16 Oct 2007 19:15:50 +0000 (12:15 -0700)]
skge: changing MTU while running causes problems

Rather than bring network down/up when changing MTU,
only need to impact receiver.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoskge: fix ram buffer size calculation
Stephen Hemminger [Tue, 16 Oct 2007 19:15:49 +0000 (12:15 -0700)]
skge: fix ram buffer size calculation

This fixes problems with transmit hangs on older fiber based SysKonnect boards.

Adjust ram buffer sizing calculation to make it correct on all boards
and make it like the code in sky2 driver.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agogianfar: Fix compile regression caused by 09f75cd7
Li Yang [Tue, 16 Oct 2007 06:18:13 +0000 (14:18 +0800)]
gianfar: Fix compile regression caused by 09f75cd7

Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agonet: Fix new EMAC driver for NAPI changes
Benjamin Herrenschmidt [Tue, 16 Oct 2007 05:40:50 +0000 (15:40 +1000)]
net: Fix new EMAC driver for NAPI changes

net: Fix new EMAC driver for NAPI changes

This fixes the new EMAC driver for the NAPI updates. The previous patch
by Roland Dreier (already applied) to do that doesn't actually work. This
applies on top of it makes it work on my test Ebony machine.

This patch depends on "net: Add __napi_sycnhronize() to sync with napi poll"
posted previously.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agobonding: two small fixes for IPoIB support
Jay Vosburgh [Mon, 15 Oct 2007 23:44:27 +0000 (16:44 -0700)]
bonding: two small fixes for IPoIB support

Two small fixes to IPoIB support for bonding:

1- copy header_ops from slave to bonding for IPoIB slaves
2- move release and destroy logic to UNREGISTER from GOING_DOWN
   notifier to avoid double release

Set bonding to version 3.2.1.

Signed-off-by: Moni Shoua <monis at voltaire.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoe1000e: don't poke PHY registers to retreive link status
Auke Kok [Mon, 15 Oct 2007 21:30:59 +0000 (14:30 -0700)]
e1000e: don't poke PHY registers to retreive link status

Apparently poking the link status registers when autonegotiation
is running on the PHY might botch the PHY link on 80003es2lan
devices. While this is a very rare condition we can completely
avoid it alltogether by just using the MAC link bits to provide
the proper information to ethtool.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoe1000e: fix error checks
Adrian Bunk [Mon, 15 Oct 2007 21:02:21 +0000 (14:02 -0700)]
e1000e: fix error checks

Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agoe1000e: Fix debug printk macro
Auke Kok [Mon, 15 Oct 2007 21:02:13 +0000 (14:02 -0700)]
e1000e: Fix debug printk macro

Spotted by Joe Perches.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years agotokenring/3c359.c: fixed array index problem
Marcus Meissner [Sat, 13 Oct 2007 08:19:37 +0000 (10:19 +0200)]
tokenring/3c359.c: fixed array index problem

The xl_laa array is just 6 bytes long, so we should substract
10 from the index, like is also done some lines above already.

Signed-Off-By: Marcus Meissner <meissner@suse.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
17 years ago[netdrvr] forcedeth: remove in-driver copy of net_device_stats
Jeff Garzik [Wed, 17 Oct 2007 00:56:09 +0000 (20:56 -0400)]
[netdrvr] forcedeth: remove in-driver copy of net_device_stats

A copy of struct net_device_stats now lives in struct net_device,
making in-driver copies a waste of memory.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
17 years ago[netdrvr] forcedeth: improved probe info; dev_printk() cleanups
Jeff Garzik [Tue, 16 Oct 2007 08:09:09 +0000 (04:09 -0400)]
[netdrvr] forcedeth: improved probe info; dev_printk() cleanups

main change:
* greatly improve per-NIC probe diagnostic output.  Similar to other
  net drivers, print out MAC address, PHY info, and various hardware and
  software flags that may be relevant.

other changes:
* similar to other net drivers, only print the initial version message
  when we have found at least one board.

* don't bother to print error message when pci_enable_device() fails,
  it will do so for us.

* use dev_printk() rather than printk() in nv_probe().  This gives
  use a standardized output similar to the rest of the kernel, and
  eliminates the need to manually print out PCI bus id.

* use DRV_NAME constant where appropriate

* clean struct pci_driver indentation

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
17 years agoforcedeth: fix NAPI rx poll function
Ingo Molnar [Wed, 17 Oct 2007 00:44:59 +0000 (20:44 -0400)]
forcedeth: fix NAPI rx poll function

fix the forcedeth NAPI poll function to not emit this warning:

[  186.635916] WARNING: at net/core/dev.c:2166 net_rx_action()
[  186.641351]  [<c060d9f5>] net_rx_action+0x145/0x1b0
[  186.646191]  [<c011d752>] __do_softirq+0x42/0x90
[  186.650784]  [<c011d7c6>] do_softirq+0x26/0x30
[  186.655202]  [<c011db48>] local_bh_enable+0x48/0xa0
[  186.660055]  [<c06023e0>] lock_sock_nested+0xa0/0xc0
[  186.664995]  [<c065da16>] tcp_recvmsg+0x16/0xbc0
[  186.669588]  [<c013e94b>] __generic_file_aio_write_nolock+0x27b/0x520
[  186.676001]  [<c0601d75>] sock_common_recvmsg+0x45/0x70
[  186.681202]  [<c05ff5df>] sock_aio_read+0x11f/0x140
[  186.686054]  [<c015c086>] do_sync_read+0xc6/0x110
[  186.690735]  [<c012b9b0>] autoremove_wake_function+0x0/0x40
[  186.696280]  [<c060dcfc>] net_tx_action+0x3c/0xe0
[  186.700961]  [<c015c9c2>] vfs_read+0x132/0x140
[  186.705378]  [<c015cd41>] sys_read+0x41/0x70
[  186.709625]  [<c0102b66>] sysenter_past_esp+0x5f/0x89
[  186.714651]  =======================

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Tue, 16 Oct 2007 23:56:35 +0000 (16:56 -0700)]
Merge /pub/scm/linux/kernel/git/bart/ide-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6: (33 commits)
  amd74xx: remove /proc/ide/amd74xx
  amd74xx/via82cxxx: don't initialize drive->dn
  sis5513: remove /proc/ide/sis
  ide: remove CONFIG_IDEDMA_ONLYDISK
  ide: add "hdx=nodma" kernel parameter
  ide: remove hwif->autodma and drive->autodma
  ide: remove "idex=dma" kernel parameter
  ide: remove CONFIG_BLK_DEV_IDEDMA_FORCED
  ide: use PCI_VDEVICE() macro
  sis5513: clear prefetch and postwrite for ATAPI devices
  it8213/piix/slc90e66: "de-couple" PIO and UDMA modes
  ide: unexport noautodma
  ide: unexport ide_tune_dma
  ide: remove ->ide_dma_check (take 2)
  ide-pmac: add PIO autotune fallback to ->ide_dma_check
  ide-cris: add PIO autotune fallback to ->ide_dma_check
  sl82c105: add PIO autotune fallback to ->ide_dma_check
  cs5530/sc1200: add PIO autotune fallback to ->ide_dma_check
  ide: remove ide_use_fast_pio()
  ide: remove drive->init_speed zeroing
  ...

17 years agofix cirrusfb breakage
Al Viro [Tue, 16 Oct 2007 23:27:18 +0000 (00:27 +0100)]
fix cirrusfb breakage

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Tue, 16 Oct 2007 23:53:20 +0000 (16:53 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/selinux-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
  SELinux: kills warnings in Improve SELinux performance when AVC misses
  SELinux: improve performance when AVC misses.
  SELinux: policy selectable handling of unknown classes and perms
  SELinux: Improve read/write performance
  SELinux: tune avtab to reduce memory usage

17 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
Linus Torvalds [Tue, 16 Oct 2007 23:52:21 +0000 (16:52 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/ieee1394/linux1394-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (25 commits)
  firewire: fw-cdev: reorder wakeup vs. spinlock
  firewire: in-code doc updates.
  firewire: a header cleanup
  firewire: adopt read cycle timer ABI from raw1394
  firewire: fw-ohci: check for misconfigured bus (phyID == 63)
  firewire: fw-ohci: missing dma_unmap_single
  firewire: fw-ohci: log posted write errors
  firewire: fw-ohci: reorder includes
  firewire: fw-ohci: fix includes
  firewire: fw-ohci: enforce read order for selfID generation
  firewire: fw-sbp2: use an own workqueue (fix system responsiveness)
  firewire: fw-sbp2: expose module parameter for workarounds
  firewire: fw-sbp2: add support for multiple logical units per target
  firewire: fw-sbp2: always enable IRQs before calling command ORB callback
  firewire: fw-core: local variable shadows a global one
  firewire: optimize fw_core_add_address_handler
  ieee1394: ieee1394_core.c: use DEFINE_SPINLOCK for spinlock definition
  ieee1394: csr1212: proper refcounting
  ieee1394: nodemgr: fix leak of struct csr1212_keyval
  ieee1394: pcilynx: I2C cleanups
  ...

17 years agoMerge ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
Linus Torvalds [Tue, 16 Oct 2007 23:51:11 +0000 (16:51 -0700)]
Merge ssh:///pub/scm/linux/kernel/git/sam/kbuild

* ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  x86: fix boot error introduced by kbuild

17 years agoMerge branch 'release' of ssh://master.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Tue, 16 Oct 2007 23:48:59 +0000 (16:48 -0700)]
Merge branch 'release' of ssh:///linux/kernel/git/aegl/linux-2.6

* 'release' of ssh://master.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] Fix build for CONFIG_SMP=n

17 years agoSELinux: kills warnings in Improve SELinux performance when AVC misses
KaiGai Kohei [Wed, 3 Oct 2007 14:42:56 +0000 (23:42 +0900)]
SELinux: kills warnings in Improve SELinux performance when AVC misses

This patch kills ugly warnings when the "Improve SELinux performance
when ACV misses" patch.

Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com>
Signed-off-by: James Morris <jmorris@namei.org>
17 years agoSELinux: improve performance when AVC misses.
KaiGai Kohei [Fri, 28 Sep 2007 17:20:55 +0000 (02:20 +0900)]
SELinux: improve performance when AVC misses.

* We add ebitmap_for_each_positive_bit() which enables to walk on
  any positive bit on the given ebitmap, to improve its performance
  using common bit-operations defined in linux/bitops.h.
  In the previous version, this logic was implemented using a combination
  of ebitmap_for_each_bit() and ebitmap_node_get_bit(), but is was worse
  in performance aspect.
  This logic is most frequestly used to compute a new AVC entry,
  so this patch can improve SELinux performance when AVC misses are happen.
* struct ebitmap_node is redefined as an array of "unsigned long", to get
  suitable for using find_next_bit() which is fasted than iteration of
  shift and logical operation, and to maximize memory usage allocated
  from general purpose slab.
* Any ebitmap_for_each_bit() are repleced by the new implementation
  in ss/service.c and ss/mls.c. Some of related implementation are
  changed, however, there is no incompatibility with the previous
  version.
* The width of any new line are less or equal than 80-chars.

The following benchmark shows the effect of this patch, when we
access many files which have different security context one after
another. The number is more than /selinux/avc/cache_threshold, so
any access always causes AVC misses.

      selinux-2.6      selinux-2.6-ebitmap
AVG:   22.763 [s]          8.750 [s]
STD:    0.265              0.019
------------------------------------------
1st:   22.558 [s]          8.786 [s]
2nd:   22.458 [s]          8.750 [s]
3rd:   22.478 [s]          8.754 [s]
4th:   22.724 [s]          8.745 [s]
5th:   22.918 [s]          8.748 [s]
6th:   22.905 [s]          8.764 [s]
7th:   23.238 [s]          8.726 [s]
8th:   22.822 [s]          8.729 [s]

Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
17 years agoSELinux: policy selectable handling of unknown classes and perms
Eric Paris [Fri, 21 Sep 2007 18:37:10 +0000 (14:37 -0400)]
SELinux: policy selectable handling of unknown classes and perms

Allow policy to select, in much the same way as it selects MLS support, how
the kernel should handle access decisions which contain either unknown
classes or unknown permissions in known classes.  The three choices for the
policy flags are

0 - Deny unknown security access. (default)
2 - reject loading policy if it does not contain all definitions
4 - allow unknown security access

The policy's choice is exported through 2 booleans in
selinuxfs.  /selinux/deny_unknown and /selinux/reject_unknown.

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
17 years agoSELinux: Improve read/write performance
Yuichi Nakamura [Fri, 14 Sep 2007 00:27:07 +0000 (09:27 +0900)]
SELinux: Improve read/write performance

It reduces the selinux overhead on read/write by only revalidating
permissions in selinux_file_permission if the task or inode labels have
changed or the policy has changed since the open-time check.  A new LSM
hook, security_dentry_open, is added to capture the necessary state at open
time to allow this optimization.

(see http://marc.info/?l=selinux&m=118972995207740&w=2)

Signed-off-by: Yuichi Nakamura<ynakam@hitachisoft.jp>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
17 years agoSELinux: tune avtab to reduce memory usage
Yuichi Nakamura [Fri, 24 Aug 2007 02:55:11 +0000 (11:55 +0900)]
SELinux: tune avtab to reduce memory usage

This patch reduces memory usage of SELinux by tuning avtab. Number of hash
slots in avtab was 32768. Unused slots used memory when number of rules is
fewer. This patch decides number of hash slots dynamically based on number
of rules. (chain length)^2 is also printed out in avtab_hash_eval to see
standard deviation of avtab hash table.

Signed-off-by: Yuichi Nakamura<ynakam@hitachisoft.jp>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
17 years agofirewire: fw-cdev: reorder wakeup vs. spinlock
Jay Fenlason [Mon, 8 Oct 2007 21:00:29 +0000 (17:00 -0400)]
firewire: fw-cdev: reorder wakeup vs. spinlock

Signed-off-by: Jay Fenlason <fenlason@redhat.com>
Prompted by https://bugzilla.redhat.com/show_bug.cgi?id=323411

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: in-code doc updates.
Yann Dirson [Sun, 7 Oct 2007 00:21:29 +0000 (02:21 +0200)]
firewire: in-code doc updates.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (update)
17 years agofirewire: a header cleanup
Stefan Richter [Sun, 7 Oct 2007 00:10:11 +0000 (02:10 +0200)]
firewire: a header cleanup

fw_node() is not used (and not useful) outside fw-topology.c.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: adopt read cycle timer ABI from raw1394
Stefan Richter [Sat, 29 Sep 2007 08:41:58 +0000 (10:41 +0200)]
firewire: adopt read cycle timer ABI from raw1394

This duplicates the read cycle timer feature of raw1394 (added in Linux
2.6.21) in firewire-core's userspace ABI.  The argument to the ioctl is
reordered though to ensure 32/64 bit compatibility.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: fw-ohci: check for misconfigured bus (phyID == 63)
Stefan Richter [Wed, 29 Aug 2007 22:11:40 +0000 (00:11 +0200)]
firewire: fw-ohci: check for misconfigured bus (phyID == 63)

Check NodeID.nodeNumber as per OHCI 1.1 clause 7.2.3.2.  See also IEEE
1394a table 5B-1.

Also, demote the "node ID not valid" message from error to notification
as it is not an error condition.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-ohci: missing dma_unmap_single
Stefan Richter [Wed, 29 Aug 2007 17:40:28 +0000 (19:40 +0200)]
firewire: fw-ohci: missing dma_unmap_single

at_context_queue_packet() didn't clean up in an early exit path.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: fw-ohci: log posted write errors
Stefan Richter [Mon, 20 Aug 2007 19:58:30 +0000 (21:58 +0200)]
firewire: fw-ohci: log posted write errors

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-ohci: reorder includes
Stefan Richter [Mon, 20 Aug 2007 19:41:22 +0000 (21:41 +0200)]
firewire: fw-ohci: reorder includes

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-ohci: fix includes
Stefan Richter [Mon, 20 Aug 2007 19:40:30 +0000 (21:40 +0200)]
firewire: fw-ohci: fix includes

Add used includes, remove unused includes.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-ohci: enforce read order for selfID generation
Stefan Richter [Sat, 25 Aug 2007 12:08:19 +0000 (14:08 +0200)]
firewire: fw-ohci: enforce read order for selfID generation

It seems unlikely, but access to self_id_cpu[0] could at least in theory
be deferred until after the loop over self_id_cpu[1..n] or even after
the subsequent reg_read.  Enforce the desired order by a read barrier.

Also prevent the reg_read from being reordered relative to the for loop.
This isn't necessary if the loop's conditional printk counts as an
implicit barrier, but better make it explicit.

(self_id_cpu[] is a coherent DMA buffer.)

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-sbp2: use an own workqueue (fix system responsiveness)
Stefan Richter [Sun, 12 Aug 2007 10:51:18 +0000 (12:51 +0200)]
firewire: fw-sbp2: use an own workqueue (fix system responsiveness)

Firewire-sbp2 did very uncooperative things in the kernel's shared
workqueue:  Sleeping until reception of management status from the
target for up to 2 seconds, and performing SCSI inquiry and all of the
setup of SCSI command set drivers via scsi_add_device.  If there were
transient or permanent error conditions, this caused long blockage of
the kernel's events process, noticeable e.g. by blocked keyboard input.

We now allocate a workqueue process exclusive to fw-sbp2.  As a side
effect, this also increases parallelism of fw-sbp2's login and reconnect
work versus fw-core's device discovery and device update work which is
performed in the shared workqueue.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: fw-sbp2: expose module parameter for workarounds
Stefan Richter [Mon, 13 Aug 2007 15:48:25 +0000 (17:48 +0200)]
firewire: fw-sbp2: expose module parameter for workarounds

On rare occasions, the ability to set one of the workaround flags at
runtime may save the day.

People who experience I/O errors with firewire-sbp2 while the old sbp2
driver worked for them should try workarounds=1 and report to the devel
mailinglist whether that improves things.  Firewire-sbp2 defaults to the
SCSI stack's maximum transfer size per command, while sbp2 limits them
to 128 kBytes.  Flag 1 accomplishes just that.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-sbp2: add support for multiple logical units per target
Stefan Richter [Sat, 25 Aug 2007 12:05:28 +0000 (14:05 +0200)]
firewire: fw-sbp2: add support for multiple logical units per target

Fixes "New firewire stack only recognizing half of a chain of drives",
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=242254

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: fw-sbp2: always enable IRQs before calling command ORB callback
Stefan Richter [Sat, 25 Aug 2007 08:40:42 +0000 (10:40 +0200)]
firewire: fw-sbp2: always enable IRQs before calling command ORB callback

On IOMMU-less noncoherent architectures, orb->callback will memcpy the
whole SCSI command buffer for READ-like SCSI commands.  It is therefore
friendlier to enable IRQs before the call, like before patch "Add
ref-counting for sbp2 orbs".

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Acked-by: Kristian Høgsberg <krh@redhat.com>
17 years agofirewire: fw-core: local variable shadows a global one
Stefan Richter [Fri, 3 Aug 2007 18:56:31 +0000 (20:56 +0200)]
firewire: fw-core: local variable shadows a global one

Sparse warned about it although it was apparently harmless:

drivers/firewire/fw-cdev.c:624:23: warning: symbol 'interrupt' shadows an earlier one
include/asm/hw_irq.h:29:13: originally declared here

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agofirewire: optimize fw_core_add_address_handler
Stefan Richter [Tue, 17 Jul 2007 00:10:16 +0000 (02:10 +0200)]
firewire: optimize fw_core_add_address_handler

Potentially avoids unnecessary loop runs.
Guarantee quadlet-aligned starts of address regions.
Document the return values.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoieee1394: ieee1394_core.c: use DEFINE_SPINLOCK for spinlock definition
Matthias Kaehlcke [Fri, 12 Oct 2007 17:57:23 +0000 (19:57 +0200)]
ieee1394: ieee1394_core.c: use DEFINE_SPINLOCK for spinlock definition

drivers/ieee1394/ieee1394_core.c: Define spinlock using
DEFINE_SPINLOCK instead of assignment to SPIN_LOCK_UNLOCKED

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoieee1394: csr1212: proper refcounting
Stefan Richter [Sat, 15 Sep 2007 12:50:25 +0000 (14:50 +0200)]
ieee1394: csr1212: proper refcounting

At least since nodemgr got rid of coarse global locking, accesses to
struct csr1212_keyval's reference counter should be atomic and coupled
with proper barriers.  Also, calls to csr1212_keep_keyval(kv) should
occur before kv is being used.

(We probably should convert refcnt to struct kref, but how to keep
csr1212_destroy_keyval's implementation non-recursively then?)

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoieee1394: nodemgr: fix leak of struct csr1212_keyval
Stefan Richter [Sat, 15 Sep 2007 12:45:53 +0000 (14:45 +0200)]
ieee1394: nodemgr: fix leak of struct csr1212_keyval

csr1212_keep_keyval(kv) in nodemgr_process_root_directory was
unbalanced if ne->vendor_name_kv already exists.  This happens for
example if eth1394 or raw1394 modify the local config ROM and it is
parsed again.

As a bonus, the attempt to add the vendor_name_kv sysfs attribute
when it already exists is now fixed for good.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoieee1394: pcilynx: I2C cleanups
Jean Delvare [Sat, 8 Sep 2007 12:09:19 +0000 (14:09 +0200)]
ieee1394: pcilynx: I2C cleanups

* Delete optional and empty i2c client_register and client_unregister
  callbacks.
* Use the proper i2c adapter ID.
* Don't use a template to initialize the i2c_adapter structure, it's
  inefficient.
* Update a misleading comment on why we use i2c_transfer rather than
  higher level i2c functions.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoieee1394: Fix kthread stopping in nodemgr_host_thread
Satyam Sharma [Wed, 15 Aug 2007 14:35:38 +0000 (20:05 +0530)]
ieee1394: Fix kthread stopping in nodemgr_host_thread

The nodemgr host thread can exit on its own even when kthread_should_stop
is not true, on receiving a signal (might never happen in practice, as
it ignores signals). But considering kthread_stop() must not be mixed with
kthreads that can exit on their own, I think changing the code like this
is clearer. This change means the thread can cut its sleep short when
receive a signal but looking at the code around, that sounds okay (and
again, it might never actually recieve a signal in practice).

Signed-off-by: Satyam Sharma <satyam@infradead.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoieee1394: sbp2: fix unsafe iteration over list of devices
Stefan Richter [Sat, 11 Aug 2007 09:52:08 +0000 (11:52 +0200)]
ieee1394: sbp2: fix unsafe iteration over list of devices

sbp2_host_reset and sbp2_handle_status_write are not serialized against
sbp2_alloc_device and sbp2_remove_device.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoieee1394: pcilynx: superfluous local variables
Stefan Richter [Sat, 28 Jul 2007 22:01:35 +0000 (00:01 +0200)]
ieee1394: pcilynx: superfluous local variables

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoieee1394: eth1394: fix lock imbalance
Stefan Richter [Sat, 28 Jul 2007 21:45:03 +0000 (23:45 +0200)]
ieee1394: eth1394: fix lock imbalance

bad_proto can be reached from points which did not take priv->lock.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agoieee1394: eth1394: superfluous local variable
Stefan Richter [Sat, 28 Jul 2007 21:44:25 +0000 (23:44 +0200)]
ieee1394: eth1394: superfluous local variable

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
17 years agox86: fix boot error introduced by kbuild
Sam Ravnborg [Tue, 16 Oct 2007 21:50:33 +0000 (23:50 +0200)]
x86: fix boot error introduced by kbuild

x86 uses target specific assignment of EXTRA_AFLAGS,
EXTRA_CFLAGS - this caused troubles with
introducing asflags-y, ccflags-y.

Fixed the target specific assignments in arch/x86/boot/Makefile
and auditted the rest of the kernel for similar usage.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
17 years agoamd74xx: remove /proc/ide/amd74xx
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)]
amd74xx: remove /proc/ide/amd74xx

This belongs to user-space (and only if really needed).

   text    data     bss     dec     hex filename
   6723    2000      28    8751    222f drivers/ide/pci/amd74xx.o.before
   3833    2000      16    5849    16d9 drivers/ide/pci/amd74xx.o.after

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoamd74xx/via82cxxx: don't initialize drive->dn
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)]
amd74xx/via82cxxx: don't initialize drive->dn

drive->dn is initialized by ide-probe.c::probe_hwif() so no need to do it
in ->init_hwif method.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agosis5513: remove /proc/ide/sis
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)]
sis5513: remove /proc/ide/sis

This belongs to user-space (and only if really needed).

   text    data     bss     dec     hex filename
   7129     404       8    7541    1d75 drivers/ide/pci/sis5513.o.before
   3916     404       1    4321    10e1 drivers/ide/pci/sis5513.o.after

Additionaly to being bloat the code contained two bugs:
- wrong cable bit was checked (0x0001 instead of 0x8000) on ATA_133 chipsets
- incorrect UDMA cycle time was reported on ATA_100a/ATA_133 chipsets

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: remove CONFIG_IDEDMA_ONLYDISK
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)]
ide: remove CONFIG_IDEDMA_ONLYDISK

ATAPI devices with broken DMA support should be handled by DMA blacklist
and for debugging purposes we have new shiny "hdx=nodma" kernel paremeter.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: add "hdx=nodma" kernel parameter
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)]
ide: add "hdx=nodma" kernel parameter

* Add "hdx=nodma" option allowing user to disallow DMA for a given device.

* Obsolete "ide=nodma" option.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: remove hwif->autodma and drive->autodma
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)]
ide: remove hwif->autodma and drive->autodma

* hpt34x.c: disable DMA masks for HPT345
  (hwif->autodma is zero so DMA won't be enabled anyway).

* trm290.c: disable IDE_HFLAG_TRUST_BIOS_FOR_DMA flag
  (hwif->autodma is zero so DMA won't be enabled anyway).

* Check noautodma global variable instead of drive->autodma in ide_tune_dma().

  This fixes handling of "ide=nodma" kernel parameter for icside, ide-cris,
  au1xxx-ide, pmac, it821x, jmicron, sgiioc4 and siimage host drivers.

* Remove hwif->autodma (it was not checked by IDE core code anyway) and
  drive->autodma (was set by all host drivers - except HPT345/TRM290 special
  cases - unless "ide=nodma" was used).

While at it:
- remove needless printk() from icside.c
- remove stale FIXME/comment from ide-probe.c
- don't force DMA off if PCI bus-mastering had to be enabled in setup-pci.c
  (this setting was always later over-ridden by host drivers anyway)

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: remove "idex=dma" kernel parameter
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:57 +0000 (22:29 +0200)]
ide: remove "idex=dma" kernel parameter

It has been obsoleted since 1 Nov 2004, is valid only when used together with
"ide=nodma" kernel parameter (which makes no sense) and only for aec62xx,
cmd64x, cs5220, generic, hpt366, sl82c105, tc86c001 and triflex host drivers.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: remove CONFIG_BLK_DEV_IDEDMA_FORCED
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:56 +0000 (22:29 +0200)]
ide: remove CONFIG_BLK_DEV_IDEDMA_FORCED

This code doesn't use pci_assign_resource() and ide_get_or_set_dma_base() uses
pci_resource_start() to get DMA base address so it has no chance of working.
Moreover this belongs to PCI quirks (in case somebody would like to fix it).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: use PCI_VDEVICE() macro
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:56 +0000 (22:29 +0200)]
ide: use PCI_VDEVICE() macro

While at it:
- make struct pci_device_id tables const
- use PCI_DEVICE_ID_ITE_8213 define in it8213.c
- fix comment in generic.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agosis5513: clear prefetch and postwrite for ATAPI devices
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:56 +0000 (22:29 +0200)]
sis5513: clear prefetch and postwrite for ATAPI devices

Clear prefetch and postwrite for ATAPI devices instead of depending on BIOS.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoit8213/piix/slc90e66: "de-couple" PIO and UDMA modes
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:56 +0000 (22:29 +0200)]
it8213/piix/slc90e66: "de-couple" PIO and UDMA modes

Don't force PIO4 when programming UDMA mode (suggested by Sergei).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: unexport noautodma
Adrian Bunk [Tue, 16 Oct 2007 20:29:55 +0000 (22:29 +0200)]
ide: unexport noautodma

noautodma can now be unexported.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: unexport ide_tune_dma
Adrian Bunk [Tue, 16 Oct 2007 20:29:55 +0000 (22:29 +0200)]
ide: unexport ide_tune_dma

static code mustn't be exported.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: remove ->ide_dma_check (take 2)
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:55 +0000 (22:29 +0200)]
ide: remove ->ide_dma_check (take 2)

* Add IDE_HFLAG_TRUST_BIOS_FOR_DMA host flag for host drivers that depend
  on BIOS for programming device/controller for DMA.  Set it in cy82c693,
  generic, ns87415, opti621 and trm290 host drivers.

* Add IDE_HFLAG_VDMA host flag for host drivers using VDMA.  Set it in cs5520
  host driver.

* Teach ide_tune_dma() about IDE_HFLAG_TRUST_BIOS_FOR_DMA flag.

* Add generic ide_dma_check() helper and remove all open coded ->ide_dma_check
  implementations.  Fix all places checking for presence of ->ide_dma_check
  hook to check for ->ide_dma_on instead.

* Remove no longer needed code from config_drive_for_dma().

* Make ide_tune_dma() static.

v2:
* Fix config_drive_for_dma() return values.

* Fix ide-dma.c build for CONFIG_BLK_DEV_IDEDMA_PCI=n by adding
  dummy config_drive_for_dma() inline.

* Fix IDE_HFLAG_TRUST_BIOS_FOR_DMA handling in ide_dma_check().

* Fix init_hwif_it8213() comment.

There should be no functionality changes caused by this patch.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide-pmac: add PIO autotune fallback to ->ide_dma_check
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:55 +0000 (22:29 +0200)]
ide-pmac: add PIO autotune fallback to ->ide_dma_check

Since ide-pmac allows separate PIO and DMA timings, and ide-pmac always sets
->autotune this change shouldn't have any other effect than bringing ide-pmac
driver in-line with other host drivers wrt ->ide_dma_check implementation.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide-cris: add PIO autotune fallback to ->ide_dma_check
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:55 +0000 (22:29 +0200)]
ide-cris: add PIO autotune fallback to ->ide_dma_check

Since ide-cris allows separate PIO and DMA timings, and ide-cris always sets
->autotune this change shouldn't have any other effect than bringing ide-cris
driver in-line with other host drivers wrt ->ide_dma_check implementation.

Cc: Mikael Starvik <starvik@axis.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agosl82c105: add PIO autotune fallback to ->ide_dma_check
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:54 +0000 (22:29 +0200)]
sl82c105: add PIO autotune fallback to ->ide_dma_check

Since sl82c105 re-programs DMA/PIO timings for DMA enable/disable, and sets
->autotune this change shouldn't have any other effect than bringing sl82c105
driver in-line with other host drivers wrt ->ide_dma_check implementation.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agocs5530/sc1200: add PIO autotune fallback to ->ide_dma_check
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:54 +0000 (22:29 +0200)]
cs5530/sc1200: add PIO autotune fallback to ->ide_dma_check

* Add PIO autotune fallback to ->ide_dma_check.

  Since cs5530/sc1200 allow separate PIO and DMA timings, and cs5530/sc1200
  always set ->autotune this change shouldn't have any other effect than
  bringing these drivers in-line with other host drivers wrt ->ide_dma_check
  implementations.

* Fix ->ide_dma_check to return "-1" if DMA cannot be set.

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: remove ide_use_fast_pio()
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:54 +0000 (22:29 +0200)]
ide: remove ide_use_fast_pio()

Remove ide_use_fast_pio() and just re-tune PIO unconditionally if DMA tuning
has failed in ->ide_dma_check.  All host drivers using ide_use_fast_pio() set
drive->autotune so PIO is always tuned anyway and in some cases we _really_
need to re-tune PIO because PIO and DMA timings are shared.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: remove drive->init_speed zeroing
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:54 +0000 (22:29 +0200)]
ide: remove drive->init_speed zeroing

Several host drivers used to reset drive->init_speed in their ->ide_dma_check
implementations which resulted in incorrect init speed being reported to the
user, fix it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoau1xxx-ide: use ide_tune_dma()
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:54 +0000 (22:29 +0200)]
au1xxx-ide: use ide_tune_dma()

* Remove needless setting of drive->using_dma from auide_dma_check().

* Split off auide_mdma_filter() from auide_dma_check().

* Use ide_tune_dma() in auide_dma_check(), this fixes following issues:
  - device's DMA capability bit not being checked
  - device not being checked against generic DMA blacklist
  - transfer mode not being set on device/host

* Add PIO autotune fallback to auide_dma_check().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoit8213/piix/slc90e66: remove {it8213,piix,slc90e66}_dma_2_pio()
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:54 +0000 (22:29 +0200)]
it8213/piix/slc90e66: remove {it8213,piix,slc90e66}_dma_2_pio()

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoatiixp: DMA setup fixes
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:53 +0000 (22:29 +0200)]
atiixp: DMA setup fixes

* Fix handling of unsupported/invalid modes in atiixp_set_dma_mode().

* ATI controllers allow separate PIO and DMA timings so remove programming
  of PIO modes from atiixp_set_dma_mode().  Also remove no longer needed
  atiixp_dma_2_pio() helper.

* SWDMA timings are not programmed by atiixp_set_dma_mode() and if SWDMA
  mode is chosen atiixp_dma_host_on() erroneously enables UDMA, just disable
  support for SWDMA modes for now.

* Enable support for MWDMA0 mode.

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agosc1200: always tune PIO
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:53 +0000 (22:29 +0200)]
sc1200: always tune PIO

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agocs5530: always tune PIO
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:53 +0000 (22:29 +0200)]
cs5530: always tune PIO

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide-cris: always tune PIO
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:53 +0000 (22:29 +0200)]
ide-cris: always tune PIO

Acked-by: Mikael Starvik <starvik@axis.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoslc90e66: always tune PIO
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:53 +0000 (22:29 +0200)]
slc90e66: always tune PIO

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoaec62xx: always tune PIO
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:53 +0000 (22:29 +0200)]
aec62xx: always tune PIO

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agosis5513: always tune PIO
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:53 +0000 (22:29 +0200)]
sis5513: always tune PIO

* Always set ->autotune in init_hwif_sis5513(), this means practically
  no change in behavior since PIO was always tuned in ->ide_dma_check
  and >autotune was always set for ->dma_base == 0 case.

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agosis5513: DMA setup fixes
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:52 +0000 (22:29 +0200)]
sis5513: DMA setup fixes

* Add sis_ata133_get_base() helper function for obtaining the address of
  the drive control registers on chipset_family == ATA_133 chipsets.

* Add three helper functions for programming PIO/MWDMA timings:
  - sis_ata16_program_timings()  (for ATA_16/33/66/100a chipset families)
  - sis_ata100_program_timings() (for ATA_100/133a chipset families)
  - sis_ata133_program_timings() (for ATA_133 chipset family)

  MWDMA timings are taken from datasheets and they match ATA spec.

* Add generic helper function sis_program_timings() and use it in
  ->set_pio_mode and ->set_dma_mode methods (previously the driver
  depended on BIOS to program the correct MWDMA timings).

* Remove redundant !chipset_family check from init_hwif_sis5513()
  (init_chipset_sis5513() guarantees that we will never get here if
   chipset_family cannot be determined).

* SWDMA seems to be unsupported by SiS chipsets (no info about SWDMA in
  datasheets and for SWDMA0 mode timing requirements are impossible to
  fulfill) so remove ->swdma_mask from init_hwif_sis5513() and handling
  of SWDMA modes from sis_set_dma_mode().

* Enable DMA support for chipset_family == ATA_16.

* Bump driver version.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agohpt366: always tune PIO
Bartlomiej Zolnierkiewicz [Tue, 16 Oct 2007 20:29:52 +0000 (22:29 +0200)]
hpt366: always tune PIO

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide-cs: Add additional id string (corsair, 1GB)
Kristoffer Ericson [Tue, 16 Oct 2007 20:29:52 +0000 (22:29 +0200)]
ide-cs: Add additional id string (corsair, 1GB)

This patch adds id strings for Corsair 1GB (identified as Hyperstone Model1)
inside legacy/ide-cs.c.

It also includes some minor whitespace cleanups.

Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
17 years agoide: fix serverworks.c UDMA regression
Tony Battersby [Tue, 16 Oct 2007 20:29:52 +0000 (22:29 +0200)]
ide: fix serverworks.c UDMA regression

The patch described by the following excerpt from ChangeLog-2.6.22 makes
it impossible to use UDMA on a Tyan S2707 motherboard (SvrWks CSB5):

commit 2d5eaa6dd744a641e75503232a01f52d0768884c
Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date:   Thu May 10 00:01:08 2007 +0200

    ide: rework the code for selecting the best DMA transfer mode (v3)

    ...

This one-line patch against 2.6.23 fixes the problem.

Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>