23 Jul, 2016

1 commit


19 Jul, 2016

1 commit

  • Since 34b48db66e08 ("block: remove artifical max_hw_sectors cap"),
    max_sectors is no longer limited to BLK_DEF_MAX_SECTORS and LITE-ON
    CX1-JB256-HP keeps timing out with higher max_sectors. Revert it to
    the previous value.

    Signed-off-by: Tejun Heo
    Reported-by: dgerasimov@gmail.com
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=121671
    Cc: stable@vger.kernel.org # v3.19+
    Fixes: 34b48db66e08 ("block: remove artifical max_hw_sectors cap")
    Signed-off-by: Tejun Heo

    Tejun Heo
     

29 Jun, 2016

1 commit


19 Jun, 2016

1 commit


18 Jun, 2016

1 commit

  • Fix the signed issue in mv_write_cached_reg() where the laddr
    is assigned from a (long)addr instead of (unsigned long)addr.

    Fixes the following warnings:

    drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
    drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
    drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
    drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression

    Signed-off-by: Ben Dooks
    Signed-off-by: Tejun Heo

    Ben Dooks
     

16 Jun, 2016

1 commit


09 Jun, 2016

1 commit

  • sas_ata_strategy_handler() adds the works of the ata error handler to
    system_unbound_wq. This workqueue asynchronously runs work items, so the
    ata error handler will be performed concurrently on different CPUs. In
    this case, ->host_failed will be decreased simultaneously in
    scsi_eh_finish_cmd() on different CPUs, and become abnormal.

    It will lead to permanently inequality between ->host_failed and
    ->host_busy, and scsi error handler thread won't start running. IO
    errors after that won't be handled.

    Since all scmds must have been handled in the strategy handler, just
    remove the decrement in scsi_eh_finish_cmd() and zero ->host_busy after
    the strategy handler to fix this race.

    Fixes: 50824d6c5657 ("[SCSI] libsas: async ata-eh")
    Cc: stable@vger.kernel.org
    Signed-off-by: Wei Fang
    Reviewed-by: James Bottomley
    Signed-off-by: Martin K. Petersen

    Wei Fang
     

28 May, 2016

1 commit

  • Most users of IS_ERR_VALUE() in the kernel are wrong, as they
    pass an 'int' into a function that takes an 'unsigned long'
    argument. This happens to work because the type is sign-extended
    on 64-bit architectures before it gets converted into an
    unsigned type.

    However, anything that passes an 'unsigned short' or 'unsigned int'
    argument into IS_ERR_VALUE() is guaranteed to be broken, as are
    8-bit integers and types that are wider than 'unsigned long'.

    Andrzej Hajda has already fixed a lot of the worst abusers that
    were causing actual bugs, but it would be nice to prevent any
    users that are not passing 'unsigned long' arguments.

    This patch changes all users of IS_ERR_VALUE() that I could find
    on 32-bit ARM randconfig builds and x86 allmodconfig. For the
    moment, this doesn't change the definition of IS_ERR_VALUE()
    because there are probably still architecture specific users
    elsewhere.

    Almost all the warnings I got are for files that are better off
    using 'if (err)' or 'if (err < 0)'.
    The only legitimate user I could find that we get a warning for
    is the (32-bit only) freescale fman driver, so I did not remove
    the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
    For 9pfs, I just worked around one user whose calling conventions
    are so obscure that I did not dare change the behavior.

    I was using this definition for testing:

    #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
    unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))

    which ends up making all 16-bit or wider types work correctly with
    the most plausible interpretation of what IS_ERR_VALUE() was supposed
    to return according to its users, but also causes a compile-time
    warning for any users that do not pass an 'unsigned long' argument.

    I suggested this approach earlier this year, but back then we ended
    up deciding to just fix the users that are obviously broken. After
    the initial warning that caused me to get involved in the discussion
    (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
    asked me to send the whole thing again.

    [ Updated the 9p parts as per Al Viro - Linus ]

    Signed-off-by: Arnd Bergmann
    Cc: Andrzej Hajda
    Cc: Andrew Morton
    Link: https://lkml.org/lkml/2016/1/7/363
    Link: https://lkml.org/lkml/2016/5/27/486
    Acked-by: Srinivas Kandagatla # For nvmem part
    Signed-off-by: Linus Torvalds

    Arnd Bergmann
     

24 May, 2016

2 commits

  • Pull libata sata_dwc_460ex updates from Tejun Heo:
    "Patches to bring sata_dwc_460ex up to snuff.

    It was a separate pull request because it depends on dmaengine dw
    platform changes which are now in mainline"

    * 'for-4.7-dw' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (24 commits)
    ata: dwc: add DMADEVICES dependency
    powerpc/4xx: Device tree update for the 460ex DWC SATA
    ata: sata_dwc_460ex: make debug messages neat
    ata: sata_dwc_460ex: supply physical address of FIFO to DMA
    ata: sata_dwc_460ex: use devm_ioremap
    ata: sata_dwc_460ex: tidy up sata_dwc_clear_dmacr()
    ata: sata_dwc_460ex: use readl/writel_relaxed()
    ata: sata_dwc_460ex: switch to new dmaengine_terminate_* API
    ata: sata_dwc_460ex: add __iomem to register base pointer
    ata: sata_dwc_460ex: get rid of incorrect cast
    ata: sata_dwc_460ex: get rid of some pointless casts
    ata: sata_dwc_460ex: remove empty libata callback
    ata: sata_dwc_460ex: correct HOSTDEV{P}_FROM_*() macros
    ata: sata_dwc_460ex: get rid of global data
    ata: sata_dwc_460ex: add phy support
    ata: sata_dwc_460ex: use "dmas" DT property to find dma channel
    ata: sata_dwc_460ex: don't call ata_sff_qc_issue() on DMA commands
    ata: sata_dwc_460ex: skip dma setup for non-dma commands
    ata: sata_dwc_460ex: select only core part of DMA driver
    ata: sata_dwc_460ex: DMA is always a flow controller
    ...

    Linus Torvalds
     
  • Pull libata ZAC support from Tejun Heo:
    "This contains Zone ATA Command support for Shingled Magnetic Recording
    devices.

    In addition to sending the new commands down to the device, as ZAC
    commands depend on getting a lot of responses from the device, piping
    up responses is beefed up too. However, it doesn't involve changes to
    libata core mechanism or its interaction with upper layers, so I'm not
    expecting too many fallouts.

    Kudos to Hannes for driving SMR support"

    * 'for-4.7-zac' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (28 commits)
    libata: support host-aware and host-managed ZAC devices
    libata: support device-managed ZAC devices
    libata: NCQ encapsulation for ZAC MANAGEMENT OUT
    libata: Implement ZBC OUT translation
    libata: implement ZBC IN translation
    libata: fixup ZAC device disabling
    libata-scsi: Generate sense code for disabled devices
    libata-trace: decode subcommands
    libata: Check log page directory before accessing pages
    libata: Add command definitions for NCQ Encapsulation for READ LOG DMA EXT
    libata: Separate out ata_dev_config_ncq_send_recv()
    libata/libsas: Define ATA_CMD_NCQ_NON_DATA
    libsas: enable FPDMA SEND/RECEIVE
    libata: do not attempt to retrieve sense code twice
    libata-scsi: Set information sense field for invalid parameter
    libata-scsi: set bit pointer for sense code information
    libata-scsi: Set field pointer in sense code
    scsi: add scsi_set_sense_field_pointer()
    libata: Implement control mode page to select sense format
    libata-scsi: generate correct ATA pass-through sense
    ...

    Linus Torvalds
     

20 May, 2016

1 commit

  • Pull dmaengine updates from Vinod Koul:
    "This time round the update brings in following changes:

    - new tegra driver for ADMA device

    - support for Xilinx AXI Direct Memory Access Engine and Xilinx AXI
    Central Direct Memory Access Engine and few updates to this driver

    - new cyclic capability to sun6i and few updates

    - slave-sg support in bcm2835

    - updates to many drivers like designware, hsu, mv_xor, pxa, edma,
    qcom_hidma & bam"

    * tag 'dmaengine-4.7-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (84 commits)
    dmaengine: ioatdma: disable relaxed ordering for ioatdma
    dmaengine: of_dma: approximate an average distribution
    dmaengine: core: Use IS_ENABLED() instead of checking for built-in or module
    dmaengine: edma: Re-evaluate errors when ccerr is triggered w/o error event
    dmaengine: qcom_hidma: add support for object hierarchy
    dmaengine: qcom_hidma: add debugfs hooks
    dmaengine: qcom_hidma: implement lower level hardware interface
    dmaengine: vdma: Add clock support
    Documentation: DT: vdma: Add clock support for dmas
    dmaengine: vdma: Add config structure to differentiate dmas
    MAINTAINERS: Update Tegra DMA maintainers
    dmaengine: tegra-adma: Add support for Tegra210 ADMA
    Documentation: DT: Add binding documentation for NVIDIA ADMA
    dmaengine: vdma: Add Support for Xilinx AXI Central Direct Memory Access Engine
    Documentation: DT: vdma: update binding doc for AXI CDMA
    dmaengine: vdma: Add Support for Xilinx AXI Direct Memory Access Engine
    Documentation: DT: vdma: update binding doc for AXI DMA
    dmaengine: vdma: Rename xilinx_vdma_ prefix to xilinx_dma
    dmaengine: slave means at least one of DMA_SLAVE, DMA_CYCLIC
    dmaengine: mv_xor: Allow selecting mv_xor for mvebu only compatible SoC
    ...

    Linus Torvalds
     

19 May, 2016

1 commit

  • Pull SCSI updates from James Bottomley:
    "First round of SCSI updates for the 4.6+ merge window.

    This batch includes the usual quota of driver updates (bnx2fc, mp3sas,
    hpsa, ncr5380, lpfc, hisi_sas, snic, aacraid, megaraid_sas). There's
    also a multiqueue update for scsi_debug, assorted bug fixes and a few
    other minor updates (refactor of scsi_sg_pools into generic code, alua
    and VPD updates, and struct timeval conversions)"

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (138 commits)
    mpt3sas: Used "synchronize_irq()"API to synchronize timed-out IO & TMs
    mpt3sas: Set maximum transfer length per IO to 4MB for VDs
    mpt3sas: Updating mpt3sas driver version to 13.100.00.00
    mpt3sas: Fix initial Reference tag field for 4K PI drives.
    mpt3sas: Handle active cable exception event
    mpt3sas: Update MPI header to 2.00.42
    Revert "lpfc: Delete unnecessary checks before the function call mempool_destroy"
    eata_pio: missing break statement
    hpsa: Fix type ZBC conditional checks
    scsi_lib: Decode T10 vendor IDs
    scsi_dh_alua: do not fail for unknown VPD identification
    scsi_debug: use locally assigned naa
    scsi_debug: uuid for lu name
    scsi_debug: vpd and mode page work
    scsi_debug: add multiple queue support
    bfa: fix bfa_fcb_itnim_alloc() error handling
    megaraid_sas: Downgrade two success messages to info
    cxlflash: Fix to resolve dead-lock during EEH recovery
    scsi_debug: rework resp_report_luns
    scsi_debug: use pdt constants
    ...

    Linus Torvalds
     

14 May, 2016

1 commit


13 May, 2016

1 commit

  • The dwc_460ex SATA driver has become available on non-powerpc architectures
    and may cause randconfig build errors when CONFIG_DMADEVICES is not set
    and SATA_DWC_OLD_DMA is enabled:

    warning: (SATA_DWC_OLD_DMA) selects DW_DMAC_CORE which has unmet direct dependencies (DMADEVICES)
    ERROR: "dw_dma_probe" [drivers/ata/sata_dwc_460ex.ko] undefined!
    ERROR: "dw_dma_remove" [drivers/ata/sata_dwc_460ex.ko] undefined!

    This adds an explcit Kconfig dependency to CONFIG_SATA_DWC so we
    cannot run into broken configurations. While it would also be
    possible to build the driver with both CONFIG_DMADEVICES
    and SATA_DWC_OLD_DMA disabled, that case is not useful because
    there is no fallback to PIO mode when the DMA engine is not
    usable.

    Signed-off-by: Arnd Bergmann
    Fixes: 50b433753df6 ("ata: sata_dwc_460ex: use "dmas" DT property to find dma channel")
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Tejun Heo

    Arnd Bergmann
     

12 May, 2016

6 commits


11 May, 2016

16 commits

  • The pointer to the mmio register base is missing the __iomem
    annotation. Fix this.

    Tested-by: Christian Lamparter
    Signed-off-by: Mans Rullgard
    Signed-off-by: Tejun Heo

    Mans Rullgard
     
  • The (void *__iomem) cast is wrong. Change the target type of the
    "base" pointer to void __iomem instead and drop the cast.

    Tested-by: Christian Lamparter
    Signed-off-by: Mans Rullgard
    Signed-off-by: Tejun Heo

    Mans Rullgard
     
  • Casting a pointer to unsigned long only to immediately cast it back
    to a pointer makes no sense. Fix this.

    Tested-by: Christian Lamparter
    Signed-off-by: Mans Rullgard
    Signed-off-by: Tejun Heo

    Mans Rullgard
     
  • The sata_dwc_qc_prep() does nothing. Use the default ata_noop_qc_prep
    instead.

    Tested-by: Christian Lamparter
    Signed-off-by: Mans Rullgard
    Signed-off-by: Tejun Heo

    Mans Rullgard
     
  • Here we refactor HOSTDEV{P}_FROM_*() macros to fit one line and fix the
    definition of HSDEV_FROM_HSDEVP() where wrong name of the parameter waas used.

    Tested-by: Christian Lamparter
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Tejun Heo

    Andy Shevchenko
     
  • This moves all global data into the driver private struct, thus
    permitting multiple devices of this type to be used.

    The core_scr_read/write() functions are replaced with equivalent
    calls to the existing sata_dwc_scr_read/write().

    Tested-by: Christian Lamparter
    Signed-off-by: Mans Rullgard
    Signed-off-by: Tejun Heo

    Mans Rullgard
     
  • This adds support for powering on an optional PHY when activating the
    device.

    Tested-by: Christian Lamparter
    Signed-off-by: Mans Rullgard
    Signed-off-by: Tejun Heo

    Mans Rullgard
     
  • Currently this driver only works with a DesignWare DMA engine which it
    registers manually using the second "reg" address range and interrupt
    number from the DT node.

    This patch makes the driver instead use the "dmas" property if present,
    otherwise optionally falling back on the old way so existing device
    trees can continue to work.

    With this change, there is no longer any reason to depend on the 460EX
    machine type so drop that from Kconfig.

    Tested-by: Christian Lamparter
    Signed-off-by: Mans Rullgard
    Signed-off-by: Tejun Heo

    Mans Rullgard
     
  • ata_sff_qc_issue() can't handle DMA commands and thus we have to avoid it for
    them. Do call ata_bmdma_qc_issue() instead for this case. Note that the former
    one distinguishes PIO and DMA mode and behaves accordingly.

    Suggested-by: Christian Lamparter
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Tejun Heo

    Andy Shevchenko
     
  • Calling dmaengine_prep_slave_sg() for non-dma ATA commands is
    unnecessary at best and could be harmful if the dma driver reacts
    badly to this. It also causes this driver to print a bogus error
    message in these cases.

    This patch changes sata_dwc_qc_issue() to only do the dma setup
    for dma commands and also reports an error to libata if if fails.

    Tested-by: Christian Lamparter
    Signed-off-by: Mans Rullgard
    Signed-off-by: Tejun Heo

    Mans Rullgard
     
  • There is no need to have a platform driver compiled since the DMA driver is
    used as a library.

    Tested-by: Christian Lamparter
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Tejun Heo

    Andy Shevchenko
     
  • In the original code the DMA is always a flow controller. Set this accordingly
    in updated code.

    Tested-by: Christian Lamparter
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Tejun Heo

    Andy Shevchenko
     
  • The burst size as defined by DMAengine API is in items of address width. Derive
    burst size from AHB_DMA_BRST_DFLT (64 bytes) by dividing it to
    DMA_SLAVE_BUSWIDTH_4_BYTES (4 bytes) that gives us 16 items.

    Tested-by: Christian Lamparter
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Tejun Heo

    Andy Shevchenko
     
  • The original code states:

    Make sure a LLI block is not created that will span 8K max FIS
    boundary. If the block spans such a FIS boundary, there is a chance
    that a DMA burst will cross that boundary -- this results in an error
    in the host controller.

    Since we have switched to generic DMAengine API we satisfy above by setting
    dma_boundary value to 0x1fff.

    Suggested-by: Mans Rullgard
    Tested-by: Christian Lamparter
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Tejun Heo

    Andy Shevchenko
     
  • This patch fixes Machine Check "Data Write PLB Error" which happens
    when libata-sff's ata_sff_dev_select is trying to write into the
    device_addr in order to select a drive. However, SATA has no master
    or slave devices like the old ATA Bus, therefore selecting a
    different drive is kind of pointless.

    Data Write PLB Error
    Oops: Machine check, sig: 7 [#1]
    PowerPC 44x Platform
    Modules linked in:
    CPU: 0 PID: 508 Comm: scsi_eh_0 Not tainted 4.6.0-rc3-next-20160412+ #10
    [...]
    NIP [c027e820] ata_sff_dev_select+0x3c/0x44
    LR [c027e810] ata_sff_dev_select+0x2c/0x44
    Call Trace:
    [cec31cd0] [c027da00] ata_sff_postreset+0x40/0xb4 (unreliable)
    [cec31ce0] [c027a03c] ata_eh_reset+0x5cc/0x928
    [cec31d60] [c027a840] ata_eh_recover+0x330/0x10bc
    [cec31df0] [c027bae0] ata_do_eh+0x4c/0xa4
    [...]

    Signed-off-by: Christian Lamparter
    Signed-off-by: Tejun Heo

    Christian Lamparter
     
  • This lock is already taken in ata_scsi_queuecmd() a few levels up the
    call stack so attempting to take it here is an error. Moreover, it is
    pointless in the first place since it only protects a single, atomic
    assignment.

    Enabling lock debugging gives the following output:

    =============================================
    [ INFO: possible recursive locking detected ]
    4.4.0-rc5+ #189 Not tainted
    ---------------------------------------------
    kworker/u2:3/37 is trying to acquire lock:
    (&(&host->lock)->rlock){-.-...}, at: [] sata_dwc_exec_command_by_tag.constprop.14+0x44/0x8c

    but task is already holding lock:
    (&(&host->lock)->rlock){-.-...}, at: [] ata_scsi_queuecmd+0x2c/0x330

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0
    ----
    lock(&(&host->lock)->rlock);
    lock(&(&host->lock)->rlock);

    *** DEADLOCK ***
    May be due to missing lock nesting notation

    4 locks held by kworker/u2:3/37:
    #0: ("events_unbound"){.+.+.+}, at: [] process_one_work+0x12c/0x430
    #1: ((&entry->work)){+.+.+.}, at: [] process_one_work+0x12c/0x430
    #2: (&bdev->bd_mutex){+.+.+.}, at: [] __blkdev_get+0x50/0x380
    #3: (&(&host->lock)->rlock){-.-...}, at: [] ata_scsi_queuecmd+0x2c/0x330

    stack backtrace:
    CPU: 0 PID: 37 Comm: kworker/u2:3 Not tainted 4.4.0-rc5+ #189
    Workqueue: events_unbound async_run_entry_fn
    Stack : 90b38e30 00000021 00000003 9b2a6040 00000000 9005f3f0 904fc8dc 00000025
    906b96e4 00000000 90528648 9b3336c4 904fc8dc 9009bf18 00000002 00000004
    00000000 00000000 9b3336c4 9b3336e4 904fc8dc 9003d074 00000000 90500000
    9005e738 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    6e657665 755f7374 756f626e 0000646e 00000000 00000000 9b00ca00 9b025000
    ...
    Call Trace:
    [] show_stack+0x88/0xa4
    [] __lock_acquire+0x1ce8/0x2154
    [] lock_acquire+0x64/0x8c
    [] _raw_spin_lock_irqsave+0x54/0x78
    [] sata_dwc_exec_command_by_tag.constprop.14+0x44/0x8c
    [] sata_dwc_qc_issue+0x1a8/0x24c
    [] ata_qc_issue+0x1f0/0x410
    [] ata_scsi_translate+0xb4/0x200
    [] ata_scsi_queuecmd+0xb4/0x330
    [] scsi_dispatch_cmd+0xd0/0x128
    [] scsi_request_fn+0x58c/0x638
    [] __blk_run_queue+0x40/0x5c
    [] blk_queue_bio+0x27c/0x28c
    [] generic_make_request+0xf0/0x188
    [] submit_bio+0xa8/0x194
    [] submit_bh_wbc.isra.23+0x15c/0x17c
    [] block_read_full_page+0x3e4/0x428
    [] do_read_cache_page+0xac/0x210
    [] read_cache_page+0x18/0x24
    [] read_dev_sector+0x38/0xb0
    [] msdos_partition+0xb4/0x5c0
    [] check_partition+0x140/0x274
    [] rescan_partitions+0xa0/0x2b0
    [] __blkdev_get+0x264/0x380
    [] blkdev_get+0x128/0x36c
    [] add_disk+0x3c0/0x4bc
    [] sd_probe_async+0x100/0x224
    [] async_run_entry_fn+0x50/0x124
    [] process_one_work+0x1a4/0x430
    [] worker_thread+0x14c/0x4fc
    [] kthread+0xd0/0xe8
    [] ret_from_kernel_thread+0x14/0x1c

    Fixes: 62936009f35a ("[libata] Add 460EX on-chip SATA driver, sata_dwc_460ex")
    Tested-by: Christian Lamparter
    Signed-off-by: Mans Rullgard
    Signed-off-by: Tejun Heo

    Mans Rullgard
     

10 May, 2016

4 commits