Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2235815imm; Wed, 3 Oct 2018 00:11:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV63fFDWnE+VnRa5MM1FNkSVWjkQFtWmjKMnxPSPs+o76InqCocF9G1V2fXQEo0Z1bCWY53nh X-Received: by 2002:aa7:8001:: with SMTP id j1-v6mr147028pfi.73.1538550701548; Wed, 03 Oct 2018 00:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538550701; cv=none; d=google.com; s=arc-20160816; b=wElOVYTE6x5QbXieK0Xb76YNCevLrMvBYCoUmCqMS0jIIbwHYJc3ozCylqFgu9YAgH NG5QiOOM5IUMbB9qTwS0cLNYNSL54qSZ2uSzwQKfJXqwWowEHLMAwcq7gk+omtJaxbQI kFZBxx/cGvxrIHk5iBb89XejDLKvdOvWdByyuUHrxooSBomdWueAdZOiAVmBQrAht9hM QyDSfBulqPXdGj7PC1hhmKJASWf4vLoVOUlcba4ov7tLNYfWJivN59tNK0IEgjzBIDdX mxX2kHJ0p1W4GWlF6lgY1ufZDp6+D82ThRclXBMK2jA1eiQfep+EAFAUn/eKgrUA4GAY Q/uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=gYb3KN+/fTI9gK8vjfzeT3EHNTZtEg/kE+jumQaOghg=; b=cB97/ERk+B0h4bpAQknef2ikG2QbK4TVMAlG/U5Lcib1e22AIbKe44zZnJYEM88Vyk X5w6kMTrLXsH7nRl0CWx6NmHOG5AClwnC1oUZAAmCXlEoHko5Iw3zm4VnWqF75ItBPHk NmuULr+eI9KcQM7V2Gx8WnFg6g45q4cRR2QBvfJTFmFxkC3ep1QwLyrmaMUwXskQXZ+A OhPwU/eFn5CjwbTZL1yB8HTJX/eflYfk/dEGDTHVq/Ti0yCYrTy40n79dMvyk+1nFd/Q /zjmppI8ISjyL6EyxT9qUwUP5f2rBGESarRBf8cMxhQiN0Q8BRtJVW/N1zkDamkSm3JZ 2oBA== 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 j10-v6si578907pgi.223.2018.10.03.00.11.26; Wed, 03 Oct 2018 00:11:41 -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; 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 S1726693AbeJCN6Q (ORCPT + 99 others); Wed, 3 Oct 2018 09:58:16 -0400 Received: from mail.bootlin.com ([62.4.15.54]:55537 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726521AbeJCN6Q (ORCPT ); Wed, 3 Oct 2018 09:58:16 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id DAF1E207EB; Wed, 3 Oct 2018 09:11:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (AAubervilliers-681-1-24-95.w90-88.abo.wanadoo.fr [90.88.144.95]) by mail.bootlin.com (Postfix) with ESMTPSA id 8F5DA207C8; Wed, 3 Oct 2018 09:10:58 +0200 (CEST) Date: Wed, 3 Oct 2018 09:10:58 +0200 From: Boris Brezillon To: Yogesh Gaur Cc: linux-mtd@lists.infradead.org, frieder.schrempf@exceet.de, computersforpeace@gmail.com, david.wolfe@nxp.com, han.xu@nxp.com, festevam@gmail.com, marek.vasut@gmail.com, prabhakar.kushwaha@nxp.com, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: spi-nor: Support controllers with limited TX FIFO size Message-ID: <20181003091058.07a13965@bbrezillon> In-Reply-To: <1528870092-14526-1-git-send-email-yogeshnarayan.gaur@nxp.com> References: <1528870092-14526-1-git-send-email-yogeshnarayan.gaur@nxp.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Jun 2018 11:38:12 +0530 Yogesh Gaur wrote: > Some SPI controllers can't write nor->page_size bytes in a single > step because their TX FIFO is too small. > > Allow nor->write() to return a size that is smaller than the requested > write size to gracefully handle this case. > > Signed-off-by: Yogesh Gaur Queued to spi-nor/next. Thanks, Boris > --- > drivers/mtd/spi-nor/spi-nor.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > index 5bfa36e..3e63543 100644 > --- a/drivers/mtd/spi-nor/spi-nor.c > +++ b/drivers/mtd/spi-nor/spi-nor.c > @@ -1431,13 +1431,6 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len, > goto write_err; > *retlen += written; > i += written; > - if (written != page_remain) { > - dev_err(nor->dev, > - "While writing %zu bytes written %zd bytes\n", > - page_remain, written); > - ret = -EIO; > - goto write_err; > - } > } > > write_err: