From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.x-arc.co.uk ([217.6.246.34] helo=root.phytec.de) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuzSh-0005UW-Pt for barebox@lists.infradead.org; Wed, 29 Aug 2018 12:20:47 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 4C1A4A00A63 for ; Wed, 29 Aug 2018 14:20:53 +0200 (CEST) From: Teresa Remmet Date: Wed, 29 Aug 2018 14:19:24 +0200 Message-Id: <1535545212-18871-9-git-send-email-t.remmet@phytec.de> In-Reply-To: <1535545212-18871-1-git-send-email-t.remmet@phytec.de> References: <1535545212-18871-1-git-send-email-t.remmet@phytec.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 08/56] ubi: Make recover_peb power cut aware To: barebox@lists.infradead.org RnJvbTogUmljaGFyZCBXZWluYmVyZ2VyIDxyaWNoYXJkQG5vZC5hdD4KCnJlY292ZXJfcGViKCkg d2FzIG5ldmVyIHBvd2VyIGN1dCBhd2FyZSwKaWYgYSBwb3dlciBjdXQgaGFwcGVuZWQgcmlnaHQg YWZ0ZXIgd3JpdGluZyB0aGUgVklEIGhlYWRlcgp1cG9uIG5leHQgYXR0YWNoIFVCSSB3b3VsZCBi bGluZGx5IHVzZSB0aGUgbmV3IHBhcnRpYWwgd3JpdHRlbgpQRUIgYW5kIGFsbCBkYXRhIGZyb20g dGhlIG9sZCBQRUIgaXMgbG9zdC4KCkluIG9yZGVyIHRvIG1ha2UgcmVjb3Zlcl9wZWIoKSBwb3dl ciBjdXQgYXdhcmUsIHdyaXRlIHRoZSBuZXcKVklEIHdpdGggYSBwcm9wZXIgY3JjIGFuZCBj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