From patchwork Tue Jan 9 10:11:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 857389 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mbgnhrlR"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="gYmNULdv"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zG8ZH0wk8z9s71 for ; Tue, 9 Jan 2018 22:10:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=TKmWTsPICUFSLkzPhsuz0wiEI/8hSDY4kQ1ELsRqbhM=; b=mbgnhrlRWh3AO7ynIt45oYwwIt cRy8itldJxT2p+aCsmi4Xfq1Z4UzcPzZBDaEqw1xPA87PqIHtJ1/3y4ijyXt3mEO15yp7sq+79T5T +gRVdHvQJG274rrgxcDP2Lt5jF+vTjtllEfstYSnIHfV49j+WLu369B7Hk8oTD8nXQzCaZBVUE+uL OteLe4rwLCPuy+f4MLnvAWpQr0loQUJSt5FpuExzyG80rTeO/cH9UZwfh6KpbDCEe204QzG5JTLu3 EGpOh9M4+mDejp8BtIdJsecB3ZgQa51cLLICOv2xNPk0kuSP1cWLc1yXk86mKqblLxGPw61ctKDOL 0Lj3VAyA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eYrnP-0006cM-06; Tue, 09 Jan 2018 11:10:19 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYrZO-0004Uw-O5 for linux-mtd@bombadil.infradead.org; Tue, 09 Jan 2018 10:55:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CyRNfqHegeAn3+kSmVG0Ckx2gDTtI/KEoRkuggVLpMI=; b=gYmNULdv+bdYw9ptDGs9VZyDS eKXx6ZWakxtEMVxNHyrU0rqFQsvRakxAbRrb78EwshJpdf3mTm9UCcgzg7q7o41MLvqZQdS9aXTY1 dfk/ZwT4ZVgmZdS/XCiTjToLmwb6QujG0locb7LgvI+XQoLQb2CddLmbsO9Tfqfw+5DVCPfdpra8y Y7KumL9DoBKAYuz+S6Ri/1KjRC30IqsLh6KdMnKy9XA63PC/ilvahSHR5L7r+UwvUlBI6EU63+2RI eJbZrBBgb5Fe+VBc52rT5NLPhlHsHoIgR3qCAkWgXpY51noKDroblUxCuYWVjSY+R+tMFEiH7tLXS UCeUiGEWw==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eYqt7-0007oS-8I for linux-mtd@lists.infradead.org; Tue, 09 Jan 2018 10:12:11 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1eYqsr-000256-2E; Tue, 09 Jan 2018 11:11:53 +0100 Received: from sha by dude.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1eYqsq-0007vL-L9; Tue, 09 Jan 2018 11:11:52 +0100 From: Sascha Hauer To: linux-mtd@lists.infradead.org Subject: [PATCH 3/8] mtd: nand: mxc: Add buffer argument to copy_spare Date: Tue, 9 Jan 2018 11:11:43 +0100 Message-Id: <20180109101148.13728-4-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180109101148.13728-1-s.hauer@pengutronix.de> References: <20180109101148.13728-1-s.hauer@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mtd@lists.infradead.org X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2001:67c:670:201:290:27ff:fe1d:cc33 listed in] [list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Sascha Hauer , kernel@pengutronix.de, Richard Weinberger MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org With following patches we will have to copy the spare data to/from other buffers, so add the buffer as argument to copy_spare(). Signed-off-by: Sascha Hauer --- drivers/mtd/nand/mxc_nand.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 019c58579dbc..ab9cd45237d3 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -262,14 +262,14 @@ static void memcpy16_toio(void __iomem *trg, const void *src, int size) * holds a page in natural order, i.e. writesize bytes data + oobsize bytes * spare) and the NFC buffer. */ -static void copy_spare(struct mtd_info *mtd, bool bfrom) +static void copy_spare(struct mtd_info *mtd, bool bfrom, void *buf) { struct nand_chip *this = mtd_to_nand(mtd); struct mxc_nand_host *host = nand_get_controller_data(this); u16 i, oob_chunk_size; u16 num_chunks = mtd->writesize / 512; - u8 *d = host->data_buf + mtd->writesize; + u8 *d = buf; u8 __iomem *s = host->spare0; u16 sparebuf_size = host->devtype_data->spare_len; @@ -1295,7 +1295,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, memcpy32_fromio(host->data_buf, host->main_area0, mtd->writesize); - copy_spare(mtd, true); + copy_spare(mtd, true, host->data_buf + mtd->writesize); break; case NAND_CMD_SEQIN: @@ -1314,7 +1314,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command, case NAND_CMD_PAGEPROG: memcpy32_toio(host->main_area0, host->data_buf, mtd->writesize); - copy_spare(mtd, false); + copy_spare(mtd, false, host->data_buf + mtd->writesize); host->devtype_data->send_page(mtd, NFC_INPUT); host->devtype_data->send_cmd(host, command, true); WARN_ONCE(column != -1 || page_addr != -1,