Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5688649ybv; Tue, 18 Feb 2020 02:06:02 -0800 (PST) X-Google-Smtp-Source: APXvYqytPN0Z2SjVKPZ8gjPEOxWvwJBTzzKfk6eydyrKw0fndo5L+k0n5x56LD/Sg5mkz9MpBhd+ X-Received: by 2002:a9d:7e8c:: with SMTP id m12mr15949876otp.346.1582020362066; Tue, 18 Feb 2020 02:06:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582020362; cv=none; d=google.com; s=arc-20160816; b=AEdSuL/wMPFIQbHKwodktAC/8Y147mQYeQrsetb/g2tY2QfXhlWF2+BPTF29KwQrus xX/QbenatkyKDakCVG+pcB9+8mum0MC2zmGIAzQMAstInhMkRaFrIfVSubzpvGxLAOSh ECUdkU3Nz1h5zpmg3R2ZAkUS0QNBnqFADUFNZ4KfRVzwuobtObr+vdnjZH3N52q/b9Ox X+TQ7JeVux59aEIjtlhDQ+3sDiTDcKadMY2f6KKbE7/FUtVgrDOCnusDuTFlUUvPdtQu UrDeiDnVnCVCLVqJ1lvgEKuSoteQd3PfxoiSMGiUma1pH7aHi37ckARGdfGFtmfyhLYn UA+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=ElNZziTUQMeZ4ypq+jqZ2J29HqiAkVdB0x8jgVNiTs8=; b=fhqLuW1ZfPvH9F+tezbNrc7BfZ0wQtaa9Z6LdxiA96dBJr+6dOVda2jH/my+DWAnYj cEAZVmi5M1gLCBjFkxWV18hpMhOi0Yrqs2SHTByjyKCQ/0DvWd6VzVcIakK5pUi3xFrO gs1YXu6HlKNZMxarjsxK8FtPe/pwDsv01DjSTBuCyBEiwduOsj/LRqjuQ29NYdDSvEGq NHGCRKhKH6lHHRPqeJ4S2uUJFHyl+QdpTORml3azrq6jA7PgLBNZUR8DI8jqjXqVRyo+ tyIu1p5BgbY/40L/dvSPy7N29S3C0FqY2grZ3kkEvUXimxY3w7AKNMWBQJbj/wlvDjUs x1sg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t22si748950otc.167.2020.02.18.02.05.49; Tue, 18 Feb 2020 02:06:02 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbgBRKF2 convert rfc822-to-8bit (ORCPT + 99 others); Tue, 18 Feb 2020 05:05:28 -0500 Received: from skedge04.snt-world.com ([91.208.41.69]:39210 "EHLO skedge04.snt-world.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbgBRKF1 (ORCPT ); Tue, 18 Feb 2020 05:05:27 -0500 Received: from sntmail10s.snt-is.com (unknown [10.203.32.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by skedge04.snt-world.com (Postfix) with ESMTPS id D63E267A8C2; Tue, 18 Feb 2020 11:05:25 +0100 (CET) Received: from sntmail12r.snt-is.com (10.203.32.182) by sntmail10s.snt-is.com (10.203.32.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Tue, 18 Feb 2020 11:05:25 +0100 Received: from sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305]) by sntmail12r.snt-is.com ([fe80::e551:8750:7bba:3305%3]) with mapi id 15.01.1913.005; Tue, 18 Feb 2020 11:05:25 +0100 From: Schrempf Frieder To: Boris Brezillon , Schrempf Frieder , Jeff Kletsky , liaoweixiong , Miquel Raynal CC: "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , "Richard Weinberger" Subject: [PATCH v3 2/3] mtd: spinand: Explicitly use MTD_OPS_RAW to write the bad block marker to OOB Thread-Topic: [PATCH v3 2/3] mtd: spinand: Explicitly use MTD_OPS_RAW to write the bad block marker to OOB Thread-Index: AQHV5kLwwRgP/Zu9XkOnsRGGZy33Bw== Date: Tue, 18 Feb 2020 10:05:25 +0000 Message-ID: <20200218100432.32433-3-frieder.schrempf@kontron.de> References: <20200218100432.32433-1-frieder.schrempf@kontron.de> In-Reply-To: <20200218100432.32433-1-frieder.schrempf@kontron.de> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-originating-ip: [172.25.9.193] x-c2processedorg: 51b406b7-48a2-4d03-b652-521f56ac89f3 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-SnT-MailScanner-Information: Please contact the ISP for more information X-SnT-MailScanner-ID: D63E267A8C2.ACAC6 X-SnT-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-SnT-MailScanner-SpamCheck: X-SnT-MailScanner-From: frieder.schrempf@kontron.de X-SnT-MailScanner-To: bbrezillon@kernel.org, git-commits@allycomm.com, liaoweixiong@allwinnertech.com, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at X-Spam-Status: No Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frieder Schrempf When writing the bad block marker to the OOB area the access mode should be set to MTD_OPS_RAW as it is done for reading the marker. Currently this only works because req.mode is initialized to MTD_OPS_PLACE_OOB (0) and spinand_write_to_cache_op() checks for req.mode != MTD_OPS_AUTO_OOB. Fix this by explicitly setting req.mode to MTD_OPS_RAW. Fixes: 7529df465248 ("mtd: nand: Add core infrastructure to support SPI NANDs") Signed-off-by: Frieder Schrempf Reviewed-by: Boris Brezillon --- Changes in v3: * none Changes in v2: * Add Boris' R-b tag --- drivers/mtd/nand/spi/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index de36cd7a5d7e..a94287884453 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -609,6 +609,7 @@ static int spinand_markbad(struct nand_device *nand, const struct nand_pos *pos) .ooboffs = 0, .ooblen = sizeof(marker), .oobbuf.out = marker, + .mode = MTD_OPS_RAW, }; int ret; -- 2.17.1