All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@stericsson.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH 10/14] mmc: mmci: Cache MMCICLOCK and MMCIPOWER register
Date: Mon, 9 Jan 2012 12:46:09 +0100	[thread overview]
Message-ID: <4F0AD381.9020105@stericsson.com> (raw)
In-Reply-To: <20120108102533.GA21765@n2100.arm.linux.org.uk>

Russell King - ARM Linux wrote:
> On Mon, Dec 05, 2011 at 06:35:56PM +0100, Ulf Hansson wrote:
>> Instead of reading a register value everytime we need to
>> apply a new value for it, maintain a cached copy for it.
>> This also means we are able to skip writes that are not
>> needed.
> 
> I'm not sure this is a good idea.  The ARM Primecells require a certain
> number of bus clocks and MCLK periods between writes to both these
> registers, and reading them back helps to ensure that we conform to
> that requirement.  Maintaining a cached copy of them allows faster
> writes to these registers which could cause that requirement to be
> violated.

You are definitely right. But how do we know that reading the register 
value is enough?

> 
> What you could do is read the register, modify, and check whether the
> modification has had any effect before writing it back.  That will
> allow unnecessary writes to still be skipped.
> 

That could work. Do you want me to fixup the patch to include this "read 
before write" mechanism then?

BR
Ulf Hansson

WARNING: multiple messages have this Message-ID (diff)
From: ulf.hansson@stericsson.com (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 10/14] mmc: mmci: Cache MMCICLOCK and MMCIPOWER register
Date: Mon, 9 Jan 2012 12:46:09 +0100	[thread overview]
Message-ID: <4F0AD381.9020105@stericsson.com> (raw)
In-Reply-To: <20120108102533.GA21765@n2100.arm.linux.org.uk>

Russell King - ARM Linux wrote:
> On Mon, Dec 05, 2011 at 06:35:56PM +0100, Ulf Hansson wrote:
>> Instead of reading a register value everytime we need to
>> apply a new value for it, maintain a cached copy for it.
>> This also means we are able to skip writes that are not
>> needed.
> 
> I'm not sure this is a good idea.  The ARM Primecells require a certain
> number of bus clocks and MCLK periods between writes to both these
> registers, and reading them back helps to ensure that we conform to
> that requirement.  Maintaining a cached copy of them allows faster
> writes to these registers which could cause that requirement to be
> violated.

You are definitely right. But how do we know that reading the register 
value is enough?

> 
> What you could do is read the register, modify, and check whether the
> modification has had any effect before writing it back.  That will
> allow unnecessary writes to still be skipped.
> 

That could work. Do you want me to fixup the patch to include this "read 
before write" mechanism then?

BR
Ulf Hansson

  reply	other threads:[~2012-01-09 11:46 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05 17:35 [PATCH 00/14] mmc: mmci: Improved PM support, cleanup and bugfixes Ulf Hansson
2011-12-05 17:35 ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 01/14] mmc: mmci: Support MMC_PM_KEEP_POWER Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 02/14] mmc: mmci: Fixup handling of MCI_STARTBITERR Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-18 23:15   ` Russell King - ARM Linux
2011-12-18 23:15     ` Russell King - ARM Linux
2011-12-19  8:59     ` Ulf Hansson
2011-12-19  8:59       ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 03/14] mmc: mmci: Increase max_segs from 16 to 128 Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 04/14] mmc: mmci: Do not release spinlock in request_end Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 05/14] mmc: mmci: Put power register deviations in variant data Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 06/14] mmc: mmci: Provide option to configure bus signal direction Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 07/14] mmc: mmci: Change vdd_handler to a generic ios_handler Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 08/14] mmc: mmci: Fixup error handling for dma Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-18 23:16   ` Russell King - ARM Linux
2011-12-18 23:16     ` Russell King - ARM Linux
2011-12-19  8:59     ` Ulf Hansson
2011-12-19  8:59       ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 09/14] mmc: mmci: Change from using legacy suspend Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 10/14] mmc: mmci: Cache MMCICLOCK and MMCIPOWER register Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2012-01-08 10:25   ` Russell King - ARM Linux
2012-01-08 10:25     ` Russell King - ARM Linux
2012-01-09 11:46     ` Ulf Hansson [this message]
2012-01-09 11:46       ` Ulf Hansson
2012-01-09 15:12     ` Ulf Hansson
2012-01-09 15:12       ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 11/14] mmc: mmci: Fixup use of runtime PM and use autosuspend Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 12/14] mmc: mmci: Decrease current consumption in suspend Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2012-01-08 10:38   ` Russell King - ARM Linux
2012-01-08 10:38     ` Russell King - ARM Linux
2012-01-09 14:12     ` Ulf Hansson
2012-01-09 14:12       ` Ulf Hansson
2011-12-05 17:35 ` [PATCH 13/14] mmc: mmci: Implement PM runtime callbacks to save power Ulf Hansson
2011-12-05 17:35   ` Ulf Hansson
2011-12-05 17:36 ` [PATCH 14/14] mmc: mmci: Use ios_handler " Ulf Hansson
2011-12-05 17:36   ` Ulf Hansson
2011-12-07 12:06 ` [PATCH 00/14] mmc: mmci: Improved PM support, cleanup and bugfixes Linus Walleij
2011-12-07 12:06   ` Linus Walleij
2011-12-13 16:17   ` Ulf Hansson
2011-12-13 16:17     ` Ulf Hansson

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=4F0AD381.9020105@stericsson.com \
    --to=ulf.hansson@stericsson.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /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.