From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16481 invoked by alias); 23 Jun 2005 23:06:12 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 16434 invoked by uid 22791); 23 Jun 2005 23:06:01 -0000 Received: from mh2dmz1.bloomberg.com (HELO mh2dmz1.bloomberg.com) (199.172.169.37) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 23 Jun 2005 23:06:01 +0000 Received: from ns9.bloomberg.com (ns9.bloomberg.com [160.43.164.52]) by mh2dmz1.bloomberg.com with ESMTP for ecos-discuss@sources.redhat.com; Thu, 23 Jun 2005 19:05:56 -0400 Received: from ny2535-dr.corp.bloomberg.com (ny2535-dr.bloomberg.com [172.20.193.74]) by ns9.bloomberg.com (8.11.7p1+Sun/8.10.2) with ESMTP id j5NN5u305064 for ; Thu, 23 Jun 2005 19:05:56 -0400 (EDT) Received: from tk2525.corp.bloomberg.com (unverified) by ny2535-dr.corp.bloomberg.com (Content Technologies SMTPRS 4.3.17) with ESMTP id for ; Thu, 23 Jun 2005 19:05:56 -0400 Received: from ny2532.corp.bloomberg.com ([172.20.73.71]) by tk2525.corp.bloomberg.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 24 Jun 2005 07:53:30 +0900 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Thu, 23 Jun 2005 23:06:00 -0000 Message-Id: <7AB442CEEA0CA04E8DBFEC23DA1759D7066958@ny2532.corp.bloomberg.com> From: "Hook, James" To: Subject: [ECOS] eth_drv_recv blocking DSR X-SW-Source: 2005-06/txt/msg00227.txt.bz2 I am currently writing an Ethernet driver to interface with the FreeBSD stack. In packages/io/eth/src/net/eth_drv.c, the eth_drv_recv() function calls MGETHDR which invokes spl_any(). spl_any() has the potential to block if the calling thread does not own the mutex. I am calling eth_drv_recv() from my Ethernet driver in a DSR when I receive an incoming packet as described in /io/eth/v2_0_21/doc/driver_doc. If the spl_any() call blocks because another thread (the "Network support" thread in this case) owns the mutex, ECOS crashes in spl_any() when the DSR attempts to lock the mutex, blocks, and then invokes the scheduler. I assume this is because the scheduler does not support a DSR blocking to a thread. Is this true? Should eth_drv_recv have the potential to block if it is DSR safe?=20 Stack Trace: #0 0x000c9c98 in hal_thread_load_context_ARM () #1 0x00096e94 in Cyg_Scheduler::unlock_inner (new_lock=3D2) #2 0x000e65de in Cyg_Scheduler::reschedule ()=20 #3 0x00097cd2 in Cyg_Mutex::lock (this=3D0x15fad0) #4 0x00095640 in cyg_mutex_lock (mutex=3D0x15fad0) #5 0x000a245a in spl_any (which=3D1) #6 0x000a2066 in cyg_splimp () #7 0x0009faa2 in eth_drv_recv (sc=3D0x1051ec, total_len=3D42) >From frame 4: (gdb) print *(mutex->owner) $5 =3D {stack_base =3D 1158004, stack_size =3D 3424, stack_limit =3D 115800= 4, stack_ptr =3D 1160404, entry_point =3D 0xa1c69 ,=20 entry_data =3D 0, saved_context =3D 0x0, next =3D 0x11b8f0, prev =3D 0x11= b8f0, priority =3D 6, queue =3D 0x1049e8, mutex_count =3D 1,=20 original_priority =3D 7, priority_inherited =3D 1, state =3D 1, suspend_count =3D 0, wakeup_count =3D 0, wait_info =3D 1161316, unique_id = =3D 4, timer =3D {next =3D 0x11b920, prev =3D 0x11b920, counter =3D 0x161870, al= arm =3D 0x95fd5 ,=20 data =3D 1161504, trigger =3D 0, interval =3D 0, enabled =3D 0, thread = =3D 0x11b8d4}, sleep_reason =3D CYG_REASON_WAIT,=20 wake_reason =3D CYG_REASON_NONE, thread_data =3D {0, 0, 0, 0, 0, 0}, name =3D 0xf24d4 "Network support", list_next =3D 0x161fd4} >From frame 5: print *((cyg_thread*) splx_thread) $6 =3D {stack_base =3D 1158004, stack_size =3D 3424, stack_limit =3D 115800= 4, stack_ptr =3D 1160404, entry_point =3D 0xa1c69 ,=20 entry_data =3D 0, saved_context =3D 0x0, next =3D 0x11b8f0, prev =3D 0x11= b8f0, priority =3D 6, queue =3D 0x1049e8, mutex_count =3D 1,=20 original_priority =3D 7, priority_inherited =3D 1, state =3D 1, suspend_count =3D 0, wakeup_count =3D 0, wait_info =3D 1161316, unique_id = =3D 4, timer =3D {next =3D 0x11b920, prev =3D 0x11b920, counter =3D 0x161870, al= arm =3D 0x95fd5 ,=20 data =3D 1161504, trigger =3D 0, interval =3D 0, enabled =3D 0, thread = =3D 0x11b8d4}, sleep_reason =3D CYG_REASON_WAIT,=20 wake_reason =3D CYG_REASON_NONE, thread_data =3D {0, 0, 0, 0, 0, 0}, name =3D 0xf24d4 "Network support", list_next =3D 0x161fd4} Thanks, James Hook -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss