1. 07 Sep, 2016 32 commits
  2. 20 Aug, 2016 8 commits
    • Greg Kroah-Hartman's avatar
      Linux 4.7.2 · 84fae3f8
      Greg Kroah-Hartman authored
      84fae3f8
    • Yoshihiro Shimoda's avatar
      phy: rcar-gen3-usb2: fix mutex_lock calling in interrupt · 300a15d7
      Yoshihiro Shimoda authored
      commit c14f8a40 upstream.
      
      This patch fixes an issue that the extcon_set_cable_state_() is possible
      to cause "BUG: scheduling while atomic" because this driver calls
      extcon_set_cable_state_() in the interrupt handler and mutex_lock()
      is possible to be called by like the following call trace.
      So, this patch adds a workqueue function to resolve this issue.
      
      [    9.706504] BUG: scheduling while atomic: systemd-journal/25893/0x00010303
      [    9.714569] Modules linked in:
      [    9.717629] CPU: 0 PID: 25893 Comm: systemd-journal Not tainted 4.7.0-rc4+ #86
      [    9.724844] Hardware name: Renesas Salvator-X board based on r8a7795 (DT)
      [    9.731624] Call trace:
      [    9.734077] [<ffff0000080889f0>] dump_backtrace+0x0/0x1a8
      [    9.739470] [<ffff000008088bac>] show_stack+0x14/0x20
      [    9.744520] [<ffff000008348ab4>] dump_stack+0x94/0xb8
      [    9.749568] [<ffff0000080da18c>] __schedule_bug+0x44/0x58
      [    9.754966] [<ffff0000087c6394>] __schedule+0x4e4/0x598
      [    9.760185] [<ffff0000087c6484>] schedule+0x3c/0xa8
      [    9.765057] [<ffff0000087c6928>] schedule_preempt_disabled+0x20/0x38
      [    9.771408] [<ffff0000080f20dc>] mutex_optimistic_spin+0x18c/0x1d0
      [    9.777583] [<ffff0000087c7ef0>] __mutex_lock_slowpath+0x38/0x140
      [    9.783669] [<ffff0000087c803c>] mutex_lock+0x44/0x60
      [    9.788717] [<ffff00000834ca48>] kobject_uevent_env+0x250/0x500
      [    9.794634] [<ffff0000086ae8c0>] extcon_update_state+0x220/0x298
      [    9.800634] [<ffff0000086ae9d8>] extcon_set_cable_state_+0x78/0x88
      [    9.806812] [<ffff000008376004>] rcar_gen3_device_recognition+0x5c/0xe0
      [    9.813420] [<ffff0000083761bc>] rcar_gen3_phy_usb2_irq+0x3c/0x48
      [    9.819509] [<ffff0000080fae94>] handle_irq_event_percpu+0x94/0x140
      [    9.825769] [<ffff0000080faf88>] handle_irq_event+0x48/0x78
      [    9.831334] [<ffff0000080fe620>] handle_fasteoi_irq+0xb8/0x1b0
      [    9.837162] [<ffff0000080fa3c4>] generic_handle_irq+0x24/0x38
      [    9.842900] [<ffff0000080fa6fc>] __handle_domain_irq+0x5c/0xb8
      [    9.848727] [<ffff000008081520>] gic_handle_irq+0x58/0xb0
      Reported-by: default avatarSimon Horman <horms@verge.net.au>
      Fixes: 2b38543c ("phy: rcar-gen3-usb2: add extcon support")
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      300a15d7
    • Ben Hutchings's avatar
      Documentation/module-signing.txt: Note need for version info if reusing a key · 799c8305
      Ben Hutchings authored
      commit b8612e51 upstream.
      
      Signing a module should only make it trusted by the specific kernel it
      was built for, not anything else.  If a module signing key is used for
      multiple ABI-incompatible kernels, the modules need to include enough
      version information to distinguish them.
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      799c8305
    • Ben Hutchings's avatar
      module: Invalidate signatures on force-loaded modules · c528032b
      Ben Hutchings authored
      commit bca014ca upstream.
      
      Signing a module should only make it trusted by the specific kernel it
      was built for, not anything else.  Loading a signed module meant for a
      kernel with a different ABI could have interesting effects.
      Therefore, treat all signatures as invalid when a module is
      force-loaded.
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c528032b
    • Mike Snitzer's avatar
      dm flakey: error READ bios during the down_interval · dbf8fc37
      Mike Snitzer authored
      commit 99f3c90d upstream.
      
      When the corrupt_bio_byte feature was introduced it caused READ bios to
      no longer be errored with -EIO during the down_interval.  This had to do
      with the complexity of needing to submit READs if the corrupt_bio_byte
      feature was used.
      
      Fix it so READ bios are properly errored with -EIO; doing so early in
      flakey_map() as long as there isn't a match for the corrupt_bio_byte
      feature.
      
      Fixes: a3998799 ("dm flakey: add corrupt_bio_byte feature")
      Reported-by: default avatarAkira Hayakawa <ruby.wktk@gmail.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dbf8fc37
    • Alim Akhtar's avatar
      rtc: s3c: Add s3c_rtc_{enable/disable}_clk in s3c_rtc_setfreq() · 5dac5e40
      Alim Akhtar authored
      commit 70c96dfa upstream.
      
      As per code flow s3c_rtc_setfreq() will get called with rtc clock disabled
      and in set_freq we perform h/w registers read/write, which results in a
      kernel crash on exynos7 platform while probing rtc driver.
      Below is code flow:
      s3c_rtc_probe()
          clk_prepare_enable(info->rtc_clk) // rtc clock enabled
          s3c_rtc_gettime() // will enable clk if not done, and disable it upon exit
          s3c_rtc_setfreq() //then this will be called with clk disabled
      
      This patch take cares of such issue by adding s3c_rtc_{enable/disable}_clk in
      s3c_rtc_setfreq().
      
      Fixes: 24e14554 ("drivers/rtc/rtc-s3c.c: delete duplicate clock control")
      Signed-off-by: default avatarAlim Akhtar <alim.akhtar@samsung.com>
      Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Reviewed-by: default avatarPankaj Dubey <pankaj.dubey@samsung.com>
      Tested-by: default avatarPankaj Dubey <pankaj.dubey@samsung.com>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5dac5e40
    • Mauricio Faria de Oliveira's avatar
      lpfc: fix oops in lpfc_sli4_scmd_to_wqidx_distr() from lpfc_send_taskmgmt() · e055ad0f
      Mauricio Faria de Oliveira authored
      commit 05a05872 upstream.
      
      The lpfc_sli4_scmd_to_wqidx_distr() function expects the scsi_cmnd
      'lpfc_cmd->pCmd' not to be null, and point to the midlayer command.
      
      That's not true in the .eh_(device|target|bus)_reset_handler path,
      because lpfc_send_taskmgmt() sends commands not from the midlayer, so
      does not set 'lpfc_cmd->pCmd'.
      
      That is true in the .queuecommand path because lpfc_queuecommand()
      stores the scsi_cmnd from midlayer in lpfc_cmd->pCmd; and lpfc_cmd is
      stored by lpfc_scsi_prep_cmnd() in piocbq->context1 -- which is passed
      to lpfc_sli4_scmd_to_wqidx_distr() as lpfc_cmd parameter.
      
      This problem can be hit on SCSI EH, and immediately with sg_reset.
      These 2 test-cases demonstrate the problem/fix with next-20160601.
      
      Test-case 1) sg_reset
      
          # strace sg_reset --device /dev/sdm
          <...>
          open("/dev/sdm", O_RDWR|O_NONBLOCK)     = 3
          ioctl(3, SG_SCSI_RESET, 0x3fffde6d0994 <unfinished ...>
          +++ killed by SIGSEGV +++
          Segmentation fault
      
          # dmesg
          Unable to handle kernel paging request for data at address 0x00000000
          Faulting instruction address: 0xd00000001c88442c
          Oops: Kernel access of bad area, sig: 11 [#1]
          <...>
          CPU: 104 PID: 16333 Comm: sg_reset Tainted: G        W       4.7.0-rc1-next-20160601-00004-g95b89dc #6
          <...>
          NIP [d00000001c88442c] lpfc_sli4_scmd_to_wqidx_distr+0xc/0xd0 [lpfc]
          LR [d00000001c826fe8] lpfc_sli_calc_ring.part.27+0x98/0xd0 [lpfc]
          Call Trace:
          [c000003c9ec876f0] [c000003c9ec87770] 0xc000003c9ec87770 (unreliable)
          [c000003c9ec87720] [d00000001c82e004] lpfc_sli_issue_iocb+0xd4/0x260 [lpfc]
          [c000003c9ec87780] [d00000001c831a3c] lpfc_sli_issue_iocb_wait+0x15c/0x5b0 [lpfc]
          [c000003c9ec87880] [d00000001c87f27c] lpfc_send_taskmgmt+0x24c/0x650 [lpfc]
          [c000003c9ec87950] [d00000001c87fd7c] lpfc_device_reset_handler+0x10c/0x200 [lpfc]
          [c000003c9ec87a10] [c000000000610694] scsi_try_bus_device_reset+0x44/0xc0
          [c000003c9ec87a40] [c0000000006113e8] scsi_ioctl_reset+0x198/0x2c0
          [c000003c9ec87bf0] [c00000000060fe5c] scsi_ioctl+0x13c/0x4b0
          [c000003c9ec87c80] [c0000000006629b0] sd_ioctl+0xf0/0x120
          [c000003c9ec87cd0] [c00000000046e4f8] blkdev_ioctl+0x248/0xb70
          [c000003c9ec87d30] [c0000000002a1f60] block_ioctl+0x70/0x90
          [c000003c9ec87d50] [c00000000026d334] do_vfs_ioctl+0xc4/0x890
          [c000003c9ec87de0] [c00000000026db60] SyS_ioctl+0x60/0xc0
          [c000003c9ec87e30] [c000000000009120] system_call+0x38/0x108
          Instruction dump:
          <...>
      
          With fix:
      
          # strace sg_reset --device /dev/sdm
          <...>
          open("/dev/sdm", O_RDWR|O_NONBLOCK)     = 3
          ioctl(3, SG_SCSI_RESET, 0x3fffe103c554) = 0
          close(3)                                = 0
          exit_group(0)                           = ?
          +++ exited with 0 +++
      
          # dmesg
          [  424.658649] lpfc 0006:01:00.4: 4:(0):0713 SCSI layer issued Device Reset (1, 0) return x2002
      
      Test-case 2) SCSI EH
      
          Using this debug patch to wire an SCSI EH trigger, for lpfc_scsi_cmd_iocb_cmpl():
          -       cmd->scsi_done(cmd);
          +       if ((phba->pport ? phba->pport->cfg_log_verbose : phba->cfg_log_verbose) == 0x32100000)
          +               printk(KERN_ALERT "lpfc: skip scsi_done()\n");
          +       else
          +               cmd->scsi_done(cmd);
      
          # echo 0x32100000 > /sys/class/scsi_host/host11/lpfc_log_verbose
      
          # dd if=/dev/sdm of=/dev/null iflag=direct &
          <...>
      
          After a while:
      
          # dmesg
          lpfc 0006:01:00.4: 4:(0):3053 lpfc_log_verbose changed from 0 (x0) to 839909376 (x32100000)
          lpfc: skip scsi_done()
          <...>
          Unable to handle kernel paging request for data at address 0x00000000
          Faulting instruction address: 0xd0000000199e448c
          Oops: Kernel access of bad area, sig: 11 [#1]
          <...>
          CPU: 96 PID: 28556 Comm: scsi_eh_11 Tainted: G        W       4.7.0-rc1-next-20160601-00004-g95b89dc #6
          <...>
          NIP [d0000000199e448c] lpfc_sli4_scmd_to_wqidx_distr+0xc/0xd0 [lpfc]
          LR [d000000019986fe8] lpfc_sli_calc_ring.part.27+0x98/0xd0 [lpfc]
          Call Trace:
          [c000000ff0d0b890] [c000000ff0d0b900] 0xc000000ff0d0b900 (unreliable)
          [c000000ff0d0b8c0] [d00000001998e004] lpfc_sli_issue_iocb+0xd4/0x260 [lpfc]
          [c000000ff0d0b920] [d000000019991a3c] lpfc_sli_issue_iocb_wait+0x15c/0x5b0 [lpfc]
          [c000000ff0d0ba20] [d0000000199df27c] lpfc_send_taskmgmt+0x24c/0x650 [lpfc]
          [c000000ff0d0baf0] [d0000000199dfd7c] lpfc_device_reset_handler+0x10c/0x200 [lpfc]
          [c000000ff0d0bbb0] [c000000000610694] scsi_try_bus_device_reset+0x44/0xc0
          [c000000ff0d0bbe0] [c0000000006126cc] scsi_eh_ready_devs+0x49c/0x9c0
          [c000000ff0d0bcb0] [c000000000614160] scsi_error_handler+0x580/0x680
          [c000000ff0d0bd80] [c0000000000ae848] kthread+0x108/0x130
          [c000000ff0d0be30] [c0000000000094a8] ret_from_kernel_thread+0x5c/0xb4
          Instruction dump:
          <...>
      
          With fix:
      
          # dmesg
          lpfc 0006:01:00.4: 4:(0):3053 lpfc_log_verbose changed from 0 (x0) to 839909376 (x32100000)
          lpfc: skip scsi_done()
          <...>
          lpfc 0006:01:00.4: 4:(0):0713 SCSI layer issued Device Reset (0, 0) return x2002
          <...>
          lpfc 0006:01:00.4: 4:(0):0723 SCSI layer issued Target Reset (1, 0) return x2002
          <...>
          lpfc 0006:01:00.4: 4:(0):0714 SCSI layer issued Bus Reset Data: x2002
          <...>
          lpfc 0006:01:00.4: 4:(0):3172 SCSI layer issued Host Reset Data:
          <...>
      
      Fixes: 8b0dff14 ("lpfc: Add support for using block multi-queue")
      Signed-off-by: default avatarMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
      Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Acked-by: default avatarJames Smart <james.smart@broadcom.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e055ad0f
    • Lv Zheng's avatar
      ACPI / EC: Work around method reentrancy limit in ACPICA for _Qxx · eba117fe
      Lv Zheng authored
      commit e1191bd4 upstream.
      
      A regression is caused by the following commit:
      
        Commit: 02b771b6
        Subject: ACPI / EC: Fix an issue caused by the serialized _Qxx evaluations
      
      In this commit, using system workqueue causes that the maximum parallel
      executions of _Qxx can exceed 255. This violates the method reentrancy
      limit in ACPICA and generates the following error log:
      
        ACPI Error: Method reached maximum reentrancy limit (255) (20150818/dsmethod-341)
      
      This patch creates a seperate workqueue and limits the number of parallel
      _Qxx evaluations down to a configurable value (can be tuned against number
      of online CPUs).
      
      Since EC events are handled after driver probe, we can create the workqueue
      in acpi_ec_init().
      
      Fixes: 02b771b6 (ACPI / EC: Fix an issue caused by the serialized _Qxx evaluations)
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=135691Reported-and-tested-by: default avatarHelen Buus <ubuntu@hbuus.com>
      Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eba117fe