30 Sep, 2016

1 commit

  • This reverts commit 640847298e2b7f19 ("ahci: qoriq: Disable NCQ
    on ls2080a SoC")

    The erratum has been fixed in ls2080a v2.0 and later soc.
    In reality, customer will not get any ls2080a v1.0 soc. Neither apply
    to any products. So reverting this commit won't create any side effect.

    Blacklisting v2.0 could also be a option, but that needs to check the
    soc version which is not suitable in the driver.

    Signed-off-by: Tang Yuantian
    Signed-off-by: Tejun Heo

    Tang Yuantian
     

22 Sep, 2016

2 commits


21 Sep, 2016

1 commit


10 Sep, 2016

1 commit


07 Sep, 2016

2 commits

  • Use the new pci_alloc_irq_vectors API to allocate MSI-X and MSI vectors.
    The big advantage over the old code is that we can use the same API for
    MSI and MSI-X, and that we don't need to store the MSI-X vector mapping
    in driver-private data structures.

    This first conversion keeps the probe order as-is: MSI-X multi vector,
    MSI multi vector, MSI single vector, MSI-X single vector and last a
    single least legacy interrupt line. There is one small change of
    behavior: we now check the "MSI Revert to Single Message" flag for
    MSI-X in addition to MSI.

    Because the API to find the Linux IRQ number for a MSI/MSI-X vector
    is PCI specific, but libahaci is bus-agnostic I had to a
    get_irq_vector function pointer to struct ahci_host_priv. The
    alternative would be to move the multi-vector case of ahci_host_activate
    to ahci.c and just call ata_host_activate directly from the others
    users of ahci_host_activate.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Tejun Heo

    Christoph Hellwig
     
  • Tejun Heo
     

30 Aug, 2016

1 commit

  • Ninja32 needs to set some flags to indicate it does 32bit IO. However it currently assigns this which
    loses the initializing flag and causes a warning spew. Fix it to use a logical or as is intended.

    Signed-off-by: Alan Cox
    Tested-by: Ellmar Stelnberger
    Signed-off-by: Tejun Heo

    Alan Cox
     

25 Aug, 2016

4 commits

  • Use non DMA write log when ATA_DFLAG_PIO is set.

    Signed-off-by: Shaun Tancheff
    Reviewed-by: Hannes Reinecke
    Acked-by: Tejun Heo

    Shaun Tancheff
     
  • Correct handling of devices with sector_size other that 512 bytes.

    In the case of a 4Kn device sector_size it is possible to describe a much
    larger DSM Trim than the current fixed default of 512 bytes.

    This patch assumes the minimum descriptor is sector_size and fills out
    the descriptor accordingly.

    The ACS-2 specification is quite clear that the DSM command payload is
    sized as number of 512 byte transfers so a 4Kn device will operate
    correctly without this patch.

    Signed-off-by: Shaun Tancheff
    Acked-by: Tejun Heo

    Shaun Tancheff
     
  • SATA drives may support write same via SCT. This is useful
    for setting the drive contents to a specific pattern (0's).

    Translate a SCSI WRITE SAME 16 command to be either a DSM TRIM
    command or an SCT Write Same command.

    Based on the UNMAP flag:
    - When set translate to DSM TRIM
    - When not set translate to SCT Write Same

    Signed-off-by: Shaun Tancheff
    Reviewed-by: Hannes Reinecke
    Acked-by: Tejun Heo

    Shaun Tancheff
     
  • Safely overwriting the attached page to ATA format from the SCSI formatted
    variant.

    Signed-off-by: Shaun Tancheff
    Reviewed-by: Hannes Reinecke
    Acked-by: Tejun Heo

    Shaun Tancheff
     

12 Aug, 2016

2 commits


11 Aug, 2016

1 commit


10 Aug, 2016

4 commits

  • By default the SATA IP on the qoriq SoCs does not generating
    coherent/snoopable transactions. This patch enable it in the
    sata axicc register.
    In addition, the dma-coherent property must be set on the
    SATA controller nodes.

    Signed-off-by: Tang Yuantian
    Signed-off-by: Tejun Heo

    Tang Yuantian
     
  • The default values for Port Phy2Cfg register and
    Port Phy3Cfg register are better, no need to overwrite them.

    Signed-off-by: Tang Yuantian
    Signed-off-by: Tejun Heo

    Tang Yuantian
     
  • scsi_done() was called repeatedly and apparently because of that,
    the kernel would call trace when we touch the Control mode page:

    Call Trace:
    [] dump_stack+0x63/0x81
    [] __warn+0xcb/0xf0
    [] warn_slowpath_null+0x1d/0x20
    [] ata_eh_finish+0xe0/0xf0 [libata]
    [] sata_pmp_error_handler+0x640/0xa50 [libata]
    [] ahci_error_handler+0x1d/0x70 [libahci]
    [] ata_scsi_port_error_handler+0x430/0x770 [libata]
    [] ? ata_scsi_cmd_error_handler+0xdd/0x160 [libata]
    [] ata_scsi_error+0xa7/0xf0 [libata]
    [] scsi_error_handler+0xaa/0x560 [scsi_mod]
    [] ? scsi_eh_get_sense+0x180/0x180 [scsi_mod]
    [] kthread+0xd8/0xf0
    [] ret_from_fork+0x1f/0x40
    [] ? kthread_worker_fn+0x170/0x170
    ---[ end trace 8b7501047e928a17 ]---

    Removed the unnecessary code and let ata_scsi_translate() do the job.

    Also, since ata_mselect_control() has no ATA command to send to the
    device, ata_scsi_mode_select_xlat() should return 1 for it, so that
    ata_scsi_translate() will finish early to avoid ata_qc_issue().

    Signed-off-by: Tom Yan
    Signed-off-by: Tejun Heo

    Tom Yan
     
  • ata_mselect_*() would initialize a char array for storing a copy of
    the current mode page. However, char could be signed char. In that
    case, bytes larger than 127 would be converted to negative number.

    For example, 0xff from def_control_mpage[] would become -1. This
    prevented ata_mselect_control() from working at all, since when it
    did the read-only bits check, there would always be a mismatch.

    Signed-off-by: Tom Yan
    Signed-off-by: Tejun Heo

    Tom Yan
     

28 Jul, 2016

1 commit

  • Pull LED updates from Jacek Anaszewski:
    "New LED class driver:
    - LED driver for TI LP3952 6-Channel Color LED

    LED core improvements:
    - Only descend into leds directory when CONFIG_NEW_LEDS is set
    - Add no-op gpio_led_register_device when LED subsystem is disabled
    - MAINTAINERS: Add file patterns for led device tree bindings

    LED Trigger core improvements:
    - return error if invalid trigger name is provided via sysfs

    LED class drivers improvements
    - is31fl32xx: define complete i2c_device_id table
    - is31fl32xx: fix typo in id and match table names
    - leds-gpio: Set of_node for created LED devices
    - pca9532: Add device tree support

    Conversion of IDE trigger to common disk trigger:
    - leds: convert IDE trigger to common disk trigger
    - leds: documentation: 'ide-disk' to 'disk-activity'
    - unicore32: use the new LED disk activity trigger
    - parisc: use the new LED disk activity trigger
    - mips: use the new LED disk activity trigger
    - arm: use the new LED disk activity trigger
    - powerpc: use the new LED disk activity trigger"

    * tag 'leds_for_4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
    leds: is31fl32xx: define complete i2c_device_id table
    leds: is31fl32xx: fix typo in id and match table names
    leds: LED driver for TI LP3952 6-Channel Color LED
    leds: leds-gpio: Set of_node for created LED devices
    leds: triggers: return error if invalid trigger name is provided via sysfs
    leds: Only descend into leds directory when CONFIG_NEW_LEDS is set
    leds: Add no-op gpio_led_register_device when LED subsystem is disabled
    unicore32: use the new LED disk activity trigger
    parisc: use the new LED disk activity trigger
    mips: use the new LED disk activity trigger
    arm: use the new LED disk activity trigger
    powerpc: use the new LED disk activity trigger
    leds: documentation: 'ide-disk' to 'disk-activity'
    leds: convert IDE trigger to common disk trigger
    leds: pca9532: Add device tree support
    MAINTAINERS: Add file patterns for led device tree bindings

    Linus Torvalds
     

27 Jul, 2016

2 commits

  • Pull core block updates from Jens Axboe:

    - the big change is the cleanup from Mike Christie, cleaning up our
    uses of command types and modified flags. This is what will throw
    some merge conflicts

    - regression fix for the above for btrfs, from Vincent

    - following up to the above, better packing of struct request from
    Christoph

    - a 2038 fix for blktrace from Arnd

    - a few trivial/spelling fixes from Bart Van Assche

    - a front merge check fix from Damien, which could cause issues on
    SMR drives

    - Atari partition fix from Gabriel

    - convert cfq to highres timers, since jiffies isn't granular enough
    for some devices these days. From Jan and Jeff

    - CFQ priority boost fix idle classes, from me

    - cleanup series from Ming, improving our bio/bvec iteration

    - a direct issue fix for blk-mq from Omar

    - fix for plug merging not involving the IO scheduler, like we do for
    other types of merges. From Tahsin

    - expose DAX type internally and through sysfs. From Toshi and Yigal

    * 'for-4.8/core' of git://git.kernel.dk/linux-block: (76 commits)
    block: Fix front merge check
    block: do not merge requests without consulting with io scheduler
    block: Fix spelling in a source code comment
    block: expose QUEUE_FLAG_DAX in sysfs
    block: add QUEUE_FLAG_DAX for devices to advertise their DAX support
    Btrfs: fix comparison in __btrfs_map_block()
    block: atari: Return early for unsupported sector size
    Doc: block: Fix a typo in queue-sysfs.txt
    cfq-iosched: Charge at least 1 jiffie instead of 1 ns
    cfq-iosched: Fix regression in bonnie++ rewrite performance
    cfq-iosched: Convert slice_resid from u64 to s64
    block: Convert fifo_time from ulong to u64
    blktrace: avoid using timespec
    block/blk-cgroup.c: Declare local symbols static
    block/bio-integrity.c: Add #include "blk.h"
    block/partition-generic.c: Remove a set-but-not-used variable
    block: bio: kill BIO_MAX_SIZE
    cfq-iosched: temporarily boost queue priority for idle classes
    block: drbd: avoid to use BIO_MAX_SIZE
    block: bio: remove BIO_MAX_SECTORS
    ...

    Linus Torvalds
     
  • Pull libata updates from Tejun Heo:
    "libata saw quite a bit of activities in this cycle:

    - SMR drive support still being worked on

    - bug fixes and improvements to misc SCSI command emulation

    - some low level driver updates"

    * 'for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (39 commits)
    libata-scsi: better style in ata_msense_*()
    AHCI: Clear GHC.IS to prevent unexpectly asserting INTx
    ata: sata_dwc_460ex: remove redundant dev_err call
    ata: define ATA_PROT_* in terms of ATA_PROT_FLAG_*
    libata: remove ATA_PROT_FLAG_DATA
    libata: remove ata_is_nodata
    ata: make lba_{28,48}_ok() use ATA_MAX_SECTORS{,_LBA48}
    libata-scsi: minor cleanup for ata_scsi_zbc_out_xlat
    libata-scsi: Fix ZBC management out command translation
    libata-scsi: Fix translation of REPORT ZONES command
    ata: Handle ATA NCQ NO-DATA commands correctly
    libata-eh: decode all taskfile protocols
    ata: fixup ATA_PROT_NODATA
    libsas: use ata_is_ncq() and ata_has_dma() accessors
    libata: use ata_is_ncq() accessors
    libata: return boolean values from ata_is_*
    libata-scsi: avoid repeated calculation of number of TRIM ranges
    libata-scsi: reject WRITE SAME (16) with n_block that exceeds limit
    libata-scsi: rename ata_msense_ctl_mode() to ata_msense_control()
    libata-scsi: fix D_SENSE bit relection in control mode page
    ...

    Linus Torvalds
     

23 Jul, 2016

1 commit


20 Jul, 2016

3 commits

  • `changeable` is the "version" of mode page requested by the user.
    It will be less confusing/misleading if we do not check it
    "together" with the setting bits of the drive.

    Not to mention that we currently have ata_mselect_*() implemented
    in a way that each of them will serve exclusively a particular bit
    on each page. The old style will hence make the condition look even
    more unnecessarily arcane if the ata_msense_*() is reflecting more
    than one bit.

    Signed-off-by: Tom Yan
    Signed-off-by: Tejun Heo

    Tom Yan
     
  • Due to PCI subsystem behaviour, unloading AHCI driver will disable
    MSI and enable INTx. When HBA supports MSIx or Multiple MSI, Driver's
    irq handler doesn't clear GHC.IS register. It works well when reading or
    writing data and GHC.IS is always non-zero. But when unloading driver
    (or any other operation which causes disable MSIx and enable INTx), PCI
    subsystem uses config write(Rx04.bit10) to enable INTx. Because
    GHC.IS is non-zero, HBA will falsely assume some port needs interrupt
    service. Then it asserts INTx. To make things worse, when AHCI controller
    shares the same interrupt pin with other PCI device, that PCI device's ISR
    will be called and nobody de-asserts previous INTx.
    This patch clears GHC.IS in ahci_port_stop() even when using MSIx or
    MMSI to prevent this case. It ensures GHC.IS is zero before PCI subsystem
    enables INTx.

    tj: Minor updates to the comment.

    Signed-off-by: Raymond Pang
    Signed-off-by: Tejun Heo

    Pang Raymond
     
  • There is a error message within devm_ioremap_resource
    already, so remove the dev_err call to avoid redundant
    error message.

    Signed-off-by: Wei Yongjun
    Signed-off-by: Tejun Heo

    Wei Yongjun
     

19 Jul, 2016

3 commits


15 Jul, 2016

4 commits

  • The reset_all variable name is misleading as this bit is also applicable to
    open, close, and finish actions. So rename that variable to "all" and remove
    the unnecessary mask operation that's already done earlier.

    Signed-off-by: Damien Le Moal
    [hch: split from the previous patch]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Tejun Heo

    Damien Le Moal
     
  • The subcommand for NCQ NON-DATA must be specified in the feature
    (low byte), not the high-order count byte. Also make sure to properly
    cast the all bit to a u16 before shiting it by 8 to avoid undefined
    behavior.

    Signed-off-by: Damien Le Moal
    [hch: split the original patch into two, updated changelog]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Tejun Heo

    Damien Le Moal
     
  • Include reporting options when translating REPORT ZONES commmand to
    ATA NCQ, and make sure we only look at the actually specified bits
    in the CDB for the options.

    Signed-off-by: Damien Le Moal
    [hch: update patch description]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Tejun Heo

    Damien Le Moal
     
  • Add a new taskfile protocol ATA_PROT_NCQ_NODATA to handle
    ATA NCQ NO-DATA commands correctly.
    And fixup ata_scsi_zbc_out_xlat() to use it.

    Signed-off-by: Hannes Reinecke
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Tejun Heo

    Hannes Reinecke
     

14 Jul, 2016

3 commits


13 Jul, 2016

4 commits

  • Currently libata statically allows only 1-block (512-byte) payload
    for each TRIM command. Each payload can carry 64 TRIM ranges since
    each range requires 8 bytes.

    It is silly to keep doing the calculation (512 / 8) in different
    places. Hence, define the new ATA_MAX_TRIM_RNUM for the result.

    Signed-off-by: Tom Yan
    Signed-off-by: Tejun Heo

    Tom Yan
     
  • Currently if a WRITE SAME (16) command is issued to the SATL with
    "number of blocks" that is larger than the "Maximum write same length"
    (which is the maximum number of blocks per TRIM command allowed in
    libata, currently 65535 * 512 / 8 blocks), the SATL will accept the
    command and translate it to a TRIM command with the upper limit.

    However, according to SBC (as of sbc4r11.pdf), the "device server"
    should terminate the command with "Invalid field in CDB" in that case.

    Signed-off-by: Tom Yan
    Signed-off-by: Tejun Heo

    Tom Yan
     
  • To make it consistent with the recently added ata_mselect_control().
    We probably shouldn't have the word "mode" in its name anyway, since
    that's not the case for other ata_msense_*() / ata_mselect_*() either.

    Signed-off-by: Tom Yan
    Signed-off-by: Tejun Heo

    Tom Yan
     
  • The bit should always be set to 1 when the requested version of
    page is "changeable" because we've made it so in ata_mselect_control().
    Also, it should always be set to 1 if ATA_DFLAG_D_SENSE is set (when
    the requested version of page is "current" or "default").

    Signed-off-by: Tom Yan
    Signed-off-by: Tejun Heo

    Tom Yan