From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759084AbbBICE3 (ORCPT ); Sun, 8 Feb 2015 21:04:29 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:38979 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751552AbbBICE2 (ORCPT ); Sun, 8 Feb 2015 21:04:28 -0500 Date: Sun, 8 Feb 2015 18:03:49 -0800 From: Guenter Roeck To: Rabin Vincent Cc: jesper.nilsson@axis.com, linux-cris-kernel@axis.com, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] CRISv32: handle multiple signals Message-ID: <20150209020349.GA821@roeck-us.net> References: <1423428304-26586-1-git-send-email-rabin@rab.in> <1423428304-26586-3-git-send-email-rabin@rab.in> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423428304-26586-3-git-send-email-rabin@rab.in> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020202.54D815AB.016B,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.001 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: C_4847, X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 5 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 08, 2015 at 09:45:04PM +0100, Rabin Vincent wrote: > Al Viro noted that CRIS fails to handle multiple signals. > > This fixes the problem for CRISv32 by making it use a C work_pending > handling loop similar to the ARM implementation in 0a267fa6a15d41c > ("ARM: 7472/1: pull all work_pending logics into C function"). > > This also happens to fixes the warnings which currently trigger on > CRISv32 due to do_signal() being called with interrupts disabled. > > Test case (should die of the SIGSEGV which gets raised when setting up > the stack for SIGALRM, but instead reaches and executes the _exit(1)): > > #include > #include > #include > #include > > static void handler(int sig) { } > > int main(int argc, char *argv[]) > { > int ret; > struct itimerval t1 = { .it_value = {1} }; > stack_t ss = { > .ss_sp = NULL, > .ss_size = SIGSTKSZ, > }; > struct sigaction action = { > .sa_handler = handler, > .sa_flags = SA_ONSTACK, > }; > > ret = sigaltstack(&ss, NULL); > if (ret < 0) > err(1, "sigaltstack"); > > sigaction(SIGALRM, &action, NULL); > setitimer(ITIMER_REAL, &t1, NULL); > > pause(); > > _exit(1); > > return 0; > } > > Reported-by: Al Viro > Link: http://lkml.kernel.org/r/20121208074429.GC4939@ZenIV.linux.org.uk > Signed-off-by: Rabin Vincent Hi Rabin, Works nicely, and, yes, it does fix the annoying traceback. Tested-by: Guenter Roeck Wondering - what serial driver do you use with crisv32, if any ? So far I always patch in a cut-down version of the driver from 2.6.26/33 which was never submitted upstream. Thanks, Guenter