linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] make clk_get_rate implementations behavior more consistent
@ 2017-07-18 10:17 Jonas Gorski
  2017-07-18 10:17 ` [PATCH 1/9] ARM: ep93xx: allow NULL clock for clk_get_rate Jonas Gorski
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Jonas Gorski @ 2017-07-18 10:17 UTC (permalink / raw)
  Cc: adi-buildroot-devel, bcm-kernel-feedback-list, linux-arm-kernel,
	linux-kernel, linux-m68k, linux-mips

The common clock and several other clock API implementations allow
calling clk_get_rate with a NULL pointer. While not specified as
expected behavior of the API, device drivers have come to rely on that,
causing them to OOPS when run on a platform with a different clock API
implementation.

Fix this by making sure all clk_get_rate implementations handle
NULL clocks instead of OOPSing.

While some custom implementations even allow ERR_PTR()s, I decided
against that as IIRC the usual idea is that errors should be handled and
not silently carried over.

Cc: adi-buildroot-devel@lists.sourceforge.net
Cc: bcm-kernel-feedback-list@broadcom.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-m68k@lists.linux-m68k.org
Cc: linux-mips@linux-mips.org

Jonas Gorski (9):
  ARM: ep93xx: allow NULL clock for clk_get_rate
  ARM: mmp: allow NULL clock for clk_get_rate
  blackfin: bf609: allow NULL clock for clk_get_rate
  m68k: allow NULL clock for clk_get_rate
  MIPS: AR7: allow NULL clock for clk_get_rate
  MIPS: BCM63XX: allow NULL clock for clk_get_rate
  MIPS: Loongson 2F: allow NULL clock for clk_get_rate
  MIPS: ralink: allow NULL clock for clk_get_rate
  unicore32: allow NULL clock for clk_get_rate

 arch/arm/mach-ep93xx/clock.c           | 3 +++
 arch/arm/mach-mmp/clock.c              | 4 +++-
 arch/blackfin/mach-bf609/clock.c       | 2 +-
 arch/m68k/coldfire/clk.c               | 3 +++
 arch/mips/ar7/clock.c                  | 3 +++
 arch/mips/bcm63xx/clk.c                | 3 +++
 arch/mips/loongson64/lemote-2f/clock.c | 3 +++
 arch/mips/ralink/clk.c                 | 3 +++
 arch/unicore32/kernel/clock.c          | 3 +++
 9 files changed, 25 insertions(+), 2 deletions(-)

-- 
2.11.0

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

end of thread, other threads:[~2017-07-19 12:21 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18 10:17 [PATCH 0/9] make clk_get_rate implementations behavior more consistent Jonas Gorski
2017-07-18 10:17 ` [PATCH 1/9] ARM: ep93xx: allow NULL clock for clk_get_rate Jonas Gorski
2017-07-19  5:04   ` Alexander Sverdlin
2017-07-18 10:17 ` [PATCH 2/9] ARM: mmp: " Jonas Gorski
2017-07-18 10:17 ` [PATCH 3/9] blackfin: bf609: " Jonas Gorski
2017-07-18 18:54   ` Masahiro Yamada
2017-07-18 10:17 ` [PATCH 4/9] m68k: " Jonas Gorski
2017-07-18 12:03   ` Greg Ungerer
2017-07-19  9:06     ` Jonas Gorski
2017-07-19 12:21       ` Greg Ungerer
2017-07-18 10:17 ` [PATCH 5/9] MIPS: AR7: " Jonas Gorski
2017-07-18 10:17 ` [PATCH 6/9] MIPS: BCM63XX: " Jonas Gorski
2017-07-18 19:55   ` Florian Fainelli
2017-07-18 10:17 ` [PATCH 7/9] MIPS: Loongson 2F: " Jonas Gorski
2017-07-18 10:17 ` [PATCH 8/9] MIPS: ralink: " Jonas Gorski
2017-07-18 10:17 ` [PATCH 9/9] unicore32: " Jonas Gorski
2017-07-18 12:01 ` [PATCH 0/9] make clk_get_rate implementations behavior more consistent Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).