LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH][v1] RTC driver(Linux) for PT7C4338 chip.
From: Jain Priyanka-B32167 @ 2010-11-11  4:05 UTC (permalink / raw)
  To: Jain Priyanka-B32167, rtc-linux, linuxppc-dev
In-Reply-To: <1288086091-22443-1-git-send-email-Priyanka.Jain@freescale.com>

Hi,

I am waiting for review comments and acknowledgement that this patch
will be pick up for open source.
Please acknowledge.

Regards
Priyanka Jain
=20
-----Original Message-----
From: Jain Priyanka-B32167=20
Sent: Tuesday, October 26, 2010 3:12 PM
To: rtc-linux@googlegroups.com; linuxppc-dev@lists.ozlabs.org
Cc: Jain Priyanka-B32167
Subject: [PATCH][v1] RTC driver(Linux) for PT7C4338 chip.

PT7C4338 chip is being manufactured by Pericom Technology Inc.
It is a serial real-time clock which provides:
1)Low-power clock/calendar.
2)Programmable square-wave output.
It has 56 bytes of nonvolatile RAM.

Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
---
 PT7C4338 RTC driver is verified on Freescale P1010RDB.=20
Changes for v1:
	Incoperated Kumar Gala's review comments=20
	-Removing board name from commit messages.

 drivers/rtc/Kconfig        |    9 ++
 drivers/rtc/Makefile       |    1 +
 drivers/rtc/rtc-pt7c4338.c |  215
++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 225 insertions(+), 0 deletions(-)  create mode 100644
drivers/rtc/rtc-pt7c4338.c

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index
10ba12c..6ff0901 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -324,6 +324,15 @@ config RTC_DRV_RX8025
 	  This driver can also be built as a module. If so, the module
 	  will be called rtc-rx8025.
=20
+config RTC_DRV_PT7C4338
+	tristate "Pericom Technology Inc. PT7C4338 RTC"
+	help
+	  If you say yes here you get support for the Pericom Technology
+	  Inc. PT7C4338 RTC chip.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rtc-pt7c4338.
+
 endif # I2C
=20
 comment "SPI RTC drivers"
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index
5adbba7..4014607 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -70,6 +70,7 @@ obj-$(CONFIG_RTC_DRV_PCF50633)	+=3D
rtc-pcf50633.o
 obj-$(CONFIG_RTC_DRV_PL030)	+=3D rtc-pl030.o
 obj-$(CONFIG_RTC_DRV_PL031)	+=3D rtc-pl031.o
 obj-$(CONFIG_RTC_DRV_PS3)	+=3D rtc-ps3.o
+obj-$(CONFIG_RTC_DRV_PT7C4338)	+=3D rtc-pt7c4338.o
 obj-$(CONFIG_RTC_DRV_PXA)	+=3D rtc-pxa.o
 obj-$(CONFIG_RTC_DRV_R9701)	+=3D rtc-r9701.o
 obj-$(CONFIG_RTC_DRV_RP5C01)	+=3D rtc-rp5c01.o
diff --git a/drivers/rtc/rtc-pt7c4338.c b/drivers/rtc/rtc-pt7c4338.c new
file mode 100644 index 0000000..fca52cd
--- /dev/null
+++ b/drivers/rtc/rtc-pt7c4338.c
@@ -0,0 +1,215 @@
+/*
+ * Copyright 2010 Freescale Semiconductor, Inc.
+ *
+ * Author:	Priyanka Jain <Priyanka.Jain@freescale.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/*
+ * This file provides Date & Time support (no alarms) for PT7C4338
chip.
+ *
+ * This file is based on drivers/rtc/rtc-ds1307.c
+ *
+ * PT7C4338 chip is manufactured by Pericom Technology Inc.
+ * It is a serial real-time clock which provides
+ * 1)Low-power clock/calendar.
+ * 2)Programmable square-wave output.
+ * It has 56 bytes of nonvolatile RAM.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/i2c.h>
+#include <linux/rtc.h>
+#include <linux/bcd.h>
+
+/* RTC register addresses */
+#define PT7C4338_REG_SECONDS          0x00
+#define PT7C4338_REG_MINUTES          0x01
+#define PT7C4338_REG_HOURS            0x02
+#define PT7C4338_REG_AMPM             0x02
+#define PT7C4338_REG_DAY              0x03
+#define PT7C4338_REG_DATE             0x04
+#define PT7C4338_REG_MONTH            0x05
+#define PT7C4338_REG_YEAR             0x06
+#define PT7C4338_REG_CTRL_STAT        0x07
+
+/* RTC second register address bit */
+#define PT7C4338_SEC_BIT_CH           0x80	/*Clock Halt (in
Register 0)*/
+
+/* RTC control and status register bits */
+#define PT7C4338_CTRL_STAT_BIT_RS0    0x1	/*Rate select 0*/
+#define PT7C4338_CTRL_STAT_BIT_RS1    0x2	/*Rate select 1*/
+#define PT7C4338_CTRL_STAT_BIT_SQWE   0x10	/*Square Wave Enable*/
+#define PT7C4338_CTRL_STAT_BIT_OSF    0x20	/*Oscillator Stop Flag*/
+#define PT7C4338_CTRL_STAT_BIT_OUT    0x80	/*Output Level Control*/
+
+static const struct i2c_device_id pt7c4338_id[] =3D {
+	{ "pt7c4338", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, pt7c4338_id);
+
+struct pt7c4338{
+	struct i2c_client *client;
+	struct rtc_device *rtc;
+};
+
+static int pt7c4338_read_time(struct device *dev, struct rtc_time=20
+*time) {
+	struct i2c_client *client =3D to_i2c_client(dev);
+	int ret;
+	u8 buf[7];
+	u8 year, month, day, hour, minute, second;
+	u8 week, twelve_hr, am_pm;
+
+	ret =3D i2c_smbus_read_i2c_block_data(client,
+			PT7C4338_REG_SECONDS, 7, buf);
+	if (ret < 0)
+		return ret;
+	if (ret < 7)
+		return -EIO;
+
+	second =3D buf[0];
+	minute =3D buf[1];
+	hour =3D buf[2];
+	week =3D buf[3];
+	day =3D buf[4];
+	month =3D buf[5];
+	year =3D buf[6];
+
+	/* Extract additional information for AM/PM */
+	twelve_hr =3D hour & 0x40;
+	am_pm =3D hour & 0x20;
+
+	/* Write to rtc_time structure */
+	time->tm_sec =3D bcd2bin(second & 0x7f);
+	time->tm_min =3D bcd2bin(minute & 0x7f);
+	if (twelve_hr) {
+		/* Convert to 24 hr */
+		if (am_pm)
+			time->tm_hour =3D bcd2bin(hour & 0x10) + 12;
+		else
+			time->tm_hour =3D bcd2bin(hour & 0xBF);
+	} else {
+		time->tm_hour =3D bcd2bin(hour);
+	}
+
+	time->tm_wday =3D bcd2bin(week & 0x07) - 1;
+	time->tm_mday =3D bcd2bin(day & 0x3f);
+	time->tm_mon =3D bcd2bin(month & 0x1F) - 1;
+	/* assume 20YY not 19YY */
+	time->tm_year =3D bcd2bin(year) + 100;
+
+	return 0;
+}
+
+static int pt7c4338_set_time(struct device *dev, struct rtc_time *time)

+{
+	struct i2c_client *client =3D to_i2c_client(dev);
+	u8 buf[7];
+
+	/* Extract time from rtc_time and load into pt7c4338*/
+	buf[0] =3D bin2bcd(time->tm_sec);
+	buf[1] =3D bin2bcd(time->tm_min);
+	buf[2] =3D bin2bcd(time->tm_hour);
+	buf[3] =3D bin2bcd(time->tm_wday + 1); /* Day of the week */
+	buf[4] =3D bin2bcd(time->tm_mday); /* Date */
+	buf[5] =3D bin2bcd(time->tm_mon + 1);
+
+	/* assume 20YY not 19YY */
+	if (time->tm_year >=3D 100)
+		buf[6] =3D bin2bcd(time->tm_year - 100);
+	else
+		buf[6] =3D bin2bcd(time->tm_year);
+
+	return i2c_smbus_write_i2c_block_data(client,
+					PT7C4338_REG_SECONDS, 7, buf);
+}
+
+static const struct rtc_class_ops pt7c4338_rtc_ops =3D {
+	.read_time =3D pt7c4338_read_time,
+	.set_time =3D pt7c4338_set_time,
+};
+
+static int pt7c4338_probe(struct i2c_client *client,
+		const struct i2c_device_id *id)
+{
+	struct pt7c4338 *pt7c4338;
+	struct i2c_adapter *adapter =3D
to_i2c_adapter(client->dev.parent);
+	int ret;
+
+	pt7c4338 =3D kzalloc(sizeof(struct pt7c4338), GFP_KERNEL);
+	if (!pt7c4338)
+		return -ENOMEM;
+
+	pt7c4338->client =3D client;
+	i2c_set_clientdata(client, pt7c4338);
+	pt7c4338->rtc =3D rtc_device_register(client->name, &client->dev,
+					&pt7c4338_rtc_ops, THIS_MODULE);
+	if (IS_ERR(pt7c4338->rtc)) {
+		ret =3D PTR_ERR(pt7c4338->rtc);
+		dev_err(&client->dev, "unable to register the class
device\n");
+		goto out_free;
+	}
+
+	return 0;
+out_free:
+	i2c_set_clientdata(client, NULL);
+	kfree(pt7c4338);
+	return ret;
+}
+
+static int __devexit pt7c4338_remove(struct i2c_client *client) {
+	struct pt7c4338 *pt7c4338 =3D i2c_get_clientdata(client);
+
+	rtc_device_unregister(pt7c4338->rtc);
+	i2c_set_clientdata(client, NULL);
+	kfree(pt7c4338);
+	return 0;
+}
+
+static struct i2c_driver pt7c4338_driver =3D {
+	.driver =3D {
+		.name =3D "rtc-pt7c4338",
+		.owner =3D THIS_MODULE,
+	},
+	.probe =3D pt7c4338_probe,
+	.remove =3D __devexit_p(pt7c4338_remove),
+	.id_table =3D pt7c4338_id,
+};
+
+static int __init pt7c4338_init(void)
+{
+	return i2c_add_driver(&pt7c4338_driver); }
+
+static void __exit pt7c4338_exit(void)
+{
+	i2c_del_driver(&pt7c4338_driver);
+}
+
+module_init(pt7c4338_init);
+module_exit(pt7c4338_exit);
+
+MODULE_AUTHOR("Priyanka Jain <Priyanka.Jain@freescale.com>");=20
+MODULE_DESCRIPTION("pericom Technology Inc. PT7C4338 RTC Driver");=20
+MODULE_LICENSE("GPL");
--
1.6.5.6

^ permalink raw reply

* [Call Trace: 2.6.37-rc1-git7 & 2.6.37-rc1-git8, Powerpc] LTP msgctl11 test case
From: Subrata Modak @ 2010-11-11  6:33 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: Linuxppc-dev, Kamalesh Babulal, Subrata Modak, linux-kernel,
	DIVYA PRAKASH

Hi Peter/Ingo,

LTPś msgctl11 test case creates Call trace and Exception for kernels
2.6.37-rc1-git7 & 2.6.37-rc1-git8. Please see the dmesg below:

================================================
msgctl11: page allocation failure. order:0, mode:0x20
Call Trace:
[c0000000fffcef30] [c000000000014c74] .show_stack+0x74/0x1c0 (unreliable)
[c0000000fffcefe0] [c00000000015e938] .__alloc_pages_nodemask+0x6d8/0x950
[c0000000fffcf160] [c0000000001a0c60] .alloc_pages_current+0xa0/0x160
[c0000000fffcf200] [c0000000001abfd8] .new_slab+0x358/0x370
[c0000000fffcf2b0] [c0000000001ac1cc] .__slab_alloc+0x1dc/0x500
[c0000000fffcf390] [c0000000001ad808] .kmem_cache_alloc+0x1a8/0x1b0
[c0000000fffcf440] [c0000000004eec88] .scsi_pool_alloc_command+0x58/0xa0
[c0000000fffcf4d0] [c0000000004eed60] .scsi_host_alloc_command+0x30/0xb0
[c0000000fffcf560] [c0000000004eee00] .__scsi_get_command+0x20/0xd0
[c0000000fffcf5f0] [c0000000004ef158] .scsi_get_command+0x58/0xf0
[c0000000fffcf690] [c0000000004f7948] .scsi_setup_fs_cmnd+0x108/0x120
[c0000000fffcf720] [d000000001484ad8] .sd_prep_fn+0x2b8/0xc70 [sd_mod]
[c0000000fffcf800] [c0000000003ea92c] .blk_peek_request+0x14c/0x310
[c0000000fffcf8b0] [c0000000004f6b14] .scsi_request_fn+0x94/0x560
[c0000000fffcf980] [c0000000003eba00] .__blk_run_queue+0x90/0x1b0
[c0000000fffcfa00] [c0000000003ebc20] .blk_run_queue+0x30/0x60
[c0000000fffcfa90] [c0000000004f5d84] .scsi_run_queue+0x104/0x3c0
[c0000000fffcfb60] [c0000000004f7228] .scsi_next_command+0x48/0x70
[c0000000fffcfbf0] [c0000000004f8280] .scsi_io_completion+0x3e0/0x580
[c0000000fffcfcd0] [c0000000004ee0a8] .scsi_finish_command+0x128/0x180
[c0000000fffcfd70] [c0000000004f8548] .scsi_softirq_done+0x118/0x1e0
[c0000000fffcfe10] [c0000000003f2410] .blk_done_softirq+0xb0/0xe0
[c0000000fffcfea0] [c0000000000943c8] .__do_softirq+0x118/0x290
[c0000000fffcff90] [c000000000031f58] .call_do_softirq+0x14/0x24
[c0000000a0992a20] [c00000000000f554] .do_softirq+0xf4/0x120
[c0000000a0992ac0] [c0000000000941d4] .irq_exit+0xb4/0xc0
[c0000000a0992b40] [c00000000000f7e0] .do_IRQ+0x160/0x2c0
[c0000000a0992c00] [c000000000004898] hardware_interrupt_entry+0x18/0x80
--- Exception: 501 at .do_raw_spin_unlock+0x80/0xe0
    LR = ._raw_spin_unlock+0x30/0x50
[c0000000a0992f70] [c00000000018943c] .__page_check_address+0x16c/0x1a0
[c0000000a0993010] [c00000000018a5b4] .page_referenced_one+0x54/0x200
[c0000000a09930d0] [c00000000018ab4c] .page_referenced+0x3ec/0x490
[c0000000a0993200] [c000000000168bbc] .shrink_page_list+0x2bc/0x6d0
[c0000000a0993350] [c00000000016942c] .shrink_inactive_list+0x15c/0x580
[c0000000a0993460] [c000000000169f10] .shrink_zone+0x2e0/0x4b0
[c0000000a0993580] [c00000000016b3c0] .do_try_to_free_pages+0x110/0x510
[c0000000a0993670] [c00000000016bb3c] .try_to_free_pages+0xbc/0x1a0
[c0000000a0993780] [c00000000015e7a0] .__alloc_pages_nodemask+0x540/0x950
[c0000000a0993900] [c0000000001a0db8] .alloc_page_vma+0x98/0x1d0
[c0000000a09939a0] [c00000000017c7f4] .do_wp_page+0x144/0xb60
[c0000000a0993a90] [c00000000017eef0] .handle_mm_fault+0x670/0xb50
[c0000000a0993b80] [c0000000006feea4] .do_page_fault+0x344/0x780
[c0000000a0993e30] [c00000000000522c] handle_page_fault+0x20/0x74
Mem-Info:
Node 0 DMA per-cpu:
CPU    0: hi:    6, btch:   1 usd:   4
CPU    1: hi:    6, btch:   1 usd:   5
CPU    2: hi:    6, btch:   1 usd:   0
CPU    3: hi:    6, btch:   1 usd:   0
CPU    4: hi:    6, btch:   1 usd:   0
CPU    5: hi:    6, btch:   1 usd:   0
CPU    6: hi:    6, btch:   1 usd:   4
CPU    7: hi:    6, btch:   1 usd:   0
CPU    8: hi:    6, btch:   1 usd:   2
CPU    9: hi:    6, btch:   1 usd:   0
CPU   10: hi:    6, btch:   1 usd:   0
CPU   11: hi:    6, btch:   1 usd:   0
CPU   12: hi:    6, btch:   1 usd:   0
CPU   13: hi:    6, btch:   1 usd:   0
CPU   14: hi:    6, btch:   1 usd:   0
CPU   15: hi:    6, btch:   1 usd:   0
CPU   16: hi:    6, btch:   1 usd:   0
CPU   17: hi:    6, btch:   1 usd:   2
CPU   18: hi:    6, btch:   1 usd:   2
CPU   19: hi:    6, btch:   1 usd:   0
CPU   20: hi:    6, btch:   1 usd:   3
CPU   21: hi:    6, btch:   1 usd:   1
CPU   22: hi:    6, btch:   1 usd:   1
CPU   23: hi:    6, btch:   1 usd:   0
active_anon:17322 inactive_anon:4230 isolated_anon:2650
 active_file:7 inactive_file:29 isolated_file:46
 unevictable:0 dirty:0 writeback:343 unstable:0
 free:57 slab_reclaimable:426 slab_unreclaimable:22103
 mapped:19 shmem:0 pagetables:16551 bounce:0
Node 0 DMA free:832kB min:8128kB low:10112kB high:12160kB active_anon:1108608kB inactive_anon:270720kB active_file:448kB inactive_file:1856kB unevictable:0kB isolated(anon):169600kB isolated(file):2944kB present:4190720kB mlocked:0kB dirty:0kB writeback:21952kB mapped:1216kB shmem:0kB slab_reclaimable:27264kB slab_unreclaimable:1414592kB kernel_stack:156336kB pagetables:1059264kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:69 all_unreclaimable? no
lowmem_reserve[]: 0 0 0
Node 0 DMA: 7*64kB 3*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB = 832kB
5188 total pagecache pages
4932 pages in swap cache
Swap cache stats: add 37086, delete 32154, find 29567/36415
Free swap  = 3652416kB
Total swap = 4095936kB
65536 pages RAM
1557 pages reserved
31189 pages shared
59735 pages non-shared
SLUB: Unable to allocate memory on node -1 (gfp=0x20)
  cache: kmalloc-128, object size: 128, buffer size: 128, default order: 0, min order: 0
  node 0: slabs: 92, objs: 47104, free: 0
================================================

Ways to reproduce the problem:
1) Fetch, build and install LTP:
        git clone git://ltp.git.sourceforge.net/gitroot/ltp/ltp
        cd ltp
        ./configure
        make
        make install
2) Execute
        cd /opt/ltp
        ./runltp -s msgctl11 -k DMESG_LOG_DIR

Verify the results under /opt/ltp/results and /opt/ltp/output directory

Regards--
Subrata

^ permalink raw reply

* Re: [Call Trace: 2.6.37-rc1-git7 & 2.6.37-rc1-git8, Powerpc] LTP msgctl11 test case
From: Subrata Modak @ 2010-11-11  6:38 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: Linuxppc-dev, Kamalesh Babulal, linux-kernel, DIVYA PRAKASH
In-Reply-To: <1289457219.5622.15.camel@subratamodak.linux.ibm.com>

Kindly note that the same thing was not observed till git6 on the same
machine.

Regards--
Subrata

On Thu, 2010-11-11 at 12:03 +0530, Subrata Modak wrote:
> Hi Peter/Ingo,
> 
> LTPś msgctl11 test case creates Call trace and Exception for kernels
> 2.6.37-rc1-git7 & 2.6.37-rc1-git8. Please see the dmesg below:
> 
> ================================================
> msgctl11: page allocation failure. order:0, mode:0x20
> Call Trace:
> [c0000000fffcef30] [c000000000014c74] .show_stack+0x74/0x1c0 (unreliable)
> [c0000000fffcefe0] [c00000000015e938] .__alloc_pages_nodemask+0x6d8/0x950
> [c0000000fffcf160] [c0000000001a0c60] .alloc_pages_current+0xa0/0x160
> [c0000000fffcf200] [c0000000001abfd8] .new_slab+0x358/0x370
> [c0000000fffcf2b0] [c0000000001ac1cc] .__slab_alloc+0x1dc/0x500
> [c0000000fffcf390] [c0000000001ad808] .kmem_cache_alloc+0x1a8/0x1b0
> [c0000000fffcf440] [c0000000004eec88] .scsi_pool_alloc_command+0x58/0xa0
> [c0000000fffcf4d0] [c0000000004eed60] .scsi_host_alloc_command+0x30/0xb0
> [c0000000fffcf560] [c0000000004eee00] .__scsi_get_command+0x20/0xd0
> [c0000000fffcf5f0] [c0000000004ef158] .scsi_get_command+0x58/0xf0
> [c0000000fffcf690] [c0000000004f7948] .scsi_setup_fs_cmnd+0x108/0x120
> [c0000000fffcf720] [d000000001484ad8] .sd_prep_fn+0x2b8/0xc70 [sd_mod]
> [c0000000fffcf800] [c0000000003ea92c] .blk_peek_request+0x14c/0x310
> [c0000000fffcf8b0] [c0000000004f6b14] .scsi_request_fn+0x94/0x560
> [c0000000fffcf980] [c0000000003eba00] .__blk_run_queue+0x90/0x1b0
> [c0000000fffcfa00] [c0000000003ebc20] .blk_run_queue+0x30/0x60
> [c0000000fffcfa90] [c0000000004f5d84] .scsi_run_queue+0x104/0x3c0
> [c0000000fffcfb60] [c0000000004f7228] .scsi_next_command+0x48/0x70
> [c0000000fffcfbf0] [c0000000004f8280] .scsi_io_completion+0x3e0/0x580
> [c0000000fffcfcd0] [c0000000004ee0a8] .scsi_finish_command+0x128/0x180
> [c0000000fffcfd70] [c0000000004f8548] .scsi_softirq_done+0x118/0x1e0
> [c0000000fffcfe10] [c0000000003f2410] .blk_done_softirq+0xb0/0xe0
> [c0000000fffcfea0] [c0000000000943c8] .__do_softirq+0x118/0x290
> [c0000000fffcff90] [c000000000031f58] .call_do_softirq+0x14/0x24
> [c0000000a0992a20] [c00000000000f554] .do_softirq+0xf4/0x120
> [c0000000a0992ac0] [c0000000000941d4] .irq_exit+0xb4/0xc0
> [c0000000a0992b40] [c00000000000f7e0] .do_IRQ+0x160/0x2c0
> [c0000000a0992c00] [c000000000004898] hardware_interrupt_entry+0x18/0x80
> --- Exception: 501 at .do_raw_spin_unlock+0x80/0xe0
>     LR = ._raw_spin_unlock+0x30/0x50
> [c0000000a0992f70] [c00000000018943c] .__page_check_address+0x16c/0x1a0
> [c0000000a0993010] [c00000000018a5b4] .page_referenced_one+0x54/0x200
> [c0000000a09930d0] [c00000000018ab4c] .page_referenced+0x3ec/0x490
> [c0000000a0993200] [c000000000168bbc] .shrink_page_list+0x2bc/0x6d0
> [c0000000a0993350] [c00000000016942c] .shrink_inactive_list+0x15c/0x580
> [c0000000a0993460] [c000000000169f10] .shrink_zone+0x2e0/0x4b0
> [c0000000a0993580] [c00000000016b3c0] .do_try_to_free_pages+0x110/0x510
> [c0000000a0993670] [c00000000016bb3c] .try_to_free_pages+0xbc/0x1a0
> [c0000000a0993780] [c00000000015e7a0] .__alloc_pages_nodemask+0x540/0x950
> [c0000000a0993900] [c0000000001a0db8] .alloc_page_vma+0x98/0x1d0
> [c0000000a09939a0] [c00000000017c7f4] .do_wp_page+0x144/0xb60
> [c0000000a0993a90] [c00000000017eef0] .handle_mm_fault+0x670/0xb50
> [c0000000a0993b80] [c0000000006feea4] .do_page_fault+0x344/0x780
> [c0000000a0993e30] [c00000000000522c] handle_page_fault+0x20/0x74
> Mem-Info:
> Node 0 DMA per-cpu:
> CPU    0: hi:    6, btch:   1 usd:   4
> CPU    1: hi:    6, btch:   1 usd:   5
> CPU    2: hi:    6, btch:   1 usd:   0
> CPU    3: hi:    6, btch:   1 usd:   0
> CPU    4: hi:    6, btch:   1 usd:   0
> CPU    5: hi:    6, btch:   1 usd:   0
> CPU    6: hi:    6, btch:   1 usd:   4
> CPU    7: hi:    6, btch:   1 usd:   0
> CPU    8: hi:    6, btch:   1 usd:   2
> CPU    9: hi:    6, btch:   1 usd:   0
> CPU   10: hi:    6, btch:   1 usd:   0
> CPU   11: hi:    6, btch:   1 usd:   0
> CPU   12: hi:    6, btch:   1 usd:   0
> CPU   13: hi:    6, btch:   1 usd:   0
> CPU   14: hi:    6, btch:   1 usd:   0
> CPU   15: hi:    6, btch:   1 usd:   0
> CPU   16: hi:    6, btch:   1 usd:   0
> CPU   17: hi:    6, btch:   1 usd:   2
> CPU   18: hi:    6, btch:   1 usd:   2
> CPU   19: hi:    6, btch:   1 usd:   0
> CPU   20: hi:    6, btch:   1 usd:   3
> CPU   21: hi:    6, btch:   1 usd:   1
> CPU   22: hi:    6, btch:   1 usd:   1
> CPU   23: hi:    6, btch:   1 usd:   0
> active_anon:17322 inactive_anon:4230 isolated_anon:2650
>  active_file:7 inactive_file:29 isolated_file:46
>  unevictable:0 dirty:0 writeback:343 unstable:0
>  free:57 slab_reclaimable:426 slab_unreclaimable:22103
>  mapped:19 shmem:0 pagetables:16551 bounce:0
> Node 0 DMA free:832kB min:8128kB low:10112kB high:12160kB active_anon:1108608kB inactive_anon:270720kB active_file:448kB inactive_file:1856kB unevictable:0kB isolated(anon):169600kB isolated(file):2944kB present:4190720kB mlocked:0kB dirty:0kB writeback:21952kB mapped:1216kB shmem:0kB slab_reclaimable:27264kB slab_unreclaimable:1414592kB kernel_stack:156336kB pagetables:1059264kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:69 all_unreclaimable? no
> lowmem_reserve[]: 0 0 0
> Node 0 DMA: 7*64kB 3*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB = 832kB
> 5188 total pagecache pages
> 4932 pages in swap cache
> Swap cache stats: add 37086, delete 32154, find 29567/36415
> Free swap  = 3652416kB
> Total swap = 4095936kB
> 65536 pages RAM
> 1557 pages reserved
> 31189 pages shared
> 59735 pages non-shared
> SLUB: Unable to allocate memory on node -1 (gfp=0x20)
>   cache: kmalloc-128, object size: 128, buffer size: 128, default order: 0, min order: 0
>   node 0: slabs: 92, objs: 47104, free: 0
> ================================================
> 
> Ways to reproduce the problem:
> 1) Fetch, build and install LTP:
>         git clone git://ltp.git.sourceforge.net/gitroot/ltp/ltp
>         cd ltp
>         ./configure
>         make
>         make install
> 2) Execute
>         cd /opt/ltp
>         ./runltp -s msgctl11 -k DMESG_LOG_DIR
> 
> Verify the results under /opt/ltp/results and /opt/ltp/output directory
> 
> Regards--
> Subrata
> 

^ permalink raw reply

* Re: [Call Trace: 2.6.37-rc1-git7 & 2.6.37-rc1-git8, Powerpc] LTP msgctl11 test case
From: Andrew Morton @ 2010-11-11  7:00 UTC (permalink / raw)
  To: subrata
  Cc: Peter Zijlstra, linux-kernel, Kamalesh Babulal, Linuxppc-dev,
	Ingo Molnar, DIVYA PRAKASH
In-Reply-To: <1289457219.5622.15.camel@subratamodak.linux.ibm.com>

On Thu, 11 Nov 2010 12:03:39 +0530 Subrata Modak <subrata@linux.vnet.ibm.com> wrote:

> Hi Peter/Ingo,
> 
> LTP__ msgctl11 test case creates Call trace and Exception for kernels
> 2.6.37-rc1-git7 & 2.6.37-rc1-git8. Please see the dmesg below:
> 
> ================================================
> msgctl11: page allocation failure. order:0, mode:0x20
> Call Trace:
> [c0000000fffcef30] [c000000000014c74] .show_stack+0x74/0x1c0 (unreliable)
> [c0000000fffcefe0] [c00000000015e938] .__alloc_pages_nodemask+0x6d8/0x950
> [c0000000fffcf160] [c0000000001a0c60] .alloc_pages_current+0xa0/0x160
> [c0000000fffcf200] [c0000000001abfd8] .new_slab+0x358/0x370
> [c0000000fffcf2b0] [c0000000001ac1cc] .__slab_alloc+0x1dc/0x500
> [c0000000fffcf390] [c0000000001ad808] .kmem_cache_alloc+0x1a8/0x1b0
> [c0000000fffcf440] [c0000000004eec88] .scsi_pool_alloc_command+0x58/0xa0
> [c0000000fffcf4d0] [c0000000004eed60] .scsi_host_alloc_command+0x30/0xb0
> [c0000000fffcf560] [c0000000004eee00] .__scsi_get_command+0x20/0xd0
> [c0000000fffcf5f0] [c0000000004ef158] .scsi_get_command+0x58/0xf0
> [c0000000fffcf690] [c0000000004f7948] .scsi_setup_fs_cmnd+0x108/0x120
> [c0000000fffcf720] [d000000001484ad8] .sd_prep_fn+0x2b8/0xc70 [sd_mod]
> [c0000000fffcf800] [c0000000003ea92c] .blk_peek_request+0x14c/0x310
> [c0000000fffcf8b0] [c0000000004f6b14] .scsi_request_fn+0x94/0x560
> [c0000000fffcf980] [c0000000003eba00] .__blk_run_queue+0x90/0x1b0
> [c0000000fffcfa00] [c0000000003ebc20] .blk_run_queue+0x30/0x60
> [c0000000fffcfa90] [c0000000004f5d84] .scsi_run_queue+0x104/0x3c0
> [c0000000fffcfb60] [c0000000004f7228] .scsi_next_command+0x48/0x70
> [c0000000fffcfbf0] [c0000000004f8280] .scsi_io_completion+0x3e0/0x580
> [c0000000fffcfcd0] [c0000000004ee0a8] .scsi_finish_command+0x128/0x180
> [c0000000fffcfd70] [c0000000004f8548] .scsi_softirq_done+0x118/0x1e0
> [c0000000fffcfe10] [c0000000003f2410] .blk_done_softirq+0xb0/0xe0
> [c0000000fffcfea0] [c0000000000943c8] .__do_softirq+0x118/0x290
> [c0000000fffcff90] [c000000000031f58] .call_do_softirq+0x14/0x24
> [c0000000a0992a20] [c00000000000f554] .do_softirq+0xf4/0x120
> [c0000000a0992ac0] [c0000000000941d4] .irq_exit+0xb4/0xc0
> [c0000000a0992b40] [c00000000000f7e0] .do_IRQ+0x160/0x2c0
> [c0000000a0992c00] [c000000000004898] hardware_interrupt_entry+0x18/0x80
> --- Exception: 501 at .do_raw_spin_unlock+0x80/0xe0
>     LR = ._raw_spin_unlock+0x30/0x50
> [c0000000a0992f70] [c00000000018943c] .__page_check_address+0x16c/0x1a0
> [c0000000a0993010] [c00000000018a5b4] .page_referenced_one+0x54/0x200
> [c0000000a09930d0] [c00000000018ab4c] .page_referenced+0x3ec/0x490
> [c0000000a0993200] [c000000000168bbc] .shrink_page_list+0x2bc/0x6d0
> [c0000000a0993350] [c00000000016942c] .shrink_inactive_list+0x15c/0x580
> [c0000000a0993460] [c000000000169f10] .shrink_zone+0x2e0/0x4b0
> [c0000000a0993580] [c00000000016b3c0] .do_try_to_free_pages+0x110/0x510
> [c0000000a0993670] [c00000000016bb3c] .try_to_free_pages+0xbc/0x1a0
> [c0000000a0993780] [c00000000015e7a0] .__alloc_pages_nodemask+0x540/0x950
> [c0000000a0993900] [c0000000001a0db8] .alloc_page_vma+0x98/0x1d0
> [c0000000a09939a0] [c00000000017c7f4] .do_wp_page+0x144/0xb60
> [c0000000a0993a90] [c00000000017eef0] .handle_mm_fault+0x670/0xb50
> [c0000000a0993b80] [c0000000006feea4] .do_page_fault+0x344/0x780
> [c0000000a0993e30] [c00000000000522c] handle_page_fault+0x20/0x74

That trace is impressively hard to understand.  Who called
do_raw_spin_unlock?

^ permalink raw reply

* Re: [linux-2.6.36-git7: Power7] LTP Memory CGROUP Controller functional test creates Backtrace, OOMKill & rcu_sched_state detected stall jiffies
From: Subrata Modak @ 2010-11-11  7:57 UTC (permalink / raw)
  To: KAMEZAWA Hiroyuki
  Cc: Linuxppc-dev, Kamalesh Babulal, Li Zefan, linux-kernel, ltp-list
In-Reply-To: <20101027094502.208c1207.kamezawa.hiroyu@jp.fujitsu.com>

On Wed, 2010-10-27 at 09:45 +0900, KAMEZAWA Hiroyuki wrote: 
> On Tue, 26 Oct 2010 16:03:56 +0530
> Subrata Modak <subrata@linux.vnet.ibm.com> wrote:
> 
> > If you run LTP Memory CGROUP Controller functional test on
> > linux-2.6.36-git7, the following Backtrace, OOMKill & rcu_sched_state
> > detected stall jiffies are created. The machine is not reachable
> > thereafter. Ways to reproduce this problem:
> > 
> > 1) Build and boot kernel 2.6.36-git7 on Power7 machine with attached
> > config file,
> > 2) Fetch, build and install LTP:
> > 	git clone git://ltp.git.sourceforge.net/gitroot/ltp/ltp
> > 	cd ltp
> > 	./configure
> > 	make
> > 	make install
> > 3) Create a LTP runtest file /opt/ltp/runtest/memcg_function_test with
> > the following entry:
> > memcg_function          memcg_function_test.sh
> > <<EOF>>
> > 	cd /opt/ltp
> > 	./runltp -f memcg_function_test
> > 
> 
> IIUC, memcg test includes intentional OOM-Kill test by setting the limit to 0.
> And it has another test to set the limit to PAGE_SIZE.
> 
> In your environemnt, I think page size is 64kb...right ?
> 
> About rcu_sched_state()....I have no idea at this stage. I reviewed memcontrol.c
> and oom_kill.c again and coundn't found anything in quick review.
> 
> Could you try again after -rc1 shipped ?

Oh Sure, I saw this mail now. I will try it out on the latest git tree
available :-)

Regards--
Subrata

> I think Andrew Morton sent some amount of updates for oom_kill and memcg, vmscan
> to Linus, today.
> 
> Thanks,
> -Kame
> 

^ permalink raw reply

* Re: [PATCH] powerpc: Fix hcall tracepoint recursion
From: Subrata Modak @ 2010-11-11  7:57 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>

I tested and reported back the results. The patch works fine. Can you
please find out if it has been committed to Linus tree and if yes, then
the commit id please ?

Regards--
Subrata

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?
> 
> > 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 3/4][v2] fsl_rio: move machine_check handler into machine_check_e500 & machine_check_e500mc
From: Xie Shaohui-B21989 @ 2010-11-11 10:19 UTC (permalink / raw)
  To: Bounine, Alexandre, akpm
  Cc: Zang Roy-R61911, Gala Kumar-B11780, linuxppc-dev, linux-kernel,
	Li Yang-R58472
In-Reply-To: <0CE8B6BE3C4AD74AB97D9D29BD24E55201538B08@CORPEXCH1.na.ads.idt.com>




Best Regards,=20
Shaohui Xie=20


> -----Original Message-----
> From: Bounine, Alexandre [mailto:Alexandre.Bounine@idt.com]
> Sent: Thursday, November 11, 2010 6:55 AM
> To: Xie Shaohui-B21989; akpm@linux-foundation.org
> Cc: linux-kernel@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; Li
Yang-
> R58472; Gala Kumar-B11780; Zang Roy-R61911
> Subject: RE: [PATCH 3/4][v2] fsl_rio: move machine_check handler into
> machine_check_e500 & machine_check_e500mc
>=20
> Shaohui Xie <b21989@freescale.com> wrote:
> >
> > diff --git a/arch/powerpc/kernel/traps.c
b/arch/powerpc/kernel/traps.c
> > index a45a63c..2a5fb9d 100644
> > --- a/arch/powerpc/kernel/traps.c
> > +++ b/arch/powerpc/kernel/traps.c
> > @@ -55,6 +55,7 @@
> >  #endif
> >  #include <asm/kexec.h>
> >  #include <asm/ppc-opcode.h>
> > +#include <linux/rio.h>
> >
> >  #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)  int
> > (*__debugger)(struct pt_regs *regs) __read_mostly; @@ -500,6 +501,13
> > @@ int machine_check_e500mc(struct pt_regs *regs)
> >  		       reason & MCSR_MEA ? "Effective" : "Physical",
> addr);
> >  	}
> >
> > +	if (reason & MCSR_BUS_RBERR) {
> > +		printk("Bus - Read Data Bus Error\n"); #ifdef
CONFIG_RAPIDIO
> > +		recoverable =3D fsl_rio_mcheck_exception(regs); #endif
> > +	}
> > +
> >  	mtspr(SPRN_MCSR, mcsr);
> >  	return mfspr(SPRN_MCSR) =3D=3D 0 && recoverable;  } @@ -527,8
+535,12
> @@
> > int machine_check_e500(struct pt_regs *regs)
> >  		printk("Bus - Write Address Error\n");
> >  	if (reason & MCSR_BUS_IBERR)
> >  		printk("Bus - Instruction Data Error\n");
> > -	if (reason & MCSR_BUS_RBERR)
> > +	if (reason & MCSR_BUS_RBERR) {
> >  		printk("Bus - Read Data Bus Error\n");
> > +#ifdef CONFIG_RAPIDIO
> > +		fsl_rio_mcheck_exception(regs);
> > +#endif
> > +	}
> >  	if (reason & MCSR_BUS_WBERR)
> >  		printk("Bus - Read Data Bus Error\n");
> >  	if (reason & MCSR_BUS_IPERR)
>=20
> This implementation breaks an intended use of
> fsl_rio_mcheck_exception():
> 1. for e500 it does not check the return value of the rio handler and
> crashes the system even after RIO Mchk was serviced. Looks like e500mc
> version handles it better but I have no HW to test it.
> 2. the RIO Mchk is expected to be handled quietly but here it has many
> printk's. May be it is better to call the fsl_rio_mcheck_exception()
> handler in very beginning and simply exit if it returns 1.
>=20
> Alex.
[Xie Shaohui-B21989] Hi Alex, seems your suggestion is some kind of
conflict with Kumar, you can have a look at=20
http://patchwork.ozlabs.org/patch/67774/

Thanks
Shaohui

>=20
>=20

^ permalink raw reply

* [PATCH v2] fsldma: add support to 36-bit physical address
From: Li Yang @ 2010-11-11 12:16 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linuxppc-dev, linux-kernel

Expand the dma_mask of fsldma device to 36-bit, indicating that the
DMA engine can deal with 36-bit physical address and does not need
the SWIOTLB to create bounce buffer for it when doing dma_map_*().

Signed-off-by: Li Yang <leoli@freescale.com>
---
Add more detailed commit message

 drivers/dma/fsldma.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index cea08be..8c79b37 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1,7 +1,7 @@
 /*
  * Freescale MPC85xx, MPC83xx DMA Engine support
  *
- * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
+ * Copyright (C) 2007-2010 Freescale Semiconductor, Inc. All rights reserved.
  *
  * Author:
  *   Zhang Wei <wei.zhang@freescale.com>, Jul 2007
@@ -1338,6 +1338,8 @@ static int __devinit fsldma_of_probe(struct platform_device *op,
 	fdev->common.device_control = fsl_dma_device_control;
 	fdev->common.dev = &op->dev;
 
+	dma_set_mask(&(op->dev), DMA_BIT_MASK(36));
+
 	dev_set_drvdata(&op->dev, fdev);
 
 	/*
-- 
1.6.6-rc1.GIT

^ permalink raw reply related

* Re: [PATCH] Add Freescale CodeWarrior debug support for kernel
From: Kumar Gala @ 2010-11-11 11:51 UTC (permalink / raw)
  To: Roy Zang; +Cc: linuxppc-dev, adrian.bogdan
In-Reply-To: <1288255803-10948-1-git-send-email-tie-fei.zang@freescale.com>


On Oct 28, 2010, at 3:50 AM, Roy Zang wrote:

> CodeWarrior is popular embedded tools to support debugging Powerpc.
> This patch adds Freescale CodeWarrior debug support for Linux kernel =
on
> 85xx/QorIQ platform.
>=20
> Signed-off-by: Bogdan Adrin <drian.bogdan@freescale.com>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> ---
> arch/powerpc/Kconfig.debug                    |    8 ++++++++
> arch/powerpc/Makefile                         |    5 +++++
> arch/powerpc/include/asm/reg_booke.h          |    4 ++++
> arch/powerpc/kernel/fsl_booke_entry_mapping.S |    3 +++
> arch/powerpc/kernel/head_fsl_booke.S          |   11 +++++++++--
> arch/powerpc/kernel/idle.c                    |    5 ++++-
> 6 files changed, 33 insertions(+), 3 deletions(-)
>=20
> diff --git a/arch/powerpc/Kconfig.debug b/arch/powerpc/Kconfig.debug
> index 2d38a50..eedd2ac 100644
> --- a/arch/powerpc/Kconfig.debug
> +++ b/arch/powerpc/Kconfig.debug
> @@ -153,6 +153,14 @@ config BDI_SWITCH
> 	  Unless you are intending to debug the kernel with one of these
> 	  machines, say N here.
>=20
> +config DEBUG_CODEWARRIOR
> +	bool "Include CodeWarrior kernel debugging"
> +	depends on DEBUG_KERNEL && PPC32
> +	help
> +	  Say Y here to include CodeWarrior kernel debugging option
> +	  Unless you are intending to debug the kernel with one of these
> +	  machines, say N here.
> +
> config BOOTX_TEXT
> 	bool "Support for early boot text console (BootX or OpenFirmware =
only)"
> 	depends on PPC_OF && PPC_BOOK3S
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index b7212b6..d3050e6 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -121,6 +121,11 @@ KBUILD_CFLAGS	+=3D $(call =
cc-option,-fno-dwarf2-cfi-asm)
> # often slow when they are implemented at all
> KBUILD_CFLAGS		+=3D -mno-string
>=20
> +ifeq ($(CONFIG_DEBUG_CODEWARRIOR),y)
> +CFLAGS +=3D -g2 -gdwarf-2
> +AFLAGS_KERNEL +=3D -Wa,-gdwarf2
> +endif
> +
> ifeq ($(CONFIG_6xx),y)
> KBUILD_CFLAGS		+=3D -mcpu=3Dpowerpc
> endif
> diff --git a/arch/powerpc/include/asm/reg_booke.h =
b/arch/powerpc/include/asm/reg_booke.h
> index 667a498..ac65fcd 100644
> --- a/arch/powerpc/include/asm/reg_booke.h
> +++ b/arch/powerpc/include/asm/reg_booke.h
> @@ -35,7 +35,11 @@
> #define MSR_KERNEL	(MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE)
> #define MSR_USER	(MSR_KERNEL|MSR_PR|MSR_EE)
> #else
> +#if defined(CONFIG_DEBUG_CODEWARRIOR)
> +#define MSR_KERNEL	(MSR_ME|MSR_RI|MSR_CE|MSR_DE)
> +#else
> #define MSR_KERNEL	(MSR_ME|MSR_RI|MSR_CE)
> +#endif
> #define MSR_USER	(MSR_KERNEL|MSR_PR|MSR_EE)
> #endif
>=20
> diff --git a/arch/powerpc/kernel/fsl_booke_entry_mapping.S =
b/arch/powerpc/kernel/fsl_booke_entry_mapping.S
> index a92c79b..9102aa7 100644
> --- a/arch/powerpc/kernel/fsl_booke_entry_mapping.S
> +++ b/arch/powerpc/kernel/fsl_booke_entry_mapping.S
> @@ -116,6 +116,9 @@ skpinv:	addi	r6,r6,1				=
/* Increment */
>=20
> 	xori	r6,r4,1
> 	slwi	r6,r6,5		/* setup new context with other address =
space */
> +#if defined(CONFIG_DEBUG_CODEWARRIOR)
> +	ori	r6, r6, 0x200	/* enable DE bit for MSR */

Can we use MSR_DE@l instead of 0x200

> +#endif
> 	bl	1f		/* Find our address */
> 1:	mflr	r9
> 	rlwimi	r7,r9,0,20,31
> diff --git a/arch/powerpc/kernel/head_fsl_booke.S =
b/arch/powerpc/kernel/head_fsl_booke.S
> index 529b817..9962d09 100644
> --- a/arch/powerpc/kernel/head_fsl_booke.S
> +++ b/arch/powerpc/kernel/head_fsl_booke.S
> @@ -21,7 +21,7 @@
>  *		debbie_chu@mvista.com
>  *    Copyright 2002-2004 MontaVista Software, Inc.
>  *	PowerPC 44x support, Matt Porter <mporter@kernel.crashing.org>
> - *    Copyright 2004 Freescale Semiconductor, Inc
> + *    Copyright 2004,2010 Freescale Semiconductor, Inc
>  *	PowerPC e500 modifications, Kumar Gala =
<galak@kernel.crashing.org>
>  *
>  * This program is free software; you can redistribute  it and/or =
modify it
> @@ -135,7 +135,7 @@ _ENTRY(__early_start)
> 	mtspr	SPRN_HID0, r2
> #endif
>=20
> -#if !defined(CONFIG_BDI_SWITCH)
> +#if !defined(CONFIG_BDI_SWITCH) && !defined(CONFIG_DEBUG_CODEWARRIOR)
> 	/*
> 	 * The Abatron BDI JTAG debugger does not tolerate others
> 	 * mucking with the debug registers.
> @@ -197,6 +197,13 @@ _ENTRY(__early_start)
> /*
>  * Decide what sort of machine this is and initialize the MMU.
>  */
> +#if defined(CONFIG_DEBUG_CODEWARRIOR)
> +	lis	r10, 0x1008 /* clear the V bit from the L2MMU_CAM8 =
register */

why do we need this code?  It seems pretty fragile if its assuming =
something about TLB entry #8

> +	mtspr	SPRN_MAS0, r10
> +	lis	r10, 0x0
> +	mtspr	SPRN_MAS1, r10
> +	tlbwe
> +#endif
> 	mr	r3,r31
> 	mr	r4,r30
> 	mr	r5,r29
> diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
> index 39a2baa..83fb019 100644
> --- a/arch/powerpc/kernel/idle.c
> +++ b/arch/powerpc/kernel/idle.c
> @@ -73,8 +73,11 @@ void cpu_idle(void)
> 				stop_critical_timings();
>=20
> 				/* check again after disabling irqs */
> -				if (!need_resched() && =
!cpu_should_die())
> +				if (!need_resched() && =
!cpu_should_die()) {
> +#if !defined(CONFIG_DEBUG_CODEWARRIOR)
> 					ppc_md.power_save();
> +#endif
> +				}
>=20
> 				start_critical_timings();
>=20
> --=20
> 1.5.6.5
>=20

^ permalink raw reply

* Re: [PATCH v2] fsldma: add support to 36-bit physical address
From: Kumar Gala @ 2010-11-11 11:56 UTC (permalink / raw)
  To: Li Yang; +Cc: dan.j.williams, linuxppc-dev, linux-kernel
In-Reply-To: <1289477789-10651-1-git-send-email-leoli@freescale.com>


On Nov 11, 2010, at 6:16 AM, Li Yang wrote:

> Expand the dma_mask of fsldma device to 36-bit, indicating that the
> DMA engine can deal with 36-bit physical address and does not need
> the SWIOTLB to create bounce buffer for it when doing dma_map_*().
>=20
> Signed-off-by: Li Yang <leoli@freescale.com>
> ---
> Add more detailed commit message
>=20
> drivers/dma/fsldma.c |    4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>=20
> diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
> index cea08be..8c79b37 100644
> --- a/drivers/dma/fsldma.c
> +++ b/drivers/dma/fsldma.c
> @@ -1,7 +1,7 @@
> /*
>  * Freescale MPC85xx, MPC83xx DMA Engine support
>  *
> - * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights =
reserved.
> + * Copyright (C) 2007-2010 Freescale Semiconductor, Inc. All rights =
reserved.
>  *
>  * Author:
>  *   Zhang Wei <wei.zhang@freescale.com>, Jul 2007
> @@ -1338,6 +1338,8 @@ static int __devinit fsldma_of_probe(struct =
platform_device *op,
> 	fdev->common.device_control =3D fsl_dma_device_control;
> 	fdev->common.dev =3D &op->dev;
>=20
> +	dma_set_mask(&(op->dev), DMA_BIT_MASK(36));
> +

Is there any reason we shouldn't set DMA_BIT_MASK(64) since the DMA =
block programming model allows the address to be 64-bits?

> 	dev_set_drvdata(&op->dev, fdev);
>=20
> 	/*
> --=20
> 1.6.6-rc1.GIT
>=20

^ permalink raw reply

* Re: [PATCH 3/3] powerpc/85xx: Update of_platform_bus_probe list to include PCI controller
From: Kumar Gala @ 2010-11-11 11:59 UTC (permalink / raw)
  To: Lan Chunhe; +Cc: Kai.Jiang, akpm, linuxppc-dev, dougthompson
In-Reply-To: <1288934910-3202-1-git-send-email-b25806@freescale.com>


On Nov 5, 2010, at 12:28 AM, Lan Chunhe wrote:

> We need to get the pci controller created as an of platform device to
> allow the EDAC driver to bind to it on P4080DS.
>=20
> Signed-off-by: Kai.Jiang <Kai.Jiang@freescale.com>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> Signed-off-by: Lan Chunhe <b25806@freescale.com>
> ---
> arch/powerpc/platforms/85xx/corenet_ds.c |    3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>=20
> diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c =
b/arch/powerpc/platforms/85xx/corenet_ds.c
> index 2ab338c..bf9b9e5 100644
> --- a/arch/powerpc/platforms/85xx/corenet_ds.c
> +++ b/arch/powerpc/platforms/85xx/corenet_ds.c
> @@ -116,6 +116,9 @@ static const struct of_device_id of_device_ids[] =
__devinitconst =3D {
> 	{
> 		.compatible	=3D "fsl,rapidio-delta",
> 	},
> +	{
> +		.compatible	=3D "fsl,p4080-pcie",
> +	},
> 	{}
> };
>=20

We've talked about doing an explicit add of a new node instead of doing =
this everywhere.  I'd like to see that done instead.

- k
> --=20
> 1.5.4.5
>=20

^ permalink raw reply

* Re: [PATCH 3/3] powerpc/85xx: Update of_platform_bus_probe list to include PCI controller
From: Kumar Gala @ 2010-11-11 12:01 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Lan Chunhe, linuxppc-dev, akpm, Kai.Jiang, dougthompson
In-Reply-To: <90A4C584-325F-4E5D-8D3C-1B5797F4CAC0@kernel.crashing.org>


On Nov 11, 2010, at 5:59 AM, Kumar Gala wrote:

>=20
> On Nov 5, 2010, at 12:28 AM, Lan Chunhe wrote:
>=20
>> We need to get the pci controller created as an of platform device to
>> allow the EDAC driver to bind to it on P4080DS.
>>=20
>> Signed-off-by: Kai.Jiang <Kai.Jiang@freescale.com>
>> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
>> Signed-off-by: Lan Chunhe <b25806@freescale.com>
>> ---
>> arch/powerpc/platforms/85xx/corenet_ds.c |    3 +++
>> 1 files changed, 3 insertions(+), 0 deletions(-)
>>=20
>> diff --git a/arch/powerpc/platforms/85xx/corenet_ds.c =
b/arch/powerpc/platforms/85xx/corenet_ds.c
>> index 2ab338c..bf9b9e5 100644
>> --- a/arch/powerpc/platforms/85xx/corenet_ds.c
>> +++ b/arch/powerpc/platforms/85xx/corenet_ds.c
>> @@ -116,6 +116,9 @@ static const struct of_device_id of_device_ids[] =
__devinitconst =3D {
>> 	{
>> 		.compatible	=3D "fsl,rapidio-delta",
>> 	},
>> +	{
>> +		.compatible	=3D "fsl,p4080-pcie",
>> +	},
>> 	{}
>> };
>>=20
>=20
> We've talked about doing an explicit add of a new node instead of =
doing this everywhere.  I'd like to see that done instead.

The thread that describes this a bit further is here:

http://patchwork.ozlabs.org/patch/59530/

- k=

^ permalink raw reply

* Re: [PATCH 1/3] edac: Use ccsr_pci structure instead of hardcoded define
From: Kumar Gala @ 2010-11-11 12:06 UTC (permalink / raw)
  To: Lan Chunhe; +Cc: Kai.Jiang, akpm, linuxppc-dev, dougthompson
In-Reply-To: <1288927383-1300-1-git-send-email-b25806@freescale.com>


On Nov 4, 2010, at 10:23 PM, Lan Chunhe wrote:

> There are some differences of register offset and definition between
> pci and pcie error management registers. While, some other pci/pcie
> error management registers are nearly the same.
>=20
> To merge pci and pcie edac code into one, it is easier to use ccsr_pci
> structure than the hardcoded define. So remove the hardcoded define =
and
> add pci/pcie error management register in ccsr_pci structure.
>=20
> Signed-off-by: Kai.Jiang <Kai.Jiang@freescale.com>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> Signed-off-by: Lan Chunhe <b25806@freescale.com>
> ---
> arch/powerpc/sysdev/fsl_pci.h |   54 =
+++++++++++++++++++++++++++++++---------
> drivers/edac/mpc85xx_edac.h   |   13 +--------
> 2 files changed, 44 insertions(+), 23 deletions(-)

You need to bring in the changes from the next patch that address the =
use of the ccsr_pci struct instead of #defines into this patch.  =
Otherwise we break building of the code.  Also it makes the next patch =
easier to read as we are mixing the changes associated with 'struct =
ccsr_pci' with what its doing

>=20
> diff --git a/arch/powerpc/sysdev/fsl_pci.h =
b/arch/powerpc/sysdev/fsl_pci.h
> index 8ad72a1..796985b 100644
> --- a/arch/powerpc/sysdev/fsl_pci.h
> +++ b/arch/powerpc/sysdev/fsl_pci.h
> @@ -1,7 +1,7 @@
> /*
>  * MPC85xx/86xx PCI Express structure define
>  *
> - * Copyright 2007 Freescale Semiconductor, Inc
> + * Copyright 2007, 2010 Freescale Semiconductor, Inc
>  *
>  * This program is free software; you can redistribute  it and/or =
modify it
>  * under  the terms of  the GNU General  Public License as published =
by the
> @@ -14,6 +14,8 @@
> #ifndef __POWERPC_FSL_PCI_H
> #define __POWERPC_FSL_PCI_H
>=20
> +#include <asm/pci-bridge.h>
> +
> #define PCIE_LTSSM	0x0404		/* PCIE Link Training and Status =
*/
> #define PCIE_LTSSM_L0	0x16		/* L0 state */
> #define PIWAR_EN		0x80000000	/* Enable */
> @@ -71,18 +73,46 @@ struct ccsr_pci {
>  */
> 	struct pci_inbound_window_regs piw[3];
>=20
> -	__be32	pex_err_dr;		/* 0x.e00 - PCI/PCIE error =
detect register */
> -	u8	res21[4];
> -	__be32	pex_err_en;		/* 0x.e08 - PCI/PCIE error =
interrupt enable register */
> -	u8	res22[4];
> -	__be32	pex_err_disr;		/* 0x.e10 - PCI/PCIE error =
disable register */
> -	u8	res23[12];
> -	__be32	pex_err_cap_stat;	/* 0x.e20 - PCI/PCIE error =
capture status register */
> +/* Merge PCI/PCI Express error management registers */
> +	__be32	pex_err_dr;	  /* 0x.e00
> +				   * - PCI/PCIE error detect register
> +				   */
> +	__be32	pex_err_cap_dr;	  /* 0x.e04
> +				   * - PCI error capture disabled =
register
> +				   * - PCIE has no this register
> +				   */
> +	__be32	pex_err_en;	  /* 0x.e08
> +				   * - PCI/PCIE error interrupt enable =
register
> +				   */
> +	__be32	pex_err_attrib;	  /* 0x.e0c
> +				   * - PCI error attributes capture =
register
> +				   * - PCIE has no this register
> +				   */
> +	__be32	pex_err_disr;	  /* 0x.e10
> +				   * - PCI error address capture =
register
> +				   * - PCIE error disable register
> +				   */
> +	__be32	pex_err_ext_addr; /* 0x.e14
> +				   * - PCI error extended addr capture =
register
> +				   * - PCIE has no this register
> +				   */
> +	__be32	pex_err_dl;	  /* 0x.e18
> +				   * - PCI error data low capture =
register
> +				   * - PCIE has no this register
> +				   */
> +	__be32	pex_err_dh;	  /* 0x.e1c
> +				   * - PCI error data high capture =
register
> +				   * - PCIE has no this register
> +				   */
> +	__be32	pex_err_cap_stat; /* 0x.e20
> +				   * - PCI gasket timer register
> +				   * - PCIE error capture status =
register
> +				   */
> 	u8	res24[4];
> -	__be32	pex_err_cap_r0;		/* 0x.e28 - PCIE error capture =
register 0 */
> -	__be32	pex_err_cap_r1;		/* 0x.e2c - PCIE error capture =
register 0 */
> -	__be32	pex_err_cap_r2;		/* 0x.e30 - PCIE error capture =
register 0 */
> -	__be32	pex_err_cap_r3;		/* 0x.e34 - PCIE error capture =
register 0 */
> +	__be32	pex_err_cap_r0;	  /* 0x.e28 - PCIE error capture =
register 0 */
> +	__be32	pex_err_cap_r1;	  /* 0x.e2c - PCIE error capture =
register 1 */
> +	__be32	pex_err_cap_r2;	  /* 0x.e30 - PCIE error capture =
register 2 */
> +	__be32	pex_err_cap_r3;	  /* 0x.e34 - PCIE error capture =
register 3 */
> };
>=20
> extern int fsl_add_bridge(struct device_node *dev, int is_primary);
> diff --git a/drivers/edac/mpc85xx_edac.h b/drivers/edac/mpc85xx_edac.h
> index cb24df8..099581d 100644
> --- a/drivers/edac/mpc85xx_edac.h
> +++ b/drivers/edac/mpc85xx_edac.h
> @@ -1,5 +1,7 @@
> /*
>  * Freescale MPC85xx Memory Controller kenel module
> + * Copyright (c) 2010 Freescale Semiconductor, Inc.
> + *
>  * Author: Dave Jiang <djiang@mvista.com>
>  *
>  * 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
> @@ -131,17 +133,6 @@
> #define PCI_EDE_PERR_MASK	(PCI_EDE_TGT_PERR | PCI_EDE_MST_PERR | \
> 				PCI_EDE_ADDR_PERR)
>=20
> -#define MPC85XX_PCI_ERR_DR		0x0000
> -#define MPC85XX_PCI_ERR_CAP_DR		0x0004
> -#define MPC85XX_PCI_ERR_EN		0x0008
> -#define MPC85XX_PCI_ERR_ATTRIB		0x000c
> -#define MPC85XX_PCI_ERR_ADDR		0x0010
> -#define MPC85XX_PCI_ERR_EXT_ADDR	0x0014
> -#define MPC85XX_PCI_ERR_DL		0x0018
> -#define MPC85XX_PCI_ERR_DH		0x001c
> -#define MPC85XX_PCI_GAS_TIMR		0x0020
> -#define MPC85XX_PCI_PCIX_TIMR		0x0024
> -
> struct mpc85xx_mc_pdata {
> 	char *name;
> 	int edac_idx;
> --=20
> 1.5.4.5
>=20

^ permalink raw reply

* Re: [REPOST] [PATCH 0/6] fixes and MPC8308 support for the mpc512x_dma driver
From: Wolfgang Denk @ 2010-11-11 12:11 UTC (permalink / raw)
  To: Ilya Yanok; +Cc: vlad, Kumar Gala, linuxppc-dev, dzu
In-Reply-To: <1288137180-3220-1-git-send-email-yanok@emcraft.com>

Dear Ilya Yanok,

In message <1288137180-3220-1-git-send-email-yanok@emcraft.com> you wrote:
> Hello everybody,
> 
> meanwhile I've fixed one more issue in mpc512x_dma driver.
> 
> Any comments? Anybody interrested in this driver? Piotr?
> 
> Still unsure how to deal with bitfield structures in IO space...
> 
> Regards, Ilya.
> 
> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
> Cc: Piotr Ziecik <kosmo@semihalf.com>

Tested-by: Wolfgang Denk <wd@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
I have often regretted my speech, never my silence.

^ permalink raw reply

* Re: [REPOST][PATCH] mpc8308: fix USB DR controller initialization
From: Wolfgang Denk @ 2010-11-11 12:18 UTC (permalink / raw)
  To: Ilya Yanok; +Cc: vlad, linuxppc-dev, dzu
In-Reply-To: <1288137756-3389-1-git-send-email-yanok@emcraft.com>

Dear Ilya Yanok,

In message <1288137756-3389-1-git-send-email-yanok@emcraft.com> you wrote:
> MPC8308 has ULPI pin muxing settings in SICRH register, bits 17-18
> which is different from both MPC8313 and MPC8315.
> Also MPC8308 doesn't have REFSEL, UTMI_PHY_EN and OTG_PORT fields
> in the USB DR controller CONTROL register.
> 
> Signed-off-by: Ilya Yanok <yanok@emcraft.com>

Tested-by: Wolfgang Denk <wd@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
If you think the problem is bad now, just wait until we've solved it.
                                                        Epstein's Law

^ permalink raw reply

* Re: [PATCH 1/4][v2] powerpc: add e500 HID1 bit definition
From: Kumar Gala @ 2010-11-11 12:20 UTC (permalink / raw)
  To: Shaohui Xie; +Cc: Alexandre Bounine, akpm, linuxppc-dev, linux-kernel
In-Reply-To: <1288776931-20689-1-git-send-email-b21989@freescale.com>


On Nov 3, 2010, at 4:35 AM, Shaohui Xie wrote:

> From: Li Yang <leoli@freescale.com>
> 
> Also make 74xx HID1 definition conditional.
> 
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Shaohui Xie <b21989@freescale.com>
> Cc: Li Yang <leoli@freescale.com>
> Cc: Kumar Gala <kumar.gala@freescale.com>
> Cc: Roy Zang <tie-fei.zang@freescale.com>
> Cc: Alexandre Bounine <alexandre.bounine@idt.com>
> ---
> These patches have been send for almost one week, and has no feedback.
> 
> arch/powerpc/include/asm/reg.h       |    2 ++
> arch/powerpc/include/asm/reg_booke.h |   14 ++++++++++++++
> 2 files changed, 16 insertions(+), 0 deletions(-)

applied to next

- k

^ permalink raw reply

* Re: [PATCH 3/4][v2] fsl_rio: move machine_check handler into machine_check_e500 & machine_check_e500mc
From: Kumar Gala @ 2010-11-11 12:26 UTC (permalink / raw)
  To: Xie Shaohui-B21989
  Cc: Li Yang-R58472, linux-kernel, Zang Roy-R61911, Bounine, Alexandre,
	akpm, linuxppc-dev, Gala Kumar-B11780
In-Reply-To: <9FCE46230501DF4D9461B9ACC152FD7104DDA26D@zmy16exm20.fsl.freescale.net>


On Nov 11, 2010, at 4:19 AM, Xie Shaohui-B21989 wrote:

>=20
>=20
>=20
> Best Regards,=20
> Shaohui Xie=20
>=20
>=20
>> -----Original Message-----
>> From: Bounine, Alexandre [mailto:Alexandre.Bounine@idt.com]
>> Sent: Thursday, November 11, 2010 6:55 AM
>> To: Xie Shaohui-B21989; akpm@linux-foundation.org
>> Cc: linux-kernel@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; Li
> Yang-
>> R58472; Gala Kumar-B11780; Zang Roy-R61911
>> Subject: RE: [PATCH 3/4][v2] fsl_rio: move machine_check handler into
>> machine_check_e500 & machine_check_e500mc
>>=20
>> Shaohui Xie <b21989@freescale.com> wrote:
>>>=20
>>> diff --git a/arch/powerpc/kernel/traps.c
> b/arch/powerpc/kernel/traps.c
>>> index a45a63c..2a5fb9d 100644
>>> --- a/arch/powerpc/kernel/traps.c
>>> +++ b/arch/powerpc/kernel/traps.c
>>> @@ -55,6 +55,7 @@
>>> #endif
>>> #include <asm/kexec.h>
>>> #include <asm/ppc-opcode.h>
>>> +#include <linux/rio.h>
>>>=20
>>> #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)  int
>>> (*__debugger)(struct pt_regs *regs) __read_mostly; @@ -500,6 +501,13
>>> @@ int machine_check_e500mc(struct pt_regs *regs)
>>> 		       reason & MCSR_MEA ? "Effective" : "Physical",
>> addr);
>>> 	}
>>>=20
>>> +	if (reason & MCSR_BUS_RBERR) {
>>> +		printk("Bus - Read Data Bus Error\n"); #ifdef
> CONFIG_RAPIDIO
>>> +		recoverable =3D fsl_rio_mcheck_exception(regs); #endif
>>> +	}
>>> +
>>> 	mtspr(SPRN_MCSR, mcsr);
>>> 	return mfspr(SPRN_MCSR) =3D=3D 0 && recoverable;  } @@ -527,8
> +535,12
>> @@
>>> int machine_check_e500(struct pt_regs *regs)
>>> 		printk("Bus - Write Address Error\n");
>>> 	if (reason & MCSR_BUS_IBERR)
>>> 		printk("Bus - Instruction Data Error\n");
>>> -	if (reason & MCSR_BUS_RBERR)
>>> +	if (reason & MCSR_BUS_RBERR) {
>>> 		printk("Bus - Read Data Bus Error\n");
>>> +#ifdef CONFIG_RAPIDIO
>>> +		fsl_rio_mcheck_exception(regs);
>>> +#endif
>>> +	}
>>> 	if (reason & MCSR_BUS_WBERR)
>>> 		printk("Bus - Read Data Bus Error\n");
>>> 	if (reason & MCSR_BUS_IPERR)
>>=20
>> This implementation breaks an intended use of
>> fsl_rio_mcheck_exception():
>> 1. for e500 it does not check the return value of the rio handler and
>> crashes the system even after RIO Mchk was serviced. Looks like =
e500mc
>> version handles it better but I have no HW to test it.
>> 2. the RIO Mchk is expected to be handled quietly but here it has =
many
>> printk's. May be it is better to call the fsl_rio_mcheck_exception()
>> handler in very beginning and simply exit if it returns 1.
>>=20
>> Alex.
> [Xie Shaohui-B21989] Hi Alex, seems your suggestion is some kind of
> conflict with Kumar, you can have a look at=20
> http://patchwork.ozlabs.org/patch/67774/

I think Alex's comment is the fact we ignore the 'return' value in the =
machine_check_e500 case.

- k=

^ permalink raw reply

* Re: [PATCH 3/4][v2] fsl_rio: move machine_check handler into machine_check_e500 & machine_check_e500mc
From: Kumar Gala @ 2010-11-11 12:31 UTC (permalink / raw)
  To: Shaohui Xie; +Cc: Alexandre Bounine, akpm, linuxppc-dev, linux-kernel
In-Reply-To: <1288777018-24259-1-git-send-email-b21989@freescale.com>


On Nov 3, 2010, at 4:36 AM, Shaohui Xie wrote:

> Signed-off-by: Shaohui Xie <b21989@freescale.com>
> Cc: Li Yang <leoli@freescale.com>
> Cc: Kumar Gala <kumar.gala@freescale.com>
> Cc: Roy Zang <tie-fei.zang@freescale.com>
> Cc: Alexandre Bounine <alexandre.bounine@idt.com>
> ---
> arch/powerpc/kernel/traps.c   |   14 +++++++++++++-
> arch/powerpc/sysdev/fsl_rio.c |   15 +++------------
> include/linux/rio.h           |    1 +
> 3 files changed, 17 insertions(+), 13 deletions(-)
>=20
> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
> index a45a63c..2a5fb9d 100644
> --- a/arch/powerpc/kernel/traps.c
> +++ b/arch/powerpc/kernel/traps.c
> @@ -55,6 +55,7 @@
> #endif
> #include <asm/kexec.h>
> #include <asm/ppc-opcode.h>
> +#include <linux/rio.h>
>=20
> #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
> int (*__debugger)(struct pt_regs *regs) __read_mostly;
> @@ -500,6 +501,13 @@ int machine_check_e500mc(struct pt_regs *regs)
> 		       reason & MCSR_MEA ? "Effective" : "Physical", =
addr);
> 	}
>=20
> +	if (reason & MCSR_BUS_RBERR) {
> +		printk("Bus - Read Data Bus Error\n");
> +#ifdef CONFIG_RAPIDIO
> +		recoverable =3D fsl_rio_mcheck_exception(regs);
> +#endif
> +	}
> +
> 	mtspr(SPRN_MCSR, mcsr);
> 	return mfspr(SPRN_MCSR) =3D=3D 0 && recoverable;
> }
> @@ -527,8 +535,12 @@ int machine_check_e500(struct pt_regs *regs)

To deal w/Alex's comment do:

machine_check_e500(...) {

	int ret =3D 0;


> 		printk("Bus - Write Address Error\n");
> 	if (reason & MCSR_BUS_IBERR)
> 		printk("Bus - Instruction Data Error\n");
> -	if (reason & MCSR_BUS_RBERR)
> +	if (reason & MCSR_BUS_RBERR) {
> 		printk("Bus - Read Data Bus Error\n");
> +#ifdef CONFIG_RAPIDIO
> +		fsl_rio_mcheck_exception(regs);
> +#endif

make this like 'ret =3D fsl_rio...

> +	}
> 	if (reason & MCSR_BUS_WBERR)
> 		printk("Bus - Read Data Bus Error\n");
> 	if (reason & MCSR_BUS_IPERR)

return ret

> diff --git a/arch/powerpc/sysdev/fsl_rio.c =
b/arch/powerpc/sysdev/fsl_rio.c
> index 1143c93..a9bc1e8 100644
> --- a/arch/powerpc/sysdev/fsl_rio.c
> +++ b/arch/powerpc/sysdev/fsl_rio.c
> @@ -256,9 +256,7 @@ struct rio_priv {
> static void __iomem *rio_regs_win;
>=20
> #ifdef CONFIG_E500
> -static int (*saved_mcheck_exception)(struct pt_regs *regs);
> -
> -static int fsl_rio_mcheck_exception(struct pt_regs *regs)
> +int fsl_rio_mcheck_exception(struct pt_regs *regs)
> {
> 	const struct exception_table_entry *entry =3D NULL;
> 	unsigned long reason =3D mfspr(SPRN_MCSR);
> @@ -280,11 +278,9 @@ static int fsl_rio_mcheck_exception(struct =
pt_regs *regs)
> 		}
> 	}
>=20
> -	if (saved_mcheck_exception)
> -		return saved_mcheck_exception(regs);
> -	else
> -		return cur_cpu_spec->machine_check(regs);
> +	return 0;
> }
> +EXPORT_SYMBOL_GPL(fsl_rio_mcheck_exception);
> #endif
>=20
> /**
> @@ -1534,11 +1530,6 @@ int fsl_rio_setup(struct platform_device *dev)
> 	fsl_rio_doorbell_init(port);
> 	fsl_rio_port_write_init(port);
>=20
> -#ifdef CONFIG_E500
> -	saved_mcheck_exception =3D ppc_md.machine_check_exception;
> -	ppc_md.machine_check_exception =3D fsl_rio_mcheck_exception;
> -#endif
> -
> 	return 0;
> err:
> 	iounmap(priv->regs_win);
> diff --git a/include/linux/rio.h b/include/linux/rio.h
> index bd6eb0e..685b18f 100644
> --- a/include/linux/rio.h
> +++ b/include/linux/rio.h
> @@ -365,5 +365,6 @@ extern int rio_open_inb_mbox(struct rio_mport *, =
void *, int, int);
> extern void rio_close_inb_mbox(struct rio_mport *, int);
> extern int rio_open_outb_mbox(struct rio_mport *, void *, int, int);
> extern void rio_close_outb_mbox(struct rio_mport *, int);
> +extern int fsl_rio_mcheck_exception(struct pt_regs *);

This should be in asm/rio.h not linux/rio.h and:

Make it look like:

#ifdef CONFIG_RAPIDIO
extern int fsl_rio_mcheck_exception(struct pt_regs *);
#else
static inline int fsl_rio_mcheck_exception(struct pt_regs *) { }
#endif


>=20
> #endif				/* LINUX_RIO_H */
> --=20
> 1.6.4
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply

* Re: [REPOST][PATCH] mpc8308: fix USB DR controller initialization
From: Kumar Gala @ 2010-11-11 12:33 UTC (permalink / raw)
  To: Ilya Yanok; +Cc: vlad, linuxppc-dev, wd, dzu
In-Reply-To: <1288137756-3389-1-git-send-email-yanok@emcraft.com>


On Oct 26, 2010, at 7:02 PM, Ilya Yanok wrote:

> MPC8308 has ULPI pin muxing settings in SICRH register, bits 17-18
> which is different from both MPC8313 and MPC8315.
> Also MPC8308 doesn't have REFSEL, UTMI_PHY_EN and OTG_PORT fields
> in the USB DR controller CONTROL register.
> 
> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
> ---
> 
> Kim, Kumar,
> 
> Please consider including this patch. Without it USB initialization code
> writes to the wrong bits on the MPC8308RDB.
> 
> Regards, Ilya.
> 
> arch/powerpc/boot/dts/mpc8308rdb.dts  |    2 +-
> arch/powerpc/platforms/83xx/mpc83xx.h |    2 ++
> arch/powerpc/platforms/83xx/usb.c     |   21 ++++++++++++++++-----
> 3 files changed, 19 insertions(+), 6 deletions(-)

applied to next

- k

^ permalink raw reply

* Re: [PATCH 2/4][v2] fsl_rio: fix non-standard HID1 register access
From: Kumar Gala @ 2010-11-11 12:20 UTC (permalink / raw)
  To: Shaohui Xie; +Cc: Alexandre Bounine, akpm, linuxppc-dev, linux-kernel
In-Reply-To: <1288776997-23562-1-git-send-email-b21989@freescale.com>


On Nov 3, 2010, at 4:36 AM, Shaohui Xie wrote:

> Signed-off-by: Shaohui Xie <b21989@freescale.com>
> Cc: Li Yang <leoli@freescale.com>
> Cc: Kumar Gala <kumar.gala@freescale.com>
> Cc: Roy Zang <tie-fei.zang@freescale.com>
> Cc: Alexandre Bounine <alexandre.bounine@idt.com>
> ---
> arch/powerpc/kernel/cpu_setup_fsl_booke.S |    6 ++++++
> arch/powerpc/sysdev/fsl_rio.c             |    2 --
> 2 files changed, 6 insertions(+), 2 deletions(-)

applied to next

- k

^ permalink raw reply

* RE: [PATCH 3/4][v2] fsl_rio: move machine_check handler into machine_check_e500 & machine_check_e500mc
From: Bounine, Alexandre @ 2010-11-11 13:40 UTC (permalink / raw)
  To: Kumar Gala, Xie Shaohui-B21989
  Cc: Li Yang-R58472, linux-kernel, Zang Roy-R61911, Gala Kumar-B11780,
	linuxppc-dev, akpm
In-Reply-To: <A530CF80-F6B6-40BE-A465-18884B887432@kernel.crashing.org>

Kumar Gala <galak@kernel.crashing.org> wrote:
> > [Xie Shaohui-B21989] Hi Alex, seems your suggestion is some kind of
> > conflict with Kumar, you can have a look at
> > http://patchwork.ozlabs.org/patch/67774/
>=20
> I think Alex's comment is the fact we ignore the 'return' value in the
machine_check_e500 case.

Yes, this one and plus the fact that Mchk exception messages are printed
even if it was handled successfully (by RIO handler). Messages are
printed in both: e500 and e500mc handlers.

Alex.
 =20

^ permalink raw reply

* RE: [PATCH 3/4][v2] fsl_rio: move machine_check handler into machine_check_e500 & machine_check_e500mc
From: Bounine, Alexandre @ 2010-11-11 14:29 UTC (permalink / raw)
  To: Kumar Gala, Shaohui Xie; +Cc: akpm, linuxppc-dev, linux-kernel
In-Reply-To: <0B482EBF-AF82-4C61-A35E-D9619246D259@freescale.com>

Kumar Gala <kumar.gala@freescale.com> wrote:
> > @@ -527,8 +535,12 @@ int machine_check_e500(struct pt_regs *regs)
>=20
> To deal w/Alex's comment do:
>=20
> machine_check_e500(...) {
>=20
> 	int ret =3D 0;
>=20
>=20
> > 		printk("Bus - Write Address Error\n");
> > 	if (reason & MCSR_BUS_IBERR)
> > 		printk("Bus - Instruction Data Error\n");
> > -	if (reason & MCSR_BUS_RBERR)
> > +	if (reason & MCSR_BUS_RBERR) {
> > 		printk("Bus - Read Data Bus Error\n");
> > +#ifdef CONFIG_RAPIDIO
> > +		fsl_rio_mcheck_exception(regs);
> > +#endif
>=20
> make this like 'ret =3D fsl_rio...
>=20

Please, place it in the beginning of the machine_check_e500[mc](...) as
well to avoid any 'printk' if RIO exception was handled properly.

Alex.=20

^ permalink raw reply

* [PATCHv6 6/7] wire up sys_time_change_notify() on powerpc
From: Alexander Shishkin @ 2010-11-11 19:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jesper Nilsson, Greg KH, Chris Friesen, John Stultz,
	Andreas Schwab, Kay Sievers, linuxppc-dev, Christoph Hellwig,
	Alexander Shishkin, Paul Mackerras, H. Peter Anvin,
	Kirill A. Shutemov, Andrew Morton, Linus Torvalds,
	Thomas Gleixner
In-Reply-To: <1289503802-22444-1-git-send-email-virtuoso@slind.org>

Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Andreas Schwab <schwab@linux-m68k.org>
CC: Alexander Shishkin <virtuoso@slind.org>
CC: Christoph Hellwig <hch@lst.de>
CC: Jesper Nilsson <jesper.nilsson@axis.com>
CC: linuxppc-dev@lists.ozlabs.org
CC: linux-kernel@vger.kernel.org
---
 arch/powerpc/include/asm/systbl.h |    1 +
 arch/powerpc/include/asm/unistd.h |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index aa0f1eb..a57cc82 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -348,3 +348,4 @@ COMPAT_SYS_SPU(sendmsg)
 COMPAT_SYS_SPU(recvmsg)
 COMPAT_SYS_SPU(recvmmsg)
 SYSCALL_SPU(accept4)
+SYSCALL(time_change_notify)
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index 6151937..bea2c9e 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -367,10 +367,11 @@
 #define __NR_recvmsg		342
 #define __NR_recvmmsg		343
 #define __NR_accept4		344
+#define __NR_time_change_notify 345
 
 #ifdef __KERNEL__
 
-#define __NR_syscalls		345
+#define __NR_syscalls		346
 
 #define __NR__exit __NR_exit
 #define NR_syscalls	__NR_syscalls
-- 
1.7.2.1.45.gb66c2

^ permalink raw reply related

* setuid() libc function hang on Freescale P1020 RDB
From: xuan zhao @ 2010-11-11 19:54 UTC (permalink / raw)
  To: linuxppc-dev

Hi GURUs

I am working on application based on Freescale P1020 SDK.  But for
some reasons, my application hangs in setuid(0).


The Freescale P1020 SDK is using this toolchain:
                  gcc-4.3.74-eglibc-2.8.74-dp-2
and the kernel is also from SDK:
                  linux-2.6.31.


The threads in my application are like:

main() thread -  SCHED_NORMAL
      |
      |-------        thread #a,  implement a timer using SIGALRM   -  SCHE=
D_RR
      |
      |--------       thread #b  =96 SCHED_NORMAL            -  this is
who hangs at setuid(0).
                             |
                             |--------   thread #c -  SCHED_RR,
waitting on a netlink FD for  incomming event


I added some code in kernel, I found that my thread #b returns from
sys_setuid() successfully, with its "task_struct->state" as
TASK_RUNNING. but for some reason, it doesn't return to my user-level
application code. it seems that it stays in setuid() libc function and
another system call sys_futex(), and its kernel mode stack calltrace
is like:

[cdc25c80] [c007e5ac] __rcu_process_callbacks+0x2c4/0x3a0 (unreliable)
[cdc25d40] [c0007ef8] __switch_to+0x5c/0xcc
[cdc25d50] [c0488ab8] schedule+0x2dc/0x4c4
[cdc25db0] [c00699e0] futex_wait_queue_me+0xfc/0x134
[cdc25de0] [c0069b54] futex_wait+0x13c/0x2cc
[cdc25ec0] [c006c560] do_futex+0x58/0x1e8
[cdc25ee0] [c006c784] sys_futex+0x94/0x1e4
[cdc25f40] [c0010254] ret_from_syscall+0x0/0x3c


I notice that there was  some discussion about RT thread setuid() hang,

http://linux.derkeiler.com/Mailing-Lists/Kernel/2009-02/msg09870.html
but that fix is already in kernel.2.6.31, and my thread is
SCHED_NORMAL, not RT. so I guess it is not like my case.

And this is some kernel configurations:

CONFIG_TREE_RCU=3Dy
# CONFIG_TREE_PREEMPT_RCU is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_FANOUT=3D32
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=3Dy
CONFIG_IKCONFIG_PROC=3Dy
CONFIG_LOG_BUF_SHIFT=3D14
CONFIG_GROUP_SCHED=3Dy
# CONFIG_FAIR_GROUP_SCHED is not set
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_USER_SCHED=3Dy
# CONFIG_CGROUP_SCHED is not set
# CONFIG_CGROUPS is not set


CONFIG_PREEMPT_NONE=3Dy
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set

         CONFIG_PREEMPT is not set, but setuid() hangs no matter
whether or not it is set.



Any way, I am completely out of ideas.

Is this caused by the toolchain of Freescale P1020 SDK?  Do you have
any ideas about what I should do to debug this issue?

I would appreciate it a lot if you GURUs could give me some idea. If
you need me to provide more information, please let me know.


thanks

^ permalink raw reply

* Re: Can't boot benh/powerpc.git kernel
From: Jim Keniston @ 2010-11-12  0:07 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1289426817.2147.1403.camel@pasglop>

On Thu, 2010-11-11 at 09:06 +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2010-11-10 at 11:54 -0800, Jim Keniston wrote:
> > I got Ben's linux/kernel/git/benh/powerpc.git source and built it
> > (.config file attached*).  It hangs on boot.  When I boot it with
> > loglevel=8, its last words are:
> 
> First, please try with Linus upstream. The "master" branch in my git
> tree is quite stale, and my next and merge branch are too at the moment
> as I'm still travelling. All our current stuff was merged during the
> last merge window so there's nothing "new" for you to pickup in my tree
> at the moment :-)
> 
> If the problem still occurs, I'll have a look next week.
> 
> Cheers,
> Ben.

I built from Linus's git tree, and that kernel doesn't boot, either.
(It doesn't hang, but rather panics during boot.  I can provide a
console log if you like.)

v2.6.36 and v2.6.37-rc1 boot fine for me.  I'll post my nvram-related
patches against v2.6.37-rc1.

Jim

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox