Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1814727lqa; Mon, 29 Apr 2024 23:02:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU/poOJDH3SLZLE9XRKYx+L8cdjaLUkcs7R3nhhu+tky56vXXOecyaSEXoD8UmVR5ckZ/f2spMQdSIpLG7xJjr4s4zgSNXFg9eVtBw3yQ== X-Google-Smtp-Source: AGHT+IFQ+tSiZ29v7u+jDGnQ0T2WZYT+RGMYHNiDO+iPHq7OV2oDv8019SKelusF593Y+OrvnMvW X-Received: by 2002:a17:906:2bd8:b0:a58:7e28:b6bc with SMTP id n24-20020a1709062bd800b00a587e28b6bcmr1506747ejg.17.1714456976544; Mon, 29 Apr 2024 23:02:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714456976; cv=pass; d=google.com; s=arc-20160816; b=g1n2lz9L8I5c1jIa2ONQB00YS8AADHGsKy/0+0Ods1TuoYPmxNu4PV17y6SmaBPYpi njNIyIvzpx7+vXsHNNY/vTm5uIVGRiatUHYruawObqQCZSq7Gouh0jeadeM0k9zD/W9Z DFRzfZZpyH083dMDcLFfh6cpQu/1S+zmKnVJBOzs4aKY2C5YRd53HFjToVaxuMtRjPXc lSvARmnhXjkSUqOonC7ag+UQylBRtiE1vvNwMUekQ7dJR0M+kt0dIZ+FM00/nrDQbOUm YKOtQrXbZEzAZmT7mtmA94HX+IHDMuqgntgUMd4ukjf4zQDT4OnWnPTrn5JB0iwfzCfS Boow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=T6O/8s5JGNGygSffr60oGF7gbXv8gyrltI8O8LYiMMA=; fh=K1DnZzhoUE9CSpdEfpcuuJKpyalWv3qdD+mV0w5dL58=; b=oVz9w8PKmhfq2rRGxbQSSM+JpOjrY5OmPr5Ok9GXlLoEk8+YmCT26hB/lSWRlmR59s gx90VsPsiS3CmqcdWuG9RMvPSDUMWtqCmCXRR+FpeymityRevd5EsDuFulWMb+80WTdD DkJVMk4G/1MJN6RMHYHaK7xp7cEnCh056jhe+DV5AEpN0MVWbX8WeUoLV2x/975/fdsp 1WzAzz0txCGhMV/3auY2r7ditf7A3kNZOKbUUj9IS12hg2RI+ZlDJ3dUxZCFvmG3xscz AKwC2swekbSOjWa8+u45WO9mv2Cnzn+cephqk+rjR5ntU05gjOa0buRI2NcmVUEfYjfY unfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="tdA3d/Du"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m20-20020a1709060d9400b00a58de5edca7si3909152eji.21.2024.04.29.23.02.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 23:02:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="tdA3d/Du"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163382-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163382-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 47B8E1F22B46 for ; Tue, 30 Apr 2024 06:02:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 220E217BDD; Tue, 30 Apr 2024 06:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tdA3d/Du" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C55E179BE for ; Tue, 30 Apr 2024 06:02:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714456968; cv=none; b=qiWgtioW0+E8E30gtQdc+9SaXhh+PFYSCZ7sd+KTqSoRkfpp29Bme0yXbG8DVSPRyTuZWdhbRCBdKkeW0b3m4REiKNQ7dcM+VvraiWrEDYrji/sk2MZzJjpt9M2Zeqbf7Ln+Y42qihJqGwL/8/SrJwXFwyllD0B2jn6Of0pcQQs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714456968; c=relaxed/simple; bh=Gq7jK/rrX6lfM7UxNj8oRoe0bGGIkcp4pVEDXAFgAx8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JurzDNrJ/vM9uhwa5BAa9xL1qor/mVFLbQZRFZzAqxal3jrO+6f7EF1XZZBzy2aVYxoDMpMYTGKZvIIHdVfLvFZ1Y6T+2MrwUEjhMmq85osXkJuAdmrhlX6yMqUOowzRN0u+aMrkOUAoDR/lHwS5N3at/YH2NAP2JQJgk77V5cU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tdA3d/Du; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2A19C2BBFC; Tue, 30 Apr 2024 06:02:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714456967; bh=Gq7jK/rrX6lfM7UxNj8oRoe0bGGIkcp4pVEDXAFgAx8=; h=From:To:Cc:Subject:Date:From; b=tdA3d/DuiHtI3iHxMvxUficnQHRO95jAObPCBNHgpkfJCtKTC/4DZ+TwdJFPDAro7 4+4l7gRpJmKTeXbPM85dTDlB7dCb4tSgjRW64P+sM3eOJCJ5XvJASo1hKcqvCPdGpc xpICE6CqS94YzoxLDIxA/sIRGtXGrXQmdnDA1xIGXIzOJ+b9DvS7/ZDVnHdvLhjMaM EOPlQ4pVrnmtB1wWDyc0Qr29hbsaJqwb80Mo9irE7wLAKiqEqZ/SVyqJLdNk1XDImS xyiJE+1euIHK5GFhnL0jltCLFMvFaHSABUfORIAhM4m7rLLMks+PZ2mhHrCMRHNS9L zOwh+hJyJ4qxw== From: Song Liu To: linux-kernel@vger.kernel.org Cc: kernel-team@meta.com, Song Liu , Andrew Morton , Peter Zijlstra Subject: [PATCH v5 1/2] watchdog: Handle comma separated nmi_watchdog command line Date: Mon, 29 Apr 2024 23:02:35 -0700 Message-ID: <20240430060236.1878002-1-song@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Per the document, the kernel can accept comma separated command line like nmi_watchdog=nopanic,0. However, the code doesn't really handle it. Fix the kernel to handle it properly. Cc: Andrew Morton Cc: Peter Zijlstra Signed-off-by: Song Liu --- kernel/watchdog.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index d7b2125503af..7f54484de16f 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -71,6 +71,7 @@ void __init hardlockup_detector_disable(void) static int __init hardlockup_panic_setup(char *str) { +next: if (!strncmp(str, "panic", 5)) hardlockup_panic = 1; else if (!strncmp(str, "nopanic", 7)) @@ -79,6 +80,12 @@ static int __init hardlockup_panic_setup(char *str) watchdog_hardlockup_user_enabled = 0; else if (!strncmp(str, "1", 1)) watchdog_hardlockup_user_enabled = 1; + while (*(str++)) { + if (*str == ',') { + str++; + goto next; + } + } return 1; } __setup("nmi_watchdog=", hardlockup_panic_setup); -- 2.43.0