fbdev: atyfb: only use ioremap_uc() on i386 and ia64
Subsystems (10)
Sasha Levin
maintainerPATCH 1/16 fbdev: atyfb: only use ioremap_uc() on i386 and ia64
From: Arnd Bergmann <[email protected]>
[ Upstream commit c1a8d1d0edb71dec15c9649cb56866c71c1ecd9e ]
ioremap_uc() is only meaningful on old x86-32 systems with the PAT extension, and on ia64 with its slightly unconventional ioremap() behavior, everywhere else this is the same as ioremap() anyway.
Change the only driver that still references ioremap_uc() to only do so on x86-32/ia64 in order to allow removing that interface at some point in the future for the other architectures.
On some architectures, ioremap_uc() just returns NULL, changing the driver to call ioremap() means that they now have a chance of working correctly.
--- drivers/video/fbdev/aty/atyfb_base.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/video/fbdev/aty/atyfb_base.c +4 -0
@@ -3440,11 +3440,15 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info, } info->fix.mmio_start = raddr; +#if defined(__i386__) || defined(__ia64__)/* * By using strong UC we force the MTRR to never have an * effect on the MMIO region on both non-PAT and PAT systems. */ par->ati_regbase =ioremap_uc (info->fix.mmio_start,0x1000 ); +#else + par->ati_regbase =ioremap (info->fix.mmio_start,0x1000 ); +#endif if (par->ati_regbase ==NULL )return -ENOMEM ;
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 2/16 spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0
From: "William A. Kennington III" <[email protected]>
[ Upstream commit 2ec8b010979036c2fe79a64adb6ecc0bd11e91d1 ]
We don't want to use the value of ilog2(0) as dummy.buswidth is 0 when dummy.nbytes is 0. Since we have no dummy bytes, we don't need to configure the dummy byte bits per clock register value anyway.
--- drivers/spi/spi-npcm-fiu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/spi/spi-npcm-fiu.c +3 -2
@@ -334,8 +334,9 @@ static int npcm_fiu_uma_read(struct spi_mem *mem, uma_cfg |=ilog2 (op->cmd.buswidth); uma_cfg |=ilog2 (op->addr.buswidth) <<NPCM_FIU_UMA_CFG_ADBPCK_SHIFT ; - uma_cfg |=ilog2 (op->dummy.buswidth) - <<NPCM_FIU_UMA_CFG_DBPCK_SHIFT ; +if (op->dummy.nbytes) + uma_cfg |=ilog2 (op->dummy.buswidth) + <<NPCM_FIU_UMA_CFG_DBPCK_SHIFT ; uma_cfg |=ilog2 (op->data.buswidth) <<NPCM_FIU_UMA_CFG_RDBPCK_SHIFT ; uma_cfg |= op->dummy.nbytes <<NPCM_FIU_UMA_CFG_DBSIZ_SHIFT ;
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 3/16 nvme-rdma: do not try to stop unallocated queues
In reply to Sasha LevinFrom: Maurizio Lombardi <[email protected]>
[ Upstream commit 3820c4fdc247b6f0a4162733bdb8ddf8f2e8a1e4 ]
Trying to stop a queue which hasn't been allocated will result in a warning due to calling mutex_lock() against an uninitialized mutex.
DEBUG_LOCKS_WARN_ON(lock->magic != lock)
WARNING: CPU: 4 PID: 104150 at kernel/locking/mutex.c:579 Call trace: RIP: 0010:__mutex_lock+0x1173/0x14a0 nvme_rdma_stop_queue+0x1b/0xa0 [nvme_rdma] nvme_rdma_teardown_io_queues.part.0+0xb0/0x1d0 [nvme_rdma] nvme_rdma_delete_ctrl+0x50/0x100 [nvme_rdma] nvme_do_delete_ctrl+0x149/0x158 [nvme_core]
--- drivers/nvme/host/rdma.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/host/rdma.c +3 -0
@@ -644,6 +644,9 @@ static void __nvme_rdma_stop_queue(struct nvme_rdma_queue *queue)static void nvme_rdma_stop_queue (struct nvme_rdma_queue *queue) { +if (!test_bit (NVME_RDMA_Q_ALLOCATED , &queue->flags)) +return ; +mutex_lock (&queue->queue_lock);if (test_and_clear_bit (NVME_RDMA_Q_LIVE , &queue->flags))__nvme_rdma_stop_queue (queue);
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 4/16 net: ipv6: fix return value check in esp_remove_trailer
In reply to Sasha LevinFrom: Ma Ke <[email protected]>
[ Upstream commit dad4e491e30b20f4dc615c9da65d2142d703b5c2 ]
In esp_remove_trailer(), to avoid an unexpected result returned by pskb_trim, we should check the return value of pskb_trim().
--- net/ipv6/esp6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv6/esp6.c +3 -1
@@ -776,7 +776,9 @@ static inline int esp_remove_trailer(struct sk_buff *skb) skb->csum =csum_block_sub (skb->csum, csumdiff, skb->len - trimlen); } -pskb_trim (skb, skb->len - trimlen); + ret =pskb_trim (skb, skb->len - trimlen); +if (unlikely (ret)) +return ret; ret = nexthdr[1 ];
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 5/16 net: ipv4: fix return value check in esp_remove_trailer
In reply to Sasha LevinFrom: Ma Ke <[email protected]>
[ Upstream commit 513f61e2193350c7a345da98559b80f61aec4fa6 ]
In esp_remove_trailer(), to avoid an unexpected result returned by pskb_trim, we should check the return value of pskb_trim().
--- net/ipv4/esp4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv4/esp4.c +3 -1
@@ -741,7 +741,9 @@ static inline int esp_remove_trailer(struct sk_buff *skb) skb->csum =csum_block_sub (skb->csum, csumdiff, skb->len - trimlen); } -pskb_trim (skb, skb->len - trimlen); + ret =pskb_trim (skb, skb->len - trimlen); +if (unlikely (ret)) +return ret; ret = nexthdr[1 ];
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 6/16 Bluetooth: vhci: Fix race when opening vhci device
In reply to Sasha LevinFrom: Arkadiusz Bokowy <[email protected]>
[ Upstream commit 92d4abd66f7080075793970fc8f241239e58a9e7 ]
When the vhci device is opened in the two-step way, i.e.: open device then write a vendor packet with requested controller type, the device shall respond with a vendor packet which includes HCI index of created interface.
When the virtual HCI is created, the host sends a reset request to the controller. This request is processed by the vhci_send_frame() function. However, this request is send by a different thread, so it might happen that this HCI request will be received before the vendor response is queued in the read queue. This results in the HCI vendor response and HCI reset request inversion in the read queue which leads to improper behavior of btvirt:
Quoted 1 line
dmesg
[1754256.640122] Bluetooth: MGMT ver 1.22 [1754263.023806] Bluetooth: MGMT ver 1.22 [1754265.043775] Bluetooth: hci1: Opcode 0x c03 failed: -110
In order to synchronize vhci two-step open/setup process with virtual HCI initialization, this patch adds internal lock when queuing data in the vhci_send_frame() function.
--- drivers/bluetooth/hci_vhci.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/bluetooth/hci_vhci.c +3 -0
@@ -67,7 +67,10 @@ static int vhci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)struct vhci_data *data =hci_get_drvdata (hdev);memcpy (skb_push (skb,1 ), &hci_skb_pkt_type (skb),1 ); + +mutex_lock (&data->open_mutex);skb_queue_tail (&data->readq, skb); +mutex_unlock (&data->open_mutex);wake_up_interruptible (&data->read_wait);return 0 ;
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 7/16 netfilter: nfnetlink_log: silence bogus compiler warning
In reply to Sasha LevinFrom: Florian Westphal <[email protected]>
[ Upstream commit 2e1d175410972285333193837a4250a74cd472e6 ]
net/netfilter/nfnetlink_log.c:800:18: warning: variable 'ctinfo' is uninitialized
The warning is bogus, the variable is only used if ct is non-NULL and always initialised in that case. Init to 0 too to silence this.
--- net/netfilter/nfnetlink_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nfnetlink_log.c +1 -1
@@ -683,8 +683,8 @@ nfulnl_log_packet(struct net *net,unsigned int plen =0 ;struct nfnl_log_net *log =nfnl_log_pernet (net);const struct nfnl_ct_hook *nfnl_ct =NULL ; +enum ip_conntrack_info ctinfo =0 ;struct nf_conn *ct =NULL ; -enum ip_conntrack_info ctinfo;if (li_user && li_user->type ==NF_LOG_TYPE_ULOG ) li = li_user;
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 8/16 ASoC: rt5650: fix the wrong result of key button
In reply to Sasha LevinFrom: Shuming Fan <[email protected]>
[ Upstream commit f88dfbf333b3661faff996bb03af2024d907b76a ]
The RT5650 should enable a power setting for button detection to avoid the wrong result.
--- sound/soc/codecs/rt5645.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/codecs/rt5645.c +2 -0
@@ -3241,6 +3241,8 @@ int rt5645_set_jack_detect(struct snd_soc_component *component, RT5645_GP1_PIN_IRQ, RT5645_GP1_PIN_IRQ);regmap_update_bits (rt5645->regmap,RT5645_GEN_CTRL1 ,RT5645_DIG_GATE_CTRL ,RT5645_DIG_GATE_CTRL ); +regmap_update_bits (rt5645->regmap,RT5645_DEPOP_M1 , +RT5645_HP_CB_MASK ,RT5645_HP_CB_PU ); }rt5645_irq (0 , rt5645);
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 9/16 fbdev: uvesafb: Call cn_del_callback() at the end of uvesafb_exit()
In reply to Sasha LevinFrom: Jorge Maidana <[email protected]>
[ Upstream commit 1022e7e2f40574c74ed32c3811b03d26b0b81daf ]
Delete the v86d netlink only after all the VBE tasks have been completed.
Fixes initial state restore on module unload:
uvesafb: VBE state restore call failed (eax=0x4f04, err=-19)
--- drivers/video/fbdev/uvesafb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/uvesafb.c +1 -1
@@ -1933,10 +1933,10 @@ static void uvesafb_exit(void) } } -cn_del_callback (&uvesafb_cn_id);driver_remove_file (&uvesafb_driver.driver, &driver_attr_v86d);platform_device_unregister (uvesafb_device);platform_driver_unregister (&uvesafb_driver); +cn_del_callback (&uvesafb_cn_id); }module_exit (uvesafb_exit);
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 10/16 fbdev: core: cfbcopyarea: fix sloppy typing
In reply to Sasha LevinFrom: Sergey Shtylyov <[email protected]>
[ Upstream commit 7f33df94cf0156f64eee9509bd9b4a178990f613 ]
In cfb_copyarea(), the local variable bits_per_line is needlessly typed as *unsigned long* -- which is a 32-bit type on the 32-bit arches and a 64-bit type on the 64-bit arches; that variable's value is derived from the __u32 typed fb_fix_screeninfo::line_length field (multiplied by 8u) and a 32-bit *unsigned int* type should still be enough to store the # of bits per line.
Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool.
--- drivers/video/fbdev/core/cfbcopyarea.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/core/cfbcopyarea.c +1 -1
@@ -382,7 +382,7 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) {u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy;u32 height = area->height, width = area->width; -unsigned long const bits_per_line = p->fix.line_length*8u ; +unsigned int const bits_per_line = p->fix.line_length *8u ;unsigned long __iomem *base =NULL ;int bits =BITS_PER_LONG , bytes = bits >>3 ;unsigned dst_idx =0 , src_idx =0 , rev_copy =0 ;
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 11/16 fbdev: core: syscopyarea: fix sloppy typing
In reply to Sasha LevinFrom: Sergey Shtylyov <[email protected]>
[ Upstream commit e8e4a470b677511f9d1ad4f3cef32adc1d9a60ca ]
In sys_copyarea(), the local variable bits_per_line is needlessly typed as *unsigned long* -- which is a 32-bit type on the 32-bit arches and a 64-bit type on the 64-bit arches; that variable's value is derived from the __u32 typed fb_fix_screeninfo::line_length field (multiplied by 8u) and a 32-bit *unsigned int* type should still be enough to store the # of bits per line.
Found by Linux Verification Center (linuxtesting.org) with the Svace static analysis tool.
--- drivers/video/fbdev/core/syscopyarea.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/core/syscopyarea.c +1 -1
@@ -316,7 +316,7 @@ void sys_copyarea(struct fb_info *p, const struct fb_copyarea *area) {u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy;u32 height = area->height, width = area->width; -unsigned long const bits_per_line = p->fix.line_length*8u ; +unsigned int const bits_per_line = p->fix.line_length *8u ;unsigned long *base =NULL ;int bits =BITS_PER_LONG , bytes = bits >>3 ;unsigned dst_idx =0 , src_idx =0 , rev_copy =0 ;
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 12/16 scsi: mpt3sas: Fix in error path
In reply to Sasha LevinFrom: Tomas Henzl <[email protected]>
[ Upstream commit e40c04ade0e2f3916b78211d747317843b11ce10 ]
The driver should be deregistered as misc driver after PCI registration failure.
--- drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_scsih.c +3 -1
@@ -11624,8 +11624,10 @@ _mpt3sas_init(void)mpt3sas_ctl_init (hbas_to_enumerate); error =pci_register_driver (&mpt3sas_driver); -if (error) +if (error) { +mpt3sas_ctl_exit (hbas_to_enumerate);scsih_exit (); + }return error; }
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 13/16 platform/x86: asus-wmi: Change ASUS_WMI_BRN_DOWN code from 0x20 to 0x2e
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit f37cc2fc277b371fc491890afb7d8a26e36bb3a1 ]
Older Asus laptops change the backlight level themselves and then send WMI events with different codes for different backlight levels.
The asus-wmi.c code maps the entire range of codes reported on brightness down keypresses to an internal ASUS_WMI_BRN_DOWN code:
define NOTIFY_BRNUP_MIN 0x11 define NOTIFY_BRNUP_MAX 0x1f define NOTIFY_BRNDOWN_MIN 0x20 define NOTIFY_BRNDOWN_MAX 0x2e
if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX)
code = ASUS_WMI_BRN_UP;
else if (code >= NOTIFY_BRNDOWN_MIN && code <= NOTIFY_BRNDOWN_MAX)
code = ASUS_WMI_BRN_DOWN;Before this commit all the NOTIFY_BRNDOWN_MIN - NOTIFY_BRNDOWN_MAX aka 0x20 - 0x2e events were mapped to 0x20.
This mapping is causing issues on new laptop models which actually send 0x2b events for printscreen presses and 0x2c events for capslock presses, which get translated into spurious brightness-down presses.
The plan is disable the 0x11-0x2e special mapping on laptops where asus-wmi does not register a backlight-device to avoid the spurious brightness-down keypresses. New laptops always send 0x2e for brightness-down presses, change the special internal ASUS_WMI_BRN_DOWN value from 0x20 to 0x2e to match this in preparation for fixing the spurious brightness-down presses.
This change does not have any functional impact since all of 0x20 - 0x2e is mapped to ASUS_WMI_BRN_DOWN first and only then checked against the keymap code and the new 0x2e value is still in the 0x20 - 0x2e range.
--- drivers/platform/x86/asus-wmi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/asus-wmi.h +1 -1
@@ -18,7 +18,7 @@#include <linux/i8042.h> #define ASUS_WMI_KEY_IGNORE (-1) -#define ASUS_WMI_BRN_DOWN 0x20 +#define ASUS_WMI_BRN_DOWN 0x2e#define ASUS_WMI_BRN_UP 0x2fstruct module ;
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 14/16 platform/x86: asus-wmi: Map 0x2a code, Ignore 0x2b and 0x2c events
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 235985d1763f7aba92c1c64e5f5aaec26c2c9b18 ]
Newer Asus laptops send the following new WMI event codes when some of the F1 - F12 "media" hotkeys are pressed:
0x2a Screen Capture0x2b PrintScreen0x2c CapsLock
Map 0x2a to KEY_SELECTIVE_SCREENSHOT mirroring how similar hotkeys are mapped on other laptops.
PrintScreem and CapsLock are also reported as normal PS/2 keyboard events, map these event codes to KE_IGNORE to avoid "Unknown key code 0x%x\n" log messages.
--- drivers/platform/x86/asus-nb-wmi.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/platform/x86/asus-nb-wmi.c +3 -0
@@ -475,6 +475,9 @@ static void asus_nb_wmi_quirks(struct asus_wmi_driver *driver)static const struct key_entry asus_nb_wmi_keymap[] = { {KE_KEY ,ASUS_WMI_BRN_DOWN , {KEY_BRIGHTNESSDOWN } }, {KE_KEY ,ASUS_WMI_BRN_UP , {KEY_BRIGHTNESSUP } }, + {KE_KEY ,0x2a , {KEY_SELECTIVE_SCREENSHOT } }, + {KE_IGNORE ,0x2b , },/* PrintScreen (also send via PS/2) on newer models */ + {KE_IGNORE ,0x2c , },/* CapsLock (also send via PS/2) on newer models */ {KE_KEY ,0x30 , {KEY_VOLUMEUP } }, {KE_KEY ,0x31 , {KEY_VOLUMEDOWN } }, {KE_KEY ,0x32 , {KEY_MUTE } },
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 15/16 platform/mellanox: mlxbf-tmfifo: Fix a warning message
In reply to Sasha LevinFrom: Liming Sun <[email protected]>
[ Upstream commit 99c09c985e5973c8f0ad976ebae069548dd86f12 ]
This commit fixes the smatch static checker warning in function mlxbf_tmfifo_rxtx_word() which complains data not initialized at line 634 when IS_VRING_DROP() is TRUE.
--- drivers/platform/mellanox/mlxbf-tmfifo.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/platform/mellanox/mlxbf-tmfifo.c +11 -10
@@ -588,24 +588,25 @@ static void mlxbf_tmfifo_rxtx_word(struct mlxbf_tmfifo_vring *vring,if (vring->cur_len +sizeof (u64) <= len) {/* The whole word. */ -if (!IS_VRING_DROP (vring)) { -if (is_rx) +if (is_rx) { +if (!IS_VRING_DROP (vring))memcpy (addr + vring->cur_len, &data,sizeof (u64)); -else -memcpy (&data, addr + vring->cur_len, -sizeof (u64)); + }else { +memcpy (&data, addr + vring->cur_len, +sizeof (u64)); } vring->cur_len +=sizeof (u64); }else {/* Leftover bytes. */ -if (!IS_VRING_DROP (vring)) { -if (is_rx) +if (is_rx) { +if (!IS_VRING_DROP (vring))memcpy (addr + vring->cur_len, &data, len - vring->cur_len); -else -memcpy (&data, addr + vring->cur_len, - len - vring->cur_len); + }else { + data =0 ; +memcpy (&data, addr + vring->cur_len, + len - vring->cur_len); } vring->cur_len = len; }
Signature · 1 line
2.42.0
Sasha Levin
maintainerPATCH 16/16 nvme-pci: add BOGUS_NID for Intel 0a54 device
In reply to Sasha LevinFrom: Keith Busch <[email protected]>
[ Upstream commit 5c3f4066462a5f6cac04d3dd81c9f551fabbc6c7 ]
These ones claim cmic and nmic capable, so need special consideration to ignore their duplicate identifiers.
--- drivers/nvme/host/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +2 -1
@@ -3181,7 +3181,8 @@ static const struct pci_device_id nvme_id_table[] = { { PCI_VDEVICE(INTEL, 0x0a54), /* Intel P4500/P4600 */ .driver_data =NVME_QUIRK_STRIPE_SIZE |NVME_QUIRK_DEALLOCATE_ZEROES | - NVME_QUIRK_IGNORE_DEV_SUBNQN, }, +NVME_QUIRK_IGNORE_DEV_SUBNQN | + NVME_QUIRK_BOGUS_NID, }, { PCI_VDEVICE(INTEL, 0x0a55), /* Dell Express Flash P4600 */ .driver_data = NVME_QUIRK_STRIPE_SIZE | NVME_QUIRK_DEALLOCATE_ZEROES, },
Signature · 1 line
2.42.0