public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux@fluff.org>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, Ben Dooks <ben-linux@fluff.org>
Subject: [patch 3/6] SM501: Fix sm501_init_reg() mask/set order
Date: Thu, 14 Jun 2007 11:01:12 +0100	[thread overview]
Message-ID: <20070614100136.038869779@fluff.org.uk> (raw)
In-Reply-To: 20070614100109.192172553@fluff.org.uk

[-- Attachment #1: simtec-drivers-mfd-sm501-reginitfix.patch --]
[-- Type: text/plain, Size: 1104 bytes --]

The order of the set and mask operation in sm501_init_reg()
was setting and then masking the bits set. Correct the order
so that we do not end up with 288MHz SDRAM clocks on certain
systems.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>

Index: linux-2.6.21-quilt8/drivers/mfd/sm501.c
===================================================================
--- linux-2.6.21-quilt8.orig/drivers/mfd/sm501.c	2007-06-07 12:13:03.000000000 +0100
+++ linux-2.6.21-quilt8/drivers/mfd/sm501.c	2007-06-07 12:13:06.000000000 +0100
@@ -803,6 +803,9 @@ static DEVICE_ATTR(dbg_regs, 0666, sm501
 /* sm501_init_reg
  *
  * Helper function for the init code to setup a register
+ *
+ * clear the bits which are set in r->mask, and then set
+ * the bits set in r->set.
 */
 
 static inline void sm501_init_reg(struct sm501_devdata *sm,
@@ -812,8 +815,8 @@ static inline void sm501_init_reg(struct
 	unsigned long tmp;
 
 	tmp = readl(sm->regs + reg);
-	tmp |= r->set;
 	tmp &= ~r->mask;
+	tmp |= r->set;
 	writel(tmp, sm->regs + reg);
 }
 

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

  parent reply	other threads:[~2007-06-14 10:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-14 10:01 [patch 0/6] SM501 fixes and updates Ben Dooks
2007-06-14 10:01 ` [patch 1/6] SM501: suspend support Ben Dooks
2007-06-14 10:01 ` [patch 2/6] SM501: initialise SDRAM clock before bus clocks Ben Dooks
2007-06-14 10:01 ` Ben Dooks [this message]
2007-06-14 10:01 ` [patch 4/6] SM501: Clock updates and checks Ben Dooks
2007-06-14 10:01 ` [patch 5/6] SM501: Add Documentation/SM501.txt Ben Dooks
2007-06-14 10:01 ` [patch 6/6] SM501: Check SM501 ID register on initialisation Ben Dooks
2007-06-14 11:22 ` [patch 0/6] SM501 fixes and updates Sam Ravnborg
2007-06-14 12:51   ` Ben Dooks

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=20070614100136.038869779@fluff.org.uk \
    --to=ben-linux@fluff.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox