From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751203AbVI1XI7 (ORCPT ); Wed, 28 Sep 2005 19:08:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751207AbVI1XI7 (ORCPT ); Wed, 28 Sep 2005 19:08:59 -0400 Received: from qproxy.gmail.com ([72.14.204.205]:53988 "EHLO qproxy.gmail.com") by vger.kernel.org with ESMTP id S1751203AbVI1XI6 convert rfc822-to-8bit (ORCPT ); Wed, 28 Sep 2005 19:08:58 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XYp6X69osbwCYZzR7tp/yL0KLSzrpDiFINNN2HVLraegN54AioLOihTiqQaWg9x1WTPk6L94w/jg+q0KKilAcww5RGcFpEe7GrO2B7lpOMuTlH6soVSiuzmG8lLirBfvdHph/Z396CTZFupUEtrJU2RzfPsHz+l2jizqby47nhE= Message-ID: Date: Wed, 28 Sep 2005 19:08:57 -0400 From: Bharath Ramesh Reply-To: Bharath Ramesh To: "Bhattacharjee, Satadal" Subject: Re: Registering for multiple SIGIO within a process Cc: "linux-kernel@vger.kernel.org" , "Bagalkote, Sreenivas" , "Patro, Sumant" , "Ram, Hari" , "Mukker, Atul" In-Reply-To: <91888D455306F94EBD4D168954A9457C04181C2F@nacos172.co.lsil.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Content-Disposition: inline References: <91888D455306F94EBD4D168954A9457C04181C2F@nacos172.co.lsil.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org I am not sure if this would work but you could try registering different real time signals to be delivered to the shared object instead of SIGIO. I am not sure if it would work. I do use RT signals to be used instead of SIGIO. You could try probably something like this fcntl (devhandle, SETOWN, getpid ()); fcntl (devhandle, SETSIG, SIGRTMIN); fcntl (devhandle, SETFL, O_ASYNC); try registering a signal handler for SIGRTMIN like SIGIO. Could be a possible solution. Bharath On 9/28/05, Bhattacharjee, Satadal wrote: > Hi, > I have hit a typical situation where I am having issues with signals. Below > is the description of the issue. > There are two separate Host Bus Adapters (HBA) connected to the system. Each > HBA has its own driver loaded in the kernel. > > There are two separate shared objects to talk to each of the drivers. One > shared object does not communicate with the other one. > > Each shared object has function within it to register with kernel to receive > SIGIO when an event is generated by the HBA. Driver received the event from > the HBA and sends SIGIO to the kernel. > > There is an application (executable) which loads the two shared objects. > Application then calls function within the shared object to register events > from HBA. > > When driver generates a signal, the shared object which registered last, > receives the signal. The first registration never receives any signal. > > Now I checked the man pages and found out that you can register for the same > signal only once from a process. > We tried to change the signal from SIGIO to SIGUSER1 in one of the shared > object. But on checking the kernel code we realized that only SIGIO is > supported. > > So can somebody suggest what is the correct mechanism to register with the > kernel for receiving multiple signals from a single process? > > I am not subscribed to the list, so please copy me in the CC field when > replying. > The shared object code snippet for registration is below: > struct sigaction sa; > int oflags; > int rc = 0; > // setup the signal handler > memset(&sa, 0, sizeof(struct sigaction)); > sa.sa_handler = &AENSignalHandler; // AENSignalHandler is the signal handler > > //sa.sa_flags = SA_ONESHOT; > sigfillset(&sa.sa_mask); > sigaction(SIGIO, &sa, NULL); > //aen_do_registration - enable driver to send us SIGIO for event > notification > rc = fcntl(ghMegaDev, F_SETOWN, getpid()); // ghMegaDev is the handle to the > driver > if (rc < 0) { > perror("AEN: registration, F_SETOWN"); > return SL_ERR_LINUX_AEN_INIT_FAILED; > } > oflags = fcntl(ghMegaDev, F_GETFL); > rc = fcntl(ghMegaDev, F_SETFL, oflags| FASYNC); > if (rc < 0) { > perror("setup_aen_handler: Failed to set ASYNC flag\n"); > return SL_ERR_LINUX_AEN_INIT_FAILED; > } > ***************************************************************** > Satadal Bhattacharjee, > LSI Logic Corp., > 3098 W Warren Ave, > Fremont, CA, 94539 > satadalb@lsil.com > (408) 433-4204 > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >