Some change to the IDE layer are causing the siimage driver to crash
at boot with a NULL dereference. This is due to the sil_dma_ops not
containing all the necessary pointers. I suppose it used to just
"override" the defaults while now, it needs to contain everything.
[bart: while at it: sil_dma_ops should be const now (pointed out by Sergei)]
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>,
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: Skip I/O merges when disabled
block: add large command support
block: replace sizeof(rq->cmd) with BLK_MAX_CDB
ide: use blk_rq_init() to initialize the request
block: use blk_rq_init() to initialize the request
block: rename and export rq_init()
block: no need to initialize rq->cmd with blk_get_request
block: no need to initialize rq->cmd in prepare_flush_fn hook
block/blk-barrier.c:blk_ordered_cur_seq() mustn't be inline
block/elevator.c:elv_rq_merge_ok() mustn't be inline
block: make queue flags non-atomic
block: add dma alignment and padding support to blk_rq_map_kern
unexport blk_max_pfn
ps3disk: Remove superfluous cast
block: make rq_init() do a full memset()
relay: fix splice problem
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Peter Osterlund <petero2@telia.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Neil Brown <neilb@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This is a preparation for changing rq->cmd from the static array to a
pointer.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This converts ide to use blk_rq_init to initialize the request.
This is a preparation for large command support, which needs to
initialize the request in a proper way (that is, just doing a memset()
will not work).
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Fix 18 errors and several warnings given by checkpatch.pl:
- use of C99 // comments;
- trailing whitespace;
- 'switch' and 'case' not at the same indentation level;
- no space before the open parenthesis of the 'if' and 'switch' statements;
- space between function name and open parenthesis (though I have introduced
such warnins in some places since the code looks prettier with the spaces);
- including <asm/io.h> instead of <linux/io.h>;
- line over 80 characters.
In addition to these changes, also do the following:
- make the arrays in sil_set_pio_mode() 'static', and make the arrays in
sil_set_dma_mode() 'static const';
- change the string of the 'if' statements into the 'switch' statement in
sil_pata_udma_filter();
- drop the needless '==' operators from the 'if' statements where a condition
is a mere bit test;
- remove needless initializer for the 'tmp' variable in init_chipset_siimage();
- beautify groups of the variable initializers and assignment operators;
- add new line after variable definitions;
- remove new line between the comment and the statements it refers to;
- remove needless curly braces and parentheses;
- fix typos, capitalize acronyms, etc. in the comments...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
ETRAX_IDE was marked as broken last year with the comment
"it doesn't even compile currently".
Remove it since it won't get fixed in the near future.
On Mon, Apr 14, 2008 at 02:50:19PM +0200, Mikael Starvik wrote:
> You can remove it for now and we will resubmit a new if/when we get around
> to fix it.
[bart: ported it over IDE tree]
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Cc: Jesper Nilsson <Jesper.Nilsson@axis.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Use 'hwif->dma_base + {4,8}' instead of hwif->dma_prdtable in
{ide,scc}_dma_setup().
* Remove no longer needed ->dma_prdtable field from ide_hwif_t.
While at it:
* Use ATA_DMA_TABLE_OFS define.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Use 'hwif->dma_base + {1,3}' instead of hwif->dma_vendor{1,3} in
pdc202xx_new host driver.
* Remove no longer needed ->dma_vendor{1,3} fields from ide_hwif_t.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Add ->dma_host_set and ->dma_start methods (+ __scc_dma_end() helper)
so scc_ide_{in,out}b() can be used directly.
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>
* Skip "VLB sync" in ata_{in,out}put_data() if host uses MMIO.
* Use I/O ops directly in ata_vlb_sync() an drop no longer needed
'ide_drive_t *drive' argument.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add ide_pad_transfer() helper (which uses ->{in,out}put_data methods
internally so the transfer is also padded to drive+host requirements)
and use it instead of ide_atapi_{write_zeros,discard_data}().
* Remove no longer needed ide_atapi_{write_zeros,discard_data}().
Cc: Borislav Petkov <petkovbb@gmail.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Remove no longer used ->INW and ->OUTW methods.
While at it:
* scc_pata.c: scc_ide_{out,in}w() is called only in scc_tf_{load,read}()
so inline it there.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Add ->tf_read method so out{b,w}(), in{b,w}() and superio_ide_inb()
can be used directly.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Add ->tf_{load,read} methods so scc_ide_{outb,outw,inb,inw}()
can be used directly.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Add ->tf_{load,read} methods so outb()/inb() and mm_outw()/mm_inw()
can be used directly.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Add ->tf_{load,read} methods so cris_ide_{outb,outw,inb,inw}()
can be used directly.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add ->tf_load and ->tf_read methods to ide_hwif_t and set the default
methods in default_hwif_transport().
* Use ->tf_{load,read} instead o calling ide_tf_{load,read}() directly.
* Make ide_tf_{load,read}() 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>
Factor out debugging code from ide_tf_load() to ide_tf_dump() helper
and update ide_tf_load() users accordingly.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Add ide_execute_pkt_cmd() helper for executing PACKET command,
then convert ATAPI device drivers to use it.
As a nice side-effect this fixes ide-{floppy,tape,scsi} w.r.t.
ide_lock taking (ide-cd was OK).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Always use ->OUTBSYNC method for executing commands so the posting is done
if needed (this affects only pmac and scc_pata host drivers at the moment).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* proc_reports_siimage() is now only called by init_chipset_siimage()
so inline it there.
* Use array instead of switch statement for reporting clock modes.
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>
Add sil_iowrite{8,16,32}() and sil_ioread{8,16}() helpers, then use them to
merge code accessing configuration registers through PCI and MMIO together.
[ because of this SATA initialization bits from setup_mmio_siimage() are
moved to init_chipset_siimage() ]
This also cuts code size a bit:
text data bss dec hex filename
4437 164 0 4601 11f9 drivers/ide/pci/siimage.o.before
3979 164 0 4143 102f drivers/ide/pci/siimage.o.after
While at it:
* Use I/O ops directly instead of using ->IN{B,W} and ->OUT{B,W}.
* Fixup CodingStyle in setup_mmio_siimage().
* Rename 'tmpbyte' variable to 'tmp' in init_chipset_siimage().
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>
Do clocking register posting earlier in setup_mmio_siimage()
to match code in init_chipset_siimage().
This is a preparation for the next patch which merges PCI and MMIO
code paths together.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Use ins{w,l}()/outs{w,l}() and __ide_mm_ins{w,l}()/__ide_mm_outs{w,l}()
directly in ata_{in,out}put_data() (by using IDE_HFLAG_MMIO host flag to
decide which I/O ops are required).
* Remove no longer needed ->INS{W,L} and ->OUTS{W,L} methods (ide-h8300,
au1xxx-ide and scc_pata implement their own ->{in,out}put_data methods).
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add IDE_HFLAG_MMIO host flag and set it for hosts which use
default_hwif_mmiops().
v2:
* Fix kernel panic in pmac host driver (',' should be '|').
Thanks to Kamalesh for reporting it + testing the fix
and to Andrew for hinting me about the source of the issue.
Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
v2:
* Update ->{in,out}_data methods to take 'struct request *rq' argument.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
v2:
* Update ->{in,out}_data methods to take 'struct request *rq' argument.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
v2:
* Update ->{in,out}_data methods to take 'struct request *rq' argument
(thanks to Stephen Rothwell for catching it).
There should be no functional changes caused by this patch.
Cc: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Cc: Akira Iguchi <akira2.iguchi@toshiba.co.jp>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Merge ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods
into new ->{in,out}put_data methods which take number of bytes to
transfer as an argument and always do padding.
While at it:
* Use 'hwif' or 'drive->hwif' instead of 'HWIF(drive)'.
There should be no functional changes caused by this patch (all users
of ->ata_{in,out}put_data methods were using multiply-of-4 word counts).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods to
falconide and q40ide host drivers (->ata_* methods are implemented on
top of ->atapi_* methods so they also do byte-swapping now).
* Cleanup atapi_{in,out}put_bytes().
v2:
* Add 'struct request *rq' argument to ->ata_{in,out}put_data methods
and don't byte-swap disk fs requests (we shouldn't un-swap fs requests
because fs itself is stored byte-swapped on the disk) - this is how
things were done before the patch (ideally device mapper should be
used instead but it would break existing setups and would have some
performance impact).
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitz@debian.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Richard Zidlicky <rz@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
On Monday 28 April 2008, Sergei Shtylyov wrote:
> Hello, I wrote:
>
> > Fix these warnings emitted when compiling drivers/ide/mips/au1xxx-ide.c:
>
> > include/asm/mach-au1x00/au1xxx_ide.h:137: warning: 'auide_tune_drive' declared
> > `static' but never defined
> > include/asm/mach-au1x00/au1xxx_ide.h:138: warning: 'auide_tune_chipset' declared
> > `static' but never defined
>
> > by wiping out the whole "function prototyping" section from the header file
> > <asm-mips/mach-au1x00/au1xxx_ide.h> as it mostly declared functions that are
> > already dead in the IDE driver; move the only useful prototype into the driver.
> >
> > Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
> > ---
> > I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...
>
> > Bart, au1xxx-ide-fix-mwdma-support.patch will probably need to be updated to
> > remove that added prototype since it won't be needed anymore...
>
> Which you haven't done either in that patch or in
> au1xxx-ide-use-init_dma-method.patch. So, face the consequences:
>
> drivers/ide/mips/au1xxx-ide.c:456: error: conflicting types for 'auide_ddma_init'
> drivers/ide/mips/au1xxx-ide.c:51: error: previous declaration of
> 'auide_ddma_init' was here
> drivers/ide/mips/au1xxx-ide.c:456: error: conflicting types for 'auide_ddma_init'
> drivers/ide/mips/au1xxx-ide.c:51: error: previous declaration of
> 'auide_ddma_init' was here
> drivers/ide/mips/au1xxx-ide.c:51: warning: 'auide_ddma_init' used but never
> defined
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Since both the IDE interface and SMC 91C111 Ethernet chip are on-board
devices, not SOC devices, move the platform device registration form the
common to the board specific code.
While at it, remove semicolon (which didn't break compilation only by
chance) from the AU1XXX_ATA_DDMA_REQ macro and do some renaming:
- change 'au1200_ide0_' variable name prefix to the mere 'ide_';
- change 'smc91x_' variable name prefix to 'smc91c111_' since that's the
name of the chip used on the boards;
- drop 'AU1XXX_' prefix from the names of macros describing IDE and Ethernet
on-board devices;
- change 'SMC91111_' to 'SMC91C111_', change 'IRQ' to 'INT' in the names of
the macros describing the Ethernet chip for consistency with the IDE
macros;
- change 'ATA_' to 'IDE_' and 'OFFSET' to 'SHIFT' (since this value is
indeed a shift count) in the names of the macros describing the IDE
interface.
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Get rid of the pipeline merge stage but retain the chrdev req caching
functionality by using a merge buffer tape->merge_bh which is flushed in chunks
of several blocks at a time. Also, remove last references to pipelining, e.g.
typedef idetape_stage_s.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This is the size of the merge buffer.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
It always returns 0 which has no effect on tape positioning calculation so
simplify it by converting its type to void, bringing no functional change to the
driver.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bart says: "can be done from user-space and is not especially interesting
even when debugging problems (raw PCI config space dump is far more useful)."
Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Cc: Andrew Morton <akpm@osdl.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Instead of allocating pages for the buffer one by one, take advantage of the
buddy alloc system and request them 2^order at a time. This increases the chance
for bigger buffer parts to be contigious and reduces loop iteration count. While
at it, rename function __idetape_kmalloc_stage() to ide_tape_kmalloc_buffer().
[bart: fold with "ide-tape: fix mem leak" patch to preserve bisectability]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add struct ide_io_ports and use it instead of `unsigned long io_ports[]`
in ide_hwif_t.
* Rename io_ports[] in hw_regs_t to io_ports_array[].
* Use un-named union for 'unsigned long io_ports_array[]' and 'struct
ide_io_ports io_ports' in hw_regs_t.
* Remove IDE_*_OFFSET defines.
v2:
* scc_pata.c build fix from Stephen Rothwell.
v3:
* Fix ctl_adrr typo in Sparc-specific part of ns87415.c.
(Noticed by Andrew Morton)
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Make ide_unregister() take 'ide_hwif_t *hwif' instead of 'unsigned int
index' (hwif->index) as an argument and update all users accordingly.
While at it:
* Remove unnecessary checks for hwif != NULL from ide-pnp.c::idepnp_remove()
and delkin_cb.c::delkin_cb_remove().
* Remove needless hwif->chipset assignment from scc_pata.c::scc_remove().
v2:
* Fixup ide_unregister() documentation.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Remove ide_unregister() call from ide_exit()
(host drivers take care of unregistering hwif-s themselves).
* Remove ide_unregister() call from probe methods of
bast-ide, palm_bk3710, ide-cs and delkin_cb host drivers
(ide_find_port() returns only free ide_hwifs[] entries).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Don't set IDE_HFLAG_NO_AUTOTUNE host flag in sgiioc4 and icside
host drivers - there is no need for it as they don't implement
->set_pio_mode method.
* Remove no longer needed IDE_HFLAG_NO_AUTOTUNE host flag.
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>
* Default to tuning PIO0 and disabling prefetch prior to probing
devices for CONFIG_BLK_DEV_CMD640_ENHANCED=y case.
* Always auto-tune PIO.
* Remove no longer used retrieve_drive_counts().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
We have "vlb|pci_clock=" parameters now.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add "vlb_clock=" parameter for specifying VLB clock frequency (in MHz).
* Add "pci_clock=" parameter for specifying PCI bus clock frequency (in MHz).
While at it:
* qd65xx.c: rename {active,recovery}_cycle variables to {act,rec}_cyc.
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
The driver is using now solely its own request queue.
- tape->next_stage is always NULL so it is safe to remove
all code depending on tape->next_stage != NULL
- this patch removes the last place which sets
IDETAPE_FLAG_PIPELINE_ACTIVE in tape->flags
[bart: add above explanations]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
idetape_queue_pc_tail() is a wrapper for its __idetape_queue_pc_tail() counterpart
and has no other functionality. Remove it and call the "wrapped" function
directly.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
The computation of the block offset of the the tape position (MTIOCPOS,
MTIOCGET) is not influenced by the stages queued in the pipeline anymore but by
the size of the current buffer which is going to be sent to the drive.
[bart: resurrect deleted idetape_wait_for_pipeline() call]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Since we don't do pipeline read-ahead anymore, we don't have to look for
filemarks we have crossed. Therefore, remove the code chunk that does that and
pass on the command to the tape. As a side effect, remove unused
idetape_wait_first_stage().
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
In order to do away with queueing read requests on the pipeline, several things
have to be done:
1. Do not allocate additional pipeline stages in idetape_init_read() until
(tape->nr_stages < max_stages) and do only read operation preparations. As a
collateral result, idetape_add_stage_tail() becomes unused so remove it.
2. Queue the read request's buffer directly thru idetape_queue_rw_tail().
3. Remove now unused idetape_kmalloc_stage() and idetape_switch_buffers().
[bart: simplify the original patch]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Pipeline handling calculations in idetape_calculate_speeds() can
go since they do not have any effect on other functionality besides:
1. info is only being exported through /proc as a read-only item
(controlled_pipeline_head_speed, uncontrolled_pipeline_head_speed)
2. used in idetape_restart_speed_control() which, in turn, is unrelated to
other code
3. used only for pipeline frames number accounting (tape->pipeline_head),
also unused elsewhere.
4.some variables are:
only written to: tape->buffer_head;
unused: tape->tape_head, tape->last_tape_head
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Refrain from adding more write requests to the pipeline and queue them
directly on the device's request queue instead.
[bart: re-do for minimal behavior changes]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Prior to allocating a new pipeline stage, the code checked for the existence of
a cached pipeline stage to use. Do away with and stick to normal pipeline
stages only.
[bart: keep idetape_kmalloc_stage() for now]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove obsoleted "hdx=noautotune" kernel parameter
(it has been obsoleted since 1 Nov 2004).
Then make ide_hwif_t.autotune a single bit flag
and remove no longer needed IDE_TUNE_* defines.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove obsoleted "idex=reset" kernel parameter
(it has been obsoleted since 1 Nov 2004).
Then remove corresponding code from ide_probe_port()
and no longer used ->reset field from ide_hwif_t.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove obsoleted "idex=serialize" kernel parameter
(it has been obsoleted since 1 Nov 2004).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Add "ignore_cable" parameter:
* "ide_core.ignore_cable=[interface_number]" boot option if IDE is built-in
(i.e. "ide_core.ignore_cable=1" to force ignoring cable for "ide1")
* "ignore_cable=[interface_number]" module parameter (for ide_core module)
if IDE is compiled as module
v2:
* Add ide_port_apply_params() helper
- use it in ide_device_add_all() and ide_scan_port().
* Make it possible to later disable ignoring cable detection by passing
"[interface_number]:0" to /sys/module/ide_core/parameters/ignore_cable
(however sysfs interface is not enabled yet since it needs some other
IDE changes to make it work reliable).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fallout from commit ac95beedf8
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Export ide_dma_exec_cmd() and __ide_dma_test_irq().
* Constify struct ide_dma_ops.
* Always set hwif->dma_ops to &sff_dma_ops in ide_setup_dma()
(it is later overriden by ide_init_port() if needed) and drop
'const struct ide_port_info *d' argument.
While at it:
* Rename __ide_dma_test_irq() to ide_dma_test_irq().
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Add struct ide_dma_ops and convert core code + drivers to use it.
While at it:
* Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods.
* Drop "ide_" "infixes" from DMA methods.
* au1xxx-ide.c:
- use auide_dma_{test_irq,end}() directly in auide_dma_timeout()
* pdc202xx_old.c:
- drop "old_" "infixes" from DMA methods
* siimage.c:
- add siimage_dma_test_irq() helper
- print SATA warning in siimage_init_one()
* Remove no longer needed ->init_hwif implementations.
v2:
* Changes based on review from Sergei:
- s/siimage_ide_dma_test_irq/siimage_dma_test_irq/
- s/drive->hwif/hwif/ in idefloppy_pc_intr().
- fix patch description w.r.t. au1xxx-ide changes
- fix au1xxx-ide build
- fix naming for cmd64*_dma_ops
- drop "ide_" and "old_" infixes
- s/hpt3xxx_dma_ops/hpt37x_dma_ops/
- s/hpt370x_dma_ops/hpt370_dma_ops/
- use correct DMA ops for HPT302/N, HPT371/N and HPT374
- s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/
v3:
* Two bugs slipped in v2 (noticed by Sergei):
- use correct DMA ops for HPT374 (for real this time)
- handle HPT370/HPT370A properly
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add IDE_HFLAG_SERIALIZE_DMA host flag to serialize ports
if DMA is available and handle it in ide_init_port().
* Convert sl82c105 host driver to use this new flag.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Make sl82c105_bridge_revision() return 'u8' instead of 'unsigned long'.
* Check bridge revision in sl82c105_init_one().
While at:
* Use proper KERN_ level for printk().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Pass 'ide_hwif_t *hwif' instead of '_auide_hwif *auide' to
auide_ddma_init().
* Add 'const struct ide_port_info *d' argument to auide_ddma_init().
* Convert the driver to use ->init_dma method.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Move DMA setup to palm_bk3710_init_dma().
* Convert the driver to use ->init_dma method.
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Move dma_base check from sgiioc4_ide_setup_pci_device()
to ide_dma_sgiioc4().
* Replace ide_dma_sgiioc4() 'unsigned long dma_base' argument
by 'const struct ide_port_info *d'.
* Move hwif->INB setup from ide_init_sgiioc4() to
sgiioc4_ide_setup_pci_device().
* Move ide_init_sgiioc4() call from sgiioc4_ide_setup_pci_device()
to ide_dma_sgiioc4().
* Convert the driver to use ->init_dma method.
Cc: Jeremy Higdon <jeremy@sgi.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add 'const struct ide_port_info *d' argument to icside_dma_init().
* Make icside_dma_init() return an error value and add icside_dma_off_init()
(->init_dma implementation for case when DMA cannot be enabled).
* Convert the driver to use ->init_dma method.
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Move pmif->dma_regs check from pmac_ide_setup_device() to
pmac_ide_init_dma().
* Get 'pmif' from 'hwif->hwif_data' in pmac_ide_init_dma() and replace
'pmac_ide_hwif_t *pmif' argument by 'const struct ide_port_info *d'.
* Add pmac_ide_init_dma() implementation for CONFIG_BLK_DEV_IDEDMA_PMAC=n
case and convert the driver to use ->init_dma method.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Make ide_hwif_setup_dma() return an error value.
* Pass 'const struct ide_port_info *d' instead of 'unsigned long dmabase'
to ->init_dma method and make it return an error value.
* Rename ide_get_or_set_dma_base() to ide_pci_dma_base(),
change ordering of its arguments and then export it.
* Export ide_pci_set_master().
* Do complete DMA setup inside ->init_dma method and update ->init_dma
users accordingly.
* Sanitize code for DMA setup in ide_init_port().
v2:
* Fix for CONFIG_BLK_DEV_IDEDMA_PCI=n configs
(from Jiri Slaby <jirislaby@gmail.com>):
Fix following compiler warning by returning EINVAL:
In file included from ANYTHING-INCLUDING-IDE.H:45:
include/linux/ide.h: In function ‘ide_hwif_setup_dma’:
include/linux/ide.h:1022: warning: no return statement in function returning non-void
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>