1. 23 1月, 2008 17 次提交
    • 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. 16 1月, 2008 2 次提交
  3. 15 1月, 2008 2 次提交
  4. 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
  5. 12 1月, 2008 1 次提交
  6. 11 1月, 2008 2 次提交
  7. 09 1月, 2008 4 次提交
    • D
      [NET]: Add NAPI_STATE_DISABLE. · a0a46196
      David S. Miller 提交于
      Create a bit to signal that a napi_disable() is in progress.
      
      This sets up infrastructure such that net_rx_action() can generically
      break out of the ->poll() loop on a NAPI context that has a pending
      napi_disable() yet is being bombed with packets (and thus would
      otherwise poll endlessly and not allow the napi_disable() to finish).
      
      Now, what napi_disable() does is first set the NAPI_STATE_DISABLE bit
      (to indicate that a disable is pending), then it polls for the
      NAPI_STATE_SCHED bit, and once the NAPI_STATE_SCHED bit is acquired
      the NAPI_STATE_DISABLE bit is cleared.  Here, the test_and_set_bit()
      provides the necessary memory barrier between the various bitops.
      
      napi_schedule_prep() now tests for a pending disable as it's first
      action and won't try to obtain the NAPI_STATE_SCHED bit if a disable
      is pending.
      
      As a result, we can remove the netif_running() check in
      netif_rx_schedule_prep() because the NAPI disable pending state serves
      this purpose.  And, it does so in a NAPI centric manner which is what
      we really want.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a0a46196
    • D
      [NET]: Do not grab device reference when scheduling a NAPI poll. · bdb95b17
      David S. Miller 提交于
      It is pointless, because everything that can make a device go away
      will do a napi_disable() first.
      
      The main impetus behind this is that now we can legally do a NAPI
      completion in generic code like net_rx_action() which a following
      changeset needs to do.  net_rx_action() can only perform actions
      in NAPI centric ways, because there may be a one to many mapping
      between NAPI contexts and network devices (SKY2 is one example).
      
      We also want to get rid of this because it's an extra atomic in the
      NAPI paths, and also because it is one of the last instances where the
      NAPI interfaces care about net devices.
      
      The one remaining netdev detail the NAPI stuff cares about is the
      netif_running() check which will be killed off in a subsequent
      changeset.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bdb95b17
    • A
      pl2303: Fix mode switching regression · bf5e5834
      Alan Cox 提交于
      Cleaning out all the incorrect 'no change made' checks for termios
      settings showed up a problem with the PL2303. The hardware here seems to
      lose sync and bits if you tell it to make no changes. This shows up with
      a real world application.
      
      To fix this the driver check for meaningful hardware changes is restored
      but doing the tests correctly and as a tty layer function so it doesn't
      get duplicated wrongly everywhere if other drivers turn out to need it.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Tested-by: NMirko Parthey <mirko.parthey@informatik.tu-chemnitz.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bf5e5834
    • S
      KEYS: fix macro · 5b7741b3
      Sebastian Siewior 提交于
      Commit 664cceb0 changed the parameters of
      the function make_key_ref().  The macros that are used in case CONFIG_KEY
      is not defined did not change.
      
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NSebastian Siewior <sebastian@breakpoint.cc>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b7741b3
  8. 07 1月, 2008 1 次提交
    • I
      CPU hotplug: fix cpu_is_offline() on !CONFIG_HOTPLUG_CPU · a263898f
      Ingo Molnar 提交于
      make randconfig bootup testing found that the cpufreq code
      crashes on bootup, if the powernow-k8 driver is enabled and
      if maxcpus=1 passed on the boot line to a !CONFIG_HOTPLUG_CPU
      kernel.
      
      First lockdep found out that there's an inconsistent unlock
      sequence:
      
       =====================================
       [ BUG: bad unlock balance detected! ]
       -------------------------------------
       swapper/1 is trying to release lock (&per_cpu(cpu_policy_rwsem, cpu)) at:
       [<ffffffff806ffd8e>] unlock_policy_rwsem_write+0x3c/0x42
       but there are no more locks to release!
      
      Call Trace:
       [<ffffffff806ffd8e>] unlock_policy_rwsem_write+0x3c/0x42
       [<ffffffff80251c29>] print_unlock_inbalance_bug+0x104/0x12c
       [<ffffffff80252f3a>] mark_held_locks+0x56/0x94
       [<ffffffff806ffd8e>] unlock_policy_rwsem_write+0x3c/0x42
       [<ffffffff807008b6>] cpufreq_add_dev+0x2a8/0x5c4
       ...
      
      then shortly afterwards the cpufreq code crashed on an assert:
      
       ------------[ cut here ]------------
       kernel BUG at drivers/cpufreq/cpufreq.c:1068!
       invalid opcode: 0000 [1] SMP
       [...]
       Call Trace:
        [<ffffffff805145d6>] sysdev_driver_unregister+0x5b/0x91
        [<ffffffff806ff520>] cpufreq_register_driver+0x15d/0x1a2
        [<ffffffff80cc0596>] powernowk8_init+0x86/0x94
       [...]
       ---[ end trace 1e9219be2b4431de ]---
      
      the bug was caused by maxcpus=1 bootup, which brought up the
      secondary core as !cpu_online() but !cpu_is_offline() either,
      which on on !CONFIG_HOTPLUG_CPU is always 0 (include/linux/cpu.h):
      
        /* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
        static inline int cpu_is_offline(int cpu) { return 0; }
      
      but the cpufreq code uses cpu_online() and cpu_is_offline() in
      a mixed way - the low-level drivers use cpu_online(), while
      the cpufreq core uses cpu_is_offline(). This opened up the
      possibility to add the non-initialized sysdev device of the
      secondary core:
      
       cpufreq-core: trying to register driver powernow-k8
       cpufreq-core: adding CPU 0
       powernow-k8: BIOS error - no PSB or ACPI _PSS objects
       cpufreq-core: initialization failed
       cpufreq-core: adding CPU 1
       cpufreq-core: initialization failed
      
      which then blew up. The fix is to make cpu_is_offline() always
      the negation of cpu_online(). With that fix applied the kernel
      boots up fine without crashing:
      
       Calling initcall 0xffffffff80cc0510: powernowk8_init+0x0/0x94()
       powernow-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ processors (1 cpu cores) (version 2.20.00)
       powernow-k8: BIOS error - no PSB or ACPI _PSS objects
       initcall 0xffffffff80cc0510: powernowk8_init+0x0/0x94() returned -19.
       initcall 0xffffffff80cc0510 ran for 19 msecs: powernowk8_init+0x0/0x94()
       Calling initcall 0xffffffff80cc328f: init_lapic_nmi_sysfs+0x0/0x39()
      
      We could fix this by making CPU enumeration aware of max_cpus, but that
      would be more fragile IMO, and the cpu_online(cpu) != cpu_is_offline(cpu)
      possibility was quite confusing and a continuous source of bugs too.
      
      Most distributions have kernels with CPU hotplug enabled, so this bug
      remained hidden for a long time.
      
      Bug forensics:
      
      The broken cpu_is_offline() API variant was introduced via:
      
       commit a59d2e4e6977e7b94e003c96a41f07e96cddc340
       Author: Rusty Russell <rusty@rustcorp.com.au>
       Date:   Mon Mar 8 06:06:03 2004 -0800
      
           [PATCH] minor cleanups for hotplug CPUs
      
      ( this predates linux-2.6.git, this commit is available from Thomas's
        historic git tree. )
      
      Then 1.5 years later the cpufreq code made use of it:
      
       commit c32b6b8e
       Author: Ashok Raj <ashok.raj@intel.com>
       Date:   Sun Oct 30 14:59:54 2005 -0800
      
           [PATCH] create and destroy cpufreq sysfs entries based on cpu notifiers
      
       +       if (cpu_is_offline(cpu))
       +               return 0;
      
      which is a correct use of the subtly broken new API. v2.6.15 then
      shipped with this bug included.
      
      then it took two more years for random-kernel qa to hit it.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a263898f
  9. 03 1月, 2008 2 次提交
  10. 02 1月, 2008 1 次提交
  11. 28 12月, 2007 1 次提交
    • L
      increase PNP_MAX_PORT to 40 from 24 · 2c838197
      Len Brown 提交于
      a7839e96
      (PNP: increase the maximum number of resources)
      increased PNP_MAX_PORT to 24 from 8.
      It also added a test and a complaint when a
      machine exceeded the limit, causing:
      
      pnpacpi: exceeded the max number of IO resources: 24
      
      http://bugzilla.kernel.org/show_bug.cgi?id=9535
      
      We should have been squawking about this all along,
      as this is a potentially serious issue.
      
      For now, simply burn some dynamic bytes and
      increase the limit by another 16 to 40.
      There is no guarantee that this will satisfy
      every system on Earth.  It probably will not,
      but it should be an improvement.
      
      In the future, PNPACPI should allocate resource
      structures as needed, rather than max-sized arrays.
      Signed-off-by: NLen Brown <len.brown@intel.com>
      2c838197
  12. 27 12月, 2007 2 次提交
  13. 24 12月, 2007 1 次提交
  14. 21 12月, 2007 1 次提交
  15. 19 12月, 2007 1 次提交
  16. 18 12月, 2007 1 次提交