linux-2.6-microblaze.git
16 years agoblk_end_request: changing viocd (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:47:52 +0000 (17:47 -0500)]
blk_end_request: changing viocd (take 4)

This patch converts viocd to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

As a result, the interface of internal function, viocd_end_request(),
is changed.

Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing xen-blkfront (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:47:36 +0000 (17:47 -0500)]
blk_end_request: changing xen-blkfront (take 4)

This patch converts xen-blkfront to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing viodasd (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:47:14 +0000 (17:47 -0500)]
blk_end_request: changing viodasd (take 4)

This patch converts viodasd to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

As a result, the interface of internal function, viodasd_end_request(),
is changed.

Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing sx8 (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:46:10 +0000 (17:46 -0500)]
blk_end_request: changing sx8 (take 4)

This patch converts sx8 to use blk_end_request interfaces.
Related 'uptodate' and 'is_ok' arguments are converted to 'error'.

As a result, the interfaces of internal functions below are changed.
  o carm_end_request_queued
  o carm_end_rq
  o carm_handle_array_info
  o carm_handle_scan_chan
  o carm_handle_generic
  o carm_handle_rw

The 'is_ok' is set at only one place in carm_handle_resp() below:

int is_ok = (status == RMSG_OK);

And the value is propagated to all functions above, and no modification
in other places.
So the actual conversion of the 'is_ok' is done at only one place above.

Cc: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing sunvdc (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:45:04 +0000 (17:45 -0500)]
blk_end_request: changing sunvdc (take 4)

This patch converts sunvdc to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

As a result, the interface of internal function, vdc_end_request(),
is changed.

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing ps3disk (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:44:39 +0000 (17:44 -0500)]
blk_end_request: changing ps3disk (take 4)

This patch converts ps3disk to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

Cc: Geoff Levand <geoffrey.levand@am.sony.com>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing nbd (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:44:06 +0000 (17:44 -0500)]
blk_end_request: changing nbd (take 4)

This patch converts nbd to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

Cc: Paul Clements <Paul.Clements@steeleye.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing floppy (take 4)
Kiyoshi Ueda [Mon, 28 Jan 2008 09:36:21 +0000 (10:36 +0100)]
blk_end_request: changing floppy (take 4)

This patch converts floppy to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

As a result, the interface of internal function, floppy_end_request(),
is changed.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing DAC960 (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:43:15 +0000 (17:43 -0500)]
blk_end_request: changing DAC960 (take 4)

This patch converts DAC960 to use blk_end_request interfaces.
Related 'UpToDate' arguments are converted to 'Error'.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing um (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:42:53 +0000 (17:42 -0500)]
blk_end_request: changing um (take 4)

This patch converts um to use blk_end_request interfaces.
Related 'uptodate' arguments are converted to 'error'.

As a result, the interface of internal function, ubd_end_request(),
is changed.

Cc: Jeff Dike <jdike@karaya.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing arm (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:42:27 +0000 (17:42 -0500)]
blk_end_request: changing arm (take 4)

This patch converts arm's OMAP mailbox driver to use
blk_end_request interfaces.

If the original code was converted literally, blk_end_request would
be called with '-EIO' because end_that_request_last() were called
with '0' (i.e. failure).
But I think these '0's are bugs in the original code because it's
unlikely that all requests are treated as failure.
(The bugs should have no effect unless these requests have an end_io
 callback.)

So I changed them to pass '0' (i.e. success) to blk_end_request.

Cc: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
Cc: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: changing block layer core (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:41:54 +0000 (17:41 -0500)]
blk_end_request: changing block layer core (take 4)

This patch converts core parts of block layer to use blk_end_request
interfaces.  Related 'uptodate' arguments are converted to 'error'.

'dequeue' argument was originally introduced for end_dequeued_request(),
where no attempt should be made to dequeue the request as it's already
dequeued.
However, it's not necessary as it can be checked with
list_empty(&rq->queuelist).
(Dequeued request has empty list and queued request doesn't.)
And it has been done in blk_end_request interfaces.

As a result of this patch, end_queued_request() and
end_dequeued_request() become identical.  A future patch will merge
and rename them and change users of those functions.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: add/export functions to get request size (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:41:17 +0000 (17:41 -0500)]
blk_end_request: add/export functions to get request size (take 4)

This patch adds/exports functions to get the size of request in bytes.
They are useful because blk_end_request interfaces take bytes
as a completed I/O size instead of sectors.

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoblk_end_request: add new request completion interface (take 4)
Kiyoshi Ueda [Tue, 11 Dec 2007 22:40:30 +0000 (17:40 -0500)]
blk_end_request: add new request completion interface (take 4)

This patch adds 2 new interfaces for request completion:
  o blk_end_request()   : called without queue lock
  o __blk_end_request() : called with queue lock held

blk_end_request takes 'error' as an argument instead of 'uptodate',
which current end_that_request_* take.
The meanings of values are below and the value is used when bio is
completed.
    0 : success
  < 0 : error

Some device drivers call some generic functions below between
end_that_request_{first/chunk} and end_that_request_last().
  o add_disk_randomness()
  o blk_queue_end_tag()
  o blkdev_dequeue_request()
These are called in the blk_end_request interfaces as a part of
generic request completion.
So all device drivers become to call above functions.
To decide whether to call blkdev_dequeue_request(), blk_end_request
uses list_empty(&rq->queuelist) (blk_queued_rq() macro is added for it).
So drivers must re-initialize it using list_init() or so before calling
blk_end_request if drivers use it for its specific purpose.
(Currently, there is no driver which completes request without
 re-initializing the queuelist after used it.  So rq->queuelist
 can be used for the purpose above.)

"Normal" drivers can be converted to use blk_end_request()
in a standard way shown below.

 a) end_that_request_{chunk/first}
    spin_lock_irqsave()
    (add_disk_randomness(), blk_queue_end_tag(), blkdev_dequeue_request())
    end_that_request_last()
    spin_unlock_irqrestore()
    => blk_end_request()

 b) spin_lock_irqsave()
    end_that_request_{chunk/first}
    (add_disk_randomness(), blk_queue_end_tag(), blkdev_dequeue_request())
    end_that_request_last()
    spin_unlock_irqrestore()
    => spin_lock_irqsave()
       __blk_end_request()
       spin_unlock_irqsave()

 c) spin_lock_irqsave()
    (add_disk_randomness(), blk_queue_end_tag(), blkdev_dequeue_request())
    end_that_request_last()
    spin_unlock_irqrestore()
    => blk_end_request()   or   spin_lock_irqsave()
                                __blk_end_request()
                                spin_unlock_irqrestore()

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney...
Linus Torvalds [Sun, 27 Jan 2008 21:15:24 +0000 (08:15 +1100)]
Merge branch 'for-linus' of git://git./linux/kernel/git/cooloney/blackfin-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: (54 commits)
  MAINTIANERS: just use Mike gmail e-mail for contact and pawn the serial driver off onto Sonic
  [Blackfin] arch: remove old I2C BF54x porting.
  [Blackfin] arch: Add the semtimedop syscall.  Upstream uClibc doesn't compile without it.
  [Blackfin] arch: fix bug kernel boot message: memory information is not reasonable
  [Blackfin] arch: use common flash driver to setup partitions rather than the bf5xx-flash driver
  [Blackfin] arch: Fix bug - kernel build with Debug option enabled fails to boot up
  [Blackfin] arch: Fix bug Only RTC interrupt can wake up deeper sleep core.
  [Blackfin] arch: Add proper SW System Reset delay sequence
  [Blackfin] arch: Update copyright date
  [Blackfin] arch: GPIO API cleanup and anomaly update
  [Blackfin] arch: Fix BUG gpio_direction_output API is not compatitable with GENERIC_GPIO API interface
  [Blackfin] arch: Initial checkin of the memory protection support.
  [Blackfin] arch: set_bfin_dma_config shouldnt set SYNC or RESTART by default - add argument or option
  [Blackfin] arch: Add some comments - fix semicolons
  [Blackfin] arch: move all code related to CPLB handling into a new subdirectory under kernel/
  [Blackfin] arch: print out list of modules if kernel is crashing and tell people if the kernel is tainted
  [Blackfin] arch: enable generic GPIO based I2C driver in STAMP-BF533, EZKIT-BF533 and EZKIT-BF561 boards
  [Blackfin] arch: Don't oops_in_progress if single step is comming from the kernel
  [Blackfin] arch: Fix BUG - kernel sometimes would stuck with KEYBOARD_GPIO on
  [Blackfin] arch: update to latest anomaly sheets
  ...

16 years agoi2c-bfin-twi: Register adapter with a specific bus number
Kalle Pokki [Sun, 27 Jan 2008 17:14:52 +0000 (18:14 +0100)]
i2c-bfin-twi: Register adapter with a specific bus number

All the users of this driver explicitly specify the I2C bus numbers
to be used in their platform data. Make the driver respect that.

Signed-off-by: Kalle Pokki <kalle.pokki@eke.fi>
Cc: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-au1550: Convert to platform driver
Manuel Lauss [Sun, 27 Jan 2008 17:14:52 +0000 (18:14 +0100)]
i2c-au1550: Convert to platform driver

Convert the i2c-au1550 bus driver to platform driver, and
register a platform device for the Alchemy Db/Pb series of
boards.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-au1550: properly terminate zero-byte transfers
Manuel Lauss [Sun, 27 Jan 2008 17:14:52 +0000 (18:14 +0100)]
i2c-au1550: properly terminate zero-byte transfers

Zero-bytes transfers would leave the bus transaction unfinished
(no i2c stop is sent), with the following transfer actually
sending the slave address to the previously addressed device,
resulting in weird device failures (e.g. reset minute register
values in my RTC).
This patch instructs the controller to send an I2C STOP right after
the slave address in case of a zero-byte transfer.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agompc-i2c: Propagate error values properly
Jon Smirl [Sun, 27 Jan 2008 17:14:52 +0000 (18:14 +0100)]
mpc-i2c: Propagate error values properly

Propagate the error values returned by i2c_wait() instead of overriding
them with a meaningless -1.

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Add i2c_new_dummy() utility
David Brownell [Sun, 27 Jan 2008 17:14:52 +0000 (18:14 +0100)]
i2c: Add i2c_new_dummy() utility

This adds a i2c_new_dummy() primitive to help work with devices
that consume multiple addresses, which include many I2C eeproms
and at least one RTC.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Drop legacy locking in i2c_new_probed_device
Jean Delvare [Sun, 27 Jan 2008 17:14:52 +0000 (18:14 +0100)]
i2c: Drop legacy locking in i2c_new_probed_device

It is no longer required to hold adapter->clist_lock to call
i2c_check_addr.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
16 years agoi2c: Limit locking scope in i2c_detach_client
Jean Delvare [Sun, 27 Jan 2008 17:14:51 +0000 (18:14 +0100)]
i2c: Limit locking scope in i2c_detach_client

We only need to hold adapter->clist_lock when we touch the client list.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-remove-redundant-i2c_client-list.patch
David Brownell [Sun, 27 Jan 2008 17:14:51 +0000 (18:14 +0100)]
i2c-remove-redundant-i2c_client-list.patch

This goes on top of the patch removing most i2c_adapter.clients usage,
updating i2c_attach_client:

 - Don't call device_register() while holding clist_lock.  This
   removes a self-deadlock when on the i2c_driver.probe() path,
   for drivers that need to attach new devices (e.g. dummies).

 - Remove a redundant address check.  The driver model core does
   this as a consequence of guaranteeing unique names.

 - Move the "device registered" diagnostic so that it never lies;
   previously, on error paths it would falsely report success.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Drivers stop using the redundant client list
Jean Delvare [Sun, 27 Jan 2008 17:14:51 +0000 (18:14 +0100)]
i2c: Drivers stop using the redundant client list

The redundant i2c client list maintained by i2c-core is going away
soon, so drivers should stop using it now. Instead, they can use the
standard iterator provided by the device driver model
(device_for_each_child).

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
Cc: Michael Hunold <michael@mihu.de>
16 years agoi2c: Stop using the redundant client list
David Brownell [Sun, 27 Jan 2008 17:14:51 +0000 (18:14 +0100)]
i2c: Stop using the redundant client list

The i2c_adapter.clients list of i2c_client nodes duplicates driver
model state.  This patch starts removing that list, letting us remove
most existing users of those i2c-core lists.

 * The core I2C code now iterates over the driver model's list instead
   of the i2c-internal one in some places where it's safe:
      - Passing a command/ioctl to each client, a mechanims
        used almost exclusively by DVB adapters;
      - Device address checking, in both i2c-core and i2c-dev.

 * Provide i2c_verify_client() to use with driver model iterators.

 * Flag the relevant i2c_adapter and i2c_client fields as deprecated,
   to help prevent new users from appearing.

For the moment the list needs to stick around, since some issues show
up when deleting devices created by legacy I2C drivers.  (They don't
follow standard driver model rules.  Removing those devices can cause
self-deadlocks.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-viapro: Add support for the VT8237S
Jean Delvare [Sun, 27 Jan 2008 17:14:51 +0000 (18:14 +0100)]
i2c-viapro: Add support for the VT8237S

Add support for another variant of the VT8237. I couldn't test
I2C block support but I assume it is present as well.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-piix4: Drop redundant PCI function number check
Jean Delvare [Sun, 27 Jan 2008 17:14:51 +0000 (18:14 +0100)]
i2c-piix4: Drop redundant PCI function number check

Checking the PCI function number doesn't add any value, and it makes
adding dynamic IDs to the driver more difficult. Drop this check.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Let the user specify PCI driver data through new_id
Jean Delvare [Sun, 27 Jan 2008 17:14:51 +0000 (18:14 +0100)]
i2c: Let the user specify PCI driver data through new_id

The i2c-amd756 and i2c-viapro drivers make use of the driver_data
field of the PCI device ID. When adding device IDs dynamically (by
writing to the new_id sysfs file) you cannot set the value of this
field by default. It has to be allowed explicitly. Do that, and
check the value so that the user can't crash the kernel accidentally.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoi2c-pxa: Add polling transfer
Mike Rapoport [Sun, 27 Jan 2008 17:14:50 +0000 (18:14 +0100)]
i2c-pxa: Add polling transfer

Add polling I2C transfer implementation for PXA I2C. This is needed
for cases where I2C transactions have to occur at times interrups are
disabled.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Support i2c_transfer in atomic contexts
Mike Rapoport [Sun, 27 Jan 2008 17:14:50 +0000 (18:14 +0100)]
i2c: Support i2c_transfer in atomic contexts

Allow i2c_transfer to be called in contexts where sleeping is not allowed.
It is the reponsability of the caller to ensure that the underlying i2c bus
driver will not sleep either.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-sibyte: Remove the bus scan module parameter
Jean Delvare [Sun, 27 Jan 2008 17:14:50 +0000 (18:14 +0100)]
i2c-sibyte: Remove the bus scan module parameter

The implementation is unsafe, and anyway one can achieve the same from
userspace using i2c-dev + i2cdetect.

Also tag i2c_sibyte_add_bus __init.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
16 years agoi2c: Discard unused driver IDs
Jean Delvare [Sun, 27 Jan 2008 17:14:50 +0000 (18:14 +0100)]
i2c: Discard unused driver IDs

Discard all I2C driver IDs that aren't used anywhere. That's not just a
couple of them, but more like 49 or one quarter of all defined IDs! And
this is just a first pass, next will come all IDs that are set but
never used, or used but never set.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-i801: Implement I2C block read support
Jean Delvare [Sun, 27 Jan 2008 17:14:50 +0000 (18:14 +0100)]
i2c-i801: Implement I2C block read support

I2C block read is supported since the ICH5. I couldn't get it to work
using the block buffer, so it's using the old-style byte-by-byte mode
for now.

Note: I'm also updating the driver author... The i2c-i801 driver was
really written by Mark Studebaker, even though he based his work on
the i2c-piix4 driver which was written by Philip Edelbrock.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-i801: Clear special mode bits as needed
Jean Delvare [Sun, 27 Jan 2008 17:14:50 +0000 (18:14 +0100)]
i2c-i801: Clear special mode bits as needed

Clear special mode bits (PEC, block buffer) at driver load time,
you never know in which state the device was left by its last user.

Also make sure that we reset the block buffer mode at the end of every
transaction, not only when PEC was used.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-i801: More explicit names for chip features
Jean Delvare [Sun, 27 Jan 2008 17:14:50 +0000 (18:14 +0100)]
i2c-i801: More explicit names for chip features

Use separate flags with explicit names to describe the features of
the ICH chip.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-i801: Document which chip support what feature
Jean Delvare [Sun, 27 Jan 2008 17:14:49 +0000 (18:14 +0100)]
i2c-i801: Document which chip support what feature

Provide a clearer documentation of which additional features each
ICH chip support, and which of these the driver supports.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c/tps65010: move header to <linux/i2c/...>
David Brownell [Sun, 27 Jan 2008 17:14:49 +0000 (18:14 +0100)]
i2c/tps65010: move header to <linux/i2c/...>

Move the tps65010 header file from the OMAP arch directory to the
more generic <linux/i2c/...> directory, and remove the spurious
dependency of this driver on OMAP.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Rename main mutex
Jean Delvare [Sun, 27 Jan 2008 17:14:49 +0000 (18:14 +0100)]
i2c: Rename main mutex

Rename the main mutex in i2c-core from core_lists to core_lock. This
makes more sense now that the redundant lists are gone.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Drop redundant i2c_driver.list
Jean Delvare [Sun, 27 Jan 2008 17:14:49 +0000 (18:14 +0100)]
i2c: Drop redundant i2c_driver.list

i2c_driver.list is superfluous, this list duplicates the one
maintained by the driver core. Drop it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
16 years agoi2c: Drop redundant i2c_adapter.list
Jean Delvare [Sun, 27 Jan 2008 17:14:48 +0000 (18:14 +0100)]
i2c: Drop redundant i2c_adapter.list

i2c_adapter.list is superfluous, this list duplicates the one
maintained by the driver core. Drop it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
16 years agoi2c: Change prototypes of refcounting functions
Jean Delvare [Sun, 27 Jan 2008 17:14:48 +0000 (18:14 +0100)]
i2c: Change prototypes of refcounting functions

Use more standard prototypes for i2c_use_client() and
i2c_release_client(). The former now returns a pointer to the client,
and the latter no longer returns anything. This matches what all other
subsystems do.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
16 years agoi2c: Use the driver model reference counting
Jean Delvare [Sun, 27 Jan 2008 17:14:48 +0000 (18:14 +0100)]
i2c: Use the driver model reference counting

Don't implement our own reference counting mechanism for i2c clients
when the driver model already has one.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
16 years agoi2c: Deprecate drivers for I2C buses on video adapters
Jean Delvare [Sun, 27 Jan 2008 17:14:47 +0000 (18:14 +0100)]
i2c: Deprecate drivers for I2C buses on video adapters

The framebuffer drivers for these pieces of hardware include support
for the DDC/I2C buses, so there is no need for separate drivers.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Don't uselessly set i2c_adapter.retries
Jean Delvare [Sun, 27 Jan 2008 17:14:47 +0000 (18:14 +0100)]
i2c: Don't uselessly set i2c_adapter.retries

I2C adapter drivers are supposed to handle retries on nack by themselves
if they do, so there's no point in setting .retries if they don't.

As this retry mechanism is going away (at least in its current form),
clean this up now so that we don't get build failures later.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Kill rogue driver IDs
Jean Delvare [Sun, 27 Jan 2008 17:14:47 +0000 (18:14 +0100)]
i2c: Kill rogue driver IDs

I2C driver IDs are optional, so if you don't need one, just omit it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: normal_i2c can be made const (remaining drivers)
Jean Delvare [Sun, 27 Jan 2008 17:14:47 +0000 (18:14 +0100)]
i2c: normal_i2c can be made const (remaining drivers)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: normal_i2c can be made const (rtc drivers)
Jean Delvare [Sun, 27 Jan 2008 17:14:47 +0000 (18:14 +0100)]
i2c: normal_i2c can be made const (rtc drivers)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Alessandro Zummo <alessandro.zummo@towertech.it>
16 years agoi2c: Constify client address data
Mark M. Hoffman [Sun, 27 Jan 2008 17:14:46 +0000 (18:14 +0100)]
i2c: Constify client address data

This patch allows much of the I2C client address data to move from initdata
into text.

Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-algo-pcf: Delete broken 10-bit address support
Jean Delvare [Sun, 27 Jan 2008 17:14:46 +0000 (18:14 +0100)]
i2c-algo-pcf: Delete broken 10-bit address support

The 10-bit address support in i2c-algo-pcf is so heavily broken that
it can't have ever been used. Nobody ever complained, so I'll take it
that nobody needs it. Let's just delete it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-algo-bit: Fix NAK/ARB comments
David Brownell [Sun, 27 Jan 2008 17:14:46 +0000 (18:14 +0100)]
i2c-algo-bit: Fix NAK/ARB comments

Update comments and logging on return path for byte writes.  NAK is
an error, to be reported or optionally ignored.  Timeouts are always
errors.  Lost arbitration is not currently handled, so don't even list
it as an option in the error message.

Don't return bogus EFAULT code for inappropriate NAK; EIO is better,
there is no bad userspace address in question.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-algo-bit: Whitespace fixes (+ NAK/ARB comments)
David Brownell [Sun, 27 Jan 2008 17:14:46 +0000 (18:14 +0100)]
i2c-algo-bit: Whitespace fixes (+ NAK/ARB comments)

Fix *LOTS* of whitespace goofs and checkpatch.pl warnings, strangely
parenthesized ternary expressions, and other CodingStyle glitches.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-pxa: Remove hardcoded #ifdef and use cpu_is_pxa27x
eric miao [Sun, 27 Jan 2008 17:14:46 +0000 (18:14 +0100)]
i2c-pxa: Remove hardcoded #ifdef and use cpu_is_pxa27x

remove #ifdef CONFIG_PXA27x .. #endif and use cpu_is_pxaXXXX() macros
so that a single binary can support PXA25x/PXA27x/PXA3xx at run-time.

Signed-off-by: eric miao <eric.miao@marvell.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: some overdue driver removal
Adrian Bunk [Sun, 27 Jan 2008 17:14:46 +0000 (18:14 +0100)]
i2c: some overdue driver removal

This patch contains the overdue removal of three I2C drivers.

[JD: In fact only i2c-ixp4xx can be removed at the moment, the other two
platforms don't implement the generic GPIO layer yet.]

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoixp4xx-i2c-gpio
Michael-Luke Jones [Sun, 27 Jan 2008 17:14:46 +0000 (18:14 +0100)]
ixp4xx-i2c-gpio

Migrate all ixp4xx devices to the bitbanging I2C bus driver utilizing
the arch-neutral GPIO API (linux/i2c-gpio.h).

Tested by the nslu2-linux and openwrt projects in public firmware releases.

Signed-off-by: Michael-Luke Jones <mlj28@cam.ac.uk>
Acked-by: Rod Whitby <rod@whitby.id.au>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: the scheduled I2C RTC driver removal
Adrian Bunk [Sun, 27 Jan 2008 17:14:45 +0000 (18:14 +0100)]
i2c: the scheduled I2C RTC driver removal

This patch contains the scheduled removal of legacy I2C RTC drivers with
replacement drivers.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-stub: Use a single array for byte and word operations
Jean Delvare [Sun, 27 Jan 2008 17:14:45 +0000 (18:14 +0100)]
i2c-stub: Use a single array for byte and word operations

This mimics the behavior of actual SMBus chips better.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
16 years agoi2c-stub: Mention the existence of an helper script
Jean Delvare [Sun, 27 Jan 2008 17:14:45 +0000 (18:14 +0100)]
i2c-stub: Mention the existence of an helper script

There's a new script named i2c-stub-from-dump that can be very helpful
when working with the i2c-stub driver.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c/tsl2550: Add power management added
Rodolfo Giometti [Sun, 27 Jan 2008 17:14:45 +0000 (18:14 +0100)]
i2c/tsl2550: Add power management added

Signed-off-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c: Add support for the PCF8575 chip
Bart Van Assche [Sun, 27 Jan 2008 17:14:45 +0000 (18:14 +0100)]
i2c: Add support for the PCF8575 chip

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-ibm_iic: Whitespace cleanup
Stefan Roese [Sun, 27 Jan 2008 17:14:45 +0000 (18:14 +0100)]
i2c-ibm_iic: Whitespace cleanup

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-pasemi: use i2c_add_numbered_adapter()
Olof Johansson [Sun, 27 Jan 2008 17:14:44 +0000 (18:14 +0100)]
i2c-pasemi: use i2c_add_numbered_adapter()

Use numbered adapter registration to always have the same hardware bus
show up at the same number.

PWRficient 1682M has three buses, they are all on the same PCI device but
different functions. So do the simple thing and register them based on
function number. Future products, if having a different number of busses,
are expected to have similar behaviour w.r.t. device/function layout.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
16 years agoi2c-nforce2: The nForce2 can do block transactions
Jean Delvare [Sun, 27 Jan 2008 17:14:44 +0000 (18:14 +0100)]
i2c-nforce2: The nForce2 can do block transactions

My guess is that all the chips supported by this driver support block
transactions and reset, but for now we play it safe and only list the
ones for which this was actually tested.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Oleg Ryjkov <olegr@olegr.ca>
16 years agoprintk: revert ktime_get() timestamps
Ingo Molnar [Sun, 27 Jan 2008 07:03:54 +0000 (08:03 +0100)]
printk: revert ktime_get() timestamps

revert 19ef9309273d26cb005cb23e6a370353dca91099.

Kevin Winchester reported a lockup during X startup an bisected
it to this commit.

Reported-by: Kevin Winchester <kjwinchester@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
Linus Torvalds [Sun, 27 Jan 2008 07:01:20 +0000 (23:01 -0800)]
Merge git://git./linux/kernel/git/sfrench/cifs-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
  [CIFS] DFS build fixes
  [CIFS] DFS support: provide shrinkable mounts
  [CIFS] Do not log path names in lookup errors
  [CIFS] DFS support patchset: Added mountdata
  [CIFS] Forgot to add two new files from previous commit
  [CIFS] DNS name resolution helper upcall for cifs
  [CIFS] fix checkpatch warnings in fs/cifs/inode.c
  [CIFS] hold ses sem on tcp session reconnect during mount
  [CIFS] Allow setting mode via cifs acl
  [CIFS]  fix unicode string alignment in SPNEGO setup
  [CIFS] cifs_partialpagewrite() cleanup
  [CIFS]  use krb5 session key from first SMB session after a NegProt
  [CIFS] redo existing session setup if needed in cifs_mount
  [CIFS] Only dump SPNEGO key if CONFIG_CIFS_DEBUG2 is set
  [CIFS] fix SetEA failure to some Samba versions

16 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Linus Torvalds [Sun, 27 Jan 2008 06:54:32 +0000 (22:54 -0800)]
Merge git://git./linux/kernel/git/bart/ide-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (63 commits)
  ide: remove REQ_TYPE_ATA_CMD
  ide: switch ide_cmd_ioctl() to use REQ_TYPE_ATA_TASKFILE requests
  ide: switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests
  ide: fix final status check in drive_cmd_intr()
  ide: check BUSY and ERROR status bits before reading data in drive_cmd_intr()
  ide: don't enable local IRQs for PIO-in in driver_cmd_intr() (take 2)
  ide: convert "empty" REQ_TYPE_ATA_CMD requests to use REQ_TYPE_ATA_TASKFILE
  ide: initialize rq->cmd_type in ide_init_drive_cmd() callers
  ide: use wait_drive_not_busy() in drive_cmd_intr() (take 2)
  ide: kill DATA_READY define
  ide: task_end_request() fix
  ide: use rq->nr_sectors in task_end_request()
  ide: remove needless ->cursg clearing from task_end_request()
  ide: set IDE_TFLAG_IN_* flags before queuing/executing command
  ide-tape: fix handling of non-special requests in ->end_request method
  ide: fix final status check in task_in_intr()
  ide: clear HOB bit for REQ_TYPE_ATA_CMD requests in ide_end_drive_cmd()
  ide: fix ->io_32bit race in ide_taskfile_ioctl()
  cmd64x: remove /proc/ide/cmd64x
  ide: remove broken disk byte-swapping support
  ...

16 years agoMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Sun, 27 Jan 2008 06:52:53 +0000 (22:52 -0800)]
Merge branch 'for-linus' of git://git390.osdl.marist.edu/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: (56 commits)
  [S390] replace lock_cpu_hotplug with get_online_cpus
  [S390] usage of s390dbf: shrink number of debug areas to use.
  [S390] constify function pointer tables.
  [S390] do local_irq_restore while spinning in spin_lock_irqsave.
  [S390] add smp_call_function_mask
  [S390] dasd: fix loop in request expiration handling
  [S390] Unused field / extern declaration in processor.h
  [S390] Remove TOPDIR from Makefile
  [S390] dasd: add hyper PAV support to DASD device driver, part 1
  [S390] single-step cleanup
  [S390] Move NOTES and BUG_TABLE.
  [S390] drivers/s390/: Spelling fixes
  [S390] include/asm-s390/: Spelling fixes
  [S390] arch/s390/: Spelling fixes
  [S390] Use diag308 subcodes 3 and 6 for reboot and dump when possible.
  [S390] vmemmap: allocate struct pages before 1:1 mapping
  [S390] Initialize sclp_ipl_info
  [S390] Allocate and free cpu lowcores and stacks when needed/possible.
  [S390] use LIST_HEAD instead of LIST_HEAD_INIT
  [S390] Load disabled wait psw instead of stopping cpu on halt.
  ...

16 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
Linus Torvalds [Sun, 27 Jan 2008 06:43:56 +0000 (22:43 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jmorris/selinux-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6:
  selinux: fix labeling of /proc/net inodes

16 years agoide: remove REQ_TYPE_ATA_CMD
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:13 +0000 (20:13 +0100)]
ide: remove REQ_TYPE_ATA_CMD

Based on the earlier work by Tejun Heo.

All users are gone so we can finally remove it.

Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: switch ide_cmd_ioctl() to use REQ_TYPE_ATA_TASKFILE requests
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:13 +0000 (20:13 +0100)]
ide: switch ide_cmd_ioctl() to use REQ_TYPE_ATA_TASKFILE requests

Based on the earlier work by Tejun Heo.

There should be no functionality changes caused by this patch.

Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:12 +0000 (20:13 +0100)]
ide: switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests

Based on the earlier work by Tejun Heo.

Switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests
and make ide_wait_cmd() static.

There should be no functionality changes caused by this patch.

Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix final status check in drive_cmd_intr()
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:12 +0000 (20:13 +0100)]
ide: fix final status check in drive_cmd_intr()

Don't check for READY_STAT bit being set for PIO-in protocol (makes the
final status check in drive_cmd_intr() match the one in task_in_intr()).

Also fix function name reported by ide_error() call while at it.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: check BUSY and ERROR status bits before reading data in drive_cmd_intr()
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:12 +0000 (20:13 +0100)]
ide: check BUSY and ERROR status bits before reading data in drive_cmd_intr()

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: don't enable local IRQs for PIO-in in driver_cmd_intr() (take 2)
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:12 +0000 (20:13 +0100)]
ide: don't enable local IRQs for PIO-in in driver_cmd_intr() (take 2)

Don't enable local IRQs for PIO-in protocol in driver_cmd_intr().

While at it:

* Remove redundant rq->cmd_type check.

* Read status register after enabling local IRQs for no-data protocol.

v2:
* Re-add DRQ=1 check lost in v1 (noticed by Sergei).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: convert "empty" REQ_TYPE_ATA_CMD requests to use REQ_TYPE_ATA_TASKFILE
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:12 +0000 (20:13 +0100)]
ide: convert "empty" REQ_TYPE_ATA_CMD requests to use REQ_TYPE_ATA_TASKFILE

Based on the previous work by Tejun Heo.

There should be no functionality changes caused by this patch.

Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: initialize rq->cmd_type in ide_init_drive_cmd() callers
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)]
ide: initialize rq->cmd_type in ide_init_drive_cmd() callers

* Initialize rq->cmd_type in ide_wait_cmd(), ide_cmd_ioctl() and
  set_pio_mode() (other callers were aleady over-riding rq->cmd_type).

* Remove no longer needed rq->cmd_type setup from ide_init_drive_cmd().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use wait_drive_not_busy() in drive_cmd_intr() (take 2)
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)]
ide: use wait_drive_not_busy() in drive_cmd_intr() (take 2)

Use wait_drive_not_busy() in drive_cmd_intr().

v2:
* Fix wait_drive_not_busy() comment (noticed by Sergei).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: kill DATA_READY define
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)]
ide: kill DATA_READY define

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: task_end_request() fix
Tejun Heo [Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)]
ide: task_end_request() fix

task_end_request() modified to always call ide_end_drive_cmd()
for taskfile requests.  Previously, ide_end_drive_cmd() was
called only when IDE_TFLAG_FLAGGED was set.  Also,
ide_dma_intr() is modified to use task_end_request().

Enables TASKFILE ioctls to get valid register outputs on
successful completion.

Bart:
- ported it over recent IDE changes

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use rq->nr_sectors in task_end_request()
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)]
ide: use rq->nr_sectors in task_end_request()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove needless ->cursg clearing from task_end_request()
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)]
ide: remove needless ->cursg clearing from task_end_request()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: set IDE_TFLAG_IN_* flags before queuing/executing command
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:10 +0000 (20:13 +0100)]
ide: set IDE_TFLAG_IN_* flags before queuing/executing command

* Add IDE_TFLAG_{HOB,TF,DEVICE} defines.

* Set IDE_TFLAG_IN_* flags in {do_rw,ide_no_data,ide_raw}_taskfile() users.

* Remove no longer needed ->tf_flags setup from ide_end_drive_cmd().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-tape: fix handling of non-special requests in ->end_request method
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:10 +0000 (20:13 +0100)]
ide-tape: fix handling of non-special requests in ->end_request method

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix final status check in task_in_intr()
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:10 +0000 (20:13 +0100)]
ide: fix final status check in task_in_intr()

Check for DRQ bit being cleared on the final status check.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: clear HOB bit for REQ_TYPE_ATA_CMD requests in ide_end_drive_cmd()
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:10 +0000 (20:13 +0100)]
ide: clear HOB bit for REQ_TYPE_ATA_CMD requests in ide_end_drive_cmd()

ide_dump_status() may set HOB bit before ide_end_drive_cmd() is called.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix ->io_32bit race in ide_taskfile_ioctl()
Tejun Heo [Sat, 26 Jan 2008 19:13:10 +0000 (20:13 +0100)]
ide: fix ->io_32bit race in ide_taskfile_ioctl()

In ide_taskfile_ioctl(), there was a race condition involving
drive->io_32bit.  It was cleared and restored during ioctl
requests but there was no synchronization with other requests.
So, other requests could execute with the altered ->io_32bit
setting or updated drive->io_32bit could be overwritten by
ide_taskfile_ioctl().

This patch adds IDE_TFLAG_IO_16BIT flag to indicate to
ide_pio_datablock() that 16-bit I/O is needed regardless of
drive->io_32bit settting.

Bart:
- ported it over recent IDE changes

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agocmd64x: remove /proc/ide/cmd64x
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:09 +0000 (20:13 +0100)]
cmd64x: remove /proc/ide/cmd64x

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

   text    data     bss     dec     hex filename
   3874     180      28    4082     ff2 drivers/ide/pci/cmd64x.o.before
   2231     180       0    2411     96b drivers/ide/pci/cmd64x.o.after

Additionaly to being bloat the code reported incorrect UDMA modes for
the reserved values of UDIDETCR0/1 registers.

Also while at it remove unused CNTRL_DIS_RA0/1 defines.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove broken disk byte-swapping support
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:09 +0000 (20:13 +0100)]
ide: remove broken disk byte-swapping support

Remove broken disk byte-swapping support:
- it can cause a data corruption on SMP (or if using PREEMPT on UP)
- all data coming from disk are byte-swapped by taskfile_*_data() which
  results in incorrect identify data being reported by /proc/ide/ and IOCTLs
- "hdx=bswap/byteswap" kernel parameter has been broken on m68k host drivers
  (including Atari/Q40 ones) since 2.5.x days (because of 'hwif' zero-ing)
- byte-swapping is limited to PIO transfers (for working with TiVo disks on
  x86 machines using user-space solutions or dm-byteswap should result in
  much better performance because DMA can be used)

For previous discussions please see:

http://www.ussg.iu.edu/hypermail/linux/kernel/0201.0/0768.html
http://lkml.org/lkml/2004/2/28/111

[ I have dm-byteswap device mapper target if somebody is interested
  (patch is for 2.6.4 though but I'll dust it off if needed). ]

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_busy_sleep() helper
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:09 +0000 (20:13 +0100)]
ide: add ide_busy_sleep() helper

Add ide_busy_sleep() helper and use it in do_probe(),
enable_nest() and probe_hwif().

As a nice side-effect this fixes a minor bug in do_probe()
(the code was reading status register without any delay).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: make CONFIG_IDEPCI_PCIBUS_ORDER visible and deprecate it
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:09 +0000 (20:13 +0100)]
ide: make CONFIG_IDEPCI_PCIBUS_ORDER visible and deprecate it

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: move CONFIG_IDEPCI_PCIBUS_ORDER code to ide-scan-pci.c
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:09 +0000 (20:13 +0100)]
ide: move CONFIG_IDEPCI_PCIBUS_ORDER code to ide-scan-pci.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: print banner message once per controller in m68k host drivers
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:09 +0000 (20:13 +0100)]
ide: print banner message once per controller in m68k host drivers

* Print banner message once per controller in m68k host drivers.

* Change printk() level to KERN_INFO in buddha, falconide and gayle.

* Add banner message to q40ide.

This is basically a preparation for the future IDE layer changes.

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_set_irq() inline helper
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:08 +0000 (20:13 +0100)]
ide: add ide_set_irq() inline helper

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-pmac: use custom hwif->sg_max_nents only if DMA support is enabled
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:08 +0000 (20:13 +0100)]
ide-pmac: use custom hwif->sg_max_nents only if DMA support is enabled

Move setting hwif->sg_max_nents from pmac_ide_setup_device()
to pmac_ide_setup_dma().

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agorapide: remove write-only hwif->hwif_data
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:08 +0000 (20:13 +0100)]
rapide: remove write-only hwif->hwif_data

Cc: Russell King <rmk@arm.linux.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use ide_init_port_hw() in setup-pci.c
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:08 +0000 (20:13 +0100)]
ide: use ide_init_port_hw() in setup-pci.c

* Move setting hwif->gendev.parent from ide_pci_setup_ports()
  to ide_hwif_configure().

* Always set hwif->io_ports in ide_hwif_configure().

* Use ide_init_port_hw() in ide_hwif_configure().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: always use ide_std_init_ports() in setup-pci.c
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:08 +0000 (20:13 +0100)]
ide: always use ide_std_init_ports() in setup-pci.c

* ide_init_hwif_ports() call in setup-pci.c::ide_hwif_configure()
  doesn't depend on the default cotrol register offset, default IRQ
  or ppc_ide_md.ide_init_hwif implementations so ide_std_init_ports()
  can always be used.

* Since 'base' is always non-zero and thus hwif->io_ports[IDE_DATA_OFFSET]
  is also non-zero always clear hwif->noprobe.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoau1xxx-ide: use ide_init_port_hw()
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:08 +0000 (20:13 +0100)]
au1xxx-ide: use ide_init_port_hw()

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoau1xxx-ide: au_ide_probe() fixes
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:07 +0000 (20:13 +0100)]
au1xxx-ide: au_ide_probe() fixes

* hwif->hold is always set in au_ide_probe() (few lines earlier),
  no need to set it again

* hwif->{channel,select_data,config_data} should be always zero

* autotune PIO also if CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA is defined

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: make remaining built-in only IDE host drivers modular (take 2)
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:07 +0000 (20:13 +0100)]
ide: make remaining built-in only IDE host drivers modular (take 2)

* Make remaining built-in only IDE host drivers modular, add ide-scan-pci.c
  file for probing PCI host drivers registered with IDE core (special case
  for built-in IDE and CONFIG_IDEPCI_PCIBUS_ORDER=y) and then take care of
  the ordering in which all IDE host drivers are probed when IDE is built-in
  during link time.

* Move probing of gayle, falconide, macide, q40ide and buddha (m68k arch
  specific) host drivers, before PCI ones (no PCI on m68k), ide-cris (cris
  arch specific), cmd640 (x86 arch specific) and pmac (ppc arch specific).

* Move probing of ide-cris (cris arch specific) host driver before cmd640
  (x86 arch specific).

* Move probing of mpc8xx (ppc specific) host driver before ide-pnp (depends
  on ISA and none of ppc platform that use mpc8xx supports ISA) and ide-h8300
  (h8300 arch specific).

* Add "probe_vlb" kernel parameter to cmd640 host driver and update
  Documentation/ide.txt accordingly.

* Make IDE_ARM config option visible so it can also be disabled if needed.

* Remove bogus comment from ide.c while at it.

v2:
* Fix two issues spotted by Sergei:
  - replace ENOMEM error value by ENOENT in ide-h8300 host driver
  - fix MODULE_PARM_DESC() in cmd640 host driver

Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix host drivers depending on ide_generic to probe for interfaces (take 2)
Bartlomiej Zolnierkiewicz [Sat, 26 Jan 2008 19:13:06 +0000 (20:13 +0100)]
ide: fix host drivers depending on ide_generic to probe for interfaces (take 2)

* Add mpc8xx_ide_probe() to mpc8xx.c and call it from probe_for_hwifs().

* Convert ide_arm, ide-cris, ide-h8300, ide-pnp, buddha, falconide, gayle,
  macide, q40ide, cmd640 and mpc8xx host drivers to use ide_device_add().

  This removes dependency on ide_generic for these drivers so update
  ide/Kconfig accordingly.

v2:
* ide_arm build fix (s/ide_device_idx/ide_device_add/)
  (Thanks to Christoph Lameter <clameter@sgi.com> for reporting the problem).

Cc: Mikael Starvik <starvik@axis.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>