Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4672119ybg; Mon, 21 Oct 2019 12:34:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPDSR4yzi9ybXBeqBs3GWV9ZRcJLfygJ+Fnoa1+keY2bu5CasAR4Xp2SFsHpQVkGkt1qKc X-Received: by 2002:a17:907:10d3:: with SMTP id rv19mr22858667ejb.301.1571686476297; Mon, 21 Oct 2019 12:34:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571686476; cv=none; d=google.com; s=arc-20160816; b=T55dl2GatcILG+11YPmX5pxWVXykSi0lJsiFOyU5wcfD1M4Nmr3OYNldATF1tkGUKz yJak6/S1zxaj1lgrDEybEGgX2EbteVjiJGo4UEBJ5MTlX4+WJgWKv/lOuTlcqttGIJ2Q vn5VNelQkv2Y+8zh9m+1yrVJR5WnSHRfr/domCb5j11c+Kd8adE7uSPTqGkJslhPAoLP Sbnq9Zg6iaVZuC7HCRAq8g+49sAKRE9F8dsW016RiovaxR7QOpUSFOcxlqbwG1l3sI91 ctl1XJimb1CiL3NKPY8eF2HhyJTb9CT4bVLp5I0I8UdbFX5xXVVq+NPgVcZLrC43bbIo U73g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=5WndJUXXgXPHwhCLRr7+0pwnLZl+9kPbswD/C+BOyJg=; b=s5bpCC/ZabMYGYlybzcN1O99Qy4nihPFhvpVhMOPsS5HK1e+3Ix/kDDZnxbjSdrzvY xVZwCkK0XA15cuHaaL0bO2a1VjjX1R+Dl83zNmLxaF2w+KSClNhci4Qyy2ZaByOcy+gC mp29bkinETLL5QFAbKH+H9VKpMcWmGrzPdIfUEu+hZZL9Is2BnDjcu7hUKjnoF+aYOSf ybGUxMxWewMwy1fTh3FPMEX4vcRCPa6k8LJFMvK1uE8JPUMltHczuG+LkxXIvg/ShST/ eVDpe0kOcdvxy/BOpWM5jl6XyFQ+nmh3j+6z/wOF99lVVOCcbaBEFaT+yI+M1wmO8q7d iXhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vESnDQab; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w54si11196656edd.427.2019.10.21.12.34.12; Mon, 21 Oct 2019 12:34:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vESnDQab; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729906AbfJUTeA (ORCPT + 99 others); Mon, 21 Oct 2019 15:34:00 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39914 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726672AbfJUTeA (ORCPT ); Mon, 21 Oct 2019 15:34:00 -0400 Received: by mail-wr1-f67.google.com with SMTP id c6so3100832wrm.6 for ; Mon, 21 Oct 2019 12:33:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=5WndJUXXgXPHwhCLRr7+0pwnLZl+9kPbswD/C+BOyJg=; b=vESnDQabBipv8xjPoc+wa2ekTjGtmzxFa4h6bCF3qeMKKFfZeqXR4+nvEHRA0fFcSR IJQUqHM4+kKmbaxbkL91blNgMn7VdxdRCJPaslroCFq6gdNvHasjYj9xlJFRlmmQcMSD +aerwVR89midy5FIYroHDoufpZsTi+pJ95BB2dMJidfzs5ZhJllBhkHii6DT1C5X3hxD bb0JfJwsvxLjTJfxbF2uYUCH73ZyON4IokveiL1tCoGjLTabJDxX3/DxYpKfB7DVyjBM IYDhULdiPp2gnyz54wgU6nbdHUPcMqmvC8r8LCTX/die87VBjodMjERvyZ9MKOYWFlTg pJmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5WndJUXXgXPHwhCLRr7+0pwnLZl+9kPbswD/C+BOyJg=; b=F7cbbPcriyySbF6stpdbby3bP5tX5gdiNBEbpBnXomKa1bLFNUiaJhoPFsewpno2xZ IqPJeyGRZB56iEwpqvgH8zgOFo15V+3Tz/QHa0sM8I/sZ6cIRZ/DDE0OUsSYzgB+quLr iDrOmFvxSDDzQsPnDpHQG9hltTpfjqoP5wPgpR5GWIq9iZzuwZfoPtNPIZpJTi/i/9Tu fiwz8wfd3eJJXBLYtE0nleI/af3/n5fz1CsPIkYyaW8Ho0Sy8PGKCW9fu9Eioanwbks6 J/KCf74lDyBKFPXt/A0JdMIjrfmD7aboaqZhXO+yN65JC39HaNykqZBWfvMy51cxnLsv WpNg== X-Gm-Message-State: APjAAAUr5aWQl3F8oe61lRZTbyfcmMFoR9G1nyz8g0vsH/B6IF/5rFOQ pE7gs7H/Uw1BQNUajYR2QQM= X-Received: by 2002:a05:6000:1051:: with SMTP id c17mr20608149wrx.124.1571686438805; Mon, 21 Oct 2019 12:33:58 -0700 (PDT) Received: from mail.broadcom.com ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id 79sm24394580wmb.7.2019.10.21.12.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 12:33:58 -0700 (PDT) From: Kamal Dasu To: linux-mtd@lists.infradead.org Cc: bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, Kamal Dasu , David Woodhouse , Brian Norris , Marek Vasut , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Subject: [PATCH] mtd: set mtd partition panic write flag Date: Mon, 21 Oct 2019 15:32:52 -0400 Message-Id: <20191021193343.41320-1-kdasu.kdev@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Check mtd panic write flag and set the mtd partition panic write flag so that low level drivers can use it to take required action to ensure oops data gets written to assigned mtd partition. Fixes: 9f897bfdd8 ("mtd: Add flag to indicate panic_write") Signed-off-by: Kamal Dasu --- drivers/mtd/mtdpart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 7328c066c5ba..b4f6479abeda 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -159,6 +159,10 @@ static int part_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { struct mtd_part *part = mtd_to_part(mtd); + + if (mtd->oops_panic_write) + part->parent->oops_panic_write = true; + return part->parent->_panic_write(part->parent, to + part->offset, len, retlen, buf); } -- 2.17.1