Commit a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple
of physical block size") split one conditional into several separate
statements in an effort to provide more accurate warning messages when
a device reports a nonsensical value. However, this reorganization
accidentally dropped the precondition of the reported value being
larger than zero. This lead to a warning getting emitted on devices
that do not report an optimal I/O size at all.
Remain silent if a device does not report an optimal I/O size.
Fixes: a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple of physical block size")
Reported-by: Hussam Al-Tayeb <ht990332(a)gmx.com>
Cc: Randy Dunlap <rdunlap(a)infradead.org>
Cc: <stable(a)vger.kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com>
---
drivers/scsi/sd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 9d8e15d03d2b..87d542de2db7 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3074,6 +3074,9 @@ static bool sd_validate_opt_xfer_size(struct scsi_disk *sdkp,
unsigned int opt_xfer_bytes =
logical_to_bytes(sdp, sdkp->opt_xfer_blocks);
+ if (sdkp->opt_xfer_blocks == 0)
+ return false;
+
if (sdkp->opt_xfer_blocks > dev_max) {
sd_first_printk(KERN_WARNING, sdkp,
"Optimal transfer size %u logical blocks " \
--
2.21.0
Here is a set of small fixes that we would like to land in the rc cycle
for 5.1. One of them is marked as stable.
The first patch fixes an unnecessary stack trace due to incorrect WQ flags. The
next three fix issues uncovered due to TID RDMA which was brought in for 5.1.
The last one is a bug in VNIC.
---
Kaike Wan (4):
IB/hfi1: Failed to drain send queue when QP is put into error state
IB/hfi1: Clear the IOWAIT pending bits when QP is put into error state
IB/hfi1: Eliminate opcode tests on mr deref
IB/hfi1: Fix the allocation of RSM table
Mike Marciniszyn (1):
IB/hfi1: Fix WQ_MEM_RECLAIM warning
drivers/infiniband/hw/hfi1/chip.c | 26 +++++++++++++++++++-------
drivers/infiniband/hw/hfi1/init.c | 3 ++-
drivers/infiniband/hw/hfi1/qp.c | 4 +++-
drivers/infiniband/hw/hfi1/rc.c | 4 ++--
4 files changed, 26 insertions(+), 11 deletions(-)
--
-Denny
On Wed, Mar 27, 2019 at 02:00:54PM +0000, Sasha Levin wrote:
> Hi,
>
> [This is an automated email]
>
> This commit has been processed because it contains a -stable tag.
> The stable tag indicates that it's relevant for the following trees: all
>
> The bot has tested the following trees: v5.0.4, v4.19.31, v4.14.108, v4.9.165, v4.4.177, v3.18.137.
>
> v5.0.4: Build OK!
> v4.19.31: Build OK!
> v4.14.108: Failed to apply! Possible dependencies:
> 6840962b0a19 ("ASoC: intel: atom: replace platform to component")
>
> v4.9.165: Failed to apply! Possible dependencies:
> 6840962b0a19 ("ASoC: intel: atom: replace platform to component")
> 80cc4df8b46e ("ASoC: Intel: make snd_soc_platform_driver const")
>
> v4.4.177: Failed to apply! Possible dependencies:
> 6840962b0a19 ("ASoC: intel: atom: replace platform to component")
> 80cc4df8b46e ("ASoC: Intel: make snd_soc_platform_driver const")
>
> v3.18.137: Failed to apply! Possible dependencies:
> 026da220c512 ("ASoC: Intel: Add Cherrytrail & Braswell machine driver cht_bsw_rt5672")
> 0505700104cd ("ASoC: Intel: Add support for decoupled mode in skl driver")
> 0fbc7d732020 ("ASoC: Intel: sst: Add makefile and kconfig changes")
> 17119a465706 ("ASoC: Intel: Add Cherrytrail & Braswell machine driver cht_bsw_max98090_ti")
> 24c8d14192cc ("ASoC: Intel: mrfld: add DSP core controls")
> 29e1812d7611 ("ASoC: Intel: mrfld - remove unnecessary check for pointer")
> 369a9f5f397f ("ASoC: Intel: fix machine driver warnings")
> 3af36706ff6c ("ASoC: Intel: Skylake: Add topology core init and handlers")
> 4fa805738e49 ("ASoC: Intel: mrfld: add the gain controls")
> 54e6beccc671 ("ASoC: Intel: add support for platform suspend")
> 6840962b0a19 ("ASoC: intel: atom: replace platform to component")
> 80cc4df8b46e ("ASoC: Intel: make snd_soc_platform_driver const")
> 85c85e5d6d57 ("ASoC: broadwell: Register jacks at the card level")
> 996cc8494d66 ("ASoC: Intel: add BYTCR machine driver with RT5640")
> a40e693c7f5e ("ASoC: Intel: Add Skylake HDA platform driver")
> b663a8c5c9c0 ("ASoC: Intel: Skylake: Initialize and load DSP controls")
> c1e99c913be4 ("ASoC: Intel: Add jack detection for Broadwell")
> d8c2dab8381d ("ASoC: Intel: Add Skylake HDA audio driver")
> e18acdc04ab2 ("ASoC: Intel: Add Cherrytrail & Braswell machine driver cht_bsw_rt5645")
> e4f5ccd050e5 ("ASoC: Intel: mrfld: add the DSP DAPM widgets")
> e56c72d5f201 ("ASoC: Intel: create boards folder and move sst boards files in")
> eb965e3686f5 ("ASoC: Intel: Add makefile support for SKL driver")
>
>
> How should we proceed with this patch?
>
This needs a backport to older kernel versions to take the missing
commit 6840962b0a19 into account. I'll be happy to provide that after
this patch is available in mainline (afaics that is not yet the case).
Guenter
This is a note to let you know that I've just added the patch titled
tty: pty: Fix race condition between release_one_tty and pty_write
to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-testing branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will be merged to the tty-next branch sometime soon,
after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
>From b9ca5f8560af244489b4a1bc1ae88b341f24bc95 Mon Sep 17 00:00:00 2001
From: Sahara <keun-o.park(a)darkmatter.ae>
Date: Mon, 11 Feb 2019 11:09:15 +0400
Subject: tty: pty: Fix race condition between release_one_tty and pty_write
Especially when a linked tty is used such as pty, the linked tty
port's buf works have not been cancelled while master tty port's
buf work has been cancelled. Since release_one_tty and flush_to_ldisc
run in workqueue threads separately, when pty_cleanup happens and
link tty port is freed, flush_to_ldisc tries to access freed port
and port->itty, eventually it causes a panic.
This patch utilizes the magic value with holding the tty_mutex to
check if the tty->link is valid.
Fixes: 2b022ab7542d ("pty: cancel pty slave port buf's work in tty_release")
Signed-off-by: Sahara <keun-o.park(a)darkmatter.ae>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/tty/pty.c | 7 +++++++
drivers/tty/tty_io.c | 3 +++
2 files changed, 10 insertions(+)
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 00099a8439d2..ef72031ab5b9 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -116,6 +116,12 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
if (tty->stopped)
return 0;
+ mutex_lock(&tty_mutex);
+ if (to->magic != TTY_MAGIC) {
+ mutex_unlock(&tty_mutex);
+ return -EIO;
+ }
+
if (c > 0) {
spin_lock_irqsave(&to->port->lock, flags);
/* Stuff the data into the input queue of the other end */
@@ -125,6 +131,7 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
tty_flip_buffer_push(to->port);
spin_unlock_irqrestore(&to->port->lock, flags);
}
+ mutex_unlock(&tty_mutex);
return c;
}
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 5fa250157025..c27777f3b8c4 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1448,10 +1448,13 @@ static void release_one_tty(struct work_struct *work)
struct tty_driver *driver = tty->driver;
struct module *owner = driver->owner;
+ mutex_lock(&tty_mutex);
if (tty->ops->cleanup)
tty->ops->cleanup(tty);
tty->magic = 0;
+ mutex_unlock(&tty_mutex);
+
tty_driver_kref_put(driver);
module_put(owner);
--
2.21.0
This is a note to let you know that I've just added the patch titled
tty: vt.c: Fix TIOCL_BLANKSCREEN console blanking if blankinterval ==
to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-testing branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will be merged to the tty-next branch sometime soon,
after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
>From 75ddbc1fb11efac87b611d48e9802f6fe2bb2163 Mon Sep 17 00:00:00 2001
From: Yifeng Li <tomli(a)tomli.me>
Date: Tue, 5 Mar 2019 07:02:49 +0800
Subject: tty: vt.c: Fix TIOCL_BLANKSCREEN console blanking if blankinterval ==
0
Previously, in the userspace, it was possible to use the "setterm" command
from util-linux to blank the VT console by default, using the following
command.
According to the man page,
> The force option keeps the screen blank even if a key is pressed.
It was implemented by calling TIOCL_BLANKSCREEN.
case BLANKSCREEN:
ioctlarg = TIOCL_BLANKSCREEN;
if (ioctl(STDIN_FILENO, TIOCLINUX, &ioctlarg))
warn(_("cannot force blank"));
break;
However, after Linux 4.12, this command ceased to work anymore, which is
unexpected. By inspecting the kernel source, it shows that the issue was
triggered by the side-effect from commit a4199f5eb809 ("tty: Disable
default console blanking interval").
The console blanking is implemented by function do_blank_screen() in vt.c:
"blank_state" will be initialized to "blank_normal_wait" in con_init() if
AND ONLY IF ("blankinterval" > 0). If "blankinterval" is 0, "blank_state"
will be "blank_off" (== 0), and a call to do_blank_screen() will always
abort, even if a forced blanking is required from the user by calling
TIOCL_BLANKSCREEN, the console won't be blanked.
This behavior is unexpected from a user's point-of-view, since it's not
mentioned in any documentation. The setterm man page suggests it will
always work, and the kernel comments in uapi/linux/tiocl.h says
> /* keep screen blank even if a key is pressed */
> #define TIOCL_BLANKSCREEN 14
To fix it, we simply remove the "blank_state != blank_off" check, as
pointed out by Nicolas Pitre, this check doesn't logically make sense
and it's safe to remove.
Suggested-by: Nicolas Pitre <nicolas.pitre(a)linaro.org>
Fixes: a4199f5eb809 ("tty: Disable default console blanking interval")
Signed-off-by: Yifeng Li <tomli(a)tomli.me>
Cc: stable <stable(a)vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/tty/vt/vt.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index d34984aa646d..721edee50234 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -4178,8 +4178,6 @@ void do_blank_screen(int entering_gfx)
return;
}
- if (blank_state != blank_normal_wait)
- return;
blank_state = blank_off;
/* don't blank graphics */
--
2.21.0
This is a note to let you know that I've just added the patch titled
Disable kgdboc failed by echo space to
to my tty git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
in the tty-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 3ec8002951ea173e24b466df1ea98c56b7920e63 Mon Sep 17 00:00:00 2001
From: Wentao Wang <witallwang(a)gmail.com>
Date: Wed, 20 Mar 2019 15:30:39 +0000
Subject: Disable kgdboc failed by echo space to
/sys/module/kgdboc/parameters/kgdboc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Echo "" to /sys/module/kgdboc/parameters/kgdboc will fail with "No such
device” error.
This is caused by function "configure_kgdboc" who init err to ENODEV
when the config is empty (legal input) the code go out with ENODEV
returned.
Fixes: 2dd453168643 ("kgdboc: Fix restrict error")
Signed-off-by: Wentao Wang <witallwang(a)gmail.com>
Cc: stable <stable(a)vger.kernel.org>
Acked-by: Daniel Thompson <daniel.thompson(a)linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/tty/serial/kgdboc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c
index 6fb312e7af71..bfe5e9e034ec 100644
--- a/drivers/tty/serial/kgdboc.c
+++ b/drivers/tty/serial/kgdboc.c
@@ -148,8 +148,10 @@ static int configure_kgdboc(void)
char *cptr = config;
struct console *cons;
- if (!strlen(config) || isspace(config[0]))
+ if (!strlen(config) || isspace(config[0])) {
+ err = 0;
goto noconfig;
+ }
kgdboc_io_ops.is_console = 0;
kgdb_tty_driver = NULL;
--
2.21.0