All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/11] Fix broken usage of driver_override (and kfree of static memory)
@ 2022-03-12 13:28 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 60+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-12 13:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki
  Cc: Stuart Yoder, Laurentiu Tudor, Abel Vesa, Shawn Guo,
	Sascha Hauer, Fabio Estevam, K. Y. Srinivasan, Haiyang Zhang,
	Stephen Hemminger, Wei Liu, Dexuan Cui, Bjorn Helgaas,
	Bjorn Andersson, Mathieu Poirier, Vineeth Vijayan,
	Peter Oberparleiter, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	Andy Gross, Srinivas Kandagatla, Mark Brown, Michael S. Tsirkin,
	Jason Wang, linux-kernel, linux-clk, NXP Linux Team,
	linux-arm-kernel, linux-hyperv, linux-pci, linux-remoteproc,
	linux-s390, linux-arm-msm, alsa-devel, linux-spi, virtualization,
	Linus Torvalds, Rasmus Villemoes, Krzysztof Kozlowski

Hi,

This is a continuation of my old patchset from 2019. [1]
Back then, few drivers set driver_override wrong. I fixed Exynos
in a different way after discussions. QCOM NGD was not fixed
and a new user appeared - IMX SCU.

It seems "char *" in driver_override looks too consty, so we
tend to make a mistake of storing there string literals.

Changes since latest v3
=======================
1. Wrap comments, extend comment in driver_set_override() about newline.
2. Minor commit msg fixes.
3. Add tags.

Changes since latest v2
=======================
1. Make all driver_override fields as "const char *", just like SPI
   and VDPA. (Mark)
2. Move "count" check to the new helper and add "count" argument. (Michael)
3. Fix typos in docs, patch subject. Extend doc. (Michael, Bjorn)
4. Compare pointers to reduce number of string readings in the helper.
5. Fix clk-imx return value.

Changes since latest v1 (not the old 2019 solution):
====================================================
https://lore.kernel.org/all/708eabb1-7b35-d525-d4c3-451d4a3de84f@rasmusvillemoes.dk/
1. Add helper for setting driver_override.
2. Use the helper.

Dependencies, merging and stable
================================
1. All patches, including last three fixes, depend on the first patch
   introducing the helper.
2. Merging idea: everything via driver core (Greg KH?).
2. The last three commits - fixes - are probably not backportable
   directly, because of this dependency. I don't know how to express
   this dependency here, since stable-kernel-rules.rst mentions only commits as
   possible dependencies.

[1] https://lore.kernel.org/all/1550484960-2392-3-git-send-email-krzk@kernel.org/

Best regards,
Krzysztof

Krzysztof Kozlowski (11):
  driver: platform: Add helper for safer setting of driver_override
  amba: Use driver_set_override() instead of open-coding
  fsl-mc: Use driver_set_override() instead of open-coding
  hv: Use driver_set_override() instead of open-coding
  PCI: Use driver_set_override() instead of open-coding
  s390/cio: Use driver_set_override() instead of open-coding
  spi: Use helper for safer setting of driver_override
  vdpa: Use helper for safer setting of driver_override
  clk: imx: scu: Fix kfree() of static memory on setting driver_override
  slimbus: qcom-ngd: Fix kfree() of static memory on setting
    driver_override
  rpmsg: Fix kfree() of static memory on setting driver_override

 drivers/amba/bus.c              | 28 +++--------------
 drivers/base/driver.c           | 56 +++++++++++++++++++++++++++++++++
 drivers/base/platform.c         | 28 +++--------------
 drivers/bus/fsl-mc/fsl-mc-bus.c | 25 +++------------
 drivers/clk/imx/clk-scu.c       |  7 ++++-
 drivers/hv/vmbus_drv.c          | 28 +++--------------
 drivers/pci/pci-sysfs.c         | 28 +++--------------
 drivers/rpmsg/rpmsg_core.c      |  3 +-
 drivers/rpmsg/rpmsg_internal.h  | 13 ++++++--
 drivers/rpmsg/rpmsg_ns.c        | 14 +++++++--
 drivers/s390/cio/cio.h          |  6 +++-
 drivers/s390/cio/css.c          | 28 +++--------------
 drivers/slimbus/qcom-ngd-ctrl.c | 13 +++++++-
 drivers/spi/spi.c               | 26 +++------------
 drivers/vdpa/vdpa.c             | 29 +++--------------
 include/linux/amba/bus.h        |  6 +++-
 include/linux/device/driver.h   |  2 ++
 include/linux/fsl/mc.h          |  6 ++--
 include/linux/hyperv.h          |  6 +++-
 include/linux/pci.h             |  6 +++-
 include/linux/platform_device.h |  6 +++-
 include/linux/rpmsg.h           |  6 ++--
 include/linux/spi/spi.h         |  2 ++
 include/linux/vdpa.h            |  4 ++-
 24 files changed, 171 insertions(+), 205 deletions(-)

-- 
2.32.0


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

end of thread, other threads:[~2022-03-17  7:01 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-12 13:28 [PATCH v4 00/11] Fix broken usage of driver_override (and kfree of static memory) Krzysztof Kozlowski
2022-03-12 13:28 ` Krzysztof Kozlowski
2022-03-12 13:28 ` Krzysztof Kozlowski
2022-03-12 13:28 ` [PATCH v4 01/11] driver: platform: Add helper for safer setting of driver_override Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-15 17:59   ` Andy Shevchenko
2022-03-15 17:59     ` Andy Shevchenko
2022-03-15 17:59     ` Andy Shevchenko
2022-03-15 17:59     ` Andy Shevchenko
2022-03-16 12:13     ` Krzysztof Kozlowski
2022-03-16 12:13       ` Krzysztof Kozlowski
2022-03-16 12:13       ` Krzysztof Kozlowski
2022-03-12 13:28 ` [PATCH v4 02/11] amba: Use driver_set_override() instead of open-coding Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28 ` [PATCH v4 03/11] fsl-mc: " Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28 ` [PATCH v4 04/11] hv: " Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28 ` [PATCH v4 05/11] PCI: " Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-15 18:01   ` Andy Shevchenko
2022-03-15 18:01     ` Andy Shevchenko
2022-03-15 18:01     ` Andy Shevchenko
2022-03-15 18:01     ` Andy Shevchenko
2022-03-12 13:28 ` [PATCH v4 06/11] s390/cio: " Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28 ` [PATCH v4 07/11] spi: Use helper for safer setting of driver_override Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28 ` [PATCH v4 08/11] vdpa: " Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-13  0:18   ` Michael S. Tsirkin
2022-03-13  0:18     ` Michael S. Tsirkin
2022-03-13  0:18     ` Michael S. Tsirkin
2022-03-13  0:18     ` Michael S. Tsirkin
2022-03-16  8:56   ` Michael S. Tsirkin
2022-03-16  8:56     ` Michael S. Tsirkin
2022-03-16  8:56     ` Michael S. Tsirkin
2022-03-16  8:56     ` Michael S. Tsirkin
2022-03-12 13:28 ` [PATCH v4 09/11] clk: imx: scu: Fix kfree() of static memory on setting driver_override Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-15 20:13   ` Stephen Boyd
2022-03-12 13:28 ` [PATCH v4 10/11] slimbus: qcom-ngd: " Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28 ` [PATCH v4 11/11] rpmsg: " Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-12 13:28   ` Krzysztof Kozlowski
2022-03-13 16:35   ` Bjorn Andersson
2022-03-13 16:35     ` Bjorn Andersson
2022-03-13 16:35     ` Bjorn Andersson
2022-03-13 16:35     ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.