1. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit 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.
      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
      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
      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
      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: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
  2. 07 Jun, 2009 1 commit
    • Bartlomiej Zolnierkiewicz's avatar
      ide: preserve Host Protected Area by default (v2) · 075affcb
      Bartlomiej Zolnierkiewicz authored
      From the perspective of most users of recent systems, disabling Host
      Protected Area (HPA) can break vendor RAID formats, GPT partitions and
      risks corrupting firmware or overwriting vendor system recovery tools.
      Unfortunately the original (kernels < 2.6.30) behavior (unconditionally
      disabling HPA and using full disk capacity) was introduced at the time
      when the main use of HPA was to make the drive look small enough for the
      BIOS to allow the system to boot with large capacity drives.
      Thus to allow the maximum compatibility with the existing setups (using
      HPA and partitioned with HPA disabled) we automically disable HPA if
      any partitions overlapping HPA are detected.  Additionally HPA can also
      be disabled using the "nohpa" module parameter (i.e. "ide_core.nohpa=0.0"
      to disable HPA on /dev/hda).
      Fix ->resume HPA support.
      While at it:
      - remove stale "idebus=" entry from Documentation/kernel-parameters.txt
      Cc: Robert Hancock <hancockrwd@gmail.com>
      Cc: Frans Pop <elendil@planet.nl>
      Cc: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      [patch description was based on input from Alan Cox and Frans Pop]
      Emphatically-Acked-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  3. 24 Mar, 2009 2 commits
  4. 25 Feb, 2009 1 commit
    • David Fries's avatar
      ide: ide.c 'clear' fix, update "ide=nodma" documentation · 0af80c04
      David Fries authored
      - ide=nodma is no longer valid.
      - The module is ide-core.ko not ide.
      - It took me a while to figure out what the arguments %d.%d:%d to nodma
        module parameter ment, so I added a comment to each.
      - Added a comment to each of the sscanf lines.
      - There is a bug, if j is 0 it would previously clear all the other bits
        except the current device, changed in three different places.
        mask &= (1 << i) should be mask &= ~(1 << i).
      Signed-off-by: default avatarDavid Fries <david@fries.net>
      [bart: s/disk/device/ in ide.c, beautify patch description]
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  5. 06 Jan, 2009 7 commits
  6. 02 Jan, 2009 1 commit
  7. 29 Dec, 2008 3 commits
  8. 13 Oct, 2008 9 commits
    • Elias Oltmanns's avatar
      ide: Implement disk shock protection support (v4) · 4abdc6ee
      Elias Oltmanns authored
      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). Port resets are deferred whenever a device on that
      port is in the parked state.
      Elias Oltmanns <eo@nebensachen.de> wrote:
      > >> 1. Make sure that no negative value is being passed to
      > >>    jiffies_to_msecs() in ide_park_show().
      > >> 2. Drop the superfluous variable hwif in ide_special_rq().
      > >> 3. Skip initialisation of task and tf in ide_special_rq() if we are not
      > >>    handling a (un)park request.
      > >
      > > Well, #3 should have been done differently because we donn't want to
      > > check for REQ_(UN)?PARK_HEADS more often than is necessary.
      > While preparing the backport to 2.6.27, it has just occurred to me that
      > we need to clear the IDE_DFLAG_PARKED flag in ide_disk_pre_reset()
      > because this flag must not be set after *any* sort of access to the
      > device.
      Fix a memory leak due to a missing blk_put_request() in
      issue_park_cmd(). Additionally, we should plug the queue when enqueueing
      the unpark request because there is no guarantee that the park timeout
      has not expired by then. Even though the chance for that to happen is
      very slim, the request might end up hanging in the queue until the next
      I/O operation is queued up. While at it, clean up the code a little:
      - make issue_park_cmd() a function of type void since nobody cares for
        the return value anyway;
      - use blk_start_queueing() instead of __blk_run_queue() since we don't
        have to worry about recursion;
      - remove a superfluous pointer deference in task_no_data_intr().
      Signed-off-by: default avatarElias Oltmanns <eo@nebensachen.de>
      Cc: Jeff Garzik <jeff@garzik.org>,
      Cc: Randy Dunlap <randy.dunlap@oracle.com>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: switch to DMA-mapping API part #2 · 2bbd57ca
      Bartlomiej Zolnierkiewicz authored
      Follow-up to commit 5c05ff68
      ("ide: switch to DMA-mapping API"):
      * pci_{alloc,free}_consistent() -> dma_{alloc,free}_coherent()
        in ide_{allocate,release}_dma_engine().
      * Add ->prd_max_nents and ->prd_ent_size fields to ide_hwif_t
        (+ set default values in ide_allocate_dma_engine()).
      * Make ide_{allocate,release}_dma_engine() available also
        for CONFIG_BLK_DEV_IDEDMA_SFF=n.  Then convert au1xxx-ide.c,
        scc_pata.c and sgiioc4.c to use them.
      * Add missing ->init_dma method to scc_pata.
      This patch also fixes:
      - ->dmatable_cpu leak for au1xxx-ide
      - too early realease of ->dmatable_cpu for scc_pata
      - wrong amount of ->dmatable_cpu memory being freed for sgiioc4
      While at it:
      - remove superfluous ->dma_base check from ide_unregister()
      - return -ENOMEM on error in ide_release_dma_engine()
      - beautify error message in ide_release_dma_engine()
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide-disk: move all ioctl handling to ide-disk_ioctl.c · f8790489
      Bartlomiej Zolnierkiewicz authored
      While at it:
      - idedisk_ioctl() -> ide_disk_ioctl()
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: convert 'pio_mode' device setting to use DS_SYNC flag · 6982daf7
      Bartlomiej Zolnierkiewicz authored
      * Convert 'pio_mode' device setting to use DS_SYNC flag.
      * Remove unused special_t.b.{set_tune,serviced} and ide_drive_t.tune_req.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove [ata_]select_t · 7f612f27
      Bartlomiej Zolnierkiewicz authored
      * Use 'drive->dn & 1' in ide_init_disk().
      * remove [ata_]select_t.
      While at it:
      * Use ATA_DEVICE_OBS define in ide_port_init_devices_data().
      Acked-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: use 'drive->dn & 1' instead of drive->select.b.unit · 123995b9
      Bartlomiej Zolnierkiewicz authored
      * Call ide_port_init_devices() in ide_host_register()
        also if 'struct ide_port_info *d' is not available.
      * Init drive->dn in ide_port_init_devices() instead of
        ide_probe_port() so it is valid also in ->init_dev.
      * Pass device number to ide_dev_apply_params().
      * Use 'drive->dn & 1' instead of drive->select.b.unit.
      There should be no functional changes caused by this patch.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: sanitize ide*_pm_* enums · 0d346ba0
      Bartlomiej Zolnierkiewicz authored
      * Move ide*_pm_* enums from ide-io.c to <linux/ide.h>.
      * idedisk_pm_* -> ide_pm_*
      * ide_pm_state_* -> ide_pm_*
      * No need to set ide_pm_* enums to the fixed values.
      * Uppercase ide_pm_* enums.
      * Fix/update comments.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: add device flags · 97100fc8
      Bartlomiej Zolnierkiewicz authored
      Add 'unsigned long dev_flags' to ide_drive_t and convert bitfields
      to IDE_DFLAG_* flags.
      While at it:
      - fixup some comments
      - remove needless g->flags zeroing from ide*_probe()
      There should be no functional changes caused by this patch.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    • Bartlomiej Zolnierkiewicz's avatar
      ide: fix IDE ACPI for slave device-only configurations · 1ea1031c
      Bartlomiej Zolnierkiewicz authored
      ACPI _GTM / _PS0 / _STM were not called if only slave device was present.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  9. 10 Oct, 2008 15 commits