18 Apr, 2015

1 commit

  • Replace occurences of the pci api by appropriate call to the dma api.

    A simplified version of the semantic patch that finds this problem is as
    follows: (http://coccinelle.lip6.fr)

    @deprecated@
    idexpression id;
    position p;
    @@

    (
    pci_dma_supported@p ( id, ...)
    |
    pci_alloc_consistent@p ( id, ...)
    )

    @bad1@
    idexpression id;
    position deprecated.p;
    @@
    ...when != &id->dev
    when != pci_get_drvdata ( id )
    when != pci_enable_device ( id )
    (
    pci_dma_supported@p ( id, ...)
    |
    pci_alloc_consistent@p ( id, ...)
    )

    @depends on !bad1@
    idexpression id;
    expression direction;
    position deprecated.p;
    @@

    (
    - pci_dma_supported@p ( id,
    + dma_supported ( &id->dev,
    ...
    + , GFP_ATOMIC
    )
    |
    - pci_alloc_consistent@p ( id,
    + dma_alloc_coherent ( &id->dev,
    ...
    + , GFP_ATOMIC
    )
    )

    Signed-off-by: Quentin Lambert
    Signed-off-by: David S. Miller

    Quentin Lambert
     

01 Nov, 2011

1 commit


10 Jun, 2009

1 commit


18 May, 2009

3 commits

  • Remove hw_regs_t typedef and rename struct hw_regs_s to struct ide_hw.

    There should be no functional changes caused by this patch.

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

    Bartlomiej Zolnierkiewicz
     
  • Pass number of ports to ide_host_{alloc,add}() and then update
    all users accordingly.

    v2:
    - drop no longer needed NULL initializers in buddha.c, cmd640.c and gayle.c
    (noticed by Sergei)

    There should be no functional changes caused by this patch.

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

    Bartlomiej Zolnierkiewicz
     
  • * Convert host drivers that still use hw_regs_t's chipset field to use
    the one in struct ide_port_info instead.

    * Move special handling of ide_pci chipset type from ide_hw_configure()
    to ide_init_port().

    * Remove chipset field from hw_regs_t.

    While at it:
    - remove stale comment in delkin_cb.c

    There should be no functional changes caused by this patch.

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

    Bartlomiej Zolnierkiewicz
     

07 Apr, 2009

1 commit


27 Mar, 2009

1 commit

  • * Add ->irq_flags field to struct ide_port_info and struct ide_host.

    * Update host drivers and IDE PCI code to use ->irq_flags field.

    * Convert init_irq() and ide_intr() to use host->irq_flags.

    This fixes handling of shared IRQs for non-PCI hosts
    and removes ugly ifdeffery from core IDE code.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

25 Mar, 2009

5 commits


07 Jan, 2009

3 commits


11 Oct, 2008

1 commit

  • * Keep pointer to ->init_chipset method also in
    struct ide_host and set it in ide_host_alloc_all().

    * Add ide_pci_suspend() and ide_pci_resume() helpers
    (default ->suspend and ->resume implementations).

    * ->init_chipset can no longer be marked __devinit.

    * Add proper PCI PM support to IDE PCI host drivers
    (rz1000.c and tc86c001.c are skipped for now since
    they need to be converted from using ->init_hwif
    to use ->init_chipset instead).

    v2:
    * Cleanup CONFIG_PM #ifdef-s per akpm's suggestion.

    Cc: Andrew Morton
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

25 Jul, 2008

8 commits


24 Jul, 2008

7 commits

  • Add ide_host_add() helper which does ide_host_alloc()+ide_host_register(),
    then convert ide_setup_pci_device[s](), ide_legacy_device_add() and some
    host drivers to use it.

    While at it:

    * Fix ide_setup_pci_device[s](), ide_arm.c, gayle.c, ide-4drives.c,
    macide.c, q40ide.c, cmd640.c and cs5520.c to return correct error value.

    * -ENOENT -> -ENOMEM in rapide.c, ide-h8300.c, ide-generic.c, au1xxx-ide.c
    and pmac.c

    * -ENODEV -> -ENOMEM in palm_bk3710.c, ide_platform.c and delkin_cb.c

    * -1 -> -ENOMEM in ide-pnp.c

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add struct ide_host which keeps pointers to host's ports.

    * Add ide_host_alloc[_all]() and ide_host_remove() helpers.

    * Pass 'struct ide_host *host' instead of 'u8 *idx' to
    ide_device_add[_all]() and rename it to ide_host_register[_all]().

    * Convert host drivers and core code to use struct ide_host.

    * Remove no longer needed ide_find_port().

    * Make ide_find_port_slot() static.

    * Unexport ide_unregister().

    v2:
    * Add missing 'struct ide_host *host' to macide.c.

    v3:
    * Fix build problem in pmac.c (s/ide_alloc_host/ide_host_alloc/)
    (Noticed by Stephen Rothwell).

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add struct ide_tp_ops for transport methods.

    * Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info
    and ide_hwif_t.

    * Set the default hwif->tp_ops in ide_init_port_data().

    * Set host driver specific hwif->tp_ops in ide_init_port().

    * Export ide_exec_command(), ide_read_status(), ide_read_altstatus(),
    ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}()
    and ata_{in,out}put_data().

    * Convert host drivers and core code to use struct ide_tp_ops.

    * Remove no longer needed default_hwif_transport().

    * Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops.

    While at it:

    * Use struct ide_port_info in falconide.c and q40ide.c.

    * Rename ata_{in,out}put_data() to ide_{in,out}put_data().

    v2:

    * Fix missing convertion in ns87415.c.

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Factor out simplex handling from ide_pci_dma_base() to
    ide_pci_check_simplex().

    * Set hwif->dma_base early in ->init_dma method / ide_hwif_setup_dma()
    and reset it in ide_init_port() if DMA initialization fails.

    * Use ->read_sff_dma_status instead of ->INB in ide_pci_dma_base().

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Export sff_dma_ops and then remove ide_setup_dma().

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add 'hw_regs_t **hws' argument to ide_device_add[_all]() and convert
    host drivers + ide_legacy_init_one() + ide_setup_pci_device[s]() to use
    it instead of calling ide_init_port_hw() directly.

    [ However if host has > 1 port we must still set hwif->chipset to hint
    consecutive ide_find_port() call that the previous slot is occupied. ]

    * Unexport ide_init_port_hw().

    v2:
    * Use defines instead of hard-coded values in buddha.c, gayle.c and q40ide.c.
    (Suggested by Geert Uytterhoeven)

    * Better patch description.

    v3:
    * Fix build problem in ide-cs.c. (Noticed by Stephen Rothwell)

    There should be no functional changes caused by this patch.

    Cc: Geert Uytterhoeven
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Move ide_pci_setup_ports() call out from do_ide_setup_pci_device()
    to ide_setup_pci_device[s]().

    * Drop no longer needed idx argument from do_ide_setup_pci_device().

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

17 Jul, 2008

4 commits


16 Jul, 2008

1 commit


27 Apr, 2008

3 commits

  • * Export ide_dma_exec_cmd() and __ide_dma_test_irq().

    * Constify struct ide_dma_ops.

    * Always set hwif->dma_ops to &sff_dma_ops in ide_setup_dma()
    (it is later overriden by ide_init_port() if needed) and drop
    'const struct ide_port_info *d' argument.

    While at it:

    * Rename __ide_dma_test_irq() to ide_dma_test_irq().

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

    Bartlomiej Zolnierkiewicz
     
  • Add struct ide_dma_ops and convert core code + drivers to use it.

    While at it:

    * Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods.

    * Drop "ide_" "infixes" from DMA methods.

    * au1xxx-ide.c:
    - use auide_dma_{test_irq,end}() directly in auide_dma_timeout()

    * pdc202xx_old.c:
    - drop "old_" "infixes" from DMA methods

    * siimage.c:
    - add siimage_dma_test_irq() helper
    - print SATA warning in siimage_init_one()

    * Remove no longer needed ->init_hwif implementations.

    v2:
    * Changes based on review from Sergei:
    - s/siimage_ide_dma_test_irq/siimage_dma_test_irq/
    - s/drive->hwif/hwif/ in idefloppy_pc_intr().
    - fix patch description w.r.t. au1xxx-ide changes
    - fix au1xxx-ide build
    - fix naming for cmd64*_dma_ops
    - drop "ide_" and "old_" infixes
    - s/hpt3xxx_dma_ops/hpt37x_dma_ops/
    - s/hpt370x_dma_ops/hpt370_dma_ops/
    - use correct DMA ops for HPT302/N, HPT371/N and HPT374
    - s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/

    v3:
    * Two bugs slipped in v2 (noticed by Sergei):
    - use correct DMA ops for HPT374 (for real this time)
    - handle HPT370/HPT370A properly

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

    Bartlomiej Zolnierkiewicz
     
  • * Make ide_hwif_setup_dma() return an error value.

    * Pass 'const struct ide_port_info *d' instead of 'unsigned long dmabase'
    to ->init_dma method and make it return an error value.

    * Rename ide_get_or_set_dma_base() to ide_pci_dma_base(),
    change ordering of its arguments and then export it.

    * Export ide_pci_set_master().

    * Do complete DMA setup inside ->init_dma method and update ->init_dma
    users accordingly.

    * Sanitize code for DMA setup in ide_init_port().

    v2:
    * Fix for CONFIG_BLK_DEV_IDEDMA_PCI=n configs
    (from Jiri Slaby ):

    Fix following compiler warning by returning EINVAL:

    In file included from ANYTHING-INCLUDING-IDE.H:45:
    include/linux/ide.h: In function ‘ide_hwif_setup_dma’:
    include/linux/ide.h:1022: warning: no return statement in function returning non-void

    Cc: Jiri Slaby
    Cc: Andrew Morton
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz