1. 07 4月, 2017 1 次提交
    • T
      pinctrl: core: Fix pinctrl_register_and_init() with pinctrl_enable() · 61187142
      Tony Lindgren 提交于
      Recent pinctrl changes to allow dynamic allocation of pins exposed one
      more issue with the pinctrl pins claimed early by the controller itself.
      This caused a regression for IMX6 pinctrl hogs.
      
      Before enabling the pin controller driver we need to wait until it has
      been properly initialized, then claim the hogs, and only then enable it.
      
      To fix the regression, split the code into pinctrl_claim_hogs() and
      pinctrl_enable(). And then let's require that pinctrl_enable() is always
      called by the pin controller driver when ready after calling
      pinctrl_register_and_init().
      
      Depends-on: 950b0d91 ("pinctrl: core: Fix regression caused by delayed
      work for hogs")
      Fixes: df61b366af26 ("pinctrl: core: Use delayed work for hogs")
      Fixes: e566fc11 ("pinctrl: imx: use generic pinctrl helpers for
      managing groups")
      Cc: Haojian Zhuang <haojian.zhuang@linaro.org>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Mika Penttilä <mika.penttila@nextfour.com>
      Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Nishanth Menon <nm@ti.com>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Stefan Agner <stefan@agner.ch>
      Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Tested-by: NGary Bisson <gary.bisson@boundarydevices.com>
      Tested-by: NFabio Estevam <fabio.estevam@nxp.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      61187142
  2. 13 1月, 2017 1 次提交
    • T
      pinctrl: core: Fix regression caused by delayed work for hogs · 950b0d91
      Tony Lindgren 提交于
      Commit df61b366af26 ("pinctrl: core: Use delayed work for hogs") caused a
      regression at least with sh-pfc that is also a GPIO controller as
      noted by Geert Uytterhoeven <geert@linux-m68k.org>.
      
      As the original pinctrl_register() has issues calling pin controller
      driver functions early before the controller has finished registering,
      we can't just revert commit df61b366af26. That would break the drivers
      using GENERIC_PINCTRL_GROUPS or GENERIC_PINMUX_FUNCTIONS.
      
      So let's fix the issue with the following steps as a single patch:
      
      1. Revert the late_init parts of commit df61b366af26.
      
         The late_init clearly won't work and we have to just give up
         on fixing pinctrl_register() for GENERIC_PINCTRL_GROUPS and
         GENERIC_PINMUX_FUNCTIONS.
      
      2. Split pinctrl_register() into two parts
      
         By splitting pinctrl_register() into pinctrl_init_controller()
         and pinctrl_create_and_start() we have better control over when
         it's safe to call pinctrl_create().
      
      3. Introduce a new pinctrl_register_and_init() function
      
         As suggested by Linus Walleij <linus.walleij@linaro.org>, we
         can just introduce a new function for the controllers that need
         pinctrl_create() called later.
      
      4. Convert the four known problem cases to use new function
      
         Let's convert pinctrl-imx, pinctrl-single, sh-pfc and ti-iodelay
         to use the new function to fix the issues. The rest of the drivers
         can be converted later. Let's also update Documentation/pinctrl.txt
         accordingly because of the known issues with pinctrl_register().
      
      Fixes: df61b366af26 ("pinctrl: core: Use delayed work for hogs")
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Gary Bisson <gary.bisson@boundarydevices.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      950b0d91
  3. 03 1月, 2017 2 次提交
  4. 30 12月, 2016 2 次提交
  5. 25 11月, 2016 1 次提交
  6. 01 11月, 2016 1 次提交
    • S
      pinctrl: imx: reset group index on probe · 9999fe5d
      Stefan Agner 提交于
      Group index is incremented on every new group parsed. Since the
      field is part of struct imx_pinctrl_soc_info, which is typically
      a global variable passed by the individual pinctrl-imx.c based
      driver, it does not get cleared automatically when re-probing the
      driver. This lead imx_pinctrl_parse_functions passing a group
      pointer which is outside of the allocated group space on second
      probe and onwards. Typically this ended up in a NULL pointer
      dereference when accessing the name field like this:
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      ...
      PC is at strcmp+0x18/0x44
      LR is at imx_dt_node_to_map+0xc4/0x290
      
      Avoid this by setting group_index to 0 on probe.
      
      This has been observed when using DEBUG_TEST_DRIVER_REMOVE.
      Signed-off-by: NStefan Agner <stefan@agner.ch>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      9999fe5d
  7. 12 9月, 2016 1 次提交
    • V
      pinctrl: imx: accept gpio request/free from pinctrl · 430be10d
      Vladimir Zapolskiy 提交于
      While only Freescale Vybrid SoC has settings of GPIO capabilities done
      by iomux controller, it is only a matter of GPIO controller driver
      implementation for the rest of Freescale/NXP SoCs from iMX series.
      
      As a practical example on GPIO request a pad function should be
      switched to GPIO, but because this requires updates to all particular
      iMX pinctrl drivers, for simplicity at the moment add only a proper
      connection between shared pinctrl-imx and pinctrl/pinmux core, namely
      .gpio_request_enable/.gpio_disable_free/.gpio_set_direction callbacks
      should return success to a caller. This change allows to progress by
      adding request/free callbacks into gpio-mxc.c driver.
      Signed-off-by: NVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
      Acked-by: NShawn Guo <shawnguo@kernel.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      430be10d
  8. 06 9月, 2016 1 次提交
  9. 29 6月, 2016 1 次提交
  10. 22 6月, 2016 1 次提交
  11. 15 6月, 2016 1 次提交
  12. 31 5月, 2016 1 次提交
    • P
      pinctrl: imx: fix initialization of imx_pinctrl_desc · 6e408ed8
      Peng Fan 提交于
      To i.MX7D, there are two iomux controllers, iomuxc and iomuxc_lpsr.
      They should not share one pin controller descriptor, otherwise
      the value filled into imx_pinctrl_desc when probing the first
      iomux controller will be overridden when probing the second one.
      
      In this patch, discard the static allcoated imx_pinctrl_desc and
      switch to dynamically allcate pin controller descriptor for each
      iomux controller.
      Signed-off-by: NPeng Fan <van.freenix@gmail.com>
      Cc: Shawn Guo <shawnguo@kernel.org>
      Cc: Philipp Zabel <p.zabel@pengutronix.de>
      Cc: Stefan Agner <stefan@agner.ch>
      Cc: Vladimir Zapolskiy <vz@mleia.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      6e408ed8
  13. 21 4月, 2016 1 次提交
  14. 30 3月, 2016 1 次提交
  15. 08 3月, 2016 1 次提交
  16. 27 1月, 2016 1 次提交
  17. 03 10月, 2015 2 次提交
  18. 02 10月, 2015 1 次提交
    • R
      pinctrl: freescale: imx: fix system crash if enable two pinctl instances · ee163518
      Robin Gong 提交于
      Fix system chrash caused by groups whose number is smaller than the number
      of groups of the last pinctl instance which is not initialized.
      
      iMX7D supports two iomux controllers (iomuxc-lpsr and iomuxc) on probing
      the second instance (iomuxc) the chrash below occurs.
      
      Uncompressing Linux... done, booting the kernel.
      [    0.000000] Booting Linux on physical CPU 0x0
      [    0.000000] Linux version 4.2.0-next-20150901-00006-gebfa43c (aalonso@bluefly)
      [    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7)
      [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasin instruction cache
      [    0.000000] Machine model: Freescale i.MX7 SabreSD Board
      [    0.661012] [<802a6cb0>] (strcmp) from [<802cc80c>] (imx_dt_node_to_map+0x58/0x208)
      [    0.668879] [<802cc80c>] (imx_dt_node_to_map) from [<802cbe24>] (pinctrl_dt_to_map+0x174/0x2b0)
      [    0.677654] [<802cbe24>] (pinctrl_dt_to_map) from [<802c8f18>] (pinctrl_get+0x100/0x424)
      [    0.685878] [<802c8f18>] (pinctrl_get) from [<802c9510>] (pinctrl_register+0x26c/0x480)
      [    0.694104] [<802c9510>] (pinctrl_register) from [<802ccf3c>] (imx_pinctrl_probe+0x580/0x6e8)
      [    0.702706] [<802ccf3c>] (imx_pinctrl_probe) from [<80351b58>] (platform_drv_probe+0x44/0xa4)
      [    0.711455] [<80351b58>] (platform_drv_probe) from [<803503ec>] (driver_probe_device+0x174/0x2b4)
      [    0.720405] [<803503ec>] (driver_probe_device) from [<803505fc>] (__driver_attach+0x8c/0x90)
      [    0.728982] [<803505fc>] (__driver_attach) from [<8034e930>] (bus_for_each_dev+0x6c/0xa0)
      [    0.737381] [<8034e930>] (bus_for_each_dev) from [<8034fb88>] (bus_add_driver+0x148/0x1f0)
      [    0.745804] [<8034fb88>] (bus_add_driver) from [<80350c00>] (driver_register+0x78/0xf8)
      [    0.753880] [<80350c00>] (driver_register) from [<800097d0>] (do_one_initcall+0x8c/0x1d4)
      [    0.762282] [<800097d0>] (do_one_initcall) from [<80987dac>] (kernel_init_freeable+0x144/0x1e4)
      [    0.771061] [<80987dac>] (kernel_init_freeable) from [<806d9c7c>] (kernel_init+0x8/0xe8)
      [    0.779285] [<806d9c7c>] (kernel_init) from [<8000f628>] (ret_from_fork+0x14/0x2c)
      [    0.786981] Code: e3520000 e5e32001 1afffffb e12fff1e (e4d03001)
      Signed-off-by: NRobin Gong <b38343@freescale.com>
      Signed-off-by: NAdrian Alonso <aalonso@freescale.com>
      Acked-by: NShawn Guo <shawnguo@kernel.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ee163518
  19. 10 6月, 2015 1 次提交
  20. 06 5月, 2015 1 次提交
  21. 07 4月, 2015 1 次提交
  22. 18 3月, 2015 1 次提交
  23. 03 2月, 2015 1 次提交
  24. 28 10月, 2014 1 次提交
  25. 23 9月, 2014 1 次提交
    • S
      pinctrl: imx: detect uninitialized pins · 3dac1918
      Stefan Agner 提交于
      The pinctrl driver initialized the register offsets for the pins
      with 0. On Vybrid an offset of 0 is a valid offset for the pinctrl
      mux register. So far, this was solved using the ZERO_OFFSET_VALID
      flag which allowed offsets of 0. However, this does not allow to
      verify whether a pins struct imx_pmx_func was initialized or not.
      
      Use signed offset values for register offsets and initialize those
      with -1 in order to detect uninitialized offset values reliable.
      Signed-off-by: NStefan Agner <stefan@agner.ch>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      3dac1918
  26. 04 9月, 2014 2 次提交
  27. 11 7月, 2014 1 次提交
  28. 22 4月, 2014 1 次提交
  29. 25 2月, 2014 1 次提交
  30. 04 11月, 2013 1 次提交
  31. 28 8月, 2013 1 次提交
  32. 24 8月, 2013 1 次提交
  33. 16 8月, 2013 4 次提交