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,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, UNPARSEABLE_RELAY,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 9871AC04AB4 for ; Tue, 14 May 2019 10:07:06 +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 6C43321473 for ; Tue, 14 May 2019 10:07:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZfDQ3ZhJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="hbhoxtjl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C43321473 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.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:MIME-Version: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:In-Reply-To:References: List-Owner; bh=oz5aYmJ7rhqmUMhcijidkb59HT0+bZ2bSzTZdymxyDk=; b=ZfDQ3ZhJTAxVwS YEIBXR1RoqUmcrkROD/0uGHLaqernFG/+pOhbok19s0kaH7uGySAA6zqPy2mKJ9K1FxW1PcOirKwS yOJHd0E9kiMh0IqMqnNkLy+NMEe1OnvchxjtDrw6PEArBWikOjLSqDhXDmATmEL4Hj1DU15JfSWNr 11w52vq5lNzOh0zPlKb5PmKYBq/6EkG+1m0vwqINktfvvsUtSevr+zx/xjg3ieo/kVdpR4oZkRp09 pfwl4RXAFpK/EoTmMmU8HJYG9cBw9WF3ytyTyJAJ4UaqNyccoFxgi1vB1LDje9WPJsPsK7EYl+Wy9 ESi9cd6iHeknGxl0gEeQ==; 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 1hQUKp-0000oh-Fb; Tue, 14 May 2019 10:06:59 +0000 Received: from aserp2130.oracle.com ([141.146.126.79]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQUKl-0000oH-Nh for linux-arm-kernel@lists.infradead.org; Tue, 14 May 2019 10:06:57 +0000 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4E9x2a5140802; Tue, 14 May 2019 10:06:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=riAB10GmF3JQLurW/6kz3EsMdlw943oN7kVaiqQGf6Q=; b=hbhoxtjlfFNyf20MCt22LKsc6us8aHajvyEGA+Tl+eaLpBK40UVBugzb/hMq6fxtz9uW 7Tqlr/cpZtDw4+SEIqxF5Hp2RUL0h0gsLO83jTUR0fBmhlvxm8taVpEy4WIcvAOwZaf6 21sCijBkw9FgYya39TsHtW2ehlL/E2doou6oE+E6vUZ2GDM/DUBGowIu90iKBJFEMVjo 5ijcEZzwPpU2QYaSFbWhZLDYBhrgYFG7OAmGtG3hyNvGPPiYDOX3NPbfrHvthOHiMwm8 NinH9JepJbG6UmA6vKpyu6ckgiTuyXoZoNMIk1j7ewjDMIT79qmnARjhtD1yhN0jyOR/ 6g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 2sdkwdn1fh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 May 2019 10:06:50 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4EA4Oo0087838; Tue, 14 May 2019 10:04:49 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 2se0tw2dkh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 May 2019 10:04:49 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x4EA4mjH026873; Tue, 14 May 2019 10:04:49 GMT Received: from mwanda (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 14 May 2019 03:04:48 -0700 Date: Tue, 14 May 2019 13:04:42 +0300 From: Dan Carpenter To: wens@csie.org Subject: [bug report] ARM: sun9i: smp: Support CPU/cluster power down and hotplugging for cpu1~7 Message-ID: <20190514100442.GA31718@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9256 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905140073 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9256 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905140073 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190514_030655_862750_C5858984 X-CRM114-Status: GOOD ( 14.47 ) 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: 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 Hello Chen-Yu Tsai, The patch 7cbea6327e76: "ARM: sun9i: smp: Support CPU/cluster power down and hotplugging for cpu1~7" from Jan 17, 2018, leads to the following static checker warning: arch/arm/mach-sunxi/mc_smp.c:581 sunxi_mc_smp_cpu_kill() error: scheduling with locks held: 'spin_lock:boot_lock' arch/arm/mach-sunxi/mc_smp.c 546 /* wait for CPU core to die and enter WFI */ 547 count = TIMEOUT_USEC / POLL_USEC; 548 spin_lock_irq(&boot_lock); ^^^^^^^^^^^^^^^^^^^^^^^^^ Atomic context. 549 for (tries = 0; tries < count; tries++) { 550 spin_unlock_irq(&boot_lock); 551 usleep_range(POLL_USEC / 2, POLL_USEC); 552 spin_lock_irq(&boot_lock); 553 554 /* 555 * If the user turns off a bunch of cores at the same 556 * time, the kernel might call cpu_kill before some of 557 * them are ready. This is because boot_lock serializes 558 * both cpu_die and cpu_kill callbacks. Either one could 559 * run first. We should wait for cpu_die to complete. 560 */ 561 if (sunxi_mc_smp_cpu_table[cluster][cpu]) 562 continue; 563 564 reg = readl(cpucfg_base + CPUCFG_CX_STATUS(cluster)); 565 if (reg & CPUCFG_CX_STATUS_STANDBYWFI(cpu)) 566 break; 567 } 568 569 if (tries >= count) { 570 ret = ETIMEDOUT; 571 goto out; 572 } 573 574 /* power down CPU core */ 575 sunxi_cpu_powerdown(cpu, cluster); 576 577 if (!sunxi_mc_smp_cluster_is_down(cluster)) 578 goto out; 579 580 /* wait for cluster L2 WFI */ 581 ret = readl_poll_timeout(cpucfg_base + CPUCFG_CX_STATUS(cluster), reg, 582 reg & CPUCFG_CX_STATUS_STANDBYWFIL2, 583 POLL_USEC, TIMEOUT_USEC); ^^^^^^^^^ This is 100. Use zero instead to avoid sleeping? 584 if (ret) { 585 /* 586 * Ignore timeout on the cluster. Leaving the cluster on 587 * will not affect system execution, just use a bit more 588 * power. But returning an error here will only confuse 589 * the user as the CPU has already been shutdown. 590 */ 591 ret = 0; 592 goto out; 593 } 594 595 /* Power down cluster */ 596 sunxi_cluster_powerdown(cluster); 597 598 out: 599 spin_unlock_irq(&boot_lock); ^^^^^^^^^ 600 pr_debug("%s: cluster %u cpu %u powerdown: %d\n", 601 __func__, cluster, cpu, ret); 602 return !ret; 603 } regards, dan carpenter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel