26 Jan, 2017

40 commits

  • Greg Kroah-Hartman
     
  • commit 7af3ea189a9a13f090de51c97f676215dabc1205 upstream.

    This is useless and more importantly not allowed on the writeback path,
    because crypto_alloc_skcipher() allocates memory with GFP_KERNEL, which
    can recurse back into the filesystem:

    kworker/9:3 D ffff92303f318180 0 20732 2 0x00000080
    Workqueue: ceph-msgr ceph_con_workfn [libceph]
    ffff923035dd4480 ffff923038f8a0c0 0000000000000001 000000009eb27318
    ffff92269eb28000 ffff92269eb27338 ffff923036b145ac ffff923035dd4480
    00000000ffffffff ffff923036b145b0 ffffffff951eb4e1 ffff923036b145a8
    Call Trace:
    [] ? schedule+0x31/0x80
    [] ? schedule_preempt_disabled+0xa/0x10
    [] ? __mutex_lock_slowpath+0xb4/0x130
    [] ? mutex_lock+0x1b/0x30
    [] ? xfs_reclaim_inodes_ag+0x233/0x2d0 [xfs]
    [] ? move_active_pages_to_lru+0x125/0x270
    [] ? radix_tree_gang_lookup_tag+0xc5/0x1c0
    [] ? __list_lru_walk_one.isra.3+0x33/0x120
    [] ? xfs_reclaim_inodes_nr+0x31/0x40 [xfs]
    [] ? super_cache_scan+0x17e/0x190
    [] ? shrink_slab.part.38+0x1e3/0x3d0
    [] ? shrink_node+0x10a/0x320
    [] ? do_try_to_free_pages+0xf4/0x350
    [] ? try_to_free_pages+0xea/0x1b0
    [] ? __alloc_pages_nodemask+0x61d/0xe60
    [] ? cache_grow_begin+0x9d/0x560
    [] ? fallback_alloc+0x148/0x1c0
    [] ? __crypto_alloc_tfm+0x37/0x130
    [] ? __kmalloc+0x1eb/0x580
    [] ? crush_choose_firstn+0x3eb/0x470 [libceph]
    [] ? __crypto_alloc_tfm+0x37/0x130
    [] ? crypto_spawn_tfm+0x39/0x60
    [] ? crypto_cbc_init_tfm+0x23/0x40 [cbc]
    [] ? __crypto_alloc_tfm+0xcc/0x130
    [] ? crypto_skcipher_init_tfm+0x113/0x180
    [] ? crypto_create_tfm+0x43/0xb0
    [] ? crypto_larval_lookup+0x150/0x150
    [] ? crypto_alloc_tfm+0x72/0x120
    [] ? ceph_aes_encrypt2+0x67/0x400 [libceph]
    [] ? ceph_pg_to_up_acting_osds+0x84/0x5b0 [libceph]
    [] ? release_sock+0x40/0x90
    [] ? tcp_recvmsg+0x4b4/0xae0
    [] ? ceph_encrypt2+0x54/0xc0 [libceph]
    [] ? ceph_x_encrypt+0x5d/0x90 [libceph]
    [] ? calcu_signature+0x5f/0x90 [libceph]
    [] ? ceph_x_sign_message+0x35/0x50 [libceph]
    [] ? prepare_write_message_footer+0x5c/0xa0 [libceph]
    [] ? ceph_con_workfn+0x2258/0x2dd0 [libceph]
    [] ? queue_con_delay+0x33/0xd0 [libceph]
    [] ? __submit_request+0x20d/0x2f0 [libceph]
    [] ? ceph_osdc_start_request+0x28/0x30 [libceph]
    [] ? rbd_queue_workfn+0x2f3/0x350 [rbd]
    [] ? process_one_work+0x160/0x410
    [] ? worker_thread+0x4d/0x480
    [] ? process_one_work+0x410/0x410
    [] ? kthread+0xcd/0xf0
    [] ? ret_from_fork+0x1f/0x40
    [] ? kthread_create_on_node+0x190/0x190

    Allocating the cipher along with the key fixes the issue - as long the
    key doesn't change, a single cipher context can be used concurrently in
    multiple requests.

    We still can't take that GFP_KERNEL allocation though. Both
    ceph_crypto_key_clone() and ceph_crypto_key_decode() are called from
    GFP_NOFS context, so resort to memalloc_noio_{save,restore}() here.

    Reported-by: Lucas Stach
    Signed-off-by: Ilya Dryomov
    Reviewed-by: Sage Weil
    Signed-off-by: Greg Kroah-Hartman

    Ilya Dryomov
     
  • commit 6db2304aabb070261ad34923bfd83c43dfb000e3 upstream.

    Signed-off-by: Ilya Dryomov
    Reviewed-by: Sage Weil
    Signed-off-by: Greg Kroah-Hartman

    Ilya Dryomov
     
  • commit 21f5eda9b8671744539c8295b9df62991fffb2ce upstream.

    Since ef1b144d ("tools/virtio/ringtest: fix run-on-all.sh to work
    without /dev/cpu") run-on-all.sh uses seq 0 $HOST_AFFINITY as the list
    of ids of the CPUs to run the command on (assuming ids of online CPUs
    are consecutive and start from 0), where $HOST_AFFINITY is the highest
    CPU id in the system previously determined using lscpu. This can fail
    on systems with offline CPUs.

    Instead let's use lscpu to determine the list of online CPUs.

    Signed-off-by: Halil Pasic
    Fixes: ef1b144d ("tools/virtio/ringtest: fix run-on-all.sh to work without
    /dev/cpu")
    Reviewed-by: Sascha Silbe
    Signed-off-by: Cornelia Huck
    Signed-off-by: Greg Kroah-Hartman

    Halil Pasic
     
  • commit df21d2fa733035e4d414379960f94b2516b41296 upstream.

    Test uses PMC2 to count the event. But PMC1 is being initialized.
    Patch to fix it.

    Fixes: 3752e453f6ba ('selftests/powerpc: Add tests of PMU EBBs')
    Signed-off-by: Madhavan Srinivasan
    Signed-off-by: Michael Ellerman
    Signed-off-by: Greg Kroah-Hartman

    Madhavan Srinivasan
     
  • commit 36b29eb30ee0f6c99f06bea406c23a3fd4cbb80b upstream.

    Fix to return a negative error code from the kthread_run() error
    handling case instead of 0, as done elsewhere in this function.

    Fixes: cdd5de500b2c ("soc: ti: Add wkup_m3_ipc driver")
    Signed-off-by: Wei Yongjun
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     
  • commit a2dd8af00ca7fff4972425a4a6b19dd1840dc807 upstream.

    The commit 7c7289a40425 ("spi: pxa2xx: Default thresholds to PXA
    configuration") while splitting up CE4100 code obviously missed a break
    condition in one chunk. Add it here.

    Looks like we have no active user of CE4100, though better to fix this later
    than never.

    Fixes: commit 7c7289a40425 ("spi: pxa2xx: Default thresholds to PXA configuration")
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • commit 5c9e6c2b2ba3ec3a442e2fb5b4286498f8b4dcb7 upstream.

    PL330 DMA engine driver is leaking a runtime reference after any terminated
    DMA transactions. This patch fixes this issue by tracking runtime PM state
    of the device and making additional call to pm_runtime_put() in terminate_all
    callback if needed.

    Fixes: ae43b3289186 ("ARM: 8202/1: dmaengine: pl330: Add runtime Power Management support v12")
    Signed-off-by: Marek Szyprowski
    Reviewed-by: Krzysztof Kozlowski
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Marek Szyprowski
     
  • commit 3139dc8ded6f27552a248d23fe9f086e3027fa12 upstream.

    The slave mapping should be removed together with other channel
    resources when the channel is freed. If it's not unmapped it will hang
    around forever after the channel is freed.

    Fixes: 9f878603dbdb7db3 ("dmaengine: rcar-dmac: add iommu support for slave transfers")
    Reported-by: Laurent Pinchart
    Signed-off-by: Niklas Söderlund
    Reviewed-by: Laurent Pinchart
    Signed-off-by: Vinod Koul
    Signed-off-by: Greg Kroah-Hartman

    Niklas Söderlund
     
  • commit c0026c7bfb95c250c3e34fde59f96ad72fd730d6 upstream.

    Clock control indirectly requires access to MFC device, so call it only
    if we are sure that the device exists in s5p_mfc_release function.
    s5p_mfc_remove() calls s5p_mfc_final_pm(), which releases all PM related
    resources, including clocks, so any call to clocks related functions
    is not valid after s5p_mfc_final_pm().

    Fixes: d695c12 ("[media] media: s5p-mfc fix invalid memory access from
    s5p_mfc_release()")

    Signed-off-by: Marek Szyprowski
    Signed-off-by: Sylwester Nawrocki
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Marek Szyprowski
     
  • commit eadf081146ec327d6fbbb6aff28e3d9aac329dc6 upstream.

    A bugfix removed the two callers of s5p_cec_runtime_suspend
    and s5p_cec_runtime_resume, leading to the return of a harmless
    warning that I had previously fixed in commit aee8937089b1
    ("[media] s5p_cec: mark suspend/resume as __maybe_unused"):

    staging/media/s5p-cec/s5p_cec.c:234:12: error: ‘s5p_cec_runtime_suspend’ defined but not used [-Werror=unused-function]
    staging/media/s5p-cec/s5p_cec.c:242:12: error: ‘s5p_cec_runtime_resume’ defined but not used [-Werror=unused-function]

    This adds the __maybe_unused annotations to the function that
    were not removed and that are now unused when CONFIG_PM
    is disabled.

    Fixes: 57b978ada073 ("[media] s5p-cec: fix system and runtime PM integration")

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 6b2bed891253c08e7f4c17dbd46b71fc87f22eef upstream.

    The devm_ioremap_resource() returns error pointers, never NULL. The
    platform_get_resource() returns NULL on error, never error pointers.
    The error code needs to be set, as well. The current code returns
    PTR_ERR(NULL) which is success.

    Fixes: 57b2c0628b60 ("[media] st-hva: multi-format video encoder V4L2 driver")

    Signed-off-by: Dan Carpenter
    Acked-by: Jean-Christophe Trotin
    Signed-off-by: Hans Verkuil
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 7ec03e60ef81c19b5d3a46dd070ee966774b860f upstream.

    Function ite_set_carrier_params() uses variable use_demodulator after
    having initialized it to false in some if branches, but this variable is
    never set to true otherwise.

    This bug has been found using clang -Wsometimes-uninitialized warning
    flag.

    Fixes: 620a32bba4a2 ("[media] rc: New rc-based ite-cir driver for
    several ITE CIRs")

    Signed-off-by: Nicolas Iooss
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Nicolas Iooss
     
  • commit df94121f02ecce435d6b5277071eb94b764caa89 upstream.

    It's not necessary to free memory allocated with devm_kzalloc
    and using kfree leads to a double free.

    Fixes: 7aae6e2df127 ("[media] Add GS1662 driver, a video serializer")

    Signed-off-by: Wei Yongjun
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Wei Yongjun
     
  • commit ff681022c6639c194fbb6893c50ace9e52a44788 upstream.

    Moving the pxa_camera driver from soc_camera lots the implied
    VIDEO_V4L2 Kconfig dependency, and building the driver without
    V4L2 results in a kernel that cannot link:

    drivers/media/platform/pxa_camera.o: In function `pxa_camera_remove':
    pxa_camera.c:(.text.pxa_camera_remove+0x10): undefined reference to `v4l2_clk_unregister'
    pxa_camera.c:(.text.pxa_camera_remove+0x18): undefined reference to `v4l2_device_unregister'
    drivers/media/platform/pxa_camera.o: In function `pxa_camera_probe':
    pxa_camera.c:(.text.pxa_camera_probe+0x458): undefined reference to `v4l2_of_parse_endpoint'
    drivers/media/v4l2-core/videobuf2-core.o: In function `__enqueue_in_driver':
    drivers/media/v4l2-core/videobuf2-core.o: In function `vb2_core_streamon':
    videobuf2-core.c:(.text.vb2_core_streamon+0x1b4): undefined reference to `v4l_vb2q_enable_media_source'
    drivers/media/v4l2-core/videobuf2-v4l2.o: In function `vb2_ioctl_reqbufs':
    videobuf2-v4l2.c:(.text.vb2_ioctl_reqbufs+0xc): undefined reference to `video_devdata'

    This adds back an explicit dependency.

    Fixes: 3050b9985024 ("[media] media: platform: pxa_camera: move pxa_camera out of soc_camera")

    Signed-off-by: Arnd Bergmann
    Acked-by: Robert Jarzmik
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit c9205e18b41a6ef5ad73e1c4b86a78b2ea3ccb9b upstream.

    devm_pinctrl_get() can fail so we should check for that.

    Fixes: 0a6824bc10de ('[media] v4l2: blackfin: select proper pinctrl state in ppi_set_params if CONFIG_PINCTRL is enabled')

    Signed-off-by: Dan Carpenter
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 63447646ac657fde00bb658ce21a3431940ae0ad upstream.

    Since commit 4dffed5b3ac796b ("rpmsg: Name rpmsg devices based on
    channel id"), it is no more possible for a firmware to register twice
    a service (on different endpoints). rpmsg_register_device function
    is failing when calling device_add for the second time as second
    device has the same name as first one already register.
    It is because name is based only on service name and so is not more
    unique. Previously name was unique thanks to the use of rpmsg_dev_index.

    This patch adds destination and source endpoint numbers device name to
    create an unique identifier.

    Fixes: 4dffed5b3ac7 ("rpmsg: Name rpmsg devices based on channel id")
    Acked-by: Peter Griffin
    Signed-off-by: Loic Pallardy
    [bjorn: flipped name and address in device name]
    Signed-off-by: Bjorn Andersson
    Signed-off-by: Greg Kroah-Hartman

    Loic Pallardy
     
  • commit 10ad1d754a434c024ce7eeb1cec9f69fd3ecc863 upstream.

    We return success or possibly uninitialized values on these error paths
    instead of proper error codes.

    Fixes: 140623410536 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller")
    Signed-off-by: Dan Carpenter
    Reviewed-by: Marek Vasut
    Reviewed-by: Moritz Fischer
    Signed-off-by: Cyrille Pitchen
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 193e87143c290ec16838f5368adc0e0bc94eb931 upstream.

    There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the >
    should be >=.

    Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller')
    Signed-off-by: Dan Carpenter
    Reviewed-by: Marek Vasut
    Signed-off-by: Cyrille Pitchen
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     
  • commit 73613b16cb5c5d5a659fc8832eff99eead3f9afb upstream.

    This patch fixes the bug of devfreq_add_device(). The devfreq device must
    have the default governor. If find_devfreq_governor() returns error,
    devfreq_add_device() fail to add the devfreq instance.

    Fixes: 1b5c1be2c88e (PM / devfreq: map devfreq drivers to governor using name)
    Signed-off-by: Chanwoo Choi
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Chanwoo Choi
     
  • commit 32dd7731699765f21dbe6df9020e613d4ed73fc3 upstream.

    This patch fixes the wrong return value. If devfreq driver requires the wrong
    and non-available governor, it is fail. So, this patch returns the error
    insead of -EPROBE_DEFER.

    Fixes: 403e0689d2a9 (PM / devfreq: exynos: Add support of bus frequency of sub-blocks using passive governor)
    Signed-off-by: Chanwoo Choi
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Chanwoo Choi
     
  • commit ffb58456589443ca572221fabbdef3db8483a779 upstream.

    mpt3sas has a firmware failure where it can only handle one pass through
    ATA command at a time. If another comes in, contrary to the SAT
    standard, it will hang until the first one completes (causing long
    commands like secure erase to timeout). The original fix was to block
    the device when an ATA command came in, but this caused a regression
    with

    commit 669f044170d8933c3d66d231b69ea97cb8447338
    Author: Bart Van Assche
    Date: Tue Nov 22 16:17:13 2016 -0800

    scsi: srp_transport: Move queuecommand() wait code to SCSI core

    So fix the original fix of the secure erase timeout by properly
    returning SAM_STAT_BUSY like the SAT recommends. The original patch
    also had a concurrency problem since scsih_qcmd is lockless at that
    point (this is fixed by using atomic bitops to set and test the flag).

    [mkp: addressed feedback wrt. test_bit and fixed whitespace]

    Fixes: 18f6084a989ba1b (mpt3sas: Fix secure erase premature termination)
    Signed-off-by: James Bottomley
    Acked-by: Sreekanth Reddy
    Reviewed-by: Christoph Hellwig
    Reported-by: Ingo Molnar
    Tested-by: Ingo Molnar
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    James Bottomley
     
  • commit 9373eba6cfae48911b977d14323032cd5d161aae upstream.

    The call to scsi_is_sas_rphy() needs to be made on the SAS end_device,
    not on the SCSI device.

    Fixes: 835831c57e9b ("ses: use scsi_is_sas_rphy instead of is_sas_attached")
    Signed-off-by: Ewan D. Milne
    Reviewed-by: Johannes Thumshirn
    Reviewed-by: James Bottomley
    Signed-off-by: Martin K. Petersen
    Signed-off-by: Greg Kroah-Hartman

    Ewan D. Milne
     
  • commit fff5d99225107f5f13fe4a9805adc2a1c4b5fb00 upstream.

    On architectures like arm64, swiotlb is tied intimately to the core
    architecture DMA support. In addition, ZONE_DMA cannot be disabled.

    To aid debugging and catch devices not supporting DMA to memory outside
    the 32-bit address space, add a kernel command line option
    "swiotlb=noforce", which disables the use of bounce buffers.
    If specified, trying to map memory that cannot be used with DMA will
    fail, and a rate-limited warning will be printed.

    Note that io_tlb_nslabs is set to 1, which is the minimal supported
    value.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     
  • commit ae7871be189cb41184f1e05742b4a99e2c59774d upstream.

    Convert the flag swiotlb_force from an int to an enum, to prepare for
    the advent of more possible values.

    Suggested-by: Konrad Rzeszutek Wilk
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Konrad Rzeszutek Wilk
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     
  • commit 524dabe1c68e0bca25ce7b108099e5d89472a101 upstream.

    Commit b67a8b29df introduced logic to skip swiotlb allocation when all memory
    is DMA accessible anyway.

    While this is a great idea, __dma_alloc still calls swiotlb code unconditionally
    to allocate memory when there is no CMA memory available. The swiotlb code is
    called to ensure that we at least try get_free_pages().

    Without initialization, swiotlb allocation code tries to access io_tlb_list
    which is NULL. That results in a stack trace like this:

    Unable to handle kernel NULL pointer dereference at virtual address 00000000
    [...]
    [] swiotlb_tbl_map_single+0xd0/0x2b0
    [] swiotlb_alloc_coherent+0x10c/0x198
    [] __dma_alloc+0x68/0x1a8
    [] drm_gem_cma_create+0x98/0x108 [drm]
    [] drm_fbdev_cma_create_with_funcs+0xbc/0x368 [drm_kms_helper]
    [] drm_fbdev_cma_create+0x2c/0x40 [drm_kms_helper]
    [] drm_fb_helper_initial_config+0x238/0x410 [drm_kms_helper]
    [] drm_fbdev_cma_init_with_funcs+0x98/0x160 [drm_kms_helper]
    [] drm_fbdev_cma_init+0x40/0x58 [drm_kms_helper]
    [] vc4_kms_load+0x90/0xf0 [vc4]
    [] vc4_drm_bind+0xec/0x168 [vc4]
    [...]

    Thankfully swiotlb code just learned how to not do allocations with the FORCE_NO
    option. This patch configures the swiotlb code to use that if we decide not to
    initialize the swiotlb framework.

    Fixes: b67a8b29df ("arm64: mm: only initialize swiotlb when necessary")
    Signed-off-by: Alexander Graf
    CC: Jisheng Zhang
    CC: Geert Uytterhoeven
    CC: Konrad Rzeszutek Wilk
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Alexander Graf
     
  • commit 1c8a946bf3754a59cba1fc373949a8114bfe5aaa upstream.

    The arm64 __page_to_voff() macro takes a parameter called 'page', and
    also refers to 'struct page'. Thus, if the value passed in is not
    called 'page', we'll refer to the wrong struct name (which might not
    exist).

    Fixes: 3fa72fe9c614 ("arm64: mm: fix __page_to_voff definition")
    Acked-by: Mark Rutland
    Suggested-by: Volodymyr Babchuk
    Signed-off-by: Oleksandr Andrushchenko
    Signed-off-by: Catalin Marinas
    Signed-off-by: Greg Kroah-Hartman

    Oleksandr Andrushchenko
     
  • commit 6d6bf72de914059b304f7b99530a7856e5c846aa upstream.

    Clean up: This message was intended to be a dprintk, as it is on the
    server-side.

    Fixes: 87cfb9a0c85c ('xprtrdma: Client-side support for ...')
    Signed-off-by: Chuck Lever
    Signed-off-by: Anna Schumaker
    Signed-off-by: Greg Kroah-Hartman

    Chuck Lever
     
  • commit 8d38de65644d900199f035277aa5f3da4aa9fc17 upstream.

    Verbs providers may perform house-keeping on the Send Queue during
    each signaled send completion. It is necessary therefore for a verbs
    consumer (like xprtrdma) to occasionally force a signaled send
    completion if it runs unsignaled most of the time.

    xprtrdma does not require signaled completions for Send or FastReg
    Work Requests, but does signal some LocalInv Work Requests. To
    ensure that Send Queue house-keeping can run before the Send Queue
    is more than half-consumed, xprtrdma forces a signaled completion
    on occasion by counting the number of Send Queue Entries it
    consumes. It currently does this by counting each ib_post_send as
    one Entry.

    Commit c9918ff56dfb ("xprtrdma: Add ro_unmap_sync method for FRWR")
    introduced the ability for frwr_op_unmap_sync to post more than one
    Work Request with a single post_send. Thus the underlying assumption
    of one Send Queue Entry per ib_post_send is no longer true.

    Also, FastReg Work Requests are currently never signaled. They
    should be signaled once in a while, just as Send is, to keep the
    accounting of consumed SQEs accurate.

    While we're here, convert the CQCOUNT macros to the currently
    preferred kernel coding style, which is inline functions.

    Fixes: c9918ff56dfb ("xprtrdma: Add ro_unmap_sync method for FRWR")
    Signed-off-by: Chuck Lever
    Signed-off-by: Anna Schumaker
    Signed-off-by: Greg Kroah-Hartman

    Chuck Lever
     
  • commit 124f930b8cbc4ac11236e6eb1c5f008318864588 upstream.

    ... otherwise the crypto stack will align it for us with a GFP_ATOMIC
    allocation and a memcpy() -- see skcipher_walk_first().

    Signed-off-by: Ilya Dryomov
    Signed-off-by: Greg Kroah-Hartman

    Ilya Dryomov
     
  • commit fe2ed42517533068ac03eed5630fffafff27eacf upstream.

    sparse says:

    fs/ceph/inode.c:308:36: warning: incorrect type in argument 1 (different base types)
    fs/ceph/inode.c:308:36: expected unsigned int [unsigned] [usertype] a
    fs/ceph/inode.c:308:36: got restricted __le32 [usertype] frag
    fs/ceph/inode.c:308:46: warning: incorrect type in argument 2 (different base types)
    fs/ceph/inode.c:308:46: expected unsigned int [unsigned] [usertype] b
    fs/ceph/inode.c:308:46: got restricted __le32 [usertype] frag

    We need to convert these values to host-endian before calling the
    comparator.

    Fixes: a407846ef7c6 ("ceph: don't assume frag tree splits in mds reply are sorted")
    Signed-off-by: Jeff Layton
    Reviewed-by: Sage Weil
    Signed-off-by: Ilya Dryomov
    Signed-off-by: Greg Kroah-Hartman

    Jeff Layton
     
  • commit 1097680d759918ce4a8705381c0ab2ed7bd60cf1 upstream.

    sparse says:

    fs/ceph/dir.c:1248:50: warning: incorrect type in assignment (different base types)
    fs/ceph/dir.c:1248:50: expected restricted __le32 [usertype] mask
    fs/ceph/dir.c:1248:50: got int [signed] [assigned] mask

    Fixes: 200fd27c8fa2 ("ceph: use lookup request to revalidate dentry")
    Signed-off-by: Jeff Layton
    Reviewed-by: Sage Weil
    Signed-off-by: Ilya Dryomov
    Signed-off-by: Greg Kroah-Hartman

    Jeff Layton
     
  • commit 6e09d0fb64402cec579f029ca4c7f39f5c48fc60 upstream.

    Commit 5c341ee32881 ("ceph: fix scheduler warning due to nested
    blocking") causes infinite loop when process is interrupted. Fix it.

    Signed-off-by: Yan, Zheng
    Signed-off-by: Ilya Dryomov
    Signed-off-by: Greg Kroah-Hartman

    Yan, Zheng
     
  • commit 5c341ee32881c554727ec14b71ec3e8832f01989 upstream.

    try_get_cap_refs can be used as a condition in a wait_event* calls.
    This is all fine until it has to call __ceph_do_pending_vmtruncate,
    which in turn acquires the i_truncate_mutex. This leads to a situation
    in which a task's state is !TASK_RUNNING and at the same time it's
    trying to acquire a sleeping primitive. In essence a nested sleeping
    primitives are being used. This causes the following warning:

    WARNING: CPU: 22 PID: 11064 at kernel/sched/core.c:7631 __might_sleep+0x9f/0xb0()
    do not call blocking ops when !TASK_RUNNING; state=1 set at [] prepare_to_wait_event+0x5d/0x110
    ipmi_msghandler tcp_scalable ib_qib dca ib_mad ib_core ib_addr ipv6
    CPU: 22 PID: 11064 Comm: fs_checker.pl Tainted: G O 4.4.20-clouder2 #6
    Hardware name: Supermicro X10DRi/X10DRi, BIOS 1.1a 10/16/2015
    0000000000000000 ffff8838b416fa88 ffffffff812f4409 ffff8838b416fad0
    ffffffff81a034f2 ffff8838b416fac0 ffffffff81052b46 ffffffff81a0432c
    0000000000000061 0000000000000000 0000000000000000 ffff88167bda54a0
    Call Trace:
    [] dump_stack+0x67/0x9e
    [] warn_slowpath_common+0x86/0xc0
    [] warn_slowpath_fmt+0x4c/0x50
    [] ? prepare_to_wait_event+0x5d/0x110
    [] ? prepare_to_wait_event+0x5d/0x110
    [] __might_sleep+0x9f/0xb0
    [] mutex_lock+0x20/0x40
    [] __ceph_do_pending_vmtruncate+0x44/0x1a0 [ceph]
    [] try_get_cap_refs+0xa2/0x320 [ceph]
    [] ceph_get_caps+0x255/0x2b0 [ceph]
    [] ? wait_woken+0xb0/0xb0
    [] ceph_write_iter+0x2b1/0xde0 [ceph]
    [] ? schedule_timeout+0x202/0x260
    [] ? kmem_cache_free+0x1ea/0x200
    [] ? iput+0x9e/0x230
    [] ? __might_sleep+0x52/0xb0
    [] ? __might_fault+0x37/0x40
    [] ? cp_new_stat+0x153/0x170
    [] __vfs_write+0xaa/0xe0
    [] vfs_write+0xa9/0x190
    [] ? set_close_on_exec+0x31/0x70
    [] SyS_write+0x46/0xa0

    This happens since wait_event_interruptible can interfere with the
    mutex locking code, since they both fiddle with the task state.

    Fix the issue by using the newly-added nested blocking infrastructure
    in 61ada528dea0 ("sched/wait: Provide infrastructure to deal with
    nested blocking")

    Link: https://lwn.net/Articles/628628/
    Signed-off-by: Nikolay Borisov
    Signed-off-by: Yan, Zheng
    Signed-off-by: Greg Kroah-Hartman

    Nikolay Borisov
     
  • commit 90f92c631b210c1e97080b53a9d863783281a932 upstream.

    The following patch was sketched by Russell in response to my
    crashes on the PB11MPCore after the patch for software-based
    priviledged no access support for ARMv8.1. See this thread:
    http://marc.info/?l=linux-arm-kernel&m=144051749807214&w=2

    I am unsure what is going on, I suspect everyone involved in
    the discussion is. I just want to repost this to get the
    discussion restarted, as I still have to apply this patch
    with every kernel iteration to get my PB11MPCore Realview
    running.

    Testing by Neil Armstrong on the Oxnas NAS has revealed that
    this bug exist also on that widely deployed hardware, so
    we are probably currently regressing all ARM11MPCore systems.

    Cc: Russell King
    Cc: Will Deacon
    Fixes: a5e090acbf54 ("ARM: software-based priviledged-no-access support")
    Tested-by: Neil Armstrong
    Signed-off-by: Linus Walleij
    Signed-off-by: Russell King
    Signed-off-by: Greg Kroah-Hartman

    Linus Walleij
     
  • commit f0e8faa7a5e894b0fc99d24be1b18685a92ea466 upstream.

    This function clearly never worked and always returns true,
    as pointed out by gcc-7:

    arch/arm/mach-ux500/pm.c: In function 'prcmu_is_cpu_in_wfi':
    arch/arm/mach-ux500/pm.c:137:212: error: ?:
    using integer constants in boolean context, the expression
    will always evaluate to 'true' [-Werror=int-in-bool-context]

    With the added braces, the condition actually makes sense.

    Fixes: 34fe6f107eab ("mfd : Check if the other db8500 core is in WFI")
    Signed-off-by: Arnd Bergmann
    Acked-by: Daniel Lezcano
    Signed-off-by: Linus Walleij
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 1ea6af3216b092ec97129ac81bd95cf254c4b140 upstream.

    This fixes commit ab8dd3aed011 ("ARM: DTS: Add minimal Support for
    Logic PD DM3730 SOM-LV") where the Card Detect and Write Protect
    pins were improperly configured.

    Fixes: ab8dd3aed011 ("ARM: DTS: Add minimal Support for Logic PD DM3730 SOM-LV")
    Signed-off-by: Adam Ford
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Adam Ford
     
  • commit 6ab5c2b662e2dcbb964099bf7f19e9dbc9ae5a41 upstream.

    This patch fixes the following error:
    sgtl5000 0-000a: Error reading chip id -6
    imx-sgtl5000 sound: ASoC: CODEC DAI sgtl5000 not registered
    imx-sgtl5000 sound: snd_soc_register_card failed (-517)

    The problem was that the pinctrl group was linked to the sound driver
    instead of the codec node. Since the codec is probed first, the sys_mclk
    was missing and it would therefore fail to initialize.

    Fixes: b32e700256bc ("ARM: dts: imx: add Boundary Devices Nitrogen6_Max board")
    Signed-off-by: Gary Bisson
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Gary Bisson
     
  • commit 3d37d41a148c32389ed360e10a9f8a7cd37ce166 upstream.

    Commit d1f3156fc8c7 ("ARM: dts: omap2: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: d1f3156fc8c7 ("ARM: dts: omap2: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas
     
  • commit 23ab4c6183ac0679d80888b5c4cc1d528fcc21c2 upstream.

    Commit 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage")
    removed the skeleton.dtsi usage since we want to get rid of it.

    But this can cause issues when booting a kernel with a boot-loader
    that doesn't create a chosen node if this isn't present in the DTB
    since the decompressor relies on a pre-existing chosen node to be
    available to insert the command line and merge other ATAGS info.

    Fixes: 008a2ebcd677 ("ARM: dts: omap3: Remove skeleton.dtsi usage")
    Reported-by: Pali Rohar
    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Javier Martinez Canillas