]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
15 years agoMIPS: TXx9: Microoptimize interrupt handlers
Atsushi Nemoto [Mon, 1 Sep 2008 13:22:37 +0000 (22:22 +0900)]
MIPS: TXx9: Microoptimize interrupt handlers

The IOC interrupt status register on RBTX49XX only have 8 bits.  Use
8-bit version of __fls() to optimize interrupt handlers.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: stop_unused_modules
Atsushi Nemoto [Mon, 1 Sep 2008 13:22:36 +0000 (22:22 +0900)]
MIPS: TXx9: stop_unused_modules

TXx9 SoCs have pin multiplex.  Stop some controller modules which can
not be used due to pin configurations.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoDocumentation: Document the RB532 specific kmac tag
Florian Fainelli [Sat, 23 Aug 2008 16:54:37 +0000 (18:54 +0200)]
Documentation: Document the RB532 specific kmac tag

The Routerboard 532 bootloader passes the korina ethernet
MAC adapter address to the kernel on the command line.
Document this in the kernel-parameters file.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: Convert to GPIO lib
Florian Fainelli [Sat, 23 Aug 2008 16:54:34 +0000 (18:54 +0200)]
MIPS: RB532: Convert to GPIO lib

This patch converts the rb532 code to use gpio library
and register its gpio chip.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: Remove unused rc32434_sync_delay and rc32434_sync_udelay
Florian Fainelli [Sat, 23 Aug 2008 16:54:04 +0000 (18:54 +0200)]
MIPS: RB532: Remove unused rc32434_sync_delay and rc32434_sync_udelay

This patch removes these two unused functions :
rc32434_sync_delay and rc32434_sync_udelay

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: Cleanup the headers again
Florian Fainelli [Sat, 23 Aug 2008 16:53:50 +0000 (18:53 +0200)]
MIPS: RB532: Cleanup the headers again

This patch cleans up headers and regroups informations to
where they should reside. While moving, try to have a
consistant naming for defines.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: Remove obsolute reference to setup_serial_port
Florian Fainelli [Sat, 23 Aug 2008 16:53:24 +0000 (18:53 +0200)]
MIPS: RB532: Remove obsolute reference to setup_serial_port

We are no longer using setup_serial_port. So just remove it
from the prom code.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: Fix id usage in platform devices
Florian Fainelli [Fri, 22 Aug 2008 15:03:03 +0000 (17:03 +0200)]
MIPS: RB532: Fix id usage in platform devices

When there is only platform device of the same type, id = -1
should be used, fix this.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: replace raw volatile read with a readl
Florian Fainelli [Fri, 22 Aug 2008 15:02:03 +0000 (17:02 +0200)]
MIPS: RB532: replace raw volatile read with a readl

This patch replaces a raw read using volatiles
with a readl.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: Remove gpio bootup state
Florian Fainelli [Fri, 22 Aug 2008 15:01:31 +0000 (17:01 +0200)]
MIPS: RB532: Remove gpio bootup state

We are no longer using gpio bootup state, so do not export
it and do not parse the kernel command line tag for it.
Instead we provide gpio-keys for the button the gpio bootup
state was checking.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: Use physical addresses for gpio and device controller registers
Florian Fainelli [Fri, 22 Aug 2008 15:01:03 +0000 (17:01 +0200)]
MIPS: RB532: Use physical addresses for gpio and device controller registers

This patch fixes the misuse of virtual addresses for the GPIO and third
device controller which would lead to problems while accessing ioremap'd
registers.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RB532: Cleanup and group definitions to their right places
Florian Fainelli [Fri, 22 Aug 2008 15:00:22 +0000 (17:00 +0200)]
MIPS: RB532: Cleanup and group definitions to their right places

This patch moves GPIO related definitions to gpio.h and IRQ
related to irq.h

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Declare smsc_fdc37m81x_config_get() in smsc_fdc37m81x.h
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:18 +0000 (22:55 +0900)]
MIPS: TXx9: Declare smsc_fdc37m81x_config_get() in smsc_fdc37m81x.h

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Add __init tag for tx4938_pcic1_map_irq.
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:17 +0000 (22:55 +0900)]
MIPS: TXx9: Add __init tag for tx4938_pcic1_map_irq.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Add board_be_init for TX4927/TX4938
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:16 +0000 (22:55 +0900)]
MIPS: TXx9: Add board_be_init for TX4927/TX4938

Setup default board_be_handler for TX4927/TX4938.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Default machine_restart using watchdog reset
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:15 +0000 (22:55 +0900)]
MIPS: TXx9: Default machine_restart using watchdog reset

Add default machine_restart routine using watchdog reset of TX4927 and
TX4938.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Make spi_eeprom.c more generic
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:14 +0000 (22:55 +0900)]
MIPS: TXx9: Make spi_eeprom.c more generic

Helper routines in txx9/rbtx4938/spi_eeprom.c is not TX4938 specific.
Move it to txx9/generic/ directory and make it works with SPI bus
number other than 0.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
 create mode 100644 arch/mips/txx9/generic/spi_eeprom.c
 delete mode 100644 arch/mips/txx9/rbtx4938/spi_eeprom.c

15 years agoMIPS: RBTX4938: Add TOSHIBA_RBTX4938_MPLEX_KEEP
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:13 +0000 (22:55 +0900)]
MIPS: RBTX4938: Add TOSHIBA_RBTX4938_MPLEX_KEEP

Add TOSHIBA_RBTX4938_MPLEX_KEEP to keep MPLEX settings by firmware.
Also replace some printk with pr_info.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Raise priority of interrupts for errors, timers, SIO
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:12 +0000 (22:55 +0900)]
MIPS: TXx9: Raise priority of interrupts for errors, timers, SIO

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Add mtd support
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:11 +0000 (22:55 +0900)]
MIPS: TXx9: Add mtd support

Add helper routines to register physmap-flash platform devices for NOR
flashes.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Runtime configuration of timeout-error
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:10 +0000 (22:55 +0900)]
MIPS: TXx9: Runtime configuration of timeout-error

Add kernel options to control bus timeout error.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Cache fixup
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:09 +0000 (22:55 +0900)]
MIPS: TXx9: Cache fixup

TX39/TX49 can enable/disable I/D cache at runtime.  Add kernel options
to control them.  This is useful to debug some cache-related issues,
such as aliasing or I/D coherency.  Also enable CWF bit for TX49 SoCs.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Early command-line preprocessing
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:08 +0000 (22:55 +0900)]
MIPS: TXx9: Early command-line preprocessing

* Select board by command-line option or firmware environment variable.
* Handle "masterclk=" option.
* Add boards.h to centerize board_vec declaration.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
 create mode 100644 include/asm-mips/txx9/boards.h

15 years agoMIPS: TXx9: Add prom_getenv
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:07 +0000 (22:55 +0900)]
MIPS: TXx9: Add prom_getenv

Add prom_getenv() which can be used for YAMON.  This assumes other
firmware should pass NULL for fw_arg2.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: TXx9: Improve handling of built-in and command-line args
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:06 +0000 (22:55 +0900)]
MIPS: TXx9: Improve handling of built-in and command-line args

* Make prom_init_cmdline() static and be called from prom_init.
* Append built-in args if the first character was '+'.
* Drop command-line args if the first character of built-in was '-'.
* Enclose args include spaces by quotes.
* TX4938_NAND_BOOT is no longer needed.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: RBTX4927: More explicit initialization
Atsushi Nemoto [Tue, 19 Aug 2008 13:55:05 +0000 (22:55 +0900)]
MIPS: RBTX4927: More explicit initialization

* Make sure all interrupts cleared on startup
* Initialize some GPIOs

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years agoMIPS: PMC MSP71XX gpio drivers
Patrick Glass [Mon, 18 Aug 2008 21:41:30 +0000 (14:41 -0700)]
MIPS: PMC MSP71XX gpio drivers

This new gpio driver for PMC-Sierra's MSP71xx SoC allows
standard api calls for access to the general and extended
gpio's.

Signed-off-by: Patrick Glass <patrickglass@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
 create mode 100755 arch/mips/pmc-sierra/msp71xx/gpio.c
 create mode 100755 arch/mips/pmc-sierra/msp71xx/gpio_extended.c
 create mode 100755 include/asm-mips/pmc-sierra/msp71xx/gpio.h

15 years agoMIPS: Use compat_sys_ptrace
Thomas Bogendoerfer [Sun, 17 Aug 2008 14:49:25 +0000 (16:49 +0200)]
MIPS: Use compat_sys_ptrace

This replaces mips's sys_ptrace32 with a compat_arch_ptrace and
enables the new generic definition of compat_sys_ptrace instead.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
15 years ago[ARM] 5300/1: fixup spitz reset during boot
Dmitry Baryshkov [Thu, 9 Oct 2008 15:58:13 +0000 (16:58 +0100)]
[ARM] 5300/1: fixup spitz reset during boot

Some machines don't have the pullup/down on their reset
pin, so configuring the reset generating pin as input makes
them reset immediately. Fix that by making reset pin direction
configurable.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
15 years agoext4: add an option to control error handling on file data
Hidehiro Kawai [Sat, 11 Oct 2008 02:12:43 +0000 (22:12 -0400)]
ext4: add an option to control error handling on file data

If the journal doesn't abort when it gets an IO error in file data
blocks, the file data corruption will spread silently.  Because
most of applications and commands do buffered writes without fsync(),
they don't notice the IO error.  It's scary for mission critical
systems.  On the other hand, if the journal aborts whenever it gets
an IO error in file data blocks, the system will easily become
inoperable.  So this patch introduces a filesystem option to
determine whether it aborts the journal or just call printk() when
it gets an IO error in file data.

If you mount an ext4 fs with data_err=abort option, it aborts on file
data write error.  If you mount it with data_err=ignore, it doesn't
abort, just call printk().  data_err=ignore is the default.

Here is the corresponding patch of the ext3 version:
http://kerneltrap.org/mailarchive/linux-kernel/2008/9/9/3239374

Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agojbd2: don't dirty original metadata buffer on abort
Hidehiro Kawai [Sat, 11 Oct 2008 00:29:31 +0000 (20:29 -0400)]
jbd2: don't dirty original metadata buffer on abort

Currently, original metadata buffers are dirtied when they are
unfiled whether the journal has aborted or not.  Eventually these
buffers will be written-back to the filesystem by pdflush.  This
means some metadata buffers are written to the filesystem without
journaling if the journal aborts.  So if both journal abort and
system crash happen at the same time, the filesystem would become
inconsistent state.  Additionally, replaying journaled metadata
can overwrite the latest metadata on the filesystem partly.
Because, if the journal gets aborted, journaled metadata are
preserved and replayed during the next mount not to lose
uncheckpointed metadata.  This would also break the consistency
of the filesystem.

This patch prevents original metadata buffers from being dirtied
on abort by clearing BH_JBDDirty flag from those buffers.  Thus,
no metadata buffers are written to the filesystem without journaling.

Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoext4: add checks for errors from jbd2
Hidehiro Kawai [Sat, 11 Oct 2008 00:29:21 +0000 (20:29 -0400)]
ext4: add checks for errors from jbd2

If the journal has aborted due to a checkpointing failure, we
have to keep the contents of the journal space.  Otherwise, the
filesystem will lose uncheckpointed metadata completely and
become inconsistent.  To avoid this, we need to keep needs_recovery
flag if checkpoint has failed.

With this patch, ext4_put_super() detects a checkpointing failure
from the return value of journal_destroy(), then it invokes
ext4_abort() to make the filesystem read only and keep
needs_recovery flag.  Errors from jbd2_journal_flush() are also
handled by this patch in some places.

Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agojbd2: fix error handling for checkpoint io
Hidehiro Kawai [Sat, 11 Oct 2008 00:29:13 +0000 (20:29 -0400)]
jbd2: fix error handling for checkpoint io

When a checkpointing IO fails, current JBD2 code doesn't check the
error and continue journaling.  This means latest metadata can be
lost from both the journal and filesystem.

This patch leaves the failed metadata blocks in the journal space
and aborts journaling in the case of jbd2_log_do_checkpoint().
To achieve this, we need to do:

1. don't remove the failed buffer from the checkpoint list where in
   the case of __try_to_free_cp_buf() because it may be released or
   overwritten by a later transaction
2. jbd2_log_do_checkpoint() is the last chance, remove the failed
   buffer from the checkpoint list and abort the journal
3. when checkpointing fails, don't update the journal super block to
   prevent the journaled contents from being cleaned.  For safety,
   don't update j_tail and j_tail_sequence either
4. when checkpointing fails, notify this error to the ext4 layer so
   that ext4 don't clear the needs_recovery flag, otherwise the
   journaled contents are ignored and cleaned in the recovery phase
5. if the recovery fails, keep the needs_recovery flag
6. prevent jbd2_cleanup_journal_tail() from being called between
   __jbd2_journal_drop_transaction() and jbd2_journal_abort()
   (a possible race issue between jbd2_log_do_checkpoint()s called by
   jbd2_journal_flush() and __jbd2_log_wait_for_space())

Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agojbd2: abort when failed to log metadata buffers
Hidehiro Kawai [Sun, 12 Oct 2008 20:39:16 +0000 (16:39 -0400)]
jbd2: abort when failed to log metadata buffers

If we failed to write metadata buffers to the journal space and
succeeded to write the commit record, stale data can be written
back to the filesystem as metadata in the recovery phase.

To avoid this, when we failed to write out metadata buffers,
abort the journal before writing the commit record.

We can also avoid this kind of corruption by using the journal
checksum feature because it can detect invalid metadata blocks in the
journal and avoid them from being replayed.  So we don't need to care
about asynchronous commit record writeout with a checksum.

Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
15 years agoext4: Rename ext4dev to ext4
Theodore Ts'o [Sat, 11 Oct 2008 00:02:48 +0000 (20:02 -0400)]
ext4: Rename ext4dev to ext4

The ext4 filesystem is getting stable enough that it's time to drop
the "dev" prefix.  Also remove the requirement for the TEST_FILESYS
flag.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15 years agoMerge branch 'r8169' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6
David S. Miller [Fri, 10 Oct 2008 21:43:54 +0000 (14:43 -0700)]
Merge branch 'r8169' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6

15 years agomyri10ge: update driver version number to 1.4.3-1.369
Brice Goglin [Fri, 10 Oct 2008 21:33:37 +0000 (14:33 -0700)]
myri10ge: update driver version number to 1.4.3-1.369

Update myri10ge driver version number to 1.4.3-1.369.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agor8169: add shutdown handler
Francois Romieu [Sat, 13 Sep 2008 15:21:40 +0000 (17:21 +0200)]
r8169: add shutdown handler

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: preliminary 8168d support
Francois Romieu [Sun, 20 Jul 2008 14:22:45 +0000 (16:22 +0200)]
r8169: preliminary 8168d support

Taken from Realtek's 8.007.00 r8168 driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Fixed-by: Ivan Vecera <ivecera@redhat.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: support additional 8168cp chipset
Francois Romieu [Sun, 20 Jul 2008 16:53:20 +0000 (18:53 +0200)]
r8169: support additional 8168cp chipset

Taken from Realtek's 8.007.00 r8168 driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Fixed-by: Ivan Vecera <ivecera@redhat.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: change default behavior for mildly identified 8168c chipsets
Francois Romieu [Sun, 29 Jun 2008 11:10:54 +0000 (13:10 +0200)]
r8169: change default behavior for mildly identified 8168c chipsets

The addition of a new device has so far implied a specialization of
these masks. While they identify 8168c devices, they can be expected
to be further refined as they have been by Realtek so far.

The change should bring the driver closer to the version 8.006.00 of
Realtek's 8168 driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: add a new 8168cp flavor
Francois Romieu [Sun, 29 Jun 2008 10:24:30 +0000 (12:24 +0200)]
r8169: add a new 8168cp flavor

Taken from Realtek's 8.006.00 r8168 driver.

I have left some bits related to jumbo frame aside for now.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: add a new 8168c flavor (bis)
Francois Romieu [Sun, 29 Jun 2008 09:54:28 +0000 (11:54 +0200)]
r8169: add a new 8168c flavor (bis)

Taken from Realtek's 8.006.00 r8168 driver.

I have left some bits related to jumbo frame aside for now.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: add a new 8168c flavor
Francois Romieu [Sat, 28 Jun 2008 11:16:02 +0000 (13:16 +0200)]
r8169: add a new 8168c flavor

Taken from Realtek's 8.006.00 r8168 driver.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: sync existing 8168 device hardware start sequences with vendor driver
Francois Romieu [Sat, 28 Jun 2008 10:22:59 +0000 (12:22 +0200)]
r8169: sync existing 8168 device hardware start sequences with vendor driver

This part of the driver should be reasonably in line with Realtek's
8.006.00 driver.

I have left some bits related to jumbo frame and optional features
aside for now.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: 8168b Tx performance tweak
Francois Romieu [Sat, 28 Jun 2008 10:00:55 +0000 (12:00 +0200)]
r8169: 8168b Tx performance tweak

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: make room for more specific 8168 hardware start procedure
Francois Romieu [Sat, 28 Jun 2008 09:58:39 +0000 (11:58 +0200)]
r8169: make room for more specific 8168 hardware start procedure

Broadly speaking the 8168c* share some common code which will
be factored in __rtl_hw_start_8168cp. The 8168b* share some
code too but it will be a bit different.

Any change of behavior should be confined to the currently
unidentified 8168 chipsets. They will not be applied the Tx
performance tweak and will emit a warning instead.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: shuffle some registers handling around (8168 operation only)
Francois Romieu [Sun, 1 Jun 2008 10:31:57 +0000 (12:31 +0200)]
r8169: shuffle some registers handling around (8168 operation only)

I can not argue strongly for (or against) a specific ordering
on a purely technical ground but the patch avoids to swallow
Realtek's changes in one big, hard-to-read gulp.

Let aside the way the RxConfig register is written (see
rtl_set_rx_tx_config_registers / RxConfig / rtl_set_rx_mode),
this change brings the registers write ordering closer with
Realtek's driver one (version 8.006.00) for the 8168 chipsets.

More 8168 specific code which touches the Configx registers will
be added in the section covered by Cfg9346_UnLock / Cfg9346_Lock.

This code should not be the cause of regression for 810x and
8110 users.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: new phy init parameters for the 8168b
Francois Romieu [Fri, 30 May 2008 14:11:48 +0000 (16:11 +0200)]
r8169: new phy init parameters for the 8168b

The new parameters are synced with Realtek's driver
version 8.006.00.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: update phy init parameters
Francois Romieu [Fri, 30 May 2008 14:07:07 +0000 (16:07 +0200)]
r8169: update phy init parameters

The modified parameters are synced with Realtek's driver
version 8.006.00.

The change should only be noticeable with some 8168c.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
15 years agor8169: wake up the PHY of the 8168
Francois Romieu [Wed, 3 Sep 2008 22:17:12 +0000 (00:17 +0200)]
r8169: wake up the PHY of the 8168

This is typically needed when some other OS puts the PHY
to sleep due to the disabling of WOL options in the BIOS
of the system.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Chiaki Ishikawa <chiaki.ishikawa@ubin.jp>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
Cc: RyanKao <ryankao@realtek.com.tw>
15 years agoaf_key: fix SADB_X_SPDDELETE response
Tobias Brunner [Fri, 10 Oct 2008 21:07:03 +0000 (14:07 -0700)]
af_key: fix SADB_X_SPDDELETE response

When deleting an SPD entry using SADB_X_SPDDELETE, c.data.byid is not
initialized to zero in pfkey_spddelete(). Thus, key_notify_policy()
responds with a PF_KEY message of type SADB_X_SPDDELETE2 instead of
SADB_X_SPDDELETE.

Signed-off-by: Tobias Brunner <tobias.brunner@strongswan.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoide: Remove ide_spin_wait_hwgroup() and use special requests instead
Elias Oltmanns [Fri, 10 Oct 2008 20:39:40 +0000 (22:39 +0200)]
ide: Remove ide_spin_wait_hwgroup() and use special requests instead

Use a special request for serialisation purposes and get rid of the
awkward ide_spin_wait_hwgroup(). This also involves converting the
ide_devset structure so it can be shared by the /proc and the ioctl code.

Signed-off-by: Elias Oltmanns <eo@nebensachen.de>
[bart: use rq->cmd[] directly]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: move IDE{FLOPPY,TAPE}_WAIT_CMD defines to <linux/ide.h>
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:39 +0000 (22:39 +0200)]
ide: move IDE{FLOPPY,TAPE}_WAIT_CMD defines to <linux/ide.h>

While at it:

* IDE{FLOPPY,TAPE}_WAIT_CMD -> WAIT_{FLOPPY,TAPE}_CMD

* Use enum for WAIT_* defines.

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_do_test_unit_ready() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:39 +0000 (22:39 +0200)]
ide: add ide_do_test_unit_ready() helper

* Add ide_do_test_unit_ready() helper and convert ide-{floppy,tape}.c
  to use it.

* Remove no longer used idetape_create_test_unit_ready_cmd().

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_do_start_stop() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:39 +0000 (22:39 +0200)]
ide: add ide_do_start_stop() helper

* Add ide_do_start_stop() helper and convert ide-{floppy,tape}.c
  to use it.

* Remove no longer used idefloppy_create_start_stop_cmd()
  and idetape_create_load_unload_cmd().

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_set_media_lock() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:38 +0000 (22:39 +0200)]
ide: add ide_set_media_lock() helper

* Set IDE_AFLAG_NO_DOORLOCK in idetape_get_mode_sense_result(), check it
  in ide_tape_set_media_lock() and cleanup idetape_create_prevent_cmd().

* Set IDE_AFLAG_NO_DOORLOCK in ide_floppy_create_read_capacity_cmd() and
  check it instead of IDE_AFLAG_CLIK_DRIVE in ide_floppy_set_media_lock().

* Add ide_set_media_lock() helper and convert ide-{floppy,tape}.c to use it.

* Remove no longer used ide*_create_prevent_cmd()/ide*_set_media_lock().

* Update comment in <linux/ide.h> accordingly.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: move floppy ioctls handling to ide-floppy_ioctl.c
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:38 +0000 (22:39 +0200)]
ide-floppy: move floppy ioctls handling to ide-floppy_ioctl.c

While at it:

- idefloppy_create_read_capacity_cmd() -> ide_floppy_create_read_capacity_cmd()
- idefloppy_create_mode_sense_cmd() -> ide_floppy_create_mode_sense_cmd()
- idefloppy_create_request_sense_cmd() -> ide_floppy_create_request_sense_cmd()
- idefloppy_create_format_unit_cmd() -> ide_floppy_create_format_unit_cmd()
- idefloppy_get_sfrp_bit() -> ide_floppy_get_sfrp_bit()

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: ->{srfp,wp} -> IDE_AFLAG_{SRFP,WP}
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:38 +0000 (22:39 +0200)]
ide-floppy: ->{srfp,wp} -> IDE_AFLAG_{SRFP,WP}

Add IDE_AFLAG_{SRFP,WP} drive->atapi_flags and use them
instead of ->{srfp,wp} struct ide_floppy_obj fields.

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_queue_pc_tail() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:38 +0000 (22:39 +0200)]
ide: add ide_queue_pc_tail() helper

* Add ide_queue_pc_tail() and convert ide-{floppy,tape}.c to use it
  instead of ide*_queue_pc_tail().

* Remove no longer used ide*_queue_pc_tail().

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_queue_pc_head() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:37 +0000 (22:39 +0200)]
ide: add ide_queue_pc_head() helper

* Move REQ_IDETAPE_* enums to <linux/ide.h>.

* Add ide_queue_pc_head() and convert ide-{floppy,tape}.c to use it
  instead of ide*_queue_pc_head().

* Remove no longer used ide*_queue_pc_head().

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_init_pc() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:37 +0000 (22:39 +0200)]
ide: add ide_init_pc() helper

* Add IDE_PC_BUFFER_SIZE define.

* Add ide_init_pc() and convert ide-{floppy,tape}.c to use it
  instead of ide*_init_pc().

* Remove no longer used IDE*_PC_BUFFER_SIZE and ide*_init_pc().

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-tape: add ide_tape_set_media_lock() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:37 +0000 (22:39 +0200)]
ide-tape: add ide_tape_set_media_lock() helper

Add ide_tape_set_media_lock() helper and convert idetape_mtioctop(),
idetape_chrdev_open() and idetape_chrdev_release() to use it.

There should be no functional changes caused by this patch (it is
OK to modify ->door_locked if idetape_create_prevent_cmd() fails).

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: add ide_floppy_set_media_lock() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:37 +0000 (22:39 +0200)]
ide-floppy: add ide_floppy_set_media_lock() helper

Add ide_floppy_set_media_lock() helper and convert idefloppy_open(),
idefloppy_release() and ide_floppy_lockdoor() to use it.

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_io_buffers() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:36 +0000 (22:39 +0200)]
ide: add ide_io_buffers() helper

* Make ->io_buffers method return number of bytes transferred.

* Use ide_end_request() instead of idefloppy_end_request()
  in ide_floppy_io_buffers() and then move the call out to
  ide_pc_intr().

* Add ide_io_buffers() helper and convert ide-{floppy,scsi}.c
  to use it instead of ide*_io_buffers().

There should be no functional changes caused by this patch.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-scsi: cleanup ide_scsi_io_buffers()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:36 +0000 (22:39 +0200)]
ide-scsi: cleanup ide_scsi_io_buffers()

Preparation for ide_{floppy,scsi}_io_buffers() unification.

Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: remove MODE_SENSE_* defines
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:36 +0000 (22:39 +0200)]
ide-floppy: remove MODE_SENSE_* defines

Only MODE_SENSE_CURRENT (0x00) is ever used so just remove
these defines and then drop no longer needed 'type' argument
from idefloppy_create_mode_sense_cmd().

Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-{floppy,tape}: remove packet command stack
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:36 +0000 (22:39 +0200)]
ide-{floppy,tape}: remove packet command stack

* Add 'struct ide_atapi_pc queued_pc' to struct ide_{floppy,tape}_obj
  and switch ide*_do_request() to use it (there can be only one active
  request for a given device).

* Add 'struct ide_atapi_pc request_sense_pc' to struct ide_*_obj
  and switch ide*_retry_pc() to use it.

* Remove needless {floppy,tape}->pc assignment from ide*_setup().

* Remove no longer needed ide*_next_pc_storage(), pc_stack[],
  rq_stack_index, IDE*_PC_STACK and DBG_PC_STACK.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-{floppy,tape}: remove request stack
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:35 +0000 (22:39 +0200)]
ide-{floppy,tape}: remove request stack

* Add 'struct request request_sense_rq' to struct ide_{floppy,tape}_obj
  and switch ide*_retry_pc() to use it (there can be only one REQUEST SENSE
  request active for a given device).

* Remove no longer needed ide*_next_rq_storage(), rq_stack[]
  and rq_stack_index.

* DBG_PCRQ_STACK -> DBG_PC_STACK

* Update comments for IDE*_PC_STACK and idetape_queue_pc_{head,tail}().

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-generic: handle probing of legacy io-ports v5
Borislav Petkov [Fri, 10 Oct 2008 20:39:35 +0000 (22:39 +0200)]
ide-generic: handle probing of legacy io-ports v5

Avoid probing the io-ports in case an IDE PCI controller is present and it
uses the legacy iobases. If we still want to enforce the probing, we do

ide_generic.probe_mask=0x3f

on the kernel command line. The iobase checking code is
adapted from drivers/ata/pata_legacy.c after converting hex
pci ids into their corresponding macros in <linux/pci_ids.h>.

Also, check only BAR0/2 resources since those are guaranteed
by the workaround in drivers/pci/probe.c:pci_setup_device().

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
[bart: trivial printk() fixups]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: use scatterlists for pio transfers
Borislav Petkov [Fri, 10 Oct 2008 20:39:35 +0000 (22:39 +0200)]
ide-floppy: use scatterlists for pio transfers

Use hwif->sg_table for pio transfers instead of fumbling
with block layer internals in the driver. Also, make debug
statements more informative in .._do_request() while at it.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
[bart: fixup pc->b_count in idefloppy_blockpc_cmd()]
[bart: add missing include (noticed by Stephen Rothwell)]
[bart: map hwif->sg_{table,nents} on pc->{sg,sg_cnt} (multi-IRQs-per-sg fix)]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-tape: remove idetape_init_rq()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:34 +0000 (22:39 +0200)]
ide-tape: remove idetape_init_rq()

idetape_init_rq() is only used in idetape_queue_pc_head()
so inline it there.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: add ide_floppy_format_ioctl() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:34 +0000 (22:39 +0200)]
ide-floppy: add ide_floppy_format_ioctl() helper

* Factor out IDEFLOPPY_IOCTL_FORMAT_* ioctls handling from
  idefloppy_ioctl() to ide_floppy_format_ioctl().

While at it:

* Pass 'drive' instead of 'floppy' to ide_floppy_format_unit().

* idefloppy_get_format_progress() -> ide_floppy_get_format_progress()

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide-floppy: remove needless parens
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:34 +0000 (22:39 +0200)]
ide-floppy: remove needless parens

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_check_atapi_device() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:34 +0000 (22:39 +0200)]
ide: add ide_check_atapi_device() helper

* Add ide_check_atapi_device() to ide-atapi.c and convert
  ide-{floppy,tape}.c to use it instead of ide*_identify_device().

While at it:

* Add DRV_NAME defines to ide-{floppy,tape}.c.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: move ioctls handling to ide-ioctls.c
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:33 +0000 (22:39 +0200)]
ide: move ioctls handling to ide-ioctls.c

* Move ioctls handling to ide-ioctls.c
  (except HDIO_DRIVE_TASKFILE for now).

* Make ide_{cmd,task}() static.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: cleanup generic_ide_ioctl()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:33 +0000 (22:39 +0200)]
ide: cleanup generic_ide_ioctl()

* Fix intendation for the main 'switch ()'.

* 'switch ()' -> 'if ()' for HDIO_DRIVE_TASKFILE case.

* Move HDIO_SET_NICE case under HDIO_GET_NICE one.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add ide_setting_ioctl() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:33 +0000 (22:39 +0200)]
ide: add ide_setting_ioctl() helper

* Add struct ide_ioctl_devset representing ioctl device setting.

* Add ide_setting_ioctl() helper for matching given ioctl
  and its parameters against table of ioctl device settings.

* Convert ide_setting_ioctl() and idedisk_ioctl() to use
  ide_setting_ioctl().

* Un-export ide_setting_mtx.

While at it:

* {get,set}_lba_addressing() -> {get,set}_addressing()

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove ->bus_state field from ide_hwif_t
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:33 +0000 (22:39 +0200)]
ide: remove ->bus_state field from ide_hwif_t

It is always set to BUSSTATE_ON.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: add proper PCI PM support (v2)
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:32 +0000 (22:39 +0200)]
ide: add proper PCI PM support (v2)

* Keep pointer to ->init_chipset method also in
  struct ide_host and set it in ide_host_alloc_all().

* Add ide_pci_suspend() and ide_pci_resume() helpers
  (default ->suspend and ->resume implementations).

* ->init_chipset can no longer be marked __devinit.

* Add proper PCI PM support to IDE PCI host drivers
  (rz1000.c and tc86c001.c are skipped for now since
  they need to be converted from using ->init_hwif
  to use ->init_chipset instead).

v2:
* Cleanup CONFIG_PM #ifdef-s per akpm's suggestion.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agohpt366: add hpt3xx_disable_fast_irq() helper
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:32 +0000 (22:39 +0200)]
hpt366: add hpt3xx_disable_fast_irq() helper

* Factor out disabling of "fast interrupt" prediction from
  init_hwif_hpt366() to hpt3xx_disable_fast_irq() helper.

* Use hpt3xx_disable_fast_irq() in ->init_chipset instead of
  ->init_hwif method.

  This is a preparation for adding proper PCI PM support.

While at it:

* Cache chip type in chip_type variable in hpt3xx_disable_fast_irq().

There should be no functional changes caused by this patch.

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: lba_capacity_is_ok() -> ata_id_is_lba_capacity_ok()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:31 +0000 (22:39 +0200)]
ide: lba_capacity_is_ok() -> ata_id_is_lba_capacity_ok()

Rename lba_capacity_is_ok() to ata_id_is_lba_capacity_ok()
and move it to <linux/ata.h> (remove needless parens while at it).

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_id_to_hd_driveid() -> ata_id_to_hd_driveid()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:31 +0000 (22:39 +0200)]
ide: ide_id_to_hd_driveid() -> ata_id_to_hd_driveid()

Rename ide_id_to_hd_driveid() to ata_id_to_hd_driveid()
and move it to <linux/ata.h>.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: use ata_id_is_cfa()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:31 +0000 (22:39 +0200)]
ide: use ata_id_is_cfa()

Use ata_id_is_cfa() in do_identify() instead of open-coding
check for CompactFlash devices (the inline helper also takes
care of detecting CFs advertising themselves as ATA disks).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:31 +0000 (22:39 +0200)]
ide: ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled()

* Add ata_id_flush_ext_enabled() inline helper to <linux/ata.h>.

* ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled()

  The latter one also checks if the command is marked as
  supported in word 83 and validity of words 83 & 86.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_id_has_flush_cache() -> ata_id_flush_enabled()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:30 +0000 (22:39 +0200)]
ide: ide_id_has_flush_cache() -> ata_id_flush_enabled()

* Add ata_id_flush_enabled() inline helper to <linux/ata.h>.

* ide_id_has_flush_cache() -> ata_id_flush_enabled()

  The latter one also checks if the command is marked as
  supported in word 83 and validity of words 83 & 86.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: check only for CACHE FLUSH command support in ide_id_has_flush_cache()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:30 +0000 (22:39 +0200)]
ide: check only for CACHE FLUSH command support in ide_id_has_flush_cache()

All devices supporting CACHE FLUSH EXT command should also support
CACHE FLUSH command so it is sufficient to check only for CACHE FLUSH
in ide_id_has_flush_cache().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: idedisk_supports_lba48() -> ata_id_lba48_enabled()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:30 +0000 (22:39 +0200)]
ide: idedisk_supports_lba48() -> ata_id_lba48_enabled()

* Add ata_id_lba48_enabled() inline helper to <linux/ata.h>.

* idedisk_supports_lba48() -> ata_id_lba48_enabled()

  The latter one also checks validity of words 83 & 86.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_dev_is_sata() -> ata_id_is_sata()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:30 +0000 (22:39 +0200)]
ide: ide_dev_is_sata() -> ata_id_is_sata()

* Use optimized ATA version check from Sergei in ata_id_is_sata().

* ide_dev_is_sata() -> ata_id_is_sata()

Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: ide_dev_has_iordy() -> ata_id_has_iordy()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)]
ide: ide_dev_has_iordy() -> ata_id_has_iordy()

* Remove (id[ATA_ID_FIELD_VALID] & 2) check from ide_dev_has_iordy()
  (it is for validity of words 64-70, IORDY is in word 49).

* ide_dev_has_iordy() -> ata_id_has_iordy()

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: factor out HDIO_*_NICE ioctl handling to ide_*_nice_ioctl()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)]
ide: factor out HDIO_*_NICE ioctl handling to ide_*_nice_ioctl()

Factor out HDIO_{GET,SET}_NICE ioctl handling from
generic_ide_ioctl() to ide_{get,set}_nice_ioctl().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove ->supports_dsc_overlap field from ide_driver_t
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)]
ide: remove ->supports_dsc_overlap field from ide_driver_t

* Use drive->media and drive->scsi to check if ->dsc_overlap
  can be set by HDIO_SET_NICE ioctl in generic_ide_ioctl().

* Remove unused ->supports_dsc_overlap field from ide_driver_t.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove read-only ->atapi_overlap field from ide_drive_t
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:29 +0000 (22:39 +0200)]
ide: remove read-only ->atapi_overlap field from ide_drive_t

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agocmd640: add __set_prefetch_mode()
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:28 +0000 (22:39 +0200)]
cmd640: add __set_prefetch_mode()

Factor out the common code from check_prefetch()
and set_prefetch_mode() to __set_prefetch_mode().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove SECTOR_WORDS define
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:28 +0000 (22:39 +0200)]
ide: remove SECTOR_WORDS define

Just use SECTOR_SIZE instead.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: /proc/ide/hd*/settings rework
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:28 +0000 (22:39 +0200)]
ide: /proc/ide/hd*/settings rework

* Add struct ide_devset, S_* flags, *DEVSET() & ide*_devset_*() macros.

* Add 'const struct ide_devset **settings' to ide_driver_t.

* Use 'const struct ide_devset **settings' in ide_drive_t instead of
  'struct ide_settings_s *settings'.  Then convert core code and device
  drivers to use struct ide_devset and co.:

  - device settings are no longer allocated dynamically for each device
    but instead there is an unique struct ide_devset instance per setting

  - device driver keeps the pointer to the table of pointers to its
    settings in ide_driver_t.settings

  - generic settings are kept in ide_generic_setting[]

  - ide_proc_[un]register_driver(), ide_find_setting_by_name(),
    ide_{read,write}_setting() and proc_ide_{read,write}_settings()
    are updated accordingly

  - ide*_add_settings() are removed

* Remove no longer used __ide_add_setting(), ide_add_setting(),
  __ide_remove_setting() and auto_remove_settings().

* Remove no longer used TYPE_*, SETTING_*, ide_procset_t
  and ide_settings_t.

* ->keep_settings, ->using_dma, ->unmask, ->noflush, ->dsc_overlap,
  ->nice1, ->addressing, ->wcache and ->nowerr ide_drive_t fields
  can now be bitfield flags.

While at it:

* Rename ide_find_setting_by_name() to ide_find_setting().

* Rename write_wcache() to set_wcache().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: preparations for /proc/ide/hd*/settings rework
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:27 +0000 (22:39 +0200)]
ide: preparations for /proc/ide/hd*/settings rework

After rework settings will be no longer created dynamically
for each device so we need to make some fixups first.

* Use set_[ksettings,unmaskirq]() as a set function for
  ["keepsettings","unmaskirq"] setting.

* Allow writes to ["io_32bit","unmaskirq"] settings also when
  drive->no_[io_32bit,unmask] is set (this is checked later inside
  set_[io_32bit,unmaskirq]() anywyay and keeps consistency with
  the corresponding HDIO_SET_[32BIT,UNMASKINTR] ioctls).

* Use max possible multi sectors value (16) as an allowed max for
  "multcount" setting.  set_multcount() set function checks against
  device's max possbile value anyway and it makes the proc setting
  consistent with the corresponding HDIO_SET_MULTCOUNT ioctl.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: call ide_proc_register_driver() later
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:27 +0000 (22:39 +0200)]
ide: call ide_proc_register_driver() later

Call ide_proc_register_driver() in ide*_setup() (just before
ide*_add_settings() call) instead of in ->probe method.

Despite being basically a preparation for /proc/ide/hd*/settings
rework this is a nice cleanup in itself.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: include <linux/hdreg.h> only when needed
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:27 +0000 (22:39 +0200)]
ide: include <linux/hdreg.h> only when needed

* Include <linux/ata.h> directly in <linux/ide.h>
  instead of through <linux/hdreg.h>.

* Include <linux/hdreg.h> only when needed.

Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
15 years agoide: remove CONFIG_IDEDISK_MULTI_MODE
Bartlomiej Zolnierkiewicz [Fri, 10 Oct 2008 20:39:26 +0000 (22:39 +0200)]
ide: remove CONFIG_IDEDISK_MULTI_MODE

Use multi PIO by default when available and remove no longer
needed CONFIG_IDEDISK_MULTI_MODE (it should be safe nowadays,
despite to what help entry has been saying).

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