From: Geoff Levand <geoffrey.levand@am.sony.com>
To: paulus@samba.org
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>,
linuxppc-dev@ozlabs.org
Subject: [patch 02/16] PS3: Make bus_id and dev_id u64
Date: Fri, 18 Jan 2008 12:30:09 -0800 [thread overview]
Message-ID: <47910C51.2000805@am.sony.com> (raw)
In-Reply-To: <20080118202612.422185192@am.sony.com>
From: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Change the PS3 bus_id and dev_id from type unsigned int to u64. These
IDs are 64-bit in the repository, and the special storage notification
device has a device ID of ULONG_MAX.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
arch/powerpc/platforms/ps3/device-init.c | 4 ++--
arch/powerpc/platforms/ps3/mm.c | 8 ++++----
arch/powerpc/platforms/ps3/platform.h | 12 ++++++------
arch/powerpc/platforms/ps3/repository.c | 21 ++++++++-------------
arch/powerpc/platforms/ps3/system-bus.c | 14 +++++++-------
drivers/net/ps3_gelic_net.c | 4 ++--
include/asm-powerpc/ps3.h | 4 ++--
7 files changed, 31 insertions(+), 36 deletions(-)
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -297,7 +297,7 @@ static int ps3_storage_wait_for_device(c
u64 dev_port;
} *notify_event;
- pr_debug(" -> %s:%u: (%u:%u:%u)\n", __func__, __LINE__, repo->bus_id,
+ pr_debug(" -> %s:%u: (%lu:%lu:%u)\n", __func__, __LINE__, repo->bus_id,
repo->dev_id, repo->dev_type);
buf = kzalloc(512, GFP_KERNEL);
@@ -384,7 +384,7 @@ static int ps3_storage_wait_for_device(c
if (notify_event->dev_id == repo->dev_id &&
notify_event->dev_type == PS3_DEV_TYPE_NOACCESS) {
- pr_debug("%s:%u: no access: dev_id %u\n", __func__,
+ pr_debug("%s:%u: no access: dev_id %lu\n", __func__,
__LINE__, repo->dev_id);
break;
}
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -359,7 +359,7 @@ static unsigned long dma_sb_lpar_to_bus(
static void __maybe_unused _dma_dump_region(const struct ps3_dma_region *r,
const char *func, int line)
{
- DBG("%s:%d: dev %u:%u\n", func, line, r->dev->bus_id,
+ DBG("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id,
r->dev->dev_id);
DBG("%s:%d: page_size %u\n", func, line, r->page_size);
DBG("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr);
@@ -394,7 +394,7 @@ struct dma_chunk {
static void _dma_dump_chunk (const struct dma_chunk* c, const char* func,
int line)
{
- DBG("%s:%d: r.dev %u:%u\n", func, line,
+ DBG("%s:%d: r.dev %lu:%lu\n", func, line,
c->region->dev->bus_id, c->region->dev->dev_id);
DBG("%s:%d: r.bus_addr %lxh\n", func, line, c->region->bus_addr);
DBG("%s:%d: r.page_size %u\n", func, line, c->region->page_size);
@@ -658,7 +658,7 @@ static int dma_sb_region_create(struct p
BUG_ON(!r);
if (!r->dev->bus_id) {
- pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__,
+ pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
r->dev->bus_id, r->dev->dev_id);
return 0;
}
@@ -724,7 +724,7 @@ static int dma_sb_region_free(struct ps3
BUG_ON(!r);
if (!r->dev->bus_id) {
- pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__,
+ pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
r->dev->bus_id, r->dev->dev_id);
return 0;
}
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -95,7 +95,7 @@ enum ps3_dev_type {
int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str,
u64 *value);
-int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id);
+int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id);
int ps3_repository_read_bus_type(unsigned int bus_index,
enum ps3_bus_type *bus_type);
int ps3_repository_read_bus_num_dev(unsigned int bus_index,
@@ -119,7 +119,7 @@ enum ps3_reg_type {
int ps3_repository_read_dev_str(unsigned int bus_index,
unsigned int dev_index, const char *dev_str, u64 *value);
int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
- unsigned int *dev_id);
+ u64 *dev_id);
int ps3_repository_read_dev_type(unsigned int bus_index,
unsigned int dev_index, enum ps3_dev_type *dev_type);
int ps3_repository_read_dev_intr(unsigned int bus_index,
@@ -138,12 +138,12 @@ int ps3_repository_read_dev_reg(unsigned
/* repository bus enumerators */
struct ps3_repository_device {
- enum ps3_bus_type bus_type;
unsigned int bus_index;
- unsigned int bus_id;
- enum ps3_dev_type dev_type;
unsigned int dev_index;
- unsigned int dev_id;
+ enum ps3_bus_type bus_type;
+ enum ps3_dev_type dev_type;
+ u64 bus_id;
+ u64 dev_id;
};
static inline struct ps3_repository_device *ps3_repository_bump_device(
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -168,18 +168,15 @@ int ps3_repository_read_bus_str(unsigned
value, 0);
}
-int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id)
+int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id)
{
int result;
- u64 v1;
- u64 v2; /* unused */
result = read_node(PS3_LPAR_ID_PME,
make_first_field("bus", bus_index),
make_field("id", 0),
0, 0,
- &v1, &v2);
- *bus_id = v1;
+ bus_id, NULL);
return result;
}
@@ -225,18 +222,16 @@ int ps3_repository_read_dev_str(unsigned
}
int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
- unsigned int *dev_id)
+ u64 *dev_id)
{
int result;
- u64 v1;
result = read_node(PS3_LPAR_ID_PME,
make_first_field("bus", bus_index),
make_field("dev", dev_index),
make_field("id", 0),
0,
- &v1, 0);
- *dev_id = v1;
+ dev_id, 0);
return result;
}
@@ -332,7 +327,7 @@ int ps3_repository_find_device(struct ps
return result;
}
- pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %u, num_dev %u\n",
+ pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n",
__func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id,
num_dev);
@@ -387,7 +382,7 @@ int ps3_repository_find_device(struct ps
return result;
}
- pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %u\n",
+ pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n",
__func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
*repo = tmp;
@@ -1034,7 +1029,7 @@ static int dump_device_info(struct ps3_r
continue;
}
- pr_debug("%s:%d (%u:%u): dev_type %u, dev_id %u\n", __func__,
+ pr_debug("%s:%d (%u:%u): dev_type %u, dev_id %lu\n", __func__,
__LINE__, repo->bus_index, repo->dev_index,
repo->dev_type, repo->dev_id);
@@ -1091,7 +1086,7 @@ int ps3_repository_dump_bus_info(void)
continue;
}
- pr_debug("%s:%d bus_%u: bus_type %u, bus_id %u, num_dev %u\n",
+ pr_debug("%s:%d bus_%u: bus_type %u, bus_id %lu, num_dev %u\n",
__func__, __LINE__, repo.bus_index, repo.bus_type,
repo.bus_id, num_dev);
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -42,8 +42,8 @@ struct {
int gpu;
} static usage_hack;
-static int ps3_is_device(struct ps3_system_bus_device *dev,
- unsigned int bus_id, unsigned int dev_id)
+static int ps3_is_device(struct ps3_system_bus_device *dev, u64 bus_id,
+ u64 dev_id)
{
return dev->bus_id == bus_id && dev->dev_id == dev_id;
}
@@ -182,8 +182,8 @@ int ps3_open_hv_device(struct ps3_system
case PS3_MATCH_ID_SYSTEM_MANAGER:
pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
__LINE__, dev->match_id);
- pr_debug("%s:%d: bus_id: %u\n", __func__,
- __LINE__, dev->bus_id);
+ pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
+ dev->bus_id);
BUG();
return -EINVAL;
@@ -220,8 +220,8 @@ int ps3_close_hv_device(struct ps3_syste
case PS3_MATCH_ID_SYSTEM_MANAGER:
pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
__LINE__, dev->match_id);
- pr_debug("%s:%d: bus_id: %u\n", __func__,
- __LINE__, dev->bus_id);
+ pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
+ dev->bus_id);
BUG();
return -EINVAL;
@@ -240,7 +240,7 @@ EXPORT_SYMBOL_GPL(ps3_close_hv_device);
static void _dump_mmio_region(const struct ps3_mmio_region* r,
const char* func, int line)
{
- pr_debug("%s:%d: dev %u:%u\n", func, line, r->dev->bus_id,
+ pr_debug("%s:%d: dev %lu:%lu\n", func, line, r->dev->bus_id,
r->dev->dev_id);
pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr);
pr_debug("%s:%d: len %lxh\n", func, line, r->len);
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -58,11 +58,11 @@ static inline struct device *ctodev(stru
{
return &card->dev->core;
}
-static inline unsigned int bus_id(struct gelic_net_card *card)
+static inline u64 bus_id(struct gelic_net_card *card)
{
return card->dev->bus_id;
}
-static inline unsigned int dev_id(struct gelic_net_card *card)
+static inline u64 dev_id(struct gelic_net_card *card)
{
return card->dev->dev_id;
}
--- a/include/asm-powerpc/ps3.h
+++ b/include/asm-powerpc/ps3.h
@@ -344,8 +344,8 @@ struct ps3_system_bus_device {
enum ps3_match_id match_id;
enum ps3_system_bus_device_type dev_type;
- unsigned int bus_id; /* SB */
- unsigned int dev_id; /* SB */
+ u64 bus_id; /* SB */
+ u64 dev_id; /* SB */
unsigned int interrupt_id; /* SB */
struct ps3_dma_region *d_region; /* SB, IOC0 */
struct ps3_mmio_region *m_region; /* SB, IOC0*/
--
next prev parent reply other threads:[~2008-01-18 20:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080118202612.422185192@am.sony.com>
2008-01-18 20:29 ` [patch 01/16] POWERPC: Add Cell SPRN bookmark register Geoff Levand
2008-01-18 20:30 ` Geoff Levand [this message]
2008-01-18 20:30 ` [patch 03/16] PS3: Add ps3_repository_find_device_by_id() Geoff Levand
2008-01-18 20:30 ` [patch 04/16] PS3: Use the HVs storage device notification mechanism properly Geoff Levand
2008-01-18 20:30 ` [patch 05/16] PS3: Add repository polling loop to work around timing bug Geoff Levand
2008-01-18 20:32 ` [patch 06/16] PS3: Kill unused ps3_repository_bump_device() Geoff Levand
2008-01-18 20:32 ` [patch 07/16] PS3: Refactor ps3_repository_find_device() Geoff Levand
2008-01-18 20:32 ` [patch 08/16] PS3: Checkpatch cleanups for drivers/ps3/ps3-sys-manager.c Geoff Levand
2008-01-18 20:32 ` [patch 09/16] PS3: Checkpatch cleanups for drivers/ps3/ps3-vuart.c Geoff Levand
2008-01-18 20:32 ` [patch 10/16] PS3: Checkpatch cleanups for arch/powerpc/platforms/ps3/repository.c Geoff Levand
2008-01-18 20:32 ` [patch 11/16] PS3: Add logical performance monitor repository routines Geoff Levand
2008-01-18 20:32 ` [patch 12/16] PS3: Add logical performance monitor device support Geoff Levand
2008-01-18 20:32 ` [patch 13/16] PS3: Add logical performance monitor driver support Geoff Levand
2008-01-18 20:32 ` [patch 14/16] PS3: Vuart change semaphore to mutex Geoff Levand
2008-01-18 20:32 ` [patch 15/16] PS3: Revove use lpar address workaround Geoff Levand
2008-01-18 20:33 ` [patch 16/16] PS3: Update ps3_defconfig Geoff Levand
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=47910C51.2000805@am.sony.com \
--to=geoffrey.levand@am.sony.com \
--cc=Geert.Uytterhoeven@sonycom.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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.