Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp273329pxx; Wed, 28 Oct 2020 04:42:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJFAUS/7rsYRL+fBvdYawADLWfGPNF3kbDQZAUAFdwBLEjPpdbT4b0em3ISVBJ0p9ajWLo X-Received: by 2002:a05:6402:19ae:: with SMTP id o14mr7025698edz.67.1603885364855; Wed, 28 Oct 2020 04:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603885364; cv=none; d=google.com; s=arc-20160816; b=ynrFe3ejiEYN9//AU9dBKoUzMhkurp4R8dsfUINQ6Wd/bj5NWTx8iJWHeW7A3OigRj 85G/qUOiXOh/w0n+AU5+00UEzxfl9ZG+8U5Hy2E29htcvhAZ/cIQjfQ5fOQD1ggskrRg BUsReCt8kEvvDSiZCPGpIaSHk0Y84rkUnpNYiUa3j8cD1LJh1YO1bcDOosL9fOLD9lL0 wWXfeXCQlq0PK+somFGxdwR8r3oWC7wFd+wwxbjzuJoz7ksG08zeG/l6cqBw33Aad3Nj HaF/oNPWoUyflQtfOwQDXo0Dn7vATtVM6nySmgwKU7c98GzKMDaEjlQALSAfEhNERGkt av8A== 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=A+vkc6vb/O7yJoFfvuhom1MlAa91mp6x95uqnxBhCzw7Rwiwu2tEQd+FRIYXPuEctM ButknDxqpCubDUrdd5DlwQSHesKA2nMzp/vBnZa9Fn/cY53gqFNbE+darvKdtZoIJVq0 F0KTxFaLU4k7JyTGkPc2qHMl90KBaDMnKUmAwn08yVqnT0OyA4PaahxTWbhT86f8tibq uBIRmtKO7vbGo9/GjxhmwTgQLISPP+y18G7TA6xJOO4KCqEKWLzfxvTHgcKv+WcBza8n W+4zBEuekli6YTrwGx1uc3wDu6q+ogDjICFEsLfjF5BgB4338yAroRr/sTdivsUTqnfc nGHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="C/oYVhte"; 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 y19si2789537ejd.730.2020.10.28.04.42.23; Wed, 28 Oct 2020 04:42:44 -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="C/oYVhte"; 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 S1794142AbgJ0PKJ (ORCPT + 99 others); Tue, 27 Oct 2020 11:10:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:37740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1789872AbgJ0PDT (ORCPT ); Tue, 27 Oct 2020 11:03:19 -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 8D2C021D24; Tue, 27 Oct 2020 15:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810998; bh=a7tWooIq1JwVf+nKvVRDjSP9fBHenH+DxoBQ0HKZLSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C/oYVhtesXUdEFiH+CPkxs1dEMxDwnPM2FDtTXL/+ziVFCvVUVpA5Yajto0w+rIj+ QxigUNXlRs6mJFJjgqdhdopfoEsUikdqQOny4PHStYiJ4ZuIHB/NmLXJG8jwSCplz7 G9es8UVD7nENz9ZqUm3cKCIe64COTEpr9wX57Js0= 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.8 337/633] mtd: mtdoops: Dont write panic data twice Date: Tue, 27 Oct 2020 14:51:20 +0100 Message-Id: <20201027135538.493820601@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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