Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp235702pxk; Wed, 2 Sep 2020 20:44:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoMhYG4KRpl1VQmD4+5laqba7nt1M3nZlIdbzjzUac7gq418pB8Rr8y7yfUC1ZoBXTJq/q X-Received: by 2002:a17:906:b082:: with SMTP id x2mr99420ejy.349.1599104649752; Wed, 02 Sep 2020 20:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599104649; cv=none; d=google.com; s=arc-20160816; b=0d6ScRLfZK/98CJqbvXyQpmutq/WVnb3p//2UtAOm653SuhwrxGBkrFxe3iGnyNnq5 rKQpWCOaL+FfY64/W4hvTUlY83TxcBhzKCvYoZkTUPdYRlRXCAZZOG89ZYVnWdRXbAaW 3pZtrk49xSyxHuckCnVanG8n8j6BJ57Sbcm7ThxeW9yLnIJk6gU/Mh27tDScEA3ymB1v laH/Zh1UTgWkmZMRR3AkOewW1ht13Cg4JUgk8ANlbSOhvNM0p3wOtUHgNUDEjVLk3Ve3 B3IT2gOSLn/pcNZDjhCK4UePKO0sCrNStAKKlbLSJCg35CaAM8OWnd9yqcmxk9DvqvK8 FgJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=JJ90luUH5F1pyN8w8r/5anGwlRHYrTL09INJPGDcfPA=; b=MRRYxWPHYouOnD/A8ngbmrEcus1hUP2e/ww5v4voF1/s9h5gBnosZoDUdG8mvDckr7 3U+loAa5uMRq485xLWokJmIUC/m+Du8QFNyCxMoIuUas6+bWulfY3CT76bbdLn7pysJv h2sucVaqI9Lj/9his7p8JPi96m5mYoVvF1rD5mxAigT8BNtQxQ9rl1aGZ8gEcY/xO6uq gkRFRoI2LTpMZMnNUaDEqcpthlxnpzypE6mbmiNMRvVktH/UeoCDjEh04S4UBqhkTOQi eQEKNYnnACHxJD1GHXJ+RMIKfLH9b8cf9ETYbGU+wSavxVbAfOOYUiZiX0FtInbE+lPS uXUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=1r0dvYdK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si1164382ejx.387.2020.09.02.20.43.46; Wed, 02 Sep 2020 20:44:09 -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=@alliedtelesis.co.nz header.s=mail181024 header.b=1r0dvYdK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728073AbgICDmj (ORCPT + 99 others); Wed, 2 Sep 2020 23:42:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbgICDmi (ORCPT ); Wed, 2 Sep 2020 23:42:38 -0400 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [IPv6:2001:df5:b000:5::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCBE5C061244 for ; Wed, 2 Sep 2020 20:42:37 -0700 (PDT) Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id B3863806B5; Thu, 3 Sep 2020 15:42:28 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1599104548; bh=JJ90luUH5F1pyN8w8r/5anGwlRHYrTL09INJPGDcfPA=; h=From:To:Cc:Subject:Date; b=1r0dvYdKPEg7ykHctSM4yi4FNI21DMauJkwAQWios3vBodFazE47tLeCF9pxU/edH uk+yqZ+OeUk1TbShcOxMsIeKyz1sFrQbfwoGE5Fm/kaZWK3tuW7SgPzy2Hhayo9Sv5 8qS/iZafRTOEFoIGFsu7m+VbcChzYpqtqT0U7ADTgwR6wpbu7MYJEGR+pLHNtt4Jdq OJw35V6M4TzcdBgWRmbeTfuL6ozhPtTU4PJjrOumnxpfjf0t0yhzLq1CFdTC6AGu8O gXcweQDK1FKPHI49ct8enW/5VV898cM8N+bv5PXUWfOeFGERiYct/5a5UlnneysBxu ra6V8CM0Q6WUQ== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Thu, 03 Sep 2020 15:42:28 +1200 Received: from markto-dl.ws.atlnz.lc (markto-dl.ws.atlnz.lc [10.33.23.25]) by smtp (Postfix) with ESMTP id B14C513EEB7; Thu, 3 Sep 2020 15:42:27 +1200 (NZST) Received: by markto-dl.ws.atlnz.lc (Postfix, from userid 1155) id 7C46833EDFD; Thu, 3 Sep 2020 15:42:28 +1200 (NZST) From: Mark Tomlinson To: miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Cc: artem.bityutskiy@linux.intel.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Tomlinson Subject: [PATCH] mtd: mtdoops: Don't write panic data twice Date: Thu, 3 Sep 2020 15:42:17 +1200 Message-Id: <20200903034217.23079-1-mark.tomlinson@alliedtelesis.co.nz> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable x-atlnz-ls: pat Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 4ced68be7ed7..774970bfcf85 100644 --- a/drivers/mtd/mtdoops.c +++ b/drivers/mtd/mtdoops.c @@ -279,12 +279,13 @@ static void mtdoops_do_dump(struct kmsg_dumper *dum= per, kmsg_dump_get_buffer(dumper, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE, record_size - MTDOOPS_HEADER_SIZE, NULL); =20 - /* Panics must be written immediately */ - if (reason !=3D KMSG_DUMP_OOPS) + if (reason !=3D 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); + } } =20 static void mtdoops_notify_add(struct mtd_info *mtd) --=20 2.28.0