* [PATCH -mm 2/2] RapidIO: Integrate rio_switch into rio_dev
From: Alexandre Bounine @ 2010-10-21 19:10 UTC (permalink / raw)
To: akpm, linux-kernel, linuxppc-dev; +Cc: Alexandre Bounine, Thomas Moll
In-Reply-To: <1287688250-14226-1-git-send-email-alexandre.bounine@idt.com>
Convert RIO switches device structures (rio_dev + rio_switch) into
a single allocation unit.
This change is based on the fact that RIO switches are using
common RIO device objects anyway. Allocating RIO switch objects
as RIO devices with added space for switch information simplifies handling
of RIO switch devices.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Thomas Moll <thomas.moll@sysgo.com>
Cc: Micha Nelissen <micha@neli.hopto.org>
---
drivers/rapidio/rio-scan.c | 59 +++++++++++++++++--------------
drivers/rapidio/rio-sysfs.c | 4 +-
include/linux/rio.h | 82 +++++++++++++++++++++---------------------
3 files changed, 75 insertions(+), 70 deletions(-)
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index 51f0af2..45d14cd 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -378,12 +378,30 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
struct rio_dev *rdev;
struct rio_switch *rswitch = NULL;
int result, rdid;
+ size_t size;
+ u32 swpinfo = 0;
- rdev = kzalloc(sizeof(struct rio_dev), GFP_KERNEL);
+ size = sizeof(struct rio_dev);
+ if (rio_mport_read_config_32(port, destid, hopcount,
+ RIO_PEF_CAR, &result))
+ return NULL;
+
+ if (result & (RIO_PEF_SWITCH | RIO_PEF_MULTIPORT)) {
+ rio_mport_read_config_32(port, destid, hopcount,
+ RIO_SWP_INFO_CAR, &swpinfo);
+ if (result & RIO_PEF_SWITCH) {
+ size += (RIO_GET_TOTAL_PORTS(swpinfo) *
+ sizeof(rswitch->nextdev[0])) + sizeof(*rswitch);
+ }
+ }
+
+ rdev = kzalloc(size, GFP_KERNEL);
if (!rdev)
return NULL;
rdev->net = net;
+ rdev->pef = result;
+ rdev->swpinfo = swpinfo;
rio_mport_read_config_32(port, destid, hopcount, RIO_DEV_ID_CAR,
&result);
rdev->did = result >> 16;
@@ -397,8 +415,6 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
rio_mport_read_config_32(port, destid, hopcount, RIO_ASM_INFO_CAR,
&result);
rdev->asm_rev = result >> 16;
- rio_mport_read_config_32(port, destid, hopcount, RIO_PEF_CAR,
- &rdev->pef);
if (rdev->pef & RIO_PEF_EXT_FEATURES) {
rdev->efptr = result & 0xffff;
rdev->phys_efptr = rio_mport_get_physefb(port, 0, destid,
@@ -408,11 +424,6 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
hopcount, RIO_EFB_ERR_MGMNT);
}
- if (rdev->pef & (RIO_PEF_SWITCH | RIO_PEF_MULTIPORT)) {
- rio_mport_read_config_32(port, destid, hopcount,
- RIO_SWP_INFO_CAR, &rdev->swpinfo);
- }
-
rio_mport_read_config_32(port, destid, hopcount, RIO_SRC_OPS_CAR,
&rdev->src_ops);
rio_mport_read_config_32(port, destid, hopcount, RIO_DST_OPS_CAR,
@@ -449,12 +460,7 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
/* If a PE has both switch and other functions, show it as a switch */
if (rio_is_switch(rdev)) {
- rswitch = kzalloc(sizeof(*rswitch) +
- RIO_GET_TOTAL_PORTS(rdev->swpinfo) *
- sizeof(rswitch->nextdev[0]),
- GFP_KERNEL);
- if (!rswitch)
- goto cleanup;
+ rswitch = rdev->rswitch;
rswitch->switchid = next_switchid;
rswitch->port_ok = 0;
rswitch->route_table = kzalloc(sizeof(u8)*
@@ -466,15 +472,13 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
for (rdid = 0; rdid < RIO_MAX_ROUTE_ENTRIES(port->sys_size);
rdid++)
rswitch->route_table[rdid] = RIO_INVALID_ROUTE;
- rdev->rswitch = rswitch;
- rswitch->rdev = rdev;
dev_set_name(&rdev->dev, "%02x:s:%04x", rdev->net->id,
- rdev->rswitch->switchid);
+ rswitch->switchid);
rio_switch_init(rdev, do_enum);
- if (do_enum && rdev->rswitch->clr_table)
- rdev->rswitch->clr_table(port, destid, hopcount,
- RIO_GLOBAL_TABLE);
+ if (do_enum && rswitch->clr_table)
+ rswitch->clr_table(port, destid, hopcount,
+ RIO_GLOBAL_TABLE);
list_add_tail(&rswitch->node, &rio_switches);
@@ -510,10 +514,9 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
return rdev;
cleanup:
- if (rswitch) {
+ if (rswitch->route_table)
kfree(rswitch->route_table);
- kfree(rswitch);
- }
+
kfree(rdev);
return NULL;
}
@@ -1072,7 +1075,7 @@ static struct rio_net __devinit *rio_alloc_net(struct rio_mport *port)
*/
static void rio_update_route_tables(struct rio_mport *port)
{
- struct rio_dev *rdev;
+ struct rio_dev *rdev, *swrdev;
struct rio_switch *rswitch;
u8 sport;
u16 destid;
@@ -1087,14 +1090,16 @@ static void rio_update_route_tables(struct rio_mport *port)
continue;
if (RIO_INVALID_ROUTE == rswitch->route_table[destid]) {
+ swrdev = sw_to_rio_dev(rswitch);
+
/* Skip if destid ends in empty switch*/
- if (rswitch->rdev->destid == destid)
+ if (swrdev->destid == destid)
continue;
- sport = RIO_GET_PORT_NUM(rswitch->rdev->swpinfo);
+ sport = RIO_GET_PORT_NUM(swrdev->swpinfo);
if (rswitch->add_entry) {
- rio_route_add_entry(rswitch->rdev,
+ rio_route_add_entry(swrdev,
RIO_GLOBAL_TABLE, destid,
sport, 0);
rswitch->route_table[destid] = sport;
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c
index 137ed93..76b4185 100644
--- a/drivers/rapidio/rio-sysfs.c
+++ b/drivers/rapidio/rio-sysfs.c
@@ -217,7 +217,7 @@ int rio_create_sysfs_dev_files(struct rio_dev *rdev)
err = device_create_bin_file(&rdev->dev, &rio_config_attr);
- if (!err && rdev->rswitch) {
+ if (!err && (rdev->pef & RIO_PEF_SWITCH)) {
err = device_create_file(&rdev->dev, &dev_attr_routes);
if (!err && rdev->rswitch->sw_sysfs)
err = rdev->rswitch->sw_sysfs(rdev, RIO_SW_SYSFS_CREATE);
@@ -239,7 +239,7 @@ int rio_create_sysfs_dev_files(struct rio_dev *rdev)
void rio_remove_sysfs_dev_files(struct rio_dev *rdev)
{
device_remove_bin_file(&rdev->dev, &rio_config_attr);
- if (rdev->rswitch) {
+ if (rdev->pef & RIO_PEF_SWITCH) {
device_remove_file(&rdev->dev, &dev_attr_routes);
if (rdev->rswitch->sw_sysfs)
rdev->rswitch->sw_sysfs(rdev, RIO_SW_SYSFS_REMOVE);
diff --git a/include/linux/rio.h b/include/linux/rio.h
index f6e25b3..9b55885 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -71,9 +71,47 @@ extern struct device rio_bus;
extern struct list_head rio_devices; /* list of all devices */
struct rio_mport;
+struct rio_dev;
union rio_pw_msg;
/**
+ * struct rio_switch - RIO switch info
+ * @node: Node in global list of switches
+ * @switchid: Switch ID that is unique across a network
+ * @route_table: Copy of switch routing table
+ * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
+ * @add_entry: Callback for switch-specific route add function
+ * @get_entry: Callback for switch-specific route get function
+ * @clr_table: Callback for switch-specific clear route table function
+ * @set_domain: Callback for switch-specific domain setting function
+ * @get_domain: Callback for switch-specific domain get function
+ * @em_init: Callback for switch-specific error management init function
+ * @em_handle: Callback for switch-specific error management handler function
+ * @sw_sysfs: Callback that initializes switch-specific sysfs attributes
+ * @nextdev: Array of per-port pointers to the next attached device
+ */
+struct rio_switch {
+ struct list_head node;
+ u16 switchid;
+ u8 *route_table;
+ u32 port_ok;
+ int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,
+ u16 table, u16 route_destid, u8 route_port);
+ int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,
+ u16 table, u16 route_destid, u8 *route_port);
+ int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,
+ u16 table);
+ int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
+ u8 sw_domain);
+ int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
+ u8 *sw_domain);
+ int (*em_init) (struct rio_dev *dev);
+ int (*em_handle) (struct rio_dev *dev, u8 swport);
+ int (*sw_sysfs) (struct rio_dev *dev, int create);
+ struct rio_dev *nextdev[0];
+};
+
+/**
* struct rio_dev - RIO device info
* @global_list: Node in list of all RIO devices
* @net_list: Node in list of RIO devices in a network
@@ -93,7 +131,6 @@ union rio_pw_msg;
* @phys_efptr: RIO device extended features pointer
* @em_efptr: RIO Error Management features pointer
* @dma_mask: Mask of bits of RIO address this device implements
- * @rswitch: Pointer to &struct rio_switch if valid for this device
* @driver: Driver claiming this device
* @dev: Device model device
* @riores: RIO resources this device owns
@@ -101,6 +138,7 @@ union rio_pw_msg;
* @destid: Network destination ID (or associated destid for switch)
* @hopcount: Hopcount to this device
* @prev: Previous RIO device connected to the current one
+ * @rswitch: struct rio_switch (if valid for this device)
*/
struct rio_dev {
struct list_head global_list; /* node in list of all RIO devices */
@@ -121,7 +159,6 @@ struct rio_dev {
u32 phys_efptr;
u32 em_efptr;
u64 dma_mask;
- struct rio_switch *rswitch; /* RIO switch info */
struct rio_driver *driver; /* RIO driver claiming this device */
struct device dev; /* LDM device structure */
struct resource riores[RIO_MAX_DEV_RESOURCES];
@@ -129,11 +166,13 @@ struct rio_dev {
u16 destid;
u8 hopcount;
struct rio_dev *prev;
+ struct rio_switch rswitch[0]; /* RIO switch info */
};
#define rio_dev_g(n) list_entry(n, struct rio_dev, global_list)
#define rio_dev_f(n) list_entry(n, struct rio_dev, net_list)
#define to_rio_dev(n) container_of(n, struct rio_dev, dev)
+#define sw_to_rio_dev(n) container_of(n, struct rio_dev, rswitch[0])
/**
* struct rio_msg - RIO message event
@@ -226,45 +265,6 @@ struct rio_net {
#define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */
#define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */
-/**
- * struct rio_switch - RIO switch info
- * @node: Node in global list of switches
- * @rdev: Associated RIO device structure
- * @switchid: Switch ID that is unique across a network
- * @route_table: Copy of switch routing table
- * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
- * @add_entry: Callback for switch-specific route add function
- * @get_entry: Callback for switch-specific route get function
- * @clr_table: Callback for switch-specific clear route table function
- * @set_domain: Callback for switch-specific domain setting function
- * @get_domain: Callback for switch-specific domain get function
- * @em_init: Callback for switch-specific error management initialization function
- * @em_handle: Callback for switch-specific error management handler function
- * @sw_sysfs: Callback that initializes switch-specific sysfs attributes
- * @nextdev: Array of per-port pointers to the next attached device
- */
-struct rio_switch {
- struct list_head node;
- struct rio_dev *rdev;
- u16 switchid;
- u8 *route_table;
- u32 port_ok;
- int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
- u16 table, u16 route_destid, u8 route_port);
- int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
- u16 table, u16 route_destid, u8 * route_port);
- int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,
- u16 table);
- int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
- u8 sw_domain);
- int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
- u8 *sw_domain);
- int (*em_init) (struct rio_dev *dev);
- int (*em_handle) (struct rio_dev *dev, u8 swport);
- int (*sw_sysfs) (struct rio_dev *dev, int create);
- struct rio_dev *nextdev[0];
-};
-
/* Low-level architecture-dependent routines */
/**
--
1.7.3.1
^ permalink raw reply related
* [PATCH -mm 1/2] RapidIO: Use common destid storage for endpoints and switches
From: Alexandre Bounine @ 2010-10-21 19:10 UTC (permalink / raw)
To: akpm, linux-kernel, linuxppc-dev; +Cc: Alexandre Bounine, Thomas Moll
In-Reply-To: <1287688250-14226-1-git-send-email-alexandre.bounine@idt.com>
Changes code to use one storage location common for switches and endpoints.
This eliminates unnecessary device type checks during basic access
operations. Logic that assigns destid to RIO devices stays unchanged - as
before, switches use an associated destid because they do not have their own.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Thomas Moll <thomas.moll@sysgo.com>
Cc: Micha Nelissen <micha@neli.hopto.org>
---
drivers/rapidio/rio-scan.c | 84 ++++++++++++++++---------------
drivers/rapidio/rio.c | 74 ++++++++-------------------
drivers/rapidio/switches/idt_gen2.c | 93 ++++++++++++-----------------------
drivers/rapidio/switches/idtcps.c | 6 +--
drivers/rapidio/switches/tsi568.c | 13 ++---
drivers/rapidio/switches/tsi57x.c | 56 +++++++++------------
include/linux/rio.h | 8 +--
include/linux/rio_drv.h | 72 +++++----------------------
8 files changed, 141 insertions(+), 265 deletions(-)
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index 1eb82c4..51f0af2 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -437,9 +437,15 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
next_destid++;
} else
rdev->destid = rio_get_device_id(port, destid, hopcount);
- } else
- /* Switch device has an associated destID */
- rdev->destid = RIO_INVALID_DESTID;
+
+ rdev->hopcount = 0xff;
+ } else {
+ /* Switch device has an associated destID which
+ * will be adjusted later
+ */
+ rdev->destid = destid;
+ rdev->hopcount = hopcount;
+ }
/* If a PE has both switch and other functions, show it as a switch */
if (rio_is_switch(rdev)) {
@@ -450,8 +456,6 @@ static struct rio_dev __devinit *rio_setup_device(struct rio_net *net,
if (!rswitch)
goto cleanup;
rswitch->switchid = next_switchid;
- rswitch->hopcount = hopcount;
- rswitch->destid = destid;
rswitch->port_ok = 0;
rswitch->route_table = kzalloc(sizeof(u8)*
RIO_MAX_ROUTE_ENTRIES(port->sys_size),
@@ -632,8 +636,7 @@ rio_unlock_device(struct rio_mport *port, u16 destid, u8 hopcount)
/**
* rio_route_add_entry- Add a route entry to a switch routing table
- * @mport: Master port to send transaction
- * @rswitch: Switch device
+ * @rdev: RIO device
* @table: Routing table ID
* @route_destid: Destination ID to be routed
* @route_port: Port number to be routed
@@ -647,31 +650,31 @@ rio_unlock_device(struct rio_mport *port, u16 destid, u8 hopcount)
* on failure.
*/
static int
-rio_route_add_entry(struct rio_mport *mport, struct rio_switch *rswitch,
+rio_route_add_entry(struct rio_dev *rdev,
u16 table, u16 route_destid, u8 route_port, int lock)
{
int rc;
if (lock) {
- rc = rio_lock_device(mport, rswitch->destid,
- rswitch->hopcount, 1000);
+ rc = rio_lock_device(rdev->net->hport, rdev->destid,
+ rdev->hopcount, 1000);
if (rc)
return rc;
}
- rc = rswitch->add_entry(mport, rswitch->destid,
- rswitch->hopcount, table,
- route_destid, route_port);
+ rc = rdev->rswitch->add_entry(rdev->net->hport, rdev->destid,
+ rdev->hopcount, table,
+ route_destid, route_port);
if (lock)
- rio_unlock_device(mport, rswitch->destid, rswitch->hopcount);
+ rio_unlock_device(rdev->net->hport, rdev->destid,
+ rdev->hopcount);
return rc;
}
/**
* rio_route_get_entry- Read a route entry in a switch routing table
- * @mport: Master port to send transaction
- * @rswitch: Switch device
+ * @rdev: RIO device
* @table: Routing table ID
* @route_destid: Destination ID to be routed
* @route_port: Pointer to read port number into
@@ -685,23 +688,24 @@ rio_route_add_entry(struct rio_mport *mport, struct rio_switch *rswitch,
* on failure.
*/
static int
-rio_route_get_entry(struct rio_mport *mport, struct rio_switch *rswitch, u16 table,
+rio_route_get_entry(struct rio_dev *rdev, u16 table,
u16 route_destid, u8 *route_port, int lock)
{
int rc;
if (lock) {
- rc = rio_lock_device(mport, rswitch->destid,
- rswitch->hopcount, 1000);
+ rc = rio_lock_device(rdev->net->hport, rdev->destid,
+ rdev->hopcount, 1000);
if (rc)
return rc;
}
- rc = rswitch->get_entry(mport, rswitch->destid,
- rswitch->hopcount, table,
- route_destid, route_port);
+ rc = rdev->rswitch->get_entry(rdev->net->hport, rdev->destid,
+ rdev->hopcount, table,
+ route_destid, route_port);
if (lock)
- rio_unlock_device(mport, rswitch->destid, rswitch->hopcount);
+ rio_unlock_device(rdev->net->hport, rdev->destid,
+ rdev->hopcount);
return rc;
}
@@ -811,14 +815,14 @@ static int __devinit rio_enum_peer(struct rio_net *net, struct rio_mport *port,
if (rio_is_switch(rdev)) {
next_switchid++;
sw_inport = RIO_GET_PORT_NUM(rdev->swpinfo);
- rio_route_add_entry(port, rdev->rswitch, RIO_GLOBAL_TABLE,
+ rio_route_add_entry(rdev, RIO_GLOBAL_TABLE,
port->host_deviceid, sw_inport, 0);
rdev->rswitch->route_table[port->host_deviceid] = sw_inport;
for (destid = 0; destid < next_destid; destid++) {
if (destid == port->host_deviceid)
continue;
- rio_route_add_entry(port, rdev->rswitch, RIO_GLOBAL_TABLE,
+ rio_route_add_entry(rdev, RIO_GLOBAL_TABLE,
destid, sw_inport, 0);
rdev->rswitch->route_table[destid] = sw_inport;
}
@@ -850,8 +854,7 @@ static int __devinit rio_enum_peer(struct rio_net *net, struct rio_mport *port,
"RIO: scanning device on port %d\n",
port_num);
rdev->rswitch->port_ok |= (1 << port_num);
- rio_route_add_entry(port, rdev->rswitch,
- RIO_GLOBAL_TABLE,
+ rio_route_add_entry(rdev, RIO_GLOBAL_TABLE,
RIO_ANY_DESTID(port->sys_size),
port_num, 0);
@@ -865,7 +868,7 @@ static int __devinit rio_enum_peer(struct rio_net *net, struct rio_mport *port,
destid < next_destid; destid++) {
if (destid == port->host_deviceid)
continue;
- rio_route_add_entry(port, rdev->rswitch,
+ rio_route_add_entry(rdev,
RIO_GLOBAL_TABLE,
destid,
port_num,
@@ -904,7 +907,7 @@ static int __devinit rio_enum_peer(struct rio_net *net, struct rio_mport *port,
next_destid++;
}
- rdev->rswitch->destid = sw_destid;
+ rdev->destid = sw_destid;
} else
pr_debug("RIO: found %s (vid %4.4x did %4.4x)\n",
rio_name(rdev), rdev->vid, rdev->did);
@@ -958,7 +961,7 @@ rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid,
next_switchid++;
/* Associated destid is how we accessed this switch */
- rdev->rswitch->destid = destid;
+ rdev->destid = destid;
pr_debug(
"RIO: found %s (vid %4.4x did %4.4x) with %d ports\n",
@@ -981,7 +984,7 @@ rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid,
for (ndestid = 0;
ndestid < RIO_ANY_DESTID(port->sys_size);
ndestid++) {
- rio_route_get_entry(port, rdev->rswitch,
+ rio_route_get_entry(rdev,
RIO_GLOBAL_TABLE,
ndestid,
&route_port, 0);
@@ -1076,7 +1079,7 @@ static void rio_update_route_tables(struct rio_mport *port)
list_for_each_entry(rdev, &rio_devices, global_list) {
- destid = (rio_is_switch(rdev))?rdev->rswitch->destid:rdev->destid;
+ destid = rdev->destid;
list_for_each_entry(rswitch, &rio_switches, node) {
@@ -1085,13 +1088,13 @@ static void rio_update_route_tables(struct rio_mport *port)
if (RIO_INVALID_ROUTE == rswitch->route_table[destid]) {
/* Skip if destid ends in empty switch*/
- if (rswitch->destid == destid)
+ if (rswitch->rdev->destid == destid)
continue;
sport = RIO_GET_PORT_NUM(rswitch->rdev->swpinfo);
if (rswitch->add_entry) {
- rio_route_add_entry(port, rswitch,
+ rio_route_add_entry(rswitch->rdev,
RIO_GLOBAL_TABLE, destid,
sport, 0);
rswitch->route_table[destid] = sport;
@@ -1203,21 +1206,20 @@ static void rio_build_route_tables(void)
list_for_each_entry(rdev, &rio_devices, global_list)
if (rio_is_switch(rdev)) {
- rio_lock_device(rdev->net->hport, rdev->rswitch->destid,
- rdev->rswitch->hopcount, 1000);
+ rio_lock_device(rdev->net->hport, rdev->destid,
+ rdev->hopcount, 1000);
for (i = 0;
i < RIO_MAX_ROUTE_ENTRIES(rdev->net->hport->sys_size);
i++) {
- if (rio_route_get_entry
- (rdev->net->hport, rdev->rswitch,
- RIO_GLOBAL_TABLE, i, &sport, 0) < 0)
+ if (rio_route_get_entry(rdev,
+ RIO_GLOBAL_TABLE, i, &sport, 0) < 0)
continue;
rdev->rswitch->route_table[i] = sport;
}
rio_unlock_device(rdev->net->hport,
- rdev->rswitch->destid,
- rdev->rswitch->hopcount);
+ rdev->destid,
+ rdev->hopcount);
}
}
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index 68cf0c9..8ebd6c5 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -471,16 +471,9 @@ exit:
*/
int rio_set_port_lockout(struct rio_dev *rdev, u32 pnum, int lock)
{
- u8 hopcount = 0xff;
- u16 destid = rdev->destid;
u32 regval;
- if (rdev->rswitch) {
- destid = rdev->rswitch->destid;
- hopcount = rdev->rswitch->hopcount;
- }
-
- rio_mport_read_config_32(rdev->net->hport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_CTL_CSR(pnum),
®val);
if (lock)
@@ -488,7 +481,7 @@ int rio_set_port_lockout(struct rio_dev *rdev, u32 pnum, int lock)
else
regval &= ~RIO_PORT_N_CTL_LOCKOUT;
- rio_mport_write_config_32(rdev->net->hport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_CTL_CSR(pnum),
regval);
return 0;
@@ -507,7 +500,7 @@ static int
rio_chk_dev_route(struct rio_dev *rdev, struct rio_dev **nrdev, int *npnum)
{
u32 result;
- int p_port, dstid, rc = -EIO;
+ int p_port, rc = -EIO;
struct rio_dev *prev = NULL;
/* Find switch with failed RIO link */
@@ -522,9 +515,7 @@ rio_chk_dev_route(struct rio_dev *rdev, struct rio_dev **nrdev, int *npnum)
if (prev == NULL)
goto err_out;
- dstid = (rdev->pef & RIO_PEF_SWITCH) ?
- rdev->rswitch->destid : rdev->destid;
- p_port = prev->rswitch->route_table[dstid];
+ p_port = prev->rswitch->route_table[rdev->destid];
if (p_port != RIO_INVALID_ROUTE) {
pr_debug("RIO: link failed on [%s]-P%d\n",
@@ -567,15 +558,8 @@ rio_mport_chk_dev_access(struct rio_mport *mport, u16 destid, u8 hopcount)
*/
static int rio_chk_dev_access(struct rio_dev *rdev)
{
- u8 hopcount = 0xff;
- u16 destid = rdev->destid;
-
- if (rdev->rswitch) {
- destid = rdev->rswitch->destid;
- hopcount = rdev->rswitch->hopcount;
- }
-
- return rio_mport_chk_dev_access(rdev->net->hport, destid, hopcount);
+ return rio_mport_chk_dev_access(rdev->net->hport,
+ rdev->destid, rdev->hopcount);
}
/**
@@ -588,23 +572,20 @@ static int rio_chk_dev_access(struct rio_dev *rdev)
static int
rio_get_input_status(struct rio_dev *rdev, int pnum, u32 *lnkresp)
{
- struct rio_mport *mport = rdev->net->hport;
- u16 destid = rdev->rswitch->destid;
- u8 hopcount = rdev->rswitch->hopcount;
u32 regval;
int checkcount;
if (lnkresp) {
/* Read from link maintenance response register
* to clear valid bit */
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_MNT_RSP_CSR(pnum),
®val);
udelay(50);
}
/* Issue Input-status command */
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_MNT_REQ_CSR(pnum),
RIO_MNT_REQ_CMD_IS);
@@ -615,7 +596,7 @@ rio_get_input_status(struct rio_dev *rdev, int pnum, u32 *lnkresp)
checkcount = 3;
while (checkcount--) {
udelay(50);
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_MNT_RSP_CSR(pnum),
®val);
if (regval & RIO_PORT_N_MNT_RSP_RVAL) {
@@ -635,15 +616,12 @@ rio_get_input_status(struct rio_dev *rdev, int pnum, u32 *lnkresp)
*/
static int rio_clr_err_stopped(struct rio_dev *rdev, u32 pnum, u32 err_status)
{
- struct rio_mport *mport = rdev->net->hport;
- u16 destid = rdev->rswitch->destid;
- u8 hopcount = rdev->rswitch->hopcount;
struct rio_dev *nextdev = rdev->rswitch->nextdev[pnum];
u32 regval;
u32 far_ackid, far_linkstat, near_ackid;
if (err_status == 0)
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_ERR_STS_CSR(pnum),
&err_status);
@@ -661,7 +639,7 @@ static int rio_clr_err_stopped(struct rio_dev *rdev, u32 pnum, u32 err_status)
pnum, regval);
far_ackid = (regval & RIO_PORT_N_MNT_RSP_ASTAT) >> 5;
far_linkstat = regval & RIO_PORT_N_MNT_RSP_LSTAT;
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_ACK_STS_CSR(pnum),
®val);
pr_debug("RIO_EM: SP%d_ACK_STS_CSR=0x%08x\n", pnum, regval);
@@ -679,9 +657,8 @@ static int rio_clr_err_stopped(struct rio_dev *rdev, u32 pnum, u32 err_status)
/* Align near outstanding/outbound ackIDs with
* far inbound.
*/
- rio_mport_write_config_32(mport, destid,
- hopcount, rdev->phys_efptr +
- RIO_PORT_N_ACK_STS_CSR(pnum),
+ rio_write_config_32(rdev,
+ rdev->phys_efptr + RIO_PORT_N_ACK_STS_CSR(pnum),
(near_ackid << 24) |
(far_ackid << 8) | far_ackid);
/* Align far outstanding/outbound ackIDs with
@@ -698,7 +675,7 @@ static int rio_clr_err_stopped(struct rio_dev *rdev, u32 pnum, u32 err_status)
pr_debug("RIO_EM: Invalid nextdev pointer (NULL)\n");
}
rd_err:
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_ERR_STS_CSR(pnum),
&err_status);
pr_debug("RIO_EM: SP%d_ERR_STS_CSR=0x%08x\n", pnum, err_status);
@@ -710,7 +687,7 @@ rd_err:
RIO_GET_PORT_NUM(nextdev->swpinfo), NULL);
udelay(50);
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_ERR_STS_CSR(pnum),
&err_status);
pr_debug("RIO_EM: SP%d_ERR_STS_CSR=0x%08x\n", pnum, err_status);
@@ -730,9 +707,6 @@ rd_err:
int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg)
{
struct rio_dev *rdev;
- struct rio_mport *mport;
- u8 hopcount;
- u16 destid;
u32 err_status, em_perrdet, em_ltlerrdet;
int rc, portnum;
@@ -800,17 +774,13 @@ int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg)
return 0;
}
- mport = rdev->net->hport;
- destid = rdev->rswitch->destid;
- hopcount = rdev->rswitch->hopcount;
-
/*
* Process the port-write notification from switch
*/
if (rdev->rswitch->em_handle)
rdev->rswitch->em_handle(rdev, portnum);
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_ERR_STS_CSR(portnum),
&err_status);
pr_debug("RIO_PW: SP%d_ERR_STS_CSR=0x%08x\n", portnum, err_status);
@@ -840,7 +810,7 @@ int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg)
rdev->rswitch->port_ok &= ~(1 << portnum);
rio_set_port_lockout(rdev, portnum, 1);
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr +
RIO_PORT_N_ACK_STS_CSR(portnum),
RIO_PORT_N_ACK_CLEAR);
@@ -851,28 +821,28 @@ int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg)
}
}
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->em_efptr + RIO_EM_PN_ERR_DETECT(portnum), &em_perrdet);
if (em_perrdet) {
pr_debug("RIO_PW: RIO_EM_P%d_ERR_DETECT=0x%08x\n",
portnum, em_perrdet);
/* Clear EM Port N Error Detect CSR */
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->em_efptr + RIO_EM_PN_ERR_DETECT(portnum), 0);
}
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->em_efptr + RIO_EM_LTL_ERR_DETECT, &em_ltlerrdet);
if (em_ltlerrdet) {
pr_debug("RIO_PW: RIO_EM_LTL_ERR_DETECT=0x%08x\n",
em_ltlerrdet);
/* Clear EM L/T Layer Error Detect CSR */
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->em_efptr + RIO_EM_LTL_ERR_DETECT, 0);
}
/* Clear remaining error bits and Port-Write Pending bit */
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_ERR_STS_CSR(portnum),
err_status);
diff --git a/drivers/rapidio/switches/idt_gen2.c b/drivers/rapidio/switches/idt_gen2.c
index 0bb871c..dd4b2b7 100644
--- a/drivers/rapidio/switches/idt_gen2.c
+++ b/drivers/rapidio/switches/idt_gen2.c
@@ -209,9 +209,6 @@ idtg2_get_domain(struct rio_mport *mport, u16 destid, u8 hopcount,
static int
idtg2_em_init(struct rio_dev *rdev)
{
- struct rio_mport *mport = rdev->net->hport;
- u16 destid = rdev->rswitch->destid;
- u8 hopcount = rdev->rswitch->hopcount;
u32 regval;
int i, tmp;
@@ -220,29 +217,25 @@ idtg2_em_init(struct rio_dev *rdev)
* All standard EM configuration should be performed at upper level.
*/
- pr_debug("RIO: %s [%d:%d]\n", __func__, destid, hopcount);
+ pr_debug("RIO: %s [%d:%d]\n", __func__, rdev->destid, rdev->hopcount);
/* Set Port-Write info CSR: PRIO=3 and CRF=1 */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_PW_INFO_CSR, 0x0000e000);
+ rio_write_config_32(rdev, IDT_PW_INFO_CSR, 0x0000e000);
/*
* Configure LT LAYER error reporting.
*/
/* Enable standard (RIO.p8) error reporting */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_LT_ERR_REPORT_EN,
+ rio_write_config_32(rdev, IDT_LT_ERR_REPORT_EN,
REM_LTL_ERR_ILLTRAN | REM_LTL_ERR_UNSOLR |
REM_LTL_ERR_UNSUPTR);
/* Use Port-Writes for LT layer error reporting.
* Enable per-port reset
*/
- rio_mport_read_config_32(mport, destid, hopcount,
- IDT_DEV_CTRL_1, ®val);
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_DEV_CTRL_1,
+ rio_read_config_32(rdev, IDT_DEV_CTRL_1, ®val);
+ rio_write_config_32(rdev, IDT_DEV_CTRL_1,
regval | IDT_DEV_CTRL_1_GENPW | IDT_DEV_CTRL_1_PRSTBEH);
/*
@@ -250,45 +243,40 @@ idtg2_em_init(struct rio_dev *rdev)
*/
/* Report all RIO.p8 errors supported by device */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_PORT_ERR_REPORT_EN_BC, 0x807e8037);
+ rio_write_config_32(rdev, IDT_PORT_ERR_REPORT_EN_BC, 0x807e8037);
/* Configure reporting of implementation specific errors/events */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_PORT_ISERR_REPORT_EN_BC, IDT_PORT_INIT_TX_ACQUIRED);
+ rio_write_config_32(rdev, IDT_PORT_ISERR_REPORT_EN_BC,
+ IDT_PORT_INIT_TX_ACQUIRED);
/* Use Port-Writes for port error reporting and enable error logging */
tmp = RIO_GET_TOTAL_PORTS(rdev->swpinfo);
for (i = 0; i < tmp; i++) {
- rio_mport_read_config_32(mport, destid, hopcount,
- IDT_PORT_OPS(i), ®val);
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev, IDT_PORT_OPS(i), ®val);
+ rio_write_config_32(rdev,
IDT_PORT_OPS(i), regval | IDT_PORT_OPS_GENPW |
IDT_PORT_OPS_PL_ELOG |
IDT_PORT_OPS_LL_ELOG |
IDT_PORT_OPS_LT_ELOG);
}
/* Overwrite error log if full */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_ERR_CAP, IDT_ERR_CAP_LOG_OVERWR);
+ rio_write_config_32(rdev, IDT_ERR_CAP, IDT_ERR_CAP_LOG_OVERWR);
/*
* Configure LANE error reporting.
*/
/* Disable line error reporting */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_LANE_ERR_REPORT_EN_BC, 0);
+ rio_write_config_32(rdev, IDT_LANE_ERR_REPORT_EN_BC, 0);
/* Use Port-Writes for lane error reporting (when enabled)
* (do per-lane update because lanes may have different configuration)
*/
tmp = (rdev->did == RIO_DID_IDTCPS1848) ? 48 : 16;
for (i = 0; i < tmp; i++) {
- rio_mport_read_config_32(mport, destid, hopcount,
- IDT_LANE_CTRL(i), ®val);
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_LANE_CTRL(i), regval | IDT_LANE_CTRL_GENPW);
+ rio_read_config_32(rdev, IDT_LANE_CTRL(i), ®val);
+ rio_write_config_32(rdev, IDT_LANE_CTRL(i),
+ regval | IDT_LANE_CTRL_GENPW);
}
/*
@@ -296,41 +284,32 @@ idtg2_em_init(struct rio_dev *rdev)
*/
/* Disable JTAG and I2C Error capture */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_AUX_PORT_ERR_CAP_EN, 0);
+ rio_write_config_32(rdev, IDT_AUX_PORT_ERR_CAP_EN, 0);
/* Disable JTAG and I2C Error reporting/logging */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_AUX_ERR_REPORT_EN, 0);
+ rio_write_config_32(rdev, IDT_AUX_ERR_REPORT_EN, 0);
/* Disable Port-Write notification from JTAG */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_JTAG_CTRL, 0);
+ rio_write_config_32(rdev, IDT_JTAG_CTRL, 0);
/* Disable Port-Write notification from I2C */
- rio_mport_read_config_32(mport, destid, hopcount,
- IDT_I2C_MCTRL, ®val);
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_I2C_MCTRL,
- regval & ~IDT_I2C_MCTRL_GENPW);
+ rio_read_config_32(rdev, IDT_I2C_MCTRL, ®val);
+ rio_write_config_32(rdev, IDT_I2C_MCTRL, regval & ~IDT_I2C_MCTRL_GENPW);
/*
* Configure CFG_BLK error reporting.
*/
/* Disable Configuration Block error capture */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_CFGBLK_ERR_CAPTURE_EN, 0);
+ rio_write_config_32(rdev, IDT_CFGBLK_ERR_CAPTURE_EN, 0);
/* Disable Port-Writes for Configuration Block error reporting */
- rio_mport_read_config_32(mport, destid, hopcount,
- IDT_CFGBLK_ERR_REPORT, ®val);
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_CFGBLK_ERR_REPORT,
- regval & ~IDT_CFGBLK_ERR_REPORT_GENPW);
+ rio_read_config_32(rdev, IDT_CFGBLK_ERR_REPORT, ®val);
+ rio_write_config_32(rdev, IDT_CFGBLK_ERR_REPORT,
+ regval & ~IDT_CFGBLK_ERR_REPORT_GENPW);
/* set TVAL = ~50us */
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr + RIO_PORT_LINKTO_CTL_CSR, 0x8e << 8);
return 0;
@@ -339,18 +318,15 @@ idtg2_em_init(struct rio_dev *rdev)
static int
idtg2_em_handler(struct rio_dev *rdev, u8 portnum)
{
- struct rio_mport *mport = rdev->net->hport;
- u16 destid = rdev->rswitch->destid;
- u8 hopcount = rdev->rswitch->hopcount;
u32 regval, em_perrdet, em_ltlerrdet;
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->em_efptr + RIO_EM_LTL_ERR_DETECT, &em_ltlerrdet);
if (em_ltlerrdet) {
/* Service Logical/Transport Layer Error(s) */
if (em_ltlerrdet & REM_LTL_ERR_IMPSPEC) {
/* Implementation specific error reported */
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
IDT_ISLTL_ADDRESS_CAP, ®val);
pr_debug("RIO: %s Implementation Specific LTL errors" \
@@ -358,13 +334,12 @@ idtg2_em_handler(struct rio_dev *rdev, u8 portnum)
rio_name(rdev), em_ltlerrdet, regval);
/* Clear implementation specific address capture CSR */
- rio_mport_write_config_32(mport, destid, hopcount,
- IDT_ISLTL_ADDRESS_CAP, 0);
+ rio_write_config_32(rdev, IDT_ISLTL_ADDRESS_CAP, 0);
}
}
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->em_efptr + RIO_EM_PN_ERR_DETECT(portnum), &em_perrdet);
if (em_perrdet) {
/* Service Port-Level Error(s) */
@@ -372,14 +347,14 @@ idtg2_em_handler(struct rio_dev *rdev, u8 portnum)
/* Implementation Specific port error reported */
/* Get IS errors reported */
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
IDT_PORT_ISERR_DET(portnum), ®val);
pr_debug("RIO: %s Implementation Specific Port" \
" errors 0x%x\n", rio_name(rdev), regval);
/* Clear all implementation specific events */
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
IDT_PORT_ISERR_DET(portnum), 0);
}
}
@@ -391,14 +366,10 @@ static ssize_t
idtg2_show_errlog(struct device *dev, struct device_attribute *attr, char *buf)
{
struct rio_dev *rdev = to_rio_dev(dev);
- struct rio_mport *mport = rdev->net->hport;
- u16 destid = rdev->rswitch->destid;
- u8 hopcount = rdev->rswitch->hopcount;
ssize_t len = 0;
u32 regval;
- while (!rio_mport_read_config_32(mport, destid, hopcount,
- IDT_ERR_RD, ®val)) {
+ while (!rio_read_config_32(rdev, IDT_ERR_RD, ®val)) {
if (!regval) /* 0 = end of log */
break;
len += snprintf(buf + len, PAGE_SIZE - len,
diff --git a/drivers/rapidio/switches/idtcps.c b/drivers/rapidio/switches/idtcps.c
index fc9f637..3a97107 100644
--- a/drivers/rapidio/switches/idtcps.c
+++ b/drivers/rapidio/switches/idtcps.c
@@ -117,10 +117,6 @@ idtcps_get_domain(struct rio_mport *mport, u16 destid, u8 hopcount,
static int idtcps_switch_init(struct rio_dev *rdev, int do_enum)
{
- struct rio_mport *mport = rdev->net->hport;
- u16 destid = rdev->rswitch->destid;
- u8 hopcount = rdev->rswitch->hopcount;
-
pr_debug("RIO: %s for %s\n", __func__, rio_name(rdev));
rdev->rswitch->add_entry = idtcps_route_add_entry;
rdev->rswitch->get_entry = idtcps_route_get_entry;
@@ -132,7 +128,7 @@ static int idtcps_switch_init(struct rio_dev *rdev, int do_enum)
if (do_enum) {
/* set TVAL = ~50us */
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr + RIO_PORT_LINKTO_CTL_CSR, 0x8e << 8);
}
diff --git a/drivers/rapidio/switches/tsi568.c b/drivers/rapidio/switches/tsi568.c
index b9a389b..3994c00 100644
--- a/drivers/rapidio/switches/tsi568.c
+++ b/drivers/rapidio/switches/tsi568.c
@@ -113,22 +113,17 @@ tsi568_route_clr_table(struct rio_mport *mport, u16 destid, u8 hopcount,
static int
tsi568_em_init(struct rio_dev *rdev)
{
- struct rio_mport *mport = rdev->net->hport;
- u16 destid = rdev->rswitch->destid;
- u8 hopcount = rdev->rswitch->hopcount;
u32 regval;
int portnum;
- pr_debug("TSI568 %s [%d:%d]\n", __func__, destid, hopcount);
+ pr_debug("TSI568 %s [%d:%d]\n", __func__, rdev->destid, rdev->hopcount);
/* Make sure that Port-Writes are disabled (for all ports) */
for (portnum = 0;
portnum < RIO_GET_TOTAL_PORTS(rdev->swpinfo); portnum++) {
- rio_mport_read_config_32(mport, destid, hopcount,
- TSI568_SP_MODE(portnum), ®val);
- rio_mport_write_config_32(mport, destid, hopcount,
- TSI568_SP_MODE(portnum),
- regval | TSI568_SP_MODE_PW_DIS);
+ rio_read_config_32(rdev, TSI568_SP_MODE(portnum), ®val);
+ rio_write_config_32(rdev, TSI568_SP_MODE(portnum),
+ regval | TSI568_SP_MODE_PW_DIS);
}
return 0;
diff --git a/drivers/rapidio/switches/tsi57x.c b/drivers/rapidio/switches/tsi57x.c
index 2003fb6..1a62934 100644
--- a/drivers/rapidio/switches/tsi57x.c
+++ b/drivers/rapidio/switches/tsi57x.c
@@ -158,48 +158,45 @@ tsi57x_get_domain(struct rio_mport *mport, u16 destid, u8 hopcount,
static int
tsi57x_em_init(struct rio_dev *rdev)
{
- struct rio_mport *mport = rdev->net->hport;
- u16 destid = rdev->rswitch->destid;
- u8 hopcount = rdev->rswitch->hopcount;
u32 regval;
int portnum;
- pr_debug("TSI578 %s [%d:%d]\n", __func__, destid, hopcount);
+ pr_debug("TSI578 %s [%d:%d]\n", __func__, rdev->destid, rdev->hopcount);
for (portnum = 0;
portnum < RIO_GET_TOTAL_PORTS(rdev->swpinfo); portnum++) {
/* Make sure that Port-Writes are enabled (for all ports) */
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
TSI578_SP_MODE(portnum), ®val);
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
TSI578_SP_MODE(portnum),
regval & ~TSI578_SP_MODE_PW_DIS);
/* Clear all pending interrupts */
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr +
RIO_PORT_N_ERR_STS_CSR(portnum),
®val);
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr +
RIO_PORT_N_ERR_STS_CSR(portnum),
regval & 0x07120214);
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
TSI578_SP_INT_STATUS(portnum), ®val);
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
TSI578_SP_INT_STATUS(portnum),
regval & 0x000700bd);
/* Enable all interrupts to allow ports to send a port-write */
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
TSI578_SP_CTL_INDEP(portnum), ®val);
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
TSI578_SP_CTL_INDEP(portnum),
regval | 0x000b0000);
/* Skip next (odd) port if the current port is in x4 mode */
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_CTL_CSR(portnum),
®val);
if ((regval & RIO_PORT_N_CTL_PWIDTH) == RIO_PORT_N_CTL_PWIDTH_4)
@@ -207,7 +204,7 @@ tsi57x_em_init(struct rio_dev *rdev)
}
/* set TVAL = ~50us */
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr + RIO_PORT_LINKTO_CTL_CSR, 0x9a << 8);
return 0;
@@ -217,14 +214,12 @@ static int
tsi57x_em_handler(struct rio_dev *rdev, u8 portnum)
{
struct rio_mport *mport = rdev->net->hport;
- u16 destid = rdev->rswitch->destid;
- u8 hopcount = rdev->rswitch->hopcount;
u32 intstat, err_status;
int sendcount, checkcount;
u8 route_port;
u32 regval;
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_ERR_STS_CSR(portnum),
&err_status);
@@ -232,15 +227,15 @@ tsi57x_em_handler(struct rio_dev *rdev, u8 portnum)
(err_status & (RIO_PORT_N_ERR_STS_PW_OUT_ES |
RIO_PORT_N_ERR_STS_PW_INP_ES))) {
/* Remove any queued packets by locking/unlocking port */
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_CTL_CSR(portnum),
®val);
if (!(regval & RIO_PORT_N_CTL_LOCKOUT)) {
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_CTL_CSR(portnum),
regval | RIO_PORT_N_CTL_LOCKOUT);
udelay(50);
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_CTL_CSR(portnum),
regval);
}
@@ -248,7 +243,7 @@ tsi57x_em_handler(struct rio_dev *rdev, u8 portnum)
/* Read from link maintenance response register to clear
* valid bit
*/
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr + RIO_PORT_N_MNT_RSP_CSR(portnum),
®val);
@@ -257,13 +252,12 @@ tsi57x_em_handler(struct rio_dev *rdev, u8 portnum)
*/
sendcount = 3;
while (sendcount) {
- rio_mport_write_config_32(mport, destid, hopcount,
+ rio_write_config_32(rdev,
TSI578_SP_CS_TX(portnum), 0x40fc8000);
checkcount = 3;
while (checkcount--) {
udelay(50);
- rio_mport_read_config_32(
- mport, destid, hopcount,
+ rio_read_config_32(rdev,
rdev->phys_efptr +
RIO_PORT_N_MNT_RSP_CSR(portnum),
®val);
@@ -277,25 +271,23 @@ tsi57x_em_handler(struct rio_dev *rdev, u8 portnum)
exit_es:
/* Clear implementation specific error status bits */
- rio_mport_read_config_32(mport, destid, hopcount,
- TSI578_SP_INT_STATUS(portnum), &intstat);
+ rio_read_config_32(rdev, TSI578_SP_INT_STATUS(portnum), &intstat);
pr_debug("TSI578[%x:%x] SP%d_INT_STATUS=0x%08x\n",
- destid, hopcount, portnum, intstat);
+ rdev->destid, rdev->hopcount, portnum, intstat);
if (intstat & 0x10000) {
- rio_mport_read_config_32(mport, destid, hopcount,
+ rio_read_config_32(rdev,
TSI578_SP_LUT_PEINF(portnum), ®val);
regval = (mport->sys_size) ? (regval >> 16) : (regval >> 24);
route_port = rdev->rswitch->route_table[regval];
pr_debug("RIO: TSI578[%s] P%d LUT Parity Error (destID=%d)\n",
rio_name(rdev), portnum, regval);
- tsi57x_route_add_entry(mport, destid, hopcount,
+ tsi57x_route_add_entry(mport, rdev->destid, rdev->hopcount,
RIO_GLOBAL_TABLE, regval, route_port);
}
- rio_mport_write_config_32(mport, destid, hopcount,
- TSI578_SP_INT_STATUS(portnum),
- intstat & 0x000700bd);
+ rio_write_config_32(rdev, TSI578_SP_INT_STATUS(portnum),
+ intstat & 0x000700bd);
return 0;
}
diff --git a/include/linux/rio.h b/include/linux/rio.h
index 0bed941..f6e25b3 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -98,7 +98,8 @@ union rio_pw_msg;
* @dev: Device model device
* @riores: RIO resources this device owns
* @pwcback: port-write callback function for this device
- * @destid: Network destination ID
+ * @destid: Network destination ID (or associated destid for switch)
+ * @hopcount: Hopcount to this device
* @prev: Previous RIO device connected to the current one
*/
struct rio_dev {
@@ -126,6 +127,7 @@ struct rio_dev {
struct resource riores[RIO_MAX_DEV_RESOURCES];
int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
u16 destid;
+ u8 hopcount;
struct rio_dev *prev;
};
@@ -229,8 +231,6 @@ struct rio_net {
* @node: Node in global list of switches
* @rdev: Associated RIO device structure
* @switchid: Switch ID that is unique across a network
- * @hopcount: Hopcount to this switch
- * @destid: Associated destid in the path
* @route_table: Copy of switch routing table
* @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
* @add_entry: Callback for switch-specific route add function
@@ -247,8 +247,6 @@ struct rio_switch {
struct list_head node;
struct rio_dev *rdev;
u16 switchid;
- u16 hopcount;
- u16 destid;
u8 *route_table;
u32 port_ok;
int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
index edc55da..e09e565 100644
--- a/include/linux/rio_drv.h
+++ b/include/linux/rio_drv.h
@@ -150,16 +150,8 @@ static inline int rio_local_write_config_8(struct rio_mport *port, u32 offset,
static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset,
u32 * data)
{
- u8 hopcount = 0xff;
- u16 destid = rdev->destid;
-
- if (rdev->rswitch) {
- destid = rdev->rswitch->destid;
- hopcount = rdev->rswitch->hopcount;
- }
-
- return rio_mport_read_config_32(rdev->net->hport, destid, hopcount,
- offset, data);
+ return rio_mport_read_config_32(rdev->net->hport, rdev->destid,
+ rdev->hopcount, offset, data);
};
/**
@@ -174,16 +166,8 @@ static inline int rio_read_config_32(struct rio_dev *rdev, u32 offset,
static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset,
u32 data)
{
- u8 hopcount = 0xff;
- u16 destid = rdev->destid;
-
- if (rdev->rswitch) {
- destid = rdev->rswitch->destid;
- hopcount = rdev->rswitch->hopcount;
- }
-
- return rio_mport_write_config_32(rdev->net->hport, destid, hopcount,
- offset, data);
+ return rio_mport_write_config_32(rdev->net->hport, rdev->destid,
+ rdev->hopcount, offset, data);
};
/**
@@ -198,16 +182,8 @@ static inline int rio_write_config_32(struct rio_dev *rdev, u32 offset,
static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset,
u16 * data)
{
- u8 hopcount = 0xff;
- u16 destid = rdev->destid;
-
- if (rdev->rswitch) {
- destid = rdev->rswitch->destid;
- hopcount = rdev->rswitch->hopcount;
- }
-
- return rio_mport_read_config_16(rdev->net->hport, destid, hopcount,
- offset, data);
+ return rio_mport_read_config_16(rdev->net->hport, rdev->destid,
+ rdev->hopcount, offset, data);
};
/**
@@ -222,16 +198,8 @@ static inline int rio_read_config_16(struct rio_dev *rdev, u32 offset,
static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset,
u16 data)
{
- u8 hopcount = 0xff;
- u16 destid = rdev->destid;
-
- if (rdev->rswitch) {
- destid = rdev->rswitch->destid;
- hopcount = rdev->rswitch->hopcount;
- }
-
- return rio_mport_write_config_16(rdev->net->hport, destid, hopcount,
- offset, data);
+ return rio_mport_write_config_16(rdev->net->hport, rdev->destid,
+ rdev->hopcount, offset, data);
};
/**
@@ -245,16 +213,8 @@ static inline int rio_write_config_16(struct rio_dev *rdev, u32 offset,
*/
static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data)
{
- u8 hopcount = 0xff;
- u16 destid = rdev->destid;
-
- if (rdev->rswitch) {
- destid = rdev->rswitch->destid;
- hopcount = rdev->rswitch->hopcount;
- }
-
- return rio_mport_read_config_8(rdev->net->hport, destid, hopcount,
- offset, data);
+ return rio_mport_read_config_8(rdev->net->hport, rdev->destid,
+ rdev->hopcount, offset, data);
};
/**
@@ -268,16 +228,8 @@ static inline int rio_read_config_8(struct rio_dev *rdev, u32 offset, u8 * data)
*/
static inline int rio_write_config_8(struct rio_dev *rdev, u32 offset, u8 data)
{
- u8 hopcount = 0xff;
- u16 destid = rdev->destid;
-
- if (rdev->rswitch) {
- destid = rdev->rswitch->destid;
- hopcount = rdev->rswitch->hopcount;
- }
-
- return rio_mport_write_config_8(rdev->net->hport, destid, hopcount,
- offset, data);
+ return rio_mport_write_config_8(rdev->net->hport, rdev->destid,
+ rdev->hopcount, offset, data);
};
extern int rio_mport_send_doorbell(struct rio_mport *mport, u16 destid,
--
1.7.3.1
^ permalink raw reply related
* Re: [PATCH -mm 0/2] RapidIO: Changes to handling of RIO switches
From: Micha Nelissen @ 2010-10-21 21:15 UTC (permalink / raw)
To: Alexandre Bounine; +Cc: linux-kernel, Thomas Moll, akpm, linuxppc-dev
In-Reply-To: <1287688250-14226-1-git-send-email-alexandre.bounine@idt.com>
Alexandre Bounine wrote:
> 1. Using one storage location common for switches and endpoints eliminates
> unnecessary device type checks during maintenance access operations.
> While destination IDs and hop counts have different meaning for endpoints and
> switches, this does not prevent us from storing them in the primary RIO device
> structure (rio_dev) for both types.
How can you say this? The two variables have different meanings, this
logically implies you can't merge them. So how do you say 'this does not
prevent us from ...' without providing a reason?
> 2. Convert RIO switch device structures (rio_dev + rio_switch) into single
> allocation unit. This change is based on the fact that RIO switches are using
> common RIO device objects anyway. Allocating RIO switch objects as RIO devices
> with added space for switch information simplifies handling of RIO switch device
> objects.
I still don't think that's a good idea because the rdev->rswitch pointer
can be defined to point to the switch that a given rio_dev is connected
to. This is useful for quick lookups. How else can to know to which
switch a given device is connected?
Micha
^ permalink raw reply
* AUTO: Michael Barry is out of the office (returning 01/11/2010)
From: Michael Barry @ 2010-10-21 21:30 UTC (permalink / raw)
To: linuxppc-dev
I am out of the office until 01/11/2010.
Note: This is an automated response to your message "Linuxppc-dev Digest,
Vol 74, Issue 107" sent on 21/10/10 20:18:24.
This is the only notification you will receive while this person is away.
^ permalink raw reply
* Re: AUTO: Michael Barry is out of the office (returning 01/11/2010)
From: Sean MacLennan @ 2010-10-22 1:17 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <OF8881CEA1.3A60B966-ON802577C3.007620EB-802577C3.007620EB@ie.ibm.com>
On Thu, 21 Oct 2010 22:30:16 +0100
Michael Barry <michael_barry@ie.ibm.com> wrote:
> I am out of the office until 01/11/2010.
Woo hoo! Time to loot his office for the good stuff!
Cheers,
Sean
^ permalink raw reply
* [git pull] Please pull powerpc.git next branch
From: Benjamin Herrenschmidt @ 2010-10-22 3:51 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev list, Andrew Morton, Linux Kernel list
Hi Linus !
Here's powerpc's batch for this merge window. Mostly bits and pieces,
such as Anton doing some performance tuning left and right, and the
usual churn. One hilight is the support for the new Freescale e5500 core
(64-bit BookE). Another one is that we now wire up the whole lot of
socket calls as direct syscalls in addition to the old style indirect
method.
Cheers,
Ben.
The following changes since commit e10117d36ef758da0690c95ecffc09d5dd7da479:
Linus Torvalds (1):
Merge branch 'upstream-linus' of git://git.kernel.org/.../jgarzik/libata-dev
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git next
Andreas Schwab (1):
powerpc: Remove fpscr use from [kvm_]cvt_{fd,df}
Anton Blanchard (5):
powerpc: Optimise 64bit csum_partial
powerpc: Optimise 64bit csum_partial_copy_generic and add csum_and_copy_from_user
powerpc: Add 64bit csum_and_copy_to_user
powerpc: Feature nop out reservation clear when stcx checks address
powerpc: Check end of stack canary at oops time
Arnd Bergmann (1):
powerpc/spufs: Use llseek in all file operations
Benjamin Herrenschmidt (4):
powerpc/dma: Add optional platform override of dma_set_mask()
powerpc/dart_iommu: Support for 64-bit iommu bypass window on PCIe
Merge remote branch 'kumar/merge' into next
Merge remote branch 'jwb/next' into next
Denis Kirjanov (1):
powerpc: Use is_32bit_task() helper to test 32-bit binary
Harninder Rai (1):
powerpc/85xx: add cache-sram support
Ian Munsie (1):
powerpc: Wire up direct socket system calls
Ilya Yanok (1):
powerpc/mpc83xx: Support for MPC8308 P1M board
Joe Perches (2):
powerpc: Use static const char arrays
powerpc: Remove pr_<level> uses of KERN_<level>
Josh Boyer (1):
powerpc/44x: Update ppc44x_defconfig
Julia Lawall (7):
powerpc/via-pmu-led.c: Add of_node_put to avoid memory leak
powerpc/maple: Add of_node_put to avoid memory leak
powerpc/powermac/pfunc_core.c: Add of_node_put to avoid memory leak
powerpc/cell: Add of_node_put to avoid memory leak
powerpc/chrp/nvram.c: Add of_node_put to avoid memory leak
powerpc/irq.c: Add of_node_put to avoid memory leak
i2c/i2c-pasemi.c: Fix unsigned return type
Kumar Gala (11):
powerpc/ppc64e: Fix link problem when building ppc64e_defconfig
powerpc/fsl-pci: Fix MSI support on 83xx platforms
powerpc/mpc8xxx_gpio: Add support for 'qoriq-gpio' controllers
powerpc/fsl-booke: Add PCI device ids for P2040/P3041/P5010/P5020 QoirQ chips
powerpc/fsl-booke: Add p3041 DS board support
powerpc: Fix compile error with paca code on ppc64e
powerpc/fsl-booke: Add support for FSL 64-bit e5500 core
powerpc/fsl-booke: Add support for FSL Arch v1.0 MMU in setup_page_sizes
powerpc/fsl-booke64: Use TLB CAMs to cover linear mapping on FSL 64-bit chips
powerpc/fsl-booke: Add p5020 DS board support
powerpc/fsl-booke: Add e55xx (64-bit) smp defconfig
Matthew McClintock (7):
powerpc/mm: Assume first cpu is boot_cpuid not 0
powerpc/kexec: make masking/disabling interrupts generic
powerpc/85xx: Remove call to mpic_teardown_this_cpu in kexec
powerpc/85xx: Minor fixups for kexec on 85xx
powerpc/85xx: flush dcache before resetting cores
powerpc/fsl_soc: Search all global-utilities nodes for rstccr
powerpc/fsl_booke: Add support to boot from core other than 0
Michael Neuling (1):
powerpc: Move arch_sd_sibling_asym_packing() to smp.c
Nathan Fontenot (3):
powerpc/pseries: Export device tree updating routines
powerpc/pseries: Export rtas_ibm_suspend_me()
powerpc/pseries: Partition migration in the kernel
Nishanth Aravamudan (8):
powerpc/pci: Fix return type of BUID_{HI,LO} macros
powerpc/dma: Fix dma_iommu_dma_supported compare
powerpc/dma: Fix check for direct DMA support
powerpc/vio: Use put_device() on device_register failure
powerpc/viobus: Free TCE table on device release
powerpc/pseries: Use kmemdup
powerpc/pci: Cleanup device dma setup code
powerpc/pseries/xics: Use cpu_possible_mask rather than cpu_all_mask
Paul Gortmaker (1):
powerpc: Fix invalid page flags in create TLB CAM path for PTE_64BIT
Paul Mackerras (5):
powerpc: Abstract indexing of lppaca structs
powerpc: Dynamically allocate most lppaca structs
powerpc: Account time using timebase rather than PURR
powerpc/pseries: Re-enable dispatch trace log userspace interface
powerpc/perf: Fix sampling enable for PPC970
Scott Wood (1):
oprofile/fsl emb: Don't set MSR[PMM] until after clearing the interrupt.
Sean MacLennan (2):
powerpc: Fix incorrect .stabs entry for copy_32.S
powerpc: mtmsrd not defined
Shaohui Xie (1):
fsl_rio: Add comments for sRIO registers.
Stephen Rothwell (1):
powerpc: define a compat_sys_recv cond_syscall
Timur Tabi (5):
powerpc: export ppc_proc_freq and ppc_tb_freq as GPL symbols
powerpc/watchdog: Allow the Book-E driver to be compiled as a module
powerpc/p1022: Add probing for individual DMA channels
powerpc/85xx: add ngPIXIS FPGA device tree node to the P1022DS board
powerpc/watchdog: Make default timeout for Book-E watchdog a Kconfig option
Tirumala Marri (1):
powerpc/44x: Add support for the AMCC APM821xx SoC
matt mooney (1):
powerpc/Makefiles: Change to new flag variables
arch/powerpc/boot/addnote.c | 4 +-
arch/powerpc/boot/dts/bluestone.dts | 254 +++++++++++++
arch/powerpc/boot/dts/mpc8308_p1m.dts | 332 ++++++++++++++++
arch/powerpc/boot/dts/p1022ds.dts | 11 +
arch/powerpc/configs/44x/bluestone_defconfig | 68 ++++
arch/powerpc/configs/e55xx_smp_defconfig | 84 ++++
arch/powerpc/configs/ppc44x_defconfig | 9 +-
arch/powerpc/configs/ppc64e_defconfig | 4 +-
arch/powerpc/include/asm/checksum.h | 10 +
arch/powerpc/include/asm/compat.h | 4 +-
arch/powerpc/include/asm/cputable.h | 14 +-
arch/powerpc/include/asm/dma-mapping.h | 14 +-
arch/powerpc/include/asm/elf.h | 2 +-
arch/powerpc/include/asm/exception-64s.h | 3 +-
arch/powerpc/include/asm/fsl_85xx_cache_sram.h | 48 +++
arch/powerpc/include/asm/kexec.h | 1 +
arch/powerpc/include/asm/kvm_fpu.h | 4 +-
arch/powerpc/include/asm/lppaca.h | 29 ++
arch/powerpc/include/asm/machdep.h | 3 +
arch/powerpc/include/asm/mmu-book3e.h | 15 +
arch/powerpc/include/asm/paca.h | 10 +-
arch/powerpc/include/asm/page_64.h | 4 +-
arch/powerpc/include/asm/ppc-pci.h | 4 +-
arch/powerpc/include/asm/ppc_asm.h | 50 ++-
arch/powerpc/include/asm/processor.h | 4 +-
arch/powerpc/include/asm/pte-common.h | 7 +
arch/powerpc/include/asm/rtas.h | 1 +
arch/powerpc/include/asm/systbl.h | 19 +
arch/powerpc/include/asm/system.h | 4 +-
arch/powerpc/include/asm/time.h | 5 -
arch/powerpc/include/asm/unistd.h | 21 +-
arch/powerpc/kernel/Makefile | 4 +-
arch/powerpc/kernel/align.c | 4 +-
arch/powerpc/kernel/asm-offsets.c | 12 +-
arch/powerpc/kernel/cpu_setup_44x.S | 1 +
arch/powerpc/kernel/cpu_setup_fsl_booke.S | 15 +
arch/powerpc/kernel/cputable.c | 43 ++-
arch/powerpc/kernel/crash.c | 13 +-
arch/powerpc/kernel/dma-iommu.c | 21 +-
arch/powerpc/kernel/dma.c | 20 +-
arch/powerpc/kernel/entry_64.S | 40 ++
arch/powerpc/kernel/fpu.S | 10 -
arch/powerpc/kernel/head_fsl_booke.S | 10 +-
arch/powerpc/kernel/irq.c | 6 +-
arch/powerpc/kernel/lparcfg.c | 14 +-
arch/powerpc/kernel/machine_kexec.c | 24 ++
arch/powerpc/kernel/machine_kexec_32.c | 4 +
arch/powerpc/kernel/paca.c | 70 ++++-
arch/powerpc/kernel/pci-common.c | 4 +-
arch/powerpc/kernel/ppc970-pmu.c | 2 +
arch/powerpc/kernel/process.c | 12 -
arch/powerpc/kernel/ptrace.c | 2 +-
arch/powerpc/kernel/rtas.c | 4 +-
arch/powerpc/kernel/setup_32.c | 2 +-
arch/powerpc/kernel/smp.c | 14 +-
arch/powerpc/kernel/time.c | 275 +++++++-------
arch/powerpc/kernel/traps.c | 5 +
arch/powerpc/kernel/vdso.c | 6 +-
arch/powerpc/kernel/vdso32/Makefile | 6 +-
arch/powerpc/kernel/vdso64/Makefile | 6 +-
arch/powerpc/kernel/vio.c | 10 +-
arch/powerpc/kvm/Makefile | 2 +-
arch/powerpc/kvm/book3s_paired_singles.c | 44 +--
arch/powerpc/kvm/emulate.c | 4 +-
arch/powerpc/kvm/fpu.S | 8 -
arch/powerpc/lib/Makefile | 7 +-
arch/powerpc/lib/checksum_64.S | 482 +++++++++++++++++-------
arch/powerpc/lib/checksum_wrappers_64.c | 102 +++++
arch/powerpc/lib/copy_32.S | 2 +-
arch/powerpc/lib/ldstfp.S | 36 +-
arch/powerpc/lib/locks.c | 4 +-
arch/powerpc/lib/sstep.c | 8 +
arch/powerpc/math-emu/Makefile | 2 +-
arch/powerpc/mm/Makefile | 6 +-
arch/powerpc/mm/fault.c | 6 +
arch/powerpc/mm/fsl_booke_mmu.c | 15 +-
arch/powerpc/mm/mmu_context_nohash.c | 6 +-
arch/powerpc/mm/mmu_decl.h | 5 +-
arch/powerpc/mm/tlb_nohash.c | 56 +++-
arch/powerpc/mm/tlb_nohash_low.S | 2 +-
arch/powerpc/oprofile/Makefile | 4 +-
arch/powerpc/oprofile/backtrace.c | 2 +-
arch/powerpc/oprofile/op_model_fsl_emb.c | 15 +-
arch/powerpc/platforms/44x/Kconfig | 16 +
arch/powerpc/platforms/44x/ppc44x_simple.c | 1 +
arch/powerpc/platforms/83xx/Kconfig | 4 +-
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 3 +-
arch/powerpc/platforms/85xx/Kconfig | 28 ++-
arch/powerpc/platforms/85xx/Makefile | 2 +
arch/powerpc/platforms/85xx/p1022_ds.c | 2 +
arch/powerpc/platforms/85xx/p3041_ds.c | 64 ++++
arch/powerpc/platforms/85xx/p5020_ds.c | 69 ++++
arch/powerpc/platforms/85xx/smp.c | 83 ++++-
arch/powerpc/platforms/Kconfig.cputype | 8 +-
arch/powerpc/platforms/cell/ras.c | 4 +-
arch/powerpc/platforms/cell/spider-pic.c | 4 +-
arch/powerpc/platforms/cell/spufs/file.c | 18 +
arch/powerpc/platforms/chrp/nvram.c | 4 +-
arch/powerpc/platforms/iseries/Makefile | 2 +-
arch/powerpc/platforms/iseries/dt.c | 4 +-
arch/powerpc/platforms/iseries/smp.c | 2 +-
arch/powerpc/platforms/maple/setup.c | 1 +
arch/powerpc/platforms/powermac/pfunc_core.c | 9 +-
arch/powerpc/platforms/pseries/Makefile | 13 +-
arch/powerpc/platforms/pseries/dlpar.c | 7 +-
arch/powerpc/platforms/pseries/dtl.c | 224 +++++++++---
arch/powerpc/platforms/pseries/lpar.c | 25 ++-
arch/powerpc/platforms/pseries/mobility.c | 362 ++++++++++++++++++
arch/powerpc/platforms/pseries/pseries.h | 9 +
arch/powerpc/platforms/pseries/setup.c | 52 +++
arch/powerpc/platforms/pseries/xics.c | 2 +-
arch/powerpc/sysdev/Makefile | 5 +-
arch/powerpc/sysdev/dart_iommu.c | 74 ++++-
arch/powerpc/sysdev/fsl_85xx_cache_ctlr.h | 101 +++++
arch/powerpc/sysdev/fsl_85xx_cache_sram.c | 159 ++++++++
arch/powerpc/sysdev/fsl_85xx_l2ctlr.c | 231 +++++++++++
arch/powerpc/sysdev/fsl_msi.c | 9 +-
arch/powerpc/sysdev/fsl_pci.c | 60 +++-
arch/powerpc/sysdev/fsl_pci.h | 1 +
arch/powerpc/sysdev/fsl_rio.c | 65 ++--
arch/powerpc/sysdev/fsl_soc.c | 20 +-
arch/powerpc/sysdev/mpc8xxx_gpio.c | 3 +
arch/powerpc/sysdev/pmi.c | 2 +-
arch/powerpc/xmon/Makefile | 4 +-
drivers/i2c/busses/i2c-pasemi.c | 2 +-
drivers/macintosh/via-pmu-led.c | 4 +-
drivers/watchdog/Kconfig | 22 +-
drivers/watchdog/booke_wdt.c | 47 ++-
include/linux/pci_ids.h | 8 +
kernel/sys_ni.c | 1 +
130 files changed, 3676 insertions(+), 683 deletions(-)
create mode 100644 arch/powerpc/boot/dts/bluestone.dts
create mode 100644 arch/powerpc/boot/dts/mpc8308_p1m.dts
create mode 100644 arch/powerpc/configs/44x/bluestone_defconfig
create mode 100644 arch/powerpc/configs/e55xx_smp_defconfig
create mode 100644 arch/powerpc/include/asm/fsl_85xx_cache_sram.h
create mode 100644 arch/powerpc/lib/checksum_wrappers_64.c
create mode 100644 arch/powerpc/platforms/85xx/p3041_ds.c
create mode 100644 arch/powerpc/platforms/85xx/p5020_ds.c
create mode 100644 arch/powerpc/platforms/pseries/mobility.c
create mode 100644 arch/powerpc/sysdev/fsl_85xx_cache_ctlr.h
create mode 100644 arch/powerpc/sysdev/fsl_85xx_cache_sram.c
create mode 100644 arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
^ permalink raw reply
* Re: [git pull] Please pull powerpc.git next branch
From: Linus Torvalds @ 2010-10-22 4:23 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev list, Andrew Morton, Linux Kernel list
In-Reply-To: <1287719462.2198.37.camel@pasglop>
On Thu, Oct 21, 2010 at 8:51 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
>
> Here's powerpc's batch for this merge window.
Ok. Please double-check that I fixed up the merge conflict (due to the
irq_work changes) correctly.
Linus
^ permalink raw reply
* [PATCH 0/9] Typo fixes of faild to failed
From: Joe Perches @ 2010-10-22 5:17 UTC (permalink / raw)
To: Jiri Kosina
Cc: cbe-oss-dev, jfs-discussion, rtc-linux, netdev, linux-kernel,
dri-devel, linux-ide, osd-dev, linuxppc-dev, linux-arm-kernel
Joe Perches (9):
drivers/ata: typo fix of faild to failed
drivers/gpu: typo fix of faild to failed
drivers/net: typo fix of faild to failed
drivers/rtc: typo fix of faild to failed
drivers/video: typo fix of faild to failed
fs/exofs: typo fix of faild to failed
fs/jfs: typo fix of faild to failed
kernel/trace: typo fix of faild to failed
net/wanrouter: typo fix of faild to failed
drivers/ata/pata_bf54x.c | 2 +-
drivers/gpu/drm/radeon/radeon_cs.c | 2 +-
drivers/net/ps3_gelic_net.c | 4 ++--
drivers/net/tulip/pnic2.c | 2 +-
drivers/rtc/rtc-nuc900.c | 2 +-
drivers/video/bf54x-lq043fb.c | 6 +++---
drivers/video/bfin-t350mcqb-fb.c | 2 +-
fs/exofs/dir.c | 4 ++--
fs/exofs/inode.c | 14 +++++++-------
fs/exofs/ios.c | 10 +++++-----
fs/jfs/jfs_mount.c | 4 ++--
kernel/trace/trace_kprobe.c | 2 +-
net/wanrouter/wanmain.c | 4 ++--
13 files changed, 29 insertions(+), 29 deletions(-)
--
1.7.3.1.g432b3.dirty
^ permalink raw reply
* [PATCH 3/9] drivers/net: typo fix of faild to failed
From: Joe Perches @ 2010-10-22 5:17 UTC (permalink / raw)
To: Jiri Kosina
Cc: cbe-oss-dev, Grant Grundler, Geoff Levand, netdev, linux-kernel,
Kyle McMartin, linuxppc-dev
In-Reply-To: <cover.1287724261.git.joe@perches.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/ps3_gelic_net.c | 4 ++--
drivers/net/tulip/pnic2.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 87d6b8f..49f6700 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -642,7 +642,7 @@ static inline void gelic_card_disable_rxdmac(struct gelic_card *card)
status = lv1_net_stop_rx_dma(bus_id(card), dev_id(card), 0);
if (status)
dev_err(ctodev(card),
- "lv1_net_stop_rx_dma faild, %d\n", status);
+ "lv1_net_stop_rx_dma failed, %d\n", status);
}
/**
@@ -660,7 +660,7 @@ static inline void gelic_card_disable_txdmac(struct gelic_card *card)
status = lv1_net_stop_tx_dma(bus_id(card), dev_id(card), 0);
if (status)
dev_err(ctodev(card),
- "lv1_net_stop_tx_dma faild, status=%d\n", status);
+ "lv1_net_stop_tx_dma failed, status=%d\n", status);
}
/**
diff --git a/drivers/net/tulip/pnic2.c b/drivers/net/tulip/pnic2.c
index b819766..186d725 100644
--- a/drivers/net/tulip/pnic2.c
+++ b/drivers/net/tulip/pnic2.c
@@ -59,7 +59,7 @@
* Bit 14:12 - autonegotiation state (write 001 to start autonegotiate)
* Bit 3 - Autopolarity state
* Bit 2 - LS10B - link state of 10baseT 0 - good, 1 - failed
- * Bit 1 - LS100B - link state of 100baseT 0 - good, 1- faild
+ * Bit 1 - LS100B - link state of 100baseT 0 - good, 1- failed
*
*
* Data Port Selection Info
--
1.7.3.1.g432b3.dirty
^ permalink raw reply related
* Re: [PATCH v4 5/5] mtd: m25p80: add support to parse the partitions by OF node
From: Kumar Gala @ 2010-10-22 6:01 UTC (permalink / raw)
To: Grant Likely
Cc: dedekind1, David Brownell, Linuxppc-dev list, linux-mtd,
spi-devel-general, Mingkai Hu
In-Reply-To: <1287301490.1951.0.camel@localhost>
On Oct 17, 2010, at 2:44 AM, Artem Bityutskiy wrote:
> On Sat, 2010-10-16 at 19:05 -0600, Grant Likely wrote:
>> On Sat, Oct 16, 2010 at 1:17 PM, Artem Bityutskiy =
<dedekind1@gmail.com> wrote:
>>> On Tue, 2010-10-12 at 18:18 +0800, Mingkai Hu wrote:
>>>> Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
>>>> Acked-by: Grant Likely <grant.likely@secretlab.ca>
>>>> ---
>>>> v4:
>>>> - Updated to latest kernel base(Linux 2.6.36-rc7).
>>>> - Made changes according to Grant's comments.
>>>=20
>>> Looks good to me, pushed to l2-mtd-2.6.git, thanks.
>>=20
>> Wait! It will break whenever CONFIG_OF is not set. I broke
>> linux-next with this patch. It can be solved by wrapping the block
>> with #ifdef CONFIG_OF, but I'd like to find a better solution.
>=20
> OK, removed.
Grant, poke. Would like to see this either resolved or have this patch =
go in for .37 w/CONFIG_OF and fix properly for .38.
- k=
^ permalink raw reply
* BUG with the kernel version 2.6.36-rc1 on power machine
From: divya @ 2010-10-22 7:20 UTC (permalink / raw)
To: LKML, benh, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 755 bytes --]
Hi ,
With the latest version of kernel 2.6.36-rc1 running on the power machine, came across the following call trace
BUG: looking up invalid subclass: 31
turning off the locking correctness validator.
Call Trace:
[c00000000e0bfb60] [c0000000000119a0] .show_stack+0x6c/0x16c (unreliable)
[c00000000e0bfc10] [c0000000000c39b8] .lockdep_init_map+0x194/0x630
[c00000000e0bfcf0] [c0000000005524f8] .mousedev_create+0xcc/0x234
[c00000000e0bfda0] [c00000000093fb58] .mousedev_init+0x38/0xa0
[c00000000e0bfe30] [c0000000000097e4] .do_one_initcall+0xd8/0x1c8
[c00000000e0bfee0] [c0000000009004ac] .kernel_init+0x23c/0x2f8
[c00000000e0bff90] [c00000000002ad30] .kernel_thread+0x54/0x70
The config file used for make oldconfig is being attached
Thanks
Divya
[-- Attachment #2: config_ppc_slub --]
[-- Type: text/plain, Size: 3583 bytes --]
CONFIG_ALTIVEC=y
# CONFIG_WIRELESS is not set
CONFIG_VSX=y
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_XACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_HAVE_KPROBES=y
CONFIG_HAVE_KRETPROBES=y
CONFIG_TREE_RCU=y
CONFIG_RCU_FANOUT=64
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_KPROBES=y
CONFIG_CMM=y
CONFIG_PPC_HAS_HASH_64K=y
CONFIG_PPC_64K_PAGES=y
CONFIG_FORCE_MAX_ZONEORDER=9
CONFIG_PPC_SUBPAGE_PROT=y
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_HAS_WALK_MEMORY=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_KEXEC=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_MEMORY_HOTPLUG_SPARSE=y
CONFIG_MEMORY_HOTREMOVE=y
CONFIG_IBMEBUS=y
CONFIG_EHEA=y
CONFIG_SCSI_IBMVSCSI=y
CONFIG_SCSI_IBMVFC=m
CONFIG_SCSI_IPR=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DETECT_SOFTLOCKUP=y
CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_SPINLOCK_SLEEP=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_INFO=y
CONFIG_KPROBES_SANITY_TEST=y
CONFIG_LATENCYTOP=y
CONFIG_SYSCTL_SYSCALL_CHECK=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_NOP_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_RING_BUFFER=y
CONFIG_TRACING=y
CONFIG_TRACING_SUPPORT=y
ONFIG_BLK_DEV_IO_TRACE=y
CONFIG_FTRACE_SELFTEST=y
CONFIG_FTRACE_STARTUP_TEST=y
CONFIG_KEYS=y
CONFIG_KEYS_DEBUG_PROC_KEYS=y
CONFIG_SECURITY=y
CONFIG_SECURITYFS=y
CONFIG_SECURITY_NETWORK=y
CONFIG_RCU_CPU_STALL_DETECTOR=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
CONFIG_EXT2_FS_SECURITY=y
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=y
CONFIG_EXT4DEV_COMPAT=y
CONFIG_EXT4_FS_XATTR=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_JBD=y
CONFIG_JBD2=y
CONFIG_REISERFS_PROC_INFO=y
CONFIG_REISERFS_FS_XATTR=y
CONFIG_REISERFS_FS_POSIX_ACL=y
CONFIG_REISERFS_FS_SECURITY=y
CONFIG_JFS_FS=m
CONFIG_JFS_POSIX_ACL=y
CONFIG_JFS_SECURITY=y
CONFIG_JFS_STATISTICS=y
CONFIG_FS_POSIX_ACL=y
CONFIG_FILE_LOCKING=y
CONFIG_XFS_FS=m
CONFIG_XFS_QUOTA=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_XFS_RT=y
CONFIG_GFS2_FS=m
CONFIG_GFS2_FS_LOCKING_DLM=m
CONFIG_OCFS2_FS=m
CONFIG_OCFS2_FS_O2CB=m
CONFIG_OCFS2_FS_USERSPACE_CLUSTER=m
CONFIG_OCFS2_FS_STATS=y
CONFIG_BTRFS_FS=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_LOCALVERSION_AUTO=n
CONFIG_LOCALVERSION=""
CONFIG_SLUB_DEBUG=y
CONFIG_SLUB=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_HAVE_PERF_COUNTERS=y
CONFIG_PERF_COUNTERS=y
CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
CONFIG_FSNOTIFY=y
CONFIG_RCU_TORTURE_TEST=y
CONFIG_RCU_TORTURE_TEST_RUNNABLE=y
CONFIG_RCU_CPU_STALL_DETECTOR=y
CONFIG_PERF_EVENTS=y
CONFIG_PPC_OF_BOOT_TRAMPOLINE=y
CONFIG_BLOCK=y
CONFIG_BLK_DEV_BSG=y
CONFIG_BLK_DEV_INTEGRITY=y
CONFIG_BLK_CGROUP=y
CONFIG_DEBUG_BLK_CGROUP=y
CONFIG_BLOCK_COMPAT=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_CFQ=y
CONFIG_CFQ_GROUP_IOSCHED=y
CONFIG_DEBUG_CFQ_IOSCHED=y
CONFIG_DEFAULT_CFQ=y
CONFIG_DEFAULT_IOSCHED="cfq"
CONFIG_VIRTUALIZATION=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
CONFIG_NR_IRQS=512
CONFIG_MIGRATION=y
CONFIG_KSM=y
CONFIG_PM=y
CONFIG_SUSPEND=y
CONFIG_SUSPEND_FREEZER=y
CONFIG_HIBERNATION=y
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_LOCK_STAT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_LOCKDEP=y
CONFIG_IXGBE_DCB=y
CONFIG_DCB=y
^ permalink raw reply
* Re: [PATCH] powerpc: Fix hcall tracepoint recursion
From: Li Zefan @ 2010-10-22 7:22 UTC (permalink / raw)
To: Anton Blanchard, subrata
Cc: ltp-list, Peter Zijlstra, LKML, Steven Rostedt, Paul Mackerras,
Ingo Molnar, linuxppc-dev
In-Reply-To: <20101021215212.4a982c85@kryten>
Anton Blanchard wrote:
> Hi,
>
>> This is a dead loop:
>>
>> trace_hcall_entry() -> trace_clock_global() -> trace_hcall_entry() ..
>>
>> And this is a PPC specific bug. Hope some ppc guys will fix it?
>> Or we kill trace_clock_global() if no one actually uses it..
>
> Nasty! How does the patch below look? I had to disable irqs otherwise
> we would sometimes drop valid events (if we take an interrupt anywhere
> in the region where depth is elevated, then the entire interrupt will
> be blocked from calling hcall tracepoints.
>
Thanks!
Subrata, could you test the patch below?
> Anton
> --
>
> Subject: [PATCH] powerpc: Fix hcall tracepoint recursion
>
> Spinlocks on shared processor partitions use H_YIELD to notify the
> hypervisor we are waiting on another virtual CPU. Unfortunately this means
> the hcall tracepoints can recurse.
>
> The patch below adds a percpu depth and checks it on both the entry and
> exit hcall tracepoints.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: powerpc.git/arch/powerpc/platforms/pseries/lpar.c
> ===================================================================
> --- powerpc.git.orig/arch/powerpc/platforms/pseries/lpar.c 2010-10-21 17:32:00.980003644 +1100
> +++ powerpc.git/arch/powerpc/platforms/pseries/lpar.c 2010-10-21 17:34:54.942681273 +1100
> @@ -701,6 +701,13 @@ EXPORT_SYMBOL(arch_free_page);
> /* NB: reg/unreg are called while guarded with the tracepoints_mutex */
> extern long hcall_tracepoint_refcount;
>
> +/*
> + * Since the tracing code might execute hcalls we need to guard against
> + * recursion. One example of this are spinlocks calling H_YIELD on
> + * shared processor partitions.
> + */
> +static DEFINE_PER_CPU(unsigned int, hcall_trace_depth);
> +
> void hcall_tracepoint_regfunc(void)
> {
> hcall_tracepoint_refcount++;
> @@ -713,12 +720,42 @@ void hcall_tracepoint_unregfunc(void)
>
> void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
> {
> + unsigned long flags;
> + unsigned int *depth;
> +
> + local_irq_save(flags);
> +
> + depth = &__get_cpu_var(hcall_trace_depth);
> +
> + if (*depth)
> + goto out;
> +
> + (*depth)++;
> trace_hcall_entry(opcode, args);
> + (*depth)--;
> +
> +out:
> + local_irq_restore(flags);
> }
>
> void __trace_hcall_exit(long opcode, unsigned long retval,
> unsigned long *retbuf)
> {
> + unsigned long flags;
> + unsigned int *depth;
> +
> + local_irq_save(flags);
> +
> + depth = &__get_cpu_var(hcall_trace_depth);
> +
> + if (*depth)
> + goto out;
> +
> + (*depth)++;
> trace_hcall_exit(opcode, retval, retbuf);
> + (*depth)--;
> +
> +out:
> + local_irq_restore(flags);
> }
> #endif
>
>
^ permalink raw reply
* Re: [PATCH] powerpc: Fix hcall tracepoint recursion
From: Subrata Modak @ 2010-10-22 7:25 UTC (permalink / raw)
To: Li Zefan
Cc: ltp-list, Peter Zijlstra, LKML, Steven Rostedt, Paul Mackerras,
Anton Blanchard, Ingo Molnar, linuxppc-dev
In-Reply-To: <4CC13BB8.7090003@cn.fujitsu.com>
On Fri, 2010-10-22 at 15:22 +0800, Li Zefan wrote:
> Anton Blanchard wrote:
> > Hi,
> >
> >> This is a dead loop:
> >>
> >> trace_hcall_entry() -> trace_clock_global() -> trace_hcall_entry() ..
> >>
> >> And this is a PPC specific bug. Hope some ppc guys will fix it?
> >> Or we kill trace_clock_global() if no one actually uses it..
> >
> > Nasty! How does the patch below look? I had to disable irqs otherwise
> > we would sometimes drop valid events (if we take an interrupt anywhere
> > in the region where depth is elevated, then the entire interrupt will
> > be blocked from calling hcall tracepoints.
> >
>
> Thanks!
>
> Subrata, could you test the patch below?
Yes, definitely. Givmme some time.
Regards--
Subrata
>
> > Anton
> > --
> >
> > Subject: [PATCH] powerpc: Fix hcall tracepoint recursion
> >
> > Spinlocks on shared processor partitions use H_YIELD to notify the
> > hypervisor we are waiting on another virtual CPU. Unfortunately this means
> > the hcall tracepoints can recurse.
> >
> > The patch below adds a percpu depth and checks it on both the entry and
> > exit hcall tracepoints.
> >
> > Signed-off-by: Anton Blanchard <anton@samba.org>
> > ---
> >
> > Index: powerpc.git/arch/powerpc/platforms/pseries/lpar.c
> > ===================================================================
> > --- powerpc.git.orig/arch/powerpc/platforms/pseries/lpar.c 2010-10-21 17:32:00.980003644 +1100
> > +++ powerpc.git/arch/powerpc/platforms/pseries/lpar.c 2010-10-21 17:34:54.942681273 +1100
> > @@ -701,6 +701,13 @@ EXPORT_SYMBOL(arch_free_page);
> > /* NB: reg/unreg are called while guarded with the tracepoints_mutex */
> > extern long hcall_tracepoint_refcount;
> >
> > +/*
> > + * Since the tracing code might execute hcalls we need to guard against
> > + * recursion. One example of this are spinlocks calling H_YIELD on
> > + * shared processor partitions.
> > + */
> > +static DEFINE_PER_CPU(unsigned int, hcall_trace_depth);
> > +
> > void hcall_tracepoint_regfunc(void)
> > {
> > hcall_tracepoint_refcount++;
> > @@ -713,12 +720,42 @@ void hcall_tracepoint_unregfunc(void)
> >
> > void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
> > {
> > + unsigned long flags;
> > + unsigned int *depth;
> > +
> > + local_irq_save(flags);
> > +
> > + depth = &__get_cpu_var(hcall_trace_depth);
> > +
> > + if (*depth)
> > + goto out;
> > +
> > + (*depth)++;
> > trace_hcall_entry(opcode, args);
> > + (*depth)--;
> > +
> > +out:
> > + local_irq_restore(flags);
> > }
> >
> > void __trace_hcall_exit(long opcode, unsigned long retval,
> > unsigned long *retbuf)
> > {
> > + unsigned long flags;
> > + unsigned int *depth;
> > +
> > + local_irq_save(flags);
> > +
> > + depth = &__get_cpu_var(hcall_trace_depth);
> > +
> > + if (*depth)
> > + goto out;
> > +
> > + (*depth)++;
> > trace_hcall_exit(opcode, retval, retbuf);
> > + (*depth)--;
> > +
> > +out:
> > + local_irq_restore(flags);
> > }
> > #endif
> >
> >
^ permalink raw reply
* Re: [PATCH v4 5/5] mtd: m25p80: add support to parse the partitions by OF node
From: Grant Likely @ 2010-10-22 7:39 UTC (permalink / raw)
To: Kumar Gala
Cc: dedekind1, David Brownell, Linuxppc-dev list, linux-mtd,
spi-devel-general, Mingkai Hu
In-Reply-To: <3AE1F37D-F328-40EF-8B35-F94CC074D384@freescale.com>
On Fri, Oct 22, 2010 at 01:01:12AM -0500, Kumar Gala wrote:
>
> On Oct 17, 2010, at 2:44 AM, Artem Bityutskiy wrote:
>
> > On Sat, 2010-10-16 at 19:05 -0600, Grant Likely wrote:
> >> On Sat, Oct 16, 2010 at 1:17 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> >>> On Tue, 2010-10-12 at 18:18 +0800, Mingkai Hu wrote:
> >>>> Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com>
> >>>> Acked-by: Grant Likely <grant.likely@secretlab.ca>
> >>>> ---
> >>>> v4:
> >>>> - Updated to latest kernel base(Linux 2.6.36-rc7).
> >>>> - Made changes according to Grant's comments.
> >>>
> >>> Looks good to me, pushed to l2-mtd-2.6.git, thanks.
> >>
> >> Wait! It will break whenever CONFIG_OF is not set. I broke
> >> linux-next with this patch. It can be solved by wrapping the block
> >> with #ifdef CONFIG_OF, but I'd like to find a better solution.
> >
> > OK, removed.
>
> Grant, poke. Would like to see this either resolved or have this patch go in for .37 w/CONFIG_OF and fix properly for .38.
>
Okay, I've added it to my devicetree/next branch with the fix.
Assuming no last minute linux-next problems, I'll be asking Linus to
pull that branch early next week.
g.
^ permalink raw reply
* Re: BUG with the kernel version 2.6.36-rc1 on power machine
From: divya @ 2010-10-22 7:40 UTC (permalink / raw)
To: LKML, benh, linuxppc-dev
In-Reply-To: <4CC13B2C.7090908@linux.vnet.ibm.com>
On Friday 22 October 2010 12:50 PM, divya wrote:
> Hi ,
>
> With the latest version of kernel 2.6.36-rc1 running on the power
> machine, came across the following call trace
>
> BUG: looking up invalid subclass: 31
> turning off the locking correctness validator.
> Call Trace:
> [c00000000e0bfb60] [c0000000000119a0] .show_stack+0x6c/0x16c (unreliable)
> [c00000000e0bfc10] [c0000000000c39b8] .lockdep_init_map+0x194/0x630
> [c00000000e0bfcf0] [c0000000005524f8] .mousedev_create+0xcc/0x234
> [c00000000e0bfda0] [c00000000093fb58] .mousedev_init+0x38/0xa0
> [c00000000e0bfe30] [c0000000000097e4] .do_one_initcall+0xd8/0x1c8
> [c00000000e0bfee0] [c0000000009004ac] .kernel_init+0x23c/0x2f8
> [c00000000e0bff90] [c00000000002ad30] .kernel_thread+0x54/0x70
>
> The config file used for make oldconfig is being attached
>
> Thanks
> Divya
>
>
>
>
I meant 2.6.36-git1(b5153163ed580e) , and not 2.6.36-rc1.
Sorry for the confusion.
Thanks
Divya
^ permalink raw reply
* Re: PROBLEM: memory corrupting bug, bisected to 6dda9d55
From: pacman @ 2010-10-22 9:15 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <1287608215.2198.23.camel@pasglop>
Benjamin Herrenschmidt writes:
>
> On Wed, 2010-10-20 at 13:33 -0500, pacman@kosh.dhis.org wrote:
> > > Just try :-) "quiesce" is something that afaik only apple ever
> > > implemented anyways. It uses hooks inside their OF to shut down all
> > > drivers that do bus master (among other HW sanitization tasks).
> >
> > I booted a version with a prom_close_stdout after the last prom_debug. It
> > didn't have any effect. That 1000Hz clock was still ticking.
>
> Ok so you'll have to make up a "workaround" in prom_init that looks for
> OHCI's in the device-tree and disable them.
I'm a long way from understanding how to do that.
>
> Check if the OHCI node has some existing f-code words you can use for
> that with "dev /path-to-ohci words" in OF for example. If not, you may
Nothing there but open close decode-unit encode-unit
> need to use the low level register accessors. Use OF client interface
> "interpret" to run forth code from C.
Here are the major problems:
1. How do I locate all usb nodes in the device tree?
2. How do I know if a particular usb node is OHCI?
3. Knowing that a node is OHCI, how do I know where its control registers
are? I'm sure this is calculated from the "reg" property but I don't see how.
4. Knowing where the control registers are, how do I access them? Do I need
to request a virt-to-phys mapping or can I assume that it's already mapped,
or that the "rl!" command will do the right thing with a physical address?
5. Which control register should I use to tell the OHCI to be quiet? Just do
a general reset, or is there something that specifically turns off the
counter that's been causing the trouble?
--
Alan Curry
^ permalink raw reply
* [PATCH 1/1] powerpc: Fix initramfs size in PPC32 build
From: Kerstin Jonsson @ 2010-10-22 10:17 UTC (permalink / raw)
To: benh, linuxppc-dev, linux-mmc; +Cc: Kerstin Jonsson, Paul Mackerras
commit ffe8018c3424892c9590048fc36caa6c3e0c8a76 of the -mm tree
fixes the initramfs size calculation for e.g. s390 but breaks it
for 32bit architectures which do not define CONFIG_32BIT.
This patch fix the problem for PPC32 which will elsewise end up
with a __initramfs_size of 0.
Signed-off-by: Kerstin Jonsson <kerstin.jonsson@ericsson.com>
Cc: Paul Mackerras <paulus@samba.org>
---
arch/powerpc/Kconfig | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 50cc5d9..d536fe4 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -4,6 +4,10 @@ config PPC32
bool
default y if !PPC64
+config 32BIT
+ bool
+ default y if PPC32
+
config 64BIT
bool
default y if PPC64
--
1.7.1
^ permalink raw reply related
* [PATCH] powerpc/mv64x60: suspected typo in assignment
From: Nicolas Kaiser @ 2010-10-22 12:58 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel
Untested, but looks like an obvious typo to me.
Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
arch/powerpc/sysdev/mv64x60_dev.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/sysdev/mv64x60_dev.c b/arch/powerpc/sysdev/mv64x60_dev.c
index 1398bc4..a2c4999 100644
--- a/arch/powerpc/sysdev/mv64x60_dev.c
+++ b/arch/powerpc/sysdev/mv64x60_dev.c
@@ -345,7 +345,7 @@ static int __init mv64x60_i2c_device_setup(struct device_node *np, int id)
if (prop)
pdata.freq_m = *prop;
- pdata.freq_m = 3; /* default */
+ pdata.freq_n = 3; /* default */
prop = of_get_property(np, "freq_n", NULL);
if (prop)
pdata.freq_n = *prop;
--
1.7.2.2
^ permalink raw reply related
* Re: [PATCH] powerpc: Fix hcall tracepoint recursion
From: Steven Rostedt @ 2010-10-22 14:14 UTC (permalink / raw)
To: Anton Blanchard
Cc: ltp-list, Peter Zijlstra, linuxppc-dev, Li Zefan, LKML,
Paul Mackerras, Ingo Molnar, subrata
In-Reply-To: <20101021215212.4a982c85@kryten>
On Thu, 2010-10-21 at 21:52 +1100, Anton Blanchard wrote:
> Anton
> --
>
> Subject: [PATCH] powerpc: Fix hcall tracepoint recursion
>
> Spinlocks on shared processor partitions use H_YIELD to notify the
> hypervisor we are waiting on another virtual CPU. Unfortunately this means
> the hcall tracepoints can recurse.
>
> The patch below adds a percpu depth and checks it on both the entry and
> exit hcall tracepoints.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: powerpc.git/arch/powerpc/platforms/pseries/lpar.c
> ===================================================================
> --- powerpc.git.orig/arch/powerpc/platforms/pseries/lpar.c 2010-10-21 17:32:00.980003644 +1100
> +++ powerpc.git/arch/powerpc/platforms/pseries/lpar.c 2010-10-21 17:34:54.942681273 +1100
> @@ -701,6 +701,13 @@ EXPORT_SYMBOL(arch_free_page);
> /* NB: reg/unreg are called while guarded with the tracepoints_mutex */
> extern long hcall_tracepoint_refcount;
>
> +/*
> + * Since the tracing code might execute hcalls we need to guard against
> + * recursion. One example of this are spinlocks calling H_YIELD on
> + * shared processor partitions.
> + */
> +static DEFINE_PER_CPU(unsigned int, hcall_trace_depth);
> +
> void hcall_tracepoint_regfunc(void)
> {
> hcall_tracepoint_refcount++;
> @@ -713,12 +720,42 @@ void hcall_tracepoint_unregfunc(void)
>
> void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
> {
> + unsigned long flags;
> + unsigned int *depth;
> +
> + local_irq_save(flags);
> +
> + depth = &__get_cpu_var(hcall_trace_depth);
> +
> + if (*depth)
> + goto out;
> +
> + (*depth)++;
> trace_hcall_entry(opcode, args);
> + (*depth)--;
> +
> +out:
> + local_irq_restore(flags);
> }
>
> void __trace_hcall_exit(long opcode, unsigned long retval,
> unsigned long *retbuf)
> {
> + unsigned long flags;
> + unsigned int *depth;
> +
> + local_irq_save(flags);
> +
> + depth = &__get_cpu_var(hcall_trace_depth);
> +
> + if (*depth)
> + goto out;
> +
> + (*depth)++;
> trace_hcall_exit(opcode, retval, retbuf);
> + (*depth)--;
> +
> +out:
> + local_irq_restore(flags);
> }
> #endif
That's similar to the example that I wrote, but without the encapsulated
code and with disabling interrupts for the reasons you gave.
Acked-by: Steven Rostedt <rostedt@goodmis.org>
-- Steve
^ permalink raw reply
* RE: [PATCH -mm 0/2] RapidIO: Changes to handling of RIO switches
From: Bounine, Alexandre @ 2010-10-22 16:47 UTC (permalink / raw)
To: Micha Nelissen; +Cc: linux-kernel, Thomas Moll, akpm, linuxppc-dev
In-Reply-To: <4CC0AD74.8070800@neli.hopto.org>
Micha Nelissen <micha@neli.hopto.org> wrote:
>=20
> Alexandre Bounine wrote:
> > 1. Using one storage location common for switches and endpoints
eliminates
> > unnecessary device type checks during maintenance access operations.
> > While destination IDs and hop counts have different meaning for
endpoints and
> > switches, this does not prevent us from storing them in the primary
RIO device
> > structure (rio_dev) for both types.
>=20
> How can you say this? The two variables have different meanings, this
> logically implies you can't merge them. So how do you say 'this does
not
> prevent us from ...' without providing a reason?
Looks like I formulated it bad - better would be: they have different
interpretation by hardware but logically in RapidIO they have single
role - destid/hopcount are a device coordinates in the RIO network used
to access that device.
> > 2. Convert RIO switch device structures (rio_dev + rio_switch) into
single
> > allocation unit. This change is based on the fact that RIO switches
are using
> > common RIO device objects anyway. Allocating RIO switch objects as
RIO devices
> > with added space for switch information simplifies handling of RIO
switch device
> > objects.
>=20
> I still don't think that's a good idea because the rdev->rswitch
pointer
> can be defined to point to the switch that a given rio_dev is
connected
> to. This is useful for quick lookups. How else can to know to which
> switch a given device is connected?
rdev->rswitch is not a pointer to the entire switch device object - it
is a pointer to the switch specific extension associated with given
rio_dev (if applicable). There is no other role for rdev->rswitch.
Why would you keep a pointer to device data extension instead of the
pointer to attached device object itself?
BTW, I have back and forward links added in previous patches and only
one link that may be added later is a forward link from mport to the
attached rio_dev (ptr to rio_switch will not work here because it can be
switchless connection). But this reference has to be added into
rio_mport.
=20
Alex.
^ permalink raw reply
* [RFC][PATCH 6/8] Removal of dead code from arch/powerpc/kernel/process.c
From: N.P.S. @ 2010-10-22 18:24 UTC (permalink / raw)
To: linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
linuxppc-dev
In-Reply-To: <4CC1D2D5.9050009@gmail.com>
commit 12747993cb2b4a07df7a62f247f20aa4a6263cd9
Author: N.P.S <napohybelskurwysynom2010@gmail.com>
Date: Thu Oct 21 23:36:00 2010 +0200
Removal of dead code from
arch/powerpc/kernel/process.c
Signed-off-by: Zimny Lech <napohybelskurwysynom2010@gmail.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: <linuxppc-dev@lists.ozlabs.org>
CC: <linux-kernel@vger.kernel.org>
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index b1c648a..e622887 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -670,12 +670,7 @@ void exit_thread(void)
void flush_thread(void)
{
discard_lazy_cpu_state();
-
-#ifdef CONFIG_HAVE_HW_BREAKPOINTS
- flush_ptrace_hw_breakpoint(current);
-#else /* CONFIG_HAVE_HW_BREAKPOINTS */
set_debug_reg_defaults(¤t->thread);
-#endif /* CONFIG_HAVE_HW_BREAKPOINTS */
}
void
^ permalink raw reply related
* [RFC][PATCH 7/8] Removal of dead code from arch/powerpc/mm/tlb_low_64e.S and arch/powerpc/include/asm/exception-64e.h
From: N.P.S. @ 2010-10-22 18:25 UTC (permalink / raw)
To: linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
linuxppc-dev
In-Reply-To: <4CC1D2D5.9050009@gmail.com>
commit bca5655fdfd3ad0a4891914bd88b28f78e5cec16
Author: N.P.S <napohybelskurwysynom2010@gmail.com>
Date: Thu Oct 21 23:26:48 2010 +0200
Removal of dead code from
arch/powerpc/mm/tlb_low_64e.S
arch/powerpc/include/asm/exception-64e.h
Signed-off-by: Zimny Lech <napohybelskurwysynom2010@gmail.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: <linuxppc-dev@lists.ozlabs.org>
CC: <linux-kernel@vger.kernel.org>
diff --git a/arch/powerpc/include/asm/exception-64e.h b/arch/powerpc/include/asm/exception-64e.h
index 6d53f31..db74814 100644
--- a/arch/powerpc/include/asm/exception-64e.h
+++ b/arch/powerpc/include/asm/exception-64e.h
@@ -65,14 +65,7 @@
#define EX_TLB_MMUCR0 (12 * 8) /* Level 0 */
#define EX_TLB_MAS1 (12 * 8) /* Level 0 */
#define EX_TLB_MAS2 (13 * 8) /* Level 0 */
-#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
-#define EX_TLB_R8 (14 * 8)
-#define EX_TLB_R9 (15 * 8)
-#define EX_TLB_LR (16 * 8)
-#define EX_TLB_SIZE (17 * 8)
-#else
#define EX_TLB_SIZE (14 * 8)
-#endif
#define START_EXCEPTION(label) \
.globl exc_##label##_book3e; \
@@ -157,36 +150,6 @@ exc_##label##_book3e:
addi r11,r13,PACA_EXTLB; \
TLB_MISS_RESTORE(r11)
-#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
-#define TLB_MISS_PROLOG_STATS \
- mflr r10; \
- std r8,EX_TLB_R8(r12); \
- std r9,EX_TLB_R9(r12); \
- std r10,EX_TLB_LR(r12);
-#define TLB_MISS_RESTORE_STATS \
- ld r16,EX_TLB_LR(r12); \
- ld r9,EX_TLB_R9(r12); \
- ld r8,EX_TLB_R8(r12); \
- mtlr r16;
-#define TLB_MISS_STATS_D(name) \
- addi r9,r13,MMSTAT_DSTATS+name; \
- bl .tlb_stat_inc;
-#define TLB_MISS_STATS_I(name) \
- addi r9,r13,MMSTAT_ISTATS+name; \
- bl .tlb_stat_inc;
-#define TLB_MISS_STATS_X(name) \
- ld r8,PACA_EXTLB+EX_TLB_ESR(r13); \
- cmpdi cr2,r8,-1; \
- beq cr2,61f; \
- addi r9,r13,MMSTAT_DSTATS+name; \
- b 62f; \
-61: addi r9,r13,MMSTAT_ISTATS+name; \
-62: bl .tlb_stat_inc;
-#define TLB_MISS_STATS_SAVE_INFO \
- std r14,EX_TLB_ESR(r12); /* save ESR */ \
-
-
-#else
#define TLB_MISS_PROLOG_STATS
#define TLB_MISS_RESTORE_STATS
#define TLB_MISS_STATS_D(name)
@@ -194,7 +157,6 @@ exc_##label##_book3e:
#define TLB_MISS_STATS_X(name)
#define TLB_MISS_STATS_Y(name)
#define TLB_MISS_STATS_SAVE_INFO
-#endif
#define SET_IVOR(vector_number, vector_offset) \
li r3,vector_offset@l; \
diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S
index 8b04c54..fc87217 100644
--- a/arch/powerpc/mm/tlb_low_64e.S
+++ b/arch/powerpc/mm/tlb_low_64e.S
@@ -757,13 +757,3 @@ tlb_load_linear_fault:
b exc_data_storage_book3e
1: TLB_MISS_EPILOG_ERROR_SPECIAL
b exc_instruction_storage_book3e
-
-
-#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
-.tlb_stat_inc:
-1: ldarx r8,0,r9
- addi r8,r8,1
- stdcx. r8,0,r9
- bne- 1b
- blr
-#endif
^ permalink raw reply related
* Re: [PATCH -mm 0/2] RapidIO: Changes to handling of RIO switches
From: Micha Nelissen @ 2010-10-22 18:28 UTC (permalink / raw)
To: Bounine, Alexandre; +Cc: linux-kernel, Thomas Moll, akpm, linuxppc-dev
In-Reply-To: <0CE8B6BE3C4AD74AB97D9D29BD24E55201445906@CORPEXCH1.na.ads.idt.com>
Bounine, Alexandre wrote:
> Micha Nelissen <micha@neli.hopto.org> wrote:
>> Alexandre Bounine wrote:
>> How can you say this? The two variables have different meanings, this
>> logically implies you can't merge them. So how do you say 'this does
> not
>> prevent us from ...' without providing a reason?
>
> Looks like I formulated it bad - better would be: they have different
> interpretation by hardware but logically in RapidIO they have single
> role - destid/hopcount are a device coordinates in the RIO network used
> to access that device.
They are logically different as well (for a non-host).
rswitch->destid with hopcount is the way to reach that switch.
rswitch->rdev->destid should be the id associated with a given switch,
so that every (processor) device can agree what id some switch has. For
a non-host, the path to reach a switch may use a different id than the
switch itself has; it's just the id by which it was discovered.
However, it's possible to fix that by fixing the id+hopcount once the
switch is found using the path with its own id: then you know the right
hopcount.
>> can be defined to point to the switch that a given rio_dev is
> connected
>> to. This is useful for quick lookups. How else can to know to which
>> switch a given device is connected?
>
> rdev->rswitch is not a pointer to the entire switch device object - it
> is a pointer to the switch specific extension associated with given
> rio_dev (if applicable). There is no other role for rdev->rswitch.
I know this, it doesn't answer my question.
> Why would you keep a pointer to device data extension instead of the
> pointer to attached device object itself?
There is no particular reason, but this is a useful way to define the
fields that are there.
My point is, now that you remove the pointer field, that information (to
which switch is a particular device connected) cannot be stored in this
way, so do you have an alternative proposal for that? Maybe add a new field.
> BTW, I have back and forward links added in previous patches and only
> one link that may be added later is a forward link from mport to the
> attached rio_dev (ptr to rio_switch will not work here because it can be
> switchless connection). But this reference has to be added into
> rio_mport.
Possible, but I suggest to put it in the rio_net: fields rdev_host, and
rdev_self. You can see it in the patch I sent you.
Micha
^ permalink raw reply
* Re: BUG with the kernel version 2.6.36-rc1 on power machine
From: Subrata Modak @ 2010-10-22 19:04 UTC (permalink / raw)
To: LKML, linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard, divya
In-Reply-To: <4CC13FFF.7040200@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]
This is seen equally on Power6 & Power7 systems.
Regards--
Subrata
On Fri, Oct 22, 2010 at 1:10 PM, divya <dipraksh@linux.vnet.ibm.com> wrote:
> On Friday 22 October 2010 12:50 PM, divya wrote:
>
>> Hi ,
>>
>> With the latest version of kernel 2.6.36-rc1 running on the power machine,
>> came across the following call trace
>>
>> BUG: looking up invalid subclass: 31
>> turning off the locking correctness validator.
>> Call Trace:
>> [c00000000e0bfb60] [c0000000000119a0] .show_stack+0x6c/0x16c (unreliable)
>> [c00000000e0bfc10] [c0000000000c39b8] .lockdep_init_map+0x194/0x630
>> [c00000000e0bfcf0] [c0000000005524f8] .mousedev_create+0xcc/0x234
>> [c00000000e0bfda0] [c00000000093fb58] .mousedev_init+0x38/0xa0
>> [c00000000e0bfe30] [c0000000000097e4] .do_one_initcall+0xd8/0x1c8
>> [c00000000e0bfee0] [c0000000009004ac] .kernel_init+0x23c/0x2f8
>> [c00000000e0bff90] [c00000000002ad30] .kernel_thread+0x54/0x70
>>
>> The config file used for make oldconfig is being attached
>>
>> Thanks
>> Divya
>>
>>
>>
>>
>> I meant 2.6.36-git1(b5153163ed580e) , and not 2.6.36-rc1.
> Sorry for the confusion.
>
> Thanks
> Divya
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
Regards & Thanks--
Subrata
[-- Attachment #2: Type: text/html, Size: 2234 bytes --]
^ permalink raw reply
* Re: BUG with the kernel version 2.6.36-rc1 on power machine
From: Subrata Modak @ 2010-10-22 19:13 UTC (permalink / raw)
To: linux-kernel, Linuxppc-dev; +Cc: Paul Mackerras, Anton Blanchard, divya
In-Reply-To: <AANLkTikmpohofzO_dV_Dv8EfcEMsyy4cdhGMUD-PAFO3@mail.gmail.com>
This is equally seen for both Power6 and Power7 machines.
Regards--
Subrata
On Sat, 2010-10-23 at 00:37 +0530, Subrata Modak wrote:
>
>
> ---------- Forwarded message ----------
> From: divya <dipraksh@linux.vnet.ibm.com>
> Date: Fri, Oct 22, 2010 at 1:10 PM
> Subject: Re: BUG with the kernel version 2.6.36-rc1 on power machine
> To: LKML <linux-kernel@vger.kernel.org>, benh@kernel.crashing.org,
> linuxppc-dev@ozlabs.org
>
>
>
> On Friday 22 October 2010 12:50 PM, divya wrote:
> Hi ,
>
> With the latest version of kernel 2.6.36-rc1 running on the
> power machine, came across the following call trace
>
> BUG: looking up invalid subclass: 31
> turning off the locking correctness validator.
> Call Trace:
> [c00000000e0bfb60] [c0000000000119a0] .show_stack+0x6c/0x16c
> (unreliable)
> [c00000000e0bfc10] [c0000000000c39b8] .lockdep_init_map
> +0x194/0x630
> [c00000000e0bfcf0] [c0000000005524f8] .mousedev_create
> +0xcc/0x234
> [c00000000e0bfda0] [c00000000093fb58] .mousedev_init+0x38/0xa0
> [c00000000e0bfe30] [c0000000000097e4] .do_one_initcall
> +0xd8/0x1c8
> [c00000000e0bfee0] [c0000000009004ac] .kernel_init+0x23c/0x2f8
> [c00000000e0bff90] [c00000000002ad30] .kernel_thread+0x54/0x70
>
> The config file used for make oldconfig is being attached
>
> Thanks
> Divya
>
>
>
>
> I meant 2.6.36-git1(b5153163ed580e) , and not 2.6.36-rc1.
> Sorry for the confusion.
>
> Thanks
> Divya
>
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
>
>
>
> --
> Regards & Thanks--
> Subrata
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox