From: Kevin Hilman <khilman@ti.com>
To: Tero Kristo <t-kristo@ti.com>
Cc: linux-omap@vger.kernel.org, Paul Walmsley <paul@pwsan.com>,
"Cousson, Benoit" <b-cousson@ti.com>,
Tony Lindgren <tony@atomide.com>,
linux-kernel@vger.kernel.org,
"Govindraj.R" <govindraj.raja@ti.com>,
"Avinash.H.M" <avinashhm@ti.com>,
linux-arm-kernel@lists.infradead.org,
Samuel Ortiz <sameo@linux.intel.com>
Subject: Re: [PATCHv9 06/18] mfd: omap-prm: added chain interrupt handler
Date: Thu, 17 Nov 2011 14:34:46 -0800 [thread overview]
Message-ID: <87aa7u1ipl.fsf@ti.com> (raw)
In-Reply-To: <1316781986-30642-7-git-send-email-t-kristo@ti.com> (Tero Kristo's message of "Fri, 23 Sep 2011 15:46:14 +0300")
Tero Kristo <t-kristo@ti.com> writes:
> Introduce a chained interrupt handler mechanism for the PRCM
> interrupt, so that individual PRCM event can cleanly be handled by
> handlers in separate drivers. We do this by introducing PRCM event
> names, which are then matched to the particular PRCM interrupt bit
> depending on the specific OMAP SoC being used.
>
> PRCM interrupts have two priority levels, high or normal. High priority
> is needed for IO event handling, so that we can be sure that IO events
> are processed before other events. This reduces latency for IO event
> customers and also prevents incorrect ack sequence on OMAP3.
>
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> Cc: Paul Walmsley <paul@pwsan.com>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Avinash.H.M <avinashhm@ti.com>
> Cc: Cousson, Benoit <b-cousson@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Govindraj.R <govindraj.raja@ti.com>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> ---
> drivers/mfd/omap-prm-common.c | 239 +++++++++++++++++++++++++++++++++++++++++
> drivers/mfd/omap-prm.h | 40 +++++++
> drivers/mfd/omap3xxx-prm.c | 29 +++++-
> drivers/mfd/omap4xxx-prm.c | 28 +++++-
> 4 files changed, 334 insertions(+), 2 deletions(-)
> create mode 100644 drivers/mfd/omap-prm.h
>
> diff --git a/drivers/mfd/omap-prm-common.c b/drivers/mfd/omap-prm-common.c
> index 39b199c8..2886eb2 100644
> --- a/drivers/mfd/omap-prm-common.c
> +++ b/drivers/mfd/omap-prm-common.c
> @@ -15,10 +15,249 @@
> #include <linux/ctype.h>
> #include <linux/module.h>
> #include <linux/io.h>
> +#include <linux/irq.h>
> +#include <linux/interrupt.h>
> #include <linux/slab.h>
> #include <linux/init.h>
> #include <linux/err.h>
>
> +#include "omap-prm.h"
> +
> +#define OMAP_PRCM_MAX_NR_PENDING_REG 2
> +
> +struct omap_prm_device {
> + const struct omap_prcm_irq_setup *irq_setup;
> + const struct omap_prcm_irq *irqs;
> + struct irq_chip_generic **irq_chips;
> + int nr_irqs;
> + u32 *saved_mask;
> + u32 *priority_mask;
> + int base_irq;
> + int irq;
> + void __iomem *base;
> +};
> +
> +static struct omap_prm_device prm_dev;
This shouldn't be statically allocated, and needlessly forces us to
assume a single, global PRM (which is the case today, but who knows...)
Instead, it should be allocated at init time and associated with the
instance (using set_drvdata or somthing.)
> +static inline u32 prm_read_reg(int offset)
> +{
> + return __raw_readl(prm_dev.base + offset);
> +}
> +
> +static inline void prm_write_reg(u32 value, int offset)
> +{
> + __raw_writel(value, prm_dev.base + offset);
> +}
This doesn't seem right either.
The register layout/access parts are what are are different between the
OMAP3 and OMAP4 versions, so I would expect anything that accesses
registers to be going through the SoC specific code.
I'm having some second thoughts about the split of common and SoC
specific code here. Currently the SoC specific code is basically
identical (ignoring the s/omap3/omap4/ throughout.)
I think we need to discuss this further, but what seems to me that the
current design is to have 2 separate drivers, with some common helper
functions. I'm starting to think that what we need instead is a single,
common driver with a set of SoC-specific functions that implement the
SoC-specific details. This latter approach follows what is done in the
powerdomain code today for example: common code in powerdomain.c and SoC
specific implementation of all the "ops" in powerdomain2xxx_3xxx.c and
powerdomain4xxx.c.
Kevin
next prev parent reply other threads:[~2011-11-17 22:34 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-23 12:46 [PATCHv9 00/18] omap PRCM chain handler Tero Kristo
2011-09-23 12:46 ` [PATCHv9 01/18] OMAP2+: hwmod: Add API to enable IO ring wakeup Tero Kristo
2011-09-23 12:46 ` [PATCHv9 02/18] OMAP2+: hwmod: Add API to check IO PAD wakeup status Tero Kristo
2011-09-23 12:46 ` [PATCHv9 03/18] TEMP: OMAP3xxx: hwmod data: add PRM hwmod Tero Kristo
2011-10-10 19:24 ` Paul Walmsley
2011-10-10 19:54 ` Cousson, Benoit
2011-10-10 20:11 ` Paul Walmsley
2011-10-10 20:42 ` Paul Walmsley
2011-10-10 22:17 ` Cousson, Benoit
2011-10-10 22:35 ` Paul Walmsley
2011-10-12 8:14 ` Cousson, Benoit
2011-10-10 23:26 ` Paul Walmsley
2011-10-12 8:16 ` Cousson, Benoit
2011-10-13 16:38 ` Paul Walmsley
2011-10-13 16:51 ` Paul Walmsley
2011-10-20 14:51 ` Cousson, Benoit
2011-10-20 15:25 ` Tero Kristo
2011-10-20 14:43 ` Cousson, Benoit
2011-09-23 12:46 ` [PATCHv9 04/18] TEMP: OMAP4xxx: " Tero Kristo
2011-09-23 12:46 ` [PATCHv9 05/18] mfd: omap-prm: add driver skeleton Tero Kristo
2011-11-18 21:35 ` Kevin Hilman
2011-09-23 12:46 ` [PATCHv9 06/18] mfd: omap-prm: added chain interrupt handler Tero Kristo
2011-11-17 22:34 ` Kevin Hilman [this message]
2011-11-18 19:18 ` Felipe Balbi
2011-11-21 13:10 ` Tero Kristo
2011-09-23 12:46 ` [PATCHv9 07/18] mfd: omap-prm: added suspend prepare and complete callbacks Tero Kristo
2011-11-18 19:02 ` Kevin Hilman
2011-11-21 13:00 ` Tero Kristo
2011-09-23 12:46 ` [PATCHv9 08/18] OMAP2+: mux: add support for PAD wakeup interrupts Tero Kristo
2011-09-23 12:46 ` [PATCHv9 09/18] omap3: pm: use prcm chain handler Tero Kristo
2011-09-23 12:46 ` [PATCHv9 10/18] OMAP3: pm: do not enable PRCM MPU interrupts manually Tero Kristo
2011-09-23 12:46 ` [PATCHv9 11/18] omap3+: add omap prm driver initialization Tero Kristo
2011-09-23 12:46 ` [PATCHv9 12/18] TEMP: serial: added mux support Tero Kristo
2011-09-23 12:46 ` [PATCHv9 13/18] TEMP: 4430sdp: use common serial init with " Tero Kristo
2011-09-23 12:46 ` [PATCHv9 14/18] TEMP: mux: added trace for io wkup event Tero Kristo
2011-09-23 12:46 ` [PATCHv9 15/18] TEMP: OMAP3: pm: remove serial resume / idle calls from idle path Tero Kristo
2011-09-23 12:46 ` [PATCHv9 16/18] TEMP: OMAP3: serial: made serial to work properly with PRCM chain handler Tero Kristo
2011-09-23 12:46 ` [PATCHv9 17/18] TEMP: OMAP: serial: remove padconf hacks Tero Kristo
2011-09-23 12:46 ` [PATCHv9 18/18] TEMP: OMAP device: change pr_warnings to pr_debugs Tero Kristo
2011-09-23 22:23 ` [PATCHv9 00/18] omap PRCM chain handler Valdis.Kletnieks
2011-09-24 5:24 ` Sripathy, Vishwanath
2011-09-24 5:55 ` Valdis.Kletnieks
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=87aa7u1ipl.fsf@ti.com \
--to=khilman@ti.com \
--cc=avinashhm@ti.com \
--cc=b-cousson@ti.com \
--cc=govindraj.raja@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=sameo@linux.intel.com \
--cc=t-kristo@ti.com \
--cc=tony@atomide.com \
/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).