Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp223844pxx; Wed, 28 Oct 2020 03:19:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8jNrFxM7CNpZGekrxSs62BaXtNwBQgpptxorMjbc/3TyzERexqniGtR0aQ2C+8nT/on9K X-Received: by 2002:a05:6402:17ac:: with SMTP id j12mr3432712edy.31.1603880362515; Wed, 28 Oct 2020 03:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603880362; cv=none; d=google.com; s=arc-20160816; b=GVqVo/CHEo4Hm3bi418qw5RUWkLdpio6cujcFjfMeDrRSFInMHxeIOvQHpZTnFp52R yiyW3YDoKHlOTQbkrWcgCtK0sYZPB3XD3OPDob7EGZWt9wtC+iBg8E4m1cd7lf5Ad90n X4nWjpdWRFqirjW0ciPTta7cDqjyT6oOTODl8bkf8wgaBxQzxJCMlooevgLT3WWYxacg 7F0oPi7ijUHStSm6Vo6m9IBU6FriLGheG1OxnwJEdW7URDK0SxD/690pzAvUz3SL1hsx +WTmv9bU2cIKgw8ICmDVoRxeDE7rvqrPepg0fjd0nB22MlHL2m6i8DcJvQPbBKvjzxfJ 3HYw== 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=xfyhy4hO78jzIlXYBwdoAWu038A21jwvciIQ7DhZA/4=; b=I4zY5DmjrAfut6v46VfbOjKsCWM9/7K48L2+Nw4mPOKNprNhVbikQLL+yDbtqTW24N C4u/mhCMKQe6CjI+gNb1pYE5URoAI/iKOkL0QkYT11PIB2bUxmO8vbGKECXK/MjdPF1K /4wtWKeyHL96wsbu6QBNZg0NADzdz2ofdycs15WqtsLqjzSt2XMywZHdsoWkbeeZMiT3 x7IUZdd1xCT9Paw+4Vt/EX6OrtohLI4QpvpV5aToQmhnu7pMsgMks9pnwq0cVgoTufsL 9fD5kZAb+nHPgU+8UFIBAnxxzYP7MsZAJiiDfmkjKnHdSeBnNzPAN9wbFv2r5ixxvYGV c8YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oHXM2cgt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si2969573ejk.629.2020.10.28.03.19.00; Wed, 28 Oct 2020 03:19:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oHXM2cgt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761122AbgJ0OiB (ORCPT + 99 others); Tue, 27 Oct 2020 10:38:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:37122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761095AbgJ0Oh5 (ORCPT ); Tue, 27 Oct 2020 10:37:57 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AA944207BB; Tue, 27 Oct 2020 14:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809476; bh=a7tWooIq1JwVf+nKvVRDjSP9fBHenH+DxoBQ0HKZLSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oHXM2cgtz5S7rReCmwkN8Mtc6mClAeIlhye1w/rE+Tq4WkoYoFvc6iXprQ06TpMWL SdlY1zu0Z1hzQuXx+V0gOG9gQHECwhZ3+1kFah3PB4yrGTGoBO85Ax7ApbR1UiwH3k m0BeI9l2z1IgEFqyFgla9IMXHO4KUNiSn44Xam3E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Tomlinson , Miquel Raynal , Sasha Levin Subject: [PATCH 5.4 209/408] mtd: mtdoops: Dont write panic data twice Date: Tue, 27 Oct 2020 14:52:27 +0100 Message-Id: <20201027135504.792874831@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Tomlinson [ Upstream commit c1cf1d57d1492235309111ea6a900940213a9166 ] If calling mtdoops_write, don't also schedule work to be done later. Although this appears to not be causing an issue, possibly because the scheduled work will never get done, it is confusing. Fixes: 016c1291ce70 ("mtd: mtdoops: do not use mtd->panic_write directly") Signed-off-by: Mark Tomlinson Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20200903034217.23079-1-mark.tomlinson@alliedtelesis.co.nz Signed-off-by: Sasha Levin --- drivers/mtd/mtdoops.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c index 4ced68be7ed7e..774970bfcf859 100644 --- a/drivers/mtd/mtdoops.c +++ b/drivers/mtd/mtdoops.c @@ -279,12 +279,13 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper, kmsg_dump_get_buffer(dumper, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE, record_size - MTDOOPS_HEADER_SIZE, NULL); - /* Panics must be written immediately */ - if (reason != KMSG_DUMP_OOPS) + if (reason != KMSG_DUMP_OOPS) { + /* Panics must be written immediately */ mtdoops_write(cxt, 1); - - /* For other cases, schedule work to write it "nicely" */ - schedule_work(&cxt->work_write); + } else { + /* For other cases, schedule work to write it "nicely" */ + schedule_work(&cxt->work_write); + } } static void mtdoops_notify_add(struct mtd_info *mtd) -- 2.25.1