04 Oct, 2011

1 commit

  • Simon Kirby reported that on his RAID setup with idedisk underneath
    the box OOMs after a couple of days of runtime. Running with
    CONFIG_DEBUG_KMEMLEAK pointed to idedisk_prep_fn() which unconditionally
    allocates an ide_cmd struct. However, ide_requeue_and_plug() can be
    called more than once per request, either from the request issue or the
    IRQ handler path and do blk_peek_request() ends up in idedisk_prep_fn()
    repeatedly, allocating a struct ide_cmd everytime and "forgetting" the
    previous pointer.

    Make sure the code reuses the old allocated chunk.

    Reported-and-tested-by: Simon Kirby
    Cc: [ 39.x, 3.0.x ]
    Link: http://marc.info/?l=linux-kernel&m=131667641517919
    Link: http://lkml.kernel.org/r/20110922072643.GA27232@hostway.ca
    Signed-off-by: Borislav Petkov
    Signed-off-by: David S. Miller

    Borislav Petkov
     

25 Oct, 2010

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
    Update broken web addresses in arch directory.
    Update broken web addresses in the kernel.
    Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget
    Revert "Fix typo: configuation => configuration" partially
    ida: document IDA_BITMAP_LONGS calculation
    ext2: fix a typo on comment in ext2/inode.c
    drivers/scsi: Remove unnecessary casts of private_data
    drivers/s390: Remove unnecessary casts of private_data
    net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
    drivers/infiniband: Remove unnecessary casts of private_data
    drivers/gpu/drm: Remove unnecessary casts of private_data
    kernel/pm_qos_params.c: Remove unnecessary casts of private_data
    fs/ecryptfs: Remove unnecessary casts of private_data
    fs/seq_file.c: Remove unnecessary casts of private_data
    arm: uengine.c: remove C99 comments
    arm: scoop.c: remove C99 comments
    Fix typo configue => configure in comments
    Fix typo: configuation => configuration
    Fix typo interrest[ing|ed] => interest[ing|ed]
    Fix various typos of valid in comments
    ...

    Fix up trivial conflicts in:
    drivers/char/ipmi/ipmi_si_intf.c
    drivers/usb/gadget/rndis.c
    net/irda/irnet/irnet_ppp.c

    Linus Torvalds
     

10 Sep, 2010

1 commit

  • Barrier is deemed too heavy and will soon be replaced by FLUSH/FUA
    requests. Deprecate barrier. All REQ_HARDBARRIERs are failed with
    -EOPNOTSUPP and blk_queue_ordered() is replaced with simpler
    blk_queue_flush().

    blk_queue_flush() takes combinations of REQ_FLUSH and FUA. If a
    device has write cache and can flush it, it should set REQ_FLUSH. If
    the device can handle FUA writes, it should also set REQ_FUA.

    All blk_queue_ordered() users are converted.

    * ORDERED_DRAIN is mapped to 0 which is the default value.
    * ORDERED_DRAIN_FLUSH is mapped to REQ_FLUSH.
    * ORDERED_DRAIN_FLUSH_FUA is mapped to REQ_FLUSH | REQ_FUA.

    Signed-off-by: Tejun Heo
    Acked-by: Boaz Harrosh
    Cc: Christoph Hellwig
    Cc: Nick Piggin
    Cc: Michael S. Tsirkin
    Cc: Jeremy Fitzhardinge
    Cc: Chris Wright
    Cc: FUJITA Tomonori
    Cc: Geert Uytterhoeven
    Cc: David S. Miller
    Cc: Alasdair G Kergon
    Cc: Pierre Ossman
    Cc: Stefan Weinhuber
    Signed-off-by: Jens Axboe

    Tejun Heo
     

19 Aug, 2010

1 commit


08 Aug, 2010

3 commits


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
     

26 Feb, 2010

1 commit

  • The block layer calling convention is blk_queue_.
    blk_queue_max_sectors predates this practice, leading to some confusion.
    Rename the function to appropriately reflect that its intended use is to
    set max_hw_sectors.

    Also introduce a temporary wrapper for backwards compability. This can
    be removed after the merge window is closed.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

22 Jul, 2009

1 commit

  • I'm using ide on 2.6.30.1 with xfs filesystem. I noticed a kernel memory
    leak after writing lots of data, the kmalloc-96 slab cache keeps
    growing. It seems the struct ide_cmd kmalloced by idedisk_prepare_flush
    is never kfreed.

    Commit a09485df9cda49fbde2766c86eb18a9cae585162 ("ide: move request
    type specific code from ide_end_drive_cmd() to callers (v3)") and
    f505d49ffd25ed062e76ffd17568d3937fcd338c ("ide: fix barriers support")
    cause this regression, cmd->rq must now be set for ide_complete_cmd to
    honor the IDE_TFLAG_DYN flag.

    Signed-off-by: Maxime Bizon
    Acked-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Maxime Bizon
     

16 Jun, 2009

1 commit


13 Jun, 2009

1 commit

  • * 'for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (29 commits)
    ide: re-implement ide_pci_init_one() on top of ide_pci_init_two()
    ide: unexport ide_find_dma_mode()
    ide: fix PowerMac bootup oops
    ide: skip probe if there are no devices on the port (v2)
    sl82c105: add printk() logging facility
    ide-tape: fix proc warning
    ide: add IDE_DFLAG_NIEN_QUIRK device flag
    ide: respect quirk_drives[] list on all controllers
    hpt366: enable all quirks for devices on quirk_drives[] list
    hpt366: sync quirk_drives[] list with pdc202xx_{new,old}.c
    ide: remove superfluous SELECT_MASK() call from do_rw_taskfile()
    ide: remove superfluous SELECT_MASK() call from ide_driveid_update()
    icside: remove superfluous ->maskproc method
    ide-tape: fix IDE_AFLAG_* atomic accesses
    ide-tape: change IDE_AFLAG_IGNORE_DSC non-atomically
    pdc202xx_old: kill resetproc() method
    pdc202xx_old: don't call pdc202xx_reset() on IRQ timeout
    pdc202xx_old: use ide_dma_test_irq()
    ide: preserve Host Protected Area by default (v2)
    ide-gd: implement block device ->set_capacity method (v2)
    ...

    Linus Torvalds
     

07 Jun, 2009

3 commits

  • 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
     

23 May, 2009

1 commit

  • The recent move to accessor functions for querying queue limits
    missed an entry in ide-disk.c:

    drivers/ide/ide-disk.c: In function ‘ide_disk_setup’:
    drivers/ide/ide-disk.c:642: error: ‘struct request_queue’ has no member named ‘max_sectors’

    Fix it.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

18 May, 2009

1 commit


11 May, 2009

1 commit

  • ide doesn't manipulate request fields anymore and thus all hard and
    their soft equivalents are always equal. Convert all references to
    accessors.

    [ Impact: use pos and nr_sectors accessors ]

    Signed-off-by: Tejun Heo
    Acked-by: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Signed-off-by: Jens Axboe

    Tejun Heo
     

28 Apr, 2009

1 commit


19 Apr, 2009

1 commit


08 Apr, 2009

2 commits

  • Make 'struct ide_taskfile' cover only 8 register values and thus put two such
    fields ('tf' and 'hob') into 'struct ide_cmd', dropping unnecessary 'tf_array'
    field from it.

    This required changing the prototype of ide_get_lba_addr() and ide_tf_dump().

    Signed-off-by: Sergei Shtylyov
    [bart: fix setting of ATA_LBA bit for LBA48 commands in __ide_do_rw_disk()]
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Sergei Shtylyov
     
  • Replace IDE_TFLAG_{IN|OUT}_* flags meaning to the taskfile register validity on
    input/output by the IDE_VALID_* flags and introduce 4 symmetric 8-bit register
    validity indicator subfields, 'valid.{input/output}.{tf|hob}', into the 'struct
    ide_cmd' instead of using the 'tf_flags' field for that purpose (this field can
    then be turned from 32-bit into 8-bit one).

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

    Sergei Shtylyov
     

01 Apr, 2009

1 commit

  • Make use of ATA_ERR instead of hard-coded value in idedisk_set_max_address()
    and idedisk_read_native_max_address().

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

    Sergei Shtylyov
     

27 Mar, 2009

10 commits

  • * Pass number of bytes instead of sectors to ide_init_sg_cmd().

    * Pass number of bytes to process to ide_pio_sector() and rename
    it to ide_pio_bytes().

    * Rename ->nsect field to ->nbytes in struct ide_cmd and use
    ->nbytes, ->nleft and ->cursg_ofs to keep track of number of
    bytes instead of sectors.

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Set IDE_TFLAG_WRITE flag and ->rq also for ATA_CMD_PACKET
    commands.

    * Pass command to ->dma_setup method and update all its
    implementations accordingly.

    * Pass command instead of request to ide_build_sglist(),
    *_build_dmatable() and ide_map_sg().

    While at it:

    * Fix scc_dma_setup() documentation + use ATA_DMA_WR define.

    * Rename sgiioc4_build_dma_table() to sgiioc4_build_dmatable(),
    change return value type to 'int' and drop unused 'ddir'
    argument.

    * Do some minor cleanups in [tx4939]ide_dma_setup().

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add ide_rq_bytes() helper.

    * Add blk_noretry_request() quirk to ide_complete_rq() (currently only fs
    requests can be marked as "noretry" so there is no change in behavior).

    * Switch current ide_end_request() users to use ide_complete_rq().

    [ No need to check for rq->nr_sectors == 0 in {ide_dma,task_pio}_intr(),
    nsectors == 0 in cdrom_end_request() and err == 0 in ide_do_devset(). ]

    * Remove no longer needed ide_end_request().

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Move rq->errors quirk out from ide_end_request() to its call sites.

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add IDE_TFLAG_MULTI_PIO taskfile flag and set it for commands
    using multi-PIO protocol.

    * Use ata_tf_protocols enums instead of TASKFILE_* defines to
    denote command's protocol and then rename ->data_phase field
    to ->protocol.

    * Remove no longer needed includes.

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Move command related fields from ide_hwif_t to struct ide_cmd.

    * Make ide_init_sg_cmd() take command and sectors number as arguments.

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add IDE_TFLAG_FS taskfile flag and set it for REQ_TYPE_FS requests.

    * Convert ->{in,out}put_data methods to take command instead of request
    as an argument. Then convert pre_task_out_intr(), task_end_request(),
    task_error(), task_in_unexpected(), ide_pio_sector(), ide_pio_multi()
    and ide_pio_datablock() in similar way.

    * Rename task_end_request() to ide_finish_cmd().

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • While at it:
    - rename struct ide_task_s to struct ide_cmd
    - remove stale comments from idedisk_{read_native,set}_max_address()
    - drop unused 'cmd' argument from ide_{cmd,task}_ioctl()
    - drop unused 'task' argument from tx4939ide_tf_load_fixup()
    - rename ide_complete_task() to ide_complete_cmd()
    - use consistent naming for struct ide_cmd variables

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Handle completion of private driver requests explicitly
    for ide_floppy and ide_tape media in ide_kill_rq().

    * Remove no longer needed ->end_request method.

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Always use hwif->task->data_phase and remove ->data_phase
    field from ide_hwif_t.

    * Remove superfluous REQ_TYPE_ATA_TASKFILE check from
    ide_pio_datablock() while at it.

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

15 Jan, 2009

1 commit


07 Jan, 2009

1 commit


03 Nov, 2008

1 commit


24 Oct, 2008

1 commit


18 Oct, 2008

3 commits

  • * Add struct ide_disk_ops containing protocol specific methods.

    * Add 'struct ide_disk_ops *' to ide_drive_t.

    * Convert ide-{disk,floppy} drivers to use struct ide_disk_ops.

    * Merge ide-{disk,floppy} drivers into generic ide-gd driver.

    While at it:
    - ide_disk_init_capacity() -> ide_disk_get_capacity()

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • While at it:
    - IDEDISK_VERSION -> IDE_GD_VERSION
    - ide_cacheflush_p() -> ide_disk_flush()
    - init_idedisk_capacity() -> ide_disk_init_capacity()
    - idedisk_set_doorlock() -> ide_disk_set_doorlock()
    - idedisk_setup() -> ide_disk_setup()

    - ide_disk_capacity() -> ide_gd_capacity()
    - ide_disk_remove() -> ide_gd_remove()
    - ide_disk_probe() -> ide_gd_probe()
    - ide_disk_resume() -> ide_gd_resume()
    - ide_device_shutdown() -> ide_gd_shutdown()
    - idedisk_driver -> ide_gd_driver
    - idedisk_open() -> ide_gd_open()
    - idedisk_release() -> ide_gd_release()
    - idedisk_getgeo() -> ide_gd_getgeo()
    - idedisk_media_changed() -> ide_gd_media_changed()
    - idedisk_revalidate_disk() -> ide_gd_revalidate_disk()
    - idedisk_ops -> ide_gd_ops
    - idedisk_init() -> ide_gd_init()
    - idedisk_exit() -> ide_gd_exit()

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz