From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 619ECC43381 for ; Mon, 4 Mar 2019 07:01:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F8C721019 for ; Mon, 4 Mar 2019 07:01:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZV/OK99V"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="hUX7Vb/1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2F8C721019 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yy6lIA2H3ck9eih3KzNGZcF/dWCGHC4GNcngz4jhITQ=; b=ZV/OK99VXc5FIf Bx3eIUqj2NY8pkvKrzSBDrD/rthkjhEyxWWFZdCuu0a0J3F0NhalDbHuhGhzbHsSkiYLvz4bdjJwz z4op54jdCeeqM+O4E92OeqWJSuaxiXrPh1BTK5lFMskXEVjj1HabF7GiXl04D2atS7dyiR/f+Ul/N DMrrsiIZaQGuyx1ZtZCUCHFezyspR4Gm6Wn5BfiUM1o7Rqvfda5IFi0NCdb/yy6r0SYpuSrWGWqEc s75sXcFDj+61ToNpkeSTkabA6Dpn3fDv3N7c/pa7dLgiFj/h6Wq9I3KkES0b5WVowmE5ClqPOpS3j 0cv1DT8v7P77+70BLswQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0hbU-0004NY-VS; Mon, 04 Mar 2019 07:01:36 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0hbR-0004N6-J6 for linux-arm-kernel@lists.infradead.org; Mon, 04 Mar 2019 07:01:34 +0000 Received: from dragon (61-216-91-114.HINET-IP.hinet.net [61.216.91.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B789020823; Mon, 4 Mar 2019 07:01:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551682893; bh=3XGPg2iTtRa0l8EuxeHFZxDZrimwk3TtMmvKmH8w8UA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hUX7Vb/10dBQ2ze8/4QH5pxyzRm1KkFPv0aDUxJW7tRA4VG/cR0RvMFU24JtD4gLr LBfDVOc8dGNy1mpNswFqwAOyCJkmCx3LPUmD7C5bo2BLHhH4KQyBSQcMT8NoG6n6jN O/qpDIuW9fLlLTFF70VUblgblDwoPrNgSViMEbiY= Date: Mon, 4 Mar 2019 15:00:31 +0800 From: Shawn Guo To: Kohji Okuno Subject: Re: [PATCH v3] ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time Message-ID: <20190304070029.GE26041@dragon> References: <20190222.174953.431124434951497467.okuno.kohji@jp.panasonic.com> <20190226023413.19531-1-okuno.kohji@jp.panasonic.com> <20190301092341.GP26041@dragon> <20190304.102814.1664010168009276853.okuno.kohji@jp.panasonic.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190304.102814.1664010168009276853.okuno.kohji@jp.panasonic.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190303_230133_643619_EAA8C5D3 X-CRM114-Status: GOOD ( 13.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fabio.estevam@nxp.com, s.hauer@pengutronix.de, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 04, 2019 at 10:28:14AM +0900, Kohji Okuno wrote: > Hi Shawn, > > I found this bug by delaying periodic communication. For example, it > is the source codes as below. > > while (1) { > sleep(2); > write(fd, "Hello", strlen("Hello")); > } > > Of course, it dows not occur frequently. However, in the worst case, > it stopped for more than 1 minute. > > If there are few running processes and few hrtimer events, this issue > will occur. > > For example: > (*) time is abstracting. > WFI idle : the CPU will be waked up by local timer. > WAIT idle: the CPU will be waked up by broad cast(bc) timer. > > [time] > CPU#0 CPU#1 > ---------------------------------------------------------------------- > enter "WAIT" idle > [next event=10] > enter "WAIT" idle > [next event=60] > all cpus are IDLE = > CPU#1 sets WAIT_UNCLOCKED > > 10: bc timer fires > exit idle > > enter "WFI" idle > [next event=12] > > 12: ** local timer is not fired ** > CPU#0 will not be waked up > until the next bc timer interrupt. > > >> all processes stop << > > 60: bc timer fires > exit idle exit idle > CPU#1 sets WAIT_CLOCKED > local timer fires > > If CPU#0 sets WAIT_CLOCKED at time=10, this issue will not occur. > > Does that make any sense? Yes, makes sense, and thanks for the details. So the fix should be a material for stable kernel, even though the bug doesn't happen often. Thanks for the patch. Shawn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel