linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shinya.kuribayashi.px@renesas.com (Shinya Kuribayashi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] hwspinlock/core: use global ID to register hwspinlocks on multiple devices
Date: Fri, 06 Jul 2012 13:56:06 +0900	[thread overview]
Message-ID: <4FF66FE6.1060005@renesas.com> (raw)
In-Reply-To: <4FF66FBD.5090601@renesas.com>

Commit 300bab9770 (hwspinlock/core: register a bank of hwspinlocks in a
single API call, 2011-09-06) introduced 'hwspin_lock_register_single()'
to register numerous (a bank of) hwspinlock instances in a single API,
'hwspin_lock_register()'.

At which time, 'hwspin_lock_register()' accidentally passes 'local IDs'
to 'hwspin_lock_register_single()', despite that ..._single() requires
'global IDs' to register hwspinlocks.

We have to convert into global IDs by supplying the missing 'base_id'.

Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
---

Note that we used to have a similar bug in omap_hwspinlock.c driver,
and fixed it in this commit:

| commit c3c1250e93a7ab1327a9fc49d2a22405672f4204
| Author: Ohad Ben-Cohen <ohad@wizery.com>
| Date:   Mon Sep 5 23:15:06 2011 +0300
|
|     hwspinlock/core/omap: fix id issues on multiple hwspinlock devices

Commit 300bab9770 made the same mistake when sorting our the core code.

 drivers/hwspinlock/hwspinlock_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index ed4e000..ba45f96 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -345,7 +345,7 @@ int hwspin_lock_register(struct hwspinlock_device *bank, struct device *dev,
 		spin_lock_init(&hwlock->lock);
 		hwlock->bank = bank;
 
-		ret = hwspin_lock_register_single(hwlock, i);
+		ret = hwspin_lock_register_single(hwlock, base_id + i);
 		if (ret)
 			goto reg_failed;
 	}
-- 
1.7.11.1

  reply	other threads:[~2012-07-06  4:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06  4:55 [PATCH 0/3] hwspinlock: a bug fix, trivial changes Shinya Kuribayashi
2012-07-06  4:56 ` Shinya Kuribayashi [this message]
2012-07-07 10:49   ` [PATCH 1/3] hwspinlock/core: use global ID to register hwspinlocks on multiple devices Ohad Ben-Cohen
2012-07-06  4:56 ` [PATCH 2/3] hwspinlock/core: add notes on lock element in 'struct hwspinlock' Shinya Kuribayashi
2012-07-07 10:53   ` Ohad Ben-Cohen
2012-07-06  4:56 ` [PATCH 3/3] hwspinlock/core: allow hwspinlock_device to have bank-specific private data Shinya Kuribayashi
2012-07-07 10:55   ` Ohad Ben-Cohen
2012-07-07 10:59 ` [PATCH 0/3] hwspinlock: a bug fix, trivial changes Ohad Ben-Cohen
2012-07-09  0:41   ` Shinya Kuribayashi

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=4FF66FE6.1060005@renesas.com \
    --to=shinya.kuribayashi.px@renesas.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).