Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp174629pxx; Wed, 28 Oct 2020 01:37:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5vCM/M/OXngYVyqSYL7tJK0BzKd55ygukQ1U5wEAdTYz9AkRKrTDzBGFa3RqWpkmTJOO5 X-Received: by 2002:a50:dac9:: with SMTP id s9mr6323423edj.75.1603874236334; Wed, 28 Oct 2020 01:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603874236; cv=none; d=google.com; s=arc-20160816; b=xISp63zcX6eWMVv3f0wxn4tFlojjVxl1V0xaBBtIUoBO6bwOrIRGsUG5fZvst3Ne10 itRSlNgUgPQFozpXya23Ve8VHL9/py1tkVl9rcoRHSZadis0ORISpemDWvIf9lE/uG29 ESxo/AriN4fLER+/p5oZyiaXEDUf3yTqh5AhDRjHSReuZ7L7eo0BRm+8DXyv+SKiJ9iM COmxwHzWyB+TUM72CGc4G3O84vHSg1bLyiVQbDStVge976DPU6AEabxmVZF5Gn+C32LJ nLzCLUXSrvcULs73Rvcq8PrF88lQQ0jH+QHRMw5LYFUMwp6hfE+gJVhjsI/D2yx8DM0L apmw== 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=A9l+LmdbaDv4VA4QEbcCTnY5938QTWWzB0VyQIMvn3A=; b=xFrygAiooRUeaK6/F6AkjcsolCed4zz3k2uCmTyG+y3CajmKtKmvqVZCLxnVIuv/sk hB54rTUaBYXJG6NBZ9XDTjn2z8HzXsd5IpzH/pjYENhQ/xU/KH/7TbMWyOOrJ1/Qx/Yw M5A8Y6STJN3xqUgW5y2nmj+wx9j8GNJys75wwMCUw/VEORjjmKVPUS0SExiFXkVjeBSe kVuI7+GRywjzsrQzE+FtXP7YppNKDMHpP59iEMMFseSMDUfUQFdxHc8SIYqiIYEr6em+ 4Jzr1Vfr0+JziXtZtiirfjYz0lMe849TXbTtamlxRDMZ8ZKAUWc0aL7jxoD1ibe9MWeV TpqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OkvAHm2x; 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 x26si2664388eds.99.2020.10.28.01.36.54; Wed, 28 Oct 2020 01:37:16 -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=OkvAHm2x; 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 S2506303AbgJ0OHF (ORCPT + 99 others); Tue, 27 Oct 2020 10:07:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:46528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209AbgJ0N7E (ORCPT ); Tue, 27 Oct 2020 09:59:04 -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 E56AD2068D; Tue, 27 Oct 2020 13:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807144; bh=uMXb6/m+AQXzQhdqLTUARmYIEE71vugfO30/rbr9xVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OkvAHm2x49WmiEdS5No91s/dJIIsA4YpJcItvhIY9Uk05QnW7WbisMKWwMAxgOgcF ApJhvimdtK2xBi1ARc9hVp6bV3o5DKbcFee7YySq2D9iXezbBp+JXLjNg4eP0p3F/+ TUISK4Q6GiaifrDygE9sSbwJQn8Aed8ks3UBWUb0= 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 4.4 057/112] mtd: mtdoops: Dont write panic data twice Date: Tue, 27 Oct 2020 14:49:27 +0100 Message-Id: <20201027134903.263574305@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 97bb8f6304d4f..09165eaac7a15 100644 --- a/drivers/mtd/mtdoops.c +++ b/drivers/mtd/mtdoops.c @@ -313,12 +313,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