From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay1.mentorg.com", Issuer "Entrust Certification Authority - L1B" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 415E61007D2 for ; Tue, 3 Jan 2012 06:10:40 +1100 (EST) Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1RhnHI-0005XB-F2 from Farrukh_Arshad@mentor.com for linuxppc-dev@lists.ozlabs.org; Mon, 02 Jan 2012 11:10:36 -0800 From: "Arshad, Farrukh" To: "linuxppc-dev@lists.ozlabs.org" Subject: Problem in getting shared memory access on P1022RDK Date: Mon, 2 Jan 2012 19:10:33 +0000 Message-ID: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> Content-Type: multipart/alternative; boundary="_000_93CD5F41FDBC6042A6B449764F3B35CC050CCA22EUMBX03mgcmento_" MIME-Version: 1.0 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --_000_93CD5F41FDBC6042A6B449764F3B35CC050CCA22EUMBX03mgcmento_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Greetings All, Please excuse me for a 'not very precise' question but I just need some clu= e or point to look for the trouble. I am running linux in AMP configuration on P1022RDK dual core. My memory pa= rtitioning is given below Core Base Address (CONFIG_PHYSICAL_START / bootm_low) Size (bootm_size / me= m kernel boot parameter) Core 0 0x0000,0000 0x1000,0000 Core 1 0x1000,0000 0x0C00,0000 Shared Memory 0x1C00,0000 0x0400,0000 I have set bootm_low / bootm_size and provided mem parameter in both kernel= configurations, both kernels are booting up fine. I have a shared memory driver running in both = cores. My shared memory driver just exposes the physical memory (0x1C00,0000) to user-space. The problem I am facing is I can not get access to same shared memory in us= er-space on both kernels. I have verified my shared memory driver on another platform (p1022ds) and i= t works perfect. I have also tried using non-cached memory mapping in shared memory driver but that does= not work as well. To me it seems one of my kernels is going beyond its defined memory partiti= on (which I have set above), I have set kernel's partitioning as CONFIG_PHYSICAL_START, bootm_size, bootm_low a= nd mem kernel boot param. Besides the shared memory driver, can anyone suggest or give me clue where = should I look for the trouble in the kernel. Regards, Farrukh Arshad. --_000_93CD5F41FDBC6042A6B449764F3B35CC050CCA22EUMBX03mgcmento_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Greetings All,

Please excuse me for a 'not very precise' question but I just need som= e clue or point to look for the trouble.
I am running linux in AMP configuration on P1022RDK dual core. My memo= ry partitioning is given below

Core B= ase Address (CONFIG_PHYSICAL_START / bootm_low) Size (bootm_size / mem kernel boot parameter)
Core 0 0x0000,0000 0x1000,0000
Core 1 0x1000,0000 0x0C00,0000
Shared Memory= 0x1C00,0000 0x0400,0000

I have set bootm_low / bootm_size and provided mem parameter in both k= ernel configurations, both 
kernels are booting up fine. I have a shared memory driver running in = both cores. My shared memory 
driver just exposes the physical memory (0x1C00,0000) to user-space.&n= bsp;

The problem I am facing is I can not get access to same shared memory = in user-space on both kernels.
I have verified my shared memory driver on another platform (p1022ds) = and it works perfect. I have also 
tried using non-cached memory mapping in shared memory driver but that= does not work as well. 

To me it seems one of my kernels is going beyond its defined memory pa= rtition (which I have set above), I have 
set kernel's partitioning as CONFIG_PHYSICAL_START, bootm_size, bootm_= low and mem kernel boot param.

Besides the shared memory driver, can anyone suggest or give me clue w= here should I look for the 
trouble in the kernel.

Regards,
Farrukh Arshad.
--_000_93CD5F41FDBC6042A6B449764F3B35CC050CCA22EUMBX03mgcmento_-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay1.mentorg.com", Issuer "Entrust Certification Authority - L1B" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 361521007D6 for ; Tue, 3 Jan 2012 20:42:45 +1100 (EST) Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Ri0tG-0006RL-MQ from Farrukh_Arshad@mentor.com for linuxppc-dev@lists.ozlabs.org; Tue, 03 Jan 2012 01:42:42 -0800 From: "Arshad, Farrukh" To: "linuxppc-dev@lists.ozlabs.org" Subject: RE: Problem in getting shared memory access on P1022RDK Date: Tue, 3 Jan 2012 09:42:39 +0000 Message-ID: <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> In-Reply-To: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> Content-Type: multipart/alternative; boundary="_000_93CD5F41FDBC6042A6B449764F3B35CC050CCA80EUMBX03mgcmento_" MIME-Version: 1.0 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --_000_93CD5F41FDBC6042A6B449764F3B35CC050CCA80EUMBX03mgcmento_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Adding more to it, When I write from Core 1 on the shared memory region it is visible at Core = 0 and it can read what I have written from Core 1 but when I write from Cor= e 0 on this shared memory it is not visible on Core 1. Regards, Farrukh Arshad From: Arshad, Farrukh Sent: Tuesday, January 03, 2012 12:11 AM To: linuxppc-dev@lists.ozlabs.org Subject: Problem in getting shared memory access on P1022RDK Greetings All, Please excuse me for a 'not very precise' question but I just need some clu= e or point to look for the trouble. I am running linux in AMP configuration on P1022RDK dual core. My memory pa= rtitioning is given below Core Base Address (CONFIG_PHYSICAL_START / bootm_low) Size (bootm_size / mem kernel boot parameter) Core 0 0x0000,0000 0x1000,0000 Core 1 0x1000,0000 0x0C00,0000 Shared Memory 0x1C00,0000 0x0400,0000 I have set bootm_low / bootm_size and provided mem parameter in both kernel= configurations, both kernels are booting up fine. I have a shared memory driver running in both = cores. My shared memory driver just exposes the physical memory (0x1C00,0000) to user-space. The problem I am facing is I can not get access to same shared memory in us= er-space on both kernels. I have verified my shared memory driver on another platform (p1022ds) and i= t works perfect. I have also tried using non-cached memory mapping in shared memory driver but that does= not work as well. To me it seems one of my kernels is going beyond its defined memory partiti= on (which I have set above), I have set kernel's partitioning as CONFIG_PHYSICAL_START, bootm_size, bootm_low a= nd mem kernel boot param. Besides the shared memory driver, can anyone suggest or give me clue where = should I look for the trouble in the kernel. Regards, Farrukh Arshad. --_000_93CD5F41FDBC6042A6B449764F3B35CC050CCA80EUMBX03mgcmento_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Adding more to it,

 <= /p>

When I write from Core 1 = on the shared memory region it is visible at Core 0 and it can read what I = have written from Core 1 but when I write from Core 0 on this shared memory it is not visible on Core 1.

 <= /p>

Regards,

Farrukh Arshad

 <= /p>

From: Arshad, = Farrukh
Sent: Tuesday, January 03, 2012 12:11 AM
To: linuxppc-dev@lists.ozlabs.org
Subject: Problem in getting shared memory access on P1022RDK

 

Greetings All,

 

Please excuse me for a 'not = very precise' question but I just need some clue or point to look for the t= rouble.

I am running linux in AMP co= nfiguration on P1022RDK dual core. My memory partitioning is given below

 

Core Base Address (CONFIG_PHYSICAL_START / bootm_low)

Size (bootm_size / mem kerne= l boot parameter)

Core 0 0x0000,0000<= /p>

0x1000,0000

Core 1 0x1000,0000<= /p>

0x0C00,0000

Shared Memory 0x1C00,0000<= /p>

0x0400,0000

 

I have set bootm_low / bootm= _size and provided mem parameter in both kernel configurations, both <= o:p>

kernels are booting up fine.= I have a shared memory driver running in both cores. My shared memory = ;

driver just exposes the phys= ical memory (0x1C00,0000) to user-space. 

 

The problem I am facing is I= can not get access to same shared memory in user-space on both kernels.

I have verified my shared me= mory driver on another platform (p1022ds) and it works perfect. I have also=  

tried using non-cached memor= y mapping in shared memory driver but that does not work as well. 

 

To me it seems one of my ker= nels is going beyond its defined memory partition (which I have set above),= I have 

set kernel's partitioning as= CONFIG_PHYSICAL_START, bootm_size, bootm_low and mem kernel boot param.

 

Besides the shared memory dr= iver, can anyone suggest or give me clue where should I look for the <= o:p>

trouble in the kernel.<= /o:p>

 

Regards,

Farrukh Arshad.

--_000_93CD5F41FDBC6042A6B449764F3B35CC050CCA80EUMBX03mgcmento_-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from VA3EHSOBE007.bigfish.com (va3ehsobe006.messaging.microsoft.com [216.32.180.16]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "mail.global.frontbridge.com", Issuer "Microsoft Secure Server Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 8FDD4B6FA8 for ; Wed, 4 Jan 2012 04:10:40 +1100 (EST) Message-ID: <4F033685.6000509@freescale.com> Date: Tue, 3 Jan 2012 11:10:29 -0600 From: Scott Wood MIME-Version: 1.0 To: "Arshad, Farrukh" Subject: Re: Problem in getting shared memory access on P1022RDK References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> In-Reply-To: <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> Content-Type: text/plain; charset="ISO-8859-1" Cc: "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 01/03/2012 03:42 AM, Arshad, Farrukh wrote: > Adding more to it, > > > > When I write from Core 1 on the shared memory region it is visible at > Core 0 and it can read what I have written from Core 1 but when I write > from Core 0 on this shared memory it is not visible on Core 1. Is the memory mapped coherent on both cores? -Scott From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay1.mentorg.com", Issuer "Entrust Certification Authority - L1B" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 5989AB6FAF for ; Wed, 4 Jan 2012 17:49:51 +1100 (EST) From: "Arshad, Farrukh" To: Scott Wood Subject: RE: Problem in getting shared memory access on P1022RDK Date: Wed, 4 Jan 2012 06:49:45 +0000 Message-ID: <93CD5F41FDBC6042A6B449764F3B35CC050CCB2E@EU-MBX-03.mgc.mentorg.com> References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> <4F033685.6000509@freescale.com> In-Reply-To: <4F033685.6000509@freescale.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Cc: "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , How can I verify if the memory mapped is coherent on both cores. My memory = partitioning is given below Core Base Address Size Core 0 0x0000,0000 0x1000,0000 --> CONFIG_PHYSICAL_START =3D bootm_low = =3D Base Address Core 1 0x1000,0000 0x0C00,0000 --> CONFIG_PHYSICAL_START =3D bootm_low = =3D Base Address Shared Mem 0x1C00,0000 0x0400,0000 Regards, Farrukh Arshad -----Original Message----- From: Scott Wood [mailto:scottwood@freescale.com]=20 Sent: Tuesday, January 03, 2012 10:10 PM To: Arshad, Farrukh Cc: linuxppc-dev@lists.ozlabs.org Subject: Re: Problem in getting shared memory access on P1022RDK On 01/03/2012 03:42 AM, Arshad, Farrukh wrote: > Adding more to it, >=20 > =20 >=20 > When I write from Core 1 on the shared memory region it is visible at=20 > Core 0 and it can read what I have written from Core 1 but when I=20 > write from Core 0 on this shared memory it is not visible on Core 1. Is the memory mapped coherent on both cores? -Scott From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay1.mentorg.com", Issuer "Entrust Certification Authority - L1B" (not verified)) by ozlabs.org (Postfix) with ESMTPS id B28261007D6 for ; Wed, 4 Jan 2012 20:56:22 +1100 (EST) From: "Arshad, Farrukh" To: Scott Wood Subject: RE: Problem in getting shared memory access on P1022RDK Date: Wed, 4 Jan 2012 09:56:17 +0000 Message-ID: <93CD5F41FDBC6042A6B449764F3B35CC050CCB7C@EU-MBX-03.mgc.mentorg.com> References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> <4F033685.6000509@freescale.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Cc: "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Some of the other things which I am experiencing which may help to trace th= is issue.=20 1: For Core 0 printk is not working in setup_arch "just before call to pagi= ng_init", where as on Core 1 printk is working in the same function. I see = the source uses ppc_md.progress to display debug messages so it seems print= k will not work then why it is working on Core 1.=20 2: During kernel boot of both cores boot messages of Core 0 are mixed in Co= re 1 messages.=20 3: If I change memory partitioning to following, then on Core 1 when I mmap= shared memory area (starting 0x0C00,0000) I receive error that can not mma= p RAM. If my both systems memory partitions are defined clearly then this a= rea does not belong to system RAM then I shouldn't receive this error in th= is memory partitioning. Core Base Address Size Core 0 0x0000,0000 0x0C00,0000 --> CONFIG_PHYSICAL_START =3D bootm_low = =3D Base Address Shared Mem 0x0C00,0000 0x0400,0000 Core 1 0x1000,0000 0x1000,0000 --> CONFIG_PHYSICAL_START =3D bootm_low = =3D Base Address I believe there is some bug / or patch which I am missing in both kernels m= emory initialization which is causing all these issues. Kernel sources / co= nfiguration of both cores are 100% same except (CONFIG_PHYSICAL_START) para= m and kernel version is 2.6.32.13.=20 Any thoughts. Regards, Farrukh Arshad -----Original Message----- From: Arshad, Farrukh=20 Sent: Wednesday, January 04, 2012 11:50 AM To: 'Scott Wood' Cc: linuxppc-dev@lists.ozlabs.org Subject: RE: Problem in getting shared memory access on P1022RDK How can I verify if the memory mapped is coherent on both cores. My memory = partitioning is given below Core Base Address Size Core 0 0x0000,0000 0x1000,0000 --> CONFIG_PHYSICAL_START =3D bootm_low = =3D Base Address Core 1 0x1000,0000 0x0C00,0000 --> CONFIG_PHYSICAL_START =3D bootm_low = =3D Base Address Shared Mem 0x1C00,0000 0x0400,0000 Regards, Farrukh Arshad -----Original Message----- From: Scott Wood [mailto:scottwood@freescale.com] Sent: Tuesday, January 03, 2012 10:10 PM To: Arshad, Farrukh Cc: linuxppc-dev@lists.ozlabs.org Subject: Re: Problem in getting shared memory access on P1022RDK On 01/03/2012 03:42 AM, Arshad, Farrukh wrote: > Adding more to it, >=20 > =20 >=20 > When I write from Core 1 on the shared memory region it is visible at=20 > Core 0 and it can read what I have written from Core 1 but when I=20 > write from Core 0 on this shared memory it is not visible on Core 1. Is the memory mapped coherent on both cores? -Scott From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.windriver.com", Issuer "Intel External Basic Issuing CA 3A" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 206A51007D6 for ; Thu, 5 Jan 2012 13:09:06 +1100 (EST) Message-ID: <4F050653.6010601@windriver.com> Date: Thu, 5 Jan 2012 10:09:23 +0800 From: "tiejun.chen" MIME-Version: 1.0 To: "Arshad, Farrukh" Subject: Re: Problem in getting shared memory access on P1022RDK References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> <4F033685.6000509@freescale.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCB2E@EU-MBX-03.mgc.mentorg.com> In-Reply-To: <93CD5F41FDBC6042A6B449764F3B35CC050CCB2E@EU-MBX-03.mgc.mentorg.com> Content-Type: text/plain; charset="UTF-8" Cc: Scott Wood , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Arshad, Farrukh wrote: > How can I verify if the memory mapped is coherent on both cores. My memory partitioning is given below > > Core Base Address Size > Core 0 0x0000,0000 0x1000,0000 --> CONFIG_PHYSICAL_START = bootm_low = Base Address > Core 1 0x1000,0000 0x0C00,0000 --> CONFIG_PHYSICAL_START = bootm_low = Base Address > Shared Mem 0x1C00,0000 0x0400,0000 Was the kernel option, CONFIG_SMP, enabled for both two kernels? CONFIG_SMP would affect the memory attribute for cache coherency. Maybe you should make sure if kernel have a appropriate memory attribute by dumping TLB entry. Tiejun > > Regards, > Farrukh Arshad > > -----Original Message----- > From: Scott Wood [mailto:scottwood@freescale.com] > Sent: Tuesday, January 03, 2012 10:10 PM > To: Arshad, Farrukh > Cc: linuxppc-dev@lists.ozlabs.org > Subject: Re: Problem in getting shared memory access on P1022RDK > > On 01/03/2012 03:42 AM, Arshad, Farrukh wrote: >> Adding more to it, >> >> >> >> When I write from Core 1 on the shared memory region it is visible at >> Core 0 and it can read what I have written from Core 1 but when I >> write from Core 0 on this shared memory it is not visible on Core 1. > > Is the memory mapped coherent on both cores? > > -Scott From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay1.mentorg.com", Issuer "Entrust Certification Authority - L1B" (not verified)) by ozlabs.org (Postfix) with ESMTPS id CDE7F1007D6 for ; Thu, 5 Jan 2012 16:46:36 +1100 (EST) From: "Arshad, Farrukh" To: tiejun.chen Subject: RE: Problem in getting shared memory access on P1022RDK Date: Thu, 5 Jan 2012 05:46:28 +0000 Message-ID: <93CD5F41FDBC6042A6B449764F3B35CC050CCC12@EU-MBX-03.mgc.mentorg.com> References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> <4F033685.6000509@freescale.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCB2E@EU-MBX-03.mgc.mentorg.com> <4F050653.6010601@windriver.com> In-Reply-To: <4F050653.6010601@windriver.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Cc: Scott Wood , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Pj4gV2FzIHRoZSBrZXJuZWwgb3B0aW9uLCBDT05GSUdfU01QLCBlbmFibGVkIGZvciBib3RoIHR3 byBrZXJuZWxzPw0KWWVzIENPTkZJR19TTVAgaXMgZW5hYmxlZCBmb3IgYm90aCBrZXJuZWxzLiAN Cg0KPj4gTWF5YmUgeW91IHNob3VsZCBtYWtlIHN1cmUgaWYga2VybmVsIGhhdmUgYSBhcHByb3By aWF0ZSBtZW1vcnkgYXR0cmlidXRlIGJ5IGR1bXBpbmcgVExCIGVudHJ5Lg0KVGhhbmtzIGZvciB0 aGUgcG9pbnRlci4gSSB3aWxsIHRyeSB0aGlzIG9uZS4NCg0KUmVnYXJkcywNCkZhcnJ1a2ggQXJz aGFkDQo= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay1.mentorg.com", Issuer "Entrust Certification Authority - L1B" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 1B208B6EF3 for ; Thu, 12 Jan 2012 02:52:22 +1100 (EST) From: "Arshad, Farrukh" To: tiejun.chen Subject: RE: Problem in getting shared memory access on P1022RDK Date: Wed, 11 Jan 2012 15:52:12 +0000 Message-ID: <93CD5F41FDBC6042A6B449764F3B35CC050CD375@EU-MBX-03.mgc.mentorg.com> References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> <4F033685.6000509@freescale.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCB2E@EU-MBX-03.mgc.mentorg.com> <4F050653.6010601@windriver.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Cc: Scott Wood , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , QWRkaW5nIG1vcmUgaXQsIA0KDQpJIGhhdmUgcmVtb3ZlZCB0aGUgc2hhcmVkIG1lbW9yeSBrZXJu ZWwgZHJpdmVyIGRlcGVuZGVuY3kganVzdCB0byBuYXJyb3cgZG93biB0aGUgcHJvYmxlbSBhcmVh IGFuZCBJIGhhdmUgd3JpdHRlbiBhIHNtYWxsIHBpZWNlIG9mIGNvZGUgaW4gdXNlciBzcGFjZS4g QSB3cml0ZXIgJiBhIHJlYWRlciBhcHBsaWNhdGlvbiB3aGljaCBhY2Nlc3MgdGhlIHNoYXJlZCBt ZW1vcnkgYW5kIEkgZ290IHRoZSBzYW1lIGJlaGF2aW9yIGFzIHdpdGggdGhlIHNoYXJlZCBtZW1v cnkga2VybmVsIGRyaXZlci4gSW50ZXJlc3RpbmdseSwgbXkgdXNlciBzcGFjZSBhcHBsaWNhdGlv biB3b3JrIGZpbmUgb24gUDEwMjJEUyBidXQgbm90IG9uIFAxMDIyUkRLIGhvd2V2ZXIgYm90aCB1 c2luZyB0aGUgc2FtZSBDUFUgbW9kdWxlcy4NCg0KV2hlbiBJIHdyaXRlIGEgc2ltcGxlIHN0cmlu ZyBvbiBzaGFyZWQgbWVtb3J5IGZyb20gQ29y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ICAgICAgICAgIAkJQmFzZSBBZGRyZXNzICAgICAgICAgCVNpemUN CkNvcmUgMCAgICAgICAgICAgICAgIAkJMHgwMDAwLDAwMDAgICAgICAgICAgCTB4MTAwMCwwMDAw DQpDb3JlIDEgICAgICAgICAgICAgICAJCTB4MTAwMCwwMDAwICAgICAgICAgIAkweDBDMDAsMDAw MA0KU2hhcmVkIE1lbW9yeSAgICAJMHgxQzAwLDAwMDAgICAgICAgICAgCTB4MDQwMCwwMDAwDQoN ClJlZ2FyZHMsDQpGYXJydWtoIEFyc2hhZC4NCk1lbnRvciBHcmFwaGljcyBQYWtpc3Rhbg0K From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.windriver.com", Issuer "Intel External Basic Issuing CA 3A" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 88077B6EF7 for ; Thu, 12 Jan 2012 19:08:55 +1100 (EST) Message-ID: <4F0E9539.7090205@windriver.com> Date: Thu, 12 Jan 2012 16:09:29 +0800 From: "tiejun.chen" MIME-Version: 1.0 To: "Arshad, Farrukh" Subject: Re: Problem in getting shared memory access on P1022RDK References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> <4F033685.6000509@freescale.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCB2E@EU-MBX-03.mgc.mentorg.com> <4F050653.6010601@windriver.com> <93CD5F41FDBC6042A6B449764F3B35CC050CD375@EU-MBX-03.mgc.mentorg.com> In-Reply-To: <93CD5F41FDBC6042A6B449764F3B35CC050CD375@EU-MBX-03.mgc.mentorg.com> Content-Type: text/plain; charset="UTF-8" Cc: Scott Wood , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Arshad, Farrukh wrote: > Adding more it, > > I have removed the shared memory kernel driver dependency just to narrow down the problem area and I have written a small piece of code in user space. A writer & a reader application which access the shared memory and I got the same behavior as with the shared memory kernel driver. Interestingly, my user space application work fine on P1022DS but not on P1022RDK however both using the same CPU modules. > > When I write a simple string on shared memory from Core 1 it is read at Core 0 properly > When I write a simple string on shared memory from Core 0 it is not read at Core 1. > Did you dump TLB entry to check page memory coherence attribute for a shared memory as I mentioned previously? This should be consistent on both sides. > With this test now I am sure the problem lies in the kernel itself. Any pointers to look for the troubled area ? > > My application code is (error checking and other code is omitted) > > #define SHM_BASE 0x1C000000 > #define SHM_SIZE 0x400000 // 4 MB of Shared Memory > #define PAGE_SIZE (4*1024) > > fd = open(device, O_RDWR); You may need to add with 'O_SYNC'. Tiejun > > shm = malloc(SHM_SIZE + (PAGE_SIZE - 1)); > if ( (unsigned long) shm % PAGE_SIZE) { > shm += PAGE_SIZE - ((unsigned long)shm % PAGE_SIZE); > } > > shm = mmap(shm, SHM_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, SHM_BASE); > ...... > ...... write some string at shm. > > My memory partitioning for both systems is > > Core Base Address Size > Core 0 0x0000,0000 0x1000,0000 > Core 1 0x1000,0000 0x0C00,0000 > Shared Memory 0x1C00,0000 0x0400,0000 > > Regards, > Farrukh Arshad. > Mentor Graphics Pakistan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "relay1.mentorg.com", Issuer "Entrust Certification Authority - L1B" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 9FADAB6F74 for ; Wed, 25 Jan 2012 22:04:48 +1100 (EST) From: "Arshad, Farrukh" To: tiejun.chen Subject: RE: Problem in getting shared memory access on P1022RDK Date: Wed, 25 Jan 2012 11:04:41 +0000 Message-ID: <93CD5F41FDBC6042A6B449764F3B35CC050CE2CD@EU-MBX-03.mgc.mentorg.com> References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> <4F033685.6000509@freescale.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCB2E@EU-MBX-03.mgc.mentorg.com> <4F050653.6010601@windriver.com> <93CD5F41FDBC6042A6B449764F3B35CC050CD375@EU-MBX-03.mgc.mentorg.com> <4F0E9539.7090205@windriver.com> In-Reply-To: <4F0E9539.7090205@windriver.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Cc: Scott Wood , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , SSBoYXZlIGR1bXBlZCBUTEIgZW50cmllcyB3aGlsZSBtYXBwaW5nIHNoYXJlZCBtZW1vcnkuIE9u IGJvdGggY29yZXMgTS1CaXQgKE1BUzJbNjFdKSBpcyBzZXQgaW4gVExCMCBlbnRyaWVzLiBPbiBi b3RoIGNvcmVzIE0tQml0IGlzIHNldCBmb3IgYWxsIHZhbGlkIFRMQjEgZW50cmllcy4gVExCMSBk b2VzIGNvbnRhaW5zIHNvbWUgaW52YWxpZCBlbnRyaWVzIHdoaWNoIGhhcyBNLUJpdCBjbGVhcmVk LiBTbyBJIGJlbGlldmUgYXQgdGhpcyB0aW1lIHRoZSBjb2hlcmVuY3kgaXMgbm90IHRoZSBpc3N1 ZS4gQW55IGZ1cnRoZXIgdGhvdWdodHMgb24gdGhlIGlzc3VlID8NCg0KSSBoYXZlIG1vZGlmaWVk IGR1bXBfdGxiX2Jvb2szZSBmdW5jdGlvbiAoZm91bmQgaW4gYXJjaC9wb3dlcnBjL3htb24veG1v bi5jKSBmdW5jdGlvbiBmb3IgQm9va0UgTU1VIHRvIGR1bXAgVExCIGVudHJpZXMuDQoNClJlZ2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QUdFX1NJWkUg LSAoKHVuc2lnbmVkIGxvbmcpc2htICUgUEFHRV9TSVpFKTsgfQ0KPiANCj4gc2htID0gbW1hcChz aG0sIFNITV9TSVpFLCBQUk9UX1JFQUR8UFJPVF9XUklURSwgTUFQX1NIQVJFRCB8IA0KPiBNQVBf RklYRUQsIGZkLCBTSE1fQkFTRSk7IC4uLi4uLg0KPiAuLi4uLi4gd3JpdGUgc29tZSBzdHJpbmcg YXQgc2htLg0KPiANCj4gTXkgbWVtb3J5IHBhcnRpdGlvbmluZyBmb3IgYm90aCBzeXN0ZW1zIGlz DQo+IA0KPiBDb3JlICAgICAgICAgICAgICAgICAJCUJhc2UgQWRkcmVzcyAgICAgICAgIAlTaXpl DQo+IENvcmUgMCAgICAgICAgICAgICAgIAkJMHgwMDAwLDAwMDAgICAgICAgICAgCTB4MTAwMCww MDAwDQo+IENvcmUgMSAgICAgICAgICAgICAgIAkJMHgxMDAwLDAwMDAgICAgICAgICAgCTB4MEMw MCwwMDAwDQo+IFNoYXJlZCBNZW1vcnkgICAgCTB4MUMwMCwwMDAwICAgICAgICAgIAkweDA0MDAs MDAwMA0KPiANCj4gUmVnYXJkcywNCj4gRmFycnVraCBBcnNoYWQuDQo+IE1lbnRvciBHcmFwaGlj cyBQYWtpc3Rhbg0KDQo= From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.windriver.com", Issuer "Intel External Basic Issuing CA 3A" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8CC0CB6EF7 for ; Sun, 29 Jan 2012 14:14:53 +1100 (EST) Message-ID: <4F24B9DF.8010006@windriver.com> Date: Sun, 29 Jan 2012 11:15:43 +0800 From: "tiejun.chen" MIME-Version: 1.0 To: "Arshad, Farrukh" Subject: Re: Problem in getting shared memory access on P1022RDK References: <93CD5F41FDBC6042A6B449764F3B35CC050CCA22@EU-MBX-03.mgc.mentorg.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCA80@EU-MBX-03.mgc.mentorg.com> <4F033685.6000509@freescale.com> <93CD5F41FDBC6042A6B449764F3B35CC050CCB2E@EU-MBX-03.mgc.mentorg.com> <4F050653.6010601@windriver.com> <93CD5F41FDBC6042A6B449764F3B35CC050CD375@EU-MBX-03.mgc.mentorg.com> <4F0E9539.7090205@windriver.com> <93CD5F41FDBC6042A6B449764F3B35CC050CE2CD@EU-MBX-03.mgc.mentorg.com> In-Reply-To: <93CD5F41FDBC6042A6B449764F3B35CC050CE2CD@EU-MBX-03.mgc.mentorg.com> Content-Type: text/plain; charset="UTF-8" Cc: Scott Wood , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Arshad, Farrukh wrote: > I have dumped TLB entries while mapping shared memory. On both cores M-Bit (MAS2[61]) is set in TLB0 entries. On both cores M-Bit is set for all valid TLB1 entries. TLB1 does contains some invalid entries which has M-Bit cleared. So I believe at this time the coherency is not the issue. Any further thoughts on the issue ? > Did you check all associated TLBx VPN/RPN and attribute setting are same between two scenarios: W -> Core0 & R <- Core1 and W -> Core1 & R <- Core0? Can you send me your TLB dump log separately if possible? And did you try this flag 'O_SYNC'? Tiejun > I have modified dump_tlb_book3e function (found in arch/powerpc/xmon/xmon.c) function for BookE MMU to dump TLB entries. > > Regards, > Farrukh Arshad > > > -----Original Message----- > From: tiejun.chen [mailto:tiejun.chen@windriver.com] > Sent: Thursday, January 12, 2012 1:09 PM > To: Arshad, Farrukh > Cc: Scott Wood; linuxppc-dev@lists.ozlabs.org > Subject: Re: Problem in getting shared memory access on P1022RDK > > Arshad, Farrukh wrote: >> Adding more it, >> >> I have removed the shared memory kernel driver dependency just to narrow down the problem area and I have written a small piece of code in user space. A writer & a reader application which access the shared memory and I got the same behavior as with the shared memory kernel driver. Interestingly, my user space application work fine on P1022DS but not on P1022RDK however both using the same CPU modules. >> >> When I write a simple string on shared memory from Core 1 it is read >> at Core 0 properly When I write a simple string on shared memory from Core 0 it is not read at Core 1. >> > > Did you dump TLB entry to check page memory coherence attribute for a shared memory as I mentioned previously? This should be consistent on both sides. > >> With this test now I am sure the problem lies in the kernel itself. Any pointers to look for the troubled area ? >> >> My application code is (error checking and other code is omitted) >> >> #define SHM_BASE 0x1C000000 >> #define SHM_SIZE 0x400000 // 4 MB of Shared Memory >> #define PAGE_SIZE (4*1024) >> >> fd = open(device, O_RDWR); > > You may need to add with 'O_SYNC'. > > Tiejun > >> shm = malloc(SHM_SIZE + (PAGE_SIZE - 1)); if ( (unsigned long) shm % >> PAGE_SIZE) { >> shm += PAGE_SIZE - ((unsigned long)shm % PAGE_SIZE); } >> >> shm = mmap(shm, SHM_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED | >> MAP_FIXED, fd, SHM_BASE); ...... >> ...... write some string at shm. >> >> My memory partitioning for both systems is >> >> Core Base Address Size >> Core 0 0x0000,0000 0x1000,0000 >> Core 1 0x1000,0000 0x0C00,0000 >> Shared Memory 0x1C00,0000 0x0400,0000 >> >> Regards, >> Farrukh Arshad. >> Mentor Graphics Pakistan >