Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 000/102] Convert drivers to explicit reset API
@ 2017-07-19 15:25 Philipp Zabel
  2017-07-19 15:25 ` [PATCH 001/102] ARM: rockchip: explicitly request exclusive reset control Philipp Zabel
                   ` (6 more replies)
  0 siblings, 7 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: Philipp Zabel, David S. Miller, Emilio López, Adrian Hunter,
	Alan Stern, Alan Tull, Alexandre Torgue, Andrew Lunn, Ben Skeggs,
	Benjamin Gaignard, Bin Liu, Bjorn Andersson, Bjorn Helgaas,
	Boris Brezillon, Brian Norris, Chanwoo Choi, Chen Feng,
	Chen-Yu Tsai, Corentin Labbe

The reset control API has two modes: exclusive access, where the driver
expects to have full and immediate control over the state of the reset
line, and shared (clock-like) access, where drivers only request reset
deassertion while active, but don't care about the state of the reset line
while inactive.

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior.

This series converts all drivers that currently implicitly request
exclusive reset controls to the corresponding explicit API call. It is,
for the most part, generated from the following semantic patch:

@@
expression rstc, dev, id;
@@
-rstc = reset_control_get(dev, id);
+rstc = reset_control_get_exclusive(dev, id);
@@
expression rstc, dev, id;
@@
-rstc = reset_control_get_optional(dev, id);
+rstc = reset_control_get_optional_exclusive(dev, id);
@@
expression rstc, node, id;
@@
-rstc = of_reset_control_get(node, id);
+rstc = of_reset_control_get_exclusive(node, id);
@@
expression rstc, node, index;
@@
-rstc = of_reset_control_get_by_index(node, index);
+rstc = of_reset_control_get_exclusive_by_index(node, index);
@@
expression rstc, dev, id;
@@
-rstc = devm_reset_control_get(dev, id);
+rstc = devm_reset_control_get_exclusive(dev, id);
@@
expression rstc, dev, id;
@@
-rstc = devm_reset_control_get_optional(dev, id);
+rstc = devm_reset_control_get_optional_exclusive(dev, id);
@@
expression rstc, dev, index;
@@
-rstc = devm_reset_control_get_by_index(dev, index);
+rstc = devm_reset_control_get_exclusive_by_index(dev, index);

After all driver patches are applied, the temporary transition helpers
can be removed.

regards
Philipp

Philipp Zabel (102):
  ARM: rockchip: explicitly request exclusive reset control
  ARM: socfpga: explicitly request exclusive reset control
  MIPS: pci-mt7620: explicitly request exclusive reset control
  ahci: st: explicitly request exclusive reset control
  ata: sata_gemini: explicitly request exclusive reset control
  ata: ahci_tegra: explicitly request exclusive reset control
  bus: sunxi-rsb: explicitly request exclusive reset control
  bus: tegra-gmi: explicitly request exclusive reset control
  clk: sunxi: explicitly request exclusive reset control
  clk: tegra: explicitly request exclusive reset control
  clocksource/drivers/timer-stm32: explicitly request exclusive reset
    control
  clocksource/drivers/sun5i: explicitly request exclusive reset control
  crypto: rockchip: explicitly request exclusive reset control
  crypto: sun4i-ss - request exclusive reset control
  PM / devfreq: tegra: explicitly request exclusive reset control
  dmaengine: stm32-dma: explicitly request exclusive reset control
  dmaengine: sun6i: explicitly request exclusive reset control
  dmaengine: tegra-apb: explicitly request exclusive reset control
  drm: kirin: explicitly request exclusive reset control
  drm/nouveau/tegra: explicitly request exclusive reset control
  drm/rockchip: explicitly request exclusive reset control
  drm/sti: explicitly request exclusive reset control
  drm/stm: explicitly request exclusive reset control
  drm/sun4i: explicitly request exclusive reset control
  drm/tegra: explicitly request exclusive reset control
  gpu: host1x: explicitly request exclusive reset control
  i2c: mv64xxx: explicitly request exclusive reset control
  i2c: stm32f4: explicitly request exclusive reset control
  i2c: sun6i-pw2i: explicitly request exclusive reset control
  i2c: tegra: explicitly request exclusive reset control
  iio: adc: rockchip_saradc: explicitly request exclusive reset control
  iio: dac: stm32-dac-core: explicitly request exclusive reset control
  Input: tegra-kbc - request exclusive reset control
  coda: explicitly request exclusive reset control
  st-rc: explicitly request exclusive reset control
  stm32-dcmi: explicitly request exclusive reset control
  rc: sunxi-cir: explicitly request exclusive reset control
  mmc: dw_mmc: explicitly request exclusive reset control
  mmc: sdhci-st: explicitly request exclusive reset control
  mmc: sunxi: explicitly request exclusive reset control
  mmc: tegra: explicitly request exclusive reset control
  mtd: nand: sunxi: explicitly request exclusive reset control
  mtd: spi-nor: stm32-quadspi: explicitly request exclusive reset
    control
  net: dsa: mt7530: explicitly request exclusive reset control
  net: ethernet: hisi_femac: explicitly request exclusive reset control
  net: ethernet: hix5hd2_gmac: explicitly request exclusive reset
    control
  net: stmmac: explicitly request exclusive reset control
  net: stmmac: dwc-qos: explicitly request exclusive reset control
  ath10k: explicitly request exclusive reset control
  nvmem: lpc18xx-eeprom: explicitly request exclusive reset control
  PCI: dwc: pcie-qcom: explicitly request exclusive reset control
  PCI: imx6: explicitly request exclusive reset control
  PCI: tegra: explicitly request exclusive reset control
  PCI: rockchip: explicitly request exclusive reset control
  phy: berlin-usb: explicitly request exclusive reset control
  PCI: mediatek: explicitly request exclusive reset control
  phy: qcom-usb-hs: explicitly request exclusive reset control
  phy: rockchip-pcie: explicitly request exclusive reset control
  phy: rockchip-typec: explicitly request exclusive reset control
  phy: rockchip-usb: explicitly request exclusive reset control
  phy: sun4i-usb: explicitly request exclusive reset control
  phy: sun9i-usb: explicitly request exclusive reset control
  phy: tegra: explicitly request exclusive reset control
  phy: qcom-qmp: explicitly request exclusive reset control
  phy: qcom-qusb2: explicitly request exclusive reset control
  pinctrl: stm32: explicitly request exclusive reset control
  pinctrl: sunxi: explicitly request exclusive reset control
  pinctrl: tegra: explicitly request exclusive reset control
  pwm: hibvt: explicitly request exclusive reset control
  pwm: tegra: explicitly request exclusive reset control
  remoteproc/keystone: explicitly request exclusive reset control
  remoteproc: qcom: explicitly request exclusive reset control
  remoteproc: st: explicitly request exclusive reset control
  soc: mediatek: PMIC wrap: explicitly request exclusive reset control
  soc/tegra: pmc: explicitly request exclusive reset control
  spi: stm32: explicitly request exclusive reset control
  spi: sun6i: explicitly request exclusive reset control
  spi: tegra20-slink: explicitly request exclusive reset control
  spi: tegra114: explicitly request exclusive reset control
  spi: tegra20-sflash: explicitly request exclusive reset control
  staging: nvec: explicitly request exclusive reset control
  thermal: rockchip: explicitly request exclusive reset control
  thermal: tegra: explicitly request exclusive reset control
  serial: 8250_dw: explicitly request exclusive reset control
  serial: tegra: explicitly request exclusive reset control
  usb: chipidea: msm: explicitly request exclusive reset control
  usb: dwc2: explicitly request exclusive reset control
  usb: host: ehci-tegra: explicitly request exclusive reset control
  usb: host: xhci-tegra: explicitly request exclusive reset control
  usb: musb: sunxi: explicitly request exclusive reset control
  usb: phy: msm: explicitly request exclusive reset control
  usb: phy: qcom-8x16-usb: explicitly request exclusive reset control
  watchdog: asm9260: explicitly request exclusive reset control
  watchdog: mt7621: explicitly request exclusive reset control
  watchdog: rt2880: explicitly request exclusive reset control
  watchdog: zx2967: explicitly request exclusive reset control
  ASoC: img: explicitly request exclusive reset control
  ASoC: stm32: explicitly request exclusive reset control
  ASoC: sun4i: explicitly request exclusive reset control
  ASoC: tegra: explicitly request exclusive reset control
  Documentation: devres: add explicit exclusive/shared reset control
    request calls
  reset: finish transition to explicit exclusive reset control requests

 Documentation/driver-model/devres.txt              |  7 ++-
 arch/arm/mach-rockchip/platsmp.c                   |  2 +-
 arch/mips/pci/pci-mt7620.c                         |  2 +-
 drivers/ata/ahci_st.c                              |  6 +--
 drivers/ata/ahci_tegra.c                           |  8 ++--
 drivers/ata/sata_gemini.c                          |  4 +-
 drivers/bus/sunxi-rsb.c                            |  2 +-
 drivers/bus/tegra-gmi.c                            |  2 +-
 drivers/clk/sunxi/clk-sun9i-mmc.c                  |  2 +-
 drivers/clk/tegra/clk-dfll.c                       |  2 +-
 drivers/clocksource/timer-stm32.c                  |  2 +-
 drivers/clocksource/timer-sun5i.c                  |  2 +-
 drivers/crypto/rockchip/rk3288_crypto.c            |  2 +-
 drivers/crypto/sunxi-ss/sun4i-ss-core.c            |  3 +-
 drivers/devfreq/tegra-devfreq.c                    |  2 +-
 drivers/dma/stm32-dma.c                            |  2 +-
 drivers/dma/sun6i-dma.c                            |  2 +-
 drivers/dma/tegra20-apb-dma.c                      |  2 +-
 drivers/fpga/altera-hps2fpga.c                     |  3 +-
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c    |  2 +-
 drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c |  2 +-
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c    |  2 +-
 drivers/gpu/drm/rockchip/cdn-dp-core.c             |  8 ++--
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c             |  2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c        |  4 +-
 drivers/gpu/drm/sti/sti_hdmi.c                     |  2 +-
 drivers/gpu/drm/sti/sti_hqvdp.c                    |  2 +-
 drivers/gpu/drm/sti/sti_tvout.c                    |  2 +-
 drivers/gpu/drm/stm/ltdc.c                         |  2 +-
 drivers/gpu/drm/sun4i/sun4i_backend.c              |  4 +-
 drivers/gpu/drm/sun4i/sun4i_tcon.c                 |  2 +-
 drivers/gpu/drm/sun4i/sun4i_tv.c                   |  2 +-
 drivers/gpu/drm/sun4i/sun6i_drc.c                  |  2 +-
 drivers/gpu/drm/sun4i/sun8i_mixer.c                |  2 +-
 drivers/gpu/drm/tegra/dc.c                         |  2 +-
 drivers/gpu/drm/tegra/dpaux.c                      |  3 +-
 drivers/gpu/drm/tegra/dsi.c                        |  2 +-
 drivers/gpu/drm/tegra/gr3d.c                       |  6 +--
 drivers/gpu/drm/tegra/hdmi.c                       |  2 +-
 drivers/gpu/drm/tegra/sor.c                        |  2 +-
 drivers/gpu/host1x/dev.c                           |  2 +-
 drivers/i2c/busses/i2c-mv64xxx.c                   |  2 +-
 drivers/i2c/busses/i2c-stm32f4.c                   |  2 +-
 drivers/i2c/busses/i2c-sun6i-p2wi.c                |  2 +-
 drivers/i2c/busses/i2c-tegra.c                     |  2 +-
 drivers/iio/adc/rockchip_saradc.c                  |  3 +-
 drivers/iio/dac/stm32-dac-core.c                   |  2 +-
 drivers/input/keyboard/tegra-kbc.c                 |  2 +-
 drivers/media/platform/coda/coda-common.c          |  3 +-
 drivers/media/platform/stm32/stm32-dcmi.c          |  2 +-
 drivers/media/rc/st_rc.c                           |  2 +-
 drivers/media/rc/sunxi-cir.c                       |  2 +-
 drivers/mmc/host/dw_mmc.c                          |  2 +-
 drivers/mmc/host/sdhci-st.c                        |  2 +-
 drivers/mmc/host/sdhci-tegra.c                     |  3 +-
 drivers/mmc/host/sunxi-mmc.c                       |  3 +-
 drivers/mtd/nand/sunxi_nand.c                      |  2 +-
 drivers/mtd/spi-nor/stm32-quadspi.c                |  2 +-
 drivers/net/dsa/mt7530.c                           |  3 +-
 drivers/net/ethernet/hisilicon/hisi_femac.c        |  4 +-
 drivers/net/ethernet/hisilicon/hix5hd2_gmac.c      |  6 +--
 .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c    |  2 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c  |  3 +-
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |  4 +-
 drivers/net/wireless/ath/ath10k/ahb.c              | 15 ++++---
 drivers/nvmem/lpc18xx_eeprom.c                     |  2 +-
 drivers/pci/dwc/pci-imx6.c                         |  7 +--
 drivers/pci/dwc/pcie-qcom.c                        | 40 +++++++++--------
 drivers/pci/host/pci-tegra.c                       |  6 +--
 drivers/pci/host/pcie-mediatek.c                   |  2 +-
 drivers/pci/host/pcie-rockchip.c                   | 15 ++++---
 drivers/phy/allwinner/phy-sun4i-usb.c              |  2 +-
 drivers/phy/allwinner/phy-sun9i-usb.c              |  4 +-
 drivers/phy/marvell/phy-berlin-usb.c               |  2 +-
 drivers/phy/qualcomm/phy-qcom-qmp.c                |  4 +-
 drivers/phy/qualcomm/phy-qcom-qusb2.c              |  3 +-
 drivers/phy/qualcomm/phy-qcom-usb-hs.c             |  3 +-
 drivers/phy/rockchip/phy-rockchip-pcie.c           |  2 +-
 drivers/phy/rockchip/phy-rockchip-typec.c          |  6 +--
 drivers/phy/rockchip/phy-rockchip-usb.c            |  2 +-
 drivers/phy/tegra/xusb-tegra210.c                  |  4 +-
 drivers/phy/tegra/xusb.c                           |  2 +-
 drivers/pinctrl/stm32/pinctrl-stm32.c              |  2 +-
 drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c        |  2 +-
 drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c        |  2 +-
 drivers/pinctrl/tegra/pinctrl-tegra-xusb.c         |  2 +-
 drivers/pwm/pwm-hibvt.c                            |  2 +-
 drivers/pwm/pwm-tegra.c                            |  2 +-
 drivers/remoteproc/keystone_remoteproc.c           |  2 +-
 drivers/remoteproc/qcom_q6v5_pil.c                 |  3 +-
 drivers/remoteproc/st_remoteproc.c                 |  6 ++-
 drivers/reset/core.c                               |  2 +-
 drivers/soc/mediatek/mtk-pmic-wrap.c               |  5 ++-
 drivers/soc/tegra/pmc.c                            |  2 +-
 drivers/spi/spi-stm32.c                            |  2 +-
 drivers/spi/spi-sun6i.c                            |  2 +-
 drivers/spi/spi-tegra114.c                         |  2 +-
 drivers/spi/spi-tegra20-sflash.c                   |  2 +-
 drivers/spi/spi-tegra20-slink.c                    |  2 +-
 drivers/staging/nvec/nvec.c                        |  2 +-
 drivers/thermal/rockchip_thermal.c                 |  3 +-
 drivers/thermal/tegra/soctherm.c                   |  3 +-
 drivers/tty/serial/8250/8250_dw.c                  |  2 +-
 drivers/tty/serial/serial-tegra.c                  |  2 +-
 drivers/usb/chipidea/ci_hdrc_msm.c                 |  2 +-
 drivers/usb/dwc2/platform.c                        |  3 +-
 drivers/usb/host/ehci-tegra.c                      |  5 ++-
 drivers/usb/host/xhci-tegra.c                      |  6 ++-
 drivers/usb/musb/sunxi.c                           |  2 +-
 drivers/usb/phy/phy-msm-usb.c                      |  4 +-
 drivers/usb/phy/phy-qcom-8x16-usb.c                |  2 +-
 drivers/watchdog/asm9260_wdt.c                     |  2 +-
 drivers/watchdog/mt7621_wdt.c                      |  2 +-
 drivers/watchdog/rt2880_wdt.c                      |  2 +-
 drivers/watchdog/zx2967_wdt.c                      |  2 +-
 include/linux/reset.h                              | 50 ----------------------
 sound/soc/img/img-i2s-in.c                         |  2 +-
 sound/soc/img/img-i2s-out.c                        |  2 +-
 sound/soc/img/img-parallel-out.c                   |  2 +-
 sound/soc/img/img-spdif-in.c                       |  2 +-
 sound/soc/img/img-spdif-out.c                      |  2 +-
 sound/soc/stm/stm32_i2s.c                          |  2 +-
 sound/soc/stm/stm32_sai.c                          |  2 +-
 sound/soc/stm/stm32_spdifrx.c                      |  2 +-
 sound/soc/sunxi/sun4i-codec.c                      |  3 +-
 sound/soc/sunxi/sun4i-i2s.c                        |  2 +-
 sound/soc/sunxi/sun4i-spdif.c                      |  3 +-
 sound/soc/tegra/tegra30_ahub.c                     |  4 +-
 128 files changed, 226 insertions(+), 235 deletions(-)

-- 
2.11.0

Cc: "David S. Miller" <davem@davemloft.net>
Cc: "Emilio López" <emilio@elopez.com.ar>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Alan Tull <atull@kernel.org>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Bin Liu <b-liu@ti.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Chanwoo Choi <cw00.choi@samsung.com>
Cc: Chen Feng <puck.chen@hisilicon.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: Corentin Labbe <clabbe.montjoie@gmail.com>
Cc: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: David Airlie <airlied@linux.ie>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Joachim Eastwood <manabian@gmail.com>
Cc: John Youn <johnyoun@synopsys.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Marc Dietrich <marvin24@gmx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Mark Yao <mark.yao@rock-chips.com>
Cc: Mathias Nyman <mathias.nyman@intel.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Moritz Fischer <moritz.fischer@ettus.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Peter Chen <Peter.Chen@nxp.com>
Cc: Peter De Schrijver <pdeschrijver@nvidia.com>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Philippe Cornu <philippe.cornu@st.com>
Cc: Prashant Gaikwad <pgaikwad@nvidia.com>
Cc: Rakesh Iyer <riyer@nvidia.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Richard Zhu <hongxing.zhu@nxp.com>
Cc: Rongrong Zou <zourongrong@gmail.com>
Cc: Ryder Lee <ryder.lee@mediatek.com>
Cc: Salil Mehta <salil.mehta@huawei.com>
Cc: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: Wim Van Sebroeck <wim@iguana.be>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Cc: Yannick Fertre <yannick.fertre@st.com>
Cc: Yisen Zhuang <yisen.zhuang@huawei.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: alsa-devel@alsa-project.org
Cc: ath10k@lists.infradead.org
Cc: devel@driverdev.osuosl.org
Cc: dmaengine@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: linux-crypto@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-fpga@vger.kernel.org
Cc: linux-gpio@vger.kernel.org
Cc: linux-i2c@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Cc: linux-iio@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-media@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-mips@linux-mips.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-mtd@lists.infradead.org
Cc: linux-pci@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: linux-pwm@vger.kernel.org
Cc: linux-remoteproc@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-serial@vger.kernel.org
Cc: linux-spi@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: linux-watchdog@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: nouveau@lists.freedesktop.org

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 001/102] ARM: rockchip: explicitly request exclusive reset control
  2017-07-19 15:25 [PATCH 000/102] Convert drivers to explicit reset API Philipp Zabel
@ 2017-07-19 15:25 ` Philipp Zabel
  2017-07-20 20:28   ` Heiko Stuebner
  2017-07-19 15:25 ` [PATCH 013/102] crypto: " Philipp Zabel
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: Philipp Zabel, Heiko Stuebner, linux-rockchip

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 arch/arm/mach-rockchip/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
index 3abafdbdd7f4a..420ba67652230 100644
--- a/arch/arm/mach-rockchip/platsmp.c
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -67,7 +67,7 @@ static struct reset_control *rockchip_get_core_reset(int cpu)
 	else
 		np = of_get_cpu_node(cpu, NULL);
 
-	return of_reset_control_get(np, NULL);
+	return of_reset_control_get_exclusive(np, NULL);
 }
 
 static int pmu_set_power_domain(int pd, bool on)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 013/102] crypto: rockchip: explicitly request exclusive reset control
  2017-07-19 15:25 [PATCH 000/102] Convert drivers to explicit reset API Philipp Zabel
  2017-07-19 15:25 ` [PATCH 001/102] ARM: rockchip: explicitly request exclusive reset control Philipp Zabel
@ 2017-07-19 15:25 ` Philipp Zabel
  2017-07-19 15:25 ` [PATCH 021/102] drm/rockchip: " Philipp Zabel
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: Philipp Zabel, Herbert Xu, David S. Miller, Heiko Stuebner,
	linux-crypto, linux-rockchip

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-crypto@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/crypto/rockchip/rk3288_crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/rockchip/rk3288_crypto.c b/drivers/crypto/rockchip/rk3288_crypto.c
index d0f80c6241f95..fdfd1f02911e9 100644
--- a/drivers/crypto/rockchip/rk3288_crypto.c
+++ b/drivers/crypto/rockchip/rk3288_crypto.c
@@ -294,7 +294,7 @@ static int rk_crypto_probe(struct platform_device *pdev)
 		goto err_crypto;
 	}
 
-	crypto_info->rst = devm_reset_control_get(dev, "crypto-rst");
+	crypto_info->rst = devm_reset_control_get_exclusive(dev, "crypto-rst");
 	if (IS_ERR(crypto_info->rst)) {
 		err = PTR_ERR(crypto_info->rst);
 		goto err_crypto;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 021/102] drm/rockchip: explicitly request exclusive reset control
  2017-07-19 15:25 [PATCH 000/102] Convert drivers to explicit reset API Philipp Zabel
  2017-07-19 15:25 ` [PATCH 001/102] ARM: rockchip: explicitly request exclusive reset control Philipp Zabel
  2017-07-19 15:25 ` [PATCH 013/102] crypto: " Philipp Zabel
@ 2017-07-19 15:25 ` Philipp Zabel
  2017-07-19 15:25 ` [PATCH 031/102] iio: adc: rockchip_saradc: " Philipp Zabel
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-rockchip, dri-devel

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Mark Yao <mark.yao@rock-chips.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 2 +-
 drivers/gpu/drm/rockchip/cdn-dp-core.c          | 8 ++++----
 drivers/gpu/drm/rockchip/dw-mipi-dsi.c          | 2 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c     | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
index 9606121fa185a..172930e7645e7 100644
--- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
+++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
@@ -297,7 +297,7 @@ static int rockchip_dp_init(struct rockchip_dp_device *dp)
 		return PTR_ERR(dp->pclk);
 	}
 
-	dp->rst = devm_reset_control_get(dev, "dp");
+	dp->rst = devm_reset_control_get_exclusive(dev, "dp");
 	if (IS_ERR(dp->rst)) {
 		dev_err(dev, "failed to get dp reset control\n");
 		return PTR_ERR(dp->rst);
diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c
index 9b0b0588bbedb..b7f5c5d9f245d 100644
--- a/drivers/gpu/drm/rockchip/cdn-dp-core.c
+++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c
@@ -765,25 +765,25 @@ static int cdn_dp_parse_dt(struct cdn_dp_device *dp)
 		return PTR_ERR(dp->grf_clk);
 	}
 
-	dp->spdif_rst = devm_reset_control_get(dev, "spdif");
+	dp->spdif_rst = devm_reset_control_get_exclusive(dev, "spdif");
 	if (IS_ERR(dp->spdif_rst)) {
 		DRM_DEV_ERROR(dev, "no spdif reset control found\n");
 		return PTR_ERR(dp->spdif_rst);
 	}
 
-	dp->dptx_rst = devm_reset_control_get(dev, "dptx");
+	dp->dptx_rst = devm_reset_control_get_exclusive(dev, "dptx");
 	if (IS_ERR(dp->dptx_rst)) {
 		DRM_DEV_ERROR(dev, "no uphy reset control found\n");
 		return PTR_ERR(dp->dptx_rst);
 	}
 
-	dp->core_rst = devm_reset_control_get(dev, "core");
+	dp->core_rst = devm_reset_control_get_exclusive(dev, "core");
 	if (IS_ERR(dp->core_rst)) {
 		DRM_DEV_ERROR(dev, "no core reset control found\n");
 		return PTR_ERR(dp->core_rst);
 	}
 
-	dp->apb_rst = devm_reset_control_get(dev, "apb");
+	dp->apb_rst = devm_reset_control_get_exclusive(dev, "apb");
 	if (IS_ERR(dp->apb_rst)) {
 		DRM_DEV_ERROR(dev, "no apb reset control found\n");
 		return PTR_ERR(dp->apb_rst);
diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
index 21b9737662ae9..c3501ae59db35 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi.c
@@ -1221,7 +1221,7 @@ static int dw_mipi_dsi_bind(struct device *dev, struct device *master,
 	 * Note that the reset was not defined in the initial device tree, so
 	 * we have to be prepared for it not being found.
 	 */
-	apb_rst = devm_reset_control_get(dev, "apb");
+	apb_rst = devm_reset_control_get_exclusive(dev, "apb");
 	if (IS_ERR(apb_rst)) {
 		ret = PTR_ERR(apb_rst);
 		if (ret == -ENOENT) {
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 5d450332c2fd7..18b582cd81e50 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1443,7 +1443,7 @@ static int vop_initial(struct vop *vop)
 	/*
 	 * do hclk_reset, reset all vop registers.
 	 */
-	ahb_rst = devm_reset_control_get(vop->dev, "ahb");
+	ahb_rst = devm_reset_control_get_exclusive(vop->dev, "ahb");
 	if (IS_ERR(ahb_rst)) {
 		dev_err(vop->dev, "failed to get ahb reset\n");
 		ret = PTR_ERR(ahb_rst);
@@ -1469,7 +1469,7 @@ static int vop_initial(struct vop *vop)
 	/*
 	 * do dclk_reset, let all config take affect.
 	 */
-	vop->dclk_rst = devm_reset_control_get(vop->dev, "dclk");
+	vop->dclk_rst = devm_reset_control_get_exclusive(vop->dev, "dclk");
 	if (IS_ERR(vop->dclk_rst)) {
 		dev_err(vop->dev, "failed to get dclk reset\n");
 		ret = PTR_ERR(vop->dclk_rst);
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 031/102] iio: adc: rockchip_saradc: explicitly request exclusive reset control
  2017-07-19 15:25 [PATCH 000/102] Convert drivers to explicit reset API Philipp Zabel
                   ` (2 preceding siblings ...)
  2017-07-19 15:25 ` [PATCH 021/102] drm/rockchip: " Philipp Zabel
@ 2017-07-19 15:25 ` Philipp Zabel
  2017-08-20 11:09   ` Jonathan Cameron
  2017-07-19 15:26 ` [PATCH 082/102] thermal: rockchip: " Philipp Zabel
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: Philipp Zabel, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Heiko Stuebner,
	linux-iio, linux-rockchip

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-iio@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/iio/adc/rockchip_saradc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index ae6d3324f5183..1d9300ba07c00 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -235,7 +235,8 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
 	 * The reset should be an optional property, as it should work
 	 * with old devicetrees as well
 	 */
-	info->reset = devm_reset_control_get(&pdev->dev, "saradc-apb");
+	info->reset = devm_reset_control_get_exclusive(&pdev->dev,
+						       "saradc-apb");
 	if (IS_ERR(info->reset)) {
 		ret = PTR_ERR(info->reset);
 		if (ret != -ENOENT)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 054/102] PCI: rockchip: explicitly request exclusive reset control
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2017-07-19 15:25   ` Philipp Zabel
  2017-07-22 13:12     ` Shawn Lin
                       ` (2 more replies)
  2017-07-19 15:26   ` [PATCH 058/102] phy: rockchip-pcie: " Philipp Zabel
                     ` (8 subsequent siblings)
  9 siblings, 3 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:25 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Heiko Stuebner, linux-pci-u79uwXL29TY76Z2rM5mHXA, Shawn Lin,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Philipp Zabel,
	Bjorn Helgaas

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Cc: Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
Cc: linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Signed-off-by: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
index 7bb9870f6d8ce..e50d6f5a81f4b 100644
--- a/drivers/pci/host/pcie-rockchip.c
+++ b/drivers/pci/host/pcie-rockchip.c
@@ -903,49 +903,50 @@ static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
 	if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
 		rockchip->link_gen = 2;
 
-	rockchip->core_rst = devm_reset_control_get(dev, "core");
+	rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core");
 	if (IS_ERR(rockchip->core_rst)) {
 		if (PTR_ERR(rockchip->core_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing core reset property in node\n");
 		return PTR_ERR(rockchip->core_rst);
 	}
 
-	rockchip->mgmt_rst = devm_reset_control_get(dev, "mgmt");
+	rockchip->mgmt_rst = devm_reset_control_get_exclusive(dev, "mgmt");
 	if (IS_ERR(rockchip->mgmt_rst)) {
 		if (PTR_ERR(rockchip->mgmt_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing mgmt reset property in node\n");
 		return PTR_ERR(rockchip->mgmt_rst);
 	}
 
-	rockchip->mgmt_sticky_rst = devm_reset_control_get(dev, "mgmt-sticky");
+	rockchip->mgmt_sticky_rst = devm_reset_control_get_exclusive(dev,
+								     "mgmt-sticky");
 	if (IS_ERR(rockchip->mgmt_sticky_rst)) {
 		if (PTR_ERR(rockchip->mgmt_sticky_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing mgmt-sticky reset property in node\n");
 		return PTR_ERR(rockchip->mgmt_sticky_rst);
 	}
 
-	rockchip->pipe_rst = devm_reset_control_get(dev, "pipe");
+	rockchip->pipe_rst = devm_reset_control_get_exclusive(dev, "pipe");
 	if (IS_ERR(rockchip->pipe_rst)) {
 		if (PTR_ERR(rockchip->pipe_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing pipe reset property in node\n");
 		return PTR_ERR(rockchip->pipe_rst);
 	}
 
-	rockchip->pm_rst = devm_reset_control_get(dev, "pm");
+	rockchip->pm_rst = devm_reset_control_get_exclusive(dev, "pm");
 	if (IS_ERR(rockchip->pm_rst)) {
 		if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing pm reset property in node\n");
 		return PTR_ERR(rockchip->pm_rst);
 	}
 
-	rockchip->pclk_rst = devm_reset_control_get(dev, "pclk");
+	rockchip->pclk_rst = devm_reset_control_get_exclusive(dev, "pclk");
 	if (IS_ERR(rockchip->pclk_rst)) {
 		if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing pclk reset property in node\n");
 		return PTR_ERR(rockchip->pclk_rst);
 	}
 
-	rockchip->aclk_rst = devm_reset_control_get(dev, "aclk");
+	rockchip->aclk_rst = devm_reset_control_get_exclusive(dev, "aclk");
 	if (IS_ERR(rockchip->aclk_rst)) {
 		if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER)
 			dev_err(dev, "missing aclk reset property in node\n");
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 058/102] phy: rockchip-pcie: explicitly request exclusive reset control
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  2017-07-19 15:25   ` [PATCH 054/102] PCI: " Philipp Zabel
@ 2017-07-19 15:26   ` Philipp Zabel
  2017-07-22 13:09     ` Shawn Lin
  2017-08-03  0:37     ` Shawn Lin
  2017-07-19 15:26   ` [PATCH 059/102] phy: rockchip-typec: " Philipp Zabel
                     ` (7 subsequent siblings)
  9 siblings, 2 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:26 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Heiko Stuebner,
	Philipp Zabel, Kishon Vijay Abraham I

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
Cc: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Signed-off-by: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 drivers/phy/rockchip/phy-rockchip-pcie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchip/phy-rockchip-pcie.c
index 6904633cad687..258220b7f481c 100644
--- a/drivers/phy/rockchip/phy-rockchip-pcie.c
+++ b/drivers/phy/rockchip/phy-rockchip-pcie.c
@@ -305,7 +305,7 @@ static int rockchip_pcie_phy_probe(struct platform_device *pdev)
 	rk_phy->phy_data = (struct rockchip_pcie_data *)of_id->data;
 	rk_phy->reg_base = grf;
 
-	rk_phy->phy_rst = devm_reset_control_get(dev, "phy");
+	rk_phy->phy_rst = devm_reset_control_get_exclusive(dev, "phy");
 	if (IS_ERR(rk_phy->phy_rst)) {
 		if (PTR_ERR(rk_phy->phy_rst) != -EPROBE_DEFER)
 			dev_err(dev,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 059/102] phy: rockchip-typec: explicitly request exclusive reset control
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  2017-07-19 15:25   ` [PATCH 054/102] PCI: " Philipp Zabel
  2017-07-19 15:26   ` [PATCH 058/102] phy: rockchip-pcie: " Philipp Zabel
@ 2017-07-19 15:26   ` Philipp Zabel
  2017-07-19 15:26   ` [PATCH 060/102] phy: rockchip-usb: " Philipp Zabel
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:26 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Heiko Stuebner,
	Philipp Zabel, Kishon Vijay Abraham I

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
Cc: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Signed-off-by: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 drivers/phy/rockchip/phy-rockchip-typec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c
index 7cfb0f8995de8..caf046e1348d1 100644
--- a/drivers/phy/rockchip/phy-rockchip-typec.c
+++ b/drivers/phy/rockchip/phy-rockchip-typec.c
@@ -888,19 +888,19 @@ static int tcphy_parse_dt(struct rockchip_typec_phy *tcphy,
 		return PTR_ERR(tcphy->clk_ref);
 	}
 
-	tcphy->uphy_rst = devm_reset_control_get(dev, "uphy");
+	tcphy->uphy_rst = devm_reset_control_get_exclusive(dev, "uphy");
 	if (IS_ERR(tcphy->uphy_rst)) {
 		dev_err(dev, "no uphy_rst reset control found\n");
 		return PTR_ERR(tcphy->uphy_rst);
 	}
 
-	tcphy->pipe_rst = devm_reset_control_get(dev, "uphy-pipe");
+	tcphy->pipe_rst = devm_reset_control_get_exclusive(dev, "uphy-pipe");
 	if (IS_ERR(tcphy->pipe_rst)) {
 		dev_err(dev, "no pipe_rst reset control found\n");
 		return PTR_ERR(tcphy->pipe_rst);
 	}
 
-	tcphy->tcphy_rst = devm_reset_control_get(dev, "uphy-tcphy");
+	tcphy->tcphy_rst = devm_reset_control_get_exclusive(dev, "uphy-tcphy");
 	if (IS_ERR(tcphy->tcphy_rst)) {
 		dev_err(dev, "no tcphy_rst reset control found\n");
 		return PTR_ERR(tcphy->tcphy_rst);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 060/102] phy: rockchip-usb: explicitly request exclusive reset control
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
                     ` (2 preceding siblings ...)
  2017-07-19 15:26   ` [PATCH 059/102] phy: rockchip-typec: " Philipp Zabel
@ 2017-07-19 15:26   ` Philipp Zabel
  2017-07-19 19:15   ` [PATCH 000/102] Convert drivers to explicit reset API Thomas Petazzoni
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:26 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Heiko Stuebner,
	Philipp Zabel, Kishon Vijay Abraham I

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
Cc: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Signed-off-by: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
---
 drivers/phy/rockchip/phy-rockchip-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-usb.c b/drivers/phy/rockchip/phy-rockchip-usb.c
index 3378eeb7a562f..e8907ab926401 100644
--- a/drivers/phy/rockchip/phy-rockchip-usb.c
+++ b/drivers/phy/rockchip/phy-rockchip-usb.c
@@ -213,7 +213,7 @@ static int rockchip_usb_phy_init(struct rockchip_usb_phy_base *base,
 		return -EINVAL;
 	}
 
-	rk_phy->reset = of_reset_control_get(child, "phy-reset");
+	rk_phy->reset = of_reset_control_get_exclusive(child, "phy-reset");
 	if (IS_ERR(rk_phy->reset))
 		rk_phy->reset = NULL;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 082/102] thermal: rockchip: explicitly request exclusive reset control
  2017-07-19 15:25 [PATCH 000/102] Convert drivers to explicit reset API Philipp Zabel
                   ` (3 preceding siblings ...)
  2017-07-19 15:25 ` [PATCH 031/102] iio: adc: rockchip_saradc: " Philipp Zabel
@ 2017-07-19 15:26 ` Philipp Zabel
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  2017-07-20 20:32 ` Heiko Stuebner
  6 siblings, 0 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-19 15:26 UTC (permalink / raw)
  To: linux-kernel
  Cc: Philipp Zabel, Zhang Rui, Eduardo Valentin, Heiko Stuebner,
	linux-pm, linux-rockchip

Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.

No functional changes.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-pm@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/thermal/rockchip_thermal.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 4c77965124535..7ca53a4368124 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -1088,7 +1088,8 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
 	if (IS_ERR(thermal->regs))
 		return PTR_ERR(thermal->regs);
 
-	thermal->reset = devm_reset_control_get(&pdev->dev, "tsadc-apb");
+	thermal->reset = devm_reset_control_get_exclusive(&pdev->dev,
+							  "tsadc-apb");
 	if (IS_ERR(thermal->reset)) {
 		error = PTR_ERR(thermal->reset);
 		dev_err(&pdev->dev, "failed to get tsadc reset: %d\n", error);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
                     ` (3 preceding siblings ...)
  2017-07-19 15:26   ` [PATCH 060/102] phy: rockchip-usb: " Philipp Zabel
@ 2017-07-19 19:15   ` Thomas Petazzoni
  2017-07-20  9:36     ` Philipp Zabel
  2017-07-20  6:56   ` Maxime Ripard
                     ` (4 subsequent siblings)
  9 siblings, 1 reply; 34+ messages in thread
From: Thomas Petazzoni @ 2017-07-19 19:15 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andrew Lunn, Prashant Gaikwad, Heiko Stuebner, Peter Chen,
	Linus Walleij, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Marc Dietrich, Rakesh Iyer, Peter Meerwald-Stadler,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang, Xinliang Liu,
	Chanwoo Choi, Alan Stern, Jiri Slaby, Michael Turquette,
	Guenter Roeck, Ohad Ben-Cohen, linux-pm-u79uwXL29TY76Z2rM5mHXA,
	Thomas Gleixner, Vincent Abriou, Bin Liu, Greg Kroah-Hartman,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA

Hello,

On Wed, 19 Jul 2017 17:25:04 +0200, Philipp Zabel wrote:
> The reset control API has two modes: exclusive access, where the driver
> expects to have full and immediate control over the state of the reset
> line, and shared (clock-like) access, where drivers only request reset
> deassertion while active, but don't care about the state of the reset line
> while inactive.
> 
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior.
> 
> This series converts all drivers that currently implicitly request
> exclusive reset controls to the corresponding explicit API call. It is,
> for the most part, generated from the following semantic patch:
> 
> @@
> expression rstc, dev, id;
> @@
> -rstc = reset_control_get(dev, id);
> +rstc = reset_control_get_exclusive(dev, id);

I don't know if it has been discussed in the past, so forgive me if it
has been. Have you considered adding a "int flags" argument to the
existing reset_control_get_*() functions, rather than introducing
separate exclusive variants ?

Indeed, with a "int flags" argument you could in the future add more
variants/behaviors without actually multiplying the number of
functions. Something like the "flags" argument for request_irq() for
example.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
                     ` (4 preceding siblings ...)
  2017-07-19 19:15   ` [PATCH 000/102] Convert drivers to explicit reset API Thomas Petazzoni
@ 2017-07-20  6:56   ` Maxime Ripard
  2017-07-20  8:11   ` Greg Kroah-Hartman
                     ` (3 subsequent siblings)
  9 siblings, 0 replies; 34+ messages in thread
From: Maxime Ripard @ 2017-07-20  6:56 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andrew Lunn, Prashant Gaikwad, Heiko Stuebner, Peter Chen,
	Linus Walleij, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Marc Dietrich, Rakesh Iyer, Peter Meerwald-Stadler,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck, Wolfram Sang,
	Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck, Ohad Ben-Cohen,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Thomas Gleixner, Vincent Abriou,
	Bin Liu, Greg Kroah-Hartman, linux-usb-u79uwXL29TaqPxH82wqD4g


[-- Attachment #1.1: Type: text/plain, Size: 8914 bytes --]

On Wed, Jul 19, 2017 at 05:25:04PM +0200, Philipp Zabel wrote:
> The reset control API has two modes: exclusive access, where the driver
> expects to have full and immediate control over the state of the reset
> line, and shared (clock-like) access, where drivers only request reset
> deassertion while active, but don't care about the state of the reset line
> while inactive.
> 
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior.
> 
> This series converts all drivers that currently implicitly request
> exclusive reset controls to the corresponding explicit API call. It is,
> for the most part, generated from the following semantic patch:
> 
> @@
> expression rstc, dev, id;
> @@
> -rstc = reset_control_get(dev, id);
> +rstc = reset_control_get_exclusive(dev, id);
> @@
> expression rstc, dev, id;
> @@
> -rstc = reset_control_get_optional(dev, id);
> +rstc = reset_control_get_optional_exclusive(dev, id);
> @@
> expression rstc, node, id;
> @@
> -rstc = of_reset_control_get(node, id);
> +rstc = of_reset_control_get_exclusive(node, id);
> @@
> expression rstc, node, index;
> @@
> -rstc = of_reset_control_get_by_index(node, index);
> +rstc = of_reset_control_get_exclusive_by_index(node, index);
> @@
> expression rstc, dev, id;
> @@
> -rstc = devm_reset_control_get(dev, id);
> +rstc = devm_reset_control_get_exclusive(dev, id);
> @@
> expression rstc, dev, id;
> @@
> -rstc = devm_reset_control_get_optional(dev, id);
> +rstc = devm_reset_control_get_optional_exclusive(dev, id);
> @@
> expression rstc, dev, index;
> @@
> -rstc = devm_reset_control_get_by_index(dev, index);
> +rstc = devm_reset_control_get_exclusive_by_index(dev, index);
> 
> After all driver patches are applied, the temporary transition helpers
> can be removed.
> 
> regards
> Philipp
> 
> Philipp Zabel (102):
>   ARM: rockchip: explicitly request exclusive reset control
>   ARM: socfpga: explicitly request exclusive reset control
>   MIPS: pci-mt7620: explicitly request exclusive reset control
>   ahci: st: explicitly request exclusive reset control
>   ata: sata_gemini: explicitly request exclusive reset control
>   ata: ahci_tegra: explicitly request exclusive reset control
>   bus: sunxi-rsb: explicitly request exclusive reset control
>   bus: tegra-gmi: explicitly request exclusive reset control
>   clk: sunxi: explicitly request exclusive reset control
>   clk: tegra: explicitly request exclusive reset control
>   clocksource/drivers/timer-stm32: explicitly request exclusive reset
>     control
>   clocksource/drivers/sun5i: explicitly request exclusive reset control
>   crypto: rockchip: explicitly request exclusive reset control
>   crypto: sun4i-ss - request exclusive reset control
>   PM / devfreq: tegra: explicitly request exclusive reset control
>   dmaengine: stm32-dma: explicitly request exclusive reset control
>   dmaengine: sun6i: explicitly request exclusive reset control
>   dmaengine: tegra-apb: explicitly request exclusive reset control
>   drm: kirin: explicitly request exclusive reset control
>   drm/nouveau/tegra: explicitly request exclusive reset control
>   drm/rockchip: explicitly request exclusive reset control
>   drm/sti: explicitly request exclusive reset control
>   drm/stm: explicitly request exclusive reset control
>   drm/sun4i: explicitly request exclusive reset control
>   drm/tegra: explicitly request exclusive reset control
>   gpu: host1x: explicitly request exclusive reset control
>   i2c: mv64xxx: explicitly request exclusive reset control
>   i2c: stm32f4: explicitly request exclusive reset control
>   i2c: sun6i-pw2i: explicitly request exclusive reset control
>   i2c: tegra: explicitly request exclusive reset control
>   iio: adc: rockchip_saradc: explicitly request exclusive reset control
>   iio: dac: stm32-dac-core: explicitly request exclusive reset control
>   Input: tegra-kbc - request exclusive reset control
>   coda: explicitly request exclusive reset control
>   st-rc: explicitly request exclusive reset control
>   stm32-dcmi: explicitly request exclusive reset control
>   rc: sunxi-cir: explicitly request exclusive reset control
>   mmc: dw_mmc: explicitly request exclusive reset control
>   mmc: sdhci-st: explicitly request exclusive reset control
>   mmc: sunxi: explicitly request exclusive reset control
>   mmc: tegra: explicitly request exclusive reset control
>   mtd: nand: sunxi: explicitly request exclusive reset control
>   mtd: spi-nor: stm32-quadspi: explicitly request exclusive reset
>     control
>   net: dsa: mt7530: explicitly request exclusive reset control
>   net: ethernet: hisi_femac: explicitly request exclusive reset control
>   net: ethernet: hix5hd2_gmac: explicitly request exclusive reset
>     control
>   net: stmmac: explicitly request exclusive reset control
>   net: stmmac: dwc-qos: explicitly request exclusive reset control
>   ath10k: explicitly request exclusive reset control
>   nvmem: lpc18xx-eeprom: explicitly request exclusive reset control
>   PCI: dwc: pcie-qcom: explicitly request exclusive reset control
>   PCI: imx6: explicitly request exclusive reset control
>   PCI: tegra: explicitly request exclusive reset control
>   PCI: rockchip: explicitly request exclusive reset control
>   phy: berlin-usb: explicitly request exclusive reset control
>   PCI: mediatek: explicitly request exclusive reset control
>   phy: qcom-usb-hs: explicitly request exclusive reset control
>   phy: rockchip-pcie: explicitly request exclusive reset control
>   phy: rockchip-typec: explicitly request exclusive reset control
>   phy: rockchip-usb: explicitly request exclusive reset control
>   phy: sun4i-usb: explicitly request exclusive reset control
>   phy: sun9i-usb: explicitly request exclusive reset control
>   phy: tegra: explicitly request exclusive reset control
>   phy: qcom-qmp: explicitly request exclusive reset control
>   phy: qcom-qusb2: explicitly request exclusive reset control
>   pinctrl: stm32: explicitly request exclusive reset control
>   pinctrl: sunxi: explicitly request exclusive reset control
>   pinctrl: tegra: explicitly request exclusive reset control
>   pwm: hibvt: explicitly request exclusive reset control
>   pwm: tegra: explicitly request exclusive reset control
>   remoteproc/keystone: explicitly request exclusive reset control
>   remoteproc: qcom: explicitly request exclusive reset control
>   remoteproc: st: explicitly request exclusive reset control
>   soc: mediatek: PMIC wrap: explicitly request exclusive reset control
>   soc/tegra: pmc: explicitly request exclusive reset control
>   spi: stm32: explicitly request exclusive reset control
>   spi: sun6i: explicitly request exclusive reset control
>   spi: tegra20-slink: explicitly request exclusive reset control
>   spi: tegra114: explicitly request exclusive reset control
>   spi: tegra20-sflash: explicitly request exclusive reset control
>   staging: nvec: explicitly request exclusive reset control
>   thermal: rockchip: explicitly request exclusive reset control
>   thermal: tegra: explicitly request exclusive reset control
>   serial: 8250_dw: explicitly request exclusive reset control
>   serial: tegra: explicitly request exclusive reset control
>   usb: chipidea: msm: explicitly request exclusive reset control
>   usb: dwc2: explicitly request exclusive reset control
>   usb: host: ehci-tegra: explicitly request exclusive reset control
>   usb: host: xhci-tegra: explicitly request exclusive reset control
>   usb: musb: sunxi: explicitly request exclusive reset control
>   usb: phy: msm: explicitly request exclusive reset control
>   usb: phy: qcom-8x16-usb: explicitly request exclusive reset control
>   watchdog: asm9260: explicitly request exclusive reset control
>   watchdog: mt7621: explicitly request exclusive reset control
>   watchdog: rt2880: explicitly request exclusive reset control
>   watchdog: zx2967: explicitly request exclusive reset control
>   ASoC: img: explicitly request exclusive reset control
>   ASoC: stm32: explicitly request exclusive reset control
>   ASoC: sun4i: explicitly request exclusive reset control
>   ASoC: tegra: explicitly request exclusive reset control
>   Documentation: devres: add explicit exclusive/shared reset control
>     request calls
>   reset: finish transition to explicit exclusive reset control requests


For all sunxi patches:
Acked-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 200 bytes --]

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
                     ` (5 preceding siblings ...)
  2017-07-20  6:56   ` Maxime Ripard
@ 2017-07-20  8:11   ` Greg Kroah-Hartman
  2017-07-20  9:24     ` Philipp Zabel
  2017-07-20 20:32   ` Heiko Stuebner
                     ` (2 subsequent siblings)
  9 siblings, 1 reply; 34+ messages in thread
From: Greg Kroah-Hartman @ 2017-07-20  8:11 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andrew Lunn, Prashant Gaikwad, Heiko Stuebner, Peter Chen,
	Linus Walleij, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Marc Dietrich, Rakesh Iyer, Peter Meerwald-Stadler,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck, Wolfram Sang,
	Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck, Ohad Ben-Cohen,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Thomas Gleixner, Vincent Abriou,
	Bin Liu, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA, linux-kernel@

On Wed, Jul 19, 2017 at 05:25:04PM +0200, Philipp Zabel wrote:
> The reset control API has two modes: exclusive access, where the driver
> expects to have full and immediate control over the state of the reset
> line, and shared (clock-like) access, where drivers only request reset
> deassertion while active, but don't care about the state of the reset line
> while inactive.
> 
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior.
> 
> This series converts all drivers that currently implicitly request
> exclusive reset controls to the corresponding explicit API call. It is,
> for the most part, generated from the following semantic patch:

Hey, I'm all for large api changes, but this really seems ackward, isn't
there a "better" way to do this?

Why not, as you say the "implicit" request is exclusive, just leave
everything alone and state that the "reset_control_get()" call is
exclusive and make the shared one the "odd" usage as that seems to not
be the normal case.

That should be a much smaller patch right?

That way you don't break everything here, and require 100+ patches to
just change the name of a function from one to another and do nothing
else.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
  2017-07-20  8:11   ` Greg Kroah-Hartman
@ 2017-07-20  9:24     ` Philipp Zabel
  0 siblings, 0 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andrew Lunn, Prashant Gaikwad, Heiko Stuebner, Peter Chen,
	Linus Walleij, dri-devel, Marc Dietrich, Rakesh Iyer,
	Peter Meerwald-Stadler, linux-clk, Wim Van Sebroeck, Wolfram Sang,
	Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck, Ohad Ben-Cohen, linux-pm,
	Thomas Gleixner, Vincent Abriou, Bin Liu, linux-usb,
	linux-wireless, linux-kernel@

Hi Greg,

The patches in this series are completely independent of each other, and
I would like the subsystem maintainers to apply them at their own
leisure.
Well, except for the last one, which I will apply only after there are
no more users of the transition helpers.

On Thu, 2017-07-20 at 10:11 +0200, Greg Kroah-Hartman wrote:
> On Wed, Jul 19, 2017 at 05:25:04PM +0200, Philipp Zabel wrote:
> > The reset control API has two modes: exclusive access, where the driver
> > expects to have full and immediate control over the state of the reset
> > line, and shared (clock-like) access, where drivers only request reset
> > deassertion while active, but don't care about the state of the reset line
> > while inactive.
> > 
> > Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> > reset lines") started to transition the reset control request API calls
> > to explicitly state whether the driver needs exclusive or shared reset
> > control behavior.
> > 
> > This series converts all drivers that currently implicitly request
> > exclusive reset controls to the corresponding explicit API call. It is,
> > for the most part, generated from the following semantic patch:
> 
> Hey, I'm all for large api changes, but this really seems ackward, isn't
> there a "better" way to do this?

It is a bit awkward. I am sorry I haven't done this earlier. Quite a few
new drivers started using the old API after the explicit requests were
introduced last year.

> Why not, as you say the "implicit" request is exclusive, just leave
> everything alone and state that the "reset_control_get()" call is
> exclusive 

I think it is better to let the drivers explicitly state what they
expect from the API, and using reset_control_get_exclusive vs _shared
helps driver developers to make a conscious decision.

Further, the implicit API call predates shared reset support, so it is
not clear that all of the old users really need exclusive control.
A few drivers have been switched to the shared API already.

> and make the shared one the "odd" usage as that seems to not
> be the normal case.

I am not sure, there have been people arguing that the "clock-like" case
really is the common one. I suppose some of those drivers touched by the
100 patches in this series could also be changed to shared. But I don't
dare to make this decision for each of them.

> That should be a much smaller patch right?
> 
> That way you don't break everything here, and require 100+ patches to
> just change the name of a function from one to another and do nothing
> else.

I don't break anything here, and I'm absolutely fine with squashing
patches together per subsystem where that is preferable.

regards
Philipp

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
  2017-07-19 19:15   ` [PATCH 000/102] Convert drivers to explicit reset API Thomas Petazzoni
@ 2017-07-20  9:36     ` Philipp Zabel
       [not found]       ` <1500543415.2354.37.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 34+ messages in thread
From: Philipp Zabel @ 2017-07-20  9:36 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: linux-kernel, Andrew Lunn, Prashant Gaikwad, Heiko Stuebner,
	Peter Chen, Linus Walleij, dri-devel, Marc Dietrich, Rakesh Iyer,
	Peter Meerwald-Stadler, linux-clk, Wim Van Sebroeck, Wolfram Sang,
	Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck, Ohad Ben-Cohen, linux-pm,
	Thomas Gleixner <tglx>

Hi Thomas,

On Wed, 2017-07-19 at 21:15 +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Wed, 19 Jul 2017 17:25:04 +0200, Philipp Zabel wrote:
> > The reset control API has two modes: exclusive access, where the driver
> > expects to have full and immediate control over the state of the reset
> > line, and shared (clock-like) access, where drivers only request reset
> > deassertion while active, but don't care about the state of the reset line
> > while inactive.
> > 
> > Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> > reset lines") started to transition the reset control request API calls
> > to explicitly state whether the driver needs exclusive or shared reset
> > control behavior.
> > 
> > This series converts all drivers that currently implicitly request
> > exclusive reset controls to the corresponding explicit API call. It is,
> > for the most part, generated from the following semantic patch:
> > 
> > @@
> > expression rstc, dev, id;
> > @@
> > -rstc = reset_control_get(dev, id);
> > +rstc = reset_control_get_exclusive(dev, id);
> 
> I don't know if it has been discussed in the past, so forgive me if it
> has been. Have you considered adding a "int flags" argument to the
> existing reset_control_get_*() functions, rather than introducing
> separate exclusive variants ?
> 
> Indeed, with a "int flags" argument you could in the future add more
> variants/behaviors without actually multiplying the number of
> functions. Something like the "flags" argument for request_irq() for
> example.

I can't find the discussion right now, but I remember we had talked
about this in the past.
Behind the scenes, all the inline API functions already call common
entry points with flags (well, currently separate bool parameters for
shared and optional).
One reason against exposing those as an int flags in the user facing API
is the possibility to accidentally provide a wrong value.

regards
Philipp

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
       [not found]       ` <1500543415.2354.37.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2017-07-20 10:36         ` Thomas Petazzoni
  2017-07-20 12:55           ` Philipp Zabel
  0 siblings, 1 reply; 34+ messages in thread
From: Thomas Petazzoni @ 2017-07-20 10:36 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andrew Lunn, Prashant Gaikwad, Heiko Stuebner, Peter Chen,
	Linus Walleij, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Marc Dietrich, Rakesh Iyer, Peter Meerwald-Stadler,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang, Xinliang Liu,
	Chanwoo Choi, Alan Stern, Jiri Slaby, Michael Turquette,
	Guenter Roeck, Ohad Ben-Cohen, linux-pm-u79uwXL29TY76Z2rM5mHXA,
	Thomas Gleixner, Vincent Abriou, Bin Liu, Greg Kroah-Hartman,
	linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA

Hello,

On Thu, 20 Jul 2017 11:36:55 +0200, Philipp Zabel wrote:

> > I don't know if it has been discussed in the past, so forgive me if it
> > has been. Have you considered adding a "int flags" argument to the
> > existing reset_control_get_*() functions, rather than introducing
> > separate exclusive variants ?
> > 
> > Indeed, with a "int flags" argument you could in the future add more
> > variants/behaviors without actually multiplying the number of
> > functions. Something like the "flags" argument for request_irq() for
> > example.  
> 
> I can't find the discussion right now, but I remember we had talked
> about this in the past.
> Behind the scenes, all the inline API functions already call common
> entry points with flags (well, currently separate bool parameters for
> shared and optional).
> One reason against exposing those as an int flags in the user facing API
> is the possibility to accidentally provide a wrong value.

This is a quite strange argument. You could also accidentally use the
wrong variant of the function, just like you could use the wrong flag.

Once again, the next time you have another parameter for those reset
functions, beyond the exclusive/shared variant, you will multiply again
by two the number of functions ? You already have the  exclusive/shared
and optional/mandatory variants, so 4 variants. When you'll add a new
parameter, you'll have 8 variants. Doesn't seem really good.

What about reset_control_get(struct device *, const char *, int flags)
to replace all those variants ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
  2017-07-20 10:36         ` Thomas Petazzoni
@ 2017-07-20 12:55           ` Philipp Zabel
  2017-07-20 20:46             ` Dmitry Torokhov
  0 siblings, 1 reply; 34+ messages in thread
From: Philipp Zabel @ 2017-07-20 12:55 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: linux-kernel, Andrew Lunn, Prashant Gaikwad, Heiko Stuebner,
	Peter Chen, Linus Walleij, dri-devel, Marc Dietrich, Rakesh Iyer,
	Peter Meerwald-Stadler, linux-clk, Wim Van Sebroeck, Wolfram Sang,
	Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck, Ohad Ben-Cohen, linux-pm,
	Thomas Gleixner <tglx>

Hi Thomas,

On Thu, 2017-07-20 at 12:36 +0200, Thomas Petazzoni wrote:
> Hello,
> 
> On Thu, 20 Jul 2017 11:36:55 +0200, Philipp Zabel wrote:
> 
> > > I don't know if it has been discussed in the past, so forgive me if it
> > > has been. Have you considered adding a "int flags" argument to the
> > > existing reset_control_get_*() functions, rather than introducing
> > > separate exclusive variants ?
> > > 
> > > Indeed, with a "int flags" argument you could in the future add more
> > > variants/behaviors without actually multiplying the number of
> > > functions. Something like the "flags" argument for request_irq() for
> > > example.  
> > 
> > I can't find the discussion right now, but I remember we had talked
> > about this in the past.
> > Behind the scenes, all the inline API functions already call common
> > entry points with flags (well, currently separate bool parameters for
> > shared and optional).
> > One reason against exposing those as an int flags in the user facing API
> > is the possibility to accidentally provide a wrong value.
> 
> This is a quite strange argument. You could also accidentally use the
> wrong variant of the function, just like you could use the wrong flag.

You can't accidentally use no flag at all or a completely bogus value
with the "plethora of inline functions" variant.

> Once again, the next time you have another parameter for those reset
> functions, beyond the exclusive/shared variant, you will multiply again
> by two the number of functions ? You already have the  exclusive/shared
> and optional/mandatory variants, so 4 variants. When you'll add a new
> parameter, you'll have 8 variants. Doesn't seem really good.

I'd rather avoid adding more variants, if possible. The complexity
increases regardless of whether the API is expressed as a bunch of
functions or as a single function with a bunch of flags.

> What about reset_control_get(struct device *, const char *, int flags)
> to replace all those variants ?

While I like how this looks, unfortunately (devm_)reset_control_get
already exists without the flags, so we can't change to that with a
gentle transition.

regards
Philipp

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 001/102] ARM: rockchip: explicitly request exclusive reset control
  2017-07-19 15:25 ` [PATCH 001/102] ARM: rockchip: explicitly request exclusive reset control Philipp Zabel
@ 2017-07-20 20:28   ` Heiko Stuebner
  0 siblings, 0 replies; 34+ messages in thread
From: Heiko Stuebner @ 2017-07-20 20:28 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: linux-kernel, linux-rockchip

Am Mittwoch, 19. Juli 2017, 17:25:05 CEST schrieb Philipp Zabel:
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
> 
> No functional changes.
> 
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

amended the subject with an "[...] in smp code" and applied for 4.14


Heiko

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
                     ` (6 preceding siblings ...)
  2017-07-20  8:11   ` Greg Kroah-Hartman
@ 2017-07-20 20:32   ` Heiko Stuebner
  2017-07-20 20:32   ` Heiko Stuebner
  2017-07-20 20:32   ` Heiko Stuebner
  9 siblings, 0 replies; 34+ messages in thread
From: Heiko Stuebner @ 2017-07-20 20:32 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andrew Lunn, Prashant Gaikwad, Peter Chen, Linus Walleij,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Marc Dietrich,
	Rakesh Iyer, Peter Meerwald-Stadler,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck, Wolfram Sang,
	Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck, Ohad Ben-Cohen,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Thomas Gleixner, Vincent Abriou,
	Bin Liu, Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA

Hi,

>   crypto: rockchip: explicitly request exclusive reset control
>   iio: adc: rockchip_saradc: explicitly request exclusive reset control
>   PCI: rockchip: explicitly request exclusive reset control
>   phy: rockchip-pcie: explicitly request exclusive reset control
>   phy: rockchip-typec: explicitly request exclusive reset control
>   phy: rockchip-usb: explicitly request exclusive reset control
>   thermal: rockchip: explicitly request exclusive reset control

for the driver-related Rockchip changes

Acked-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
  2017-07-19 15:25 [PATCH 000/102] Convert drivers to explicit reset API Philipp Zabel
                   ` (5 preceding siblings ...)
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2017-07-20 20:32 ` Heiko Stuebner
  6 siblings, 0 replies; 34+ messages in thread
From: Heiko Stuebner @ 2017-07-20 20:32 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andrew Lunn, Prashant Gaikwad, Peter Chen, Linus Walleij,
	dri-devel, Marc Dietrich, Rakesh Iyer, Peter Meerwald-Stadler,
	linux-clk, Wim Van Sebroeck, Wolfram Sang, Xinliang Liu,
	Chanwoo Choi, Alan Stern, Jiri Slaby, Michael Turquette,
	Guenter Roeck, Ohad Ben-Cohen, linux-pm, Thomas Gleixner,
	Vincent Abriou, Bin Liu, Greg Kroah-Hartman, linux-usb,
	linux-wireless

Hi,

>   crypto: rockchip: explicitly request exclusive reset control
>   iio: adc: rockchip_saradc: explicitly request exclusive reset control
>   PCI: rockchip: explicitly request exclusive reset control
>   phy: rockchip-pcie: explicitly request exclusive reset control
>   phy: rockchip-typec: explicitly request exclusive reset control
>   phy: rockchip-usb: explicitly request exclusive reset control
>   thermal: rockchip: explicitly request exclusive reset control

for the driver-related Rockchip changes

Acked-by: Heiko Stuebner <heiko@sntech.de>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
                     ` (8 preceding siblings ...)
  2017-07-20 20:32   ` Heiko Stuebner
@ 2017-07-20 20:32   ` Heiko Stuebner
  9 siblings, 0 replies; 34+ messages in thread
From: Heiko Stuebner @ 2017-07-20 20:32 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andrew Lunn, Prashant Gaikwad, Peter Chen, Linus Walleij,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Marc Dietrich,
	Rakesh Iyer, Peter Meerwald-Stadler,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck, Wolfram Sang,
	Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck, Ohad Ben-Cohen,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Thomas Gleixner, Vincent Abriou,
	Bin Liu, Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA

Hi,

>   crypto: rockchip: explicitly request exclusive reset control
>   iio: adc: rockchip_saradc: explicitly request exclusive reset control
>   PCI: rockchip: explicitly request exclusive reset control
>   phy: rockchip-pcie: explicitly request exclusive reset control
>   phy: rockchip-typec: explicitly request exclusive reset control
>   phy: rockchip-usb: explicitly request exclusive reset control
>   thermal: rockchip: explicitly request exclusive reset control

for the driver-related Rockchip changes

Acked-by: Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
       [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
                     ` (7 preceding siblings ...)
  2017-07-20 20:32   ` Heiko Stuebner
@ 2017-07-20 20:32   ` Heiko Stuebner
  2017-07-20 20:32   ` Heiko Stuebner
  9 siblings, 0 replies; 34+ messages in thread
From: Heiko Stuebner @ 2017-07-20 20:32 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andrew Lunn, Prashant Gaikwad, Peter Chen, Linus Walleij,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Marc Dietrich,
	Rakesh Iyer, Peter Meerwald-Stadler,
	linux-clk-u79uwXL29TY76Z2rM5mHXA, Wim Van Sebroeck, Wolfram Sang,
	Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck, Ohad Ben-Cohen,
	linux-pm-u79uwXL29TY76Z2rM5mHXA, Thomas Gleixner, Vincent Abriou,
	Bin Liu, Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA

Hi,

>   crypto: rockchip: explicitly request exclusive reset control
>   iio: adc: rockchip_saradc: explicitly request exclusive reset control
>   PCI: rockchip: explicitly request exclusive reset control
>   phy: rockchip-pcie: explicitly request exclusive reset control
>   phy: rockchip-typec: explicitly request exclusive reset control
>   phy: rockchip-usb: explicitly request exclusive reset control
>   thermal: rockchip: explicitly request exclusive reset control

for the driver-related Rockchip changes

Acked-by: Heiko Stuebner <heiko@sntech.de>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
  2017-07-20 12:55           ` Philipp Zabel
@ 2017-07-20 20:46             ` Dmitry Torokhov
  2017-07-23 18:41               ` Linus Walleij
  0 siblings, 1 reply; 34+ messages in thread
From: Dmitry Torokhov @ 2017-07-20 20:46 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Thomas Petazzoni, lkml, Andrew Lunn, Prashant Gaikwad,
	Heiko Stuebner, Peter Chen, Linus Walleij, DRI, Marc Dietrich,
	Rakesh Iyer, Peter Meerwald-Stadler, linux-clk, Wim Van Sebroeck,
	Wolfram Sang, Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck

On Thu, Jul 20, 2017 at 5:55 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> Hi Thomas,
>
> On Thu, 2017-07-20 at 12:36 +0200, Thomas Petazzoni wrote:
>> Hello,
>>
>> On Thu, 20 Jul 2017 11:36:55 +0200, Philipp Zabel wrote:
>>
>> > > I don't know if it has been discussed in the past, so forgive me if it
>> > > has been. Have you considered adding a "int flags" argument to the
>> > > existing reset_control_get_*() functions, rather than introducing
>> > > separate exclusive variants ?
>> > >
>> > > Indeed, with a "int flags" argument you could in the future add more
>> > > variants/behaviors without actually multiplying the number of
>> > > functions. Something like the "flags" argument for request_irq() for
>> > > example.
>> >
>> > I can't find the discussion right now, but I remember we had talked
>> > about this in the past.
>> > Behind the scenes, all the inline API functions already call common
>> > entry points with flags (well, currently separate bool parameters for
>> > shared and optional).
>> > One reason against exposing those as an int flags in the user facing API
>> > is the possibility to accidentally provide a wrong value.
>>
>> This is a quite strange argument. You could also accidentally use the
>> wrong variant of the function, just like you could use the wrong flag.
>
> You can't accidentally use no flag at all or a completely bogus value
> with the "plethora of inline functions" variant.
>
>> Once again, the next time you have another parameter for those reset
>> functions, beyond the exclusive/shared variant, you will multiply again
>> by two the number of functions ? You already have the  exclusive/shared
>> and optional/mandatory variants, so 4 variants. When you'll add a new
>> parameter, you'll have 8 variants. Doesn't seem really good.
>
> I'd rather avoid adding more variants, if possible. The complexity
> increases regardless of whether the API is expressed as a bunch of
> functions or as a single function with a bunch of flags.
>
>> What about reset_control_get(struct device *, const char *, int flags)
>> to replace all those variants ?
>
> While I like how this looks, unfortunately (devm_)reset_control_get
> already exists without the flags, so we can't change to that with a
> gentle transition.

This was done for gpiod_get() and its flags argument with horrifying
#define-ry, which thankfully was completely hidden from users.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 058/102] phy: rockchip-pcie: explicitly request exclusive reset control
  2017-07-19 15:26   ` [PATCH 058/102] phy: rockchip-pcie: " Philipp Zabel
@ 2017-07-22 13:09     ` Shawn Lin
  2017-08-03  0:37     ` Shawn Lin
  1 sibling, 0 replies; 34+ messages in thread
From: Shawn Lin @ 2017-07-22 13:09 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: linux-kernel, shawn.lin, linux-rockchip, Heiko Stuebner,
	Kishon Vijay Abraham I

Hi Philipp

On 2017/7/19 23:26, Philipp Zabel wrote:
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
>
> No functional changes.
>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/phy/rockchip/phy-rockchip-pcie.c | 2 +-

This driver is under reconstruction and would probably go via
pci tree later. So I would mention your change to the reconstruction
work if that's applied.

>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchip/phy-rockchip-pcie.c
> index 6904633cad687..258220b7f481c 100644
> --- a/drivers/phy/rockchip/phy-rockchip-pcie.c
> +++ b/drivers/phy/rockchip/phy-rockchip-pcie.c
> @@ -305,7 +305,7 @@ static int rockchip_pcie_phy_probe(struct platform_device *pdev)
>  	rk_phy->phy_data = (struct rockchip_pcie_data *)of_id->data;
>  	rk_phy->reg_base = grf;
>
> -	rk_phy->phy_rst = devm_reset_control_get(dev, "phy");
> +	rk_phy->phy_rst = devm_reset_control_get_exclusive(dev, "phy");
>  	if (IS_ERR(rk_phy->phy_rst)) {
>  		if (PTR_ERR(rk_phy->phy_rst) != -EPROBE_DEFER)
>  			dev_err(dev,
>


-- 
Best Regards
Shawn Lin

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 054/102] PCI: rockchip: explicitly request exclusive reset control
  2017-07-19 15:25   ` [PATCH 054/102] PCI: " Philipp Zabel
@ 2017-07-22 13:12     ` Shawn Lin
  2017-07-24  8:35       ` Philipp Zabel
  2017-08-03  0:31     ` Shawn Lin
  2017-08-03 21:43     ` Bjorn Helgaas
  2 siblings, 1 reply; 34+ messages in thread
From: Shawn Lin @ 2017-07-22 13:12 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: linux-kernel, shawn.lin, Bjorn Helgaas, Heiko Stuebner, linux-pci,
	linux-rockchip

Hi Philipp,

On 2017/7/19 23:25, Philipp Zabel wrote:
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
>
> No functional changes.
>
> Cc: Shawn Lin <shawn.lin@rock-chips.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------

As mentioned in the thread of conversion for phy-rockchip-pcie,
I would prefer add your patches after the reconstruction work got
merged.


>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 7bb9870f6d8ce..e50d6f5a81f4b 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -903,49 +903,50 @@ static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
>  	if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
>  		rockchip->link_gen = 2;
>
> -	rockchip->core_rst = devm_reset_control_get(dev, "core");
> +	rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core");
>  	if (IS_ERR(rockchip->core_rst)) {
>  		if (PTR_ERR(rockchip->core_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing core reset property in node\n");
>  		return PTR_ERR(rockchip->core_rst);
>  	}
>
> -	rockchip->mgmt_rst = devm_reset_control_get(dev, "mgmt");
> +	rockchip->mgmt_rst = devm_reset_control_get_exclusive(dev, "mgmt");
>  	if (IS_ERR(rockchip->mgmt_rst)) {
>  		if (PTR_ERR(rockchip->mgmt_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing mgmt reset property in node\n");
>  		return PTR_ERR(rockchip->mgmt_rst);
>  	}
>
> -	rockchip->mgmt_sticky_rst = devm_reset_control_get(dev, "mgmt-sticky");
> +	rockchip->mgmt_sticky_rst = devm_reset_control_get_exclusive(dev,
> +								     "mgmt-sticky");
>  	if (IS_ERR(rockchip->mgmt_sticky_rst)) {
>  		if (PTR_ERR(rockchip->mgmt_sticky_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing mgmt-sticky reset property in node\n");
>  		return PTR_ERR(rockchip->mgmt_sticky_rst);
>  	}
>
> -	rockchip->pipe_rst = devm_reset_control_get(dev, "pipe");
> +	rockchip->pipe_rst = devm_reset_control_get_exclusive(dev, "pipe");
>  	if (IS_ERR(rockchip->pipe_rst)) {
>  		if (PTR_ERR(rockchip->pipe_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pipe reset property in node\n");
>  		return PTR_ERR(rockchip->pipe_rst);
>  	}
>
> -	rockchip->pm_rst = devm_reset_control_get(dev, "pm");
> +	rockchip->pm_rst = devm_reset_control_get_exclusive(dev, "pm");
>  	if (IS_ERR(rockchip->pm_rst)) {
>  		if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pm reset property in node\n");
>  		return PTR_ERR(rockchip->pm_rst);
>  	}
>
> -	rockchip->pclk_rst = devm_reset_control_get(dev, "pclk");
> +	rockchip->pclk_rst = devm_reset_control_get_exclusive(dev, "pclk");
>  	if (IS_ERR(rockchip->pclk_rst)) {
>  		if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pclk reset property in node\n");
>  		return PTR_ERR(rockchip->pclk_rst);
>  	}
>
> -	rockchip->aclk_rst = devm_reset_control_get(dev, "aclk");
> +	rockchip->aclk_rst = devm_reset_control_get_exclusive(dev, "aclk");
>  	if (IS_ERR(rockchip->aclk_rst)) {
>  		if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing aclk reset property in node\n");
>


-- 
Best Regards
Shawn Lin

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
  2017-07-20 20:46             ` Dmitry Torokhov
@ 2017-07-23 18:41               ` Linus Walleij
  2017-07-24  8:33                 ` Philipp Zabel
  0 siblings, 1 reply; 34+ messages in thread
From: Linus Walleij @ 2017-07-23 18:41 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Philipp Zabel, Thomas Petazzoni, lkml, Andrew Lunn,
	Prashant Gaikwad, Heiko Stuebner, Peter Chen, DRI, Marc Dietrich,
	Rakesh Iyer, Peter Meerwald-Stadler, linux-clk, Wim Van Sebroeck,
	Wolfram Sang, Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette, Guenter Roeck

On Thu, Jul 20, 2017 at 10:46 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Thu, Jul 20, 2017 at 5:55 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote:

>>> What about reset_control_get(struct device *, const char *, int flags)
>>> to replace all those variants ?
>>
>> While I like how this looks, unfortunately (devm_)reset_control_get
>> already exists without the flags, so we can't change to that with a
>> gentle transition.
>
> This was done for gpiod_get() and its flags argument with horrifying
> #define-ry, which thankfully was completely hidden from users.

For your reference:

commit bae48da237fcedd7ad09569025483b988635efb7
"gpiolib: add gpiod_get() and gpiod_put() functions"

commit 39b2bbe3d715cf5013b5c48695ccdd25bd3bf120
"gpio: add flags argument to gpiod_get*() functions"

commit 0dbc8b7afef6e4fddcfebcbacbeb269a0a3b06d5
"gpio: move varargs hack outside #ifdef GPIOLIB"

commit b17d1bf16cc72a374a48d748940f700009d40ff4
"gpio: make flags mandatory for gpiod_get functions"

Retrospectively ... was that really a good idea... it was a LOT
of trouble to add a flag, maybe it had been better to try and
just slam all users in a single go.

But it worked.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
  2017-07-23 18:41               ` Linus Walleij
@ 2017-07-24  8:33                 ` Philipp Zabel
       [not found]                   ` <1500885221.2391.50.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 34+ messages in thread
From: Philipp Zabel @ 2017-07-24  8:33 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Dmitry Torokhov, Thomas Petazzoni, lkml, Andrew Lunn,
	Prashant Gaikwad, Heiko Stuebner, Peter Chen, DRI, Marc Dietrich,
	Rakesh Iyer, Peter Meerwald-Stadler, linux-clk, Wim Van Sebroeck,
	Wolfram Sang, Xinliang Liu, Chanwoo Choi, Alan Stern, Jiri Slaby,
	Michael Turquette

On Sun, 2017-07-23 at 20:41 +0200, Linus Walleij wrote:
> On Thu, Jul 20, 2017 at 10:46 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Thu, Jul 20, 2017 at 5:55 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> 
> >>> What about reset_control_get(struct device *, const char *, int flags)
> >>> to replace all those variants ?
> >>
> >> While I like how this looks, unfortunately (devm_)reset_control_get
> >> already exists without the flags, so we can't change to that with a
> >> gentle transition.
> >
> > This was done for gpiod_get() and its flags argument with horrifying
> > #define-ry, which thankfully was completely hidden from users.
> 
> For your reference:
> 
> commit bae48da237fcedd7ad09569025483b988635efb7
> "gpiolib: add gpiod_get() and gpiod_put() functions"
> 
> commit 39b2bbe3d715cf5013b5c48695ccdd25bd3bf120
> "gpio: add flags argument to gpiod_get*() functions"
> 
> commit 0dbc8b7afef6e4fddcfebcbacbeb269a0a3b06d5
> "gpio: move varargs hack outside #ifdef GPIOLIB"
> 
> commit b17d1bf16cc72a374a48d748940f700009d40ff4
> "gpio: make flags mandatory for gpiod_get functions"
> 
> Retrospectively ... was that really a good idea... it was a LOT
> of trouble to add a flag, maybe it had been better to try and
> just slam all users in a single go.
> 
> But it worked.

Thanks for the hint and the references. It seems this turned out okay,
but I wouldn't dare to introduce such macro horror^Wmagic.
I'd rather have all users converted to the _exclusive/_shared function
calls and maybe then replace the internal __reset_control_get with
Thomas' suggestion.

regards
Philipp

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 054/102] PCI: rockchip: explicitly request exclusive reset control
  2017-07-22 13:12     ` Shawn Lin
@ 2017-07-24  8:35       ` Philipp Zabel
  0 siblings, 0 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-07-24  8:35 UTC (permalink / raw)
  To: Shawn Lin
  Cc: linux-kernel, Bjorn Helgaas, Heiko Stuebner, linux-pci,
	linux-rockchip

Hi Shawn,

On Sat, 2017-07-22 at 21:12 +0800, Shawn Lin wrote:
> Hi Philipp,
> 
> On 2017/7/19 23:25, Philipp Zabel wrote:
> > Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> > reset lines") started to transition the reset control request API calls
> > to explicitly state whether the driver needs exclusive or shared reset
> > control behavior. Convert all drivers requesting exclusive resets to the
> > explicit API call so the temporary transition helpers can be removed.
> >
> > No functional changes.
> >
> > Cc: Shawn Lin <shawn.lin@rock-chips.com>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: Heiko Stuebner <heiko@sntech.de>
> > Cc: linux-pci@vger.kernel.org
> > Cc: linux-rockchip@lists.infradead.org
> > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > ---
> >  drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------
> 
> As mentioned in the thread of conversion for phy-rockchip-pcie,
> I would prefer add your patches after the reconstruction work got
> merged.

Feel free to add them when and where it is most convenient for you.
Please let me know if you want me to rebase them somewhere.

regards
Philipp

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 054/102] PCI: rockchip: explicitly request exclusive reset control
  2017-07-19 15:25   ` [PATCH 054/102] PCI: " Philipp Zabel
  2017-07-22 13:12     ` Shawn Lin
@ 2017-08-03  0:31     ` Shawn Lin
  2017-08-03 21:43     ` Bjorn Helgaas
  2 siblings, 0 replies; 34+ messages in thread
From: Shawn Lin @ 2017-08-03  0:31 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: linux-kernel, shawn.lin, Bjorn Helgaas, Heiko Stuebner, linux-pci,
	linux-rockchip

Hi,

On 2017/7/19 23:25, Philipp Zabel wrote:
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
> 
> No functional changes.
> 
> Cc: Shawn Lin <shawn.lin@rock-chips.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Acked-by: Shawn Lin <shawn.lin@rock-chips.com>

> ---
>   drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------
>   1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 7bb9870f6d8ce..e50d6f5a81f4b 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -903,49 +903,50 @@ static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
>   	if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
>   		rockchip->link_gen = 2;
>   
> -	rockchip->core_rst = devm_reset_control_get(dev, "core");
> +	rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core");
>   	if (IS_ERR(rockchip->core_rst)) {
>   		if (PTR_ERR(rockchip->core_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing core reset property in node\n");
>   		return PTR_ERR(rockchip->core_rst);
>   	}
>   
> -	rockchip->mgmt_rst = devm_reset_control_get(dev, "mgmt");
> +	rockchip->mgmt_rst = devm_reset_control_get_exclusive(dev, "mgmt");
>   	if (IS_ERR(rockchip->mgmt_rst)) {
>   		if (PTR_ERR(rockchip->mgmt_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing mgmt reset property in node\n");
>   		return PTR_ERR(rockchip->mgmt_rst);
>   	}
>   
> -	rockchip->mgmt_sticky_rst = devm_reset_control_get(dev, "mgmt-sticky");
> +	rockchip->mgmt_sticky_rst = devm_reset_control_get_exclusive(dev,
> +								     "mgmt-sticky");
>   	if (IS_ERR(rockchip->mgmt_sticky_rst)) {
>   		if (PTR_ERR(rockchip->mgmt_sticky_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing mgmt-sticky reset property in node\n");
>   		return PTR_ERR(rockchip->mgmt_sticky_rst);
>   	}
>   
> -	rockchip->pipe_rst = devm_reset_control_get(dev, "pipe");
> +	rockchip->pipe_rst = devm_reset_control_get_exclusive(dev, "pipe");
>   	if (IS_ERR(rockchip->pipe_rst)) {
>   		if (PTR_ERR(rockchip->pipe_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing pipe reset property in node\n");
>   		return PTR_ERR(rockchip->pipe_rst);
>   	}
>   
> -	rockchip->pm_rst = devm_reset_control_get(dev, "pm");
> +	rockchip->pm_rst = devm_reset_control_get_exclusive(dev, "pm");
>   	if (IS_ERR(rockchip->pm_rst)) {
>   		if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing pm reset property in node\n");
>   		return PTR_ERR(rockchip->pm_rst);
>   	}
>   
> -	rockchip->pclk_rst = devm_reset_control_get(dev, "pclk");
> +	rockchip->pclk_rst = devm_reset_control_get_exclusive(dev, "pclk");
>   	if (IS_ERR(rockchip->pclk_rst)) {
>   		if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing pclk reset property in node\n");
>   		return PTR_ERR(rockchip->pclk_rst);
>   	}
>   
> -	rockchip->aclk_rst = devm_reset_control_get(dev, "aclk");
> +	rockchip->aclk_rst = devm_reset_control_get_exclusive(dev, "aclk");
>   	if (IS_ERR(rockchip->aclk_rst)) {
>   		if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER)
>   			dev_err(dev, "missing aclk reset property in node\n");
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 058/102] phy: rockchip-pcie: explicitly request exclusive reset control
  2017-07-19 15:26   ` [PATCH 058/102] phy: rockchip-pcie: " Philipp Zabel
  2017-07-22 13:09     ` Shawn Lin
@ 2017-08-03  0:37     ` Shawn Lin
  1 sibling, 0 replies; 34+ messages in thread
From: Shawn Lin @ 2017-08-03  0:37 UTC (permalink / raw)
  To: Philipp Zabel, Bjorn Helgaas
  Cc: linux-kernel, shawn.lin, linux-rockchip, Heiko Stuebner,
	Kishon Vijay Abraham I

[+ Bjorn]

On 2017/7/19 23:26, Philipp Zabel wrote:
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
> 
> No functional changes.
> 
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

some changes for phy-rockchip-pcie.c would go via pci tree
for 4.14, so is it ok for Bjorn to pick this up if no objection
from Kishon, in case of merge conflict?

Anyway,

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> ---
>   drivers/phy/rockchip/phy-rockchip-pcie.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchip/phy-rockchip-pcie.c
> index 6904633cad687..258220b7f481c 100644
> --- a/drivers/phy/rockchip/phy-rockchip-pcie.c
> +++ b/drivers/phy/rockchip/phy-rockchip-pcie.c
> @@ -305,7 +305,7 @@ static int rockchip_pcie_phy_probe(struct platform_device *pdev)
>   	rk_phy->phy_data = (struct rockchip_pcie_data *)of_id->data;
>   	rk_phy->reg_base = grf;
>   
> -	rk_phy->phy_rst = devm_reset_control_get(dev, "phy");
> +	rk_phy->phy_rst = devm_reset_control_get_exclusive(dev, "phy");
>   	if (IS_ERR(rk_phy->phy_rst)) {
>   		if (PTR_ERR(rk_phy->phy_rst) != -EPROBE_DEFER)
>   			dev_err(dev,
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 054/102] PCI: rockchip: explicitly request exclusive reset control
  2017-07-19 15:25   ` [PATCH 054/102] PCI: " Philipp Zabel
  2017-07-22 13:12     ` Shawn Lin
  2017-08-03  0:31     ` Shawn Lin
@ 2017-08-03 21:43     ` Bjorn Helgaas
  2 siblings, 0 replies; 34+ messages in thread
From: Bjorn Helgaas @ 2017-08-03 21:43 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: linux-kernel, Shawn Lin, Bjorn Helgaas, Heiko Stuebner, linux-pci,
	linux-rockchip

On Wed, Jul 19, 2017 at 05:25:58PM +0200, Philipp Zabel wrote:
> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
> 
> No functional changes.
> 
> Cc: Shawn Lin <shawn.lin@rock-chips.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Applied with Shawn's ack to pci/host-rockchip for v4.14, thanks!

> ---
>  drivers/pci/host/pcie-rockchip.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 7bb9870f6d8ce..e50d6f5a81f4b 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -903,49 +903,50 @@ static int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip)
>  	if (rockchip->link_gen < 0 || rockchip->link_gen > 2)
>  		rockchip->link_gen = 2;
>  
> -	rockchip->core_rst = devm_reset_control_get(dev, "core");
> +	rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core");
>  	if (IS_ERR(rockchip->core_rst)) {
>  		if (PTR_ERR(rockchip->core_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing core reset property in node\n");
>  		return PTR_ERR(rockchip->core_rst);
>  	}
>  
> -	rockchip->mgmt_rst = devm_reset_control_get(dev, "mgmt");
> +	rockchip->mgmt_rst = devm_reset_control_get_exclusive(dev, "mgmt");
>  	if (IS_ERR(rockchip->mgmt_rst)) {
>  		if (PTR_ERR(rockchip->mgmt_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing mgmt reset property in node\n");
>  		return PTR_ERR(rockchip->mgmt_rst);
>  	}
>  
> -	rockchip->mgmt_sticky_rst = devm_reset_control_get(dev, "mgmt-sticky");
> +	rockchip->mgmt_sticky_rst = devm_reset_control_get_exclusive(dev,
> +								     "mgmt-sticky");
>  	if (IS_ERR(rockchip->mgmt_sticky_rst)) {
>  		if (PTR_ERR(rockchip->mgmt_sticky_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing mgmt-sticky reset property in node\n");
>  		return PTR_ERR(rockchip->mgmt_sticky_rst);
>  	}
>  
> -	rockchip->pipe_rst = devm_reset_control_get(dev, "pipe");
> +	rockchip->pipe_rst = devm_reset_control_get_exclusive(dev, "pipe");
>  	if (IS_ERR(rockchip->pipe_rst)) {
>  		if (PTR_ERR(rockchip->pipe_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pipe reset property in node\n");
>  		return PTR_ERR(rockchip->pipe_rst);
>  	}
>  
> -	rockchip->pm_rst = devm_reset_control_get(dev, "pm");
> +	rockchip->pm_rst = devm_reset_control_get_exclusive(dev, "pm");
>  	if (IS_ERR(rockchip->pm_rst)) {
>  		if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pm reset property in node\n");
>  		return PTR_ERR(rockchip->pm_rst);
>  	}
>  
> -	rockchip->pclk_rst = devm_reset_control_get(dev, "pclk");
> +	rockchip->pclk_rst = devm_reset_control_get_exclusive(dev, "pclk");
>  	if (IS_ERR(rockchip->pclk_rst)) {
>  		if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing pclk reset property in node\n");
>  		return PTR_ERR(rockchip->pclk_rst);
>  	}
>  
> -	rockchip->aclk_rst = devm_reset_control_get(dev, "aclk");
> +	rockchip->aclk_rst = devm_reset_control_get_exclusive(dev, "aclk");
>  	if (IS_ERR(rockchip->aclk_rst)) {
>  		if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER)
>  			dev_err(dev, "missing aclk reset property in node\n");
> -- 
> 2.11.0
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
       [not found]                   ` <1500885221.2391.50.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2017-08-12 11:43                     ` Wolfram Sang
  2017-08-14  7:36                       ` Philipp Zabel
  0 siblings, 1 reply; 34+ messages in thread
From: Wolfram Sang @ 2017-08-12 11:43 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: Andrew Lunn, Prashant Gaikwad, Heiko Stuebner, Peter Chen,
	Linus Walleij, DRI, Marc Dietrich, Rakesh Iyer,
	Peter Meerwald-Stadler, linux-clk, Xinliang Liu, Chanwoo Choi,
	Alan Stern, Jiri Slaby, Michael Turquette, Guenter Roeck,
	Ohad Ben-Cohen, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Thomas Gleixner, Vincent Abriou, Bin Liu, Greg Kroah-Hartman,
	USB list


[-- Attachment #1.1: Type: text/plain, Size: 378 bytes --]


> Thanks for the hint and the references. It seems this turned out okay,
> but I wouldn't dare to introduce such macro horror^Wmagic.
> I'd rather have all users converted to the _exclusive/_shared function
> calls and maybe then replace the internal __reset_control_get with
> Thomas' suggestion.

I didn't follow the discussion closely. Shall I still apply the i2c
patches?


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 200 bytes --]

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 000/102] Convert drivers to explicit reset API
  2017-08-12 11:43                     ` Wolfram Sang
@ 2017-08-14  7:36                       ` Philipp Zabel
  0 siblings, 0 replies; 34+ messages in thread
From: Philipp Zabel @ 2017-08-14  7:36 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Linus Walleij, Dmitry Torokhov, Thomas Petazzoni, lkml,
	Andrew Lunn, Prashant Gaikwad, Heiko Stuebner, Peter Chen, DRI,
	Marc Dietrich, Rakesh Iyer, Peter Meerwald-Stadler, linux-clk,
	Wim Van Sebroeck, Xinliang Liu, Chanwoo Choi, Alan Stern,
	Jiri Slaby, Michael Turquette, Guenter

On Sat, 2017-08-12 at 13:43 +0200, Wolfram Sang wrote:
> > Thanks for the hint and the references. It seems this turned out
> > okay,
> > but I wouldn't dare to introduce such macro horror^Wmagic.
> > I'd rather have all users converted to the _exclusive/_shared
> > function
> > calls and maybe then replace the internal __reset_control_get with
> > Thomas' suggestion.
> 
> I didn't follow the discussion closely. Shall I still apply the i2c
> patches?

Yes, please.

regards
Philipp

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH 031/102] iio: adc: rockchip_saradc: explicitly request exclusive reset control
  2017-07-19 15:25 ` [PATCH 031/102] iio: adc: rockchip_saradc: " Philipp Zabel
@ 2017-08-20 11:09   ` Jonathan Cameron
  0 siblings, 0 replies; 34+ messages in thread
From: Jonathan Cameron @ 2017-08-20 11:09 UTC (permalink / raw)
  To: Philipp Zabel
  Cc: linux-kernel, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Heiko Stuebner, linux-iio, linux-rockchip

On Wed, 19 Jul 2017 17:25:35 +0200
Philipp Zabel <p.zabel@pengutronix.de> wrote:

> Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
> reset lines") started to transition the reset control request API calls
> to explicitly state whether the driver needs exclusive or shared reset
> control behavior. Convert all drivers requesting exclusive resets to the
> explicit API call so the temporary transition helpers can be removed.
> 
> No functional changes.
> 
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Hartmut Knaack <knaack.h@gmx.de>
> Cc: Lars-Peter Clausen <lars@metafoo.de>
> Cc: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
> Cc: Heiko Stuebner <heiko@sntech.de>
> Cc: linux-iio@vger.kernel.org
> Cc: linux-rockchip@lists.infradead.org
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/adc/rockchip_saradc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
> index ae6d3324f5183..1d9300ba07c00 100644
> --- a/drivers/iio/adc/rockchip_saradc.c
> +++ b/drivers/iio/adc/rockchip_saradc.c
> @@ -235,7 +235,8 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
>  	 * The reset should be an optional property, as it should work
>  	 * with old devicetrees as well
>  	 */
> -	info->reset = devm_reset_control_get(&pdev->dev, "saradc-apb");
> +	info->reset = devm_reset_control_get_exclusive(&pdev->dev,
> +						       "saradc-apb");
>  	if (IS_ERR(info->reset)) {
>  		ret = PTR_ERR(info->reset);
>  		if (ret != -ENOENT)

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2017-08-20 11:09 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-19 15:25 [PATCH 000/102] Convert drivers to explicit reset API Philipp Zabel
2017-07-19 15:25 ` [PATCH 001/102] ARM: rockchip: explicitly request exclusive reset control Philipp Zabel
2017-07-20 20:28   ` Heiko Stuebner
2017-07-19 15:25 ` [PATCH 013/102] crypto: " Philipp Zabel
2017-07-19 15:25 ` [PATCH 021/102] drm/rockchip: " Philipp Zabel
2017-07-19 15:25 ` [PATCH 031/102] iio: adc: rockchip_saradc: " Philipp Zabel
2017-08-20 11:09   ` Jonathan Cameron
2017-07-19 15:26 ` [PATCH 082/102] thermal: rockchip: " Philipp Zabel
     [not found] ` <20170719152646.25903-1-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-07-19 15:25   ` [PATCH 054/102] PCI: " Philipp Zabel
2017-07-22 13:12     ` Shawn Lin
2017-07-24  8:35       ` Philipp Zabel
2017-08-03  0:31     ` Shawn Lin
2017-08-03 21:43     ` Bjorn Helgaas
2017-07-19 15:26   ` [PATCH 058/102] phy: rockchip-pcie: " Philipp Zabel
2017-07-22 13:09     ` Shawn Lin
2017-08-03  0:37     ` Shawn Lin
2017-07-19 15:26   ` [PATCH 059/102] phy: rockchip-typec: " Philipp Zabel
2017-07-19 15:26   ` [PATCH 060/102] phy: rockchip-usb: " Philipp Zabel
2017-07-19 19:15   ` [PATCH 000/102] Convert drivers to explicit reset API Thomas Petazzoni
2017-07-20  9:36     ` Philipp Zabel
     [not found]       ` <1500543415.2354.37.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-07-20 10:36         ` Thomas Petazzoni
2017-07-20 12:55           ` Philipp Zabel
2017-07-20 20:46             ` Dmitry Torokhov
2017-07-23 18:41               ` Linus Walleij
2017-07-24  8:33                 ` Philipp Zabel
     [not found]                   ` <1500885221.2391.50.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-08-12 11:43                     ` Wolfram Sang
2017-08-14  7:36                       ` Philipp Zabel
2017-07-20  6:56   ` Maxime Ripard
2017-07-20  8:11   ` Greg Kroah-Hartman
2017-07-20  9:24     ` Philipp Zabel
2017-07-20 20:32   ` Heiko Stuebner
2017-07-20 20:32   ` Heiko Stuebner
2017-07-20 20:32   ` Heiko Stuebner
2017-07-20 20:32 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox