Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp170077pxx; Wed, 28 Oct 2020 01:28:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza42UQUX06RnZmtWA0ez5gHhaT+lrtfBDmrA2JKdj8qABpGw7jDJBlo9sn9sYOM3WSAlUL X-Received: by 2002:a17:906:4351:: with SMTP id z17mr6381096ejm.110.1603873707131; Wed, 28 Oct 2020 01:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603873707; cv=none; d=google.com; s=arc-20160816; b=e8Y4X+1miE3sUTFxRw10E5/cix+TYAFtUj3EEaDgcAAHx8wmKyMcEXKx5xf4weQma2 wuGIfjaZPH4jrTEBbQ9oGct2U1ubijzfGXlT5zo1Zx60ukeI3STUlVgs7m6g6bfxsVl2 npNg/lxGs/6kVZuJ2JHcFM39/9lpwDWpkd6PfJcauxHGI+biBbIhbPHlogYvIavgHiOA hQJvZXOYYNU83vWIQuQlr5ovF+5AkW5+HjVn6qZMsxMPhuc5kEesZQAyBLPKA8fbaNeq nPd/iQ652YRv9/SVPllmlF7qCau4+RG0TuA4W4T0S7MtsPufxnb5wP1zoGnXk5cP+M7a 4Y5w== 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=onSL2ghI+29tiGAZUbYiZ1J046dZVHHJZABaQtsXwedHPLQktQcXSeqSIjjVbEI2aS 0q9Mel+ym83s1Csudgt1JpxjIFD0lhjjkNSZVYmrcrdLqFKrBLE1ypntXbfYpgWQS12f 8Jg47XAWe+PXE1hRrIRKrY3GsFlRf5dC6u4Vuuy1ab5ATm2I73RneL0y71rqmTs40tOM QaAlnJKP9rAr//dK3o7tUS/huoiBoB61lR8LZ3QUe5OGdbrqJBQXgUWTS+0n0M19FADT 3SscndH06Y2SEs3UlFeMYDYzEfH/1UX75aJGdPADh3sT8bAGs2ASSwkTfGzDAyDYYYWz WKpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=15OquLEC; 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 s18si2795558ejd.147.2020.10.28.01.28.04; Wed, 28 Oct 2020 01:28:27 -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=15OquLEC; 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 S1754137AbgJ0OE1 (ORCPT + 99 others); Tue, 27 Oct 2020 10:04:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:52632 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504514AbgJ0OEV (ORCPT ); Tue, 27 Oct 2020 10:04:21 -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 EAA4022263; Tue, 27 Oct 2020 14:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807460; bh=uMXb6/m+AQXzQhdqLTUARmYIEE71vugfO30/rbr9xVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=15OquLECJUhpqG1plvSIxyuIoBCBPbkRqW5qDBkJXKAGNOgn/0BstV6OELKp/5nDE fektL7TDrcLHFMxVr1lVCovp2Tmprmm57Vox0+pc0tAPiwKRBH3vr9lJObOsMndJ+d PPIWhaIB+/9cMBkmZADMW042ztuuQFMHeF6dxGAA= 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.9 061/139] mtd: mtdoops: Dont write panic data twice Date: Tue, 27 Oct 2020 14:49:15 +0100 Message-Id: <20201027134905.017898360@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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