Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2414524rwi; Tue, 11 Oct 2022 08:30:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5sLbgP3vcFPIk7ZU0XUBtvuVyYi2L9V7nulskPnru9+YsNjNriUwoTcojAC8PZ0xHAsBDB X-Received: by 2002:a17:902:dac4:b0:178:3037:680a with SMTP id q4-20020a170902dac400b001783037680amr25447537plx.37.1665502214989; Tue, 11 Oct 2022 08:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665502214; cv=none; d=google.com; s=arc-20160816; b=xfrC8i7O6ox6iillighZ1gyadrOw73/7n/Avn/jm7oDda1WWyuGjyGbxAytYLcqK7X 49nKE5KgagLvhI2L6hq6DzusVnv6nN8yQOVHnzCiL6OaDgrHq8gB6wx3kWavHmxRMNP8 O2pxsewwNFiqBfpfRPJbQCgiVG6n6tjPhUpGj9XNn56vNIR74r3PrTLMzA3v5Uog1Ye7 NgBBroEpAli0lRCJqrabyz3cO7t1dFhIQ98doGMDgbzFxUXRobp7+/jloZQ9soB53thy cH5lPRUraiNnAdeEk8jSps6bkRoa4LsiYiOsg7UdIFc7bSm2hBgc6nZozb0pqp/TXBLO Eh2Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bV7elVFTkLsEyHBoUZ0grVQ5VR9IXaVfEHwjuQLSCe8=; b=uiH1qSZU9EzvqIvzhSrzzyc5bLQX9HsMQ6NZVfdVV+jj/K9e1m5Rum2+WFKU0o3GAI wDj7jZuTkb/Oa+oL+OOxKzrQHMQhU5Wm51O5tNfpJuju3N7arD9ej6JWyRhcg7E1aAI4 QtpZkKMM1+stq7+XADRULY3o2tOZ41uRwKLL7pcQedlvVnUbi2DsfziEJsnujXMMlsWo 9XWTNVBVJv/G/qBIa3MiB3v8jRwnitWJ/lBhVmevUbPQJKIQ+5IipZR8yAqiObotkXI3 bT3x55yt3UpLZFgZClUVe3cPUhdH8ptVfUlbboQWD0qouqxXy/dEERwubwTPaJDJxpLz GWmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zp239Pcn; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020a170902d4d000b00178aa58f3ebsi17799290plg.139.2022.10.11.08.30.03; Tue, 11 Oct 2022 08:30:14 -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=@kernel.org header.s=k20201202 header.b=Zp239Pcn; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230435AbiJKOyn (ORCPT + 99 others); Tue, 11 Oct 2022 10:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230310AbiJKOxe (ORCPT ); Tue, 11 Oct 2022 10:53:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F2B59C203; Tue, 11 Oct 2022 07:51:31 -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 091A6B81629; Tue, 11 Oct 2022 14:51:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E47A0C433D6; Tue, 11 Oct 2022 14:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665499888; bh=ojCmeGHkofBLPO9rvISVcCUKCRfazna5eqPo7nU17v0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zp239PcndrhV55aJVZeeqp13++q2X08HXd/7/bBlXvsvAodHFXrKvvWMpchr//8LB lPBRwD8sOqwNt3FKLEPIVb2zsKIdQNNlKQICpljbyfv3zFw0sNfQbxOhyhxv9jbRYz Q1e1aLVgVx86NUS+4KdWbAwEtdioUu+w6PWZLLPL0BGtLu947Nh74Iz0vGXgorwLQl srS8U3wX44yzbcTxaxGRWAkMaAqpcHIGTWBV/Tc+lB9lrwXECJJ6lHLY83KoCaBr4S uyGdsFgbyiM0Otr6gfwrmp+fv9PcRBy92ia09U0G3xY7VZJxUeMmi5kjKVIJNiysdL y9dtcjeyjjfFQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zhao Gongyi , Shuah Khan , Sasha Levin , shuah@kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH AUTOSEL 6.0 46/46] selftests/cpu-hotplug: Use return instead of exit Date: Tue, 11 Oct 2022 10:50:14 -0400 Message-Id: <20221011145015.1622882-46-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221011145015.1622882-1-sashal@kernel.org> References: <20221011145015.1622882-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 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 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 -- 2.35.1