01 Nov, 2011

1 commit


31 Mar, 2011

1 commit


09 Aug, 2010

1 commit

  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David S. Miller

    Julia Lawall
     

07 Apr, 2010

1 commit

  • When ide taskfile access is being used (for example with hdparm --security
    commands) and cfq scheduler is selected, the scheduler crashes on BUG in
    cfq_put_request.

    The reason is that the cfq scheduler is tracking counts of read and write
    requests separately; the ide-taskfile subsystem allocates a read request and
    then flips the flag to make it a write request. The counters in cfq will
    mismatch.

    This patch changes ide-taskfile to allocate the READ or WRITE request as
    required and don't change the flag later.

    Signed-off-by: Mikulas Patocka
    Signed-off-by: David S. Miller

    Mikulas Patocka
     

08 Aug, 2009

4 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
     
  • Fix trivial style problems:

    WARNING: Use #include instead of
    WARNING: space prohibited between function name and open parenthesis '('
    WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable
    ERROR: do not use C99 // comments X 2
    ERROR: trailing statements should be on next line
    ERROR: trailing whitespace
    ERROR: switch and case should be at the same indent
    WARNING: line over 80 characters

    total: 5 errors, 4 warnings

    Also removed dead code

    Also used pr_err() to avoid line breaks

    Signed-off-by: Jaswinder Singh Rajput
    Acked-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Jaswinder Singh Rajput
     
  • GCC can't see that flags is only set and used when PageHighmem() is
    true.

    Inspired by a patch from Jean Delvare.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • PageHighMem() isn't cheap so avoid calling it twice on the same page.

    Signed-off-by: Jean Delvare
    Acked-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Jean Delvare
     

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

1 commit


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

  • Impact: rq->buffer usage cleanup

    ide_raw_taskfile() directly uses rq->buffer to carry pointer to the
    data buffer. This complicates both block interface and ide backend
    request handling. Use blk_rq_map_kern() instead and drop special
    handling for REQ_TYPE_ATA_TASKFILE from ide_map_sg().

    Note that REQ_RW setting is moved upwards as blk_rq_map_kern() uses it
    to initialize bio rw flag.

    Signed-off-by: Tejun Heo
    Cc: Jens Axboe

    Tejun Heo
     

19 Apr, 2009

1 commit

  • Impact: rq->buffer usage cleanup

    ide_raw_taskfile() directly uses rq->buffer to carry pointer to the
    data buffer. This complicates both block interface and ide backend
    request handling. Use blk_rq_map_kern() instead and drop special
    handling for REQ_TYPE_ATA_TASKFILE from ide_map_sg().

    Note that REQ_RW setting is moved upwards as blk_rq_map_kern() uses it
    to initialize bio rw flag.

    Signed-off-by: Tejun Heo
    Cc: Jens Axboe

    Tejun Heo
     

08 Apr, 2009

5 commits

  • Simplify tf_read() method, making it deal only with 'struct ide_taskfile' and
    the validity flags that the upper layer passes, and factoring out the code that
    deals with the high order bytes into ide_tf_readback() to be called from the
    only two functions interested, ide_complete_cmd() and ide_dump_sector().

    This should stop the needless code duplication in this method and so make
    it about twice smaller than it was; along with simplifying the setup for
    the method call, this should save both time and space...

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

    Sergei Shtylyov
     
  • Simplify tf_load() method, making it deal only with 'struct ide_taskfile' and
    the validity flags that the upper layer passes, and moving the code that deals
    with the high order bytes into the only function interested, do_rw_taskfile().

    This should stop the needless code duplication in this method and so make
    it about twice smaller than it was; along with simplifying the setup for the
    method call, this should save both time and space...

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

    Sergei Shtylyov
     
  • Move device register masking (and setting drive->select) out of tf_load() method
    and into the only function that needs to use this code, do_rw_taskfile()...

    Signed-off-by: Sergei Shtylyov
    [bart: fix whitespace error]
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Sergei Shtylyov
     
  • 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

6 commits


27 Mar, 2009

15 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
     
  • * Pass command structure to ide_execute_command() and skip
    __ide_set_handler() for ATAPI protocols on non-DRQ devices.

    * Convert ide_issue_pc() to always use ide_execute_command()
    and remove no longer needed ide_execute_pkt_cmd().

    v2:
    * Fix for non-DRQ devices (based on report from Borislav).

    There should be no functional changes caused by this patch.

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

    Bartlomiej Zolnierkiewicz
     
  • * Rename dma_timer_expiry() to ide_dma_sff_timer_expiry() and export it.

    * Add ->dma_timer_expiry method and use it to set hwif->expiry for
    ATA_PROT_DMA protocol in do_rw_taskfile().

    * Initialize ->dma_timer_expiry to ide_dma_sff_timer_expiry() for SFF hosts.

    * Move setting hwif->expiry from ide_execute_command() to its users and drop
    'expiry' argument.

    * Use ide_execute_command() instead of ->dma_exec_cmd in do_rw_taskfile().

    * Remove ->dma_exec_cmd method and its implementations.

    * Unexport ide_execute_command() and ide_dma_intr().

    v2:
    * Fix CONFIG_BLK_DEV_IDEDMA=n build (noticed by Randy Dunlap).

    * Fix *dma_expiry naming (suggested by Sergei Shtylyov).

    There should be no functional changes caused by this patch.

    Cc: Randy Dunlap
    Cc: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Set hwif->expiry prior to calling [__]ide_set_handler()
    and drop 'expiry' argument.

    * Set hwif->expiry to NULL in ide_{timer_expiry,intr}()
    and remove 'hwif->expiry = NULL' assignments.

    There should be no functional changes caused by this patch.

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

    Bartlomiej Zolnierkiewicz
     
  • * Pass command to ide_issue_pc() and update ->do_request methods
    in ide-{cd,floppy,tape}.c accordingly.

    * Convert ide_pktcmd_tf_load() to ide_init_packet_cmd() which
    just initializes command structure and use do_rw_taskfile()
    to load ATA_CMD_PACKET commands.

    While at it:

    * Rename ide{floppy,tape}_issue_pc() to ide_{floppy,tape}_issue_pc().

    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
     
  • There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Set rq->errors at ide_complete_rq() call sites and then pass
    error value to ide_complete_rq().

    [ Some rq->errors assignments look really wrong but this patch
    leaves them alone to not introduce too many changes at once. ]

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Move ide_end_request() call out from ide_finish_cmd() to its users.

    * Use ide_finish_cmd() in task_no_data_intr().

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Fixup ->tf_flags in ide_do_park_unpark() to match their current use.

    * Use ide_complete_cmd() for REQ_UNPARK_HEADS.

    While at it:

    * No need to read Error register for PM requests in task_no_data_intr().

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Move handling of head unload commands from task_no_data_intr()
    to ide_complete_cmd() and then use ide_complete_cmd() also for
    head unload commands.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Move ide_error() call from task_error() to task_pio_intr()
    (the only user).

    * Drop no longer used arguments from task_error().

    * Rename task_error() to ide_error_cmd().

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

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

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • task_in_unexpected() is only used by task_pio_intr() so inline it there.

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz