]> pilppa.com Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
16 years agoARM: OMAP: No need to include board-omap2430sdp.h from hardware.h
Tony Lindgren [Tue, 31 Mar 2009 21:12:52 +0000 (14:12 -0700)]
ARM: OMAP: No need to include board-omap2430sdp.h from hardware.h

Move the defines to the associated board file and remove
the now unnecessary header file. Also rename
SDP2430_ETHR_GPIO_IRQ to SDP2430_ETHR_GPIO_IRQ.

Signed-off-by: Tony Lindgren <tony@atomide.com>
16 years agoARM: OMAP: No need to include board-palm*.h from hardware.h
Tony Lindgren [Tue, 31 Mar 2009 21:12:33 +0000 (14:12 -0700)]
ARM: OMAP: No need to include board-palm*.h from hardware.h

Move the defines to the associated board file and remove
the now unnecessary header files.

Signed-off-by: Tony Lindgren <tony@atomide.com>
16 years agoARM: OMAP: No need to include board-osk.h from hardware.h
Tony Lindgren [Tue, 31 Mar 2009 21:10:38 +0000 (14:10 -0700)]
ARM: OMAP: No need to include board-osk.h from hardware.h

Move the defines to the board file and remove the now unnecessary
header file.

Signed-off-by: Tony Lindgren <tony@atomide.com>
16 years agoARM: OMAP: No need to include board-innovator.h from hardware.h
Tony Lindgren [Tue, 31 Mar 2009 21:08:07 +0000 (14:08 -0700)]
ARM: OMAP: No need to include board-innovator.h from hardware.h

Move the defines to the board file and remove the now unnecessary
header file.

Signed-off-by: Tony Lindgren <tony@atomide.com>
16 years agoREMOVE OMAP LEGACY CODE: Remove old dead gpio expander code
Tony Lindgren [Tue, 31 Mar 2009 21:07:45 +0000 (14:07 -0700)]
REMOVE OMAP LEGACY CODE: Remove old dead gpio expander code

This should be done with GPIO calls. Patches against the
mainline tree welcome to add the necessary working functionality
back.

Signed-off-by: Tony Lindgren <tony@atomide.com>
16 years agoBtrfs: try to free metadata pages when we free btree blocks
Chris Mason [Tue, 31 Mar 2009 17:47:50 +0000 (13:47 -0400)]
Btrfs: try to free metadata pages when we free btree blocks

COW means we cycle though blocks fairly quickly, and once we
free an extent on disk, it doesn't make much sense to keep the pages around.

This commit tries to immediately free the page when we free the extent,
which lowers our memory footprint significantly.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
16 years agoBtrfs: add extra flushing for renames and truncates
Chris Mason [Tue, 31 Mar 2009 17:27:11 +0000 (13:27 -0400)]
Btrfs: add extra flushing for renames and truncates

Renames and truncates are both common ways to replace old data with new
data.  The filesystem can make an effort to make sure the new data is
on disk before actually replacing the old data.

This is especially important for rename, which many application use as
though it were atomic for both the data and the metadata involved.  The
current btrfs code will happily replace a file that is fully on disk
with one that was just created and still has pending IO.

If we crash after transaction commit but before the IO is done, we'll end
up replacing a good file with a zero length file.  The solution used
here is to create a list of inodes that need special ordering and force
them to disk before the commit is done.  This is similar to the
ext3 style data=ordering, except it is only done on selected files.

Btrfs is able to get away with this because it does not wait on commits
very often, even for fsync (which use a sub-commit).

For renames, we order the file when it wasn't already
on disk and when it is replacing an existing file.  Larger files
are sent to filemap_flush right away (before the transaction handle is
opened).

For truncates, we order if the file goes from non-zero size down to
zero size.  This is a little different, because at the time of the
truncate the file has no dirty bytes to order.  But, we flag the inode
so that it is added to the ordered list on close (via release method).  We
also immediately add it to the ordered list of the current transaction
so that we can try to flush down any writes the application sneaks in
before commit.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
16 years agoide-floppy: do not complete rq's prematurely
Borislav Petkov [Tue, 31 Mar 2009 18:15:34 +0000 (20:15 +0200)]
ide-floppy: do not complete rq's prematurely

... and access them afterwards. Simplify rq completing code while at it.

Spotted-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: be able to build pmac driver without IDE built-in
Gilles Espinasse [Tue, 31 Mar 2009 18:15:34 +0000 (20:15 +0200)]
ide: be able to build pmac driver without IDE built-in

No reason to need IDE built-in to be able to compile pmac driver.

Tested to work on 2.6.29-rc8 and 2.6.28.8 with ide and pmac as modules
inside an initramfs.

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Cc: sam@ravnborg.org
Cc: benh@kernel.crashing.org
[bart: remove now superfluous IDE check]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-pmac: IDE cable detection on Apple PowerBook
TOMARI Hisanobu [Tue, 31 Mar 2009 18:15:34 +0000 (20:15 +0200)]
ide-pmac: IDE cable detection on Apple PowerBook

As IDE cable used on Apple PowerBook/iBook laptops are always of "Short 40"
type when the firmware says it's 80 conductor one, the cable detection should
return ATA_CBL_PATA40_SHORT on those machines.  This enables to automatically
use UDMA5 even with drives that doesn't correctly detect those cables on Apple
laptops.

Signed-off-by: TOMARI Hisanobu <posco.grubb@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: benh@kernel.crashing.org
[bart: beautify patch description]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: inline SELECT_DRIVE()
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:33 +0000 (20:15 +0200)]
ide: inline SELECT_DRIVE()

Since SELECT_DRIVE() has boiled down to a mere dev_select() method call, it now
makes sense to just inline it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: turn selectproc() method into dev_select() method (take 5)
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:32 +0000 (20:15 +0200)]
ide: turn selectproc() method into dev_select() method (take 5)

Turn selectproc() method into dev_select() method by teaching it to write to the
device register and moving it from 'struct ide_port_ops' to 'struct ide_tp_ops'.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: benh@kernel.crashing.org
Cc: petkovbb@gmail.com
[bart: add ->dev_select to at91_ide.c and tx4939.c (__BIG_ENDIAN case)]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoMAINTAINERS: move old ide-{floppy,tape} entries to CREDITS (take 2)
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:31 +0000 (20:15 +0200)]
MAINTAINERS: move old ide-{floppy,tape} entries to CREDITS (take 2)

Ben Hutchings noticed that MAINTAINERS somehow still contain old
ide-{floppy,tape} entries.  Fix it by moving them to CREDITS (kudos
to Gadi and Paul for all the early hard work on ide-{floppy,tape}).

v2:
Rename IDE/ATAPI CDROM DRIVER entry to IDE/ATAPI DRIVERS one.

Cc: Gadi Oxman <gadio@netvision.net.il>
Cc: Paul Bristow <paul@paulbristow.net>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: move data register access out of tf_{read|load}() methods (take 2)
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:31 +0000 (20:15 +0200)]
ide: move data register access out of tf_{read|load}() methods (take 2)

Move IDE_FTFLAG_{IN|OUT}_DATA flag handling out of tf_{read|load}() methods
into the only two functions where these flags actually need to be handled:
do_rw_taskfile() and ide_complete_cmd()...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: call {in|out}put_data() methods from tf_{read|load}() methods (take 2)
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:31 +0000 (20:15 +0200)]
ide: call {in|out}put_data() methods from tf_{read|load}() methods (take 2)

Handle IDE_FTFLAG_{IN|OUT}_DATA flags in tf_{read|load}() methods by calling
{in|out}put_data() methods to transfer 2 bytes -- this will allow us to move
that handling out of those methods altogether...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-io-std: shorten ide_{in|out}put_data()
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:31 +0000 (20:15 +0200)]
ide-io-std: shorten ide_{in|out}put_data()

ide_{in|out|put_data() can be somewhat shortened by merging the paths doing
16-bit I/O...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: rename IDE_TFLAG_IN_[HOB_]FEATURE
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:30 +0000 (20:15 +0200)]
ide: rename IDE_TFLAG_IN_[HOB_]FEATURE

The feature register has never been readable -- when its location is read, one
gets the error register value; hence rename IDE_TFLAG_IN_[HOB_]FEATURE into
IDE_TFLAG_IN_[HOB_]ERROR and introduce the 'hob_error' field into the 'struct
ide_taskfile' (despite the error register not really depending on the HOB bit).

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: turn set_irq() method into write_devctl() method
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:30 +0000 (20:15 +0200)]
ide: turn set_irq() method into write_devctl() method

Turn set_irq() method with its software reset hack into write_devctl() method
(for just writing a value into the device control register) at last...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use ATA_HOB
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:29 +0000 (20:15 +0200)]
ide: use ATA_HOB

Make use of ATA_HOB instead of hard-coded value in the tf_read() method.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-disk: use ATA_ERR
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:29 +0000 (20:15 +0200)]
ide-disk: use ATA_ERR

Make use of ATA_ERR instead of hard-coded value in idedisk_set_max_address()
and idedisk_read_native_max_address().

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add support for CFA specified transfer modes (take 3)
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:28 +0000 (20:15 +0200)]
ide: add support for CFA specified transfer modes (take 3)

Add support for the CompactFlash specific PIO modes 5/6 and MWDMA modes 3/4.

Since there were no PIO5 capable hard drives produced and one would also need
66 MHz IDE clock to actually get the difference WRT the address setup timings
programmed, I decided to simply replace the old non-standard PIO mode 5 timings
with the CFA specified ones.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: stf_xl@wp.pl
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-iops: only clear DMA words on setting DMA mode
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:27 +0000 (20:15 +0200)]
ide-iops: only clear DMA words on setting DMA mode

The bytes indicating current DMA mode in the identify data words 62, 63, and 88
should only change on setting a DMA mode, so stop clearing them  on setting PIO
mode in ide_config_drive_speed().  While at it, correct SW/MW DMA mode masks...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: identify data word 53 bit 1 doesn't cover words 62 and 63 (take 3)
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:27 +0000 (20:15 +0200)]
ide: identify data word 53 bit 1 doesn't cover words 62 and 63 (take 3)

The IDE code assumed for years that the bit 1 of the identify data word 53 also
covers the validity of the SW/MW DMA information in words 62 and 63, but it has
always covered only words 64 thru 70, with words 62 and 63 being defined in the
original ATA spec, not in ATA-2...

This fix however should only concern *very* old hard disks and rather old CF
cards...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoau1xxx-ide: auide_{in|out}sw() should be static
Sergei Shtylyov [Tue, 31 Mar 2009 18:15:27 +0000 (20:15 +0200)]
au1xxx-ide: auide_{in|out}sw() should be static

Make auide_{insw|outsw}() 'static' and mark them 'inline' as there's only one
call site for each: in the driver's {in|out}put_data() methods respectively...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-floppy: use ide_pio_bytes()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:26 +0000 (20:15 +0200)]
ide-floppy: use ide_pio_bytes()

* Fix ide_init_sg_cmd() setup for non-fs requests.

* Convert ide_pc_intr() to use ide_pio_bytes() for floppy media.

* Remove no longer needed ide_io_buffers() and sg/sg_cnt fields
  from struct ide_atapi_pc.

* Remove partial completions; kill idefloppy_update_buffers(), as a
  result.

* Add some more debugging statements.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-{floppy,tape}: fix padding for PIO transfers
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:26 +0000 (20:15 +0200)]
ide-{floppy,tape}: fix padding for PIO transfers

* Return number of bytes left to transfer from idetape_{in,out}put_buffers()
  and number of bytes done from ide_tape_io_buffers().

* Fix padding for PIO transfers in ide_pc_intr() so read/write buffers are
  always completely processed and then the transfer is padded if necessary.

* Remove invalid error messages.

* Remove now superfluous padding from ide{_io_buffers,tape_input_buffers}().

While at it:

* Set pc->bh to NULL in idetape_input_buffers() after all bh-s are done.

* Cache !!(pc->flags & PC_FLAG_WRITING) in local variable in ide_pc_intr().

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: remove CONFIG_BLK_DEV_IDEDOUBLER config option
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:26 +0000 (20:15 +0200)]
ide: remove CONFIG_BLK_DEV_IDEDOUBLER config option

Nowadays it is not worth having a separate config option for
Amiga IDE Doubler support so always include it (it still needs
to be explicitly enabled by module parameter).

Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: decrease size of ->pc_buf field in struct ide_atapi_pc
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:25 +0000 (20:15 +0200)]
ide: decrease size of ->pc_buf field in struct ide_atapi_pc

struct ide_atapi_pc is often allocated on the stack and size of ->pc_buf
size is 256 bytes.  However since only ide_floppy_create_read_capacity_cmd()
and idetape_create_inquiry_cmd() require such size allocate buffers for
these pc-s explicitely and decrease ->pc_buf size to 64 bytes.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: fix locking in drive_release_dev()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:25 +0000 (20:15 +0200)]
ide: fix locking in drive_release_dev()

* Request queue cleanup should happen before freeing drive->id
  and marking device as non-present.  Fix it.

* Remove superfluous hwif->lock acquiring/releasing.

Cc: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: merge ide_arm and ide_generic host drivers
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:24 +0000 (20:15 +0200)]
ide: merge ide_arm and ide_generic host drivers

There is no need for a separate ide_arm host driver nowadays
so merge it into ide_generic one.

While at it:
- return -EBUSY from ide_generic_init() if I/O resources are busy
- scale down ide_generic_check_pci_legacy_iobases() for CONFIG_PCI=n

Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Alexander Schulz <alex@shark-linux.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-generic: remove no longer needed sysfs interface
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:24 +0000 (20:15 +0200)]
ide-generic: remove no longer needed sysfs interface

Nowadays we have "ide_generic.probe_mask=" module parameter
and ide_platform host driver so sysfs interface for adding
IDE interfaces is no longer needed.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: sanitize ide_build_sglist() and ide_destroy_dmatable()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:24 +0000 (20:15 +0200)]
ide: sanitize ide_build_sglist() and ide_destroy_dmatable()

* Move ide_map_sg() calls out from ide_build_sglist()
  to ide_dma_prepare().

* Pass command to ide_destroy_dmatable().

* Rename ide_build_sglist() to ide_dma_map_sg()
  and ide_destroy_dmatable() to ide_dma_unmap_sg().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: set/clear drive->waiting_for_dma flag in the core code
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:22 +0000 (20:15 +0200)]
ide: set/clear drive->waiting_for_dma flag in the core code

Set/clear drive->waiting_for_dma flag in the core code
instead of in ->dma_setup and ->dma_end methods.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: move ide_map_sg() call out of ->dma_setup method (take 2)
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:21 +0000 (20:15 +0200)]
ide: move ide_map_sg() call out of ->dma_setup method (take 2)

Move ide_map_sg() call from ->dma_setup implementations and
ide_destroy_dmatable() one from *_build_dmatable() to ide_dma_prepare().

There should be no functional changes caused by this patch.

Sergei:
Removed 'use_pio_instead' labels and replaced 'goto' with 'return 0' --
that required no changes to the follow-up patches...

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ->dma_check method
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:21 +0000 (20:15 +0200)]
ide: add ->dma_check method

* Add (an optional) ->dma_check method for checking if DMA can be
  used for a given command and fail DMA setup in ide_dma_prepare()
  if necessary.

* Convert alim15x3 and trm290 host drivers to use ->dma_check.

* Rename ali15x3_dma_setup() to ali_dma_check() while at it.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agotrm290: use custom ->dma_{start,end} to handle trm290_prepare_drive()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:21 +0000 (20:15 +0200)]
trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive()

Use custom ->dma_{start,end} methods to handle trm290_prepare_drive()
there instead of in ->dma_setup method.

There should be no functional changes caused by this patch
(DMA support is disabled currently in trm290.c).

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agons87415: use custom ->dma_{start,end} to handle ns87415_prepare_drive()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:20 +0000 (20:15 +0200)]
ns87415: use custom ->dma_{start,end} to handle ns87415_prepare_drive()

Use custom ->dma_{start,end} methods to handle ns87415_prepare_drive()
there instead of in ->dma_setup method.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ide_dma_prepare() helper
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:20 +0000 (20:15 +0200)]
ide: add ide_dma_prepare() helper

* Add ide_dma_prepare() helper.

* Convert ide_issue_pc() and do_rw_taskfile() to use it.

* Make ide_build_sglist() static.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: destroy DMA mappings after ending DMA (v2)
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:20 +0000 (20:15 +0200)]
ide: destroy DMA mappings after ending DMA (v2)

Move ide_destroy_dmatable() call out from ->dma_end method to
{ide_pc,cdrom_newpc,ide_dma}_intr(), ide_dma_timeout_retry()
and sgiioc4_resetproc().

This causes minor/safe behavior changes w.r.t.:
* cmd64x.c::cmd64{8,x}_dma_end()
* cs5536.c::cs5536_dma_end()
* icside.c::icside_dma_end()
* it821x.c::it821x_dma_end()
* scc_pata.c::__scc_dma_end()
* sl82c105.c::sl82c105_dma_end()
* tx4939ide.c::tx4939ide_dma_end()

v2:
* Fix build for CONFIG_BLK_DEV_IDEDMA=n (reported by Randy Dunlap).

Cc: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: inline ide_dma_timeout() into ide_dma_timeout_retry()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:19 +0000 (20:15 +0200)]
ide: inline ide_dma_timeout() into ide_dma_timeout_retry()

Since ide_dma_timeout() is only used by ide_dma_timeout_retry()
inline it there.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add ->dma_clear method and remove ->dma_timeout one
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:19 +0000 (20:15 +0200)]
ide: add ->dma_clear method and remove ->dma_timeout one

All custom ->dma_timeout implementations call the generic one thus it is
possible to have only an optional method for resetting DMA engine instead:

* Add ->dma_clear method and convert hpt366, pdc202xx_old and sl82c105
  host drivers to use it.

* Always use ide_dma_timeout() in ide_dma_timeout_retry() and remove
 ->dma_timeout method.

* Make ide_dma_timeout() static.

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: minor ide_cdrom_setup() cleanup
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:16 +0000 (20:15 +0200)]
ide-cd: minor ide_cdrom_setup() cleanup

Cache drive->queue in local variable and use max().

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: unify transfer padding in cdrom_newpc_intr()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:16 +0000 (20:15 +0200)]
ide-cd: unify transfer padding in cdrom_newpc_intr()

* 'thislen' is always <= cmd->nleft for non-fs requests so the transfer
  padding inside the 'while (thislen > 0)' loop can happen only for fs
  requests -- then move it out of the loop and unify with the transfer
  padding for non-fs requests ('thislen' == 'len' for fs requests).

* blk_dump_rq_flags() dumps all request flags so it is enough to pass
  only the function name to it.

* Update my Copyrights while at it.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: use common completion path for DMA requests in cdrom_newpc_intr()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:15 +0000 (20:15 +0200)]
ide-cd: use common completion path for DMA requests in cdrom_newpc_intr()

Use the following facts:

- rq->nr_sectors should now be always equal to (non-zero)
  rq->hard_nr_sectors for fs requests

- REQ_TYPE_ATA_PC requests have never bio attached to them

- rq->hard_nr_sectors == 0 for REQ_TYPE_ATA_PC requests

- DMA is used only for fs, pc and REQ_TYPE_ATA_PC requests

- 'uptodate' is ignored for pc requests ('rc == 0' case)

and use the common completion path also for DMA requests.

There should be no functional changes caused by this patch

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: use scatterlists for PIO transfers (non-fs requests) (v2)
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:15 +0000 (20:15 +0200)]
ide-cd: use scatterlists for PIO transfers (non-fs requests) (v2)

Convert ide-cd to use scatterlists for PIO transfers and get rid of
partial completions (except on error) also for non-fs requests.

v2:
Do not map dataless commands to an sg since it oopses on the virt_to_page()
translation check when DEBUG_VIRTUAL is enabled.  (from Borislav Petkov,
reported/bisected-by Tetsuo Handa).

Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: merge ide_cd_prepare_rw_request() into cdrom_start_rw()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:14 +0000 (20:15 +0200)]
ide-cd: merge ide_cd_prepare_rw_request() into cdrom_start_rw()

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: fix non-SECTOR_SIZE-multiples PIO transfers for fs requests
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:13 +0000 (20:15 +0200)]
ide-cd: fix non-SECTOR_SIZE-multiples PIO transfers for fs requests

We now support arbitrary number of bytes per-IRQ also for fs requests
so remove ide_cd_check_transfer_size() and IDE_AFLAG_LIMIT_NFRAMES.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: use scatterlists for PIO transfers (fs requests)
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:13 +0000 (20:15 +0200)]
ide-cd: use scatterlists for PIO transfers (fs requests)

* Export ide_pio_bytes().

* Add ->last_xfer_len field to struct ide_cmd.

* Add ide_cd_error_cmd() helper to ide-cd.

* Convert ide-cd to use scatterlists also for PIO transfers (fs requests
  only for now) and get rid of partial completions (except when the error
  happens -- which is still subject to change later because looking at
  ATAPI spec it seems that the device is free to error the whole transfer
  with setting the Error bit only on the last transfer chunk).

* Update ide_cd_{prepare_rw,restore_request,do_request}() accordingly.

* Inline ide_cd_restore_request() into cdrom_start_rw().

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: cleanup ide_cd_do_request()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:05 +0000 (20:15 +0200)]
ide-cd: cleanup ide_cd_do_request()

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: kill whole failed request in ide_cd_do_request()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:04 +0000 (20:15 +0200)]
ide-cd: kill whole failed request in ide_cd_do_request()

Untangling cdrom_end_request() uncovered an error in completing
failed requests in ide_cd_do_request().  Fix it.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove cdrom_end_request()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:04 +0000 (20:15 +0200)]
ide-cd: remove cdrom_end_request()

Inline cdrom_end_request() into cdrom_newpc_intr()
and ide_cd_do_request().

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: unify cdrom_newpc_intr() exit paths
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:03 +0000 (20:15 +0200)]
ide-cd: unify cdrom_newpc_intr() exit paths

* Move cdrom_end_request() calls from cdrom_decode_status()
  and ide_cd_check_ireason() to cdrom_newpc_intr().

* Unify cdrom_newpc_intr() exit paths.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: move setting REQ_FAILED flag out from 'end_request' exit path
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:03 +0000 (20:15 +0200)]
ide-cd: move setting REQ_FAILED flag out from 'end_request' exit path

Move setting REQ_FAILED flag out from 'end_request' exit path in
cdrom_newpc_intr() and also rename 'end_request' to 'out_end'.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: unify ide_cd_do_request() exit paths
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:02 +0000 (20:15 +0200)]
ide-cd: unify ide_cd_do_request() exit paths

* Move cdrom_end_request() calls from cdrom_start_rw()
  and ide_cd_prepare_rw_request() to ide_cd_do_request().

* Unify ide_cd_do_request() exit paths.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: factor out failed request completion from cdrom_end_request()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:01 +0000 (20:15 +0200)]
ide-cd: factor out failed request completion from cdrom_end_request()

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove no longer needed 'ignore' module parameter
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:01 +0000 (20:15 +0200)]
ide-cd: remove no longer needed 'ignore' module parameter

ide-scsi is gone...

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove needless ide_dump_status_no_sense() wrapper
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:00 +0000 (20:15 +0200)]
ide-cd: remove needless ide_dump_status_no_sense() wrapper

It makes no sense to check for BSY bit being set as earlier OK_STAT()
check in cdrom_end_request() makes sure that BSY bit is cleared.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove dead code from cdrom_decode_status()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:00 +0000 (20:15 +0200)]
ide-cd: remove dead code from cdrom_decode_status()

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: use ide_end_rq() also for failed non-fs requests
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:15:00 +0000 (20:15 +0200)]
ide-cd: use ide_end_rq() also for failed non-fs requests

Use ide_end_rq() also for failed non-fs requests on completion
of REQUEST SENSE requests + use blk_rq_bytes() while at it.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-cd: remove dead URLs
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:14:59 +0000 (20:14 +0200)]
ide-cd: remove dead URLs

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: use PageHighMem() instead of ifdefs in ide_pio_bytes()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:14:59 +0000 (20:14 +0200)]
ide: use PageHighMem() instead of ifdefs in ide_pio_bytes()

Use PageHighMem() instead of ifdefs in ide_pio_bytes()
(=> local IRQs won't be disabled when not necessary).

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: add support for arbitrary transfer lengths to ide_pio_bytes()
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:14:59 +0000 (20:14 +0200)]
ide: add support for arbitrary transfer lengths to ide_pio_bytes()

Add support for arbitrary transfer lengths to ide_pio_bytes()
and then inline ide_pio_multi() into ide_pio_datablock().

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide-atapi: start DMA after issuing a packet command
Borislav Petkov [Tue, 31 Mar 2009 18:14:58 +0000 (20:14 +0200)]
ide-atapi: start DMA after issuing a packet command

Apparently¹, some ATAPI devices want to see the packet command first
before enabling DMA otherwise they simply hang indefinitely. Reorder the
two steps and start DMA only after having issued the command first.

[1] http://marc.info/?l=linux-kernel&m=123835520317235&w=2

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Reported-by: Michael Roth <mroth@nessie.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoat91_ide: fix ->ftf_flags handling
Bartlomiej Zolnierkiewicz [Tue, 31 Mar 2009 18:14:57 +0000 (20:14 +0200)]
at91_ide: fix ->ftf_flags handling

Fix some incorrect IDE_FTFLAG_* changes which slipped in commit
"ide: add "flagged" taskfile flags to struct ide_taskfile (v2)"
(commit 19710d25d50ae0be05eebe4231ed8918b1092d82) few days ago.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: drivers/ide/ide-atapi.c needs <linux/scatterlist.h>
Geert Uytterhoeven [Tue, 31 Mar 2009 18:14:57 +0000 (20:14 +0200)]
ide: drivers/ide/ide-atapi.c needs <linux/scatterlist.h>

On m68k:
| drivers/ide/ide-atapi.c: In function 'ide_io_buffers':
| drivers/ide/ide-atapi.c:87: error: implicit declaration of function 'sg_page'
| drivers/ide/ide-atapi.c:87: warning: passing argument 1 of 'PageHighMem' makes pointer from integer without a cast
| drivers/ide/ide-atapi.c:91: warning: passing argument 1 of 'kmap_atomic' makes pointer from integer without a cast
| drivers/ide/ide-atapi.c:96: error: implicit declaration of function 'sg_virt'
| drivers/ide/ide-atapi.c:96: warning: assignment makes pointer from integer without a cast
| drivers/ide/ide-atapi.c:107: error: implicit declaration of function 'sg_next'
| drivers/ide/ide-atapi.c:107: warning: assignment makes pointer from integer without a cast

[bart: Dmitri Vorobiev submitted similar patch fixing MIPS]

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years agoide: Fix code dealing with sleeping devices in do_ide_request()
Elias Oltmanns [Tue, 31 Mar 2009 18:14:56 +0000 (20:14 +0200)]
ide: Fix code dealing with sleeping devices in do_ide_request()

Unfortunately, I missed a catch when reviewing the patch committed as
201bffa4. Here is the fix to the currently broken handling of sleeping
devices. In particular, this is required to get the disk shock
protection code working again.

Reported-by: Christian Thaeter <ct@pipapo.org>
Cc: stable@kernel.org
Signed-off-by: Elias Oltmanns <eo@nebensachen.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
16 years ago[S390] cio: online_store - trigger recognition for boxed devices
Sebastian Ott [Tue, 31 Mar 2009 17:16:07 +0000 (19:16 +0200)]
[S390] cio: online_store - trigger recognition for boxed devices

Start a new device recognition if someone writes to sysfs online attribute
of a boxed ccw device. The current test will fail, since cu_type != 0
for devices which were recognized before.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] cio: disallow online setting of device in transient state
Sebastian Ott [Tue, 31 Mar 2009 17:16:06 +0000 (19:16 +0200)]
[S390] cio: disallow online setting of device in transient state

Return -EAGAIN on writes to sysfs online attribute if the corresponding
ccw device is in transient state.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] cio: introduce notifier for boxed state
Sebastian Ott [Tue, 31 Mar 2009 17:16:05 +0000 (19:16 +0200)]
[S390] cio: introduce notifier for boxed state

If a ccw device did not respond in time during internal io, we set it
into boxed state. With this patch we have the following behaviour:
 * the ccw driver will get a notification if the device was online and
   goes into the boxed state
 * if the device was disconnected and got boxed nothing special is to be
   done (it will be handled in reprobing later)
 * if the device got boxed while initial sensing it will be unregistered

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] cio: introduce ccw_device_schedule_sch_unregister
Sebastian Ott [Tue, 31 Mar 2009 17:16:04 +0000 (19:16 +0200)]
[S390] cio: introduce ccw_device_schedule_sch_unregister

Introduce ccw_device_schedule_sch_unregister as a wrapper for queuing
ccw_device_call_sch_unregister on the slow_path_wq. This wrapper
will be used in the next patch.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] cio: wake up on failed recognition
Sebastian Ott [Tue, 31 Mar 2009 17:16:03 +0000 (19:16 +0200)]
[S390] cio: wake up on failed recognition

Wake up even on failed device recognition, since this may be triggered
from a user trying to force a device online. With this patch a write
to the online sysfs attribute will not block for ever but return with
-EAGAIN in this case.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[S390] fix hypfs build failure
Heiko Carstens [Tue, 31 Mar 2009 17:16:02 +0000 (19:16 +0200)]
[S390] fix hypfs build failure

Fix build breakage below which probably was introduced with
("rcu: don't include unnecessary headers, allow kmemtrace w/ tracepoints").

  CC      arch/s390/hypfs/hypfs_diag.o
arch/s390/hypfs/hypfs_diag.c: In function 'diag204_free_buffer':
arch/s390/hypfs/hypfs_diag.c:364: error: implicit declaration of function 'free_pages'
arch/s390/hypfs/hypfs_diag.c: In function 'diag204_alloc_rbuf':
arch/s390/hypfs/hypfs_diag.c:384: error: implicit declaration of function '__get_free_pages'
arch/s390/hypfs/hypfs_diag.c:384: error: 'GFP_KERNEL' undeclared (first use in this function)
arch/s390/hypfs/hypfs_diag.c:384: error: (Each undeclared identifier is reported only once
arch/s390/hypfs/hypfs_diag.c:384: error: for each function it appears in.)

Reported-by: Sachin Sant <sachinp@in.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years ago[PATCH] sysrq: include interrupt.h instead of irq.h
Heiko Carstens [Tue, 31 Mar 2009 17:13:13 +0000 (19:13 +0200)]
[PATCH] sysrq: include interrupt.h instead of irq.h

With "cpumask: update irq_desc to use cpumask_var_t"
we get this build failure on s390:

  CC      drivers/char/sysrq.o
In file included from drivers/char/sysrq.c:38:
include/linux/irq.h: In function 'init_alloc_desc_masks':
include/linux/irq.h:442: error: dereferencing pointer to incomplete type

drivers/char/sysrq.c should include interrupt.h instead of irq.h.

Cc: Mike Travis <travis@sgi.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16 years agofs: Add exofs to Kernel build
Boaz Harrosh [Mon, 15 Dec 2008 10:53:08 +0000 (12:53 +0200)]
fs: Add exofs to Kernel build

- Add exofs to fs/Kconfig under "menu 'Miscellaneous filesystems'"
- Add exofs to fs/Makefile

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 years agoexofs: Documentation
Boaz Harrosh [Tue, 28 Oct 2008 15:22:01 +0000 (17:22 +0200)]
exofs: Documentation

Added some documentation in exofs.txt, as well as a BUGS file.

For further reading, operation instructions, example scripts
and up to date infomation and code please see:
http://open-osd.org

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 years agoexofs: export_operations
Boaz Harrosh [Sun, 22 Mar 2009 10:47:26 +0000 (12:47 +0200)]
exofs: export_operations

implement export_operations and set in superblock.
It is now posible to export exofs via nfs

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 years agoexofs: super_operations and file_system_type
Boaz Harrosh [Tue, 28 Oct 2008 14:11:41 +0000 (16:11 +0200)]
exofs: super_operations and file_system_type

This patch ties all operation vectors into a file system superblock
and registers the exofs file_system_type at module's load time.

* The file system control block (AKA on-disk superblock) resides in
  an object with a special ID (defined in common.h).
  Information included in the file system control block is used to
  fill the in-memory superblock structure at mount time. This object
  is created before the file system is used by mkexofs.c It contains
  information such as:
- The file system's magic number
- The next inode number to be allocated

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 years agoexofs: dir_inode and directory operations
Boaz Harrosh [Tue, 28 Oct 2008 13:38:12 +0000 (15:38 +0200)]
exofs: dir_inode and directory operations

implementation of directory and inode operations.

* A directory is treated as a file, and essentially contains a list
  of <file name, inode #> pairs for files that are found in that
  directory. The object IDs correspond to the files' inode numbers
  and are allocated using a 64bit incrementing global counter.
* Each file's control block (AKA on-disk inode) is stored in its
  object's attributes. This applies to both regular files and other
  types (directories, device files, symlinks, etc.).

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 years agoexofs: address_space_operations
Boaz Harrosh [Mon, 27 Oct 2008 17:31:34 +0000 (19:31 +0200)]
exofs: address_space_operations

OK Now we start to read and write from osd-objects. We try to
collect at most contiguous pages as possible in a single write/read.
The first page index is the object's offset.

TODO:
   In 64-bit a single bio can carry at most 128 pages.
   Add support of chaining multiple bios

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 years agoexofs: symlink_inode and fast_symlink_inode operations
Boaz Harrosh [Mon, 27 Oct 2008 17:04:34 +0000 (19:04 +0200)]
exofs: symlink_inode and fast_symlink_inode operations

Generic implementation of symlink ops.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 years agoexofs: file and file_inode operations
Boaz Harrosh [Mon, 27 Oct 2008 16:37:02 +0000 (18:37 +0200)]
exofs: file and file_inode operations

implementation of the file_operations and inode_operations for
regular data files.

Most file_operations are generic vfs implementations except:
- exofs_truncate will truncate the OSD object as well
- Generic file_fsync is not good for none_bd devices so open code it
- The default for .flush in Linux is todo nothing so call exofs_fsync
  on the file.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 years agoexofs: Kbuild, Headers and osd utils
Boaz Harrosh [Mon, 27 Oct 2008 16:27:55 +0000 (18:27 +0200)]
exofs: Kbuild, Headers and osd utils

This patch includes osd infrastructure that will be used later by
the file system.

Also the declarations of constants, on disk structures,
and prototypes.

And the Kbuild+Kconfig files needed to build the exofs module.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
16 years agoMerge branches 'tracing/docs', 'tracing/filters', 'tracing/ftrace', 'tracing/kprobes...
Ingo Molnar [Tue, 31 Mar 2009 15:46:40 +0000 (17:46 +0200)]
Merge branches 'tracing/docs', 'tracing/filters', 'tracing/ftrace', 'tracing/kprobes', 'tracing/blktrace-v2' and 'tracing/textedit' into tracing/core-v2

16 years agotrace: make argument 'mem' of trace_seq_putmem() const
Li Zefan [Fri, 27 Mar 2009 02:21:00 +0000 (10:21 +0800)]
trace: make argument 'mem' of trace_seq_putmem() const

Impact: fix build warning

I passed a const value to trace_seq_putmem(), and I got compile warning.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agotracing: add missing 'extern' keywords to trace_output.h
Eduard - Gabriel Munteanu [Mon, 23 Mar 2009 13:12:23 +0000 (15:12 +0200)]
tracing: add missing 'extern' keywords to trace_output.h

Impact: cleanup

Many declarations within trace_output.h are missing the 'extern' keyword
in an inconsistent manner. This adds 'extern' where it should be.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agotracing: provide trace_seq_reserve()
Eduard - Gabriel Munteanu [Mon, 23 Mar 2009 13:12:22 +0000 (15:12 +0200)]
tracing: provide trace_seq_reserve()

trace_seq_reserve() allows a caller to reserve space in a trace_seq and
write directly into it. This makes it easier to export binary data to
userspace via the tracing interface, by simply filling in a struct.

Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoblktrace: print out BLK_TN_MESSAGE properly
Li Zefan [Fri, 27 Mar 2009 02:21:54 +0000 (10:21 +0800)]
blktrace: print out BLK_TN_MESSAGE properly

Impact: improve ftrace plugin output

Before this patch:

 # cat trace
         make-5383  [001]   741.240059:   8,7    P   N [make]
 __trace_note_message: cfq1074

 # echo 1 > options/blk_classic
 # cat trace
   8,7    1     0.692221252     0  C   W 130411392 + 1024 [0]
 Bad pc action 6361
 Bad pc action 283d

 # echo 0 > options/blk_classic
 # echo bin > trace_options
 # cat trace_pipe | blkparse -i -
 (can't parse messages generated by blk_add_trace_msg())

After this patch:
 # cat trace
      <idle>-0     [001]   187.600933:   8,7    C   W 145220224 + 8 [0]
      <idle>-0     [001]   187.600946:   8,7    m   N cfq1076 complete

 # echo 1 > options/blk_classic
 # cat trace
   8,7    1     0.256378996   238  I   W 113190728 + 8 [pdflush]
   8,7    1     0.256378998   238  m   N cfq1076 insert_request

 # echo 0 > options/blk_classic
 # echo bin > trace_options
 # cat trace_pipe | blkparse -i -
  8,7    1        0    22.973250293     0  C   W 102770576 + 8 [0]
  8,7    1        0    22.973259213     0  m   N cfq1076 complete

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoblktrace: extract duplidate code
Li Zefan [Fri, 27 Mar 2009 02:21:23 +0000 (10:21 +0800)]
blktrace: extract duplidate code

Impact: cleanup

blk_trace_event_print() and blk_tracer_print_line() share most of the code.

   text    data     bss     dec     hex filename
   8605     393      12    9010    2332 kernel/trace/blktrace.o.orig
   text    data     bss     dec     hex filename
   8555     393      12    8960    2300 kernel/trace/blktrace.o

This patch also prepares for the next patch, that prints out BLK_TN_MESSAGE.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoblktrace: fix memory leak when freeing struct blk_io_trace
Li Zefan [Fri, 27 Mar 2009 02:20:24 +0000 (10:20 +0800)]
blktrace: fix memory leak when freeing struct blk_io_trace

Impact: fix mixed ioctl and ftrace-plugin blktrace use memory leak

When mixing the use of ioctl-based blktrace and ftrace-based blktrace,
we can leak memory in this way:

  # btrace /dev/sda > /dev/null &
  # echo 0 > /sys/block/sda/sda1/trace/enable

now we leak bt->dropped_file, bt->msg_file, bt->rchan...

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoblktrace: fix blk_probes_ref chaos
Li Zefan [Fri, 27 Mar 2009 02:20:09 +0000 (10:20 +0800)]
blktrace: fix blk_probes_ref chaos

Impact: fix mixed ioctl and ftrace-plugin blktrace use refcount bugs

ioctl-based blktrace allocates bt and registers tracepoints when
ioctl(BLKTRACESETUP), and do all cleanups when ioctl(BLKTRACETEARDOWN).

while ftrace-based blktrace allocates/frees bt when:
  # echo 1/0 > /sys/block/sda/sda1/trace/enable

and registers/unregisters tracepoints when:
  # echo blk/nop > /debugfs/tracing/current_tracer
or
  # echo 1/0 > /debugfs/tracing/tracing_enable

The separatation of allocation and registeration causes 2 problems:

  1. current user-space blktrace still calls ioctl(TEARDOWN) when
     ioctl(SETUP) failed:
       # echo 1 > /sys/block/sda/sda1/trace/enable
       # blktrace /dev/sda
         BLKTRACESETUP: Device or resource busy
         ^C
     and now blk_probes_ref == -1

  2. Another way to make blk_probes_ref == -1:
     # plugin sdb && mount sdb1
     # echo 1 > /sys/block/sdb/sdb1/trace/enable
     # remove sdb

This patch does the allocation and registeration when writing
sdaX/trace/enable.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoblktrace: make classic output more classic
Li Zefan [Fri, 27 Mar 2009 02:19:46 +0000 (10:19 +0800)]
blktrace: make classic output more classic

Impact: fix ftrace plugin timestamp output

In the classic user-space blktrace, the output timestamp is sec.nsec
not sec.usec.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoblktrace: fix off-by-one bug
Li Zefan [Tue, 24 Mar 2009 08:05:27 +0000 (16:05 +0800)]
blktrace: fix off-by-one bug

'what' is used as the index of array what2act, so it can't >= the array size.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoblktrace: fix the original blktrace
Li Zefan [Wed, 25 Mar 2009 09:21:26 +0000 (17:21 +0800)]
blktrace: fix the original blktrace

Currently the original blktrace, which is using relay and is used via
ioctl, is broken. You can use ftrace to see the output of blktrace,
but user-space blktrace is unusable.

It's broken by "blktrace: add ftrace plugin"
(c71a896154119f4ca9e89d6078f5f63ad60ef199)

 - if (unlikely(bt->trace_state != Blktrace_running))
 + if (unlikely(bt->trace_state != Blktrace_running || !blk_tracer_enabled))
return;

With this patch, both ioctl and ftrace can be used, but of course you
can't use both of them at the same time.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoblktrace: fix a race when creating blk_tree_root in debugfs
Li Zefan [Wed, 25 Mar 2009 09:19:33 +0000 (17:19 +0800)]
blktrace: fix a race when creating blk_tree_root in debugfs

t1                                t2
------                            ------
do_blk_trace_setup()              do_blk_trace_setup()
  if (!blk_tree_root) {
                                    if (!blk_tree_root)
    blk_tree_root = create_dir()
                                      blk_tree_root = create_dir();
                                      (now blk_tree_root == NULL)
  ...
  dir = create_dir(name, blk_tree_root);

Due to this race, t1 will create 'dir' in /debugfs but not /debugfs/block.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agoblktrace: fix timestamp in binary output
Li Zefan [Wed, 25 Mar 2009 09:18:56 +0000 (17:18 +0800)]
blktrace: fix timestamp in binary output

I found the timestamp is wrong:

 # echo bin > trace_option
 # echo blk > current_tracer
 # cat trace_pipe | blkparse -i -
 8,0    0        0     0.000000000   504  A   W ...
 ...
 8,7    1        0     0.008534097     0  C   R ...
            (should be 8.534097xxx)

user-space blkparse expects the timestamp to be nanosecond.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agopowerpc/85xx: Use fsl,mpc85.. as prefix for memory ctrl & l2-cache nodes
Kumar Gala [Tue, 31 Mar 2009 13:46:25 +0000 (08:46 -0500)]
powerpc/85xx: Use fsl,mpc85.. as prefix for memory ctrl & l2-cache nodes

Older devices tree's used "fsl,85.." instead of the preferred
"fsl,mpc85.." for the memory controller & l2 cache controller nodes.
The EDAC code is the only use of these and has been updated for some
time to support both "fsl,85.." and "fsl,mpc85.."

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Remove unused symbols from fsl_devices.h
Grant Likely [Sat, 28 Mar 2009 21:07:16 +0000 (15:07 -0600)]
powerpc: Remove unused symbols from fsl_devices.h

Remove old artifacts leftover from the platform driver gianfar and
fsl_i2c drivers.  These symbols became unused when the drivers
were migrated over to use the of_platform bus.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agopowerpc: Make LOWMEM_CAM_NUM depend on FSL_BOOKE
Josh Boyer [Tue, 31 Mar 2009 12:05:50 +0000 (08:05 -0400)]
powerpc: Make LOWMEM_CAM_NUM depend on FSL_BOOKE

The recent addition of CONFIG_LOWMEM_CAM_BOOL and
CONFIG_LOWMEM_CAM_NUM cause the latter to show up in configs
that do not need it during 'make oldconfig'.  Make LOWMEM_CAM_NUM
depend on FSL_BOOKE.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
16 years agolockdep: add stack dumps to asserts
Peter Zijlstra [Wed, 18 Mar 2009 11:38:47 +0000 (12:38 +0100)]
lockdep: add stack dumps to asserts

Have a better idea about exactly which loc causes a lockdep
limit overflow. Often it's a bug or inefficiency in that
subsystem.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1237376327.5069.253.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agohrtimer: fix rq->lock inversion (again)
Peter Zijlstra [Fri, 13 Mar 2009 11:21:27 +0000 (12:21 +0100)]
hrtimer: fix rq->lock inversion (again)

It appears I inadvertly introduced rq->lock recursion to the
hrtimer_start() path when I delegated running already expired
timers to softirq context.

This patch fixes it by introducing a __hrtimer_start_range_ns()
method that will not use raise_softirq_irqoff() but
__raise_softirq_irqoff() which avoids the wakeup.

It then also changes schedule() to check for pending softirqs and
do the wakeup then, I'm not quite sure I like this last bit, nor
am I convinced its really needed.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: paulus@samba.org
LKML-Reference: <20090313112301.096138802@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>