1. 17 11月, 2016 3 次提交
  2. 30 10月, 2016 13 次提交
  3. 29 10月, 2016 3 次提交
  4. 28 10月, 2016 12 次提交
    • B
      ubi: fastmap: Fix add_vol() return value test in ubi_attach_fastmap() · 40b6e61a
      Boris Brezillon 提交于
      Commit e96a8a3b ("UBI: Fastmap: Do not add vol if it already
      exists") introduced a bug by changing the possible error codes returned
      by add_vol():
      - this function no longer returns NULL in case of allocation failure
        but return ERR_PTR(-ENOMEM)
      - when a duplicate entry in the volume RB tree is found it returns
        ERR_PTR(-EEXIST) instead of ERR_PTR(-EINVAL)
      
      Fix the tests done on add_vol() return val to match this new behavior.
      
      Fixes: e96a8a3b ("UBI: Fastmap: Do not add vol if it already exists")
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
      Acked-by: NSheng Yong <shengyong1@huawei.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      40b6e61a
    • J
      VMCI: Doorbell create and destroy fixes · eb94cd68
      Jorgen Hansen 提交于
      This change consists of two changes:
      
      1) If vmci_doorbell_create is called when neither guest nor
         host personality as been initialized, vmci_get_context_id
         will return VMCI_INVALID_ID. In that case, we should fail
         the create call.
      2) In doorbell destroy, we assume that vmci_guest_code_active()
         has the same return value on create and destroy. That may not
         be the case, so we may end up with the wrong refcount.
         Instead, destroy should check explicitly whether the doorbell
         is in the index table as an indicator of whether the guest
         code was active at create time.
      Reviewed-by: NAdit Ranadive <aditr@vmware.com>
      Signed-off-by: NJorgen Hansen <jhansen@vmware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eb94cd68
    • G
      GenWQE: Fix bad page access during abort of resource allocation · a7a7aeef
      Gerald Schaefer 提交于
      When interrupting an application which was allocating DMAable
      memory, it was possible, that the DMA memory was deallocated
      twice, leading to the error symptoms below.
      
      Thanks to Gerald, who analyzed the problem and provided this
      patch.
      
      I agree with his analysis of the problem: ddcb_cmd_fixups() ->
      genwqe_alloc_sync_sgl() (fails in f/lpage, but sgl->sgl != NULL
      and f/lpage maybe also != NULL) -> ddcb_cmd_cleanup() ->
      genwqe_free_sync_sgl() (double free, because sgl->sgl != NULL and
      f/lpage maybe also != NULL)
      
      In this scenario we would have exactly the kind of double free that
      would explain the WARNING / Bad page state, and as expected it is
      caused by broken error handling (cleanup).
      
      Using the Ubuntu git source, tag Ubuntu-4.4.0-33.52, he was able to reproduce
      the "Bad page state" issue, and with the patch on top he could not reproduce
      it any more.
      
      ------------[ cut here ]------------
      WARNING: at /build/linux-o03cxz/linux-4.4.0/arch/s390/include/asm/pci_dma.h:141
      Modules linked in: qeth_l2 ghash_s390 prng aes_s390 des_s390 des_generic sha512_s390 sha256_s390 sha1_s390 sha_common genwqe_card qeth crc_itu_t qdio ccwgroup vmur dm_multipath dasd_eckd_mod dasd_mod
      CPU: 2 PID: 3293 Comm: genwqe_gunzip Not tainted 4.4.0-33-generic #52-Ubuntu
      task: 0000000032c7e270 ti: 00000000324e4000 task.ti: 00000000324e4000
      Krnl PSW : 0404c00180000000 0000000000156346 (dma_update_cpu_trans+0x9e/0xa8)
                 R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3
      Krnl GPRS: 00000000324e7bcd 0000000000c3c34a 0000000027628298 000000003215b400
                 0000000000000400 0000000000001fff 0000000000000400 0000000116853000
                 07000000324e7b1e 0000000000000001 0000000000000001 0000000000000001
                 0000000000001000 0000000116854000 0000000000156402 00000000324e7a38
      Krnl Code: 000000000015633a: 95001000           cli     0(%r1),0
                 000000000015633e: a774ffc3           brc     7,1562c4
                #0000000000156342: a7f40001           brc     15,156344
                >0000000000156346: 92011000           mvi     0(%r1),1
                 000000000015634a: a7f4ffbd           brc     15,1562c4
                 000000000015634e: 0707               bcr     0,%r7
                 0000000000156350: c00400000000       brcl    0,156350
                 0000000000156356: eb7ff0500024       stmg    %r7,%r15,80(%r15)
      Call Trace:
      ([<00000000001563e0>] dma_update_trans+0x90/0x228)
       [<00000000001565dc>] s390_dma_unmap_pages+0x64/0x160
       [<00000000001567c2>] s390_dma_free+0x62/0x98
       [<000003ff801310ce>] __genwqe_free_consistent+0x56/0x70 [genwqe_card]
       [<000003ff801316d0>] genwqe_free_sync_sgl+0xf8/0x160 [genwqe_card]
       [<000003ff8012bd6e>] ddcb_cmd_cleanup+0x86/0xa8 [genwqe_card]
       [<000003ff8012c1c0>] do_execute_ddcb+0x110/0x348 [genwqe_card]
       [<000003ff8012c914>] genwqe_ioctl+0x51c/0xc20 [genwqe_card]
       [<000000000032513a>] do_vfs_ioctl+0x3b2/0x518
       [<0000000000325344>] SyS_ioctl+0xa4/0xb8
       [<00000000007b86c6>] system_call+0xd6/0x264
       [<000003ff9e8e520a>] 0x3ff9e8e520a
      Last Breaking-Event-Address:
       [<0000000000156342>] dma_update_cpu_trans+0x9a/0xa8
      ---[ end trace 35996336235145c8 ]---
      BUG: Bad page state in process jbd2/dasdb1-8  pfn:3215b
      page:000003d100c856c0 count:-1 mapcount:0 mapping:          (null) index:0x0
      flags: 0x3fffc0000000000()
      page dumped because: nonzero _count
      Signed-off-by: NGerald Schaefer <gerald.schaefer@de.ibm.com>
      Signed-off-by: NFrank Haverkamp <haver@linux.vnet.ibm.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a7a7aeef
    • M
      vme: vme_get_size potentially returning incorrect value on failure · 6ad37567
      Martyn Welch 提交于
      The function vme_get_size returns the size of the window to the caller,
      however it doesn't check the return value of the call to vme_master_get.
      
      Return 0 on failure rather than anything else.
      Suggested-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NMartyn Welch <martyn.welch@collabora.co.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6ad37567
    • R
      tty: serial_core: fix NULL struct tty pointer access in uart_write_wakeup · d0f4bce2
      Rob Herring 提交于
      Since commit 761ed4a9 ("tty: serial_core: convert uart_close to
      use tty_port_close"), the serial console is broken on various systems
      and typing "reboot" splats the following on the serial console:
      
      INIT: Sending p[  427.863916] BUG: unable to handle kernel NULL pointer dereference at 00000000000001e0
      [  427.885156] IP: [] tty_wakeup+0xc/0x70
      [  427.898337] PGD 0 [  427.902051]
      [  427.907498] Oops: 0000 [#1] PREEMPT SMP
      [  427.917635] Modules linked in: nfsv3 nfs_acl nfs fscache lockd
      sunrpc grace edd af_packet cpufreq_conservative cpufreq_userspace
      cpufreq_powersave fuse loop md_mod dm_mod joydev hid_generic usbhid
      ipmi_ssif ohci_pci ohci_hcd ehci_pci ehci_hcd e1000e ptp firewire_ohci
      edac_core pps_core tpm_infineon sp5100_tco firewire_core acpi_cpufreq
      serio_raw pcspkr fjes usbcore shpchp edac_mce_amd tpm_tis ipmi_si
      tpm_tis_core i2c_piix4 k10temp sg ipmi_msghandler tpm sr_mod button
      cdrom kvm_amd kvm irqbypass crc_itu_t ast ttm drm_kms_helper drm
      fb_sys_fops sysimgblt sysfillrect syscopyarea i2c_algo_bit scsi_dh_rdac
      scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw ata_generic pata_atiixp
      [  428.054179] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-rc1-1.g73e3f23-default #1
      [  428.072868] Hardware name: System manufacturer System Product Name/KGP(M)E-D16, BIOS 0902    12/03/2010
      [  428.094755] task: ffffffffa2c0d500 task.stack: ffffffffa2c00000
      [  428.109717] RIP: 0010:[]  [] tty_wakeup+0xc/0x70
      [  428.128407] RSP: 0018:ffff9a1a5fc03df8  EFLAGS: 00010086
      [  428.142184] RAX: ffff9a1857258000 RBX: ffffffffa3050ea0 RCX: 0000000000000000
      [  428.159649] RDX: 000000000000001b RSI: 0000000000000000 RDI: 0000000000000000
      [  428.177109] RBP: ffff9a1a5fc03e08 R08: 0000000000000000 R09: 0000000000000000
      [  428.194547] R10: 0000000000021c77 R11: 0000000000000000 R12: ffff9a1857258000
      [  428.212002] R13: 0000000000000000 R14: 0000000000000020 R15: 0000000000000020
      [  428.229481] FS:  0000000000000000(0000) GS:ffff9a1a5fc00000(0000) knlGS:0000000000000000
      [  428.248938] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  428.263726] CR2: 00000000000001e0 CR3: 0000000390c06000 CR4: 00000000000006f0
      [  428.281331] Stack:
      [  428.288696]  ffffffffa3050ea0 ffff9a1857258000 ffff9a1a5fc03e18 ffffffffa24e0ab1
      [  428.307064]  ffff9a1a5fc03e40 ffffffffa24e8865 ffffffffa3050ea0 00000000000000c2
      [  428.325456]  0000000000000046 ffff9a1a5fc03e78 ffffffffa24e8a5f ffffffffa3050ea0
      [  428.343905] Call Trace:
      [  428.352319]   [  428.356216]  [] uart_write_wakeup+0x21/0x30
      
      The problem is for console ports, the serial port is not shutdown and
      interrupts may fire after the struct tty is gone. Simply calling the
      tty_port helper tty_port_tty_wakeup instead of tty_wakeup directly will
      ensure there is a valid struct tty.
      
      Fixes: 761ed4a9 ("tty: serial_core: convert uart_close to use tty_port_close")
      Reported-by: NBorislav Petkov <bp@alien8.de>
      Reported-by: NMike Galbraith <mgalbraith@suse.de>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-serial@vger.kernel.org
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d0f4bce2
    • G
      tty: serial_core: Fix serial console crash on port shutdown · 4dda864d
      Geert Uytterhoeven 提交于
      The port->console flag is always false, as uart_console() is called
      before the serial console has been registered.
      
      Hence for a serial port used as the console, uart_tty_port_shutdown()
      will still be called when userspace closes the port, powering it down.
      This may lead to a system lock up when the serial console driver writes
      to the serial port's registers.
      
      To fix this, move the setting of port->console after the call to
      uart_configure_port(), which registers the serial console.
      
      Fixes: 761ed4a9 ("tty: serial_core: convert uart_close to use tty_port_close")
      Reported-by: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NRob Herring <robh@kernel.org>
      Tested-by: NMugunthan V N <mugunthanvnm@ti.com>
      Tested-by: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      [robh: rebased on tty-linus]
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4dda864d
    • R
      tty/serial: at91: fix hardware handshake on Atmel platforms · 9bcffe75
      Richard Genoud 提交于
      After commit 1cf6e8fc ("tty/serial: at91: fix RTS line management
      when hardware handshake is enabled"), the hardware handshake wasn't
      functional anymore on Atmel platforms (beside SAMA5D2).
      
      To understand why, one has to understand the flag ATMEL_US_USMODE_HWHS
      first:
      Before commit 1cf6e8fc ("tty/serial: at91: fix RTS line management
      when hardware handshake is enabled"), this flag was never set.
      Thus, the CTS/RTS where only handled by serial_core (and everything
      worked just fine).
      
      This commit introduced the use of the ATMEL_US_USMODE_HWHS flag,
      enabling it for all boards when the user space enables flow control.
      
      When the ATMEL_US_USMODE_HWHS is set, the Atmel USART controller
      handles a part of the flow control job:
      - disable the transmitter when the CTS pin gets high.
      - drive the RTS pin high when the DMA buffer transfer is completed or
        PDC RX buffer full or RX FIFO is beyond threshold. (depending on the
        controller version).
      
      NB: This feature is *not* mandatory for the flow control to work.
      (Nevertheless, it's very useful if low latencies are needed.)
      
      Now, the specifics of the ATMEL_US_USMODE_HWHS flag:
      
      - For platforms with DMAC and no FIFOs (sam9x25, sam9x35, sama5D3,
      sama5D4, sam9g15, sam9g25, sam9g35)* this feature simply doesn't work.
      ( source: https://lkml.org/lkml/2016/9/7/598 )
      Tested it on sam9g35, the RTS pins always stays up, even when RXEN=1
      or a new DMA transfer descriptor is set.
      => ATMEL_US_USMODE_HWHS must not be used for those platforms
      
      - For platforms with a PDC (sam926{0,1,3}, sam9g10, sam9g20, sam9g45,
      sam9g46)*, there's another kind of problem. Once the flag
      ATMEL_US_USMODE_HWHS is set, the RTS pin can't be driven anymore via
      RTSEN/RTSDIS in USART Control Register. The RTS pin can only be driven
      by enabling/disabling the receiver or setting RCR=RNCR=0 in the PDC
      (Receive (Next) Counter Register).
      => Doing this is beyond the scope of this patch and could add other
      bugs, so the original (and working) behaviour should be set for those
      platforms (meaning ATMEL_US_USMODE_HWHS flag should be unset).
      
      - For platforms with a FIFO (sama5d2)*, the RTS pin is driven according
      to the RX FIFO thresholds, and can be also driven by RTSEN/RTSDIS in
      USART Control Register. No problem here.
      (This was the use case of commit 1cf6e8fc ("tty/serial: at91: fix
      RTS line management when hardware handshake is enabled"))
      NB: If the CTS pin declared as a GPIO in the DTS, (for instance
      cts-gpios = <&pioA PIN_PB31 GPIO_ACTIVE_LOW>), the transmitter will be
      disabled.
      => ATMEL_US_USMODE_HWHS flag can be set for this platform ONLY IF the
      CTS pin is not a GPIO.
      
      So, the only case when ATMEL_US_USMODE_HWHS can be enabled is when
      (atmel_use_fifo(port) &&
       !mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_CTS))
      
      Tested on all Atmel USART controller flavours:
      AT91SAM9G35-CM (DMAC flavour), AT91SAM9G20-EK (PDC flavour),
      SAMA5D2xplained (FIFO flavour).
      
      * the list may not be exhaustive
      
      Cc: <stable@vger.kernel.org> #4.4+ (beware, missing atmel_port variable)
      Fixes: 1cf6e8fc ("tty/serial: at91: fix RTS line management when hardware handshake is enabled")
      Signed-off-by: NRichard Genoud <richard.genoud@gmail.com>
      Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Acked-by: NCyrille Pitchen <cyrille.pitchen@atmel.com>
      Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9bcffe75
    • D
    • U
      ipack: print a hex number after a 0x prefix · 9105585d
      Uwe Kleine-König 提交于
      It makes the result hard to interpret correctly if a base 10 number is
      prefixed by 0x.  So change to a hex number.
      
      Link: http://lkml.kernel.org/r/20161026125658.25728-4-u.kleine-koenig@pengutronix.deSigned-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Cc: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
      Cc: Jens Taprogge <jens.taprogge@taprogge.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9105585d
    • U
      block: DAC960: print a hex number after a 0x prefix · ee52c44d
      Uwe Kleine-König 提交于
      It makes the message hard to interpret correctly if a base 10 number is
      prefixed by 0x.  So change to a hex number.
      
      Link: http://lkml.kernel.org/r/20161026125658.25728-3-u.kleine-koenig@pengutronix.deSigned-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ee52c44d
    • D
      device-dax: fix percpu_ref_exit ordering · 52e73eb2
      Dan Williams 提交于
      We need to wait until the percpu_ref is released before exit. Otherwise,
      we sometimes lose the race and trigger this new warning that was added
      in v4.9 (commit a67823c1 "percpu-refcount: init ->confirm_switch
      member properly"):
      
       WARNING: CPU: 0 PID: 3629 at lib/percpu-refcount.c:107 percpu_ref_exit+0x51/0x60
       [..]
       Call Trace:
        [<ffffffff814bf093>] dump_stack+0x85/0xc2
        [<ffffffff810b15db>] __warn+0xcb/0xf0
        [<ffffffff810b170d>] warn_slowpath_null+0x1d/0x20
        [<ffffffff814d70c1>] percpu_ref_exit+0x51/0x60
        [<ffffffffa005706a>] dax_pmem_percpu_exit+0x1a/0x50 [dax_pmem]
        [<ffffffff81615f1f>] devm_action_release+0xf/0x20
      
      Cc: <stable@vger.kernel.org>
      Fixes: ab68f262 ("/dev/dax, pmem: direct access to persistent memory")
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      52e73eb2
    • A
      nvdimm: make CONFIG_NVDIMM_DAX 'bool' · 867dfe34
      Arnd Bergmann 提交于
      A bugfix just tried to address a randconfig build problem and introduced
      a variant of the same problem: with CONFIG_LIBNVDIMM=y and
      CONFIG_NVDIMM_DAX=m, the nvdimm module now fails to link:
      
      drivers/nvdimm/built-in.o: In function `to_nd_device_type':
      bus.c:(.text+0x1b5d): undefined reference to `is_nd_dax'
      drivers/nvdimm/built-in.o: In function `nd_region_notify_driver_action.constprop.2':
      region_devs.c:(.text+0x6b6c): undefined reference to `is_nd_dax'
      region_devs.c:(.text+0x6b8c): undefined reference to `to_nd_dax'
      drivers/nvdimm/built-in.o: In function `nd_region_probe':
      region.c:(.text+0x70f3): undefined reference to `nd_dax_create'
      drivers/nvdimm/built-in.o: In function `mode_show':
      namespace_devs.c:(.text+0xa196): undefined reference to `is_nd_dax'
      drivers/nvdimm/built-in.o: In function `nvdimm_namespace_common_probe':
      (.text+0xa55f): undefined reference to `is_nd_dax'
      drivers/nvdimm/built-in.o: In function `nvdimm_namespace_common_probe':
      (.text+0xa56e): undefined reference to `to_nd_dax'
      
      This reverts the earlier fix, making NVDIMM_DAX a 'bool' option again
      as it should be (it gets linked into the libnvdimm module). To fix
      the original problem, I'm adding a dependency on LIBNVDIMM to
      DEV_DAX_PMEM, which ensures we can't have that one built-in if the
      rest is a module.
      
      Fixes: 4e65e938 ("/dev/dax: fix Kconfig dependency build breakage")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NRoss Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      867dfe34
  5. 27 10月, 2016 9 次提交