linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org,
	Helmut Schaa <helmut.schaa@googlemail.com>,
	Pekon Gupta <pekon@ti.com>, Scott Wood <scottwood@freescale.com>,
	Brian Norris <computersforpeace@gmail.com>
Subject: [PATCH 3.10 13/53] mtd: eLBC NAND: fix subpage write support
Date: Mon,  7 Jul 2014 16:57:58 -0700	[thread overview]
Message-ID: <20140707235829.694197476@linuxfoundation.org> (raw)
In-Reply-To: <20140707235829.281783607@linuxfoundation.org>

3.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pekon Gupta <pekon@ti.com>

commit f034d87def51f026b735d1e2877e9387011b2ba3 upstream.

As subpage write is enabled by default for all drivers, nand_write_subpage_hwecc
causes a crash if the driver did not register ecc->hwctl or ecc->calculate.
This behavior was introduced in
   commit 837a6ba4f3b6d23026674e6af6b6849a4634fff9
   "mtd: nand: subpage write support for hardware based ECC schemes".

This fixes a crash by emulating subpage write support by padding sub-page data
with 0xff on either sides to make it full page compatible.

Reported-by: Helmut Schaa <helmut.schaa@googlemail.com>
Tested-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Pekon Gupta <pekon@ti.com>
Reviewed-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mtd/nand/fsl_elbc_nand.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -725,6 +725,19 @@ static int fsl_elbc_write_page(struct mt
 	return 0;
 }
 
+/* ECC will be calculated automatically, and errors will be detected in
+ * waitfunc.
+ */
+static int fsl_elbc_write_subpage(struct mtd_info *mtd, struct nand_chip *chip,
+				uint32_t offset, uint32_t data_len,
+				const uint8_t *buf, int oob_required)
+{
+	fsl_elbc_write_buf(mtd, buf, mtd->writesize);
+	fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize);
+
+	return 0;
+}
+
 static int fsl_elbc_chip_init(struct fsl_elbc_mtd *priv)
 {
 	struct fsl_lbc_ctrl *ctrl = priv->ctrl;
@@ -763,6 +776,7 @@ static int fsl_elbc_chip_init(struct fsl
 
 	chip->ecc.read_page = fsl_elbc_read_page;
 	chip->ecc.write_page = fsl_elbc_write_page;
+	chip->ecc.write_subpage = fsl_elbc_write_subpage;
 
 	/* If CS Base Register selects full hardware ECC then use it */
 	if ((in_be32(&lbc->bank[priv->bank].br) & BR_DECC) ==



  parent reply	other threads:[~2014-07-08  0:21 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 23:57 [PATCH 3.10 00/53] 3.10.48-stable review Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 01/53] ibmvscsi: Abort init sequence during error recovery Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 02/53] ibmvscsi: Add memory barriers for send / receive Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 03/53] virtio-scsi: avoid cancelling uninitialized work items Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 04/53] virtio-scsi: fix various bad behavior on aborted requests Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 05/53] xhci: correct burst count field for isoc transfers on 1.0 xhci hosts Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 06/53] xhci: Fix runtime suspended xhci from blocking system suspend Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 07/53] USB: option: add device ID for SpeedUp SU9800 usb 3g modem Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 09/53] USB: ftdi_sio: fix null deref at port probe Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 11/53] rt2x00: disable TKIP on USB Greg Kroah-Hartman
2014-07-07 23:57 ` [PATCH 3.10 12/53] rt2x00: fix rfkill regression on rt2500pci Greg Kroah-Hartman
2014-07-07 23:57 ` Greg Kroah-Hartman [this message]
2014-07-07 23:57 ` [PATCH 3.10 14/53] mtd: nand: omap: fix BCHx ecc.correct to return detected bit-flips in erased-page Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 15/53] drm/radeon: only apply hdmi bpc pll flags when encoder mode is hdmi Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 16/53] drm/radeon: fix typo in radeon_connector_is_dp12_capable() Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 17/53] drm/radeon/dp: fix lane/clock setup for dp 1.2 capable devices Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 18/53] drm/radeon/atom: fix dithering on certain panels Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 20/53] drm/vmwgfx: Fix incorrect write to read-only register v2: Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 21/53] Bluetooth: Fix SSP acceptor just-works confirmation without MITM Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 22/53] Bluetooth: Fix check for connection encryption Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 23/53] Bluetooth: Fix locking of hdev when calling into SMP code Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 24/53] dm thin: update discard_granularity to reflect the thin-pool blocksize Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 25/53] rbd: use reference counts for image requests Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 26/53] rbd: handle parent_overlap on writes correctly Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 27/53] hwmon: (ina2xx) Cast to s16 on shunt and current regs Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 28/53] mac80211: dont check netdev state for debugfs read/write Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 30/53] iwlwifi: pcie: try to get ownership several times Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 31/53] ARM: OMAP2+: Fix parser-bug in platform muxing code Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 34/53] CIFS: fix mount failure with broken pathnames when smb3 mount with mapchars option Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 35/53] ext4: Fix buffer double free in ext4_alloc_branch() Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 36/53] ext4: Fix hole punching for files with indirect blocks Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 37/53] KVM: x86: Increase the number of fixed MTRR regs to 10 Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 38/53] KVM: x86: preserve the high 32-bits of the PAT register Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 39/53] iio: of_iio_channel_get_by_name() returns non-null pointers for error legs Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 40/53] nfsd: fix rare symlink decoding bug Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 41/53] tools: ffs-test: fix header values endianess Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 42/53] tracing: Remove ftrace_stop/start() from reading the trace file Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 43/53] md: flush writes before starting a recovery Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 44/53] irqchip: spear_shirq: Fix interrupt offset Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 45/53] mmc: rtsx: add R1-no-CRC mmc command type handle Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 46/53] serial: 8250_dw: Report CTS asserted for auto flow Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 47/53] serial: 8250_dw: Improve unwritable LCR workaround Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 48/53] serial: 8250_dw: Fix LCR workaround regression Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 49/53] ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb() Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 50/53] ALSA: usb-audio: Prevent printk ratelimiting from spamming kernel log while DEBUG not defined Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 51/53] arch/unicore32/mm/alignment.c: include "asm/pgtable.h" to avoid compiling error Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 52/53] drivers/video/fbdev/fb-puv3.c: Add header files for function unifb_mmap Greg Kroah-Hartman
2014-07-07 23:58 ` [PATCH 3.10 53/53] sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue Greg Kroah-Hartman
2014-07-08 13:19 ` [PATCH 3.10 00/53] 3.10.48-stable review Guenter Roeck
2014-07-08 22:15   ` Greg Kroah-Hartman
2014-07-09 10:21     ` Luis Henriques
2014-07-15  0:59     ` Greg Kroah-Hartman
2014-07-08 19:31 ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140707235829.694197476@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=computersforpeace@gmail.com \
    --cc=helmut.schaa@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pekon@ti.com \
    --cc=scottwood@freescale.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).