From: Greg Kroah-Hartman Date: Tue, 28 Nov 2017 08:44:06 +0000 (+0100) Subject: 3.18-stable patches X-Git-Tag: v3.18.85~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a82ba1147da714cc33037e6db85a1c2b9f80676;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: mtd-nand-fix-writing-mtdoops-to-nand-flash.patch net-9p-switch-to-wait_event_killable.patch --- diff --git a/queue-3.18/mtd-nand-fix-writing-mtdoops-to-nand-flash.patch b/queue-3.18/mtd-nand-fix-writing-mtdoops-to-nand-flash.patch new file mode 100644 index 00000000000..ed4290b078a --- /dev/null +++ b/queue-3.18/mtd-nand-fix-writing-mtdoops-to-nand-flash.patch @@ -0,0 +1,51 @@ +From 30863e38ebeb500a31cecee8096fb5002677dd9b Mon Sep 17 00:00:00 2001 +From: Brent Taylor +Date: Mon, 30 Oct 2017 22:32:45 -0500 +Subject: mtd: nand: Fix writing mtdoops to nand flash. + +From: Brent Taylor + +commit 30863e38ebeb500a31cecee8096fb5002677dd9b upstream. + +When mtdoops calls mtd_panic_write(), it eventually calls +panic_nand_write() in nand_base.c. In order to properly wait for the +nand chip to be ready in panic_nand_wait(), the chip must first be +selected. + +When using the atmel nand flash controller, a panic would occur due to +a NULL pointer exception. + +Fixes: 2af7c6539931 ("mtd: Add panic_write for NAND flashes") +Signed-off-by: Brent Taylor +Signed-off-by: Boris Brezillon +Signed-off-by: Greg Kroah-Hartman + + +--- + drivers/mtd/nand/nand_base.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/mtd/nand/nand_base.c ++++ b/drivers/mtd/nand/nand_base.c +@@ -2501,15 +2501,18 @@ static int panic_nand_write(struct mtd_i + size_t *retlen, const uint8_t *buf) + { + struct nand_chip *chip = mtd->priv; ++ int chipnr = (int)(to >> chip->chip_shift); + struct mtd_oob_ops ops; + int ret; + +- /* Wait for the device to get ready */ +- panic_nand_wait(mtd, chip, 400); +- + /* Grab the device */ + panic_nand_get_device(chip, mtd, FL_WRITING); + ++ chip->select_chip(mtd, chipnr); ++ ++ /* Wait for the device to get ready */ ++ panic_nand_wait(mtd, chip, 400); ++ + ops.len = len; + ops.datbuf = (uint8_t *)buf; + ops.oobbuf = NULL; diff --git a/queue-3.18/net-9p-switch-to-wait_event_killable.patch b/queue-3.18/net-9p-switch-to-wait_event_killable.patch new file mode 100644 index 00000000000..6f6bd4d90ea --- /dev/null +++ b/queue-3.18/net-9p-switch-to-wait_event_killable.patch @@ -0,0 +1,83 @@ +From 9523feac272ccad2ad8186ba4fcc89103754de52 Mon Sep 17 00:00:00 2001 +From: Tuomas Tynkkynen +Date: Wed, 6 Sep 2017 17:59:08 +0300 +Subject: net/9p: Switch to wait_event_killable() + +From: Tuomas Tynkkynen + +commit 9523feac272ccad2ad8186ba4fcc89103754de52 upstream. + +Because userspace gets Very Unhappy when calls like stat() and execve() +return -EINTR on 9p filesystem mounts. For instance, when bash is +looking in PATH for things to execute and some SIGCHLD interrupts +stat(), bash can throw a spurious 'command not found' since it doesn't +retry the stat(). + +In practice, hitting the problem is rare and needs a really +slow/bogged down 9p server. + +Signed-off-by: Tuomas Tynkkynen +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman + + +--- + net/9p/client.c | 3 +-- + net/9p/trans_virtio.c | 13 ++++++------- + 2 files changed, 7 insertions(+), 9 deletions(-) + +--- a/net/9p/client.c ++++ b/net/9p/client.c +@@ -753,8 +753,7 @@ p9_client_rpc(struct p9_client *c, int8_ + } + again: + /* Wait for the response */ +- err = wait_event_interruptible(*req->wq, +- req->status >= REQ_STATUS_RCVD); ++ err = wait_event_killable(*req->wq, req->status >= REQ_STATUS_RCVD); + + /* + * Make sure our req is coherent with regard to updates in other +--- a/net/9p/trans_virtio.c ++++ b/net/9p/trans_virtio.c +@@ -292,8 +292,8 @@ req_retry: + if (err == -ENOSPC) { + chan->ring_bufs_avail = 0; + spin_unlock_irqrestore(&chan->lock, flags); +- err = wait_event_interruptible(*chan->vc_wq, +- chan->ring_bufs_avail); ++ err = wait_event_killable(*chan->vc_wq, ++ chan->ring_bufs_avail); + if (err == -ERESTARTSYS) + return err; + +@@ -324,7 +324,7 @@ static int p9_get_mapped_pages(struct vi + * Other zc request to finish here + */ + if (atomic_read(&vp_pinned) >= chan->p9_max_pages) { +- err = wait_event_interruptible(vp_wq, ++ err = wait_event_killable(vp_wq, + (atomic_read(&vp_pinned) < chan->p9_max_pages)); + if (err == -ERESTARTSYS) + return err; +@@ -454,8 +454,8 @@ req_retry_pinned: + if (err == -ENOSPC) { + chan->ring_bufs_avail = 0; + spin_unlock_irqrestore(&chan->lock, flags); +- err = wait_event_interruptible(*chan->vc_wq, +- chan->ring_bufs_avail); ++ err = wait_event_killable(*chan->vc_wq, ++ chan->ring_bufs_avail); + if (err == -ERESTARTSYS) + goto err_out; + +@@ -472,8 +472,7 @@ req_retry_pinned: + virtqueue_kick(chan->vq); + spin_unlock_irqrestore(&chan->lock, flags); + p9_debug(P9_DEBUG_TRANS, "virtio request kicked\n"); +- err = wait_event_interruptible(*req->wq, +- req->status >= REQ_STATUS_RCVD); ++ err = wait_event_killable(*req->wq, req->status >= REQ_STATUS_RCVD); + /* + * Non kernel buffers are pinned, unpin them + */ diff --git a/queue-3.18/series b/queue-3.18/series index d8481c71475..3daac3401c8 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -44,3 +44,5 @@ powerpc-signal-properly-handle-return-value-from-uprobe_deny_signal.patch media-don-t-do-dma-on-stack-for-firmware-upload-in-the-as102-driver.patch media-rc-check-for-integer-overflow.patch media-v4l2-ctrl-fix-flags-field-on-control-events.patch +net-9p-switch-to-wait_event_killable.patch +mtd-nand-fix-writing-mtdoops-to-nand-flash.patch