* [PATCH AUTOSEL 5.10 2/8] usb: storage: sddr55: fix sloppy typing in sddr55_{read|write}_data()
2024-04-03 17:19 [PATCH AUTOSEL 5.10 1/8] tools: iio: replace seekdir() in iio_generic_buffer Sasha Levin
@ 2024-04-03 17:19 ` Sasha Levin
2024-04-03 17:19 ` [PATCH AUTOSEL 5.10 3/8] usb: typec: tcpci: add generic tcpci fallback compatible Sasha Levin
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2024-04-03 17:19 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Karina Yankevich, Sergey Shtylyov, Alan Stern, Greg Kroah-Hartman,
Sasha Levin, linux-usb, usb-storage
From: Karina Yankevich <k.yankevich@omp.ru>
[ Upstream commit d6429a3555fb29f380c5841a12f5ac3f7444af03 ]
In sddr55_{read|write}_data(), the address variables are needlessly typed
as *unsigned long* -- which is 32-bit type on the 32-bit arches and 64-bit
type on the 64-bit arches; those variables' value should fit into just 3
command bytes and consists of 10-bit block # (or at least the max block #
seems to be 1023) and 4-/5-bit page # within a block, so 32-bit *unsigned*
*int* type should be more than enough...
Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.
[Sergey: rewrote the patch subject/description]
Signed-off-by: Karina Yankevich <k.yankevich@omp.ru>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/4c9485f2-0bfc-591b-bfe7-2059289b554e@omp.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/storage/sddr55.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c
index 15dc25801cdcc..0aa079405d23c 100644
--- a/drivers/usb/storage/sddr55.c
+++ b/drivers/usb/storage/sddr55.c
@@ -196,7 +196,7 @@ static int sddr55_read_data(struct us_data *us,
unsigned char *buffer;
unsigned int pba;
- unsigned long address;
+ unsigned int address;
unsigned short pages;
unsigned int len, offset;
@@ -316,7 +316,7 @@ static int sddr55_write_data(struct us_data *us,
unsigned int pba;
unsigned int new_pba;
- unsigned long address;
+ unsigned int address;
unsigned short pages;
int i;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH AUTOSEL 5.10 3/8] usb: typec: tcpci: add generic tcpci fallback compatible
2024-04-03 17:19 [PATCH AUTOSEL 5.10 1/8] tools: iio: replace seekdir() in iio_generic_buffer Sasha Levin
2024-04-03 17:19 ` [PATCH AUTOSEL 5.10 2/8] usb: storage: sddr55: fix sloppy typing in sddr55_{read|write}_data() Sasha Levin
@ 2024-04-03 17:19 ` Sasha Levin
2024-04-03 17:19 ` [PATCH AUTOSEL 5.10 4/8] usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined Sasha Levin
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2024-04-03 17:19 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Marco Felsch, Heikki Krogerus, Greg Kroah-Hartman, Sasha Levin,
rdbabiera, u.kleine-koenig, linux-usb
From: Marco Felsch <m.felsch@pengutronix.de>
[ Upstream commit 8774ea7a553e2aec323170d49365b59af0a2b7e0 ]
The driver already support the tcpci binding for the i2c_device_id so
add the support for the of_device_id too.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240222210903.208901-3-m.felsch@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/typec/tcpm/tcpci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c
index e34e46df80243..33c67adf7c67a 100644
--- a/drivers/usb/typec/tcpm/tcpci.c
+++ b/drivers/usb/typec/tcpm/tcpci.c
@@ -732,6 +732,7 @@ MODULE_DEVICE_TABLE(i2c, tcpci_id);
#ifdef CONFIG_OF
static const struct of_device_id tcpci_of_match[] = {
{ .compatible = "nxp,ptn5110", },
+ { .compatible = "tcpci", },
{},
};
MODULE_DEVICE_TABLE(of, tcpci_of_match);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH AUTOSEL 5.10 4/8] usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined
2024-04-03 17:19 [PATCH AUTOSEL 5.10 1/8] tools: iio: replace seekdir() in iio_generic_buffer Sasha Levin
2024-04-03 17:19 ` [PATCH AUTOSEL 5.10 2/8] usb: storage: sddr55: fix sloppy typing in sddr55_{read|write}_data() Sasha Levin
2024-04-03 17:19 ` [PATCH AUTOSEL 5.10 3/8] usb: typec: tcpci: add generic tcpci fallback compatible Sasha Levin
@ 2024-04-03 17:19 ` Sasha Levin
2024-04-03 17:19 ` [PATCH AUTOSEL 5.10 5/8] ASoC: soc-core.c: Skip dummy codec when adding platforms Sasha Levin
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2024-04-03 17:19 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Colin Ian King, Greg Kroah-Hartman, Sasha Levin, nathan,
u.kleine-koenig, linux-usb, llvm
From: Colin Ian King <colin.i.king@gmail.com>
[ Upstream commit 12f371e2b6cb4b79c788f1f073992e115f4ca918 ]
Function checkdone is only required if QUIRK2 is defined, so add
appropriate #if / #endif around the function.
Cleans up clang scan build warning:
drivers/usb/host/sl811-hcd.c:588:18: warning: unused function
'checkdone' [-Wunused-function]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240307111351.1982382-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/host/sl811-hcd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 9465fce99c822..f803079a9f263 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -585,6 +585,7 @@ done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank)
finish_request(sl811, ep, urb, urbstat);
}
+#ifdef QUIRK2
static inline u8 checkdone(struct sl811 *sl811)
{
u8 ctl;
@@ -616,6 +617,7 @@ static inline u8 checkdone(struct sl811 *sl811)
#endif
return irqstat;
}
+#endif
static irqreturn_t sl811h_irq(struct usb_hcd *hcd)
{
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH AUTOSEL 5.10 5/8] ASoC: soc-core.c: Skip dummy codec when adding platforms
2024-04-03 17:19 [PATCH AUTOSEL 5.10 1/8] tools: iio: replace seekdir() in iio_generic_buffer Sasha Levin
` (2 preceding siblings ...)
2024-04-03 17:19 ` [PATCH AUTOSEL 5.10 4/8] usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined Sasha Levin
@ 2024-04-03 17:19 ` Sasha Levin
2024-04-03 17:20 ` [PATCH AUTOSEL 5.10 6/8] fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2 Sasha Levin
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2024-04-03 17:19 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Chancel Liu, Zhipeng Wang, Mark Brown, Sasha Levin, lgirdwood,
perex, tiwai, linux-sound
From: Chancel Liu <chancel.liu@nxp.com>
[ Upstream commit 23fb6bc2696119391ec3a92ccaffe50e567c515e ]
When pcm_runtime is adding platform components it will scan all
registered components. In case of DPCM FE/BE some DAI links will
configure dummy platform. However both dummy codec and dummy platform
are using "snd-soc-dummy" as component->name. Dummy codec should be
skipped when adding platforms otherwise there'll be overflow and UBSAN
complains.
Reported-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://msgid.link/r/20240305065606.3778642-1-chancel.liu@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/soc-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index e9da95ebccc83..af4e678ba17b9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1041,6 +1041,9 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card,
if (!snd_soc_is_matching_component(platform, component))
continue;
+ if (snd_soc_component_is_dummy(component) && component->num_dai)
+ continue;
+
snd_soc_rtd_add_component(rtd, component);
}
}
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH AUTOSEL 5.10 6/8] fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2
2024-04-03 17:19 [PATCH AUTOSEL 5.10 1/8] tools: iio: replace seekdir() in iio_generic_buffer Sasha Levin
` (3 preceding siblings ...)
2024-04-03 17:19 ` [PATCH AUTOSEL 5.10 5/8] ASoC: soc-core.c: Skip dummy codec when adding platforms Sasha Levin
@ 2024-04-03 17:20 ` Sasha Levin
2024-04-03 17:20 ` [PATCH AUTOSEL 5.10 7/8] drivers/nvme: Add quirks for device 126f:2262 Sasha Levin
2024-04-03 17:20 ` [PATCH AUTOSEL 5.10 8/8] fbmon: prevent division by zero in fb_videomode_from_videomode() Sasha Levin
6 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2024-04-03 17:20 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Aleksandr Burakov, Helge Deller, Sasha Levin, FlorianSchandinat,
linux-fbdev, dri-devel
From: Aleksandr Burakov <a.burakov@rosalinux.ru>
[ Upstream commit bc87bb342f106a0402186bcb588fcbe945dced4b ]
There are some actions with value 'tmp' but 'dst_addr' is checked instead.
It is obvious that a copy-paste error was made here and the value
of variable 'tmp' should be checked here.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Aleksandr Burakov <a.burakov@rosalinux.ru>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/via/accel.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/via/accel.c b/drivers/video/fbdev/via/accel.c
index 0a1bc7a4d7853..1e04026f08091 100644
--- a/drivers/video/fbdev/via/accel.c
+++ b/drivers/video/fbdev/via/accel.c
@@ -115,7 +115,7 @@ static int hw_bitblt_1(void __iomem *engine, u8 op, u32 width, u32 height,
if (op != VIA_BITBLT_FILL) {
tmp = src_mem ? 0 : src_addr;
- if (dst_addr & 0xE0000007) {
+ if (tmp & 0xE0000007) {
printk(KERN_WARNING "hw_bitblt_1: Unsupported source "
"address %X\n", tmp);
return -EINVAL;
@@ -260,7 +260,7 @@ static int hw_bitblt_2(void __iomem *engine, u8 op, u32 width, u32 height,
writel(tmp, engine + 0x18);
tmp = src_mem ? 0 : src_addr;
- if (dst_addr & 0xE0000007) {
+ if (tmp & 0xE0000007) {
printk(KERN_WARNING "hw_bitblt_2: Unsupported source "
"address %X\n", tmp);
return -EINVAL;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH AUTOSEL 5.10 7/8] drivers/nvme: Add quirks for device 126f:2262
2024-04-03 17:19 [PATCH AUTOSEL 5.10 1/8] tools: iio: replace seekdir() in iio_generic_buffer Sasha Levin
` (4 preceding siblings ...)
2024-04-03 17:20 ` [PATCH AUTOSEL 5.10 6/8] fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2 Sasha Levin
@ 2024-04-03 17:20 ` Sasha Levin
2024-04-03 17:20 ` [PATCH AUTOSEL 5.10 8/8] fbmon: prevent division by zero in fb_videomode_from_videomode() Sasha Levin
6 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2024-04-03 17:20 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Jiawei Fu (iBug), Christoph Hellwig, Sagi Grimberg, Keith Busch,
Sasha Levin, linux-nvme
From: "Jiawei Fu (iBug)" <i@ibugone.com>
[ Upstream commit e89086c43f0500bc7c4ce225495b73b8ce234c1f ]
This commit adds NVME_QUIRK_NO_DEEPEST_PS and NVME_QUIRK_BOGUS_NID for
device [126f:2262], which appears to be a generic VID:PID pair used for
many SSDs based on the Silicon Motion SM2262/SM2262EN controller.
Two of my SSDs with this VID:PID pair exhibit the same behavior:
* They frequently have trouble exiting the deepest power state (5),
resulting in the entire disk unresponsive.
Verified by setting nvme_core.default_ps_max_latency_us=10000 and
observing them behaving normally.
* They produce all-zero nguid and eui64 with `nvme id-ns` command.
The offending products are:
* HP SSD EX950 1TB
* HIKVISION C2000Pro 2TB
Signed-off-by: Jiawei Fu <i@ibugone.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/pci.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 970a1b374a669..5242feda5471a 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3199,6 +3199,9 @@ static const struct pci_device_id nvme_id_table[] = {
NVME_QUIRK_BOGUS_NID, },
{ PCI_VDEVICE(REDHAT, 0x0010), /* Qemu emulated controller */
.driver_data = NVME_QUIRK_BOGUS_NID, },
+ { PCI_DEVICE(0x126f, 0x2262), /* Silicon Motion generic */
+ .driver_data = NVME_QUIRK_NO_DEEPEST_PS |
+ NVME_QUIRK_BOGUS_NID, },
{ PCI_DEVICE(0x126f, 0x2263), /* Silicon Motion unidentified */
.driver_data = NVME_QUIRK_NO_NS_DESC_LIST, },
{ PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH AUTOSEL 5.10 8/8] fbmon: prevent division by zero in fb_videomode_from_videomode()
2024-04-03 17:19 [PATCH AUTOSEL 5.10 1/8] tools: iio: replace seekdir() in iio_generic_buffer Sasha Levin
` (5 preceding siblings ...)
2024-04-03 17:20 ` [PATCH AUTOSEL 5.10 7/8] drivers/nvme: Add quirks for device 126f:2262 Sasha Levin
@ 2024-04-03 17:20 ` Sasha Levin
6 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2024-04-03 17:20 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Roman Smirnov, Sergey Shtylyov, Helge Deller, Sasha Levin, daniel,
linux-fbdev, dri-devel
From: Roman Smirnov <r.smirnov@omp.ru>
[ Upstream commit c2d953276b8b27459baed1277a4fdd5dd9bd4126 ]
The expression htotal * vtotal can have a zero value on
overflow. It is necessary to prevent division by zero like in
fb_var_to_videomode().
Found by Linux Verification Center (linuxtesting.org) with Svace.
Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/core/fbmon.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 1bf82dbc9e3cf..3c29a5eb43805 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -1311,7 +1311,7 @@ int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, struct fb_inf
int fb_videomode_from_videomode(const struct videomode *vm,
struct fb_videomode *fbmode)
{
- unsigned int htotal, vtotal;
+ unsigned int htotal, vtotal, total;
fbmode->xres = vm->hactive;
fbmode->left_margin = vm->hback_porch;
@@ -1344,8 +1344,9 @@ int fb_videomode_from_videomode(const struct videomode *vm,
vtotal = vm->vactive + vm->vfront_porch + vm->vback_porch +
vm->vsync_len;
/* prevent division by zero */
- if (htotal && vtotal) {
- fbmode->refresh = vm->pixelclock / (htotal * vtotal);
+ total = htotal * vtotal;
+ if (total) {
+ fbmode->refresh = vm->pixelclock / total;
/* a mode must have htotal and vtotal != 0 or it is invalid */
} else {
fbmode->refresh = 0;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread