public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bharath Ramesh <krosswindz@gmail.com>
To: "Bhattacharjee, Satadal" <Satadal.Bhattacharjee@engenio.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Bagalkote, Sreenivas" <Sreenivas.Bagalkote@engenio.com>,
	"Patro, Sumant" <Sumant.Patro@engenio.com>,
	"Ram, Hari" <hari.ram@engenio.com>,
	"Mukker, Atul" <Atul.Mukker@engenio.com>
Subject: Re: Registering for multiple SIGIO within a process
Date: Wed, 28 Sep 2005 19:08:57 -0400	[thread overview]
Message-ID: <c775eb9b05092816086df55d13@mail.gmail.com> (raw)
In-Reply-To: <91888D455306F94EBD4D168954A9457C04181C2F@nacos172.co.lsil.com>

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 <Satadal.Bhattacharjee@engenio.com> 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/
>

  parent reply	other threads:[~2005-09-28 23:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-28 22:02 Registering for multiple SIGIO within a process Bhattacharjee, Satadal
2005-09-28 22:51 ` Ray Lee
2005-09-28 23:08 ` Bharath Ramesh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-09-29  0:44 Bagalkote, Sreenivas
2005-09-29  1:15 ` Ray Lee
2005-09-29  3:50   ` Bharath Ramesh
2005-09-29  4:09 Bagalkote, Sreenivas
2005-09-29  5:28 ` Ray Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c775eb9b05092816086df55d13@mail.gmail.com \
    --to=krosswindz@gmail.com \
    --cc=Atul.Mukker@engenio.com \
    --cc=Satadal.Bhattacharjee@engenio.com \
    --cc=Sreenivas.Bagalkote@engenio.com \
    --cc=Sumant.Patro@engenio.com \
    --cc=hari.ram@engenio.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox