* Re: [PATCH 34/57] fbdev: sh_mobile_lcdc: Store the format in struct sh_mobile_lcdc_chan
From: Laurent Pinchart @ 2011-12-16 10:17 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-35-git-send-email-laurent.pinchart@ideasonboard.com>
Hi Guennadi,
On Thursday 15 December 2011 23:29:29 Guennadi Liakhovetski wrote:
> On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> > Store the active format in the channel structure, and use it instead of
> > parsing info->var all over the place when the format is needed.
>
> Right, this is what I was wondering about, while looking at the previous
> patch:-)
So I'll consider your comment to patch 33/57 to be addressed :-)
> But:
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >
> > drivers/video/sh_mobile_lcdcfb.c | 21 ++++++++++-----------
> > drivers/video/sh_mobile_lcdcfb.h | 4 +++-
> > 2 files changed, 13 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/video/sh_mobile_lcdcfb.c
> > b/drivers/video/sh_mobile_lcdcfb.c index c6b6b9d..9829e01 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/sh_mobile_lcdcfb.c
>
> [snip]
>
> > @@ -1350,6 +1345,8 @@ static int sh_mobile_set_par(struct fb_info *info)
> >
> > info->fix.line_length = info->var.xres
> >
> > * info->var.bits_per_pixel / 8;
> >
> > + ch->format > > sh_mobile_format_info(sh_mobile_format_fourcc(&info->var));
>
> Cannot this be NULL? As far as I could trace it back, I'm not sure with
> hotplug bits_per_pixel would be initialised correctly along the lines of
> sh_mobile_fb_reconfig().
You're right, sh_mobile_fb_reconfig() doesn't set the bits_per_pixel (and
other format-related) field. I'll fix this by initializing those fields from
the current var in sh_mobile_fb_reconfig() in patch 30/57, as that's the one
that introduces the problem.
--
Regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH 27/57] fbdev: sh_mobile_lcdc: Pass a video mode to the notify callback
From: Laurent Pinchart @ 2011-12-16 10:10 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-28-git-send-email-laurent.pinchart@ideasonboard.com>
Hi Guennadi,
On Thursday 15 December 2011 20:01:54 Guennadi Liakhovetski wrote:
> On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> > Pass pointers to struct fb_videomode and struct fb_monspecs instead of
> > struct fb_var_screeninfo to the notify callback.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >
> > drivers/video/sh_mobile_hdmi.c | 59
> > +++++++++++++++++-------------------- drivers/video/sh_mobile_lcdcfb.c
> > | 40 ++++++++++++++----------- drivers/video/sh_mobile_lcdcfb.h |
> > 3 +-
> > 3 files changed, 51 insertions(+), 51 deletions(-)
>
> [snip]
>
> > diff --git a/drivers/video/sh_mobile_lcdcfb.c
> > b/drivers/video/sh_mobile_lcdcfb.c index 21e5f10..4ec216e 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/sh_mobile_lcdcfb.c
>
> [ditto]
>
> > @@ -433,12 +432,17 @@ static int sh_mobile_lcdc_display_notify(struct
> > sh_mobile_lcdc_chan *ch,
> >
> > }
> > break;
> >
> > - case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE:
> > + case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE: {
> > + struct fb_var_screeninfo var;
> > +
> >
> > /* Validate a proposed new mode */
> >
> > - var->bits_per_pixel = info->var.bits_per_pixel;
> > - ret = info->fbops->fb_check_var(var, info);
> > + fb_videomode_to_var(&var, mode);
> > + var.bits_per_pixel = info->var.bits_per_pixel;
> > + var.grayscale = info->var.grayscale;
> > + ret = info->fbops->fb_check_var(&var, info);
> >
> > break;
> >
> > }
> >
> > + }
>
> nitpick - please, realign:-)
It's common in driver code not to increase the identation level twice in a
case statement if braces are needed. However, those "braced" statements are
usually not the last ones in the switch. In this particular case this creates
an alignment issue at the end, as your correctly pointed out. However, I'd
like to avoid increasing the indentation of the whole block. Increasing the
indentation of the closing brace only also causes an alignment issue. I can
add a default case that returns an error to fix this, but that's adding code
to fix a cosmetic problem :-) What's your preference.
--
Regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH 12/57] arm: mach-shmobile: Add LCDC tx_dev field to platform data
From: Laurent Pinchart @ 2011-12-16 10:04 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-13-git-send-email-laurent.pinchart@ideasonboard.com>
Hi Guennadi,
On Thursday 15 December 2011 15:01:27 Guennadi Liakhovetski wrote:
> On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> > Make sure the transmitter devices get registered before the associated
> > LCDC devices.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[snip]
> > diff --git a/arch/arm/mach-shmobile/board-ap4evb.c
> > b/arch/arm/mach-shmobile/board-ap4evb.c index dca4860..e0a6b3d 100644
> > --- a/arch/arm/mach-shmobile/board-ap4evb.c
> > +++ b/arch/arm/mach-shmobile/board-ap4evb.c
[snip]
> > @@ -627,6 +553,86 @@ static struct platform_device *qhd_devices[]
> > __initdata = {
> >
> > };
> > #endif /* CONFIG_AP4EVB_QHD */
> >
> > +/* LCDC0 */
> > +static const struct fb_videomode ap4evb_lcdc_modes[] = {
>
> Hm, I must be missing something. I thought you were moving all the structs
> around to make them available for reference _without_ forward
> declarations. But you _do_ end up using a forward declaration anyway. Here
> and for HDMI below too. So, what's the point? Why not just forward declare
> that one struct, that's needed and leave the rest where it currently is
> in the file?
As we have circular dependencies forward declaration can't be avoided. I found
it cleaner to have devices data in registration order in the board file, but I
can remove this if you prefer.
> > + {
> > +#ifdef CONFIG_AP4EVB_QHD
> > + .name = "R63302(QHD)",
> > + .xres = 544,
> > + .yres = 961,
> > + .left_margin = 72,
> > + .right_margin = 600,
> > + .hsync_len = 16,
> > + .upper_margin = 8,
> > + .lower_margin = 8,
> > + .vsync_len = 2,
> > + .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
> > +#else
> > + .name = "WVGA Panel",
> > + .xres = 800,
> > + .yres = 480,
> > + .left_margin = 220,
> > + .right_margin = 110,
> > + .hsync_len = 70,
> > + .upper_margin = 20,
> > + .lower_margin = 5,
> > + .vsync_len = 5,
> > + .sync = 0,
> > +#endif
> > + },
> > +};
[snip]
> > diff --git a/arch/arm/mach-shmobile/board-mackerel.c
> > b/arch/arm/mach-shmobile/board-mackerel.c index 4ed0138..ccdd9fc 100644
> > --- a/arch/arm/mach-shmobile/board-mackerel.c
> > +++ b/arch/arm/mach-shmobile/board-mackerel.c
[snip]
> > @@ -1313,8 +1317,8 @@ static struct platform_device *mackerel_devices[]
> > __initdata = {
> > &sh_mmcif_device,
> > &ceu_device,
> > &mackerel_camera,
> > - &hdmi_lcdc_device,
> > &hdmi_device,
> > + &hdmi_lcdc_device,
> > &meram_device,
> > };
>
> Sorry, could you elaborate, why this is needed? If this is really
> important, then I'd prefer to test this before committing. If OTOH this is
> unimportant, and my assumption, that normally it's the platform driver
> registration order, that's important, not device registration order, is
> correct, then you don't have to swap the order?
If both the transmitter and LCDC drivers are built-in, the device probe order
is the device registration order. As we need the transmitter to be probed
first, it needs to be registered first.
--
Regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH v5 5/5] imx6q: Remove unconditional dependency on l2x0 L2
From: Shawn Guo @ 2011-12-16 9:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1323964434-6764-6-git-send-email-dave.martin@linaro.org>
On Thu, Dec 15, 2011 at 03:53:54PM +0000, Dave Martin wrote:
> The i.MX6 Quad SoC will work without the l2x0 L2 cache controller
> support built into the kernel, so this patch removes the dependency
> on CACHE_L2X0.
>
> This makes the l2x0 support optional, so that it can be turned off
> when desired for debugging purposes etc.
>
> Since SOC_IMX6Q already depends on ARCH_IMX_V6_V7 and
> ARCH_IMX_V6_V7 selects MIGHT_HAVE_CACHE_L2X0, there is no need to
> select that option explicitly from SOC_IMX6Q.
>
> Thanks to Shawn Guo for this suggestion. [1]
>
> [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2011-November/074602.html
>
> Signed-off-by: Dave Martin <dave.martin@linaro.org>
Acked-and-Tested-by: Shawn Guo <shawn.guo@linaro.org>
Regards,
Shawn
> ---
> Changes:
>
> v5: Don't select MIGHT_HAVE_CACHE_L2X0 directly from SOC_IMX6Q, but
> instead select implicitly via ARCH_IMX_V6_V7 (which we expect
> to be selected by other relevant SoCs). Thanks to Shawn for
> this suggestion.
>
>
> arch/arm/mach-imx/Kconfig | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 29a3d61..1530678 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -609,7 +609,6 @@ comment "i.MX6 family:"
> config SOC_IMX6Q
> bool "i.MX6 Quad support"
> select ARM_GIC
> - select CACHE_L2X0
> select CPU_V7
> select HAVE_ARM_SCU
> select HAVE_IMX_GPC
> --
> 1.7.4.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply
* Re: [PATCH v5 1/5] ARM: l2x0/pl310: Refactor Kconfig to be more
From: Shawn Guo @ 2011-12-16 9:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1323964434-6764-2-git-send-email-dave.martin@linaro.org>
On Thu, Dec 15, 2011 at 03:53:50PM +0000, Dave Martin wrote:
> Making CACHE_L2X0 depend on (huge list of MACH_ and ARCH_ configs)
> is bothersome to maintain and likely to lead to merge conflicts.
>
> This patch moves the knowledge of which platforms have a L2x0 or
> PL310 cache controller to the individual machines. To enable this,
> a new MIGHT_HAVE_CACHE_L2X0 config option is introduced to allow
> machines to indicate that they may have such a cache controller
> independently of each other.
>
> Boards/SoCs which cannot reliably operate without the L2 cache
> controller support will need to select CACHE_L2X0 directly from
> their own Kconfigs instead. This applies to some TrustZone-enabled
> boards where Linux runs in the Normal World, for example.
>
> Signed-off-by: Dave Martin <dave.martin@linaro.org>
> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
> (for cns3xxx)
> Acked-by: Tony Lindgren <tony@atomide.com>
> (for omap)
> ---
[...]
> diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
> index b3a1f2b..b30708e 100644
> --- a/arch/arm/plat-mxc/Kconfig
> +++ b/arch/arm/plat-mxc/Kconfig
> @@ -20,6 +20,7 @@ config ARCH_IMX_V6_V7
> bool "i.MX3, i.MX6"
> select AUTO_ZRELADDR if !ZBOOT_ROM
> select ARM_PATCH_PHYS_VIRT
> + select MIGHT_HAVE_CACHE_L2X0
> help
> This enables support for systems based on the Freescale i.MX3 and i.MX6
> family.
Acked-by: Shawn Guo <shawn.guo@linaro.org>
--
Regards,
Shawn
^ permalink raw reply
* Re: [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to sh_mobile_lcdc_entity
From: Laurent Pinchart @ 2011-12-16 9:52 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-22-git-send-email-laurent.pinchart@ideasonboard.com>
Hi Guennadi,
On Thursday 15 December 2011 17:16:16 Guennadi Liakhovetski wrote:
> On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> > The field will be used by the transmitter drivers to access
> > sh_mobile_lcdc_chan fields such as fb_info.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >
> > drivers/video/sh_mobile_lcdcfb.c | 5 ++++-
> > drivers/video/sh_mobile_lcdcfb.h | 2 ++
> > 2 files changed, 6 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/video/sh_mobile_lcdcfb.c
> > b/drivers/video/sh_mobile_lcdcfb.c index cb5ea3c..2dccfde 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/sh_mobile_lcdcfb.c
> > @@ -1497,8 +1497,10 @@ static int sh_mobile_lcdc_remove(struct
> > platform_device *pdev)
> >
> > if (!info || !info->device)
> >
> > continue;
> >
> > - if (ch->tx_dev)
> > + if (ch->tx_dev) {
> > + ch->tx_dev->lcdc = NULL;
> >
> > module_put(ch->cfg.tx_dev->dev.driver->owner);
> >
> > + }
> >
> > if (ch->sglist)
> >
> > vfree(ch->sglist);
> >
> > @@ -1608,6 +1610,7 @@ sh_mobile_lcdc_channel_init(struct
> > sh_mobile_lcdc_priv *priv,
> >
> > return -EINVAL;
> >
> > }
> > ch->tx_dev = platform_get_drvdata(cfg->tx_dev);
> >
> > + ch->tx_dev->lcdc = ch;
>
> I do not have a kernel, patched with your patches up to 20/57;-) so, I
> cannot verify - can ch->tx_dev at this point not be NULL?
I don't think so, as the
if (!cfg->tx_dev->dev.driver ||
!try_module_get(cfg->tx_dev->dev.driver->owner))
check above ensures that the transmitter driver is loaded and bound to the
device. As the transmitter driver calls platform_Set_drvdata() at probe time,
platform_get_drvdata() will not return NULL.
> > }
> >
> > /* Iterate through the modes to validate them and find the highest
> >
> > diff --git a/drivers/video/sh_mobile_lcdcfb.h
> > b/drivers/video/sh_mobile_lcdcfb.h index 9601b92..36cd564 100644
> > --- a/drivers/video/sh_mobile_lcdcfb.h
> > +++ b/drivers/video/sh_mobile_lcdcfb.h
> > @@ -19,6 +19,7 @@ struct fb_info;
> >
> > struct module;
> > struct sh_mobile_lcdc_entity;
> > struct sh_mobile_lcdc_priv;
> >
> > +struct sh_mobile_lcdc_chan;
> >
> > struct sh_mobile_lcdc_entity_ops {
> >
> > /* Display */
> >
> > @@ -30,6 +31,7 @@ struct sh_mobile_lcdc_entity_ops {
> >
> > struct sh_mobile_lcdc_entity {
> >
> > struct module *owner;
> > const struct sh_mobile_lcdc_entity_ops *ops;
> >
> > + struct sh_mobile_lcdc_chan *lcdc;
> >
> > };
> >
> > /*
--
Regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH 25/57] sh_mobile_lcdc: Add display notify callback to
From: Guennadi Liakhovetski @ 2011-12-16 9:40 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-26-git-send-email-laurent.pinchart@ideasonboard.com>
On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> The callback implements 3 notification events:
>
> - SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT notifies the LCDC that the
> display has been connected
> - SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT notifies the LCDC that the
> display has been disconnected
> - SH_MOBILE_LCDC_EVENT_DISPLAY_MODE notifies that LCDC that a display
> mode has been detected
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/video/sh_mobile_lcdcfb.c | 81 ++++++++++++++++++++++++++++++++++++++
> drivers/video/sh_mobile_lcdcfb.h | 10 +++++
> 2 files changed, 91 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index 4b03aa5..21e5f10 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
> @@ -363,6 +363,86 @@ static void sh_mobile_lcdc_display_off(struct sh_mobile_lcdc_chan *ch)
> ch->tx_dev->ops->display_off(ch->tx_dev);
> }
>
> +static bool
> +sh_mobile_lcdc_must_reconfigure(struct sh_mobile_lcdc_chan *ch,
> + const struct fb_var_screeninfo *new_var)
> +{
> + struct fb_var_screeninfo *old_var = &ch->display_var;
> + struct fb_videomode old_mode;
> + struct fb_videomode new_mode;
> +
> + fb_var_to_videomode(&old_mode, old_var);
> + fb_var_to_videomode(&new_mode, new_var);
> +
> + dev_dbg(ch->info->dev, "Old %ux%u, new %ux%u\n",
> + old_mode.xres, old_mode.yres, new_mode.xres, new_mode.yres);
> +
> + if (fb_mode_is_equal(&old_mode, &new_mode)) {
> + /* It can be a different monitor with an equal video-mode */
> + old_var->width = new_var->width;
> + old_var->height = new_var->height;
> + return false;
> + }
> +
> + dev_dbg(ch->info->dev, "Switching %u -> %u lines\n",
> + old_mode.yres, new_mode.yres);
> + *old_var = *new_var;
> +
> + return true;
> +}
> +
> +static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch,
> + enum sh_mobile_lcdc_entity_event event,
> + struct fb_var_screeninfo *var)
> +{
> + struct fb_info *info = ch->info;
> + int ret = 0;
> +
> + switch (event) {
> + case SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT:
> + /* HDMI plug in */
> + if (lock_fb_info(info)) {
> + console_lock();
> +
> + if (!sh_mobile_lcdc_must_reconfigure(ch, var) &&
> + info->state = FBINFO_STATE_RUNNING) {
> + /* First activation with the default monitor.
> + * Just turn on, if we run a resume here, the
> + * logo disappears.
> + */
> + info->var.width = var->width;
> + info->var.height = var->height;
> + sh_mobile_lcdc_display_on(ch);
> + } else {
> + /* New monitor or have to wake up */
> + fb_set_suspend(info, 0);
> + }
> +
> + console_unlock();
> + unlock_fb_info(info);
> + }
> + break;
> +
> + case SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT:
> + /* HDMI disconnect */
> + if (lock_fb_info(info)) {
> + console_lock();
> + fb_set_suspend(info, 1);
> + console_unlock();
> + unlock_fb_info(info);
> + }
> + break;
> +
> + case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE:
> + /* Validate a proposed new mode */
> + var->bits_per_pixel = info->var.bits_per_pixel;
> + ret = info->fbops->fb_check_var(var, info);
You can call sh_mobile_lcdc_check_var() directly here too, right?
Thanks
Guennadi
> + break;
> + }
> +
> + return ret;
> +}
> +
> /* -----------------------------------------------------------------------------
> * Format helpers
> */
> @@ -1591,6 +1671,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
> int i;
>
> mutex_init(&ch->open_lock);
> + ch->notify = sh_mobile_lcdc_display_notify;
>
> /* Allocate the frame buffer device. */
> ch->info = framebuffer_alloc(0, priv->dev);
> diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
> index 6fb956c..e2eb7af 100644
> --- a/drivers/video/sh_mobile_lcdcfb.h
> +++ b/drivers/video/sh_mobile_lcdcfb.h
> @@ -30,6 +30,12 @@ struct sh_mobile_lcdc_entity_ops {
> void (*display_off)(struct sh_mobile_lcdc_entity *entity);
> };
>
> +enum sh_mobile_lcdc_entity_event {
> + SH_MOBILE_LCDC_EVENT_DISPLAY_CONNECT,
> + SH_MOBILE_LCDC_EVENT_DISPLAY_DISCONNECT,
> + SH_MOBILE_LCDC_EVENT_DISPLAY_MODE,
> +};
> +
> struct sh_mobile_lcdc_entity {
> struct module *owner;
> const struct sh_mobile_lcdc_entity_ops *ops;
> @@ -70,6 +76,10 @@ struct sh_mobile_lcdc_chan {
> unsigned long base_addr_y;
> unsigned long base_addr_c;
> unsigned int pitch;
> +
> + int (*notify)(struct sh_mobile_lcdc_chan *ch,
> + enum sh_mobile_lcdc_entity_event event,
> + struct fb_var_screeninfo *var);
> };
>
> #endif
> --
> 1.7.3.4
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* Re: [PATCH/RFC] mmc: add a device PM QoS constraint when a host is
From: Guennadi Liakhovetski @ 2011-12-16 9:14 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Ulf Hansson, linux-mmc@vger.kernel.org, linux-pm@vger.kernel.org,
Chris Ball, linux-sh@vger.kernel.org
In-Reply-To: <201112142236.26739.rjw@sisk.pl>
On Wed, 14 Dec 2011, Rafael J. Wysocki wrote:
> On Wednesday, December 14, 2011, Ulf Hansson wrote:
[snip]
> > 2.
> > When executing mmc/sd commands/requests the host must always be claimed
> > (and thus the host is always enabled).
Why? Why cannot we save some power between IO operations - if we can do
this quickly and safely without affecting functionality and throughput?
> > But more important some mmc/sd
> > commands must be executed as a sequence, without the host being disabled
> > in between the commands (since a disable might mean that the clock to
> > card gets disabled).
Ok, there might well be such command sequences, but my question is: who
knows about them? Is this mandated by the MMC(/SD/SDIO/...) standard or is
it host-specific? Also "might mean" is actually interesting here. I think
we eventually need a combination of timing-oriented PM constraints and
"stateful" ones. During such a command sequence you would require the card
clock to stay on.
> > To solve this, the mmc_claim_host is used, to make
> > sure the host is enabled during the complete command sequence.
> >
> > I happily continue this discussion, to see if someone more can break the
> > idea about having get_sync in mmc_host_enable. :-)
>
> I'll leave this one to Guennadi, if you don't mind. :-)
As I said above, I think, we need both - to be able to require a certain
responsiveness / throughput and specific interface parameters like
supplying clock, power, etc.
Also notice, that setting a constraint doesn't affect in principle, when
the device is allowed to suspend. This is done as usual per
pm_runtime_get*() and _put*(). I think, a reasonable solution to use PM
QoS to impose timing constraints but at the same time to not disable the
hardware, when this is disallowed, is to tie pm_runtime_get() and _put()
calls to driver's .set_ios() method, like tmio_mmc and sh_mmcif drivers
currently do. Those drivers only call pm_runtime_put() when the interface
clock is gated. So, as long as the core is aware, that that IO sequence
has to run uninterrupted without stopping the clock between single
transfers, it just has to avoid gating the clock for that period and the
interface will not enter any power-saving mode.
So, I don't think we need to enforce pm_runtime_get_sync() in
mmc_claim_host().
Thanks
Guennadi
> > >> Using PM QoS as you propose, might prevent some hosts from doing
> > >> runtime_suspend|resume completely and thus those might not fulfill power
> > >> consumption requirements instead.
> > >
> > > I'm not sure what scenario you have in mind. Care to elaborate?
> >
> > Well, suppose a the host drivers start considering the PM QoS
> > requirement, but never can fulfill the requirement of 100us for it's
> > runtime_suspend callback function...
>
> OK, that's a valid concern. This means there should be a way for user space
> to specify the constraint somehow, because it's a user space's role to define
> policies.
>
> > >> I do not think we can take this decision at this level. Is performance more
> > >> important than power save, that is kind of the question.
> > >
> > > Yes, it is. Also, the number used here is somewhat arbitrary.
> >
> > For you maybe power management is less important, but I doubt everybody
> > else agree to that. It is a more complex balance I believe.
>
> You're right.
>
> > > However, since no one except for SH7372 is now using device PM QoS, no one
> > > else will be affected by this change at the moment.
> >
> > True, but that is not a good reason for adding more stuff to the mmc core.
>
> Good point.
>
> Thanks,
> Rafael
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* E_LOAN APPLICATION**Apply Now**
From: E_LOAN SOLUTION TERM @ 2011-12-16 3:40 UTC (permalink / raw)
We are currently giving out loans to any part of the world at 2% interest rate. If interested, send your name, Resident country and Phone number to Mr. Bernard Thompson with the email address bellow Email:Eloandeskdptuk55@ozledim.net or call: +447045798621
Warmest Regards,
Secretary, Mrs. Kady Hogan.
Copyright © 2011.
^ permalink raw reply
* [PATCH] ARM: mach-shmobile: mackerel: use renesas_usbhs instead of r8a66597_hcd
From: Kuninori Morimoto @ 2011-12-16 1:55 UTC (permalink / raw)
To: linux-sh
Current renesas_usbhs driver can use both USB host/gadget.
This patch removes current r8a66597_hcd driver settings,
and adds renesas_usbhs host driver settings for mackerel USB1 port.
You can still use this port as "gadget" with small modify.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
arch/arm/mach-shmobile/board-mackerel.c | 55 +++++--------------------------
1 files changed, 9 insertions(+), 46 deletions(-)
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 9c5e598..07f8886 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -676,51 +676,16 @@ static struct platform_device usbhs0_device = {
* Use J30 to select between Host and Function. This setting
* can however not be detected by software. Hotplug of USBHS1
* is provided via IRQ8.
+ *
+ * Current USB1 works as "USB Host".
+ * - set J30 "short"
+ *
+ * If you want to use it as "USB gadget",
+ * - J30 "open"
+ * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET
+ * - add .get_vbus = usbhs_get_vbus in usbhs1_private
*/
#define IRQ8 evt2irq(0x0300)
-
-/* USBHS1 USB Host support via r8a66597_hcd */
-static void usb1_host_port_power(int port, int power)
-{
- if (!power) /* only power-on is supported for now */
- return;
-
- /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
- __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
-}
-
-static struct r8a66597_platdata usb1_host_data = {
- .on_chip = 1,
- .port_power = usb1_host_port_power,
-};
-
-static struct resource usb1_host_resources[] = {
- [0] = {
- .name = "USBHS1",
- .start = 0xe68b0000,
- .end = 0xe68b00e6 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = evt2irq(0x1ce0) /* USB1_USB1I0 */,
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device usb1_host_device = {
- .name = "r8a66597_hcd",
- .id = 1,
- .dev = {
- .dma_mask = NULL, /* not use dma */
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &usb1_host_data,
- },
- .num_resources = ARRAY_SIZE(usb1_host_resources),
- .resource = usb1_host_resources,
-};
-
-/* USBHS1 USB Function support via renesas_usbhs */
-
#define USB_PHY_MODE (1 << 4)
#define USB_PHY_INT_EN ((1 << 3) | (1 << 2))
#define USB_PHY_ON (1 << 1)
@@ -776,7 +741,7 @@ static void usbhs1_hardware_exit(struct platform_device *pdev)
static int usbhs1_get_id(struct platform_device *pdev)
{
- return USBHS_GADGET;
+ return USBHS_HOST;
}
static u32 usbhs1_pipe_cfg[] = {
@@ -807,7 +772,6 @@ static struct usbhs_private usbhs1_private = {
.hardware_exit = usbhs1_hardware_exit,
.get_id = usbhs1_get_id,
.phy_reset = usbhs_phy_reset,
- .get_vbus = usbhs_get_vbus,
},
.driver_param = {
.buswait_bwait = 4,
@@ -1299,7 +1263,6 @@ static struct platform_device *mackerel_devices[] __initdata = {
&nor_flash_device,
&smc911x_device,
&lcdc_device,
- &usb1_host_device,
&usbhs1_device,
&usbhs0_device,
&leds_device,
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH v4 REPOST 2/5] ARM: SMP: Refactor Kconfig to be more
From: David Brown @ 2011-12-16 0:31 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1323862781-3465-3-git-send-email-dave.martin@linaro.org>
On Wed, Dec 14, 2011 at 11:39:38AM +0000, Dave Martin wrote:
> Making SMP depend on (huge list of MACH_ and ARCH_ configs) is
> bothersome to maintain and likely to lead to merge conflicts.
>
> This patch moves the knowledge of which platforms are SMP-capable
> to the individual machines. To enable this, a new HAVE_SMP config
> option is introduced to allow machines to indicate that they can
> run in a SMP configuration.
>
> arch/arm/mach-msm/Kconfig | 1 +
Acked-by: David Brown <davidb@codeaurora.org>
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply
* [Update][PATCH 5/5] PM / shmobile: Allow the A4R domain to be turned off at run time
From: Rafael J. Wysocki @ 2011-12-16 0:16 UTC (permalink / raw)
To: Linux-sh list; +Cc: Linux PM list, Guennadi Liakhovetski, Magnus Damm, LKML
In-Reply-To: <201112160110.09124.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
After adding PM QoS constraints for the I2C controller in the A4R
domain, that domain can be allowed to be turned off and on by runtime
PM, so remove the "always on" governor from it.
However, the A4R domain has to be "on" when suspend_device_irqs() and
resume_device_irqs() are executed during system suspend and resume,
respectively, so that those functions don't crash while accessing the
INTCS. For this reason, add a PM notifier to the SH7372 PM code and
make it restore power to A4R before system suspend and remove power
from all unused PM domains after system resume.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/pm-sh7372.c | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
Index: linux/arch/arm/mach-shmobile/pm-sh7372.c
=================================--- linux.orig/arch/arm/mach-shmobile/pm-sh7372.c
+++ linux/arch/arm/mach-shmobile/pm-sh7372.c
@@ -239,7 +239,6 @@ struct sh7372_pm_domain sh7372_d4 = {
struct sh7372_pm_domain sh7372_a4r = {
.genpd.name = "A4R",
.bit_shift = 5,
- .gov = &pm_domain_always_on_gov,
.suspend = sh7372_a4r_suspend,
.resume = sh7372_intcs_resume,
};
@@ -496,9 +495,37 @@ static int sh7372_enter_suspend(suspend_
return 0;
}
+/**
+ * sh7372_pm_notifier_fn - SH7372 PM notifier routine.
+ * @notifier: Unused.
+ * @pm_event: Event being handled.
+ * @unused: Unused.
+ */
+static int sh7372_pm_notifier_fn(struct notifier_block *notifier,
+ unsigned long pm_event, void *unused)
+{
+ switch (pm_event) {
+ case PM_SUSPEND_PREPARE:
+ /*
+ * This is necessary, because the A4R domain has to be "on"
+ * when suspend_device_irqs() and resume_device_irqs() are
+ * executed during system suspend and resume, respectively, so
+ * that those functions don't crash while accessing the INTCS.
+ */
+ pm_genpd_poweron(&sh7372_a4r.genpd);
+ break;
+ case PM_POST_SUSPEND:
+ pm_genpd_poweroff_unused();
+ break;
+ }
+
+ return NOTIFY_DONE;
+}
+
static void sh7372_suspend_init(void)
{
shmobile_suspend_ops.enter = sh7372_enter_suspend;
+ pm_notifier(sh7372_pm_notifier_fn, 0);
}
#else
static void sh7372_suspend_init(void) {}
^ permalink raw reply
* [Update][PATCH 4/5] PM / input / touchscreen: Make st1232 use device PM QoS constraints
From: Rafael J. Wysocki @ 2011-12-16 0:13 UTC (permalink / raw)
To: Linux-sh list; +Cc: Linux PM list, Guennadi Liakhovetski, Magnus Damm, LKML
In-Reply-To: <201112160110.09124.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
Make the st1232 driver use dev_pm_qos_add_ancestor_request() to
add a device PM QoS latency constraint for the controller it
depends on, so that the controller won't go into an overly deep
low-power state when the touchscreen has to be particularly
responsive (e.g. when the user moves his or her finger on it).
This change is based on a prototype patch from Guennadi Liakhovetski.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/input/touchscreen/st1232.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
Index: linux/drivers/input/touchscreen/st1232.c
=================================--- linux.orig/drivers/input/touchscreen/st1232.c
+++ linux/drivers/input/touchscreen/st1232.c
@@ -23,6 +23,7 @@
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/module.h>
+#include <linux/pm_qos.h>
#include <linux/slab.h>
#include <linux/types.h>
@@ -46,6 +47,7 @@ struct st1232_ts_data {
struct i2c_client *client;
struct input_dev *input_dev;
struct st1232_ts_finger finger[MAX_FINGERS];
+ struct dev_pm_qos_request low_latency_req;
};
static int st1232_ts_read_data(struct st1232_ts_data *ts)
@@ -118,8 +120,17 @@ static irqreturn_t st1232_ts_irq_handler
}
/* SYN_MT_REPORT only if no contact */
- if (!count)
+ if (!count) {
input_mt_sync(input_dev);
+ if (ts->low_latency_req.dev) {
+ dev_pm_qos_remove_request(&ts->low_latency_req);
+ ts->low_latency_req.dev = NULL;
+ }
+ } else if (!ts->low_latency_req.dev) {
+ /* First contact, request 100 us latency. */
+ dev_pm_qos_add_ancestor_request(&ts->client->dev,
+ &ts->low_latency_req, 100);
+ }
/* SYN_REPORT */
input_sync(input_dev);
^ permalink raw reply
* [Update][PATCH 3/5] PM / QoS: Introduce dev_pm_qos_add_ancestor_request()
From: Rafael J. Wysocki @ 2011-12-16 0:12 UTC (permalink / raw)
To: Linux-sh list; +Cc: Linux PM list, Guennadi Liakhovetski, Magnus Damm, LKML
In-Reply-To: <201112160110.09124.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
Some devices, like the I2C controller on SH7372, are not
necessary for providing power to their children or forwarding
wakeup signals (and generally interrupts) from them. They are
only needed by their children when there's some data to transfer,
so they may be suspended for the majority of time and resumed
on demand, when the children have data to send or receive. For this
purpose, however, their power.ignore_children flags have to be set,
or the PM core wouldn't allow them to be suspended while their
children were active.
Unfortunately, in some situations it may take too much time to
resume such devices so that they can assist their children in
transferring data. For example, if such a device belongs to a PM
domain which goes to the "power off" state when that device is
suspended, it may take too much time to restore power to the
domain in response to the request from one of the device's
children. In that case, if the parent's resume time is critical,
the domain should stay in the "power on" state, although it still may
be desirable to power manage the parent itself (e.g. by manipulating
its clock).
In general, device PM QoS may be used to address this problem.
Namely, if the device's children added PM QoS latency constraints
for it, they would be able to prevent it from being put into an
overly deep low-power state. However, in some cases the devices
needing to be serviced are not the immediate children of a
"children-ignoring" device, but its grandchildren or even less
direct descendants. In those cases, the entity wanting to add a
PM QoS request for a given device's ancestor that ignores its
children will have to find it in the first place, so introduce a new
helper function that may be used to achieve that. This function,
dev_pm_qos_add_ancestor_request(), will search for the first
ancestor of the given device whose power.ignore_children flag is
set and will add a device PM QoS latency request for that ancestor
on behalf of the caller. The request added this way may be removed
with the help of dev_pm_qos_remove_request() in the future, like
any other device PM QoS latency request.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/base/power/qos.c | 25 +++++++++++++++++++++++++
include/linux/pm_qos.h | 5 +++++
2 files changed, 30 insertions(+)
Index: linux/drivers/base/power/qos.c
=================================--- linux.orig/drivers/base/power/qos.c
+++ linux/drivers/base/power/qos.c
@@ -420,3 +420,28 @@ int dev_pm_qos_remove_global_notifier(st
return blocking_notifier_chain_unregister(&dev_pm_notifiers, notifier);
}
EXPORT_SYMBOL_GPL(dev_pm_qos_remove_global_notifier);
+
+/**
+ * dev_pm_qos_add_ancestor_request - Add PM QoS request for device's ancestor.
+ * @dev: Device whose ancestor to add the request for.
+ * @req: Pointer to the preallocated handle.
+ * @value: Constraint latency value.
+ */
+int dev_pm_qos_add_ancestor_request(struct device *dev,
+ struct dev_pm_qos_request *req, s32 value)
+{
+ struct device *ancestor = dev->parent;
+ int error = -ENODEV;
+
+ while (ancestor && !ancestor->power.ignore_children)
+ ancestor = ancestor->parent;
+
+ if (ancestor)
+ error = dev_pm_qos_add_request(ancestor, req, value);
+
+ if (error)
+ req->dev = NULL;
+
+ return error;
+}
+EXPORT_SYMBOL_GPL(dev_pm_qos_add_ancestor_request);
Index: linux/include/linux/pm_qos.h
=================================--- linux.orig/include/linux/pm_qos.h
+++ linux/include/linux/pm_qos.h
@@ -92,6 +92,8 @@ int dev_pm_qos_add_global_notifier(struc
int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
void dev_pm_qos_constraints_init(struct device *dev);
void dev_pm_qos_constraints_destroy(struct device *dev);
+int dev_pm_qos_add_ancestor_request(struct device *dev,
+ struct dev_pm_qos_request *req, s32 value);
#else
static inline int pm_qos_update_target(struct pm_qos_constraints *c,
struct plist_node *node,
@@ -153,6 +155,9 @@ static inline void dev_pm_qos_constraint
{
dev->power.power_state = PMSG_INVALID;
}
+int dev_pm_qos_add_ancestor_request(struct device *dev,
+ struct dev_pm_qos_request *req, s32 value)
+ { return 0; }
#endif
#endif
^ permalink raw reply
* [Update][PATCH 2/5] PM / shmobile: Remove the stay_on flag from SH7372's PM domains
From: Rafael J. Wysocki @ 2011-12-16 0:12 UTC (permalink / raw)
To: Linux-sh list; +Cc: Linux PM list, Guennadi Liakhovetski, Magnus Damm, LKML
In-Reply-To: <201112160110.09124.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
SH7372 uses two independent mechanisms for ensuring that power
domains will never be turned off: the stay_on flag and the "always
on" domain governor. Moreover, the "always on" governor is only taken
into accout by runtime PM code paths, while the stay_on flag affects
all attempts to turn the given domain off. Thus setting the stay_on
flag causes the "always on" governor to be unnecessary, which is
quite confusing.
However, the stay_on flag is currently only set for the A3SP PM
domain and only if console_suspend_enabled, so it may be replaced
by checking console_suspend_enabled directly in the A3SP's
.suspend() routine. [This requires domain .suspend() to return
a result, but that is a minor modification.]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/include/mach/sh7372.h | 3 --
arch/arm/mach-shmobile/pm-sh7372.c | 36 ++++++++++++---------------
2 files changed, 18 insertions(+), 21 deletions(-)
Index: linux/arch/arm/mach-shmobile/include/mach/sh7372.h
=================================--- linux.orig/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ linux/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -480,11 +480,10 @@ struct platform_device;
struct sh7372_pm_domain {
struct generic_pm_domain genpd;
struct dev_power_governor *gov;
- void (*suspend)(void);
+ int (*suspend)(void);
void (*resume)(void);
unsigned int bit_shift;
bool no_debug;
- bool stay_on;
};
static inline struct sh7372_pm_domain *to_sh7372_pd(struct generic_pm_domain *d)
Index: linux/arch/arm/mach-shmobile/pm-sh7372.c
=================================--- linux.orig/arch/arm/mach-shmobile/pm-sh7372.c
+++ linux/arch/arm/mach-shmobile/pm-sh7372.c
@@ -82,11 +82,12 @@ static int pd_power_down(struct generic_
struct sh7372_pm_domain *sh7372_pd = to_sh7372_pd(genpd);
unsigned int mask = 1 << sh7372_pd->bit_shift;
- if (sh7372_pd->suspend)
- sh7372_pd->suspend();
+ if (sh7372_pd->suspend) {
+ int ret = sh7372_pd->suspend();
- if (sh7372_pd->stay_on)
- return 0;
+ if (ret)
+ return ret;
+ }
if (__raw_readl(PSTR) & mask) {
unsigned int retry_count;
@@ -113,9 +114,6 @@ static int __pd_power_up(struct sh7372_p
unsigned int retry_count;
int ret = 0;
- if (sh7372_pd->stay_on)
- goto out;
-
if (__raw_readl(PSTR) & mask)
goto out;
@@ -148,10 +146,11 @@ static int pd_power_up(struct generic_pm
return __pd_power_up(to_sh7372_pd(genpd), true);
}
-static void sh7372_a4r_suspend(void)
+static int sh7372_a4r_suspend(void)
{
sh7372_intcs_suspend();
__raw_writel(0x300fffff, WUPRMSK); /* avoid wakeup */
+ return 0;
}
static bool pd_active_wakeup(struct device *dev)
@@ -243,7 +242,6 @@ struct sh7372_pm_domain sh7372_a4r = {
.gov = &pm_domain_always_on_gov,
.suspend = sh7372_a4r_suspend,
.resume = sh7372_intcs_resume,
- .stay_on = true,
};
struct sh7372_pm_domain sh7372_a3rv = {
@@ -256,21 +254,23 @@ struct sh7372_pm_domain sh7372_a3ri = {
.bit_shift = 8,
};
+static int sh7372_a3sp_suspend(void)
+{
+ /*
+ * Serial consoles make use of SCIF hardware located in A3SP,
+ * keep such power domain on if "no_console_suspend" is set.
+ */
+ return console_suspend_enabled ? -EBUSY : 0;
+}
+
struct sh7372_pm_domain sh7372_a3sp = {
.genpd.name = "A3SP",
.bit_shift = 11,
.gov = &pm_domain_always_on_gov,
.no_debug = true,
+ .suspend = sh7372_a3sp_suspend,
};
-static void sh7372_a3sp_init(void)
-{
- /* serial consoles make use of SCIF hardware located in A3SP,
- * keep such power domain on if "no_console_suspend" is set.
- */
- sh7372_a3sp.stay_on = !console_suspend_enabled;
-}
-
struct sh7372_pm_domain sh7372_a3sg = {
.genpd.name = "A3SG",
.bit_shift = 13,
@@ -514,8 +514,6 @@ void __init sh7372_pm_init(void)
/* do not convert A3SM, A3SP, A3SG, A4R power down into A4S */
__raw_writel(0, PDNSEL);
- sh7372_a3sp_init();
-
sh7372_suspend_init();
sh7372_cpuidle_init();
}
^ permalink raw reply
* [Update][PATCH 1/5] PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume
From: Rafael J. Wysocki @ 2011-12-16 0:11 UTC (permalink / raw)
To: Linux-sh list; +Cc: Linux PM list, Guennadi Liakhovetski, Magnus Damm, LKML
In-Reply-To: <201112160110.09124.rjw@sisk.pl>
From: Rafael J. Wysocki <rjw@sisk.pl>
Since the SH7372's INTCS in included into syscore suspend/resume,
which causes the chip to be accessed when PM domains have been
turned off during system suspend, the A4R domain containing the
INTCS has to stay on during system sleep, which is suboptimal
from the power consumption point of view.
For this reason, add a new INTC flag, skip_syscore_suspend, to mark
the INTCS for intc_suspend() and intc_resume(), so that they don't
touch it. This allows the A4R domain to be turned off during
system suspend and the INTCS state is resrored during system
resume by the A4R's "power on" code.
Suggested-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Magnus Damm <damm@opensource.se>
---
arch/arm/mach-shmobile/intc-sh7372.c | 1 +
drivers/sh/intc/core.c | 8 ++++++++
drivers/sh/intc/internals.h | 1 +
include/linux/sh_intc.h | 1 +
4 files changed, 11 insertions(+)
Index: linux/include/linux/sh_intc.h
=================================--- linux.orig/include/linux/sh_intc.h
+++ linux/include/linux/sh_intc.h
@@ -95,6 +95,7 @@ struct intc_desc {
unsigned int num_resources;
intc_enum force_enable;
intc_enum force_disable;
+ bool skip_syscore_suspend;
struct intc_hw_desc hw;
};
Index: linux/arch/arm/mach-shmobile/intc-sh7372.c
=================================--- linux.orig/arch/arm/mach-shmobile/intc-sh7372.c
+++ linux/arch/arm/mach-shmobile/intc-sh7372.c
@@ -535,6 +535,7 @@ static struct resource intcs_resources[]
static struct intc_desc intcs_desc __initdata = {
.name = "sh7372-intcs",
.force_enable = ENABLED_INTCS,
+ .skip_syscore_suspend = true,
.resource = intcs_resources,
.num_resources = ARRAY_SIZE(intcs_resources),
.hw = INTC_HW_DESC(intcs_vectors, intcs_groups, intcs_mask_registers,
Index: linux/drivers/sh/intc/core.c
=================================--- linux.orig/drivers/sh/intc/core.c
+++ linux/drivers/sh/intc/core.c
@@ -354,6 +354,8 @@ int __init register_intc_controller(stru
if (desc->force_enable)
intc_enable_disable_enum(desc, d, desc->force_enable, 1);
+ d->skip_suspend = desc->skip_syscore_suspend;
+
nr_intc_controllers++;
return 0;
@@ -386,6 +388,9 @@ static int intc_suspend(void)
list_for_each_entry(d, &intc_list, list) {
int irq;
+ if (d->skip_suspend)
+ continue;
+
/* enable wakeup irqs belonging to this intc controller */
for_each_active_irq(irq) {
struct irq_data *data;
@@ -409,6 +414,9 @@ static void intc_resume(void)
list_for_each_entry(d, &intc_list, list) {
int irq;
+ if (d->skip_suspend)
+ continue;
+
for_each_active_irq(irq) {
struct irq_data *data;
struct irq_chip *chip;
Index: linux/drivers/sh/intc/internals.h
=================================--- linux.orig/drivers/sh/intc/internals.h
+++ linux/drivers/sh/intc/internals.h
@@ -67,6 +67,7 @@ struct intc_desc_int {
struct intc_window *window;
unsigned int nr_windows;
struct irq_chip chip;
+ bool skip_suspend;
};
^ permalink raw reply
* [Update][PATCH 0/5] PM / shmobile: Use PM QoS latency constraints in touchscreen driver on SH7372
From: Rafael J. Wysocki @ 2011-12-16 0:10 UTC (permalink / raw)
To: Linux-sh list; +Cc: Linux PM list, Guennadi Liakhovetski, Magnus Damm, LKML
In-Reply-To: <201112100042.45168.rjw@sisk.pl>
Hi,
I have reworked the patchset slightly.
On Saturday, December 10, 2011, Rafael J. Wysocki wrote:
>
> The following series of patches updates the SH7372 PM domain's so that
> A4R doesn't need to be turned on during system sleep, drops the SH7372's
> PM domains stay_on flag and makes the touchscreen add a PM QoS constraint
> on its I2C controller to prevent the A4R domain containing it from being
> turned off (due to power management) when the touchscreen is active.
The first two patches are unchaged (apart from the Magnus' ACKs), as well
as the third one. The fourth one, though, has been split as suggested by
Guennadi and the touchscreen part has been simplified slightly.
[1/5] - Don't include SH7372's INTCS in syscore suspend/resume.
[2/5] - Remove the stay_on flag from SH7372's PM domains.
[3/5] - Introduce dev_pm_qos_add_ancestor_request().
[4/5] - Make st1232 use device PM QoS constraints.
[5/5] - Allow the A4R domain to be turned off and on at runtime.
Thanks,
Rafael
^ permalink raw reply
* Re: [PATCH 34/57] fbdev: sh_mobile_lcdc: Store the format in struct
From: Guennadi Liakhovetski @ 2011-12-15 22:29 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-35-git-send-email-laurent.pinchart@ideasonboard.com>
On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> Store the active format in the channel structure, and use it instead of
> parsing info->var all over the place when the format is needed.
Right, this is what I was wondering about, while looking at the previous
patch:-) But:
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/video/sh_mobile_lcdcfb.c | 21 ++++++++++-----------
> drivers/video/sh_mobile_lcdcfb.h | 4 +++-
> 2 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index c6b6b9d..9829e01 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
[snip]
> @@ -1350,6 +1345,8 @@ static int sh_mobile_set_par(struct fb_info *info)
> info->fix.line_length = info->var.xres
> * info->var.bits_per_pixel / 8;
>
> + ch->format = sh_mobile_format_info(sh_mobile_format_fourcc(&info->var));
Cannot this be NULL? As far as I could trace it back, I'm not sure with
hotplug bits_per_pixel would be initialised correctly along the lines of
sh_mobile_fb_reconfig().
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* Re: [PATCH 33/57] fbdev: sh_mobile_lcdc: Add sh_mobile_format_info()
From: Guennadi Liakhovetski @ 2011-12-15 22:17 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-34-git-send-email-laurent.pinchart@ideasonboard.com>
On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> The function returns a pointer to a structure describing a format based
> on its fourcc. Use the function where applicable instead of hardcoded
> switch-case statements.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/video/sh_mobile_lcdcfb.c | 174 ++++++++++++++++++++++----------------
> 1 files changed, 102 insertions(+), 72 deletions(-)
>
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index 3bc82ae..c6b6b9d 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
[snip]
> @@ -665,37 +726,20 @@ static void __sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv)
>
> /* Setup geometry, format, frame buffer memory and operation mode. */
> for (k = 0; k < ARRAY_SIZE(priv->ch); k++) {
> + const struct sh_mobile_lcdc_format_info *format;
> + u32 fourcc;
> +
> ch = &priv->ch[k];
> if (!ch->enabled)
> continue;
>
> sh_mobile_lcdc_geometry(ch);
>
> - switch (sh_mobile_format_fourcc(&ch->info->var)) {
> - case V4L2_PIX_FMT_RGB565:
> - tmp = LDDFR_PKF_RGB16;
> - break;
> - case V4L2_PIX_FMT_BGR24:
> - tmp = LDDFR_PKF_RGB24;
> - break;
> - case V4L2_PIX_FMT_BGR32:
> - tmp = LDDFR_PKF_ARGB32;
> - break;
> - case V4L2_PIX_FMT_NV12:
> - case V4L2_PIX_FMT_NV21:
> - tmp = LDDFR_CC | LDDFR_YF_420;
> - break;
> - case V4L2_PIX_FMT_NV16:
> - case V4L2_PIX_FMT_NV61:
> - tmp = LDDFR_CC | LDDFR_YF_422;
> - break;
> - case V4L2_PIX_FMT_NV24:
> - case V4L2_PIX_FMT_NV42:
> - tmp = LDDFR_CC | LDDFR_YF_444;
> - break;
> - }
> + fourcc = sh_mobile_format_fourcc(&ch->info->var);
> + format = sh_mobile_format_info(fourcc);
> + tmp = format->lddfr;
Why don't you just store a pointer to the selected format struct per
channel in sh_mobile_lcdc_channel_init() to avoid recalculation here? If
OTOH this can be a new info here from a hotplug event, the above risks an
Oops?
>
> - if (sh_mobile_format_is_yuv(&ch->info->var)) {
> + if (format->yuv) {
> switch (ch->info->var.colorspace) {
> case V4L2_COLORSPACE_REC709:
> tmp |= LDDFR_CF1;
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* Re: [PATCH 27/57] fbdev: sh_mobile_lcdc: Pass a video mode to the
From: Guennadi Liakhovetski @ 2011-12-15 19:01 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-28-git-send-email-laurent.pinchart@ideasonboard.com>
On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> Pass pointers to struct fb_videomode and struct fb_monspecs instead of
> struct fb_var_screeninfo to the notify callback.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/video/sh_mobile_hdmi.c | 59 +++++++++++++++++--------------------
> drivers/video/sh_mobile_lcdcfb.c | 40 ++++++++++++++-----------
> drivers/video/sh_mobile_lcdcfb.h | 3 +-
> 3 files changed, 51 insertions(+), 51 deletions(-)
[snip]
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index 21e5f10..4ec216e 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
[ditto]
> @@ -433,12 +432,17 @@ static int sh_mobile_lcdc_display_notify(struct sh_mobile_lcdc_chan *ch,
> }
> break;
>
> - case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE:
> + case SH_MOBILE_LCDC_EVENT_DISPLAY_MODE: {
> + struct fb_var_screeninfo var;
> +
> /* Validate a proposed new mode */
> - var->bits_per_pixel = info->var.bits_per_pixel;
> - ret = info->fbops->fb_check_var(var, info);
> + fb_videomode_to_var(&var, mode);
> + var.bits_per_pixel = info->var.bits_per_pixel;
> + var.grayscale = info->var.grayscale;
> + ret = info->fbops->fb_check_var(&var, info);
> break;
> }
> + }
nitpick - please, realign:-)
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* Re: [PATCH v4 REPOST 2/5] ARM: SMP: Refactor Kconfig to be more
From: David Brown @ 2011-12-15 18:14 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1323862781-3465-3-git-send-email-dave.martin@linaro.org>
On Wed, Dec 14, 2011 at 11:39:38AM +0000, Dave Martin wrote:
> Making SMP depend on (huge list of MACH_ and ARCH_ configs) is
> bothersome to maintain and likely to lead to merge conflicts.
>
> This patch moves the knowledge of which platforms are SMP-capable
> to the individual machines. To enable this, a new HAVE_SMP config
> option is introduced to allow machines to indicate that they can
> run in a SMP configuration.
There still seem to be several people and lists from the
get_maintainer.pl output that are missing. Russell should be
included, as well as the MSM maintainers and that list.
David
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply
* Re: [PATCH 24/57] fbdev: sh_mobile_lcdc: Return display connection
From: Guennadi Liakhovetski @ 2011-12-15 17:11 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-25-git-send-email-laurent.pinchart@ideasonboard.com>
On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> Return true if the display is connected and false otherwise. Set the fb
> info state to FBINFO_STATE_SUSPENDED in the sh_mobile_lcdc driver when
> the display is not connected.
Hmm... I'm not sure I like functions, that return either a negative error,
or _several_ non-negative success values. How about returning -ENODEV?
Thanks
Guennadi
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/video/sh_mipi_dsi.c | 2 +-
> drivers/video/sh_mobile_hdmi.c | 9 +++++----
> drivers/video/sh_mobile_lcdcfb.c | 3 +++
> drivers/video/sh_mobile_lcdcfb.h | 3 +++
> 4 files changed, 12 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/sh_mipi_dsi.c b/drivers/video/sh_mipi_dsi.c
> index 1ede247..5ff3742 100644
> --- a/drivers/video/sh_mipi_dsi.c
> +++ b/drivers/video/sh_mipi_dsi.c
> @@ -412,7 +412,7 @@ static int mipi_display_on(struct sh_mobile_lcdc_entity *entity)
>
> sh_mipi_dsi_enable(mipi, true);
>
> - return 0;
> + return SH_MOBILE_LCDC_DISPLAY_CONNECTED;
>
> mipi_display_on_fail1:
> pm_runtime_put_sync(&mipi->pdev->dev);
> diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c
> index c22e123..1464abf 100644
> --- a/drivers/video/sh_mobile_hdmi.c
> +++ b/drivers/video/sh_mobile_hdmi.c
> @@ -1004,9 +1004,9 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity)
> {
> struct sh_hdmi *hdmi = entity_to_sh_hdmi(entity);
> struct sh_mobile_lcdc_chan *ch = entity->lcdc;
> - struct fb_info *info = ch->info;
>
> - dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi, info->state);
> + dev_dbg(hdmi->dev, "%s(%p): state %x\n", __func__, hdmi,
> + hdmi->hp_state);
>
> /*
> * hp_state can be set to
> @@ -1021,12 +1021,13 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity)
> dev_dbg(hdmi->dev, "HDMI running\n");
> break;
> case HDMI_HOTPLUG_DISCONNECTED:
> - info->state = FBINFO_STATE_SUSPENDED;
> default:
> hdmi->var = ch->display_var;
> }
>
> - return 0;
> + return hdmi->hp_state = HDMI_HOTPLUG_DISCONNECTED
> + ? SH_MOBILE_LCDC_DISPLAY_DISCONNECTED
> + : SH_MOBILE_LCDC_DISPLAY_CONNECTED;
> }
>
> static void sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index 47108aa..4b03aa5 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
> @@ -342,6 +342,9 @@ static void sh_mobile_lcdc_display_on(struct sh_mobile_lcdc_chan *ch)
> ret = ch->tx_dev->ops->display_on(ch->tx_dev);
> if (ret < 0)
> return;
> +
> + if (ret = SH_MOBILE_LCDC_DISPLAY_DISCONNECTED)
> + ch->info->state = FBINFO_STATE_SUSPENDED;
> }
>
> /* HDMI must be enabled before LCDC configuration */
> diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
> index b2cb8e6..6fb956c 100644
> --- a/drivers/video/sh_mobile_lcdcfb.h
> +++ b/drivers/video/sh_mobile_lcdcfb.h
> @@ -21,6 +21,9 @@ struct sh_mobile_lcdc_entity;
> struct sh_mobile_lcdc_priv;
> struct sh_mobile_lcdc_chan;
>
> +#define SH_MOBILE_LCDC_DISPLAY_DISCONNECTED 0
> +#define SH_MOBILE_LCDC_DISPLAY_CONNECTED 1
> +
> struct sh_mobile_lcdc_entity_ops {
> /* Display */
> int (*display_on)(struct sh_mobile_lcdc_entity *entity);
> --
> 1.7.3.4
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* Re: [PATCH 21/57] sh_mobile_lcdc: Add an lcdc channel pointer to
From: Guennadi Liakhovetski @ 2011-12-15 16:16 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1323784972-24205-22-git-send-email-laurent.pinchart@ideasonboard.com>
Hi Laurent
On Tue, 13 Dec 2011, Laurent Pinchart wrote:
> The field will be used by the transmitter drivers to access
> sh_mobile_lcdc_chan fields such as fb_info.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/video/sh_mobile_lcdcfb.c | 5 ++++-
> drivers/video/sh_mobile_lcdcfb.h | 2 ++
> 2 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
> index cb5ea3c..2dccfde 100644
> --- a/drivers/video/sh_mobile_lcdcfb.c
> +++ b/drivers/video/sh_mobile_lcdcfb.c
> @@ -1497,8 +1497,10 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
> if (!info || !info->device)
> continue;
>
> - if (ch->tx_dev)
> + if (ch->tx_dev) {
> + ch->tx_dev->lcdc = NULL;
> module_put(ch->cfg.tx_dev->dev.driver->owner);
> + }
>
> if (ch->sglist)
> vfree(ch->sglist);
> @@ -1608,6 +1610,7 @@ sh_mobile_lcdc_channel_init(struct sh_mobile_lcdc_priv *priv,
> return -EINVAL;
> }
> ch->tx_dev = platform_get_drvdata(cfg->tx_dev);
> + ch->tx_dev->lcdc = ch;
I do not have a kernel, patched with your patches up to 20/57;-) so, I
cannot verify - can ch->tx_dev at this point not be NULL?
> }
>
> /* Iterate through the modes to validate them and find the highest
> diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h
> index 9601b92..36cd564 100644
> --- a/drivers/video/sh_mobile_lcdcfb.h
> +++ b/drivers/video/sh_mobile_lcdcfb.h
> @@ -19,6 +19,7 @@ struct fb_info;
> struct module;
> struct sh_mobile_lcdc_entity;
> struct sh_mobile_lcdc_priv;
> +struct sh_mobile_lcdc_chan;
>
> struct sh_mobile_lcdc_entity_ops {
> /* Display */
> @@ -30,6 +31,7 @@ struct sh_mobile_lcdc_entity_ops {
> struct sh_mobile_lcdc_entity {
> struct module *owner;
> const struct sh_mobile_lcdc_entity_ops *ops;
> + struct sh_mobile_lcdc_chan *lcdc;
> };
>
> /*
> --
> 1.7.3.4
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply
* [PATCH v5 5/5] imx6q: Remove unconditional dependency on l2x0 L2 cache support
From: Dave Martin @ 2011-12-15 15:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1323964434-6764-1-git-send-email-dave.martin@linaro.org>
The i.MX6 Quad SoC will work without the l2x0 L2 cache controller
support built into the kernel, so this patch removes the dependency
on CACHE_L2X0.
This makes the l2x0 support optional, so that it can be turned off
when desired for debugging purposes etc.
Since SOC_IMX6Q already depends on ARCH_IMX_V6_V7 and
ARCH_IMX_V6_V7 selects MIGHT_HAVE_CACHE_L2X0, there is no need to
select that option explicitly from SOC_IMX6Q.
Thanks to Shawn Guo for this suggestion. [1]
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2011-November/074602.html
Signed-off-by: Dave Martin <dave.martin@linaro.org>
---
Changes:
v5: Don't select MIGHT_HAVE_CACHE_L2X0 directly from SOC_IMX6Q, but
instead select implicitly via ARCH_IMX_V6_V7 (which we expect
to be selected by other relevant SoCs). Thanks to Shawn for
this suggestion.
arch/arm/mach-imx/Kconfig | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 29a3d61..1530678 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -609,7 +609,6 @@ comment "i.MX6 family:"
config SOC_IMX6Q
bool "i.MX6 Quad support"
select ARM_GIC
- select CACHE_L2X0
select CPU_V7
select HAVE_ARM_SCU
select HAVE_IMX_GPC
--
1.7.4.1
^ permalink raw reply related
* [PATCH v5 4/5] highbank: Unconditionally require l2x0 L2 cache controller support
From: Dave Martin @ 2011-12-15 15:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1323964434-6764-1-git-send-email-dave.martin@linaro.org>
If running in the Normal World on a TrustZone-enabled SoC, Linux
does not have complete control over the L2 cache controller
configuration. The kernel cannot work reliably on such platforms
without the l2x0 cache support code built in.
This patch unconditionally enables l2x0 support for the Highbank
SoC.
Thanks to Rob Herring for this suggestion. [1]
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2011-November/074495.html
Signed-off-by: Dave Martin <dave.martin@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
---
arch/arm/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index eca82f9..1792146 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -340,12 +340,12 @@ config ARCH_HIGHBANK
select ARM_AMBA
select ARM_GIC
select ARM_TIMER_SP804
+ select CACHE_L2X0
select CLKDEV_LOOKUP
select CPU_V7
select GENERIC_CLOCKEVENTS
select HAVE_ARM_SCU
select HAVE_SMP
- select MIGHT_HAVE_CACHE_L2X0
select USE_OF
help
Support for the Calxeda Highbank SoC based boards.
--
1.7.4.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox