From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12181 invoked by alias); 20 Sep 2013 03:20:36 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 12169 invoked by uid 89); 20 Sep 2013 03:20:35 -0000 Received: from p02c12o148.mxlogic.net (HELO p02c12o148.mxlogic.net) (208.65.145.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 20 Sep 2013 03:20:35 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,RDNS_NONE autolearn=no version=3.3.2 X-HELO: p02c12o148.mxlogic.net Received: from unknown [12.218.215.72] (EHLO smtpauth1.linear.com) by p02c12o148.mxlogic.net(mxl_mta-7.1.0-4) with ESMTP id 00fbb325.0.262900.00-119.638813.p02c12o148.mxlogic.net (envelope-from ); Thu, 19 Sep 2013 21:20:35 -0600 (MDT) X-MXL-Hash: 523bbf033314a93e-3a58430285d5ecdd7d28325641dd66f1110aac7e Received: from [192.168.0.221] (174-24-54-29.clsp.qwest.net [174.24.54.29]) by smtpauth1.linear.com (Postfix) with ESMTPSA id 6CB7A74007 for ; Thu, 19 Sep 2013 20:20:31 -0700 (PDT) From: Michael Jones Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: Date: Fri, 20 Sep 2013 03:20:00 -0000 To: ecos discuss Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) X-AnalysisOut: [v=2.0 cv=H+tsNZki c=1 sm=1 a=glloKNylpeYNumXQcclYyA==:17 a] X-AnalysisOut: [=X5_EFmJ_wiQA:10 a=D2_GN2MmYMYA:10 a=BLceEmwcHowA:10 a=kj9] X-AnalysisOut: [zAlcOel0A:10 a=MqDINYqSAAAA:8 a=4F3-G26c9tsA:10 a=6Edgrk46] X-AnalysisOut: [mFD08JMQy0IA:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2010122901)] X-MAIL-FROM: X-IsSubscribed: yes Subject: [ECOS] SMP Scheduler Behavior during startup X-SW-Source: 2013-09/txt/msg00014.txt.bz2 I am debugging SMP startup for a new Cortex A9 HAL and have a few questions= about startup behavior. In the docs and in the code a lock is taken by secondary CPUs before callin= g cpu_start(): externC void cyg_kernel_smp_startup() { CYG_INSTRUMENT_SMP( CPU_START, CYG_KERNEL_CPU_THIS(), 0 ); Cyg_Scheduler::lock(); Cyg_Scheduler::start_cpu(); } start_cpu() will setup the software interrupt. The first question is which CPU and in what routine is the scheduler unlock= ed the first time? The second question is which CPU starts the first thread? Now, the reason I am asking is I am having a specific startup problem. The = symptoms are: - CPU 1 is started and results in a spinlock via Cyg_Scheduler::lock() - CPU 0 is started - The application starts two threads and the first thread runs on CPU 0 - The application thread calls cyg_mutex_lock on CPU 0 - cyg_mutex_lock calls spin on the spinlock and goes into an infinite loop The spinlock variable has a 1, indicating that CPU 1 is holding the lock. I= assume, but don't know, that the scheduler lock in cyg_kernel_smp_startup(= ) is holding the lock, and something is not getting the scheduler unlocked.= However, it is possible it is somewhere else in the code. I don't have a J= TAG that works on both cores, so I can only debug on core 0 for now. Some things that hopefully will help: 1) Single core without SMP runs fine, the UART works, etc. So nothing major= wrong with the code. 2) By adding instrumentation code, I have proven that the CPU 1 startup wor= ks, and that cyb_kernel_smp_startup () is called. I write to memory I can s= ee from CPU 0 and JTAG. 3) Interrupts for the real time clock and UART are only issued to CPU 0. 4) The code that setups the software ISR may not be correct. It is possible= that interrupts are not delivered, and I am assuming I will get farther th= rough the code and the unlock does not depend on the software interrupt. If= the unlock depends on the interrupt, I would like to know how, and then I = can spend some time getting the software interrupt working. Regards Mike -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss