27 Aug, 2019

1 commit

  • Use the dma_set_mask_and_coherent helper to set the DMA mask. Rely
    on the relatively recent change that setting a larger than required
    mask will never fail to avoid the need for the boilerplate 32-bit
    fallback code.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Christoph Hellwig
     

29 Jun, 2019

1 commit


24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 or at your option any
    later version this program is distributed in the hope that it will
    be useful but without any warranty without even the implied warranty
    of merchantability or fitness for a particular purpose see the gnu
    general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 44 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Richard Fontana
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190523091651.032047323@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

06 Jun, 2018

1 commit

  • Pull libata updates from Tejun Heo:

    - libata has always been limiting the maximum queue depth to 31, with
    one entry set aside mostly for historical reasons. This didn't use to
    make much difference but Jens found out that modern hard drives can
    actually perform measurably better with the extra one queue depth.
    Jens updated libata core so that it can make use of full 32 queue
    depth

    - Damien updated command retry logic in error handling so that it
    doesn't unnecessarily retry when upper layer (SCSI) is gonna handle
    them

    - A couple misc changes

    * 'for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
    sata_fsl: use the right type for tag bitshift
    ahci: enable full queue depth of 32
    libata: don't clamp queue depth to ATA_MAX_QUEUE - 1
    libata: add extra internal command
    sata_nv: set host can_queue count appropriately
    libata: remove assumption that ATA_MAX_QUEUE - 1 is the max
    libata: use ata_tag_internal() consistently
    libata: bump ->qc_active to a 64-bit type
    libata: convert core and drivers to ->hw_tag usage
    libata: introduce notion of separate hardware tags
    libata: Fix command retry decision
    libata: Honor RQF_QUIET flag
    libata: Make ata_dev_set_mode() less verbose
    libata: Fix ata_err_string()
    libata: Fix comment typo in ata_eh_analyze_tf()
    sata_nv: don't use block layer bounce buffer
    ata: hpt37x: Convert to use match_string() helper

    Linus Torvalds
     

12 May, 2018

1 commit


02 May, 2018

1 commit


08 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: Tejun Heo

    Quentin Lambert
     

25 Mar, 2015

1 commit

  • sata_sil24 for some reason pukes when tags are allocated round-robin
    which helps tag ordered controllers. To work around the issue,
    72dd299d5039 ("libata: allow sata_sil24 to opt-out of tag ordered
    submission") introduced ATA_FLAG_LOWTAG which tells libata tag
    allocation to do lowest-first.

    However, with the recent switch to blk-mq tag allocation, the liata
    tag allocation code path is no longer used and the workaround is now
    implemented in the block layer and selected by setting
    scsi_host_template->tag_alloc_policy to BLK_TAG_ALLOC_FIFO. See
    9269e23496dd ("libata: make sata_sil24 use fifo tag allocator").

    This leaves ATA_FLAG_LOWTAG withoout any actual user. Remove it.

    Signed-off-by: Tejun Heo
    Cc: Shaohua Li
    Cc: Dan Williams

    Tejun Heo
     

13 Feb, 2015

1 commit

  • Pull block driver changes from Jens Axboe:
    "This contains:

    - The 4k/partition fixes for brd from Boaz/Matthew.

    - A few xen front/back block fixes from David Vrabel and Roger Pau
    Monne.

    - Floppy changes from Takashi, cleaning the device file creation.

    - Switching libata to use the new blk-mq tagging policy, removing
    code (and a suboptimal implementation) from libata. This will
    throw you a merge conflict, since a bug in the original libata
    tagging code was fixed since this code was branched. Trivial.
    From Shaohua.

    - Conversion of loop to blk-mq, from Ming Lei.

    - Cleanup of the io_schedule() handling in bsg from Peter Zijlstra.
    He claims it improves on unreadable code, which will cost him a
    beer.

    - Maintainer update or NDB, now handled by Markus Pargmann.

    - NVMe:
    - Optimization from me that avoids a kmalloc/kfree per IO for
    smaller (t handle REQ_FUA explicitly
    block: loop: introduce lo_discard() and lo_req_flush()
    block: loop: say goodby to bio
    block: loop: improve performance via blk-mq

    Linus Torvalds
     

27 Jan, 2015

1 commit

  • libata starts using block tag now, we can use BLK_TAG_ALLOC_FIFO to
    solve the sata_sil24 tag bug.

    https://bugzilla.kernel.org/show_bug.cgi?id=87101

    Cc: Christoph Hellwig
    Signed-off-by: Shaohua Li
    Acked-by: Tejun Heo
    Acked-by: Dan Williams
    Signed-off-by: Jens Axboe

    Shaohua Li
     

19 Jan, 2015

1 commit

  • Ronny reports: https://bugzilla.kernel.org/show_bug.cgi?id=87101
    "Since commit 8a4aeec8d "libata/ahci: accommodate tag ordered
    controllers" the access to the harddisk on the first SATA-port is
    failing on its first access. The access to the harddisk on the
    second port is working normal.

    When reverting the above commit, access to both harddisks is working
    fine again."

    Maintain tag ordered submission as the default, but allow sata_sil24 to
    continue with the old behavior.

    Cc:
    Cc: Tejun Heo
    Reported-by: Ronny Hegewald
    Signed-off-by: Dan Williams
    Signed-off-by: Tejun Heo

    Dan Williams
     

22 Jul, 2014

1 commit


10 May, 2014

1 commit

  • This patch fixes host drivers to use CONFIG_PM_SLEEP instead of CONFIG_PM
    where applicable. Benefits of this change:

    * unused code is not being compiled in for CONFIG_PM=y, CONFIG_PM_SLEEP=n
    and CONFIG_PM_RUNTIME=y configurations

    * easier transition to use struct dev_pm_ops and SIMPLE_DEV_PM_OPS() in
    the future

    * more consistent code (there are host drivers which are using the correct
    CONFIG_PM_SLEEP checks already)

    The patch leaves the core libata code and ->port_[suspend,resume] support
    in sata_[inic162x,nv,sil24].c alone for now.

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Tejun Heo

    Bartlomiej Zolnierkiewicz
     

03 Jun, 2013

1 commit

  • Use the wrapper function for getting the driver data using pci_dev
    instead of using dev_get_drvdata() with &pdev->dev, so we can directly
    pass a struct pci_dev. This is a purely cosmetic change.

    Signed-off-by: Jingoo Han
    Signed-off-by: Tejun Heo

    Jingoo Han
     

29 Nov, 2012

1 commit


26 Jul, 2012

1 commit

  • This patch converts the drivers in drivers/ata/* to use module_pci_driver()
    macro which makes the code smaller and a bit simpler.

    Signed-off-by: Axel Lin
    Cc: Alan Cox
    Cc: Jeff Garzik
    Cc: Mikael Pettersson
    Cc: Mark Lord
    Cc: Jeremy Higdon
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Jeff Garzik

    Axel Lin
     

13 Jan, 2012

1 commit


08 Oct, 2011

1 commit

  • Reduce data by using const.

    $ size drivers/ata/sata_sil24.o*
    text data bss dec hex filename
    12764 614 2688 16066 3ec2 drivers/ata/sata_sil24.o.new
    12320 1058 2688 16066 3ec2 drivers/ata/sata_sil24.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     

24 Jul, 2011

3 commits

  • Use a single mechanism to show driver version.
    Reduces text a tiny bit too.

    Remove uses of static int printed_version
    Add and use ata_print_version(const struct device *, const char *ver)
    and ata_print_version_once.

    $ size drivers/ata/built-in.*
    text data bss dec hex filename
    544969 73893 116584 735446 b38d6 drivers/ata/built-in.allyesconfig.ata.o
    543870 73893 116592 734355 b34ad drivers/ata/built-in.allyesconfig.print_once.o
    141328 14689 4220 160237 271ed drivers/ata/built-in.defconfig.ata.o
    141212 14689 4220 160121 27179 drivers/ata/built-in.defconfig.print_once.o

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     
  • Saves text by removing nearly duplicated text format strings by
    creating ata__printk functions and printf extension %pV.

    ata defconfig size shrinks ~5% (~8KB), allyesconfig ~2.5% (~13KB)

    Format string duplication comes from:

    #define ata_link_printk(link, lv, fmt, args...) do { \
    if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \
    printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \
    (link)->pmp , ##args); \
    else \
    printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \
    } while(0)

    Coalesce long formats.

    $ size drivers/ata/built-in.*
    text data bss dec hex filename
    544969 73893 116584 735446 b38d6 drivers/ata/built-in.allyesconfig.ata.o
    558429 73893 117864 750186 b726a drivers/ata/built-in.allyesconfig.dev_level.o
    141328 14689 4220 160237 271ed drivers/ata/built-in.defconfig.ata.o
    149567 14689 4220 168476 2921c drivers/ata/built-in.defconfig.dev_level.o

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     
  • Saves a bit of text as the call takes fewer args.

    Coalesce a few formats.
    Convert a few bare printks to pr_cont.

    $ size drivers/ata/built-in.o*
    text data bss dec hex filename
    558429 73893 117864 750186 b726a drivers/ata/built-in.o.allyesconfig.new
    559574 73893 117888 751355 b76fb drivers/ata/built-in.o.allyesconfig.old
    149567 14689 4220 168476 2921c drivers/ata/built-in.o.defconfig.new
    149851 14689 4220 168760 29338 drivers/ata/built-in.o.defconfig.old

    Signed-off-by: Joe Perches
    Signed-off-by: Jeff Garzik

    Joe Perches
     

02 Mar, 2011

2 commits

  • All checks of ATA_FLAG_NO_LEGACY have been removed by the commits
    c791c30670ea61f19eec390124128bf278e854fe ([libata] minor PCI IDE probe
    fixes and cleanups) and f0d36efdc624beb3d9e29b9ab9e9537bf0f25d5b (libata:
    update libata core layer to use devres), so I think it's time to finally
    get rid of this flag...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • Commit 0d5ff566779f894ca9937231a181eb31e4adff0e (libata: convert to iomap)
    removed all checks of ATA_FLAG_MMIO but neglected to remove the flag itself.
    Do it now, at last...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     

22 Oct, 2010

1 commit


11 Jun, 2010

2 commits

  • The data in the cmd_block buffers may reach the main memory after the
    writel() to the device ports. This patch introduces two calls to wmb()
    to ensure the relative ordering.

    Signed-off-by: Catalin Marinas
    Tested-by: Colin Tuckley
    Cc: Tejun Heo
    Cc: Jeff Garzik
    Signed-off-by: Jeff Garzik

    Catalin Marinas
     
  • cb->atapi.cdb is an array of 16 u8 elements. The call too memset()
    would set the first part of the sge array to zero as well. It's not
    a packed struct.

    This one has been around for five years. I found it with Smatch. I
    think the reason no one has seen it before is because we normally call
    sil24_fill_sg() and that overwrites sge with proper information?

    Signed-off-by: Dan Carpenter
    Signed-off-by: Jeff Garzik

    Dan Carpenter
     

08 Jun, 2010

1 commit


18 May, 2010

1 commit

  • ATA_FLAG_DISABLED is only used by drivers which don't use
    ->error_handler framework and is largely broken. Its only meaningful
    function is to make irq handlers skip processing if the flag is set,
    which is largely useless and even harmful as it makes those ports more
    likely to cause IRQ storms.

    Kill ATA_FLAG_DISABLED and makes the callers disable attached devices
    instead. ata_port_probe() and ata_port_disable() which manipulate the
    flag are also killed.

    This simplifies condition check in IRQ handlers. While updating IRQ
    handlers, remove ap NULL check as libata guarantees consecutive port
    allocation (unoccupied ports are initialized with dummies) and
    long-obsolete ATA_QCFLAG_ACTIVE check (checked by ata_qc_from_tag()).

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

30 Mar, 2010

1 commit

  • …it 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.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    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
    file.

    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
    files.

    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
    necessary.

    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: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

03 Dec, 2009

1 commit


02 Sep, 2009

1 commit

  • The sil24 hardware has a built-in list of commands and associated protocols
    that gets used by default to decide how to handle a given command. However,
    if the command is not known to the controller then it presumably assumes it to
    be a non-data command which then causes protocol mismatch errors if the device
    ends up requesting data transfer. The new DATA SET MANAGEMENT - Trim command
    causes this issue since it's a DMA data-out command.

    Since we should always know best what protocol the command should be using,
    let's just set the override flag to inform the controller what protocol to use
    for all non-ATAPI commands with data transfer.

    Signed-off-by: Robert Hancock
    Tested-by: Mark Lord
    Signed-off-by: Jeff Garzik

    Robert Hancock
     

07 Apr, 2009

2 commits


25 Mar, 2009

1 commit


09 Jan, 2009

1 commit


28 Oct, 2008

1 commit

  • Due to request posting limitations, bandwidth of sil3132 is limited to
    around 120MB/s with the minimum pci-e payload size (128bytes) which is
    used by most consumer systems. However, write throughput can be
    slightly (~3%) increased by increasing the max read requeset size.
    Configure it to 4k which is the maximum supported. This optimization
    is also done by SIMG's windows driver.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

29 Sep, 2008

1 commit

  • Logically, SCR access ops should take @link; however, there was no
    compelling reason to convert all SCR access ops when adding @link
    abstraction as there's one-to-one mapping between a port and a non-PMP
    link. However, that assumption won't hold anymore with the scheduled
    addition of slave link.

    Make SCR access ops per-link.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

04 Jul, 2008

1 commit


20 May, 2008

1 commit

  • When 4140 PMP is attached to sil24, NCQ commands to fan out port 1 and
    2 (0 based) often stall if commands are in progress to other ports.
    I've tried a number of things but can't tell what's going on. It
    never happens w/ ahci and reportedly sata_mv which can issue NCQ
    commands to multiple devices simultaneously like sil24 does.

    Disable NCQ for devices behind 4140 PMP for the time being.

    Signed-off-by: Tejun Heo
    Cc: Mark Lord
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

18 Apr, 2008

1 commit

  • Currently, SATA softresets should do link onlineness check before
    actually performing SRST protocol but it doesn't really belong to
    softreset.

    This patch moves onlineness check in softreset to ata_eh_reset() and
    ata_eh_followup_srst_needed() to clean up code and help future sata_mv
    changes which need clear separation between SCR and TF accesses.

    sata_fsl is peculiar in that its softreset really isn't softreset but
    combination of hardreset and softreset. This patch adds dummy private
    ->prereset to keep the current behavior but the driver really should
    implement separate hard and soft resets and return -EAGAIN from
    hardreset if it should be follwed by softreset.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo