Skip to content
Snippets Groups Projects
  1. Jun 16, 2020
  2. Jun 15, 2020
  3. Jun 13, 2020
    • Masahiro Yamada's avatar
      treewide: replace '---help---' in Kconfig files with 'help' · a7f7f624
      Masahiro Yamada authored
      
      Since commit 84af7a61 ("checkpatch: kconfig: prefer 'help' over
      '---help---'"), the number of '---help---' has been gradually
      decreasing, but there are still more than 2400 instances.
      
      This commit finishes the conversion. While I touched the lines,
      I also fixed the indentation.
      
      There are a variety of indentation styles found.
      
        a) 4 spaces + '---help---'
        b) 7 spaces + '---help---'
        c) 8 spaces + '---help---'
        d) 1 space + 1 tab + '---help---'
        e) 1 tab + '---help---'    (correct indentation)
        f) 1 tab + 1 space + '---help---'
        g) 1 tab + 2 spaces + '---help---'
      
      In order to convert all of them to 1 tab + 'help', I ran the
      following commend:
      
        $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      a7f7f624
  4. Jun 10, 2020
  5. Jun 09, 2020
    • Mike Rapoport's avatar
      mm: reorder includes after introduction of linux/pgtable.h · 65fddcfc
      Mike Rapoport authored
      
      The replacement of <asm/pgrable.h> with <linux/pgtable.h> made the include
      of the latter in the middle of asm includes.  Fix this up with the aid of
      the below script and manual adjustments here and there.
      
      	import sys
      	import re
      
      	if len(sys.argv) is not 3:
      	    print "USAGE: %s <file> <header>" % (sys.argv[0])
      	    sys.exit(1)
      
      	hdr_to_move="#include <linux/%s>" % sys.argv[2]
      	moved = False
      	in_hdrs = False
      
      	with open(sys.argv[1], "r") as f:
      	    lines = f.readlines()
      	    for _line in lines:
      		line = _line.rstrip('
      ')
      		if line == hdr_to_move:
      		    continue
      		if line.startswith("#include <linux/"):
      		    in_hdrs = True
      		elif not moved and in_hdrs:
      		    moved = True
      		    print hdr_to_move
      		print line
      
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200514170327.31389-4-rppt@kernel.org
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      65fddcfc
    • Mike Rapoport's avatar
      mm: introduce include/linux/pgtable.h · ca5999fd
      Mike Rapoport authored
      
      The include/linux/pgtable.h is going to be the home of generic page table
      manipulation functions.
      
      Start with moving asm-generic/pgtable.h to include/linux/pgtable.h and
      make the latter include asm/pgtable.h.
      
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200514170327.31389-3-rppt@kernel.org
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ca5999fd
    • Mike Rapoport's avatar
      mm: don't include asm/pgtable.h if linux/mm.h is already included · e31cf2f4
      Mike Rapoport authored
      
      Patch series "mm: consolidate definitions of page table accessors", v2.
      
      The low level page table accessors (pXY_index(), pXY_offset()) are
      duplicated across all architectures and sometimes more than once.  For
      instance, we have 31 definition of pgd_offset() for 25 supported
      architectures.
      
      Most of these definitions are actually identical and typically it boils
      down to, e.g.
      
      static inline unsigned long pmd_index(unsigned long address)
      {
              return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
      }
      
      static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
      {
              return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
      }
      
      These definitions can be shared among 90% of the arches provided
      XYZ_SHIFT, PTRS_PER_XYZ and xyz_page_vaddr() are defined.
      
      For architectures that really need a custom version there is always
      possibility to override the generic version with the usual ifdefs magic.
      
      These patches introduce include/linux/pgtable.h that replaces
      include/asm-generic/pgtable.h and add the definitions of the page table
      accessors to the new header.
      
      This patch (of 12):
      
      The linux/mm.h header includes <asm/pgtable.h> to allow inlining of the
      functions involving page table manipulations, e.g.  pte_alloc() and
      pmd_alloc().  So, there is no point to explicitly include <asm/pgtable.h>
      in the files that include <linux/mm.h>.
      
      The include statements in such cases are remove with a simple loop:
      
      	for f in $(git grep -l "include <linux/mm.h>") ; do
      		sed -i -e '/include <asm\/pgtable.h>/ d' $f
      	done
      
      Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Cain <bcain@codeaurora.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Ley Foon Tan <ley.foon.tan@intel.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Mike Rapoport <rppt@kernel.org>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Stafford Horne <shorne@gmail.com>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vincent Chen <deanbo422@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Link: http://lkml.kernel.org/r/20200514170327.31389-1-rppt@kernel.org
      Link: http://lkml.kernel.org/r/20200514170327.31389-2-rppt@kernel.org
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e31cf2f4
  6. Jun 04, 2020
  7. Jun 03, 2020
  8. Jun 02, 2020
    • Christoph Hellwig's avatar
      mm: remove the pgprot argument to __vmalloc · 88dca4ca
      Christoph Hellwig authored
      
      The pgprot argument to __vmalloc is always PAGE_KERNEL now, so remove it.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: Michael Kelley <mikelley@microsoft.com> [hyperv]
      Acked-by: Gao Xiang <xiang@kernel.org> [erofs]
      Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWei Liu <wei.liu@kernel.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Christophe Leroy <christophe.leroy@c-s.fr>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Laura Abbott <labbott@redhat.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Sumit Semwal <sumit.semwal@linaro.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Paul Mackerras <paulus@ozlabs.org>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Will Deacon <will@kernel.org>
      Link: http://lkml.kernel.org/r/20200414131348.444715-22-hch@lst.de
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      88dca4ca
  9. May 29, 2020
    • Al Viro's avatar
      lpfc_debugfs: get rid of pointless access_ok() · e6c0433e
      Al Viro authored
      
      	No, you do NOT need to "protect copy from user" that way.
      Incidentally, your userland ABI stinks.  I understand that you
      wanted to accept "reset" and "reset\n" as equivalent, but I suspect
      that accepting "reset this, you !@^!@!" had been an accident.
      Nothing to do about that now - it is a userland ABI...
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      e6c0433e
  10. May 27, 2020
    • James Smart's avatar
      lpfc: Fix return value in __lpfc_nvme_ls_abort · 6b6e8963
      James Smart authored
      
      A static checker reported the following issue:
        drivers/scsi/lpfc/lpfc_nvmet.c:1366 lpfc_nvmet_ls_abort()
        warn: 'ret' can be either negative or positive
      
      The comment indicates a non-zero value indicates error in the
      form of -Exxx, but the code is returning "1".
      
      Fix the code to return -EINVAL to be compliant to comment.
      
      Fixes: e96a22b0 ("lpfc: Refactor Send LS Abort support")
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
      Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      6b6e8963
    • James Smart's avatar
      lpfc: fix axchg pointer reference after free and double frees · 4e57e0b9
      James Smart authored
      
      The axchg structure is a structure allocated early in the
      lpfc_nvme_unsol_ls_handler() to represent the newly received exchange.
      Upon error, the out_fail path in the routine unconditionally frees the
      pointer, yet subsequently passes the pointer to the abort routine.
      Additionally, the abort routine, lpfc_nvme_unsol_ls_issue_abort(), also
      has a failure path that will attempt to delete the pointer on error.
      
      Fix these errors by:
      - Removing the unconditional free so that it stays valid if passed
        to the abort routine.
      - Revise the abort routine to not free the pointer. Instead, return
        a success/failure status. Note: if success, the later completion of
        the abort frees the structure.
      - Back in the unsol_ls_handler() error path, if the abort routine was
        skipped (thus no possible reference) or the abort routine returned
        error, free the pointer.
      
      Fixes: 3a8070c5 ("lpfc: Refactor NVME LS receive handling")
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
      Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
      Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      4e57e0b9
    • James Smart's avatar
      lpfc: Fix pointer checks and comments in LS receive refactoring · fcdd14b8
      James Smart authored
      
      Additional testing encountered null pointers that weren't fully qualified
      in lpfc_nvmet_xmt_ls_abort_cmp() and lpfc_nvmet_unsol_issue_abort().
      
      The same error was detected and reported by static checker reporting:
        drivers/scsi/lpfc/lpfc_sli.c:2905 lpfc_nvme_unsol_ls_handler()
        error: we previously assumed 'phba->targetport' could be null
          (see line 2837)
      
      Fix by making phba->nvmet_support and phba->targetport validity checks
      in lpfc_nvmet_xmt_ls_abort_cmp() and lpfc_nvmet_unsol_issue_abort().
      
      Fixes: 3a8070c5 (“lpfc: Refactor NVME LS receive handling”)
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarPaul Ely <paul.ely@broadcom.com>
      Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
      Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      fcdd14b8
    • Vignesh Raghavendra's avatar
      scsi: ufs: ti-j721e-ufs: Fix unwinding of pm_runtime changes · 22617e21
      Vignesh Raghavendra authored
      Fix unwinding of pm_runtime changes when bailing out of driver probe due to
      a failure and also on removal of driver.
      
      Link: https://lore.kernel.org/r/20200526100340.15032-1-vigneshr@ti.com
      
      
      Fixes: 6979e56c ("scsi: ufs: Add driver for TI wrapper for Cadence UFS IP")
      Reported-by: default avatarDinghao Liu <dinghao.liu@zju.edu.cn>
      Signed-off-by: default avatarVignesh Raghavendra <vigneshr@ti.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      22617e21
    • Dan Carpenter's avatar
      scsi: cxgb3i: Fix some leaks in init_act_open() · b6170a49
      Dan Carpenter authored
      There wasn't any clean up done if cxgb3_alloc_atid() failed and also the
      original code didn't release "csk->l2t".
      
      Link: https://lore.kernel.org/r/20200521121221.GA247492@mwanda
      
      
      Fixes: 6f7efaab ("[SCSI] cxgb3i: change cxgb3i to use libcxgbi")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      b6170a49
    • Chen Tao's avatar
      scsi: ibmvscsi: Make some functions static · 1f93ad17
      Chen Tao authored
      Fix the following warning:
      
      drivers/scsi/ibmvscsi/ibmvscsi.c:2387:12: warning: symbol
      'ibmvscsi_module_init' was not declared. Should it be static?
      drivers/scsi/ibmvscsi/ibmvscsi.c:2409:13: warning: symbol
      'ibmvscsi_module_exit' was not declared. Should it be static?
      
      Link: https://lore.kernel.org/r/20200520091036.247286-1-chentao107@huawei.com
      
      
      Signed-off-by: default avatarChen Tao <chentao107@huawei.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      1f93ad17
    • Gabriel Krisman Bertazi's avatar
      scsi: iscsi: Fix deadlock on recovery path during GFP_IO reclaim · 7e7cd796
      Gabriel Krisman Bertazi authored
      iSCSI suffers from a deadlock in case a management command submitted via
      the netlink socket sleeps on an allocation while holding the rx_queue_mutex
      if that allocation causes a memory reclaim that writebacks to a failed
      iSCSI device.  The recovery procedure can never make progress to recover
      the failed disk or abort outstanding IO operations to complete the reclaim
      (since rx_queue_mutex is locked), thus locking the system.
      
      Nevertheless, just marking all allocations under rx_queue_mutex as GFP_NOIO
      (or locking the userspace process with something like PF_MEMALLOC_NOIO) is
      not enough, since the iSCSI command code relies on other subsystems that
      try to grab locked mutexes, whose threads are GFP_IO, leading to the same
      deadlock. One instance where this situation can be observed is in the
      backtraces below, stitched from multiple bugs reports, involving the kobj
      uevent sent when a session is created.
      
      The root of the problem is not the fact that iSCSI does GFP_IO allocations,
      that is acceptable. The actual problem is that rx_queue_mutex has a very
      large granularity, covering every unrelated netlink command execution at
      the same time as the error recovery path.
      
      The proposed fix leverages the recently added mechanism to stop failed
      connections from the kernel, by enabling it to execute even though a
      management command from the netlink socket is being run (rx_queue_mutex is
      held), provided that the command is known to be safe.  It splits the
      rx_queue_mutex in two mutexes, one protecting from concurrent command
      execution from the netlink socket, and one protecting stop_conn from racing
      with other connection management operations that might conflict with it.
      
      It is not very pretty, but it is the simplest way to resolve the deadlock.
      I considered making it a lock per connection, but some external mutex would
      still be needed to deal with iscsi_if_destroy_conn.
      
      The patch was tested by forcing a memory shrinker (unrelated, but used
      bufio/dm-verity) to reclaim iSCSI pages every time
      ISCSI_UEVENT_CREATE_SESSION happens, which is reasonable to simulate
      reclaims that might happen with GFP_KERNEL on that path.  Then, a faulty
      hung target causes a connection to fail during intensive IO, at the same
      time a new session is added by iscsid.
      
      The following stacktraces are stiches from several bug reports, showing a
      case where the deadlock can happen.
      
       iSCSI-write
               holding: rx_queue_mutex
               waiting: uevent_sock_mutex
      
               kobject_uevent_env+0x1bd/0x419
               kobject_uevent+0xb/0xd
               device_add+0x48a/0x678
               scsi_add_host_with_dma+0xc5/0x22d
               iscsi_host_add+0x53/0x55
               iscsi_sw_tcp_session_create+0xa6/0x129
               iscsi_if_rx+0x100/0x1247
               netlink_unicast+0x213/0x4f0
               netlink_sendmsg+0x230/0x3c0
      
       iscsi_fail iscsi_conn_failure
               waiting: rx_queue_mutex
      
               schedule_preempt_disabled+0x325/0x734
               __mutex_lock_slowpath+0x18b/0x230
               mutex_lock+0x22/0x40
               iscsi_conn_failure+0x42/0x149
               worker_thread+0x24a/0xbc0
      
       EventManager_
               holding: uevent_sock_mutex
               waiting: dm_bufio_client->lock
      
               dm_bufio_lock+0xe/0x10
               shrink+0x34/0xf7
               shrink_slab+0x177/0x5d0
               do_try_to_free_pages+0x129/0x470
               try_to_free_mem_cgroup_pages+0x14f/0x210
               memcg_kmem_newpage_charge+0xa6d/0x13b0
               __alloc_pages_nodemask+0x4a3/0x1a70
               fallback_alloc+0x1b2/0x36c
               __kmalloc_node_track_caller+0xb9/0x10d0
               __alloc_skb+0x83/0x2f0
               kobject_uevent_env+0x26b/0x419
               dm_kobject_uevent+0x70/0x79
               dev_suspend+0x1a9/0x1e7
               ctl_ioctl+0x3e9/0x411
               dm_ctl_ioctl+0x13/0x17
               do_vfs_ioctl+0xb3/0x460
               SyS_ioctl+0x5e/0x90
      
       MemcgReclaimerD"
               holding: dm_bufio_client->lock
               waiting: stuck io to finish (needs iscsi_fail thread to progress)
      
               schedule at ffffffffbd603618
               io_schedule at ffffffffbd603ba4
               do_io_schedule at ffffffffbdaf0d94
               __wait_on_bit at ffffffffbd6008a6
               out_of_line_wait_on_bit at ffffffffbd600960
               wait_on_bit.constprop.10 at ffffffffbdaf0f17
               __make_buffer_clean at ffffffffbdaf18ba
               __cleanup_old_buffer at ffffffffbdaf192f
               shrink at ffffffffbdaf19fd
               do_shrink_slab at ffffffffbd6ec000
               shrink_slab at ffffffffbd6ec24a
               do_try_to_free_pages at ffffffffbd6eda09
               try_to_free_mem_cgroup_pages at ffffffffbd6ede7e
               mem_cgroup_resize_limit at ffffffffbd7024c0
               mem_cgroup_write at ffffffffbd703149
               cgroup_file_write at ffffffffbd6d9c6e
               sys_write at ffffffffbd6662ea
               system_call_fastpath at ffffffffbdbc34a2
      
      Link: https://lore.kernel.org/r/20200520022959.1912856-1-krisman@collabora.com
      
      
      Reported-by: default avatarKhazhismel Kumykov <khazhy@google.com>
      Reviewed-by: default avatarLee Duncan <lduncan@suse.com>
      Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@collabora.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      7e7cd796
    • Stanley Chu's avatar
      scsi: ufs: Fix WriteBooster flush during runtime suspend · 51dd905b
      Stanley Chu authored
      Currently UFS host driver promises VCC supply if UFS device needs to do
      WriteBooster flush during runtime suspend.
      
      However the UFS specification mentions:
      
      "While the flushing operation is in progress, the device is in Active power
      mode."
      
      Therefore UFS host driver needs to promise more: Keep UFS device as "Active
      power mode", otherwise UFS device shall not do any flush if device enters
      Sleep or PowerDown power mode.  Similarly, the same promises shall be
      applied if device needs urgent BKOP during runtime suspend.
      
      Fix this by not changing device power mode if WriteBooster flush or urgent
      BKOP is required in ufshcd_suspend().
      
      Now, if device finishes its job but is not resumed for a very long time,
      system will have unnecessary power drain because VCC is still supplied. A
      method to re-check the threshold of keeping VCC supply is required to fix
      the power drain. However, the threshold re-check needs to re-activate the
      link first because the decision depends on the latest device status.
      
      Also introduce a delayed work to force runtime resume after a certain delay
      during runtime suspend. This makes threshold re-check happen natually in
      the entry of the next runtime-suspend. The device can continue its
      WriteBooster flush or urgent BKOP jobs soon after resumed if device has no
      upcoming requests and link enters hibern8 state either by Auto-Hibern8 or
      hibern8 during clk-gating scheme. This solution not only prevents power
      drain but also makes as much use of time as possible for device's
      background jobs.
      
      Link: https://lore.kernel.org/r/20200522083212.4008-5-stanley.chu@mediatek.com
      
      
      Reviewed-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
      Signed-off-by: default avatarStanley Chu <stanley.chu@mediatek.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      51dd905b
Loading