All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Jimmy Rubin <jimmy.rubin@stericsson.com>,
	linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org,
	Dan Johansson <dan.johansson@stericsson.com>,
	Linus Walleij <linus.walleij@stericsson.com>
Subject: Re: [PATCH 10/10] ux500: MCDE: Add platform specific data
Date: Fri, 12 Nov 2010 17:03:52 +0100	[thread overview]
Message-ID: <201011121703.52422.arnd@arndb.de> (raw)
In-Reply-To: <1289390653-6111-11-git-send-email-jimmy.rubin@stericsson.com>

On Wednesday 10 November 2010, Jimmy Rubin wrote:
> +
> +	if (ddev->id == PRIMARY_DISPLAY_ID && rotate_main) {
> +		swap(width, height);
> +#ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY_ROTATE_180_DEGREES
> +		rotate = FB_ROTATE_CCW;
> +#else
> +		rotate = FB_ROTATE_CW;
> +#endif
> +	}
> +
> +	virtual_width = width;
> +	virtual_height = height * 2;
> +#ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY_AUTO_SYNC
> +	if (ddev->id == PRIMARY_DISPLAY_ID)
> +		virtual_height = height;
> +#endif
> +

The contents of the hardware description should really not
be configuration dependent, because that breaks booting the same
kernel on machines that have different requirements.

This is something that should be passed down from the boot loader.

> +static void mcde_epod_enable(void)
> +{
> +	/* Power on DSS mem */
> +	writel(PRCMU_ENABLE_DSS_MEM, PRCM_EPOD_C_SET);
> +	mdelay(PRCMU_MCDE_DELAY);
> +	/* Power on DSS logic */
> +	writel(PRCMU_ENABLE_DSS_LOGIC, PRCM_EPOD_C_SET);
> +	mdelay(PRCMU_MCDE_DELAY);
> +}

In general, try to avoid using mdelay. Keeping the CPU busy for miliseconds
or even microseconds for no reason is just wrong.

Reasonable hardware will not require this and do the right thing anyway.
multiple writel calls are by design strictly ordered on the bus. If that is
not the case on your hardware, you should find a proper way to ensure
ordering and create a small wrapper for it with a comment that explains
the breakage. Better get the hardware designers to fix their crap before
releasing a product ;-)

If there is not even a way to reorder I/O by accessing other registers,
use msleep() to let the CPU do something useful in the meantime and complain
even more to the HW people.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 10/10] ux500: MCDE: Add platform specific data
Date: Fri, 12 Nov 2010 16:03:52 +0000	[thread overview]
Message-ID: <201011121703.52422.arnd@arndb.de> (raw)
In-Reply-To: <1289390653-6111-11-git-send-email-jimmy.rubin@stericsson.com>

On Wednesday 10 November 2010, Jimmy Rubin wrote:
> +
> +	if (ddev->id = PRIMARY_DISPLAY_ID && rotate_main) {
> +		swap(width, height);
> +#ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY_ROTATE_180_DEGREES
> +		rotate = FB_ROTATE_CCW;
> +#else
> +		rotate = FB_ROTATE_CW;
> +#endif
> +	}
> +
> +	virtual_width = width;
> +	virtual_height = height * 2;
> +#ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY_AUTO_SYNC
> +	if (ddev->id = PRIMARY_DISPLAY_ID)
> +		virtual_height = height;
> +#endif
> +

The contents of the hardware description should really not
be configuration dependent, because that breaks booting the same
kernel on machines that have different requirements.

This is something that should be passed down from the boot loader.

> +static void mcde_epod_enable(void)
> +{
> +	/* Power on DSS mem */
> +	writel(PRCMU_ENABLE_DSS_MEM, PRCM_EPOD_C_SET);
> +	mdelay(PRCMU_MCDE_DELAY);
> +	/* Power on DSS logic */
> +	writel(PRCMU_ENABLE_DSS_LOGIC, PRCM_EPOD_C_SET);
> +	mdelay(PRCMU_MCDE_DELAY);
> +}

In general, try to avoid using mdelay. Keeping the CPU busy for miliseconds
or even microseconds for no reason is just wrong.

Reasonable hardware will not require this and do the right thing anyway.
multiple writel calls are by design strictly ordered on the bus. If that is
not the case on your hardware, you should find a proper way to ensure
ordering and create a small wrapper for it with a comment that explains
the breakage. Better get the hardware designers to fix their crap before
releasing a product ;-)

If there is not even a way to reorder I/O by accessing other registers,
use msleep() to let the CPU do something useful in the meantime and complain
even more to the HW people.

	Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 10/10] ux500: MCDE: Add platform specific data
Date: Fri, 12 Nov 2010 17:03:52 +0100	[thread overview]
Message-ID: <201011121703.52422.arnd@arndb.de> (raw)
In-Reply-To: <1289390653-6111-11-git-send-email-jimmy.rubin@stericsson.com>

On Wednesday 10 November 2010, Jimmy Rubin wrote:
> +
> +	if (ddev->id == PRIMARY_DISPLAY_ID && rotate_main) {
> +		swap(width, height);
> +#ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY_ROTATE_180_DEGREES
> +		rotate = FB_ROTATE_CCW;
> +#else
> +		rotate = FB_ROTATE_CW;
> +#endif
> +	}
> +
> +	virtual_width = width;
> +	virtual_height = height * 2;
> +#ifdef CONFIG_DISPLAY_GENERIC_DSI_PRIMARY_AUTO_SYNC
> +	if (ddev->id == PRIMARY_DISPLAY_ID)
> +		virtual_height = height;
> +#endif
> +

The contents of the hardware description should really not
be configuration dependent, because that breaks booting the same
kernel on machines that have different requirements.

This is something that should be passed down from the boot loader.

> +static void mcde_epod_enable(void)
> +{
> +	/* Power on DSS mem */
> +	writel(PRCMU_ENABLE_DSS_MEM, PRCM_EPOD_C_SET);
> +	mdelay(PRCMU_MCDE_DELAY);
> +	/* Power on DSS logic */
> +	writel(PRCMU_ENABLE_DSS_LOGIC, PRCM_EPOD_C_SET);
> +	mdelay(PRCMU_MCDE_DELAY);
> +}

In general, try to avoid using mdelay. Keeping the CPU busy for miliseconds
or even microseconds for no reason is just wrong.

Reasonable hardware will not require this and do the right thing anyway.
multiple writel calls are by design strictly ordered on the bus. If that is
not the case on your hardware, you should find a proper way to ensure
ordering and create a small wrapper for it with a comment that explains
the breakage. Better get the hardware designers to fix their crap before
releasing a product ;-)

If there is not even a way to reorder I/O by accessing other registers,
use msleep() to let the CPU do something useful in the meantime and complain
even more to the HW people.

	Arnd

  reply	other threads:[~2010-11-12 16:03 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10 12:04 [PATCH 00/10] MCDE: Add frame buffer device driver Jimmy Rubin
2010-11-10 12:04 ` Jimmy Rubin
2010-11-10 12:04 ` Jimmy Rubin
2010-11-10 12:04 ` [PATCH 01/10] MCDE: Add hardware abstraction layer Jimmy Rubin
2010-11-10 12:04   ` Jimmy Rubin
2010-11-10 12:04   ` Jimmy Rubin
2010-11-10 12:04   ` [PATCH 02/10] MCDE: Add configuration registers Jimmy Rubin
2010-11-10 12:04     ` Jimmy Rubin
2010-11-10 12:04     ` Jimmy Rubin
2010-11-10 12:04     ` [PATCH 03/10] MCDE: Add pixel processing registers Jimmy Rubin
2010-11-10 12:04       ` Jimmy Rubin
2010-11-10 12:04       ` Jimmy Rubin
2010-11-10 12:04       ` [PATCH 04/10] MCDE: Add formatter registers Jimmy Rubin
2010-11-10 12:04         ` Jimmy Rubin
2010-11-10 12:04         ` Jimmy Rubin
2010-11-10 12:04         ` [PATCH 05/10] MCDE: Add dsi link registers Jimmy Rubin
2010-11-10 12:04           ` Jimmy Rubin
2010-11-10 12:04           ` Jimmy Rubin
2010-11-10 12:04           ` [PATCH 06/10] MCDE: Add generic display Jimmy Rubin
2010-11-10 12:04             ` Jimmy Rubin
2010-11-10 12:04             ` Jimmy Rubin
2010-11-10 12:04             ` [PATCH 07/10] MCDE: Add display subsystem framework Jimmy Rubin
2010-11-10 12:04               ` Jimmy Rubin
2010-11-10 12:04               ` Jimmy Rubin
2010-11-10 12:04               ` [PATCH 08/10] MCDE: Add frame buffer device Jimmy Rubin
2010-11-10 12:04                 ` Jimmy Rubin
2010-11-10 12:04                 ` Jimmy Rubin
2010-11-10 12:04                 ` [PATCH 09/10] MCDE: Add build files and bus Jimmy Rubin
2010-11-10 12:04                   ` Jimmy Rubin
2010-11-10 12:04                   ` Jimmy Rubin
2010-11-10 12:04                   ` [PATCH 10/10] ux500: MCDE: Add platform specific data Jimmy Rubin
2010-11-10 12:04                     ` Jimmy Rubin
2010-11-10 12:04                     ` Jimmy Rubin
2010-11-12 16:03                     ` Arnd Bergmann [this message]
2010-11-12 16:03                       ` Arnd Bergmann
2010-11-12 16:03                       ` Arnd Bergmann
2010-11-25 11:20                       ` Jimmy RUBIN
2010-11-25 11:20                         ` Jimmy RUBIN
2010-11-12 16:23                   ` [PATCH 09/10] MCDE: Add build files and bus Arnd Bergmann
2010-11-12 16:23                     ` Arnd Bergmann
2010-11-12 16:23                     ` Arnd Bergmann
2010-11-12 16:29                 ` [PATCH 08/10] MCDE: Add frame buffer device Arnd Bergmann
2010-11-12 16:29                   ` Arnd Bergmann
2010-11-12 16:29                   ` Arnd Bergmann
2010-11-25 11:52                   ` Jimmy RUBIN
2010-11-25 11:52                     ` Jimmy RUBIN
2010-11-12 16:38               ` [PATCH 07/10] MCDE: Add display subsystem framework Arnd Bergmann
2010-11-12 16:38                 ` Arnd Bergmann
2010-11-12 16:38                 ` Arnd Bergmann
2010-11-25  7:16                 ` Jimmy RUBIN
2010-11-25  7:16                   ` Jimmy RUBIN
2010-11-12 15:46       ` [PATCH 03/10] MCDE: Add pixel processing registers Arnd Bergmann
2010-11-12 15:46         ` Arnd Bergmann
2010-11-12 15:46         ` Arnd Bergmann
2010-11-12 15:14     ` [PATCH 02/10] MCDE: Add configuration registers Arnd Bergmann
2010-11-12 15:14       ` Arnd Bergmann
2010-11-12 15:14       ` Arnd Bergmann
2010-11-12 15:34       ` Russell King - ARM Linux
2010-11-12 15:34         ` Russell King - ARM Linux
2010-11-12 15:34         ` Russell King - ARM Linux
2010-11-15 14:25         ` Arnd Bergmann
2010-11-15 14:25           ` Arnd Bergmann
2010-11-15 14:25           ` Arnd Bergmann
2010-11-15 14:59           ` Russell King - ARM Linux
2010-11-15 14:59             ` Russell King - ARM Linux
2010-11-15 14:59             ` Russell King - ARM Linux
2010-11-15 18:24             ` Geert Uytterhoeven
2010-11-15 18:24               ` Geert Uytterhoeven
2010-11-15 18:24               ` Geert Uytterhoeven
2010-11-25 11:30       ` Jimmy RUBIN
2010-11-25 11:30         ` Jimmy RUBIN
2010-11-25 16:21         ` Arnd Bergmann
2010-11-25 16:21           ` Arnd Bergmann
2010-11-10 17:14   ` [PATCH 01/10] MCDE: Add hardware abstraction layer Joe Perches
2010-11-10 17:14     ` Joe Perches
2010-11-10 17:14     ` Joe Perches
2010-11-15  9:52     ` Jimmy RUBIN
2010-11-15  9:52       ` Jimmy RUBIN
2010-11-15  9:52       ` Jimmy RUBIN
2010-11-15 16:30       ` Joe Perches
2010-11-15 16:30         ` Joe Perches
2010-11-15 16:30         ` Joe Perches
2010-11-12 15:43   ` Arnd Bergmann
2010-11-12 15:43     ` Arnd Bergmann
2010-11-12 15:43     ` Arnd Bergmann
2010-11-16 15:29     ` Jimmy RUBIN
2010-11-16 15:29       ` Jimmy RUBIN
2010-11-16 15:29       ` Jimmy RUBIN
2010-11-16 16:12       ` Arnd Bergmann
2010-11-16 16:12         ` Arnd Bergmann
2010-11-16 16:12         ` Arnd Bergmann
2010-11-16 16:16         ` Arnd Bergmann
2010-11-16 16:16           ` Arnd Bergmann
2010-11-16 16:16           ` Arnd Bergmann
2010-11-16 19:46       ` Joe Perches
2010-11-16 19:46         ` Joe Perches
2010-11-16 19:46         ` Joe Perches
2010-11-17  9:55         ` Arnd Bergmann
2010-11-17  9:55           ` Arnd Bergmann
2010-11-17  9:55           ` Arnd Bergmann
2010-11-17 16:01           ` Joe Perches
2010-11-17 16:01             ` Joe Perches
2010-11-17 16:01             ` Joe Perches
2010-11-10 14:42 ` [PATCH 00/10] MCDE: Add frame buffer device driver Alex Deucher
2010-11-10 14:42   ` Alex Deucher
2010-11-10 14:42   ` Alex Deucher
2010-11-12 13:18   ` Jimmy RUBIN
2010-11-12 13:18     ` Jimmy RUBIN
2010-11-12 13:18     ` Jimmy RUBIN
2010-11-12 15:52     ` Alex Deucher
2010-11-12 15:52       ` Alex Deucher
2010-11-12 15:52       ` Alex Deucher
2010-11-12 16:46       ` Marcus LORENTZON
2010-11-12 16:46         ` Marcus LORENTZON
2010-11-12 16:46         ` Marcus LORENTZON
2010-11-12 17:22         ` Alex Deucher
2010-11-12 17:22           ` Alex Deucher
2010-11-12 17:22           ` Alex Deucher
2010-11-15 11:05           ` Michel Dänzer
2010-11-15 11:05             ` Michel Dänzer
2010-11-15 11:05             ` Michel Dänzer
2010-11-13 11:54         ` Hans Verkuil
2010-11-13 11:54           ` Hans Verkuil
2010-11-13 11:54           ` Hans Verkuil
2010-11-13 17:26           ` Marcus LORENTZON
2010-11-13 17:26             ` Marcus LORENTZON
2010-11-13 17:26             ` Marcus LORENTZON
2010-11-13 17:57             ` Hans Verkuil
2010-11-13 17:57               ` Hans Verkuil
2010-11-13 17:57               ` Hans Verkuil

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=201011121703.52422.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=dan.johansson@stericsson.com \
    --cc=jimmy.rubin@stericsson.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-media@vger.kernel.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 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.