1. 17 7月, 2018 3 次提交
    • L
      Merge tag 'pinctrl-v4.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 30b06abf
      Linus Torvalds 提交于
      Pull pin control fixes from Linus Walleij:
      
       - A slew of driver fixes for Mediatek mt7622
      
       - Fix a direction inversion bug in the Ingenic driver
      
       - Fix unsupported drive strength setting on the PFC r8a77970
      
       - Off by one and NULL dereference fixes in the NSP driver
      
      * tag 'pinctrl-v4.18-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: nsp: Fix potential NULL dereference
        pinctrl: nsp: off by ones in nsp_pinmux_enable()
        pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag
        pinctrl: ingenic: Fix inverted direction for < JZ4770
        pinctrl: mt7622: fix a kernel panic when gpio-hog is being applied
        pinctrl: mt7622: stop using the deprecated pinctrl_add_gpio_range
        pinctrl: mt7622: fix that pinctrl_claim_hogs cannot work
        pinctrl: mt7622: fix initialization sequence between eint and gpiochip
        pinctrl: mt7622: fix error path on failing at groups building
      30b06abf
    • L
      Merge tag 'drm-fixes-2018-07-16-1' of git://anongit.freedesktop.org/drm/drm · 706bf68b
      Linus Torvalds 提交于
      Pull drm fixes from Dave Airlie:
      
       - two AGP fixes in here
      
       - a bunch of mostly amdgpu fixes
      
       - sun4i build fix
      
       - two armada fixes
      
       - some tegra fixes
      
       - one i915 core and one i915 gvt fix
      
      * tag 'drm-fixes-2018-07-16-1' of git://anongit.freedesktop.org/drm/drm:
        drm/amdgpu/pp/smu7: use a local variable for toc indexing
        amd/dc/dce100: On dce100, set clocks to 0 on suspend
        drm/amd/display: Convert 10kHz clks from PPLib into kHz for Vega
        drm/amdgpu: Verify root PD is mapped into kernel address space (v4)
        drm/amd/display: fix invalid function table override
        drm/amdgpu: Reserve VM root shared fence slot for command submission (v3)
        Revert "drm/amd/display: Don't return ddc result and read_bytes in same return value"
        char: amd64-agp: Use 64-bit arithmetic instead of 32-bit
        char: agp: Change return type to vm_fault_t
        drm/i915: Fix hotplug irq ack on i965/g4x
        drm/armada: fix irq handling
        drm/armada: fix colorkey mode property
        drm/tegra: Fix comparison operator for buffer size
        gpu: host1x: Check whether size of unpin isn't 0
        gpu: host1x: Skip IOMMU initialization if firewall is enabled
        drm/sun4i: link in front-end code if needed
        drm/i915/gvt: update vreg on inhibit context lri command
      706bf68b
    • P
      mm: don't do zero_resv_unavail if memmap is not allocated · d1b47a7c
      Pavel Tatashin 提交于
      Moving zero_resv_unavail before memmap_init_zone(), caused a regression on
      x86-32.
      
      The cause is that we access struct pages before they are allocated when
      CONFIG_FLAT_NODE_MEM_MAP is used.
      
      free_area_init_nodes()
        zero_resv_unavail()
          mm_zero_struct_page(pfn_to_page(pfn)); <- struct page is not alloced
        free_area_init_node()
          if CONFIG_FLAT_NODE_MEM_MAP
            alloc_node_mem_map()
              memblock_virt_alloc_node_nopanic() <- struct page alloced here
      
      On the other hand memblock_virt_alloc_node_nopanic() zeroes all the memory
      that it returns, so we do not need to do zero_resv_unavail() here.
      
      Fixes: e181ae0c ("mm: zero unavailable pages before memmap init")
      Signed-off-by: NPavel Tatashin <pasha.tatashin@oracle.com>
      Tested-by: NMatt Hart <matt@mattface.org>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d1b47a7c
  2. 16 7月, 2018 8 次提交
  3. 15 7月, 2018 19 次提交
  4. 14 7月, 2018 10 次提交
    • W
      pinctrl: nsp: Fix potential NULL dereference · c29e9da5
      Wei Yongjun 提交于
      platform_get_resource() may fail and return NULL, so we should
      better check it's return value to avoid a NULL pointer dereference
      a bit later in the code.
      
      This is detected by Coccinelle semantic patch.
      
      @@
      expression pdev, res, n, t, e, e1, e2;
      @@
      
      res = platform_get_resource(pdev, t, n);
      + if (!res)
      +   return -EINVAL;
      ... when != res == NULL
      e = devm_ioremap_nocache(e1, res->start, e2);
      
      Fixes: cc4fa83f ("pinctrl: nsp: add pinmux driver support for Broadcom NSP SoC")
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Reviewed-by: NRay Jui <ray.jui@broadcom.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      c29e9da5
    • D
      pinctrl: nsp: off by ones in nsp_pinmux_enable() · f90a21c8
      Dan Carpenter 提交于
      The > comparisons should be >= or else we read beyond the end of the
      pinctrl->functions[] array.
      
      Fixes: cc4fa83f ("pinctrl: nsp: add pinmux driver support for Broadcom NSP SoC")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NRay Jui <ray.jui@broadcom.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      f90a21c8
    • N
      pinctrl: sh-pfc: r8a77970: remove SH_PFC_PIN_CFG_DRIVE_STRENGTH flag · 550b6f7e
      Niklas Söderlund 提交于
      The datasheet does not document any registers to control drive strength,
      and no drive strength registers are for this reason described for this
      SoC. The flags indicating that drive strength can be controlled are
      however set for some pins in the driver.
      
      This leads to a NULL pointer dereference when the sh-pfc core tries to
      access the struct describing the drive strength registers, for example
      when reading the sysfs file pinconf-pins.
      
      Fix this by removing the SH_PFC_PIN_CFG_DRIVE_STRENGTH from all pins.
      
      Fixes: b92ac66a ("pinctrl: sh-pfc: Add R8A77970 PFC support")
      Signed-off-by: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
      Reviewed-by: NSimon Horman <horms+renesas@verge.net.au>
      Reviewed-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      550b6f7e
    • P
      pinctrl: ingenic: Fix inverted direction for < JZ4770 · 0084a786
      Paul Cercueil 提交于
      The .gpio_set_direction() callback was setting inverted direction
      for SoCs older than the JZ4770, this restores the correct behaviour.
      Signed-off-by: NPaul Cercueil <paul@crapouillou.net>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      0084a786
    • S
      pinctrl: mt7622: fix a kernel panic when gpio-hog is being applied · 5b1c4bf2
      Sean Wang 提交于
      When we are explicitly using GPIO hogging mechanism in the pinctrl node,
      such as:
      
      	&pio {
      		line_input {
      			gpio-hog;
      			gpios = <95 0>, <96 0>, <97 0>;
      			input;
      		};
      	};
      
      A kernel panic happens at dereferencing a NULL pointer: In this case, the
      drvdata is still not setup properly yet when it is being accessed.
      
      A better solution for fixing up this issue should be we should obtain the
      private data from struct gpio_chip using a specific gpiochip_get_data
      instead of a generic dev_get_drvdata.
      
      [    0.249424] Unable to handle kernel NULL pointer dereference at virtual
      	       address 000000c8
      [    0.257818] Mem abort info:
      [    0.260704]   ESR = 0x96000005
      [    0.263869]   Exception class = DABT (current EL), IL = 32 bits
      [    0.270011]   SET = 0, FnV = 0
      [    0.273167]   EA = 0, S1PTW = 0
      [    0.276421] Data abort info:
      [    0.279398]   ISV = 0, ISS = 0x00000005
      [    0.283372]   CM = 0, WnR = 0
      [    0.286440] [00000000000000c8] user address but active_mm is swapper
      [    0.293027] Internal error: Oops: 96000005 [#1] PREEMPT SMP
      [    0.298795] Modules linked in:
      [    0.301958] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.16.0-rc1+ #389
      [    0.308716] Hardware name: MediaTek MT7622 RFB1 board (DT)
      [    0.314396] pstate: 80000005 (Nzcv daif -PAN -UAO)
      [    0.319362] pc : mtk_hw_pin_field_get+0x28/0x118
      [    0.324140] lr : mtk_hw_set_value+0x30/0x104
      [    0.328557] sp : ffffff800801b6d0
      [    0.331983] x29: ffffff800801b6d0 x28: ffffff80086b7970
      [    0.337484] x27: 0000000000000000 x26: ffffff80087b8000
      [    0.342986] x25: 0000000000000000 x24: ffffffc00324c230
      [    0.348487] x23: 0000000000000003 x22: 0000000000000000
      [    0.353988] x21: ffffff80087b8000 x20: 0000000000000000
      [    0.359489] x19: 0000000000000054 x18: 00000000fffff7c0
      [    0.364990] x17: 0000000000006300 x16: 000000000000003f
      [    0.370492] x15: 000000000000000e x14: ffffffffffffffff
      [    0.375993] x13: 0000000000000000 x12: 0000000000000020
      [    0.381494] x11: 0000000000000006 x10: 0101010101010101
      [    0.386995] x9 : fffffffffffffffa x8 : 0000000000000007
      [    0.392496] x7 : ffffff80085d63f8 x6 : 0000000000000003
      [    0.397997] x5 : 0000000000000054 x4 : ffffffc0031eb800
      [    0.403499] x3 : ffffff800801b728 x2 : 0000000000000003
      [    0.409000] x1 : 0000000000000054 x0 : 0000000000000000
      [    0.414502] Process swapper/0 (pid: 1, stack limit = 0x000000002a913c1c)
      [    0.421441] Call trace:
      [    0.423968]  mtk_hw_pin_field_get+0x28/0x118
      [    0.428387]  mtk_hw_set_value+0x30/0x104
      [    0.432445]  mtk_gpio_set+0x20/0x28
      [    0.436052]  mtk_gpio_direction_output+0x18/0x30
      [    0.440833]  gpiod_direction_output_raw_commit+0x7c/0xa0
      [    0.446333]  gpiod_direction_output+0x104/0x114
      [    0.451022]  gpiod_configure_flags+0xbc/0xfc
      [    0.455441]  gpiod_hog+0x8c/0x140
      [    0.458869]  of_gpiochip_add+0x27c/0x2d4
      [    0.462928]  gpiochip_add_data_with_key+0x338/0x5f0
      [    0.467976]  mtk_pinctrl_probe+0x388/0x400
      [    0.472217]  platform_drv_probe+0x58/0xa4
      [    0.476365]  driver_probe_device+0x204/0x44c
      [    0.480783]  __device_attach_driver+0xac/0x108
      [    0.485384]  bus_for_each_drv+0x7c/0xac
      [    0.489352]  __device_attach+0xa0/0x144
      [    0.493320]  device_initial_probe+0x10/0x18
      [    0.497647]  bus_probe_device+0x2c/0x8c
      [    0.501616]  device_add+0x2f8/0x540
      [    0.505226]  of_device_add+0x3c/0x44
      [    0.508925]  of_platform_device_create_pdata+0x80/0xb8
      [    0.514245]  of_platform_bus_create+0x290/0x3e8
      [    0.518933]  of_platform_populate+0x78/0x100
      [    0.523352]  of_platform_default_populate+0x24/0x2c
      [    0.528403]  of_platform_default_populate_init+0x94/0xa4
      [    0.533903]  do_one_initcall+0x98/0x130
      [    0.537874]  kernel_init_freeable+0x13c/0x1d4
      [    0.542385]  kernel_init+0x10/0xf8
      [    0.545903]  ret_from_fork+0x10/0x18
      [    0.549603] Code: 900020a1 f9400800 911dcc21 1400001f (f9406401)
      [    0.555916] ---[ end trace de8c34787fdad3b3 ]---
      [    0.560722] Kernel panic - not syncing: Attempted to kill init!
      	       exitcode=0x0000000b
      [    0.560722]
      [    0.570188] SMP: stopping secondary CPUs
      [    0.574253] ---[ end Kernel panic - not syncing: Attempted to kill
      	       init! exitcode=0x0000000b
      [    0.574253]
      
      Cc: stable@vger.kernel.org
      Fixes: d6ed9355 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC")
      Signed-off-by: NSean Wang <sean.wang@mediatek.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      5b1c4bf2
    • S
      pinctrl: mt7622: stop using the deprecated pinctrl_add_gpio_range · de227ed7
      Sean Wang 提交于
      If the pinctrl node has the gpio-ranges property, the range will be added
      by the gpio core and doesn't need to be added by the pinctrl driver.
      
      But for keeping backward compatibility, an explicit pinctrl_add_gpio_range
      is still needed to be called when there is a missing gpio-ranges in pinctrl
      node in old dts files.
      
      Cc: stable@vger.kernel.org
      Fixes: d6ed9355 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC")
      Signed-off-by: NSean Wang <sean.wang@mediatek.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      de227ed7
    • S
      pinctrl: mt7622: fix that pinctrl_claim_hogs cannot work · ae6efcae
      Sean Wang 提交于
      To allow claiming hogs by pinctrl, we cannot enable pinctrl until all
      groups and functions are being added done. Also, it's necessary that
      the corresponding gpiochip is being added when the pinctrl device is
      enabled.
      
      Cc: stable@vger.kernel.org
      Fixes: d6ed9355 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC")
      Signed-off-by: NSean Wang <sean.wang@mediatek.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ae6efcae
    • S
      pinctrl: mt7622: fix initialization sequence between eint and gpiochip · 8875059d
      Sean Wang 提交于
      Because gpichip applied in the driver must depend on mtk eint to implement
      the input data debouncing and the translation between gpio and irq, it's
      better to keep logic consistent with mtk eint being built prior to gpiochip
      being added.
      
      Cc: stable@vger.kernel.org
      Fixes: e6dabd38 ("pinctrl: mediatek: add EINT support to MT7622 SoC")
      Signed-off-by: NSean Wang <sean.wang@mediatek.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      8875059d
    • S
      pinctrl: mt7622: fix error path on failing at groups building · fafa35cc
      Sean Wang 提交于
      It should be to return an error code when failing at groups building.
      
      Cc: stable@vger.kernel.org
      Fixes: d6ed9355 ("pinctrl: mediatek: add pinctrl driver for MT7622 SoC")
      Signed-off-by: NSean Wang <sean.wang@mediatek.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      fafa35cc
    • L
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 2db39a2f
      Linus Torvalds 提交于
      Pull i2c fixes from Wolfram Sang:
      
       - I2C core bugfix regarding bus recovery
      
       - driver bugfix for the tegra driver
      
       - typo correction
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: recovery: if possible send STOP with recovery pulses
        i2c: tegra: Fix NACK error handling
        i2c: stu300: use non-archaic spelling of failes
      2db39a2f