pandora-kernel.git
16 years agoieee1394: eth1394: don't autoload by hotplug when ohci1394 starts
Stefan Richter [Mon, 26 Mar 2007 23:36:50 +0000 (01:36 +0200)]
ieee1394: eth1394: don't autoload by hotplug when ohci1394 starts

Until now, ieee1394 put an IP-over-1394 capability entry into each new
host's config ROM.  As soon as the controller was initialized --- i.e.
right after modprobe ohci1394 --- this entry triggered a hotplug event
which typically caused auto-loading of eth1394.

This irritated or annoyed many users and distributors.  Of course they
could blacklist eth1394, but then ieee1394 wrongly advertized IP-over-
1394 capability to the FireWire bus.

Therefore
  - remove the offending kernel config option
    IEEE1394_CONFIG_ROM_IP1394,
  - let eth1394 add the ROM entry by itself, i.e. only after eth1394 was
    loaded.

This fixes http://bugzilla.kernel.org/show_bug.cgi?id=7793 .

To emulate the behaviour of older kernels, simply add the following to
to /etc/modprobe.conf:

install ohci1394 /sbin/modprobe eth1394; \
                 /sbin/modprobe --ignore-install ohci1394

Note, autoloading of eth1394 when an _external_ IP-over-1394 capable
device is discovered is _not_ affected by this patch.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: eth1394: reduce excessive function inlining
Stefan Richter [Sun, 18 Mar 2007 11:23:11 +0000 (12:23 +0100)]
ieee1394: eth1394: reduce excessive function inlining

Shrinks eth1394.ko by about 5%.

Many of these functions have only one caller and are therefore auto-
inlined anyway.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: eth1394: clean up host removal
Stefan Richter [Sat, 10 Feb 2007 22:57:57 +0000 (23:57 +0100)]
ieee1394: eth1394: clean up host removal

ether1394_add_host() guarantees that hi->dev != NULL if hi != NULL.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: eth1394: unregister address space in failure case
Stefan Richter [Sat, 10 Feb 2007 22:56:38 +0000 (23:56 +0100)]
ieee1394: eth1394: unregister address space in failure case

Warn if hpsb_allocate_and_register_addrspace() failed.
Unregister the address space if something else failed.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: send async streams at S100
Stefan Richter [Mon, 23 Apr 2007 19:27:13 +0000 (21:27 +0200)]
ieee1394: send async streams at S100

The comment says it all.  This affects only asynchronous streams sent
via raw1394; the eth1394 driver has own code and needs an own fix.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: SPIN_LOCK_UNLOCKED cleanup
Milind Arun Choudhary [Wed, 11 Apr 2007 17:54:34 +0000 (23:24 +0530)]
ieee1394: SPIN_LOCK_UNLOCKED cleanup

SPIN_LOCK_UNLOCKED cleanup,use DEFINE_SPINLOCK instead

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: nodemgr: unify some error messages
Stefan Richter [Fri, 30 Mar 2007 17:21:05 +0000 (19:21 +0200)]
ieee1394: nodemgr: unify some error messages

Shrinks object file size a little bit.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: nodemgr: less noise in dmesg
Stefan Richter [Fri, 30 Mar 2007 17:19:55 +0000 (19:19 +0200)]
ieee1394: nodemgr: less noise in dmesg

Everytime when eth1394 or a libraw1394 client updates the configuration
ROM, a certain sysfs attribute cannot be added since it already exists.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: unroll a weird macro
Stefan Richter [Sat, 17 Mar 2007 23:55:15 +0000 (00:55 +0100)]
ieee1394: unroll a weird macro

This is a coding style touch-up for ieee1394's handle_incoming_packet().

A preprocessor macro contained hardwired variable names and, even worse,
the 'break' keyword.  This macro is now unrolled and removed.

Also, all 'break's which had the effect of a return are replaced by
return.  And a FIXME comment is brought up to date.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: iso.c needs sched.h
Andrew Morton [Thu, 26 Apr 2007 07:16:04 +0000 (00:16 -0700)]
ieee1394: iso.c needs sched.h

alpha:

drivers/ieee1394/iso.c: In function 'hpsb_iso_xmit_sync':
drivers/ieee1394/iso.c:440: error: invalid use of undefined type 'struct task_struct'
drivers/ieee1394/iso.c:440: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
drivers/ieee1394/iso.c:440: error: (Each undeclared identifier is reported only once
drivers/ieee1394/iso.c:440: error: for each function it appears in.)
drivers/ieee1394/iso.c:440: warning: implicit declaration of function 'signal_pending'
drivers/ieee1394/iso.c:440: error: invalid use of undefined type 'struct task_struct'
drivers/ieee1394/iso.c:440: warning: implicit declaration of function 'schedule'
drivers/ieee1394/iso.c: In function 'hpsb_iso_wake':
drivers/ieee1394/iso.c:562: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (brought into alphabetic order)
16 years agoieee1394: some more includes
Stefan Richter [Tue, 10 Apr 2007 00:39:07 +0000 (02:39 +0200)]
ieee1394: some more includes

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: ieee1394_transactions needs sched.h
Torsten Kaiser [Mon, 9 Apr 2007 19:03:15 +0000 (21:03 +0200)]
ieee1394: ieee1394_transactions needs sched.h

drivers/ieee1394/ieee1394_transactions.c fails for me if CONFIG_SMP=n

gcc complains:
  CC      drivers/ieee1394/ieee1394_transactions.o
drivers/ieee1394/ieee1394_transactions.c: In function 'hpsb_get_tlabel':
drivers/ieee1394/ieee1394_transactions.c:183: error:
'TASK_INTERRUPTIBLE' undeclared (first use in this function)
drivers/ieee1394/ieee1394_transactions.c:183: error: (Each undeclared
identifier is reported only once

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (added comment)
16 years agoieee1394: ieee1394_core printk format
Randy Dunlap [Tue, 3 Apr 2007 20:00:47 +0000 (13:00 -0700)]
ieee1394: ieee1394_core printk format

Fix printk format string:
drivers/ieee1394/ieee1394_core.c:702: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: remove usage of skb_queue as packet queue
Stefan Richter [Sun, 25 Mar 2007 20:22:40 +0000 (22:22 +0200)]
ieee1394: remove usage of skb_queue as packet queue

This considerably reduces the memory requirements for a packet and
eliminates ieee1394's dependency on CONFIG_NET.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: csr1212: log if devices have CRC errors in their ROM
Stefan Richter [Tue, 13 Mar 2007 23:29:20 +0000 (00:29 +0100)]
ieee1394: csr1212: log if devices have CRC errors in their ROM

This will point out firmware bugs.

I tested with 11 SBP-2 devices and one OS X PC and got these errors from
two old CD-RWs only.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: csr1212: more sensible names for jump targets
Stefan Richter [Tue, 13 Mar 2007 23:28:36 +0000 (00:28 +0100)]
ieee1394: csr1212: more sensible names for jump targets

Code beneath two labels called "fail" is actually also reached in case
of success.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: csr1212: warn on unreachable code
Stefan Richter [Tue, 13 Mar 2007 23:27:46 +0000 (00:27 +0100)]
ieee1394: csr1212: warn on unreachable code

We want bugs to show themselves.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: shrink csr1212_new_string_descriptor_leaf
Stefan Richter [Tue, 13 Mar 2007 23:27:18 +0000 (00:27 +0100)]
ieee1394: shrink csr1212_new_string_descriptor_leaf

Make unnecessarily generic code specific and thus simpler.
Shrink a lookup table from 128 to 16 bytes.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: csr1212: coding style
Stefan Richter [Tue, 13 Mar 2007 23:26:38 +0000 (00:26 +0100)]
ieee1394: csr1212: coding style

Whitespace, line breaks, braces...

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: replace vmalloc by kmalloc in csr1212
Stefan Richter [Sun, 11 Mar 2007 21:51:24 +0000 (22:51 +0100)]
ieee1394: replace vmalloc by kmalloc in csr1212

The biggest chunk ever allocated by CSR1212_MALLOC is 1024 Bytes +
sizeof(struct csr1212_csr_rom_cache) big.  Most of the time much
smaller data structures are allocated.  Therefore vmalloc is a waste.

The one exception is csr1212_append_new_cache() which is called to
append a chunk of CSR1212_EXTENDED_ROM_SIZE + sizeof(struct
csr1212_csr_rom_cache) if the currently allocated ROM cache is too
small.  CSR1212_EXTENDED_ROM_SIZE is generously defined as 256 kBytes.
In SVN commit 1220, Steve Kinneberg lowered this to 2 kBytes in the
config_rom_2.4 branch.  This same commit also switched CSR1212_MALLOC
from kmalloc to vmalloc in the SVN trunk branch:

> r1220 | kberg | 2004-05-31 01:51:44 +0200 (Mon, 31 May 2004) | 13 lines
>
> CSR1212 Extended ROM bug fixes:
> trunk line changes:
>   - Use vmalloc instead of kmalloc
>   - Change delayed_reset_bus() to operate in a work_queue instead of a
>     timer interrupt.
>   - Fix hpsb_allocate_and_register_addrspace() to not allocate space
>     on top of already allocated space.
>   - Fix problems in csr1212.c filling ConfigROM images when extend
>     ROMs are present.
> config-rom-2.4 changes:
>   - Changed extended rom allocation from 256K to 8K.
(It was actually 2 kB, not 8 kB.)
>   - Fix hpsb_allocate_and_register_addrspace() to not allocate space
>     on top of already allocated space.
>   - Fix problems in csr1212.c filling ConfigROM images when extend
>     ROMs are present.

I am now setting CSR1212_EXTENDED_ROM_SIZE to 2 kB minus the overhead of
struct csr1212_csr_rom_cache.  Note, this code path is not used by the
in-kernel drivers though.  raw1394 could trigger it, but the respective
libraw1394 functions don't exist yet.

Furthermore, userspace programs can replace the entire local ROM via
raw1394.  If kmalloc does not fulfill their needs --- well, tough luck.
I decree that nobody needs such huge extended ROMs.  (Extended ROMs are
defined by IEEE 1212 clause 7.7.18.  The spec does not impose
practically relevant restrictions on the size of extended ROM chunks.)

Another potentially demanding use of CSR1212_MALLOC is if external
FireWire devices come with Extended ROM entries.  If they are too big
for kmalloc (or have been too big for vmalloc) we just fail to read
their ROM.  This is quite unlikely though, to my knowledge.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: de-inline some functions
Stefan Richter [Tue, 13 Mar 2007 23:20:53 +0000 (00:20 +0100)]
ieee1394: de-inline some functions

This small reorganization of public csr1212 functions saves one
exported symbol and a few bytes in the driver modules.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: stricter error checks in csr1212
Stefan Richter [Sun, 11 Mar 2007 21:50:13 +0000 (22:50 +0100)]
ieee1394: stricter error checks in csr1212

return -EINVAL becomes BUG_ON in checks of function call parameters.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: csr1212: rename some types
Stefan Richter [Sun, 11 Mar 2007 21:49:34 +0000 (22:49 +0100)]
ieee1394: csr1212: rename some types

Use u8, u32 etc. instead of u_int8_t, csr1212_quad_t etc.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: drop csr1212's support for external compilation
Stefan Richter [Sun, 11 Mar 2007 21:49:05 +0000 (22:49 +0100)]
ieee1394: drop csr1212's support for external compilation

csr1212 was written to be compiled either as part of the ieee1394 kernel
driver or of an anticipated IEEE 1212 userspace library.  We now drop
support for the latter.  The costs in terms of code footprint and depth
of abstraction are not countered by any actual benefit.

Also remove some obsolete #includes.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: remove unused csr1212 code
Stefan Richter [Sun, 11 Mar 2007 21:47:34 +0000 (22:47 +0100)]
ieee1394: remove unused csr1212 code

Delete unused code.
Make some extern functions static.
Remove superfluous inline keywords.
Move private definitions from csr1212.h to csr1212.c.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: small header cleanup
Stefan Richter [Mon, 5 Mar 2007 02:07:38 +0000 (03:07 +0100)]
ieee1394: small header cleanup

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: move some comments from declaration to definition
Stefan Richter [Mon, 5 Mar 2007 02:06:23 +0000 (03:06 +0100)]
ieee1394: move some comments from declaration to definition

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: remove declarations of nonexisting functions
Stefan Richter [Mon, 5 Mar 2007 02:05:32 +0000 (03:05 +0100)]
ieee1394: remove declarations of nonexisting functions

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: sbp2: include fixes
Andrew Morton [Mon, 23 Apr 2007 18:50:56 +0000 (11:50 -0700)]
ieee1394: sbp2: include fixes

drivers/ieee1394/sbp2.c: In function 'sbp2util_access_timeout':
drivers/ieee1394/sbp2.c:399: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
drivers/ieee1394/sbp2.c:399: error: (Each undeclared identifier is reported only once
drivers/ieee1394/sbp2.c:399: error: for each function it appears in.)
drivers/ieee1394/sbp2.c:399: warning: implicit declaration of function 'signal_pending'
drivers/ieee1394/sbp2.c:399: warning: implicit declaration of function 'schedule_timeout'
drivers/ieee1394/sbp2.c: In function 'sbp2_prep_command_orb_sg':
drivers/ieee1394/sbp2.c:1438: warning: implicit declaration of function 'page_address'
drivers/ieee1394/sbp2.c:1438: warning: passing argument 2 of 'dma_map_single' makes pointer from integer without a cast
drivers/ieee1394/sbp2.c: In function 'sbp2_handle_status_write':
drivers/ieee1394/sbp2.c:1842: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)

Possibly due to changes in -mm, but this file should explicitly include the
headers for the stuff it uses.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (brought into alphabetic order)
16 years agoieee1394: sbp2: move some memory allocations into non-atomic context
Stefan Richter [Sun, 4 Feb 2007 19:57:38 +0000 (20:57 +0100)]
ieee1394: sbp2: move some memory allocations into non-atomic context

When the command ORB pool is created, the ORB list won't be accessed
concurrently.  Therefore we don't have to take the spinlock there.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: sbp2: optimize DMA direction of s/g tables
Stefan Richter [Sun, 4 Feb 2007 19:54:57 +0000 (20:54 +0100)]
ieee1394: sbp2: optimize DMA direction of s/g tables

Unlike the name suggests, "cmd->scatter_gather_element" holds only the
s/g table, not the actual s/g elements.  Since the table is only read
but never written by the device, DMA_BIDIRECTIONAL can be replaced by
DMA_TO_DEVICE which may be cheaper on some architectures.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: sbp2: enforce 32bit DMA mapping
Stefan Richter [Sun, 4 Feb 2007 19:25:43 +0000 (20:25 +0100)]
ieee1394: sbp2: enforce 32bit DMA mapping

In order to use OHCI-1394 physical DMA, all s/g elements, s/g tables,
ORBs, and response buffers have to reside within the first 4 GB of the
FireWire controller's physical address space.  Set the correct mask for
DMA mappings.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoieee1394: sbp2: remove unnecessary alignments of struct members
Stefan Richter [Sun, 4 Feb 2007 12:04:32 +0000 (13:04 +0100)]
ieee1394: sbp2: remove unnecessary alignments of struct members

The members "dma_addr_t command_orb_dma" and "dma_addr_t sge_dma" of
sbp2.h::sbp2_command_info do not have to be aligned themselves --- only
the memory which they point to has to be.

The member "struct sbp2_command_orb command_orb" has to be aligned on
4 bytes boundary which is guaranteed because it contains u32 members.

The member "struct sbp2_unrestricted_page_table scatter_gather_element",
i.e. the SBP-2 s/g table, has to be aligned on 8 bytes boundary
according to the SBP-2 spec.  This is not a requirement for FireWire
controllers but could be expected by SBP-2 targets.

I see no need to align the members command_orb and
scatter_gather_element on CPU cacheline boundaries.  It could have
performance benefits, but on the other hand sbp2 has a somewhat wasteful
allocation scheme which should be optimized first before further tweaks
like cacheline alignments.  (E.g. don't always allocate SG_ALL s/g table
elements.)

Note, before as well as after the patch, the code relies on the
assumption that memory alignment in the virtual address space is
preserved in the physical address space after DMA mapping.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
16 years agoMerge branch 'field-zeroing' into for-linus
Jiri Kosina [Sun, 29 Apr 2007 20:19:02 +0000 (22:19 +0200)]
Merge branch 'field-zeroing' into for-linus

16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Sun, 29 Apr 2007 17:48:48 +0000 (10:48 -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: (107 commits)
  smc911x: fix compilation breakage wjen debug is on
  [netdrvr] eexpress: minor corrections
  add NAPI support to sb1250-mac.c
  ixgb: ROUND_UP macro cleanup in drivers/net/ixgb
  e1000: ROUND_UP macro cleanup in drivers/net/e1000
  Generic HDLC sparse annotations
  e100: Optionally use I/O mode only to access register space
  e100: allow bad MAC address when running with invalid eeprom csum
  ehea: fix for dlpar support
  ehea: fix for sysfs entries
  3C509: Remove unnecessary include of <linux/pm_legacy.h>
  NetXen: Fix for vmalloc issues
  NetXen: Fixes for Power PC architecture
  NetXen: Port swap feature for multi port cards
  NetXen: Removal of redundant macros
  NetXen: Multi PCI support for Quad cards
  NetXen: Removal of redundant argument passing
  NetXen: Use multiple PCI functions
  [netdrvr e100] experiment with doing RX in a similar manner to eepro100
  [PATCH] ieee80211: add missing global needed by IEEE80211_DEBUG_XXXX
  ...

16 years agoMerge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
Linus Torvalds [Sun, 29 Apr 2007 17:48:21 +0000 (10:48 -0700)]
Merge branch 'upstream-linus' of /linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (86 commits)
  SPIN_LOCK_UNLOCKED cleanup in drivers/ata/pata_winbond.c
  drivers/ata/pata_cmd640.c: fix build with CONFIG_PM=n
  pata_hpt37x: Further small fixes
  pata_hpt3x2n: Add HPT371N support and other bits
  ata: printk warning fixes
  libata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET
  ahci: consolidate common port flags
  ata_timing: ensure t->cycle is always correct
  libata: add missing call to ->cable_detect() in new EH path
  pata_amd: remove contamination added during cable_detect conversion
  libata: Handle drives that require a spin-up command before first access
  libata: HPA support
  libata: kill probe_ent and related helpers
  libata: convert the remaining PATA drivers to new init model
  libata: convert the remaining SATA drivers to new init model
  libata: convert ata_pci_init_native_mode() users to new init model
  libata: convert drivers with combined SATA/PATA ports to new init model
  libata: add init helpers including ata_pci_prepare_native_host()
  libata: convert native PCI host handling to new init model
  libata: convert legacy PCI host handling to new init model
  ...

16 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
Linus Torvalds [Sun, 29 Apr 2007 17:47:25 +0000 (10:47 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (105 commits)
  sonypi: use mutex instead of semaphore
  sony-laptop: remove user visible camera controls as platform attributes
  meye: make meye use sony-laptop instead of sonypi
  sony-laptop: add a meye-usable include file for camera ops
  sony-laptop: complete the motion eye camera support in sony-laptop
  sonypi: try to detect if sony-laptop has already taken one of the known ioports
  sonypi: suggest sonypi users to try sony-laptop instead
  sony-laptop: add edge modem support (also called WWAN)
  sony-laptop: add locking on accesses to the ioport and global vars
  sony-laptop: add camera enable/disable parameter, better handle possible infinite loop
  thinkpad-acpi: make drivers/misc/thinkpad_acpi:fan_mutex static
  ACPI: thinkpad-acpi: add sysfs support to wan and bluetooth subdrivers
  ACPI: thinkpad-acpi: add sysfs support to hotkey subdriver
  ACPI: thinkpad-acpi: improve dock subdriver initialization
  ACPI: thinkpad-acpi: improve debugging for acpi helpers
  ACPI: thinkpad-acpi: improve fan control documentation
  ACPI: thinkpad-acpi: map ENXIO to EINVAL for fan sysfs
  ACPI: thinkpad-acpi: fix a fan watchdog invocation
  ACPI: thinkpad-acpi: do not arm fan watchdog if it would not work
  ACPI: thinkpad-acpi: add a fan-control feature master toggle
  ...

16 years agoUSB HID: don't warn on idVendor == 0
Jiri Kosina [Sun, 29 Apr 2007 11:14:56 +0000 (13:14 +0200)]
USB HID: don't warn on idVendor == 0

It turns out that there are broken devices out there that incorrectly
report VID/PID as 0x000, see http://lkml.org/lkml/2007/4/27/496

Therefore we should not confuse users by dumping warnings and stacktraces
in such situation. It is not possible to add quirks for such horribly
broken devices, but currently that's not needed.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
16 years ago[AF_IUCV/IUCV]: smp_call_function deadlock
Martin Schwidefsky [Sun, 29 Apr 2007 06:03:59 +0000 (23:03 -0700)]
[AF_IUCV/IUCV]: smp_call_function deadlock

Calling smp_call_function can lead to a deadlock if it is called
from tasklet context.
Fixing this deadlock requires to move the smp_call_function from the
tasklet context to a work queue. To do that queue the path pending
interrupts to a separate list and move the path cleanup out of
iucv_path_sever to iucv_path_connect and iucv_path_pending.
This creates a new requirement for iucv_path_connect: it may not be
called from tasklet context anymore.
Also fixed compile problem for CONFIG_HOTPLUG_CPU=n and
another one when walking the cpu_online mask. When doing this,
we must disable cpu hotplug.

Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV6]: Fix slab corruption running ip6sic
Eric Sesterhenn [Sun, 29 Apr 2007 04:26:23 +0000 (21:26 -0700)]
[IPV6]: Fix slab corruption running ip6sic

From: Eric Sesterhenn <snakebyte@gmx.de>

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: Update references in two old comments
Gerrit Renker [Sun, 29 Apr 2007 04:21:46 +0000 (21:21 -0700)]
[TCP]: Update references in two old comments

This updates references to drafts in comments which must be about 10
years old.  Internet draft draft-ietf-tcpimpl-prob-03.txt expired in 1998
and was replaced by RFC 2525 in March 1999.

Section 3.10 of the draft maps almost identically into section 2.17 of RFC
2525: both are entitled "Failure to RST on close with data pending", the
differences in text body amount to a typo and minor sentence change.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[XFRM]: Export SPD info
Jamal Hadi Salim [Sun, 29 Apr 2007 04:20:32 +0000 (21:20 -0700)]
[XFRM]: Export SPD info

With this patch you can use iproute2 in user space to efficiently see
how many policies exist in different directions.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPV6]: Track device renames in snmp6.
Stephen Hemminger [Sun, 29 Apr 2007 04:16:39 +0000 (21:16 -0700)]
[IPV6]: Track device renames in snmp6.

When network device's are renamed, the IPV6 snmp6 code
gets confused. It doesn't track name changes so it will OOPS
when network device's are removed.

The fix is trivial, just unregister/re-register in notify handler.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SCTP]: Fix sctp_getsockopt_local_addrs_old() to use local storage.
Vlad Yasevich [Sun, 29 Apr 2007 04:09:04 +0000 (21:09 -0700)]
[SCTP]: Fix sctp_getsockopt_local_addrs_old() to use local storage.

sctp_getsockopt_local_addrs_old() in net/sctp/socket.c calls
copy_to_user() while the spinlock addr_lock is held. this should not
be done as copy_to_user() might sleep. the call to
sctp_copy_laddrs_to_user() while holding the lock is also problematic
as it calls copy_to_user()

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Remove NETIF_F_INTERNAL_STATS, default to internal stats.
Rusty Russell [Sun, 29 Apr 2007 04:04:03 +0000 (21:04 -0700)]
[NET]: Remove NETIF_F_INTERNAL_STATS, default to internal stats.

Herbert Xu conviced me that a new flag was overkill; every driver
currently overrides get_stats, so we might as well make the internal
one the default.  If someone did fail to set get_stats, they would now
get all 0 stats instead of "No statistics available".

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETPOLL]: Remove CONFIG_NETPOLL_RX
Sergei Shtylyov [Sun, 29 Apr 2007 03:58:22 +0000 (20:58 -0700)]
[NETPOLL]: Remove CONFIG_NETPOLL_RX

Get rid of the CONFIG_NETPOLL_RX option completely since all the
dependencies have been removed long ago...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETPOLL]: Fix TX queue overflow in trapped mode.
Sergei Shtylyov [Sun, 29 Apr 2007 03:57:37 +0000 (20:57 -0700)]
[NETPOLL]: Fix TX queue overflow in trapped mode.

CONFIG_NETPOLL_TRAP causes the TX queue controls to be completely bypassed in
the netpoll's "trapped" mode which easily causes overflows in the drivers with
short TX queues (most notably, in 8139too with its 4-deep queue).  So, make
this option more sensible by making it only bypass the TX softirq wakeup.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Acked-by: Tom Rini <trini@kernel.crashing.org>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoPull bugzilla-8346 into release branch
Len Brown [Sun, 29 Apr 2007 03:19:25 +0000 (23:19 -0400)]
Pull bugzilla-8346 into release branch

16 years agoPull sbs into release branch
Len Brown [Sun, 29 Apr 2007 03:16:59 +0000 (23:16 -0400)]
Pull sbs into release branch

16 years agoPull dock into release branch
Len Brown [Sun, 29 Apr 2007 03:13:03 +0000 (23:13 -0400)]
Pull dock into release branch

16 years agoPull ec into release branch
Len Brown [Sun, 29 Apr 2007 03:12:56 +0000 (23:12 -0400)]
Pull ec into release branch

16 years agoPull misc-for-upstream into release branch
Len Brown [Sun, 29 Apr 2007 03:12:03 +0000 (23:12 -0400)]
Pull misc-for-upstream into release branch

16 years agoPull thinkpad into release branch
Len Brown [Sun, 29 Apr 2007 03:11:19 +0000 (23:11 -0400)]
Pull thinkpad into release branch

Conflicts:

drivers/misc/Kconfig

Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoPull sony into release branch
Len Brown [Sun, 29 Apr 2007 03:09:57 +0000 (23:09 -0400)]
Pull sony into release branch

16 years agoPull asus into release branch
Len Brown [Sun, 29 Apr 2007 02:18:21 +0000 (22:18 -0400)]
Pull asus into release branch

16 years agosonypi: use mutex instead of semaphore
Matthias Kaehlcke [Tue, 24 Apr 2007 20:02:35 +0000 (22:02 +0200)]
sonypi: use mutex instead of semaphore

the Sony Programmable I/O Control driver uses a semaphore as
mutex. use the mutex API instead of the (binary) semaphore

Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Acked-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosony-laptop: remove user visible camera controls as platform attributes
malattia@linux.it [Sat, 28 Apr 2007 14:36:40 +0000 (23:36 +0900)]
sony-laptop: remove user visible camera controls as platform attributes

Avoid giving the user the possibility to shoot his own foot and let
the meye driver enable/disable the camera wisely (PCI_ID based).

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agomeye: make meye use sony-laptop instead of sonypi
malattia@linux.it [Sat, 28 Apr 2007 14:36:26 +0000 (23:36 +0900)]
meye: make meye use sony-laptop instead of sonypi

Change sonypi_camera_command() calls to sony_pic_camera_command() and use
the renamed macros.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosony-laptop: add a meye-usable include file for camera ops
malattia@linux.it [Sat, 28 Apr 2007 14:34:36 +0000 (23:34 +0900)]
sony-laptop: add a meye-usable include file for camera ops

Copy and rename (for easier co-existence) the MEYE-wise exported interface.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosony-laptop: complete the motion eye camera support in sony-laptop
malattia@linux.it [Sat, 28 Apr 2007 14:34:22 +0000 (23:34 +0900)]
sony-laptop: complete the motion eye camera support in sony-laptop

Add the exported sony_pic_camera_command() function to make the MEYE
driver happy.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosonypi: try to detect if sony-laptop has already taken one of the known ioports
malattia@linux.it [Sat, 28 Apr 2007 14:34:10 +0000 (23:34 +0900)]
sonypi: try to detect if sony-laptop has already taken one of the known ioports

Get the IO resources list in sony-laptop in the same order as listed
in sonypi and make sonypi check if one of those is already busy.
The sonypi check can be disabled by a module parameter in case the user
thinks we are plainly wrong (check_ioport=0).

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosonypi: suggest sonypi users to try sony-laptop instead
malattia@linux.it [Sat, 28 Apr 2007 14:22:11 +0000 (23:22 +0900)]
sonypi: suggest sonypi users to try sony-laptop instead

Try to migrate sonypi users to sony-laptop gracefully.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosony-laptop: add edge modem support (also called WWAN)
malattia@linux.it [Sat, 28 Apr 2007 14:21:42 +0000 (23:21 +0900)]
sony-laptop: add edge modem support (also called WWAN)

Some SZ Vaios have a gsm built-in modem. Allow powering on/off this device.
Thanks to Joshua Wise for the base code.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosony-laptop: add locking on accesses to the ioport and global vars
malattia@linux.it [Sat, 28 Apr 2007 14:19:36 +0000 (23:19 +0900)]
sony-laptop: add locking on accesses to the ioport and global vars

Better avoid having ioport commands mixing and global variables reading/writing.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agosony-laptop: add camera enable/disable parameter, better handle possible infinite...
malattia@linux.it [Sat, 28 Apr 2007 14:18:45 +0000 (23:18 +0900)]
sony-laptop: add camera enable/disable parameter, better handle possible infinite loop

Use a parameter to enable/disable motion eye camera (for C1VE/C1VN models)
controls and avoid entering an infinite loop if the camera is not present
and the HW doesn't answer as we expect on io commands.

Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agothinkpad-acpi: make drivers/misc/thinkpad_acpi:fan_mutex static
Adrian Bunk [Sat, 28 Apr 2007 19:19:38 +0000 (21:19 +0200)]
thinkpad-acpi: make drivers/misc/thinkpad_acpi:fan_mutex static

This patch makes the needlessly global fan_mutex static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: add sysfs support to wan and bluetooth subdrivers
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:17 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: add sysfs support to wan and bluetooth subdrivers

Add support to sysfs to the wan and bluetooth subdrivers.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: add sysfs support to hotkey subdriver
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:16 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: add sysfs support to hotkey subdriver

Add the hotkey sysfs support.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: improve dock subdriver initialization
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:15 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: improve dock subdriver initialization

The dock sub-driver has split-personality (two subdrivers), and it was
doing some unoptimal things on init because of that.  Fix it so that the
second half of it will only init when necessary, and only if the first half
initialized sucessfully in the first place.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: improve debugging for acpi helpers
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:14 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: improve debugging for acpi helpers

Some issues with the dock subdriver proved that a slightly improved
debugging setup for ACPI notifiers and handler helpers would be useful.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: improve fan control documentation
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:13 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: improve fan control documentation

Improve fan control documentation and fix one mistake.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: map ENXIO to EINVAL for fan sysfs
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:12 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: map ENXIO to EINVAL for fan sysfs

Currently, all fan control operations return ENXIO if unsupported
operations are requested, but return EINVAL if invalid fan modes are
requested on a given ThinkPad.

This is not strictly correct for sysfs, so map ENXIO to EINVAL in the sysfs
attribute store handlers, as we do benefit from the ENXIO in other parts of
the driver code.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: fix a fan watchdog invocation
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:11 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: fix a fan watchdog invocation

The fan control watchdog was being called in one place even when the fan
control operation had failed.  Fix it.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: do not arm fan watchdog if it would not work
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:10 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: do not arm fan watchdog if it would not work

Do not enable/rearm the fan control safety watchdog if we would not be able
to do anything to the fan anyway.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPI: thinkpad-acpi: add a fan-control feature master toggle
Henrique de Moraes Holschuh [Sat, 28 Apr 2007 01:00:09 +0000 (22:00 -0300)]
ACPI: thinkpad-acpi: add a fan-control feature master toggle

Len Brown considers that an active by default fan control interface in
laptops may be too close to giving users enough rope.  There is a good
chance he is quite correct on this, especially if someone decides to use
that interface in applets and users are not aware of its risks.

This patch adds a master switch to thinkpad-acpi that enables or disables
the entire fan-control feature as a module parameter: "fan_control".  It
defaults to disabled.  Set it to non-zero to enable fan control.

Also, the patch removes the expermiental status from fan control, since it
is stable enough to not be called experimental, and the master switch makes
it safe enough to do so.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoACPICA: clear fields reserved before FADT r3
Bob Moore [Sun, 29 Apr 2007 00:53:50 +0000 (20:53 -0400)]
ACPICA: clear fields reserved before FADT r3

Linux-2.6.21 stopped booting on a P4/HT because Linux
wrote the FADT.CST_CNT value to the SMI_CMD.
Apparently this stumbled over some SMM instability,
such as confusing SMM when invoking it from cpu1.

Linux did this because even though the r2 FADT reserves
the CST_CNT field, this BIOS set that field and Linux
used it.

Turns out that up through 2.6.20 we explicitly cleared
cst_control for r2 FADTs.  So here we go back to doing that,
plus also clear some additional fields that are reserved
until FADT r3.

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

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
16 years agoSPIN_LOCK_UNLOCKED cleanup in drivers/ata/pata_winbond.c
Milind Arun Choudhary [Thu, 26 Apr 2007 07:19:27 +0000 (00:19 -0700)]
SPIN_LOCK_UNLOCKED cleanup in drivers/ata/pata_winbond.c

remove SPIN_LOCK_UNLOCKED, use DEFINE_SPINLOCK instead

Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agodrivers/ata/pata_cmd640.c: fix build with CONFIG_PM=n
Andrew Morton [Thu, 26 Apr 2007 07:19:26 +0000 (00:19 -0700)]
drivers/ata/pata_cmd640.c: fix build with CONFIG_PM=n

This is grubby, but all the ata drivers do it this way.

Would it not be better to do

#define ata_scsi_device_resume NULL

in libata.h, remove all those ifdefs?

(updated version, ug, ug)

Cc: Jeff Garzik <jeff@garzik.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopata_hpt37x: Further small fixes
Alan Cox [Thu, 26 Apr 2007 07:19:25 +0000 (00:19 -0700)]
pata_hpt37x: Further small fixes

Further HPT37x changes

- No 66MHz 370/370A
- Remove dead special case check now we use the DPLL (as per the IDE driver)

Pointed out by Sergei

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopata_hpt3x2n: Add HPT371N support and other bits
Alan Cox [Thu, 26 Apr 2007 07:19:25 +0000 (00:19 -0700)]
pata_hpt3x2n: Add HPT371N support and other bits

Yes its no longer 3x2n but 3xxn, I can rename it if you want Jeff

- Don't reset both ports each time (Sergei)
- If we can't get a DPLL then abort entirely
- Use ioport access for clock (from drivers/ide)
- Add HPT371N support (from drivers/ide)

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoata: printk warning fixes
Andrew Morton [Thu, 26 Apr 2007 07:19:21 +0000 (00:19 -0700)]
ata: printk warning fixes

drivers/ata/libata-core.c: In function 'ata_hpa_resize':
drivers/ata/libata-core.c:986: warning: format '%lld' expects type 'long long int', but argument 5 has type 'u64'
drivers/ata/libata-core.c:986: warning: format '%lld' expects type 'long long int', but argument 6 has type 'u64'
drivers/ata/libata-core.c:990: warning: format '%lld' expects type 'long long int', but argument 4 has type 'u64'
drivers/ata/libata-core.c:990: warning: format '%lld' expects type 'long long int', but argument 5 has type 'u64'
drivers/ata/libata-core.c:1003: warning: format '%lld' expects type 'long long int', but argument 4 has type 'u64'

Also fix various 80-col bustage.

Cc: Jeff Garzik <jeff@garzik.org>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET
Tejun Heo [Sun, 22 Apr 2007 17:41:05 +0000 (02:41 +0900)]
libata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET

Separate ATA_EHI_DID_RESET into ATA_EHI_DID_SOFTRESET and
ATA_EHI_DID_HARDRESET.  ATA_EHI_DID_RESET is redefined as OR of the
two flags.  This patch doesn't introduce any behavior change.  This
will be used later to determine whether _SDD is necessary or not.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoahci: consolidate common port flags
Tejun Heo [Sun, 22 Apr 2007 17:41:05 +0000 (02:41 +0900)]
ahci: consolidate common port flags

Consolidate common port flags into AHCI_FLAG_COMMON.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoata_timing: ensure t->cycle is always correct
Alan Cox [Mon, 23 Apr 2007 10:55:36 +0000 (11:55 +0100)]
ata_timing: ensure t->cycle is always correct

Russell King hit a case where quantisation errors accumulated such that
the cycle time was shorter than rather than equal to the active/recovery
time. The code already knows how to stretch times to fit the cycle time
but does not know about the reverse.

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: add missing call to ->cable_detect() in new EH path
Tejun Heo [Sun, 22 Apr 2007 17:05:53 +0000 (02:05 +0900)]
libata: add missing call to ->cable_detect() in new EH path

->cable_detect() used to be called on by the old ata_bus_probe() path.
Add invocation to ata_eh_revalidate_and_attach() right after IDENTIFYs
are done.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agopata_amd: remove contamination added during cable_detect conversion
Tejun Heo [Sun, 22 Apr 2007 17:04:38 +0000 (02:04 +0900)]
pata_amd: remove contamination added during cable_detect conversion

This is added by added by cff63dfceb52c564fe1ba5394d50ab7d599a11b9
 - pata: cable methods.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: Handle drives that require a spin-up command before first access
Mark Lord [Tue, 17 Apr 2007 22:26:07 +0000 (18:26 -0400)]
libata: Handle drives that require a spin-up command before first access

(S)ATA drives can be configured for "power-up in standby",
a mode whereby a specific "spin up now!" command is required
before the first media access.

Currently, a drive with this feature enabled can not be used at all
with libata, and once in this mode, the drive becomes a doorstop.

The older drivers/ide subsystem at least enumerates the drive,
so that it can be woken up after the fact from a userspace HDIO_*
command, but not libata.

This patch adds support to libata for the "power-up in standby"
mode where a "spin up now!" command (SET_FEATURES) is needed.
With this, libata will recognize such drives, spin them up,
and then re-IDENTIFY them if necessary to get a full/complete
set of drive features data.

Drives in this state are determined by looking for
special values in id[2], as documented in the current ATA specs.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: HPA support
Alan Cox [Tue, 10 Apr 2007 23:23:13 +0000 (00:23 +0100)]
libata: HPA support

Signed-off-by: Alan Cox <alan@redhat.com>
Add support for ignoring the BIOS HPA result (off by default) and setting
the disk to the full available size unless already frozen.

Tested with various platforms/disks and confirmed to work with the
Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48
readback that Tejun fixed).

For normal users this brings us, I believe, to feature parity with old IDE
(and of course more featured in some areas too).
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: kill probe_ent and related helpers
Tejun Heo [Tue, 17 Apr 2007 14:44:08 +0000 (23:44 +0900)]
libata: kill probe_ent and related helpers

All drivers are converted to new init model.  Kill probe_ent,
ata_device_add() and ata_pci_init_native_mode().

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: convert the remaining PATA drivers to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:08 +0000 (23:44 +0900)]
libata: convert the remaining PATA drivers to new init model

Convert pdc_adma, pata_cs5520, pata_isapnp, pata_ixp4xx_cf,
pata_legacy, pata_mpc52xx, pata_mpiix, pata_pcmcia, pata_pdc2027x,
pata_platform, pata_qdi, pata_scc and pata_winbond to new init model.

* init_one()'s now follow more consistent init order

* cs5520 now registers one host with two ports, not two hosts.  If any
  of the two ports are disabled, it's made dummy as other drivers do.

Tested pdc_adma and pata_legacy.  Both are as broken as before.  The
rest are compile tested only.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: convert the remaining SATA drivers to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:08 +0000 (23:44 +0900)]
libata: convert the remaining SATA drivers to new init model

Convert ahci, sata_sil, sata_sil24, sata_svw, sata_qstor, sata_mv,
sata_sx4, sata_vsc and sata_inic162x to new init model.

Now that host and ap are available during intialization, functions are
converted to take either host or ap instead of low level parameters
which were inevitable for functions shared between init and other
paths.  This simplifies code quite a bit.

* init_one()'s now follow more consistent init order

* ahci_setup_port() and ahci_host_init() collapsed into
  ahci_init_one() for init order consistency

* sata_vsc uses port_info instead of setting fields manually

* in sata_svw, k2_board_info converted to port_info (info is now in
  port flags).  port number is honored now.

Tested on ICH7/8 AHCI, jmb360, sil3112, 3114, 3124 and 3132.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: convert ata_pci_init_native_mode() users to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:08 +0000 (23:44 +0900)]
libata: convert ata_pci_init_native_mode() users to new init model

Convert drivers which use ata_pci_init_native_mode() to new init
model.  ata_pci_init_native_host() is used instead.  sata_nv, sata_uli
and sata_sis are in this category.

Tested on nVidia Corporation CK804 Serial ATA Controller [10de:0054]
in both BMDMA and ADMA mode.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: convert drivers with combined SATA/PATA ports to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: convert drivers with combined SATA/PATA ports to new init model

Convert sata_via and sata_promise to new init model.  Both controllers
can have combined configuration (SATA + PATA) and used twisted
initialization method (modifying port in ->port_start) to overcome
probe_ent limitations.

This patch converts both drivers to new init model in which such
configuration is natively supported.

* promise: Combined pata port now uses separate port_info entry right
  after the sata counterpart entry.

* promise: Controller configuration is discerned using ap->flags.
  This simplifies init path and makes it look more like other LLDs.

* via: Both SATA and PATA ports in vt6421 are represented in their
  own port_info structure.

Tested on PDC20375 (SATA150 TX2plus) [105a:3375] and PDC40775 (SATA
300 TX2plus) [105a:3d73].  Couldn't test via cuz my c3 won't boot the
current kernel.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: add init helpers including ata_pci_prepare_native_host()
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: add init helpers including ata_pci_prepare_native_host()

These will be used to convert LLDs to new init model.

* Add irq_handler field to port_info.  In new init model, requesting
  IRQ is LLD's responsibility and libata doesn't need to know about
  irq_handler.  Most LLDs can simply register their irq_handler but
  some need different irq_handler depending on specific chip.  The
  added port_info->irq_handler field can be used by LLDs to select
  the matching IRQ handler in such cases.

* Add ata_dummy_port_info.

* Implement ata_pci_prepare_native_host(), a helper to alloc ATA host,
  acquire all resources and init the host in one go.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: convert native PCI host handling to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: convert native PCI host handling to new init model

Convert native PCI host handling to alloc-init-register model.  New
function ata_pci_init_native_host() follows the new init model and
replaces ata_pci_init_native_mode().  As there are remaining LLD
users, the old function isn't removed yet.

ata_pci_init_one() is reimplemented using the new function and now
fully converted to new init model.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: convert legacy PCI host handling to new init model
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: convert legacy PCI host handling to new init model

Convert legacy PCI host handling to alloc-init-register model.
ata_init_legacy_host(), ata_request_legacy_irqs() and
ata_pci_init_bmdma() are separated out and follow the new init model.

The two legacy handling functions use separate ata_legacy_devres
instead of generic devm_* resources.  This reduces devres overhead for
legacy hosts which was a bit high because it didn't use PCI/iomap
merged resoruces.

ata_pci_init_one() is rewritten in terms of the aboved functions but
native mode handling is still using the old method.  Conversion will
be completed when native mode handling is updated.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: implement ata_host_alloc_pinfo() and ata_host_register()
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: implement ata_host_alloc_pinfo() and ata_host_register()

Implement ata_host_alloc_pinfo() and ata_host_register().  These helpers
will be used in the following patches to adopt new init model.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: separate out ata_host_alloc() and ata_host_register()
Tejun Heo [Tue, 17 Apr 2007 14:44:07 +0000 (23:44 +0900)]
libata: separate out ata_host_alloc() and ata_host_register()

Reorganize ata_host_alloc() and its subroutines into the following
three functions.

* ata_host_alloc() : allocates host and its ports.  shost is not
  registered automatically.

* ata_scsi_add_hosts() : allocates and adds shosts associated with an
  ATA host.  Used by ata_host_register().

* ata_host_register() : takes a fully initialized ata_host structure
  and registers it to libata layer and probes it.

Only ata_host_alloc() and ata_host_register() are exported.
ata_device_add() is rewritten using the above functions.  This patch
does not introduce any observable behavior change.  Things worth
mentioning.

* print_id is assigned at registration time and LLDs are allowed to
  overallocate ports and reduce host->n_ports during initialization.
  ata_host_register() will throw away unused ports automatically.

* All SCSI host initialization stuff now resides in
  ata_scsi_add_hosts() in libata-scsi.c, where it should be.

* ipr is now the only user of ata_host_init().  Either kill it by
  converting ipr to use ata_host_alloc() and friends or rename and
  move it to libata-scsi.c

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: separate out ata_host_start()
Tejun Heo [Tue, 17 Apr 2007 14:44:06 +0000 (23:44 +0900)]
libata: separate out ata_host_start()

Separate out ata_host_start() from ata_device_add().  ata_host_start()
calls ->port_start on each port if available and freezes the port.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolibata: allocate ap separately from shost
Tejun Heo [Tue, 17 Apr 2007 14:44:06 +0000 (23:44 +0900)]
libata: allocate ap separately from shost

Don't embed ap inside shost.  Allocate it separately and point it back
from shosts's hostdata.  This makes port allocation more flexible and
allows regular ATA and SAS share host alloc/init paths.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>