13 Jan, 2012

1 commit


08 Oct, 2011

1 commit

  • Reduce data by using const.

    $ size drivers/ata/sata_sil24.o*
    text data bss dec hex filename
    12764 614 2688 16066 3ec2 drivers/ata/sata_sil24.o.new
    12320 1058 2688 16066 3ec2 drivers/ata/sata_sil24.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     

24 Jul, 2011

3 commits

  • Use a single mechanism to show driver version.
    Reduces text a tiny bit too.

    Remove uses of static int printed_version
    Add and use ata_print_version(const struct device *, const char *ver)
    and ata_print_version_once.

    $ size drivers/ata/built-in.*
    text data bss dec hex filename
    544969 73893 116584 735446 b38d6 drivers/ata/built-in.allyesconfig.ata.o
    543870 73893 116592 734355 b34ad drivers/ata/built-in.allyesconfig.print_once.o
    141328 14689 4220 160237 271ed drivers/ata/built-in.defconfig.ata.o
    141212 14689 4220 160121 27179 drivers/ata/built-in.defconfig.print_once.o

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     
  • Saves text by removing nearly duplicated text format strings by
    creating ata__printk functions and printf extension %pV.

    ata defconfig size shrinks ~5% (~8KB), allyesconfig ~2.5% (~13KB)

    Format string duplication comes from:

    #define ata_link_printk(link, lv, fmt, args...) do { \
    if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \
    printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \
    (link)->pmp , ##args); \
    else \
    printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \
    } while(0)

    Coalesce long formats.

    $ size drivers/ata/built-in.*
    text data bss dec hex filename
    544969 73893 116584 735446 b38d6 drivers/ata/built-in.allyesconfig.ata.o
    558429 73893 117864 750186 b726a drivers/ata/built-in.allyesconfig.dev_level.o
    141328 14689 4220 160237 271ed drivers/ata/built-in.defconfig.ata.o
    149567 14689 4220 168476 2921c drivers/ata/built-in.defconfig.dev_level.o

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     
  • Saves a bit of text as the call takes fewer args.

    Coalesce a few formats.
    Convert a few bare printks to pr_cont.

    $ size drivers/ata/built-in.o*
    text data bss dec hex filename
    558429 73893 117864 750186 b726a drivers/ata/built-in.o.allyesconfig.new
    559574 73893 117888 751355 b76fb drivers/ata/built-in.o.allyesconfig.old
    149567 14689 4220 168476 2921c drivers/ata/built-in.o.defconfig.new
    149851 14689 4220 168760 29338 drivers/ata/built-in.o.defconfig.old

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     

02 Mar, 2011

2 commits

  • All checks of ATA_FLAG_NO_LEGACY have been removed by the commits
    c791c30670ea61f19eec390124128bf278e854fe ([libata] minor PCI IDE probe
    fixes and cleanups) and f0d36efdc624beb3d9e29b9ab9e9537bf0f25d5b (libata:
    update libata core layer to use devres), so I think it's time to finally
    get rid of this flag...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • Commit 0d5ff566779f894ca9937231a181eb31e4adff0e (libata: convert to iomap)
    removed all checks of ATA_FLAG_MMIO but neglected to remove the flag itself.
    Do it now, at last...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     

22 Oct, 2010

1 commit


11 Jun, 2010

2 commits

  • The data in the cmd_block buffers may reach the main memory after the
    writel() to the device ports. This patch introduces two calls to wmb()
    to ensure the relative ordering.

    Signed-off-by: Catalin Marinas
    Tested-by: Colin Tuckley
    Cc: Tejun Heo
    Cc: Jeff Garzik
    Signed-off-by: Jeff Garzik

    Catalin Marinas
     
  • cb->atapi.cdb is an array of 16 u8 elements. The call too memset()
    would set the first part of the sge array to zero as well. It's not
    a packed struct.

    This one has been around for five years. I found it with Smatch. I
    think the reason no one has seen it before is because we normally call
    sil24_fill_sg() and that overwrites sge with proper information?

    Signed-off-by: Dan Carpenter
    Signed-off-by: Jeff Garzik

    Dan Carpenter
     

08 Jun, 2010

1 commit


18 May, 2010

1 commit

  • ATA_FLAG_DISABLED is only used by drivers which don't use
    ->error_handler framework and is largely broken. Its only meaningful
    function is to make irq handlers skip processing if the flag is set,
    which is largely useless and even harmful as it makes those ports more
    likely to cause IRQ storms.

    Kill ATA_FLAG_DISABLED and makes the callers disable attached devices
    instead. ata_port_probe() and ata_port_disable() which manipulate the
    flag are also killed.

    This simplifies condition check in IRQ handlers. While updating IRQ
    handlers, remove ap NULL check as libata guarantees consecutive port
    allocation (unoccupied ports are initialized with dummies) and
    long-obsolete ATA_QCFLAG_ACTIVE check (checked by ata_qc_from_tag()).

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

03 Dec, 2009

1 commit


02 Sep, 2009

1 commit

  • The sil24 hardware has a built-in list of commands and associated protocols
    that gets used by default to decide how to handle a given command. However,
    if the command is not known to the controller then it presumably assumes it to
    be a non-data command which then causes protocol mismatch errors if the device
    ends up requesting data transfer. The new DATA SET MANAGEMENT - Trim command
    causes this issue since it's a DMA data-out command.

    Since we should always know best what protocol the command should be using,
    let's just set the override flag to inform the controller what protocol to use
    for all non-ATAPI commands with data transfer.

    Signed-off-by: Robert Hancock
    Tested-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Robert Hancock
     

07 Apr, 2009

2 commits


25 Mar, 2009

1 commit


09 Jan, 2009

1 commit


28 Oct, 2008

1 commit

  • Due to request posting limitations, bandwidth of sil3132 is limited to
    around 120MB/s with the minimum pci-e payload size (128bytes) which is
    used by most consumer systems. However, write throughput can be
    slightly (~3%) increased by increasing the max read requeset size.
    Configure it to 4k which is the maximum supported. This optimization
    is also done by SIMG's windows driver.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

29 Sep, 2008

1 commit

  • Logically, SCR access ops should take @link; however, there was no
    compelling reason to convert all SCR access ops when adding @link
    abstraction as there's one-to-one mapping between a port and a non-PMP
    link. However, that assumption won't hold anymore with the scheduled
    addition of slave link.

    Make SCR access ops per-link.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

04 Jul, 2008

1 commit


20 May, 2008

1 commit

  • When 4140 PMP is attached to sil24, NCQ commands to fan out port 1 and
    2 (0 based) often stall if commands are in progress to other ports.
    I've tried a number of things but can't tell what's going on. It
    never happens w/ ahci and reportedly sata_mv which can issue NCQ
    commands to multiple devices simultaneously like sil24 does.

    Disable NCQ for devices behind 4140 PMP for the time being.

    Signed-off-by: Tejun Heo
    Cc: Mark Lord
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

18 Apr, 2008

15 commits

  • Currently, SATA softresets should do link onlineness check before
    actually performing SRST protocol but it doesn't really belong to
    softreset.

    This patch moves onlineness check in softreset to ata_eh_reset() and
    ata_eh_followup_srst_needed() to clean up code and help future sata_mv
    changes which need clear separation between SCR and TF accesses.

    sata_fsl is peculiar in that its softreset really isn't softreset but
    combination of hardreset and softreset. This patch adds dummy private
    ->prereset to keep the current behavior but the driver really should
    implement separate hard and soft resets and return -EAGAIN from
    hardreset if it should be follwed by softreset.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Some code paths which had been made obsolete by recent reset
    simplification were still around. Kill them.

    * ata_eh_reset() checked for ATA_DEV_UNKNOWN to determine
    classification failure. This is no longer applicable.

    * ata_do_reset() should convert ATA_DEV_UNKNOWN to ATA_DEV_NONE
    regardless of reset result (e.g. -EAGAIN).

    * LLDs don't need to convert ATA_DEV_UNKNOWN to ATA_DEV_NONE.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • Implement helpers to test whether PMP is supported, attached and
    determine pmp number to use when issuing SRST to a link. While at it,
    move ata_is_host_link() so that it's together with the two new PMP
    helpers.

    This change simplifies LLDs and helps making PMP support optional.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • ap->ioaddr is to carry addresses for TF and BMDMA registers of a SFF
    controller, don't abuse it in non-SFF controllers.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Now that all SFF stuff is separated out of core layer, core layer
    doesn't call ops->[alt_]check_status(). In fact, no one calls them
    for non-SFF drivers anymore. Kill them.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Now that all SFF stuff is separated out of core layer, core layer
    doesn't call ops->tf_read directly. It gets called only via
    ops->qc_fill_rtf() for non-SFF drivers. This patch directly
    implements private ops->qc_fill_rtf() for non-SFF controllers and kill
    ops->tf_read().

    This is much cleaner for non-SFF controllers as some of them have to
    cache SFF register values in private data structure and report the
    cached values via ops->tf_read(). Also, ops->tf_read() gets nasty for
    controllers which don't have clear notion of TF registers when
    operation is not in progress.

    As this change makes default ops->qc_fill_rtf unnecessary, move
    ata_sff_qc_fill_rtf() form ata_base_port_ops to ata_sff_port_ops where
    it belongs.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • ata_qc_complete_multiple() took @finish_qc and called it on every qc
    before completing it. This was to give opportunity to update TF cache
    before ata_qc_complete() tries to fill result_tf. Now that result TF
    is a separate operation, this is no longer necessary.

    Update sata_sil24, which was the only user of this mechanism, such
    that it implements its own ops->qc_fill_rtf() and drop @finish_qc from
    ata_qc_complete_multiple().

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • If PMP fan-out reset fails and SCR isn't accessible, PMP should be
    reset. This used to be tested by sata_pmp_std_hardreset() and
    communicated to EH by -ERESTART. However, this logic is generic and
    doesn't really have much to do with specific hardreset implementation.

    This patch moves SCR access failure detection logic to ata_eh_reset()
    where it belongs. As this makes sata_pmp_std_hardreset() identical to
    sata_std_hardreset(), the function is killed and replaced with the
    standard method.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Add sff_ prefix to SFF specific port ops.

    This rename is in preparation of separating SFF support out of libata
    core layer. This patch strictly renames ops and doesn't introduce any
    behavior difference.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Currently reset methods are not specified directly in the
    ata_port_operations table. If a LLD wants to use custom reset
    methods, it should construct and use a error_handler which uses those
    reset methods. It's done this way for two reasons.

    First, the ops table already contained too many methods and adding
    four more of them would noticeably increase the amount of necessary
    boilerplate code all over low level drivers.

    Second, as ->error_handler uses those reset methods, it can get
    confusing. ie. By overriding ->error_handler, those reset ops can be
    made useless making layering a bit hazy.

    Now that ops table uses inheritance, the first problem doesn't exist
    anymore. The second isn't completely solved but is relieved by
    providing default values - most drivers can just override what it has
    implemented and don't have to concern itself about higher level
    callbacks. In fact, there currently is no driver which actually
    modifies error handling behavior. Drivers which override
    ->error_handler just wraps the standard error handler only to prepare
    the controller for EH. I don't think making ops layering strict has
    any noticeable benefit.

    This patch makes ->prereset, ->softreset, ->hardreset, ->postreset and
    their PMP counterparts propoer ops. Default ops are provided in the
    base ops tables and drivers are converted to override individual reset
    methods instead of creating custom error_handler.

    * ata_std_error_handler() doesn't use sata_std_hardreset() if SCRs
    aren't accessible. sata_promise doesn't need to use separate
    error_handlers for PATA and SATA anymore.

    * softreset is broken for sata_inic162x and sata_sx4. As libata now
    always prefers hardreset, this doesn't really matter but the ops are
    forced to NULL using ATA_OP_NULL for documentation purpose.

    * pata_hpt374 needs to use different prereset for the first and second
    PCI functions. This used to be done by branching from
    hpt374_error_handler(). The proper way to do this is to use
    separate ops and port_info tables for each function. Converted.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • libata lets low level drivers build ata_port_operations table and
    register it with libata core layer. This allows low level drivers
    high level of flexibility but also burdens them with lots of
    boilerplate entries.

    This becomes worse for drivers which support related similar
    controllers which differ slightly. They share most of the operations
    except for a few. However, the driver still needs to list all
    operations for each variant. This results in large number of
    duplicate entries, which is not only inefficient but also error-prone
    as it becomes very difficult to tell what the actual differences are.

    This duplicate boilerplates all over the low level drivers also make
    updating the core layer exteremely difficult and error-prone. When
    compounded with multi-branched development model, it ends up
    accumulating inconsistencies over time. Some of those inconsistencies
    cause immediate problems and fixed. Others just remain there dormant
    making maintenance increasingly difficult.

    To rectify the problem, this patch implements ata_port_operations
    inheritance. To allow LLDs to easily re-use their own ops tables
    overriding only specific methods, this patch implements poor man's
    class inheritance. An ops table has ->inherits field which can be set
    to any ops table as long as it doesn't create a loop. When the host
    is started, the inheritance chain is followed and any operation which
    isn't specified is taken from the nearest ancestor which has it
    specified. This operation is called finalization and done only once
    per an ops table and the LLD doesn't have to do anything special about
    it other than making the ops table non-const such that libata can
    update it.

    libata provides four base ops tables lower drivers can inherit from -
    base, sata, pmp, sff and bmdma. To avoid overriding these ops
    accidentaly, these ops are declared const and LLDs should always
    inherit these instead of using them directly.

    After finalization, all the ops table are identical before and after
    the patch except for setting .irq_handler to ata_interrupt in drivers
    which didn't use to. The .irq_handler doesn't have any actual effect
    and the field will soon be removed by later patch.

    * sata_sx4 is still using old style EH and currently doesn't take
    advantage of ops inheritance.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • libata lets low level drivers build scsi_host_template and register it
    to the SCSI layer. This allows low level drivers high level of
    flexibility but also burdens them with lots of boilerplate entries.

    This patch implements SHT initializers which can be used to initialize
    all the boilerplate entries in a sht. Three variants of them are
    implemented - BASE, BMDMA and NCQ - for different types of drivers.
    Note that entries can be overriden by putting individual initializers
    after the helper macro.

    All sht tables are identical before and after this patch.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • ->irq_clear() is used to clear IRQ bit of a SFF controller and isn't
    useful for drivers which don't use libata SFF HSM implementation.
    However, it's a required callback and many drivers implement their own
    noop version as placeholder. This patch implements ata_noop_irq_clear
    and use it to replace those custom placeholders.

    Also, SFF drivers which don't support BMDMA don't need to use
    ata_bmdma_irq_clear(). It becomes noop if BMDMA address isn't
    initialized. Convert them to use ata_noop_irq_clear().

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Some controllers can't reliably record the initial D2H FIS after SATA
    link is brought online for whatever reason. Advanced controllers
    which don't have traditional TF register based interface often have
    this problem as they don't really have the TF registers to update
    while the controller and link are being initialized.

    SKIP_D2H_BSY works around the problem by skipping the wait for device
    readiness before issuing SRST, so for such controllers libata issues
    SRST blindly and hopes for the best.

    Now that libata defaults to hardreset, this workaround is no longer
    necessary. For controllers which have support for hardreset, SRST is
    never issued by itself. It is only issued as follow-up SRST for
    device classification and PMP initialization, so there's no need to
    wait for it from prereset.

    Kill ATA_LFLAG_SKIP_D2H_BSY.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • When both soft and hard resets are available, libata preferred
    softreset till now. The logic behind it was to be softer to devices;
    however, this doesn't really help much. Rationales for the change:

    * BIOS may freeze lock certain things during boot and softreset can't
    unlock those. This by itself is okay but during operation PHY event
    or other error conditions can trigger hardreset and the device may
    end up with different configuration.

    For example, after a hardreset, previously unlockable HPA can be
    unlocked resulting in different device size and thus revalidation
    failure. Similar condition can occur during or after resume.

    * Certain ATAPI devices require hardreset to recover after certain
    error conditions. On PATA, this is done by issuing the DEVICE RESET
    command. On SATA, COMRESET has equivalent effect. The problem is
    that DEVICE RESET needs its own execution protocol.

    For SFF controllers with bare TF access, it can be easily
    implemented but more advanced controllers (e.g. ahci and sata_sil24)
    require specialized implementations. Simply using hardreset solves
    the problem nicely.

    * COMRESET initialization sequence is the norm in SATA land and many
    SATA devices don't work properly if only SRST is used. For example,
    some PMPs behave this way and libata works around by always issuing
    hardreset if the host supports PMP.

    Like the above example, libata has developed a number of mechanisms
    aiming to promote softreset to hardreset if softreset is not going
    to work. This approach is time consuming and error prone.

    Also, note that, dependingon how you read the specs, it could be
    argued that PMP fan-out ports require COMRESET to start operation.
    In fact, all the PMPs on the market except one don't work properly
    if COMRESET is not issued to fan-out ports after PMP reset.

    * COMRESET is an integral part of SATA connection and any working
    device should be able to handle COMRESET properly. After all, it's
    the way to signal hardreset during reboot. This is the most used
    and recommended (at least by the ahci spec) method of resetting
    devices.

    So, this patch makes libata prefer hardreset over softreset by making
    the following changes.

    * Rename ATA_EH_RESET_MASK to ATA_EH_RESET and use it whereever
    ATA_EH_{SOFT|HARD}RESET used to be used. ATA_EH_{SOFT|HARD}RESET is
    now only used to tell prereset whether soft or hard reset will be
    issued.

    * Strip out now unneeded promote-to-hardreset logics from
    ata_eh_reset(), ata_std_prereset(), sata_pmp_std_prereset() and
    other places.

    Signed-off-by: Tejun Heo

    Tejun Heo
     

19 Feb, 2008

1 commit

  • that provided by the block layer

    ATA requires that all DMA transfers begin and end on word boundaries.
    Because of this, a large amount of machinery grew up in ide to adjust
    scatterlists on this basis. However, as of 2.5, the block layer has a
    dma_alignment variable which ensures both the beginning and length of a
    DMA transfer are aligned on the dma_alignment boundary. Although the
    block layer does adjust the beginning of the transfer to ensure this
    happens, it doesn't actually adjust the length, it merely makes sure
    that space is allocated for transfers beyond the declared length. The
    upshot of this is that scatterlists may be padded to any size between
    the actual length and the length adjusted to the dma_alignment safely
    knowing that memory is allocated in this region.

    Right at the moment, SCSI takes the default dma_aligment which is on a
    512 byte boundary. Note that this aligment only applies to transfers
    coming in from user space. However, since all kernel allocations are
    automatically aligned on a minimum of 32 byte boundaries, it is safe to
    adjust them in this manner as well.

    tj: * Adjusting sg after padding is done in block layer. Make libata
    set queue alignment correctly for ATAPI devices and drop broken
    sg mangling from ata_sg_setup().
    * Use request->raw_data_len for ATAPI transfer chunk size.
    * Killed qc->raw_nbytes.
    * Separated out killing qc->n_iter.

    Signed-off-by: James Bottomley
    Signed-off-by: Tejun Heo
    Signed-off-by: Jens Axboe

    James Bottomley
     

23 Jan, 2008

1 commit

  • libata used private sg iterator to handle padding sg. Now that sg can
    be chained, padding can be handled using standard sg ops. Convert to
    chained sg.

    * s/qc->__sg/qc->sg/

    * s/qc->pad_sgent/qc->extra_sg[]/. Because chaining consumes one sg
    entry. There need to be two extra sg entries. The renaming is also
    for future addition of other extra sg entries.

    * Padding setup is moved into ata_sg_setup_extra() which is organized
    in a way that future addition of other extra sg entries is easy.

    * qc->orig_n_elem is unused and removed.

    * qc->n_elem now contains the number of sg entries that LLDs should
    map. qc->mapped_n_elem is added to carry the original number of
    mapped sgs for unmapping.

    * The last sg of the original sg list is used to chain to extra sg
    list. The original last sg is pointed to by qc->last_sg and the
    content is stored in qc->saved_last_sg. It's restored during
    ata_sg_clean().

    * All sg walking code has been updated. Unnecessary assertions and
    checks for conditions the core layer already guarantees are removed.

    Signed-off-by: Tejun Heo
    Cc: Jens Axboe
    Signed-off-by: Jeff Garzik

    Tejun Heo