1. 23 1月, 2008 23 次提交
    • T
      libata: factor out ata_pci_activate_sff_host() from ata_pci_one() · 4e6b79fa
      Tejun Heo 提交于
      Factor out ata_pci_activate_sff_host() from ata_pci_one().  This does
      about the same thing as ata_host_activate() but needs to be separate
      because SFF controllers use different and multiple IRQs in legacy
      mode.
      
      This will be used to make SFF LLD initialization more flexible.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4e6b79fa
    • A
      libata annotations and fixes · 4ca4e439
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      4ca4e439
    • J
      libata: make ata_port_queue_task() an internal function · 442eacc3
      Jeff Garzik 提交于
      ata_port_queue_task() served a single user:  ata_pio_task()
      
      Rename to ata_pio_queue_task() and un-export it, as nobody outside of
      libata-core.c uses it.
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      442eacc3
    • T
      libata: make qc->nbytes include extra buffers · 0bcc65ad
      Tejun Heo 提交于
      qc->nbytes didn't use to include extra buffers setup by libata core
      layer and my be odd.  This patch makes qc->nbytes include any extra
      buffers setup by libata core layer and guaranteed to be aligned on 4
      byte boundary.
      
      This value is to be used to program the host controller.  As this
      represents the actual length of buffer available to the controller and
      the controller must be able to deal with short transfers for ATAPI
      commands which can transfer variable length, this shouldn't break any
      controllers while making problems like rounding-down and controllers
      choking up on odd transfer bytes much less likely.
      
      The unmodified value is stored in new field qc->raw_nbytes.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      0bcc65ad
    • T
      libata: convert to chained sg · ff2aeb1e
      Tejun Heo 提交于
      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: NTejun Heo <htejun@gmail.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ff2aeb1e
    • T
      libata: kill non-sg DMA interface · 001102d7
      Tejun Heo 提交于
      With atapi_request_sense() converted to use sg, there's no user of
      non-sg interface.  Kill non-sg interface.
      
      * ATA_QCFLAG_SINGLE and ATA_QCFLAG_SG are removed.  ATA_QCFLAG_DMAMAP
        is used instead.  (this way no LLD change is necessary)
      
      * qc->buf_virt is removed.
      
      * ata_sg_init_one() and ata_sg_setup_one() are removed.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Rusty Russel <rusty@rustcorp.com.au>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      001102d7
    • T
      libata: update ->data_xfer hook for ATAPI · 55dba312
      Tejun Heo 提交于
      Depending on how many bytes are transferred as a unit, PIO data
      transfer may consume more bytes than requested.  Knowing how much
      data is consumed is necessary to determine how much is left for
      draining.  This patch update ->data_xfer such that it returns the
      number of consumed bytes.
      
      While at it, it also makes the following changes.
      
      * s/adev/dev/
      * use READ/WRITE constants for rw indication
      * misc clean ups
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      55dba312
    • T
      libata: add ATAPI_* cmd types and implement atapi_cmd_type() · ceb0c642
      Tejun Heo 提交于
      Add ATAPI command types - ATAPI_READ, WRITE, RW_BUF, READ_CD and MISC,
      and implement atapi_cmd_type() which takes SCSI opcode and returns to
      which class the opcode belongs.  This will be used later to improve
      ATAPI handling.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      ceb0c642
    • T
      libata: rename ATA_PROT_ATAPI_* to ATAPI_PROT_* · 0dc36888
      Tejun Heo 提交于
      ATA_PROT_ATAPI_* are ugly and naming schemes between ATA_PROT_* and
      ATA_PROT_ATAPI_* are inconsistent causing confusion.  Rename them to
      ATAPI_PROT_* and make them consistent with ATA counterpart.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jgarzik@redhat.com>
      0dc36888
    • T
      cdrom: add more GPCMD_* constants · 537b53c1
      Tejun Heo 提交于
      Add GPCMD_* constants for READ_BUFFER, WRITE_12 and WRITE_BUFFER for
      completeness.  These will be used libata.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      537b53c1
    • T
      libata: reimplement ata_acpi_cbl_80wire() using ata_acpi_gtm_xfermask() · 021ee9a6
      Tejun Heo 提交于
      Reimplement ata_acpi_cbl_80wire() using ata_acpi_gtm_xfermask() and
      while at it relocate the function below ata_acpi_gtm_xfermask().
      
      New ata_acpi_cbl_80wire() implementation takes @gtm, in both pata_via
      and pata_amd, use the initial GTM value.  Both are trying to peek
      initial BIOS configuration, so using initial caching value makes
      sense.  This fixes ACPI part of cable detection in pata_amd which
      previously always returned 0 because configuring PIO0 during reset
      clears DMA configuration.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      021ee9a6
    • T
      libata: implement ata_timing_cycle2mode() and use it in libata-acpi and pata_acpi · a0f79b92
      Tejun Heo 提交于
      libata-acpi is using separate timing tables for transfer modes
      although libata-core has the complete ata_timing table.  Implement
      ata_timing_cycle2mode() to look for matching mode given transfer type
      and cycle duration and use it in libata-acpi and pata_acpi to replace
      private timing tables.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      a0f79b92
    • T
      libata: separate out ata_acpi_gtm_xfermask() from pacpi_discover_modes() · 7c77fa4d
      Tejun Heo 提交于
      Finding out matching transfer mode from ACPI GTM values is useful for
      other purposes too.  Separate out the function and timing tables from
      pata_acpi::pacpi_discover_modes().
      
      Other than checking shared-configuration bit after doing
      ata_acpi_gtm() in pacpi_discover_modes() which should be safe, this
      patch doesn't introduce any behavior change.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      7c77fa4d
    • T
      libata: add ATA_CBL_PATA_IGN · c88f90c3
      Tejun Heo 提交于
      ATA_CBL_PATA_UNK indicates that the cable type can't be determined
      from the host side and might be either 80c or 40c.  libata applies
      drive or other generic limit in this case.  However, there are
      controllers where both host and drive side detections are
      misimplemented and the driver has to rely solely on private method -
      peeking BIOS or ACPI configuration or using some other private
      mechanism.
      
      This patch adds ATA_CBL_PATA_IGN which tells libata to ignore the
      cable type completely and just let the LLD determine the transfer mode
      via host transfer mode masks and ->mode_filter().
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      c88f90c3
    • T
      libata: xfer_mask is unsigned long not unsigned int · 7dc951ae
      Tejun Heo 提交于
      Jeff says xfer_mask is unsigned long not unsigned int.  Convert all
      xfermask fields and handling functions to deal with unsigned longs.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      7dc951ae
    • T
      libata: kill ata_id_to_dma_mode() · 9d3501ab
      Tejun Heo 提交于
      ata_id_to_dma_mode() isn't quite generic.  The function is basically
      privately implemented ata_id_xfermask() combined with hardcoded mode
      printing and configuration which are specific to ata_generic.
      
      Kill the function and open code it in generic_set_mode() using generic
      xfermode handling functions.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      9d3501ab
    • T
      libata: clean up xfermode / PATA timing related stuff · 70cd071e
      Tejun Heo 提交于
      * s/ATA_BITS_(PIO|MWDMA|UDMA)/ATA_NR_\1_MODES/g
      
      * Consistently use 0xff to indicate invalid transfer mode (0x00 is
        valid for PIO_SLOW).
      
      * Make ata_xfer_mode2mask() return proper mode mask instead of just
        the highest bit.
      
      * Sort ata_timing table in increasing xfermode order and update
        ata_timing_find_mode() accordingly.
      
      This patch doesn't introduce any behavior change.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      70cd071e
    • T
      libata: export xfermode / PATA timing related functions · 6357357c
      Tejun Heo 提交于
      Export the following xfermode related functions.
      
      * ata_pack_xfermask()
      * ata_unpack_xfermask()
      * ata_xfer_mask2mode()
      * ata_xfer_mode2mask()
      * ata_xfer_mode2shift()
      * ata_mode_string()
      * ata_id_xfermask()
      * ata_timing_find_mode()
      
      These functions will be used later by LLD updates.  While at it,
      change unsigned short @speed to u8 @xfer_mode in
      ata_timing_find_mode() for consistency.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      6357357c
    • T
      libata: implement ATA_DFLAG_DUBIOUS_XFER · 00115e0f
      Tejun Heo 提交于
      ATA_DFLAG_DUBIOUS_XFER is set whenever data transfer speed or method
      changes and gets cleared when data transfer command succeeds in the
      newly configured transfer mode.
      
      This will be used to improve speed down logic.
      
      Signed-off-by: Tejun Heo <htejun@gmail.com<
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      00115e0f
    • T
      libata: clean up EH speed down implementation · 3884f7b0
      Tejun Heo 提交于
      Clean up EH speed down implementation.
      
      * is_io boolean variable is replaced eflags.  is_io is ATA_EFLAG_IS_IO.
      
      * Error categories now have names.
      
      * Better comments.
      
      * Reorder 5min and 10min rules in ata_eh_speed_down_verdict()
      
      * Use local variable @link to cache @dev->link in ata_eh_speed_down()
      
      These changes are to improve readability and ease further changes.
      This patch doesn't introduce any behavior change.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      3884f7b0
    • T
      libata: implement protocol tests · 405e66b3
      Tejun Heo 提交于
      Implement protocol tests - ata_is_atapi(), ata_is_nodata(),
      ata_is_pio(), ata_is_dma(), ata_is_ncq() and ata_is_data() and use
      them to replace is_atapi_taskfile() and hard coded protocol tests.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      405e66b3
    • T
      libata: rearrange ATA_DFLAG_* · f20ded38
      Tejun Heo 提交于
      Area for DFLAGs which are cleared on INIT is full.  Extend it by 8
      bits.
      Signed-off-by: NTejun Heo <htejun@gmail.com>
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      f20ded38
    • A
      libata: Disable ATA8-ACS proposed Trusted Computing features by default · ae8d4ee7
      Alan Cox 提交于
      Historically word 48 in the identify data was used to mean 32bit I/O
      was supported for VLB IDE etc. ATA8 reassigns this word to the Trusted
      Computing Group, where it is used for TCG features. This means that
      an ATA8 TCG drive is going to trigger 32bit I/O on some systems which
      will be funny.
      
      Anyway we need to sort this out ready for ATA8 so:
      - Reorder the ata.h header a bit so the ata_version function occurs early
        in it
      - Make dword_io check the ATA version
      - Add an ATA8 version checking TCG presence test
      
      While we are at it the current drafts have a flaw where it may not be
      possible to disable TCG features at boot (and opt out of the trusted
      model) as TCG intends because it relies on presence of a different
      optional feature (DCS). Handle this in software by refusing the TCG
      commands if libata.allow_tpm is not set. (We must make it possible
      as some environments such as proprietary VDR devices will doubtless
      want to use it to lock up content)
      
      Finally as with CPRM print a warning so that the user knows they may
      not be able to full access and use the device.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      ae8d4ee7
  2. 22 1月, 2008 1 次提交
  3. 18 1月, 2008 1 次提交
  4. 16 1月, 2008 2 次提交
  5. 15 1月, 2008 6 次提交
  6. 14 1月, 2008 1 次提交
    • R
      remove task_ppid_nr_ns · 84427eae
      Roland McGrath 提交于
      task_ppid_nr_ns is called in three places.  One of these should never
      have called it.  In the other two, using it broke the existing
      semantics.  This was presumably accidental.  If the function had not
      been there, it would have been much more obvious to the eye that those
      patches were changing the behavior.  We don't need this function.
      
      In task_state, the pid of the ptracer is not the ppid of the ptracer.
      
      In do_task_stat, ppid is the tgid of the real_parent, not its pid.
      I also moved the call outside of lock_task_sighand, since it doesn't
      need it.
      
      In sys_getppid, ppid is the tgid of the real_parent, not its pid.
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      84427eae
  7. 12 1月, 2008 1 次提交
  8. 11 1月, 2008 4 次提交
  9. 10 1月, 2008 1 次提交