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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED 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 881C7C10F03 for ; Thu, 25 Apr 2019 09:39:23 +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 539752084F for ; Thu, 25 Apr 2019 09:39:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ab5/UvMd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 539752084F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TFLfMy6yUB7AavSV0oCp9oqQ5sQIoKppAFIEKeY7DRQ=; b=ab5/UvMdqBZJV4 mn3Zij2QI/A84OQJX6nnMB6SR6/ZvWxSbmlQ101056xj79IQon7mu+G6kCejo5v8uvnhZrhtJLR3y uFN+7I4Fm/aeAqhFxi04YsceCa5+n8uUlZcFN6O6qI2LZrUuawhvJ9jn/s6+Og5wJVrKog50kSMao b5TmvD72mFz3l9CMJxlH6KpoL5F2GIzA5kxO6fDhtJT/xzrVvDEE6ipgHxsDcV7PSk/IOLHueN3/S KKzEZTQPgUXuISzFU6cyrllbWc/nw5HNB6m6qyWkiJkWHX7rk3a+arYupvewxhPXCkyHnWsLTDH38 FgjQyfoH5wiTRQ3/aDLQ==; 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 1hJaqW-0001Ws-Uf; Thu, 25 Apr 2019 09:39:12 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJaqU-0001WV-Bj for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2019 09:39:11 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 18DAC374; Thu, 25 Apr 2019 02:39:09 -0700 (PDT) Received: from [10.1.196.129] (ostrya.cambridge.arm.com [10.1.196.129]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 387253F5AF; Thu, 25 Apr 2019 02:39:08 -0700 (PDT) Subject: Re: [PATCH] drivers/firmware: psci_checker: Park kthreads before stopping them To: Sudeep Holla References: <20190424174728.13826-1-jean-philippe.brucker@arm.com> <20190425090357.GB1535@e107155-lin> From: Jean-Philippe Brucker Message-ID: <4cef486e-2456-0c4c-79c6-64604444e666@arm.com> Date: Thu, 25 Apr 2019 10:38:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190425090357.GB1535@e107155-lin> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190425_023910_408349_6CEC9A61 X-CRM114-Status: GOOD ( 18.67 ) 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: Mark Rutland , Lorenzo Pieralisi , "linux-arm-kernel@lists.infradead.org" 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 25/04/2019 10:03, Sudeep Holla wrote: > Hi Jean-Philippe, > > Thanks for fixing this, I did see this issue when I was working on > commit 7401056de5f8 ("drivers/firmware: psci_checker: stash and use > topology_core_cpumask for hotplug tests") but was not consistent. > > On Wed, Apr 24, 2019 at 06:47:28PM +0100, Jean-Philippe Brucker wrote: >> Since commit 85f1abe0019f ("kthread, sched/wait: Fix kthread_parkme() >> completion issue"), kthreads that are bound to a CPU must be parked >> before being stopped. At the moment the PSCI checker calls >> kthread_stop() directly on the suspend kthread, which triggers the >> following warning: >> >> [ 6.068288] WARNING: CPU: 1 PID: 1 at kernel/kthread.c:398 __kthread_bind_mask+0x20/0x78 >> ... >> [ 6.190151] Call trace: >> [ 6.192566] __kthread_bind_mask+0x20/0x78 >> [ 6.196615] kthread_unpark+0x74/0x80 >> [ 6.200235] kthread_stop+0x44/0x1d8 >> [ 6.203769] psci_checker+0x3bc/0x484 >> [ 6.207389] do_one_initcall+0x48/0x260 >> [ 6.211180] kernel_init_freeable+0x2c8/0x368 >> [ 6.215488] kernel_init+0x10/0x100 >> [ 6.218935] ret_from_fork+0x10/0x1c >> [ 6.222467] ---[ end trace e05e22863d043cd3 ]--- >> >> kthread_unpark() tries to bind the thread to its CPU and aborts with a >> WARN() if the thread wasn't in TASK_PARKED state. Park the kthreads >> before stopping them. >> >> Fixes: 85f1abe0019f ("kthread, sched/wait: Fix kthread_parkme() completion issue") > > Now that this file along with psci.c is move into drivers/firmware/psci/ > you may have to repost. The changes are in linux-next and may land > upstream via linux-pm tree. I assume we can get this merged as fix after > merge window ? Ah right, I didn't notice the file was moving. The fix doesn't seem too urgent so I'll resend after the merge window > > FWIW, > > Reviewed-by: Sudeep Holla Thanks! Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel