From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 17/30] pwm: samsung: repair the worst MMIO abuses
Date: Fri, 12 Apr 2013 00:46:00 -0700 (PDT) [thread overview]
Message-ID: <1469653.nxt3obZ5EV@flatron> (raw)
In-Reply-To: <20130412070635.GA16956@avionic-0098.mockup.avionic-design.de>
On Friday 12 of April 2013 09:06:35 Thierry Reding wrote:
> On Thu, Apr 11, 2013 at 02:04:59AM +0200, Arnd Bergmann wrote:
> > The Samsung PWM driver uses "magic" pointers that are mapped
> > at boot time to point its MMIO registers. This fails horribly
> > with a multiplatform kernel, which can not rely on platform
> > specific header files to contain the right values, aside from
> > this being a really bad idea in general.
> >
> > This changes the driver to at least pass an __iomem token
> > around in the device structure to dereference that. Fixing
> > the platform code is much harder, so we'll leave that
> > until we have a DT binding for pwm-samsung, which may require
> > other changes in this area. Since we are already touching
> > every MMIO accessor in this driver, let's also use the
> > proper readl_relaxed variant rather than __raw_readl.
> >
> > Tomasz Figa has a set of patches to clean this up in a proper
> > way, but that might be too late for 3.10.
>
> Joonyoung Shim (Cc'ed) posted a driver for Exynos back in December. I
> had a few comments on it but never saw an updated version. Is Tomasz'
> work based on that patch?
Is this the patch you are talking about?
https://lkml.org/lkml/2012/12/13/84
If yes, it solves the problems only for Exynos SoCs (excluding Exynos 4210
rev0), which don't need to share the PWM hardware between two drivers.
On older platforms (S3C24xx, S3C64xx, S5P64x0, S5PC100, S5PV210 and Exynos
4210 rev0) the same hardware block is used for two drivers - clocksource
driver and PWM driver.
You can get more information from these two threads:
- http://thread.gmane.org/gmane.linux.kernel.samsung-soc/16480/focus=16510
(starting from the linked post)
- http://thread.gmane.org/gmane.linux.kernel.samsung-soc/17464
> Given that this patch solves a real problem and doesn't make things any
> worse, I think it's okay to use it temporarily until Tomasz has had time
> to finish up the proper driver, so:
Well, from what I've seen, the PWM might have been already broken on non-
DT platforms using channels higher than 0, because the driver registers
each channel passing -1 as base, which makes the id being assigned
dynamically (usually to 0, since it's the only PWM channel used), while in
all platform data, the real (hardware) PWM channel id is used and no PWM
lookup is registered.
You can use the following grep to find all platforms with broken PWM:
git grep pwm_id arch/arm/mach-s[35]* | grep -v "= 0"
I have a set of patches to fix everything up in the PWM driver, but they
depend on my patches providing the infrastructure to share the PWM
hardware, on next version of which I'm currently working.
So, for now, Arnd's patch is fine to me as well.
Best regards,
Tomasz
next prev parent reply other threads:[~2013-04-12 7:46 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 0:04 [PATCH 00/30] ARM: exynos multiplatform support Arnd Bergmann
2013-04-11 0:04 ` [PATCH 01/30] ARM: exynos: introduce EXYNOS_ATAGS symbol Arnd Bergmann
2013-04-11 0:04 ` [PATCH 02/30] ARM: exynos: prepare for sparse IRQ Arnd Bergmann
2013-04-11 0:17 ` Kyungmin Park
2013-04-11 0:04 ` [PATCH 03/30] ARM: exynos: move debug-macro.S to include/debug/ Arnd Bergmann
2013-04-11 0:04 ` [PATCH 04/30] ARM: samsung: move mfc device definition to s5p-dev-mfc.c Arnd Bergmann
2013-04-11 0:04 ` [PATCH 05/30] tty: serial/samsung: prepare for common clock API Arnd Bergmann
2013-04-11 0:04 ` [PATCH 06/30] tty: serial/samsung: make register definitions global Arnd Bergmann
2013-04-11 0:04 ` [PATCH 07/30] tty: serial/samsung: fix modular build Arnd Bergmann
2013-04-11 0:04 ` [PATCH 08/30] i2c: s3c2410: make header file local Arnd Bergmann
2013-04-14 12:20 ` Wolfram Sang
2013-04-14 17:01 ` Heiko Stübner
2013-04-11 0:04 ` [PATCH 09/30] mmc: sdhci-s3c: remove platform dependencies Arnd Bergmann
2013-04-11 1:06 ` Chris Ball
2013-04-11 0:04 ` [PATCH 10/30] usb: exynos: do not include plat/usb-phy.h Arnd Bergmann
2013-04-11 20:25 ` Greg Kroah-Hartman
2013-04-11 20:49 ` [PATCH v3] " Arnd Bergmann
2013-04-11 0:04 ` [PATCH 11/30] [media] exynos: remove unnecessary header inclusions Arnd Bergmann
2013-04-11 0:13 ` Mauro Carvalho Chehab
2013-04-11 9:07 ` Sylwester Nawrocki
2013-04-11 10:52 ` Arnd Bergmann
2013-04-11 0:04 ` [PATCH 12/30] video/exynos: " Arnd Bergmann
2013-04-11 5:07 ` Jingoo Han
2013-04-11 11:51 ` Tomi Valkeinen
2013-04-11 12:08 ` Arnd Bergmann
2013-04-11 0:04 ` [PATCH 13/30] video/s3c: move platform_data out of arch/arm Arnd Bergmann
2013-04-11 4:34 ` Jingoo Han
2013-04-11 5:12 ` Jingoo Han
2013-04-11 0:04 ` [PATCH 14/30] thermal/exynos: remove unnecessary header inclusions Arnd Bergmann
2013-04-11 1:19 ` Eduardo Valentin
2013-04-11 23:26 ` Zhang Rui
2013-04-11 0:04 ` [PATCH 15/30] mtd: onenand/samsung: make regs-onenand.h file local Arnd Bergmann
2013-04-11 0:18 ` Kyungmin Park
2013-04-11 0:04 ` [PATCH 16/30] rtc: s3c: make header " Arnd Bergmann
2013-04-11 0:04 ` [PATCH 17/30] pwm: samsung: repair the worst MMIO abuses Arnd Bergmann
2013-04-12 7:06 ` Thierry Reding
2013-04-12 7:46 ` Tomasz Figa [this message]
2013-04-11 0:05 ` [PATCH 18/30] ASoC: samsung: move plat/ headers to local directory Arnd Bergmann
2013-04-11 16:47 ` Mark Brown
2013-04-11 17:08 ` Arnd Bergmann
2013-04-11 17:19 ` Mark Brown
2013-04-11 19:02 ` [PATCH] ASoC: samsung: fix neo1973-wm8753 compilation Heiko Stübner
2013-04-12 12:13 ` Mark Brown
2013-04-12 11:04 ` [alsa-devel] [PATCH 18/30] ASoC: samsung: move plat/ headers to local directory Lars-Peter Clausen
2013-04-12 11:26 ` Mark Brown
2013-04-11 0:05 ` [PATCH 19/30] ASoC: samsung: use irq resource for idma Arnd Bergmann
2013-04-11 16:48 ` Mark Brown
2013-04-11 0:05 ` [PATCH 20/30] ASoC: samsung: convert to dmaengine API Arnd Bergmann
2013-04-11 14:27 ` Mark Brown
2013-04-11 14:47 ` Arnd Bergmann
2013-04-11 15:42 ` Mark Brown
2013-04-12 19:27 ` [alsa-devel] " Lars-Peter Clausen
2013-04-15 11:04 ` Mark Brown
2013-04-11 0:05 ` [PATCH 21/30] ASoC: samsung/i2s: fix module_device_table Arnd Bergmann
2013-04-11 16:48 ` Mark Brown
2013-04-11 0:05 ` [PATCH 22/30] ASoC: samsung/idma: export idma_reg_addr_init Arnd Bergmann
2013-04-11 16:48 ` Mark Brown
2013-04-11 0:05 ` [PATCH 23/30] clk: exynos: prepare for multiplatform Arnd Bergmann
2013-04-11 0:05 ` [PATCH 24/30] clocksource: exynos_mct: remove platform header dependency Arnd Bergmann
2013-04-11 0:05 ` [PATCH 25/30] irqchip: exynos: pass max combiner number to combiner_init Arnd Bergmann
2013-04-11 0:05 ` [PATCH 26/30] irqchip: exynos: allocate combiner_data dynamically Arnd Bergmann
2013-04-11 0:05 ` [PATCH 27/30] irqchip: exynos: localize irq lookup for ATAGS Arnd Bergmann
2013-04-11 0:05 ` [PATCH 28/30] irqchip: exynos: pass irq_base from platform Arnd Bergmann
2013-04-11 0:05 ` [PATCH 29/30] spi: s3c64xx: move to generic dmaengine API Arnd Bergmann
2013-04-11 16:55 ` Mark Brown
2013-04-11 20:42 ` [PATCH v2] " Arnd Bergmann
2013-04-12 12:55 ` Mark Brown
2013-04-17 14:46 ` Mark Brown
2013-04-17 20:05 ` [PATCH 29/30] " Arnd Bergmann
2013-04-18 16:46 ` Mark Brown
2013-04-11 0:05 ` [PATCH 30/30] ARM: exynos: enable multiplatform support Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469653.nxt3obZ5EV@flatron \
--to=tomasz.figa@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).