06 May, 2015

3 commits


07 Dec, 2013

1 commit

  • Replace direct inclusions of , and
    , which are incorrect, with
    inclusions and remove some inclusions of those files that aren't
    necessary.

    First of all, , and
    should not be included directly from any files that are built for
    CONFIG_ACPI unset, because that generally leads to build warnings about
    undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set,
    includes those files and for CONFIG_ACPI unset it
    provides stub ACPI symbols to be used in that case.

    Second, there are ordering dependencies between those files that always
    have to be met. Namely, it is required that be included
    prior to so that the acpi_pci_root declarations the
    latter depends on are always there. And which provides
    basic ACPICA type declarations should always be included prior to any other
    ACPI headers in CONFIG_ACPI builds. That also is taken care of including
    as appropriate.

    Signed-off-by: Lv Zheng
    Cc: Greg Kroah-Hartman
    Cc: Matthew Garrett
    Cc: Tony Luck
    Cc: "H. Peter Anvin"
    Acked-by: Bjorn Helgaas (drivers/pci stuff)
    Acked-by: Konrad Rzeszutek Wilk (Xen stuff)
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

17 Oct, 2013

1 commit


29 Mar, 2012

2 commits

  • …m/linux/kernel/git/dhowells/linux-asm_system

    Pull "Disintegrate and delete asm/system.h" from David Howells:
    "Here are a bunch of patches to disintegrate asm/system.h into a set of
    separate bits to relieve the problem of circular inclusion
    dependencies.

    I've built all the working defconfigs from all the arches that I can
    and made sure that they don't break.

    The reason for these patches is that I recently encountered a circular
    dependency problem that came about when I produced some patches to
    optimise get_order() by rewriting it to use ilog2().

    This uses bitops - and on the SH arch asm/bitops.h drags in
    asm-generic/get_order.h by a circuituous route involving asm/system.h.

    The main difficulty seems to be asm/system.h. It holds a number of
    low level bits with no/few dependencies that are commonly used (eg.
    memory barriers) and a number of bits with more dependencies that
    aren't used in many places (eg. switch_to()).

    These patches break asm/system.h up into the following core pieces:

    (1) asm/barrier.h

    Move memory barriers here. This already done for MIPS and Alpha.

    (2) asm/switch_to.h

    Move switch_to() and related stuff here.

    (3) asm/exec.h

    Move arch_align_stack() here. Other process execution related bits
    could perhaps go here from asm/processor.h.

    (4) asm/cmpxchg.h

    Move xchg() and cmpxchg() here as they're full word atomic ops and
    frequently used by atomic_xchg() and atomic_cmpxchg().

    (5) asm/bug.h

    Move die() and related bits.

    (6) asm/auxvec.h

    Move AT_VECTOR_SIZE_ARCH here.

    Other arch headers are created as needed on a per-arch basis."

    Fixed up some conflicts from other header file cleanups and moving code
    around that has happened in the meantime, so David's testing is somewhat
    weakened by that. We'll find out anything that got broken and fix it..

    * tag 'split-asm_system_h-for-linus-20120328' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-asm_system: (38 commits)
    Delete all instances of asm/system.h
    Remove all #inclusions of asm/system.h
    Add #includes needed to permit the removal of asm/system.h
    Move all declarations of free_initmem() to linux/mm.h
    Disintegrate asm/system.h for OpenRISC
    Split arch_align_stack() out from asm-generic/system.h
    Split the switch_to() wrapper out of asm-generic/system.h
    Move the asm-generic/system.h xchg() implementation to asm-generic/cmpxchg.h
    Create asm-generic/barrier.h
    Make asm-generic/cmpxchg.h #include asm-generic/cmpxchg-local.h
    Disintegrate asm/system.h for Xtensa
    Disintegrate asm/system.h for Unicore32 [based on ver #3, changed by gxt]
    Disintegrate asm/system.h for Tile
    Disintegrate asm/system.h for Sparc
    Disintegrate asm/system.h for SH
    Disintegrate asm/system.h for Score
    Disintegrate asm/system.h for S390
    Disintegrate asm/system.h for PowerPC
    Disintegrate asm/system.h for PA-RISC
    Disintegrate asm/system.h for MN10300
    ...

    Linus Torvalds
     
  • Remove all #inclusions of asm/system.h preparatory to splitting and killing
    it. Performed with the following command:

    perl -p -i -e 's!^#\s*include\s*.*\n!!' `grep -Irl '^#\s*include\s*' *`

    Signed-off-by: David Howells

    David Howells
     

16 Mar, 2012

1 commit

  • The header includes a lot of stuff, and
    it in turn gets a lot of use just for the basic "struct device"
    which appears so often.

    Clean up the users as follows:

    1) For those headers only needing "struct device" as a pointer
    in fcn args, replace the include with exactly that.

    2) For headers not really using anything from device.h, simply
    delete the include altogether.

    3) For headers relying on getting device.h implicitly before
    being included themselves, now explicitly include device.h

    4) For files in which doing #1 or #2 uncovers an implicit
    dependency on some other header, fix by explicitly adding
    the required header(s).

    Any C files that were implicitly relying on device.h to be
    present have already been dealt with in advance.

    Total removals from #1 and #2: 51. Total additions coming
    from #3: 9. Total other implicit dependencies from #4: 7.

    As of 3.3-rc1, there were 110, so a net removal of 42 gives
    about a 38% reduction in device.h presence in include/*

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

04 Jan, 2012

1 commit


09 May, 2011

1 commit


17 Jun, 2010

2 commits


24 May, 2010

1 commit


22 May, 2010

1 commit

  • bdops->set_capacity() is unnecessarily generic. All that's required
    is a simple one way notification to lower level driver telling it to
    try to unlock native capacity. There's no reason to pass in target
    capacity or return the new capacity. The former is always the
    inherent native capacity and the latter can be handled via the usual
    device resize / revalidation path. In fact, the current API is always
    used that way.

    Replace ->set_capacity() with ->unlock_native_capacity() which take
    only @disk and doesn't return anything. IDE which is the only current
    user of the API is converted accordingly.

    Signed-off-by: Tejun Heo
    Cc: Ben Hutchings
    Cc: Bartlomiej Zolnierkiewicz
    Acked-by: David S. Miller
    Signed-off-by: Jens Axboe

    Tejun Heo
     

15 Apr, 2010

1 commit

  • Fix typo in the comment to the 'dma_mode' field of the 'struct ide_drive_s'
    introduced by the commit 3fccaa192b9501e79a57e02e62b6bf420d2b461e (ide: add
    drive->dma_mode field).

    Whilt at it, convert spaces to a tab in the declaration of the neighbouring
    'dn' field...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: David S. Miller

    Sergei Shtylyov
     

01 Apr, 2010

1 commit

  • I noticed that my KVM virtual machines were experiencing IDE
    issues resulting in processes stuck on waiting for buffers to
    complete.

    The root cause is of course race conditions in the ancient qemu
    backend that I'm using. However, the fact that the guest isn't
    recovering is a bug.

    I've tracked it down to the change made last year to dequeue
    requests at the start rather than at the end in the IDE layer.

    commit 8f6205cd572fece673da0255d74843680f67f879
    Author: Tejun Heo
    Date: Fri May 8 11:53:59 2009 +0900

    ide: dequeue in-flight request

    The problem is that the function ide_dma_timeout_retry does not
    requeue the current request, causing one request to be lost for
    each DMA timeout.

    This patch fixes this by requeueing the request.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

19 Jan, 2010

5 commits


03 Dec, 2009

1 commit


02 Sep, 2009

1 commit

  • ->read_proc, ->write_proc are going away, ->proc_fops should be used instead.

    The only tricky place is IDENTIFY handling: if for some reason
    taskfile_lib_get_identify() fails, buffer _is_ changed and at least
    first byte is overwritten. Emulate old behaviour with returning
    that first byte to userspace and reporting length=1 despite overall -E.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: David S. Miller

    Alexey Dobriyan
     

08 Aug, 2009

2 commits

  • * Make cmd->tf_flags field 'u16' and add IDE_TFLAG_SET_XFER taskfile flag.

    * Update ide_finish_cmd() to set xfer / re-read id if the new flag is set.

    * Convert set_xfer_rate() (write handler for /proc/ide/hd?/current_speed)
    and ide_cmd_ioctl() (HDIO_DRIVE_CMD ioctl handler) to use the new flag.

    * Remove no longer needed disable_irq_nosync() + enable_irq() from
    ide_config_drive_speed().

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Bartlomiej Zolnierkiewicz
     
  • * Un-static __ide_wait_stat().

    * Allow ide_dev_read_id() helper to be called from the IRQ context by
    adding irq_ctx flag and using mdelay()/__ide_wait_stat() when needed.

    * Switch ide_driveid_update() to set irq_ctx flag.

    This change is needed for the consecutive patch which fixes races in
    handling of user-space SET XFER commands but for improved bisectability
    and clarity it is better to do it in a separate patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Bartlomiej Zolnierkiewicz
     

30 Jun, 2009

1 commit

  • commit 2f0d0fd2a605666d38e290c5c0d2907484352dc4 ("ide-acpi: cleanup
    do_drive_get_GTF()") didn't account for the lack of hwif->acpidata
    check in generic_ide_suspend() [ indirect user of do_drive_get_GTF()
    through ide_acpi_exec_tfs() ] resulting in broken resume when ACPI
    support is enabled but ACPI data is unavailable.

    Fix it by adding ide_port_acpi() helper for checking if port needs
    ACPI handling and cleaning generic_ide_{suspend,resume}() to use it
    instead of hiding hwif->acpidata and ide_noacpi checks in IDE ACPI
    helpers (this should help in preventing similar bugs in the future).

    While at it:
    - kill superfluous debugging printks in ide_acpi_{get,push}_timing()

    Reported-and-tested-by: Etienne Basset
    Also-reported-and-tested-by: Jeff Chua
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Bartlomiej Zolnierkiewicz
     

26 Jun, 2009

1 commit

  • * Use blk_rq_bytes() instead of obsolete ide_rq_bytes() in ide_kill_rq()
    and ide_floppy_do_request() for failed requests.
    [ bugfix part ]

    * Use blk_rq_bytes() instead of obsolete ide_rq_bytes() in ide_do_devset()
    and ide_complete_drive_reset(). Then remove ide_rq_bytes().
    [ cleanup part ]

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Bartlomiej Zolnierkiewicz
     

24 Jun, 2009

1 commit

  • There are some broken devices that report multiple DMA xfer modes
    enabled at once (ATA spec doesn't allow it) but otherwise work fine
    with DMA so just delete ide_id_dma_bug().

    [ As discovered by detective work by Frans and Bart, due to how
    handling of the ID block was handled before commit c419993
    ("ide-iops: only clear DMA words on setting DMA mode") this
    check was always seeing zeros in the fields or other similar
    garbage. Therefore this check wasn't actually checking anything.
    Now that the tests actually check the real bits, all we see are
    devices that trigger the check yet work perfectly fine, therefore
    killing this useless check is the best thing to do. -DaveM ]

    Reported-by: Frans Pop
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Bartlomiej Zolnierkiewicz
     

16 Jun, 2009

4 commits

  • Change ide_drive_t 'drive_data' field from 'unsigned int' type to 'void *'
    type, allowing a wider range of values/types to be stored in this field.

    Added 'ide_get_drivedata' and 'ide_set_drivedata' helpers to get and set
    the 'drive_data' field.

    Fixed all host drivers to maintain coherency with the change in the
    'drive_data' field type.

    Signed-off-by: Joao Ramos
    [bart: fix qd65xx build, cast to 'unsigned long', minor Coding Style fixups]
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Joao Ramos
     
  • Move the ack_intr() method into 'struct ide_port_ops', also renaming it to
    test_irq() while at it...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Sergei Shtylyov
     
  • * Add 'unsigned long port_flags' field to ide_hwif_t.

    * Add IDE_PFLAG_PROBING port flag and keep it set during probing.

    * Fix ide_pio_need_iordy() to not enable IORDY at a probe time
    (IORDY may lead to controller lock up on certain controllers
    if the port is not occupied).

    Loosely based on the recent libata's fix by Tejun, thanks to Alan
    for the hint that IDE may also need it.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Add ide_pio_need_iordy() helper and convert host drivers to use it.

    This fixes it8172, it8213, pdc202xx_old, piix, slc90e66 and siimage
    host drivers to handle IORDY correctly.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

13 Jun, 2009

1 commit


07 Jun, 2009

5 commits

  • Add IDE_DFLAG_NIEN_QUIRK device flag and use it instead of
    drive->quirk_list.

    There should be no functional changes caused by this patch.

    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add ide_check_nien_quirk_list() helper to the core code
    and then use it in ide_port_tune_devices().

    * Remove no longer needed ->quirkproc methods from hpt366.c
    and pdc202xx_{new,old}.c.

    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Bartlomiej Zolnierkiewicz
     
  • 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).

    v2:
    Fix ->resume HPA support.

    While at it:
    - remove stale "idebus=" entry from Documentation/kernel-parameters.txt

    Cc: Robert Hancock
    Cc: Frans Pop
    Cc: "Andries E. Brouwer"
    Cc: Al Viro
    Acked-by: Sergei Shtylyov
    [patch description was based on input from Alan Cox and Frans Pop]
    Emphatically-Acked-by: Alan Cox
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Use ->probed_capacity to store native device capacity for ATA disks.

    * Add ->set_capacity method to struct ide_disk_ops.

    * Implement disk device ->set_capacity method for ATA disks.

    * Implement block device ->set_capacity method.

    v2:
    * Check if LBA and HPA are supported in ide_disk_set_capacity().

    * According to the spec the SET MAX ADDRESS command shall be
    immediately preceded by a READ NATIVE MAX ADDRESS command.

    * Add ide_disk_hpa_{get_native,set}_capacity() helpers.

    Together with the previous patch adding ->set_capacity block device
    method this allows automatic disabling of Host Protected Area (HPA)
    if any partitions overlapping HPA are detected.

    Cc: Robert Hancock
    Cc: Frans Pop
    Cc: "Andries E. Brouwer"
    Cc: Al Viro
    Emphatically-Acked-by: Alan Cox
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

22 May, 2009

2 commits