linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/3] 2.6.30 next patches
@ 2009-03-03 18:33 Geoff Levand
  2009-03-03 18:33 ` [patch 1/3] powerpc: Add missing DABR flags Geoff Levand
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Geoff Levand @ 2009-03-03 18:33 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, cbe-oss-dev

Hi Ben,

This is a small set of patches for your 2.6.30 next branch.

 [patch 1/3] powerpc: Add missing DABR flags
 [patch 2/3] powerpc/ps3: Print memory hotplug errors
 [patch 3/3] powerpc/ps3: Make ps3av_set_video_mode mode ID signed

-Geoff


-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 1/3] powerpc: Add missing DABR flags
  2009-03-03 18:33 [patch 0/3] 2.6.30 next patches Geoff Levand
@ 2009-03-03 18:33 ` Geoff Levand
  2009-03-03 18:33 ` [patch 2/3] powerpc/ps3: Print memory hotplug errors Geoff Levand
  2009-03-03 18:33 ` [patch 3/3] powerpc/ps3: Make ps3av_set_video_mode mode ID signed Geoff Levand
  2 siblings, 0 replies; 4+ messages in thread
From: Geoff Levand @ 2009-03-03 18:33 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, cbe-oss-dev

The powerpc 64 bit architecture defines three flags for the
DABR (Data Address Breakpoint Register).  Add definitions
for the currently missing DABR_DATA_WRITE and DABR_DATA_READ
flags to the powerpc reg.h file.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
 arch/powerpc/include/asm/reg.h |    2 ++
 1 file changed, 2 insertions(+)

--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -155,6 +155,8 @@
 #define   CTRL_RUNLATCH	0x1
 #define SPRN_DABR	0x3F5	/* Data Address Breakpoint Register */
 #define   DABR_TRANSLATION	(1UL << 2)
+#define   DABR_DATA_WRITE	(1UL << 1)
+#define   DABR_DATA_READ	(1UL << 0)
 #define SPRN_DABR2	0x13D	/* e300 */
 #define SPRN_DABRX	0x3F7	/* Data Address Breakpoint Register Extension */
 #define   DABRX_USER	(1UL << 0)

-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 2/3] powerpc/ps3: Print memory hotplug errors
  2009-03-03 18:33 [patch 0/3] 2.6.30 next patches Geoff Levand
  2009-03-03 18:33 ` [patch 1/3] powerpc: Add missing DABR flags Geoff Levand
@ 2009-03-03 18:33 ` Geoff Levand
  2009-03-03 18:33 ` [patch 3/3] powerpc/ps3: Make ps3av_set_video_mode mode ID signed Geoff Levand
  2 siblings, 0 replies; 4+ messages in thread
From: Geoff Levand @ 2009-03-03 18:33 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, cbe-oss-dev

To help users diagnose hotpug memory problems, change the
printing of memory hotplug errors from DBG() to pr_err().

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
 arch/powerpc/platforms/ps3/mm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -311,7 +311,7 @@ static int __init ps3_mm_add_memory(void
 	result = add_memory(0, start_addr, map.r1.size);
 
 	if (result) {
-		DBG("%s:%d: add_memory failed: (%d)\n",
+		pr_err("%s:%d: add_memory failed: (%d)\n",
 			__func__, __LINE__, result);
 		return result;
 	}
@@ -322,7 +322,7 @@ static int __init ps3_mm_add_memory(void
 	result = online_pages(start_pfn, nr_pages);
 
 	if (result)
-		DBG("%s:%d: online_pages failed: (%d)\n",
+		pr_err("%s:%d: online_pages failed: (%d)\n",
 			__func__, __LINE__, result);
 
 	return result;

-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 3/3] powerpc/ps3: Make ps3av_set_video_mode mode ID signed
  2009-03-03 18:33 [patch 0/3] 2.6.30 next patches Geoff Levand
  2009-03-03 18:33 ` [patch 1/3] powerpc: Add missing DABR flags Geoff Levand
  2009-03-03 18:33 ` [patch 2/3] powerpc/ps3: Print memory hotplug errors Geoff Levand
@ 2009-03-03 18:33 ` Geoff Levand
  2 siblings, 0 replies; 4+ messages in thread
From: Geoff Levand @ 2009-03-03 18:33 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Roel Kluin, cbe-oss-dev

From: roel kluin <roel.kluin@gmail.com>

Change the ps3av_auto_videomode() mode id argument type from unsigned to
signed so a negative id can be detected and reported as an -EINVAL failure.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
arch/powerpc/include/asm/ps3av.h |    2 +-
 drivers/ps3/ps3av.c              |   16 ++++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/ps3av.h b/arch/powerpc/include/asm/ps3av.h
index cd24ac1..0427b0b 100644
--- a/arch/powerpc/include/asm/ps3av.h
+++ b/arch/powerpc/include/asm/ps3av.h
@@ -730,7 +730,7 @@ extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *);
 extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *,
 					    u32);
 
-extern int ps3av_set_video_mode(u32);
+extern int ps3av_set_video_mode(int);
 extern int ps3av_set_audio_mode(u32, u32, u32, u32, u32);
 extern int ps3av_get_auto_mode(void);
 extern int ps3av_get_mode(void);
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c
index 5324978..235e87f 100644
--- a/drivers/ps3/ps3av.c
+++ b/drivers/ps3/ps3av.c
@@ -838,7 +838,7 @@ static int ps3av_get_hw_conf(struct ps3av *ps3av)
 }
 
 /* set mode using id */
-int ps3av_set_video_mode(u32 id)
+int ps3av_set_video_mode(int id)
 {
 	int size;
 	u32 option;
@@ -940,7 +940,7 @@ EXPORT_SYMBOL_GPL(ps3av_audio_mute);
 static int ps3av_probe(struct ps3_system_bus_device *dev)
 {
 	int res;
-	u32 id;
+	int id;
 
 	dev_dbg(&dev->core, " -> %s:%d\n", __func__, __LINE__);
 	dev_dbg(&dev->core, "  timeout=%d\n", timeout);
@@ -962,8 +962,10 @@ static int ps3av_probe(struct ps3_system_bus_device *dev)
 	init_completion(&ps3av->done);
 	complete(&ps3av->done);
 	ps3av->wq = create_singlethread_workqueue("ps3avd");
-	if (!ps3av->wq)
+	if (!ps3av->wq) {
+		res = -ENOMEM;
 		goto fail;
+	}
 
 	switch (ps3_os_area_get_av_multi_out()) {
 	case PS3_PARAM_AV_MULTI_OUT_NTSC:
@@ -994,6 +996,12 @@ static int ps3av_probe(struct ps3_system_bus_device *dev)
 		safe_mode = 1;
 #endif /* CONFIG_FB */
 	id = ps3av_auto_videomode(&ps3av->av_hw_conf);
+	if (id < 0) {
+		printk(KERN_ERR "%s: invalid id :%d\n", __func__, id);
+		res = -EINVAL;
+		goto fail;
+	}
+
 	safe_mode = 0;
 
 	mutex_lock(&ps3av->mutex);
@@ -1007,7 +1015,7 @@ static int ps3av_probe(struct ps3_system_bus_device *dev)
 fail:
 	kfree(ps3av);
 	ps3av = NULL;
-	return -ENOMEM;
+	return res;
 }
 
 static int ps3av_remove(struct ps3_system_bus_device *dev)

-- 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-03 18:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-03 18:33 [patch 0/3] 2.6.30 next patches Geoff Levand
2009-03-03 18:33 ` [patch 1/3] powerpc: Add missing DABR flags Geoff Levand
2009-03-03 18:33 ` [patch 2/3] powerpc/ps3: Print memory hotplug errors Geoff Levand
2009-03-03 18:33 ` [patch 3/3] powerpc/ps3: Make ps3av_set_video_mode mode ID signed Geoff Levand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).