03 Feb, 2009

1 commit

  • Fix libata kernel-doc warnings:

    Warning(linux-next-20090120//drivers/ata/libata-core.c:4720): Excess function parameter 'dev' description in 'ata_qc_new'
    Warning(linux-next-20090120//drivers/ata/libata-scsi.c:428): No description found for parameter 'ap'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Jeff Garzik

    Randy Dunlap
     

27 Jan, 2009

1 commit

  • Introduce new libata flags ATA_FLAG_NO_POWEROFF_SPINDOWN and
    ATA_FLAG_NO_HIBERNATE_SPINDOWN that, if set, will prevent disks from
    being spun off during system power off and hibernation, respectively
    (to handle the hibernation case we need the new system state
    SYSTEM_HIBERNATE_ENTER that can be checked against by libata, in
    analogy with SYSTEM_POWER_OFF).

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Jeff Garzik

    Rafael J. Wysocki
     

16 Jan, 2009

1 commit


07 Jan, 2009

1 commit


31 Dec, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (104 commits)
    [SCSI] fcoe: fix configuration problems
    [SCSI] cxgb3i: fix select/depend problem
    [SCSI] fcoe: fix incorrect use of struct module
    [SCSI] cxgb3i: remove use of skb->sp
    [SCSI] cxgb3i: Add cxgb3i iSCSI driver.
    [SCSI] zfcp: Remove unnecessary warning message
    [SCSI] zfcp: Add support for unchained FSF requests
    [SCSI] zfcp: Remove busid macro
    [SCSI] zfcp: remove DID_DID flag
    [SCSI] zfcp: Simplify mask lookups for incoming RSCNs
    [SCSI] zfcp: Remove initial device data from zfcp_data
    [SCSI] zfcp: fix compile warning
    [SCSI] zfcp: Remove adapter list
    [SCSI] zfcp: Simplify SBAL allocation to fix sparse warnings
    [SCSI] zfcp: register with SCSI layer on ccw registration
    [SCSI] zfcp: Fix message line break
    [SCSI] qla2xxx: changes in multiq code
    [SCSI] eata: fix the data buffer accessors conversion regression
    [SCSI] ibmvfc: Improve async event handling
    [SCSI] lpfc : correct printk types on PPC compiles
    ...

    Linus Torvalds
     

30 Dec, 2008

1 commit


29 Dec, 2008

1 commit

  • There currently are the following looping constructs.

    * __ata_port_for_each_link() for all available links
    * ata_port_for_each_link() for edge links
    * ata_link_for_each_dev() for all devices
    * ata_link_for_each_dev_reverse() for all devices in reverse order

    Now there's a need for looping construct which is similar to
    __ata_port_for_each_link() but iterates over PMP links before the host
    link. Instead of adding another one with long name, do the following
    cleanup.

    * Implement and export ata_link_next() and ata_dev_next() which take
    @mode parameter and can be used to build custom loop.
    * Implement ata_for_each_link() and ata_for_each_dev() which take
    looping mode explicitly.

    The following iteration modes are implemented.

    * ATA_LITER_EDGE : loop over edge links
    * ATA_LITER_HOST_FIRST : loop over all links, host link first
    * ATA_LITER_PMP_FIRST : loop over all links, PMP links first

    * ATA_DITER_ENABLED : loop over enabled devices
    * ATA_DITER_ENABLED_REVERSE : loop over enabled devices in reverse order
    * ATA_DITER_ALL : loop over all devices
    * ATA_DITER_ALL_REVERSE : loop over all devices in reverse order

    This change removes exlicit device enabledness checks from many loops
    and makes it clear which ones are iterated over in which direction.

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

    Tejun Heo
     

11 Nov, 2008

1 commit

  • This patch reverts the following three commits which convert libata to
    use block layer tagging.

    43a49cbdf31e812c0d8f553d433b09b421f5d52c
    e013e13bf605b9e6b702adffbe2853cfc60e7806
    2fca5ccf97d2c28bcfce44f5b07d85e74e3cd18e

    Although using block layer tagging is the right direction, due to the
    tight coupling among tag number, data structure allocation and
    hardware command slot allocation, libata doesn't work correctly with
    the current conversion.

    The biggest problem is guaranteeing that tag 0 is always used for
    non-NCQ commands. Due to the way blk-tag is implemented and how SCSI
    starts and finishes requests, such guarantee can't be made. I'm not
    sure whether this would actually break any low level driver but it
    doesn't look like a good idea to break such assumption given the
    frailty of ATA controllers.

    So, for the time being, keep using the old dumb in-libata qc
    allocation.

    Signed-off-by: Tejun Heo
    Cc: Jens Axobe
    Cc: Jeff Garzik
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

04 Nov, 2008

1 commit

  • Peter Moulder has pointed out that there is a slight chance that a
    negative value might be passed to jiffies_to_msecs() in
    ata_scsi_park_show(). This is fixed by saving the value of jiffies in a
    local variable, thus also reducing code since the volatile variable
    jiffies is accessed only once.

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

    Elias Oltmanns
     

28 Oct, 2008

1 commit


24 Oct, 2008

2 commits

  • The recent commit 2fca5ccf97d2c28bcfce44f5b07d85e74e3cd18e ("libata:
    switch to using block layer tagging support") to enable support for
    block layer tagging in libata was broken for non-NCQ devices

    The block layer initializes the tag field to -1 to detect invalid uses
    of a tag, and if the libata devices does NOT support NCQ, we just used
    that field to index the internal command list. So we need to check for
    -1 first and only use the tag field if it's valid.

    Signed-off-by: Jens Axboe
    Reported-by: Alexander Beregalov
    Tested-by: Paul Mundt
    Tested-by: Dave Young
    Tested-by: Rafael J. Wysocki
    Signed-off-by: Linus Torvalds

    Jens Axboe
     
  • libata currently has a pretty dumb ATA_MAX_QUEUE loop for finding
    a free tag to use. Instead of fixing that up, convert libata to
    using block layer tagging - gets rid of code in libata, and is also
    much faster.

    Signed-off-by: Jens Axboe
    Acked-by: Tejun Heo
    Signed-off-by: Linus Torvalds

    Jens Axboe
     

11 Oct, 2008

2 commits

  • Acked-by: Jeff Garzik
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block: (132 commits)
    doc/cdrom: Trvial documentation error, file not present
    block_dev: fix kernel-doc in new functions
    block: add some comments around the bio read-write flags
    block: mark bio_split_pool static
    block: Find bio sector offset given idx and offset
    block: gendisk integrity wrapper
    block: Switch blk_integrity_compare from bdev to gendisk
    block: Fix double put in blk_integrity_unregister
    block: Introduce integrity data ownership flag
    block: revert part of d7533ad0e132f92e75c1b2eb7c26387b25a583c1
    bio.h: Remove unused conditional code
    block: remove end_{queued|dequeued}_request()
    block: change elevator to use __blk_end_request()
    gdrom: change to use __blk_end_request()
    memstick: change to use __blk_end_request()
    virtio_blk: change to use __blk_end_request()
    blktrace: use BLKTRACE_BDEV_SIZE as the name size for setup structure
    block: add lld busy state exporting interface
    block: Fix blk_start_queueing() to not kick a stopped queue
    include blktrace_api.h in headers_install
    ...

    Linus Torvalds
     

09 Oct, 2008

1 commit


29 Sep, 2008

1 commit

  • On user request (through sysfs), the IDLE IMMEDIATE command with UNLOAD
    FEATURE as specified in ATA-7 is issued to the device and processing of
    the request queue is stopped thereafter until the specified timeout
    expires or user space asks to resume normal operation. This is supposed
    to prevent the heads of a hard drive from accidentally crashing onto the
    platter when a heavy shock is anticipated (like a falling laptop
    expected to hit the floor). In fact, the whole port stops processing
    commands until the timeout has expired in order to avoid any resets due
    to failed commands on another device.

    Signed-off-by: Elias Oltmanns
    Signed-off-by: Jeff Garzik

    Elias Oltmanns
     

31 Jul, 2008

1 commit

  • Global and per-LLD ATAPI disable checks were done in the command issue
    path probably because it was left out during EH conversion. On
    affected machines, this can cause lots of warning messages. Move them
    to where they belong - the probing path.

    Reported by Chunbo Luo.

    Signed-off-by: Tejun Heo
    Cc: Chunbo Luo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

16 Jul, 2008

1 commit

  • * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
    AHCI: Remove an unnecessary flush from ahci_qc_issue
    AHCI: speed up resume
    [libata] Add support for VPD page b1
    ata: endianness annotations in pata drivers
    libata-eh: update atapi_eh_request_sense() to take @dev instead of @qc
    [libata] sata_svw: update code comments relating to data corruption
    libata/ahci: enclosure management support
    libata: improve EH internal command timeout handling
    libata: use ULONG_MAX to terminate reset timeout table
    libata: improve EH retry delay handling
    libata: consistently use msecs for time durations

    Linus Torvalds
     

15 Jul, 2008

2 commits


04 Jul, 2008

1 commit

  • This adds blk_queue_update_dma_pad to prevent LLDs from overwriting
    the dma pad mask wrongly (we added blk_queue_update_dma_alignment due
    to the same reason).

    This also converts libata to use blk_queue_update_dma_pad instead of
    blk_queue_dma_pad.

    Signed-off-by: FUJITA Tomonori
    Cc: Tejun Heo
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Thomas Bogendoerfer
    Cc: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     

19 Jun, 2008

1 commit


31 May, 2008

1 commit

  • Fix libata-scsi kernel-doc notation:

    Warning(linux-2.6.25-git15//drivers/ata/libata-scsi.c:1659): No description found for parameter 'cmd'
    Warning(linux-2.6.25-git15//drivers/ata/libata-scsi.c:1971): No description found for parameter 'buf'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Jeff Garzik

    Randy Dunlap
     

20 May, 2008

1 commit

  • I was hoping ATA_HORKAGE_NODMA | ATA_HORKAGE_SKIP_PM could keep it
    happy but no even this doesn't work under certain configurations and
    it's not like we can do anything useful with the cofig device anyway.
    Replace ATA_HORKAGE_SKIP_PM with ATA_HORKAGE_DISABLE and use it for
    the config device. This makes the device completely ignored by
    libata.

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

    Tejun Heo
     

29 Apr, 2008

2 commits

  • Buffer length handling in simulated commands is error-prone and full
    of bugs. There are a number of places where necessary length checks
    are missing and if the output buffer is passed in as sglist, nothing
    works.

    This patch adds a static buffer ata_scsi_rbuf which is sufficiently
    large to handle the larges output from simulated commands (4k
    currently), let all simulte functions write to the buffer and removes
    all length checks as we know that there always is enough buffer space.
    Copying in (for ATAPI inquiry fix up) and out are handled by
    sg_copy_to/from_buffer() behind ata_scsi_rbuf_get/put() interface
    which handles sglist properly.

    This patch is inspired from buffer length check fix patch from Petr
    Vandrovec.

    Updated to use sg_copy_to/from_buffer() as suggested by FUJITA
    Tomonori.

    Signed-off-by: Tejun Heo
    Cc: Petr Vandrovec
    Cc: FUJITA Tomonori
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • * make ata_scsiop_*() static
    * make ata_scsi_set_sense() static and move it above its users
    * make ata_scsi_rbuf_fill() static
    * kill unused ata_scsi_badcmd()

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

    Tejun Heo
     

20 Apr, 2008

1 commit


19 Apr, 2008

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (137 commits)
    [SCSI] iscsi: bidi support for iscsi_tcp
    [SCSI] iscsi: bidi support at the generic libiscsi level
    [SCSI] iscsi: extended cdb support
    [SCSI] zfcp: Fix error handling for blocked unit for send FCP command
    [SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlock
    [SCSI] zfcp: fix 31 bit compile warnings
    [SCSI] bsg: no need to set BSG_F_BLOCK bit in bsg_complete_all_commands
    [SCSI] bsg: remove minor in struct bsg_device
    [SCSI] bsg: use better helper list functions
    [SCSI] bsg: replace kobject_get with blk_get_queue
    [SCSI] bsg: takes a ref to struct device in fops->open
    [SCSI] qla1280: remove version check
    [SCSI] libsas: fix endianness bug in sas_ata
    [SCSI] zfcp: fix compiler warning caused by poking inside new semaphore (linux-next)
    [SCSI] aacraid: Do not describe check_reset parameter with its value
    [SCSI] aacraid: Fix down_interruptible() to check the return value
    [SCSI] sun3_scsi_vme: add MODULE_LICENSE
    [SCSI] st: rename flush_write_buffer()
    [SCSI] tgt: use KMEM_CACHE macro
    [SCSI] initio: fix big endian problems for auto request sense
    ...

    Linus Torvalds
     
  • The kernel now panics reliably on boot if you have a SATAPI device
    connected.

    The problem was introduced by the libata merge trying to pull out all
    the SFF code into a separate module. Unfortunately, if you're a satapi
    device you usually need to call atapi_request_sense, which has a bare
    invocation of a SFF callback which is NULL on non-SFF HBAs. Fix this by
    making the call conditional.

    Signed-off-by: James Bottomley
    Signed-off-by: Linus Torvalds

    James Bottomley
     

18 Apr, 2008

6 commits

  • 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
     
  • Now that SFF support is completely separated out from the core layer,
    it can be made optional. Add CONFIG_ATA_SFF and let SFF drivers
    depend on it. If CONFIG_ATA_SFF isn't set, all codes in libata-sff.c
    and data structures for SFF support are disabled. This saves good
    number of bytes for small systems.

    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
     
  • ata_ehi_schedule_probe() was created to hide details of link-resuming
    reset magic. Now that all the softreset workarounds are gone,
    scheduling probe is very simple - set probe_mask and request RESET.
    Kill ata_ehi_schedule_probe() and open code it. This also increases
    consistency as ata_ehi_schedule_probe() couldn't cover individual
    device probings so they were open-coded even when the helper existed.

    While at it, define ATA_ALL_DEVICES as mask of all possible devices on
    a link and always use it when requesting probe on link level for
    simplicity and consistency. Setting extra bits in the probe_mask
    doesn't hurt anybody.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • ATA_EHI_RESUME_LINK has two functions - promote reset to hardreset if
    ATA_LFLAG_HRST_TO_RESUME is set and preventing EH from shortcutting
    reset action when probing is requested. The former is gone now and
    the latter can easily be achieved by making EH to perform at least one
    reset if reset is requested, which also makes more sense than
    depending on RESUME_LINK flag.

    As ATA_EHI_RESUME_LINK was the only EHI reset modifier, this also
    kills reset modifier handling.

    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
     

08 Apr, 2008

1 commit


25 Mar, 2008

1 commit


04 Mar, 2008

2 commits

  • Block layer alignment was used for two different purposes - memory
    alignment and padding. This causes problems in lower layers because
    drivers which only require memory alignment ends up with adjusted
    rq->data_len. Separate out padding such that padding occurs iff
    driver explicitly requests it.

    Tomo: restorethe code to update bio in blk_rq_map_user
    introduced by the commit 40b01b9bbdf51ae543a04744283bf2d56c4a6afa
    according to padding alignment.

    Signed-off-by: Tejun Heo
    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    Tejun Heo
     
  • The meaning of rq->data_len was changed to the length of an allocated
    buffer from the true data length. It breaks SG_IO friends and
    bsg. This patch restores the meaning of rq->data_len to the true data
    length and adds rq->extra_len to store an extended length (due to
    drain buffer and padding).

    This patch also removes the code to update bio in blk_rq_map_user
    introduced by the commit 40b01b9bbdf51ae543a04744283bf2d56c4a6afa.
    The commit adjusts bio according to memory alignment
    (queue_dma_alignment). However, memory alignment is NOT padding
    alignment. This adjustment also breaks SG_IO friends and bsg. Padding
    alignment needs to be fixed in a proper way (by a separate patch).

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Jens Axboe

    FUJITA Tomonori
     

01 Mar, 2008

1 commit