From patchwork Wed Oct 19 08:29:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5286 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp281074wrs; Wed, 19 Oct 2022 05:01:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4wwLbSHLhqlgU2EbhalZYArkKerF1Buh9O+uFI/keScNcgYg1r19zyWHB4rZ2CIfHK3fBb X-Received: by 2002:a17:907:6e11:b0:78e:3057:f631 with SMTP id sd17-20020a1709076e1100b0078e3057f631mr6304556ejc.333.1666180896812; Wed, 19 Oct 2022 05:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666180896; cv=none; d=google.com; s=arc-20160816; b=APwz/T5YeTjSkJHHn+itCKQXTTtHro4zWvDAnCNi+hN9pDScskxkeTD+9eS0GqA5Rr 7BJQ0RUj0uE2qO2LKfN3MthJ3wJDOJH2L813L0qAEEezBYChhF2tiYUlKMG8uCpcUsF5 w/uc9CCtjXh8btLCYSohW9PdErPTsqxZJxfK7zReQ7/GnwS7T4WQ2+G9/xgwd7DkaRKb AyIFC9Hde1qiVDS7ePvuIugMooss1one9Nbog5XNmEyr8NAdz9OG1ea8Rja8ChkkgRUY PX5TTAhCGAmUgU99JOR4TOIvprT2YtsgN8+p6lninJAHGiBWuA3rW0W8d/oNR9iAaIMu 6N/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y70JzDOolKy/GxrA5KTQDDrQE6WV0cW/8gtS4opIXYc=; b=OaGN2OSWPKqxV0RapPTV0Yz+uLPThY0tbg+gzU8wsGQSlAh5yuYZhPdNMnx+v3z+4c 782NsuQFh1b7OOUsnfLngvV55d+kBluPMsIMjcLZAJuHDLwgcq6cwK7Wa+IeTygH3BLu R55Wb0PpPZQL+jP2izeF+B1lC/RMVfqzmPtlvn9cElf1EK1s94cqNSFob82kjzgp9qgw ifiR50GADtB7MK9JEpLYrrwumlI8QT+/xNaKpcrucZ7sz9K/fjSXhjTzSqpZUJRGdBoq 4aVVTRihgggdTCZo/3HT5q0WhcLigg5tDd1B4Csmu4jKpG8q6DlD9NySegVYl9IPmCEN volQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BdJW+BnB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fi18-20020a056402551200b0045a3b951e8bsi13537551edb.194.2022.10.19.05.01.09; Wed, 19 Oct 2022 05:01:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BdJW+BnB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232399AbiJSL40 (ORCPT + 99 others); Wed, 19 Oct 2022 07:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232663AbiJSLyy (ORCPT ); Wed, 19 Oct 2022 07:54:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E7851B864F; Wed, 19 Oct 2022 04:34:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 906D8B8244F; Wed, 19 Oct 2022 08:59:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07288C433D6; Wed, 19 Oct 2022 08:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169993; bh=coQ3Q/Ae05f07tSDbuwVfPnSEuQZI1GqMFwqyzL101s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BdJW+BnBV/j+1hQVaJcsIwW8zeywOHUTcglyGgWrs7/81ga126WBy+OibzF1E9n83 8vMk+bKCRVZ2PWlgfdv9aIUj8se7AaaX+cBuCq5GuGwcuyc5oef20hiupK96rJxkvt Qy/SY8KDHvVp20UFNLtyabmQxIOWC77SqbyMk0l8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhao Gongyi , Shuah Khan , Sasha Levin Subject: [PATCH 6.0 454/862] selftests/cpu-hotplug: Use return instead of exit Date: Wed, 19 Oct 2022 10:29:01 +0200 Message-Id: <20221019083310.034366440@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747117300130066730?= X-GMAIL-MSGID: =?utf-8?q?1747117300130066730?= From: Zhao Gongyi [ Upstream commit 972cf4ce51ef5532d56822af17defb148aac0ccb ] Some cpus will be left in offline state when online function exits in some error conditions. Use return instead of exit to fix it. Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan Stable-dep-of: 51d4c851465c ("selftests/cpu-hotplug: Reserve one cpu online at least") Signed-off-by: Sasha Levin --- .../selftests/cpu-hotplug/cpu-on-off-test.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh index 0d26b5e3f966..940b68c940bb 100755 --- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh +++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh @@ -4,6 +4,7 @@ SYSFS= # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 +retval=0 prerequisite() { @@ -102,10 +103,10 @@ online_cpu_expect_success() if ! online_cpu $cpu; then echo $FUNCNAME $cpu: unexpected fail >&2 - exit 1 + retval=1 elif ! cpu_is_online $cpu; then echo $FUNCNAME $cpu: unexpected offline >&2 - exit 1 + retval=1 fi } @@ -128,10 +129,10 @@ offline_cpu_expect_success() if ! offline_cpu $cpu; then echo $FUNCNAME $cpu: unexpected fail >&2 - exit 1 + retval=1 elif ! cpu_is_offline $cpu; then echo $FUNCNAME $cpu: unexpected offline >&2 - exit 1 + retval=1 fi } @@ -201,7 +202,7 @@ if [ $allcpus -eq 0 ]; then offline_cpu_expect_success $present_max online_cpu $present_max fi - exit 0 + exit $retval else echo "Full scope test: all hotplug cpus" echo -e "\t online all offline cpus" @@ -291,3 +292,5 @@ done echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/CPU_DOWN_PREPARE/error /sbin/modprobe -q -r cpu-notifier-error-inject + +exit $retval