Linux 4.19.284
Greg Kroah-Hartman
maintainerI'm announcing the release of the 4.19.284 kernel.
All users of the 4.19 kernel series must upgrade.
The updated 4.19.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.19.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/m68k/kernel/signal.c | 14 arch/parisc/include/asm/cacheflush.h | 5 arch/parisc/kernel/cache.c | 5 arch/parisc/kernel/process.c | 11 arch/x86/include/asm/intel-family.h | 5 arch/x86/kernel/dumpstack.c | 7 arch/x86/mm/init.c | 25 drivers/acpi/acpica/dbnames.c | 3 drivers/acpi/acpica/dswstate.c | 11 drivers/acpi/ec.c | 1 drivers/base/platform.c | 20 drivers/base/regmap/regcache.c | 6 drivers/char/tpm/tpm_tis.c | 16 drivers/clk/tegra/clk-tegra20.c | 28 - drivers/firmware/arm_sdei.c | 37 - drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 5 drivers/gpu/drm/exynos/exynos_drm_g2d.h | 4 drivers/gpu/drm/tegra/sor.c | 2 drivers/hid/hid-logitech-hidpp.c | 53 + drivers/hid/wacom.h | 3 drivers/hid/wacom_sys.c | 2 drivers/hid/wacom_wac.c | 72 +- drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 drivers/input/joystick/xpad.c | 5 drivers/mcb/mcb-pci.c | 27 - drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 drivers/media/radio/radio-shark.c | 10 drivers/media/radio/radio-shark2.c | 10 drivers/memstick/host/r592.c | 2 drivers/message/fusion/mptlan.c | 2 drivers/mfd/dln2.c | 1 drivers/net/ethernet/3com/3c589_cs.c | 11 drivers/net/ethernet/broadcom/genet/bcmgenet.c | 9 drivers/net/ethernet/freescale/fec_main.c | 13 drivers/net/ethernet/intel/igb/e1000_mac.c | 4 drivers/net/ethernet/nvidia/forcedeth.c | 1 drivers/net/ethernet/pasemi/pasemi_mac.c | 2 drivers/net/ethernet/sun/cassini.c | 2 drivers/net/ipvlan/ipvlan_core.c | 6 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 13 drivers/net/wireless/intel/iwlwifi/dvm/sta.c | 5 drivers/phy/st/phy-miphy28lp.c | 42 - drivers/power/supply/bq27xxx_battery.c | 41 - drivers/power/supply/bq27xxx_battery_i2c.c | 3 drivers/power/supply/power_supply_leds.c | 5 drivers/power/supply/sbs-charger.c | 2 drivers/s390/cio/qdio.h | 25 drivers/s390/cio/qdio_main.c | 62 +- drivers/spi/spi-fsl-cpm.c | 23 drivers/spi/spi-fsl-spi.c | 65 +- drivers/spi/spi-imx.c | 24 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 5 drivers/tty/serial/8250/8250_core.c | 1 drivers/tty/serial/8250/8250_pci.c | 5 drivers/tty/serial/arc_uart.c | 7 drivers/tty/vt/vc_screen.c | 57 +- drivers/usb/core/usb.c | 76 ++ drivers/usb/gadget/function/u_ether.c | 39 - drivers/usb/misc/sisusbvga/sisusb.c | 14 drivers/usb/storage/scsiglue.c | 28 - drivers/usb/typec/altmodes/displayport.c | 4 drivers/usb/typec/tcpm.c | 16 drivers/xen/pvcalls-back.c | 9 fs/btrfs/disk-io.c | 9 fs/btrfs/free-space-cache.c | 7 fs/btrfs/inode.c | 12 fs/ceph/snap.c | 13 fs/ext2/ext2.h | 1 fs/ext2/super.c | 7 fs/ext4/mballoc.c | 65 +- fs/f2fs/checkpoint.c | 12 fs/f2fs/data.c | 3 fs/gfs2/glops.c | 3 fs/hfsplus/inode.c | 28 - fs/nilfs2/inode.c | 18 fs/statfs.c | 4 include/linux/cpuhotplug.h | 1 include/linux/platform_device.h | 3 include/linux/power/bq27xxx_battery.h | 1 include/linux/sched/task_stack.h | 2 include/linux/string_helpers.h | 15 include/linux/usb.h | 5 include/net/ip6_tunnel.h | 2 include/net/ip_tunnels.h | 2 include/net/netfilter/nf_tables.h | 15 include/net/netfilter/nf_tables_core.h | 9 include/net/netfilter/nft_fib.h | 2 include/net/netfilter/nft_masq.h | 4 include/net/netfilter/nft_redir.h | 4 include/net/sock.h | 22 include/net/tcp.h | 9 include/uapi/sound/skl-tplg-interface.h | 3 kernel/bpf/verifier.c | 2 lib/cpu_rmap.c | 5 net/8021q/vlan_dev.c | 4 net/bluetooth/l2cap_core.c | 1 net/core/datagram.c | 15 net/core/dev.c | 2 net/core/skbuff.c | 4 net/core/stream.c | 2 net/ipv4/af_inet.c | 2 net/ipv4/ip_gre.c | 6 net/ipv4/netfilter/nft_dup_ipv4.c | 18 net/ipv4/tcp.c | 27 - net/ipv4/tcp_input.c | 4 net/ipv4/udplite.c | 2 net/ipv6/exthdrs_core.c | 2 net/ipv6/ip6_gre.c | 36 - net/ipv6/netfilter/nft_dup_ipv6.c | 18 net/ipv6/udplite.c | 2 net/key/af_key.c | 12 net/netfilter/nf_tables_api.c | 228 +++++--- net/netfilter/nft_bitwise.c | 14 net/netfilter/nft_byteorder.c | 14 net/netfilter/nft_cmp.c | 8 net/netfilter/nft_ct.c | 12 net/netfilter/nft_dup_netdev.c | 6 net/netfilter/nft_dynset.c | 12 net/netfilter/nft_exthdr.c | 14 net/netfilter/nft_fib.c | 5 net/netfilter/nft_fwd_netdev.c | 18 net/netfilter/nft_hash.c | 25 net/netfilter/nft_immediate.c | 6 net/netfilter/nft_lookup.c | 14 net/netfilter/nft_masq.c | 14 net/netfilter/nft_meta.c | 12 net/netfilter/nft_nat.c | 35 - net/netfilter/nft_numgen.c | 15 net/netfilter/nft_objref.c | 6 net/netfilter/nft_osf.c | 8 net/netfilter/nft_payload.c | 10 net/netfilter/nft_queue.c | 12 net/netfilter/nft_range.c | 6 net/netfilter/nft_redir.c | 14 net/netfilter/nft_rt.c | 7 net/netfilter/nft_socket.c | 7 net/netfilter/nft_tproxy.c | 14 net/netfilter/nft_tunnel.c | 8 net/netlink/af_netlink.c | 8 net/nsh/nsh.c | 8 net/socket.c | 2 net/unix/af_unix.c | 22 net/vmw_vsock/af_vsock.c | 2 scripts/recordmcount.c | 6 sound/pci/hda/hda_generic.c | 7 sound/pci/hda/patch_ca0132.c | 1 sound/pci/hda/patch_hdmi.c | 5 sound/pci/hda/patch_realtek.c | 324 +++++++++--- tools/power/cpupower/utils/idle_monitor/mperf_monitor.c | 31 - tools/testing/selftests/memfd/fuse_test.c | 1 152 files changed, 1633 insertions(+), 796 deletions(-)
Adam Stylinski (1):
ALSA: hda/ca0132: add quirk for EVGA X299 DARK
Ai Chao (1):
ALSA: hda/realtek: Add a quirk for HP EliteDesk 805
Alain Volmat (1):
phy: st: miphy28lp: use _poll_timeout functions for waits
Alan Stern (3):
USB: core: Add routines for endpoint checks in old drivers
USB: sisusbvga: Add endpoint checks
media: radio-shark: Add endpoint checks
Aleksandr Loktionov (1):
igb: fix bit_shift to be in [1..8] range
Alexander Stein (1):
regmap: cache: Return error in cache sync operations for REGCACHE_NONE
Andreas Gruenbacher (1):
gfs2: Fix inode height consistency check
Armin Wolf (1):
ACPI: EC: Fix oops when removing custom query handlers
Arnd Bergmann (2):
clk: tegra20: fix gcc-7 constant overflow warning drm/exynos: fix g2d_open/close helper function definitions
Badhri Jagan Sridharan (1):
usb: typec: altmodes/displayport: fix pin_assignment_show
Bartosz Golaszewski (2):
drivers: provide devm_platform_ioremap_resource()
drivers: depend on HAS_IOMEM for devm_platform_ioremap_resource()
Bastien Nocera (2):
HID: logitech-hidpp: Don't use the USB serial for USB devices
HID: logitech-hidpp: Reconcile USB and Unifying serials
Cezary Rojewski (1):
ASoC: Intel: Skylake: Fix declaration of enum skl_ch_cfg
Chao Yu (1):
f2fs: fix to drop all dirty pages during umount() if cp_error is set
Christophe JAILLET (3):
cassini: Fix a memory leak in the error handling path of cas_init_one()
forcedeth: Fix an error handling path in nv_probe() 3c589_cs: Fix an error handling path in tc589_probe()
Christophe Leroy (2):
spi: fsl-spi: Re-organise transfer bits_per_word adaptation
spi: fsl-cpm: Use 16 bit mode for large transfers with even size
Daisuke Nojiri (1):
power: supply: sbs-charger: Fix INHIBITED bit for Status reg
Dan Carpenter (2):
coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet() xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()
Dave Hansen (1):
x86/mm: Avoid incomplete Global INVLPG flushes
Dong Chenchen (1):
net: nsh: Use correct mac_offset to unwind gso skb in nsh_gso_segment()
Duoming Zhou (1):
media: netup_unidvb: fix use-after-free at del_timer()
Eli Cohen (1):
lib: cpu_rmap: Avoid use after free on rmap->obj array entries
Eric Dumazet (6):
netlink: annotate accesses to nlk->cb_running
net: annotate sk->sk_err write from do_recvmmsg()
tcp: reduce POLLOUT events caused by TCP_NOTSENT_LOWAT
tcp: add annotations around sk->sk_shutdown accesses
net: datagram: fix data-races in datagram_poll()
vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit()
Filipe Manana (1):
btrfs: fix space cache inconsistency after error loading it from disk
Finn Thain (1):
m68k: Move signal frame following exception on 68020/030
Florian Fainelli (2):
net: bcmgenet: Remove phy_stop() from bcmgenet_netif_stop()
net: bcmgenet: Restore phy_stop() depending upon suspend/close
Frank Wang (1):
usb: typec: tcpm: fix multiple times discover svids error
Gavrilov Ilia (1):
ipv6: Fix out-of-bounds access in ipv6_find_tlv()
George Kennedy (1):
vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF
Greg Kroah-Hartman (1):
Linux 4.19.284
Hans de Goede (5):
wifi: iwlwifi: dvm: Fix memcpy: detected field-spanning write backtrace
power: supply: leds: Fix blink to LED on transition
power: supply: bq27xxx: Fix bq27xxx_battery_update() race condition
power: supply: bq27xxx: Fix I2C IRQ race on remove
power: supply: bq27xxx: Fix poll_interval handling and races on remove
Hao Zeng (1):
recordmcount: Fix memory leaks in the uwrite function
Hardik Garg (1):
selftests/memfd: Fix unknown type name build failure
Hector Martin (1):
wifi: brcmfmac: cfg80211: Pass the PMK in binary instead of hex
Heiko Carstens (2):
s390/qdio: get rid of register asm s390/qdio: fix do_sqbs() inline assembly constraint
Helge Deller (2):
parisc: Allow to reboot machine after system halt
parisc: Fix flush_dcache_page() for usage from irq context
Hui Wang (1):
ALSA: hda/realtek: Fix the mic type detection issue for ASUS G551JW
Ilya Leoshkevich (1):
statfs: enforce statfs[64] structure initialization
Jan Kara (1):
ext2: Check block size validity during mount
Jason Gerecke (2):
HID: wacom: generic: Set battery quirk only when we see battery data
HID: wacom: Force pen out of prox if no events have been received in a while
Jeremy Szu (1):
ALSA: hda/realtek - The front Mic on a HP machine doesn't work
Jerry Snitselaar (1):
tpm/tpm_tis: Disable interrupts for more Lenovo devices
Jian-Hong Pan (2):
ALSA: hda/realtek - Enable headset mic of Acer X2660G with ALC662
ALSA: hda/realtek - Enable the headset of Acer N50-600 with ALC662
Jiri Slaby (1):
vc_screen: rewrite vcs_size to accept vc, not inode
Jon Hunter (1):
usb: gadget: u_ether: Convert prints to device prints
Josef Bacik (1):
btrfs: use nofs when cleaning up aborted transactions
Josh Poimboeuf (1):
sched: Fix KCSAN noinstr violation
Kailang Yang (4):
ALSA: hda/realtek - Add Headset Mic supported for HP cPC
ALSA: hda/realtek - Add headset Mic support for Lenovo ALC897 platform
ALSA: hda/realtek - ALC897 headset MIC no sound
ALSA: hda/realtek - Fixed one of HP ALC671 platform Headset Mic supported
Ke Zhang (1):
serial: arc_uart: fix of_iomap leak in arc_serial_probe
Kemeng Shi (1):
ext4: set goal start correctly in ext4_mb_normalize_request
Kevin Groeneveld (1):
spi: spi-imx: fix MX51_ECSPI_* macros when cs > 3
Konrad Gräfe (1):
usb: gadget: u_ether: Fix host MAC address case
Kuniyuki Iwashima (4):
net: Fix load-tearing on sk->sk_stamp in sock_recv_cmsgs().
af_unix: Fix a data race of sk->sk_receive_queue->qlen.
af_unix: Fix data races around sk->sk_shutdown.
udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated().Maxime Bizon (1):
usb-storage: fix deadlock when a scsi command timeouts more than once
Min Li (1):
Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp
Nathan Chancellor (1):
net: pasemi: Fix return type of pasemi_mac_start_tx()
Nick Child (1):
net: Catch invalid index in XPS mapping
Nikhil Mahale (1):
ALSA: hda: Add NVIDIA codec IDs a3 through a7 to patch table
Nikolay Borisov (1):
btrfs: replace calls to btrfs_find_free_ino with btrfs_find_free_objectid
Nur Hussein (1):
drm/tegra: Avoid potential 32-bit integer overflow
Ojaswin Mujoo (1):
ext4: Fix best extent lstart adjustment logic in ext4_mb_new_inode_pa()
Pablo Neira Ayuso (9):
netfilter: nftables: add nft_parse_register_load() and use it
netfilter: nftables: add nft_parse_register_store() and use it
netfilter: nftables: statify nft_parse_register()
netfilter: nf_tables: validate registers coming from userspace.
netfilter: nf_tables: add nft_setelem_parse_key()
netfilter: nf_tables: allow up to 64 bytes in the set element data area
netfilter: nf_tables: stricter validation of element data
netfilter: nf_tables: validate NFTA_SET_ELEM_OBJREF based on NFT_SET_OBJECT flag
netfilter: nf_tables: do not allow RULE_ID to refer to another chain
Paolo Abeni (1):
tcp: factor out __tcp_close() helper
Peilin Ye (3):
ip6_gre: Fix skb_under_panic in __gre6_xmit()
ip6_gre: Make o_seqno start from 0 in native mode ip_gre, ip6_gre: Fix race condition on o_seqno in collect_md mode
Philipp Hortmann (1):
staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE
Pierre Gondois (1):
firmware: arm_sdei: Fix sleep from invalid context BUG
Pratyush Yadav (1):
net: fix skb leak in __skb_tstamp_tx()
Qiang Ning (1):
mfd: dln2: Fix memory leak in dln2_probe()
Rasmus Villemoes (1):
spi: spi-fsl-spi: automatically adapt bits-per-word in cpu mode
Rodrigo Siqueira (1):
drm/amd/display: Use DC_LOG_DC in the trasform pixel function
Rodríguez Barbarin, José Javier (1):
mcb-pci: Reallocate memory region to avoid memory overlapping
Ryusuke Konishi (1):
nilfs2: fix use-after-free bug of nilfs_root in nilfs_evict_inode()
Sergey Bostandzhyan (1):
Add Acer Aspire Ethos 8951G model quirk
Soheil Hassas Yeganeh (1):
tcp: return EPOLLOUT from tcp_poll only when notsent_bytes is half the limit
Takashi Iwai (3):
ALSA: hda: Fix Oops by 9.1 surround channel names
ALSA: hda/realtek - More constifications
ALSA: hda/realtek - Fix inverted bass GPIO pin on Acer 8951G
Tamir Duberstein (1):
ACPICA: Avoid undefined behavior: applying zero offset to null pointer
Tetsuo Handa (1):
fs: hfsplus: remove WARN_ON() from hfsplus_cat_{read,write}_inode()
Tobias Brunner (1):
af_key: Reject optional tunnel/BEET mode templates in outbound policies
Tony Lindgren (1):
serial: 8250: Reinit port->pm on port specific driver unbind
Uwe Kleine-König (1):
net: fec: Better handle pm_runtime_get() failing in .remove()
Vadim Pasternak (1):
lib/string_helpers: Introduce string_upper() and string_lower() helpers
Vernon Lovejoy (1):
x86/show_trace_log_lvl: Ensure stack pointer is aligned, again
Vicki Pfau (1):
Input: xpad - add constants for GIP interface numbers
Vitaliy Tomin (1):
serial: Add support for Advantech PCI-1611U card
Will Deacon (1):
bpf: Fix mask generation for 32-bit narrow loads of 64-bit fields
Wyes Karny (1):
cpupower: Make TSC read per CPU for Mperf monitor
Xin Long (1):
erspan: get the proto with the md version for collect_md
Xiubo Li (1):
ceph: force updating the msg pointer in non-split case
Zheng Wang (2):
memstick: r592: Fix UAF bug in r592_remove due to race condition
scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition
Zhuang Shengen (1):
vsock: avoid to close connected socket after the timeout
t.feng (1):
ipvlan:Fix out-of-bounds caused by unclear skb->cb
void0red (1):
ACPICA: ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 4 PATCHLEVEL = 19 -SUBLEVEL = 283 +SUBLEVEL = 284 EXTRAVERSION = NAME = "People's Front"
arch/m68k/kernel/signal.c +10 -4
@@ -882,11 +882,17 @@ static inline int rt_setup_ucontext(struct ucontext __user *uc, struct pt_regs * }static inline void __user * -get_sigframe (struct ksignal *ksig,size_t frame_size) +get_sigframe (struct ksignal *ksig,struct pt_regs *tregs,size_t frame_size) {unsigned long usp =sigsp (rdusp (), ksig); +unsigned long gap =0 ; -return (void __user *)((usp - frame_size) &-8UL ); +if (CPU_IS_020_OR_030 && tregs->format ==0xb ) { +/* USP is unreliable so use worst-case value */ + gap =256 ; + } + +return (void __user *)((usp - gap - frame_size) &-8UL ); } static int setup_frame(struct ksignal *ksig, sigset_t *set,
@@ -904,7 +910,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,return -EFAULT ; } - frame =get_sigframe (ksig,sizeof (*frame) + fsize); + frame =get_sigframe (ksig, tregs,sizeof (*frame) + fsize);if (fsize) err |=copy_to_user (frame +1 , regs +1 , fsize);
@@ -975,7 +981,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,return -EFAULT ; } - frame =get_sigframe (ksig,sizeof (*frame)); + frame =get_sigframe (ksig, tregs,sizeof (*frame));if (fsize) err |=copy_to_user (&frame->uc.uc_extra, regs +1 , fsize);
arch/parisc/include/asm/cacheflush.h +5 -0
@@ -57,6 +57,11 @@ extern void flush_dcache_page(struct page *page);#define flush_dcache_mmap_lock (mapping) xa_lock_irq(&mapping->i_pages)#define flush_dcache_mmap_unlock (mapping) xa_unlock_irq(&mapping->i_pages) +#define flush_dcache_mmap_lock_irqsave (mapping, flags) \ + xa_lock_irqsave(&mapping->i_pages, flags) +#define flush_dcache_mmap_unlock_irqrestore (mapping, flags) \ + xa_unlock_irqrestore(&mapping->i_pages, flags) +#define flush_icache_page (vma,page) do { \ flush_kernel_dcache_page(page); \
arch/parisc/kernel/cache.c +3 -2
@@ -309,6 +309,7 @@ void flush_dcache_page(struct page *page)struct vm_area_struct *mpnt;unsigned long offset;unsigned long addr, old_addr =0 ; +unsigned long flags;pgoff_t pgoff;if (mapping && !mapping_mapped (mapping)) {
@@ -328,7 +329,7 @@ void flush_dcache_page(struct page *page)* declared as MAP_PRIVATE or MAP_SHARED), so we only need * to flush one address here for them all to become coherent */ -flush_dcache_mmap_lock (mapping); +flush_dcache_mmap_lock_irqsave (mapping, flags); vma_interval_tree_foreach(mpnt, &mapping->i_mmap, pgoff, pgoff) { offset = (pgoff - mpnt->vm_pgoff) <<PAGE_SHIFT ; addr = mpnt->vm_start + offset;
@@ -351,7 +352,7 @@ void flush_dcache_page(struct page *page) old_addr = addr; } } -flush_dcache_mmap_unlock (mapping); +flush_dcache_mmap_unlock_irqrestore (mapping, flags); }EXPORT_SYMBOL (flush_dcache_page);
arch/parisc/kernel/process.c +8 -3
@@ -138,13 +138,18 @@ void machine_power_off(void)/* It seems we have no way to power the system off via * software. The user has to press the button himself. */ -printk (KERN_EMERG "System shut down completed.\n" -"Please power this system off now." ); +printk ("Power off or press RETURN to reboot.\n" );/* prevent soft lockup/stalled CPU messages for endless loop. */ rcu_sysrq_start ();lockup_detector_soft_poweroff (); -for (;;); +while (1 ) { +/* reboot if user presses RETURN key */ +if (pdc_iodc_getc () ==13 ) { +printk ("Rebooting...\n" ); +machine_restart (NULL ); + } + } }void (*pm_power_off)(void );
arch/x86/include/asm/intel-family.h +5 -0
@@ -74,6 +74,11 @@#define INTEL_FAM6_LAKEFIELD 0x8A#define INTEL_FAM6_ALDERLAKE 0x97#define INTEL_FAM6_ALDERLAKE_L 0x9A +#define INTEL_FAM6_ALDERLAKE_N 0xBE + +#define INTEL_FAM6_RAPTORLAKE 0xB7 +#define INTEL_FAM6_RAPTORLAKE_P 0xBA +#define INTEL_FAM6_RAPTORLAKE_S 0xBF/* "Small Core" Processors (Atom) */
arch/x86/kernel/dumpstack.c +5 -2
@@ -171,7 +171,6 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,printk ("%sCall Trace:\n" , log_lvl);unwind_start (&state, task, regs, stack); - stack = stack ? :get_stack_pointer (task, regs); regs =unwind_get_entry_regs (&state, &partial);/*
@@ -190,9 +189,13 @@ void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,* - hardirq stack * - entry stack */ -for ( ; stack; stack =PTR_ALIGN (stack_info.next_sp,sizeof (long ))) { +for (stack = stack ?:get_stack_pointer (task, regs); + stack; + stack = stack_info.next_sp) {const char *stack_name; + stack =PTR_ALIGN (stack,sizeof (long )); +if (get_stack_info (stack, task, &stack_info, &visit_mask)) {/* * We weren't on a valid stack. It's possible that
arch/x86/mm/init.c +25 -0
@@ -9,6 +9,7 @@#include <linux/kmemleak.h> #include <asm/set_memory.h> +#include <asm/cpu_device_id.h> #include <asm/e820/api.h> #include <asm/init.h> #include <asm/page.h>
@@ -207,6 +208,24 @@ static void __init probe_page_size_mask(void) } } +#define INTEL_MATCH (_model) { .vendor = X86_VENDOR_INTEL, \ + .family = 6, \ + .model = _model, \ + } +/* +* INVLPG may not properly flush Global entries +* on these CPUs when PCIDs are enabled. +*/ +static const struct x86_cpu_id invlpg_miss_ids[] = { +INTEL_MATCH (INTEL_FAM6_ALDERLAKE ), +INTEL_MATCH (INTEL_FAM6_ALDERLAKE_L ), +INTEL_MATCH (INTEL_FAM6_ALDERLAKE_N ), +INTEL_MATCH (INTEL_FAM6_RAPTORLAKE ), +INTEL_MATCH (INTEL_FAM6_RAPTORLAKE_P ), +INTEL_MATCH (INTEL_FAM6_RAPTORLAKE_S ), + {} +}; +static void setup_pcid (void ) {if (!IS_ENABLED (CONFIG_X86_64 ))
@@ -215,6 +234,12 @@ static void setup_pcid(void)if (!boot_cpu_has (X86_FEATURE_PCID ))return ; +if (x86_match_cpu (invlpg_miss_ids)) { +pr_info ("Incomplete global flushes, disabling PCID" ); +setup_clear_cpu_cap (X86_FEATURE_PCID ); +return ; + } +if (boot_cpu_has (X86_FEATURE_PGE )) {/* * This can't be cr4_set_bits_and_update_boot() -- the
drivers/acpi/acpica/dbnames.c +3 -0
@@ -571,6 +571,9 @@ acpi_status acpi_db_display_objects(char *obj_type_arg, char *display_count_arg) object_info =ACPI_ALLOCATE_ZEROED (sizeof (struct acpi_object_info )); +if (!object_info) +return (AE_NO_MEMORY ); +/* Walk the namespace from the root */ (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
drivers/acpi/acpica/dswstate.c +8 -3
@@ -576,9 +576,14 @@ acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state,ACPI_FUNCTION_TRACE (ds_init_aml_walk); walk_state->parser_state.aml = - walk_state->parser_state.aml_start = aml_start; - walk_state->parser_state.aml_end = - walk_state->parser_state.pkg_end = aml_start + aml_length; + walk_state->parser_state.aml_start = + walk_state->parser_state.aml_end = + walk_state->parser_state.pkg_end = aml_start; +/* Avoid undefined behavior: applying zero offset to null pointer */ +if (aml_length !=0 ) { + walk_state->parser_state.aml_end += aml_length; + walk_state->parser_state.pkg_end += aml_length; + }/* The next_op of the next_walk will be the beginning of the method */
drivers/acpi/ec.c +1 -0
@@ -1153,6 +1153,7 @@ static void acpi_ec_remove_query_handlers(struct acpi_ec *ec,void acpi_ec_remove_query_handler (struct acpi_ec *ec,u8 query_bit) {acpi_ec_remove_query_handlers (ec, false, query_bit); +flush_workqueue (ec_query_wq); }EXPORT_SYMBOL_GPL (acpi_ec_remove_query_handler);
drivers/base/platform.c +20 -0
@@ -80,6 +80,26 @@ struct resource *platform_get_resource(struct platform_device *dev, }EXPORT_SYMBOL_GPL (platform_get_resource); +/** +* devm_platform_ioremap_resource - call devm_ioremap_resource() for a platform +* device +* +* @pdev: platform device to use both for memory resource lookup as well as +* resource managemend +* @index: resource index +*/ +#ifdef CONFIG_HAS_IOMEM +void __iomem *devm_platform_ioremap_resource (struct platform_device *pdev, +unsigned int index) +{ +struct resource *res; + + res =platform_get_resource (pdev,IORESOURCE_MEM , index); +return devm_ioremap_resource (&pdev->dev, res); +} +EXPORT_SYMBOL_GPL (devm_platform_ioremap_resource); +#endif /* CONFIG_HAS_IOMEM */ +/** * platform_get_irq - get an IRQ for a device * @dev: platform device
drivers/base/regmap/regcache.c +6 -0
@@ -347,6 +347,9 @@ int regcache_sync(struct regmap *map)const char *name;bool bypass; +if (WARN_ON (map->cache_type ==REGCACHE_NONE )) +return -EINVAL ; +BUG_ON (!map->cache_ops); map->lock (map->lock_arg);
@@ -416,6 +419,9 @@ int regcache_sync_region(struct regmap *map, unsigned int min,const char *name;bool bypass; +if (WARN_ON (map->cache_type ==REGCACHE_NONE )) +return -EINVAL ; +BUG_ON (!map->cache_ops); map->lock (map->lock_arg);
drivers/char/tpm/tpm_tis.c +16 -0
@@ -87,6 +87,22 @@ static const struct dmi_system_id tpm_tis_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T490s"), }, }, + { + .callback = tpm_tis_disable_irq, + .ident = "ThinkStation P360 Tiny", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkStation P360 Tiny"), + }, + }, + { + .callback = tpm_tis_disable_irq, + .ident = "ThinkPad L490", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L490"), + }, + }, {} };
drivers/clk/tegra/clk-tegra20.c +14 -14
@@ -29,24 +29,24 @@#define MISC_CLK_ENB 0x48#define OSC_CTRL 0x50 -#define OSC_CTRL_OSC_FREQ_MASK (3<<30) -#define OSC_CTRL_OSC_FREQ_13MHZ (0<<30) -#define OSC_CTRL_OSC_FREQ_19_2MHZ (1<<30) -#define OSC_CTRL_OSC_FREQ_12MHZ (2<<30) -#define OSC_CTRL_OSC_FREQ_26MHZ (3<<30) -#define OSC_CTRL_MASK (0x3f2 | OSC_CTRL_OSC_FREQ_MASK) - -#define OSC_CTRL_PLL_REF_DIV_MASK (3<<28) -#define OSC_CTRL_PLL_REF_DIV_1 (0<<28) -#define OSC_CTRL_PLL_REF_DIV_2 (1<<28) -#define OSC_CTRL_PLL_REF_DIV_4 (2<<28) +#define OSC_CTRL_OSC_FREQ_MASK (3u<<30) +#define OSC_CTRL_OSC_FREQ_13MHZ (0u<<30) +#define OSC_CTRL_OSC_FREQ_19_2MHZ (1u<<30) +#define OSC_CTRL_OSC_FREQ_12MHZ (2u<<30) +#define OSC_CTRL_OSC_FREQ_26MHZ (3u<<30) +#define OSC_CTRL_MASK (0x3f2u | OSC_CTRL_OSC_FREQ_MASK) + +#define OSC_CTRL_PLL_REF_DIV_MASK (3u<<28) +#define OSC_CTRL_PLL_REF_DIV_1 (0u<<28) +#define OSC_CTRL_PLL_REF_DIV_2 (1u<<28) +#define OSC_CTRL_PLL_REF_DIV_4 (2u<<28)#define OSC_FREQ_DET 0x58 -#define OSC_FREQ_DET_TRIG (1<<31) +#define OSC_FREQ_DET_TRIG (1u<<31)#define OSC_FREQ_DET_STATUS 0x5c -#define OSC_FREQ_DET_BUSY (1<<31) -#define OSC_FREQ_DET_CNT_MASK 0xFFFF +#define OSC_FREQ_DET_BUSYu (1<<31) +#define OSC_FREQ_DET_CNT_MASK 0xFFFFu#define TEGRA20_CLK_PERIPH_BANKS 3
drivers/firmware/arm_sdei.c +20 -17
@@ -43,6 +43,8 @@ static asmlinkage void (*sdei_firmware_call)(unsigned long function_id,/* entry point from firmware to arch asm code */ static unsigned long sdei_entry_point; +static int sdei_hp_state; +struct sdei_event {/* These three are protected by the sdei_list_lock */ struct list_head list;
@@ -303,8 +305,6 @@ int sdei_mask_local_cpu(void) {int err; -WARN_ON_ONCE (preemptible ()); - err =invoke_sdei_fn (SDEI_1_0_FN_SDEI_PE_MASK ,0 ,0 ,0 ,0 ,0 ,NULL );if (err && err != -EIO ) { pr_warn_once("failed to mask CPU[%u]: %d\n",
@@ -317,6 +317,7 @@ int sdei_mask_local_cpu(void)static void _ipi_mask_cpu (void *ignored) { +WARN_ON_ONCE (preemptible ());sdei_mask_local_cpu (); }
@@ -324,8 +325,6 @@ int sdei_unmask_local_cpu(void) {int err; -WARN_ON_ONCE (preemptible ()); - err =invoke_sdei_fn (SDEI_1_0_FN_SDEI_PE_UNMASK ,0 ,0 ,0 ,0 ,0 ,NULL );if (err && err != -EIO ) { pr_warn_once("failed to unmask CPU[%u]: %d\n",
@@ -338,6 +337,7 @@ int sdei_unmask_local_cpu(void)static void _ipi_unmask_cpu (void *ignored) { +WARN_ON_ONCE (preemptible ());sdei_unmask_local_cpu (); }
@@ -345,6 +345,8 @@ static void _ipi_private_reset(void *ignored) {int err; +WARN_ON_ONCE (preemptible ()); + err =invoke_sdei_fn (SDEI_1_0_FN_SDEI_PRIVATE_RESET ,0 ,0 ,0 ,0 ,0 ,NULL );if (err && err != -EIO )
@@ -391,8 +393,6 @@ static void _local_event_enable(void *data)int err;struct sdei_crosscall_args *arg = data; -WARN_ON_ONCE (preemptible ()); - err =sdei_api_event_enable (arg->event->event_num);sdei_cross_call_return (arg, err);
@@ -483,8 +483,6 @@ static void _local_event_unregister(void *data)int err;struct sdei_crosscall_args *arg = data; -WARN_ON_ONCE (preemptible ()); - err =sdei_api_event_unregister (arg->event->event_num);sdei_cross_call_return (arg, err);
@@ -573,8 +571,6 @@ static void _local_event_register(void *data)struct sdei_registered_event *reg;struct sdei_crosscall_args *arg = data; -WARN_ON (preemptible ()); - reg =per_cpu_ptr (arg->event->private_registered,smp_processor_id ()); err =sdei_api_event_register (arg->event->event_num, sdei_entry_point, reg,0 ,0 );
@@ -754,6 +750,8 @@ static int sdei_pm_notifier(struct notifier_block *nb, unsigned long action, {int rv; +WARN_ON_ONCE (preemptible ()); +switch (action) {case CPU_PM_ENTER : rv =sdei_mask_local_cpu ();
@@ -802,7 +800,7 @@ static int sdei_device_freeze(struct device *dev)int err;/* unregister private events */ -cpuhp_remove_state (CPUHP_AP_ARM_SDEI_STARTING ); +cpuhp_remove_state (sdei_entry_point); err =sdei_unregister_shared ();if (err)
@@ -823,12 +821,15 @@ static int sdei_device_thaw(struct device *dev)return err; } - err =cpuhp_setup_state (CPUHP_AP_ARM_SDEI_STARTING ,"SDEI" , + err =cpuhp_setup_state (CPUHP_AP_ONLINE_DYN ,"SDEI" , &sdei_cpuhp_up, &sdei_cpuhp_down); -if (err) +if (err <0 ) {pr_warn ("Failed to re-register CPU hotplug notifier...\n" ); +return err; + } -return err; + sdei_hp_state = err; +return 0 ; }static int sdei_device_restore (struct device *dev)
@@ -860,7 +861,7 @@ static int sdei_reboot_notifier(struct notifier_block *nb, unsigned long action,* We are going to reset the interface, after this there is no point * doing work when we take CPUs offline. */ -cpuhp_remove_state (CPUHP_AP_ARM_SDEI_STARTING ); +cpuhp_remove_state (sdei_hp_state);sdei_platform_reset ();
@@ -973,13 +974,15 @@ static int sdei_probe(struct platform_device *pdev) goto remove_cpupm; } - err =cpuhp_setup_state (CPUHP_AP_ARM_SDEI_STARTING ,"SDEI" , + err =cpuhp_setup_state (CPUHP_AP_ONLINE_DYN ,"SDEI" , &sdei_cpuhp_up, &sdei_cpuhp_down); -if (err) { +if (err <0 ) {pr_warn ("Failed to register CPU hotplug notifier...\n" ); goto remove_reboot; } + sdei_hp_state = err; +return 0 ; remove_reboot:
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +2 -3
@@ -778,7 +778,7 @@ static void dce_transform_set_pixel_storage_depth( color_depth =COLOR_DEPTH_101010 ; pixel_depth =0 ; expan_mode =1 ; -BREAK_TO_DEBUGGER (); +DC_LOG_DC ("The pixel depth %d is not valid, set COLOR_DEPTH_101010 instead." , depth);break ; }
@@ -792,8 +792,7 @@ static void dce_transform_set_pixel_storage_depth(if (!(xfm_dce->lb_pixel_depth_supported & depth)) {/*we should use unsupported capabilities * unless it is required by w/a*/ -DC_LOG_WARNING ("%s: Capability not supported" , - __func__); +DC_LOG_DC ("%s: Capability not supported" , __func__); } }
drivers/gpu/drm/exynos/exynos_drm_g2d.h +2 -2
@@ -37,11 +37,11 @@ static inline int exynos_g2d_exec_ioctl(struct drm_device *dev, void *data, return -ENODEV; } -int g2d_open (struct drm_device *drm_dev,struct drm_file *file) +static inline int g2d_open (struct drm_device *drm_dev,struct drm_file *file) {return 0 ; } -void g2d_close (struct drm_device *drm_dev,struct drm_file *file) +static inline void g2d_close (struct drm_device *drm_dev,struct drm_file *file) { }#endif
drivers/gpu/drm/tegra/sor.c +1 -1
@@ -829,7 +829,7 @@ static int tegra_sor_compute_config(struct tegra_sor *sor, struct drm_dp_link *link) {const u64 f =100000 , link_rate = link->rate *1000 ; -const u64 pclk = mode->clock *1000 ; +const u64 pclk = (u64 )mode->clock *1000 ;u64 input, output, watermark, num;struct tegra_sor_params params;u32 num_syms_per_line;
drivers/hid/hid-logitech-hidpp.c +51 -2
71 lines not on this page · raw message
drivers/hid/wacom.h +3 -0
@@ -94,6 +94,7 @@#include <linux/leds.h> #include <linux/usb/input.h> #include <linux/power_supply.h> +#include <linux/timer.h> #include <asm/unaligned.h> /*
@@ -170,6 +171,7 @@ struct wacom {struct delayed_work init_work;struct wacom_remote *remote;struct work_struct mode_change_work; +struct timer_list idleprox_timer;bool generic_has_leds;struct wacom_leds {struct wacom_group_leds *groups;
@@ -242,4 +244,5 @@ struct wacom_led *wacom_led_find(struct wacom *wacom, unsigned int group,struct wacom_led *wacom_led_next (struct wacom *wacom,struct wacom_led *cur);int wacom_equivalent_usage (int usage);int wacom_initialize_leds (struct wacom *wacom); +void wacom_idleprox_timeout (struct timer_list *list);#endif
drivers/hid/wacom_sys.c +2 -0
@@ -2754,6 +2754,7 @@ static int wacom_probe(struct hid_device *hdev,INIT_WORK (&wacom->battery_work, wacom_battery_work);INIT_WORK (&wacom->remote_work, wacom_remote_work);INIT_WORK (&wacom->mode_change_work, wacom_mode_change_work); +timer_setup (&wacom->idleprox_timer, &wacom_idleprox_timeout,TIMER_DEFERRABLE );/* ask for the report descriptor to be loaded by HID */ error =hid_parse (hdev);
@@ -2802,6 +2803,7 @@ static void wacom_remove(struct hid_device *hdev)cancel_work_sync (&wacom->battery_work);cancel_work_sync (&wacom->remote_work);cancel_work_sync (&wacom->mode_change_work); +del_timer_sync (&wacom->idleprox_timer);if (hdev->bus ==BUS_BLUETOOTH )device_remove_file (&hdev->dev, &dev_attr_speed);
drivers/hid/wacom_wac.c +50 -22
122 lines not on this page · raw message
drivers/hwtracing/coresight/coresight-tmc-etr.c +1 -1
@@ -866,7 +866,7 @@ tmc_etr_buf_insert_barrier_packet(struct etr_buf *etr_buf, u64 offset) len =tmc_etr_buf_get_data (etr_buf, offset,CORESIGHT_BARRIER_PKT_SIZE , &bufp); -if (WARN_ON (len <CORESIGHT_BARRIER_PKT_SIZE )) +if (WARN_ON (len <0 || len <CORESIGHT_BARRIER_PKT_SIZE ))return -EINVAL ;coresight_insert_barrier_packet (bufp);return offset +CORESIGHT_BARRIER_PKT_SIZE ;
drivers/input/joystick/xpad.c +4 -1
@@ -503,6 +503,9 @@ struct xboxone_init_packet { } +#define GIP_WIRED_INTF_DATA 0 +#define GIP_WIRED_INTF_AUDIO 1 +/* * This packet is required for all Xbox One pads with 2015 * or later firmware installed (or present from the factory).
@@ -1827,7 +1830,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id }if (xpad->xtype ==XTYPE_XBOXONE && - intf->cur_altsetting->desc.bInterfaceNumber !=0 ) { + intf->cur_altsetting->desc.bInterfaceNumber !=GIP_WIRED_INTF_DATA ) {/* * The Xbox One controller lists three interfaces all with the * same interface class, subclass and protocol. Differentiate by
drivers/mcb/mcb-pci.c +25 -2
@@ -34,7 +34,7 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) {struct resource *res;struct priv *priv; -int ret; +int ret, table_size;unsigned long flags; priv =devm_kzalloc (&pdev->dev,sizeof (struct priv ),GFP_KERNEL );
@@ -93,7 +93,30 @@ static int mcb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)if (ret <0 ) goto out_mcb_bus; -dev_dbg (&pdev->dev,"Found %d cells\n" , ret); + table_size = ret; + +if (table_size <CHAM_HEADER_SIZE ) { +/* Release the previous resources */ +devm_iounmap (&pdev->dev, priv->base); +devm_release_mem_region (&pdev->dev, priv->mapbase,CHAM_HEADER_SIZE ); + +/* Then, allocate it again with the actual chameleon table size */ + res =devm_request_mem_region (&pdev->dev, priv->mapbase, + table_size, +KBUILD_MODNAME ); +if (!res) { +dev_err (&pdev->dev,"Failed to request PCI memory\n" ); + ret = -EBUSY ; + goto out_mcb_bus; + } + + priv->base =devm_ioremap (&pdev->dev, priv->mapbase, table_size); +if (!priv->base) { +dev_err (&pdev->dev,"Cannot ioremap\n" ); + ret = -ENOMEM ; + goto out_mcb_bus; + } + }mcb_bus_add_devices (priv->bus);
drivers/media/pci/netup_unidvb/netup_unidvb_core.c +1 -1
@@ -706,7 +706,7 @@ static void netup_unidvb_dma_fini(struct netup_unidvb_dev *ndev, int num)netup_unidvb_dma_enable (dma,0 );msleep (50 );cancel_work_sync (&dma->work); -del_timer (&dma->timeout); +del_timer_sync (&dma->timeout); }static int netup_unidvb_dma_setup (struct netup_unidvb_dev *ndev)
drivers/media/radio/radio-shark.c +10 -0
@@ -316,6 +316,16 @@ static int usb_shark_probe(struct usb_interface *intf, {struct shark_device *shark;int retval = -ENOMEM ; +static const u8 ep_addresses[] = { +SHARK_IN_EP |USB_DIR_IN , +SHARK_OUT_EP |USB_DIR_OUT , +0 }; + +/* Are the expected endpoints present? */ +if (!usb_check_int_endpoints (intf, ep_addresses)) { +dev_err (&intf->dev,"Invalid radioSHARK device\n" ); +return -EINVAL ; + } shark =kzalloc (sizeof (struct shark_device ),GFP_KERNEL );if (!shark)
drivers/media/radio/radio-shark2.c +10 -0
@@ -282,6 +282,16 @@ static int usb_shark_probe(struct usb_interface *intf, {struct shark_device *shark;int retval = -ENOMEM ; +static const u8 ep_addresses[] = { +SHARK_IN_EP |USB_DIR_IN , +SHARK_OUT_EP |USB_DIR_OUT , +0 }; + +/* Are the expected endpoints present? */ +if (!usb_check_int_endpoints (intf, ep_addresses)) { +dev_err (&intf->dev,"Invalid radioSHARK2 device\n" ); +return -EINVAL ; + } shark =kzalloc (sizeof (struct shark_device ),GFP_KERNEL );if (!shark)
drivers/memstick/host/r592.c +1 -1
@@ -831,7 +831,7 @@ static void r592_remove(struct pci_dev *pdev)/* Stop the processing thread. That ensures that we won't take any more requests */ kthread_stop (dev->io_thread); - +del_timer_sync (&dev->detect_timer);r592_enable_device (dev, false);while (!error && dev->req) {
drivers/message/fusion/mptlan.c +2 -0
@@ -1430,7 +1430,9 @@ mptlan_remove(struct pci_dev *pdev) {MPT_ADAPTER *ioc =pci_get_drvdata (pdev);struct net_device *dev = ioc->netdev; +struct mpt_lan_priv *priv =netdev_priv (dev); +cancel_delayed_work_sync (&priv->post_buckets_task);if (dev !=NULL ) {unregister_netdev (dev);free_netdev (dev);
drivers/mfd/dln2.c +1 -0
@@ -800,6 +800,7 @@ static int dln2_probe(struct usb_interface *interface,dln2_stop_rx_urbs (dln2); out_free: +usb_put_dev (dln2->usb_dev);dln2_free (dln2);return ret;
drivers/net/ethernet/3com/3c589_cs.c +10 -1
@@ -196,6 +196,7 @@ static int tc589_probe(struct pcmcia_device *link) {struct el3_private *lp;struct net_device *dev; +int ret;dev_dbg (&link->dev,"3c589_attach()\n" );
@@ -219,7 +220,15 @@ static int tc589_probe(struct pcmcia_device *link) dev->ethtool_ops = &netdev_ethtool_ops; -return tc589_config (link); + ret =tc589_config (link); +if (ret) + goto err_free_netdev; + +return 0 ; + +err_free_netdev: +free_netdev (dev); +return ret; }static void tc589_detach (struct pcmcia_device *link)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +5 -4
@@ -2980,7 +2980,7 @@ static int bcmgenet_open(struct net_device *dev)return ret; } -static void bcmgenet_netif_stop (struct net_device *dev) +static void bcmgenet_netif_stop (struct net_device *dev,bool stop_phy) {struct bcmgenet_priv *priv =netdev_priv (dev);
@@ -2995,7 +2995,8 @@ static void bcmgenet_netif_stop(struct net_device *dev)/* Disable MAC transmit. TX DMA disabled must be done before this */ umac_enable_set (priv,CMD_TX_EN , false); -phy_stop (dev->phydev); +if (stop_phy) +phy_stop (dev->phydev);bcmgenet_disable_rx_napi (priv);bcmgenet_intr_disable (priv);
@@ -3021,7 +3022,7 @@ static int bcmgenet_close(struct net_device *dev)netif_dbg (priv, ifdown, dev,"bcmgenet_close\n" ); -bcmgenet_netif_stop (dev); +bcmgenet_netif_stop (dev, false);/* Really kill the PHY state machine and disconnect from it */ phy_disconnect (dev->phydev);
@@ -3721,7 +3722,7 @@ static int bcmgenet_suspend(struct device *d)netif_device_detach (dev); -bcmgenet_netif_stop (dev); +bcmgenet_netif_stop (dev, true);if (!device_may_wakeup (d))phy_suspend (dev->phydev);
drivers/net/ethernet/freescale/fec_main.c +10 -3
@@ -3721,7 +3721,9 @@ fec_drv_remove(struct platform_device *pdev) ret =pm_runtime_get_sync (&pdev->dev);if (ret <0 ) -return ret; +dev_err (&pdev->dev, +"Failed to resume device in remove callback (%pe)\n" , +ERR_PTR (ret));cancel_work_sync (&fep->tx_timeout_work);fec_ptp_stop (pdev);
@@ -3734,8 +3736,13 @@ fec_drv_remove(struct platform_device *pdev)of_phy_deregister_fixed_link (np);of_node_put (fep->phy_node); -clk_disable_unprepare (fep->clk_ahb); -clk_disable_unprepare (fep->clk_ipg); +/* After pm_runtime_get_sync() failed, the clks are still off, so skip +* disabling them again. +*/ +if (ret >=0 ) { +clk_disable_unprepare (fep->clk_ahb); +clk_disable_unprepare (fep->clk_ipg); + }pm_runtime_put_noidle (&pdev->dev);pm_runtime_disable (&pdev->dev);
drivers/net/ethernet/intel/igb/e1000_mac.c +2 -2
@@ -425,7 +425,7 @@ void igb_mta_set(struct e1000_hw *hw, u32 hash_value)static u32 igb_hash_mc_addr (struct e1000_hw *hw,u8 *mc_addr) {u32 hash_value, hash_mask; -u8 bit_shift =0 ; +u8 bit_shift =1 ;/* Register count multiplied by bits per register */ hash_mask = (hw->mac.mta_reg_count *32 ) -1 ;
@@ -433,7 +433,7 @@ static u32 igb_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)/* For a mc_filter_type of 0, bit_shift is the number of left-shifts * where 0xFF would still fall within the hash mask. */ -while (hash_mask >> bit_shift !=0xFF ) +while (hash_mask >> bit_shift !=0xFF && bit_shift <4 ) bit_shift++;/* The portion of the address that is used for the hash table
drivers/net/ethernet/nvidia/forcedeth.c +1 -0
@@ -6061,6 +6061,7 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)return 0 ; out_error: +nv_mgmt_release_sema (dev);if (phystate_orig)writel (phystate|NVREG_ADAPTCTL_RUNNING , base + NvRegAdapterControl); out_freering:
drivers/net/ethernet/pasemi/pasemi_mac.c +1 -1
@@ -1435,7 +1435,7 @@ static void pasemi_mac_queue_csdesc(const struct sk_buff *skb,write_dma_reg (PAS_DMA_TXCHAN_INCR (txring->chan.chno),2 ); } -static int pasemi_mac_start_tx (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t pasemi_mac_start_tx (struct sk_buff *skb,struct net_device *dev) {struct pasemi_mac *const mac =netdev_priv (dev);struct pasemi_mac_txring *const txring =tx_ring (mac);
drivers/net/ethernet/sun/cassini.c +2 -0
@@ -5138,6 +5138,8 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)cas_shutdown (cp);mutex_unlock (&cp->pm_mutex); +vfree (cp->fw_data); +pci_iounmap (pdev, cp->regs);
drivers/net/ipvlan/ipvlan_core.c +6 -0
@@ -443,6 +443,9 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb) goto err; }skb_dst_set (skb, &rt->dst); + +memset (IPCB (skb),0 ,sizeof (*IPCB (skb))); + err =ip_local_out (net, skb->sk, skb);if (unlikely (net_xmit_eval (err))) dev->stats.tx_errors++;
@@ -481,6 +484,9 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb) goto err; }skb_dst_set (skb, dst); + +memset (IP6CB (skb),0 ,sizeof (*IP6CB (skb))); + err =ip6_local_out (net, skb->sk, skb);if (unlikely (net_xmit_eval (err))) dev->stats.tx_errors++;
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +7 -6
@@ -1238,13 +1238,14 @@ static u16 brcmf_map_fw_linkdown_reason(const struct brcmf_event_msg *e)static int brcmf_set_pmk (struct brcmf_if *ifp,const u8 *pmk_data,u16 pmk_len) {struct brcmf_wsec_pmk_le pmk; -int i, err; +int err; + +memset (&pmk,0 ,sizeof (pmk)); -/* convert to firmware key format */ - pmk.key_len =cpu_to_le16 (pmk_len <<1 ); - pmk.flags =cpu_to_le16 (BRCMF_WSEC_PASSPHRASE ); -for (i =0 ; i < pmk_len; i++) -snprintf (&pmk.key[2 * i],3 ,"%02x" , pmk_data[i]); +/* pass pmk directly */ + pmk.key_len =cpu_to_le16 (pmk_len); + pmk.flags =cpu_to_le16 (0 ); +memcpy (pmk.key, pmk_data, pmk_len);/* store psk in firmware */ err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_WSEC_PMK,
drivers/net/wireless/intel/iwlwifi/dvm/sta.c +4 -1
@@ -1101,6 +1101,7 @@ static int iwlagn_send_sta_key(struct iwl_priv *priv, {__le16 key_flags;struct iwl_addsta_cmd sta_cmd; +size_t to_copy;int i;spin_lock_bh (&priv->sta_lock);
@@ -1120,7 +1121,9 @@ static int iwlagn_send_sta_key(struct iwl_priv *priv, sta_cmd.key.tkip_rx_tsc_byte2 = tkip_iv32;for (i =0 ; i <5 ; i++) sta_cmd.key.tkip_rx_ttak[i] =cpu_to_le16 (tkip_p1k[i]); -memcpy (sta_cmd.key.key, keyconf->key, keyconf->keylen); +/* keyconf may contain MIC rx/tx keys which iwl does not use */ + to_copy =min_t (size_t,sizeof (sta_cmd.key.key), keyconf->keylen); +memcpy (sta_cmd.key.key, keyconf->key, to_copy);break ;case WLAN_CIPHER_SUITE_WEP104 : key_flags |=STA_KEY_FLG_KEY_SIZE_MSK ;
drivers/phy/st/phy-miphy28lp.c +10 -32
80 lines not on this page · raw message
drivers/power/supply/bq27xxx_battery.c +21 -20
75 lines not on this page · raw message
drivers/power/supply/bq27xxx_battery_i2c.c +2 -1
@@ -187,7 +187,7 @@ static int bq27xxx_battery_i2c_probe(struct i2c_client *client,i2c_set_clientdata (client, di);if (client->irq) { - ret =devm_request_threaded_irq (&client->dev, client->irq, + ret =request_threaded_irq (client->irq,NULL , bq27xxx_battery_irq_handler_thread,IRQF_ONESHOT , di->name, di);
@@ -217,6 +217,7 @@ static int bq27xxx_battery_i2c_remove(struct i2c_client *client) {struct bq27xxx_device_info *di =i2c_get_clientdata (client); +free_irq (client->irq, di);bq27xxx_battery_teardown (di);mutex_lock (&battery_mutex);
drivers/power/supply/power_supply_leds.c +3 -2
@@ -35,8 +35,9 @@ static void power_supply_update_bat_leds(struct power_supply *psy)led_trigger_event (psy->charging_full_trig,LED_FULL );led_trigger_event (psy->charging_trig,LED_OFF );led_trigger_event (psy->full_trig,LED_FULL ); -led_trigger_event (psy->charging_blink_full_solid_trig, -LED_FULL ); +/* Going from blink to LED on requires a LED_OFF event to stop blink */ +led_trigger_event (psy->charging_blink_full_solid_trig,LED_OFF ); +led_trigger_event (psy->charging_blink_full_solid_trig,LED_FULL );break ;case POWER_SUPPLY_STATUS_CHARGING :led_trigger_event (psy->charging_full_trig,LED_FULL );
drivers/power/supply/sbs-charger.c +1 -1
@@ -29,7 +29,7 @@#define SBS_CHARGER_REG_STATUS 0x13#define SBS_CHARGER_REG_ALARM_WARNING 0x16 -#define SBS_CHARGER_STATUS_CHARGE_INHIBITED BIT(1) +#define SBS_CHARGER_STATUS_CHARGE_INHIBITED BIT(0)#define SBS_CHARGER_STATUS_RES_COLD BIT(9)#define SBS_CHARGER_STATUS_RES_HOT BIT(10)#define SBS_CHARGER_STATUS_BATTERY_PRESENT BIT(14)
drivers/s390/cio/qdio.h +13 -12
@@ -88,15 +88,15 @@ enum qdio_irq_states {static inline int do_sqbs (u64 token,unsigned char state,int queue,int *start,int *count) { - register unsigned long _ccq asm ("0") = *count; - register unsigned long _token asm ("1") = token;unsigned long _queuestart = ((unsigned long )queue <<32 ) | *start; +unsigned long _ccq = *count; asmvolatile ( -" .insn rsy,0xeb000000008A,%1,0,0(%2)" - :"+d" (_ccq),"+d" (_queuestart) - :"d" ((unsigned long )state),"d" (_token) - :"memory" ,"cc" ); +" lgr 1,%[token]\n" +" .insn rsy,0xeb000000008a,%[qs],%[ccq],0(%[state])" + : [ccq]"+&d" (_ccq), [qs]"+&d" (_queuestart) + : [state]"a" ((unsigned long )state), [token]"d" (token) + :"memory" ,"cc" ,"1" ); *count = _ccq &0xff ; *start = _queuestart &0xff ;
@@ -106,16 +106,17 @@ static inline int do_sqbs(u64 token, unsigned char state, int queue,static inline int do_eqbs (u64 token,unsigned char *state,int queue,int *start,int *count,int ack) { - register unsigned long _ccq asm ("0") = *count; - register unsigned long _token asm ("1") = token;unsigned long _queuestart = ((unsigned long )queue <<32 ) | *start;unsigned long _state = (unsigned long )ack <<63 ; +unsigned long _ccq = *count; asmvolatile ( -" .insn rrf,0xB99c0000,%1,%2,0,0" - :"+d" (_ccq),"+d" (_queuestart),"+d" (_state) - :"d" (_token) - :"memory" ,"cc" ); +" lgr 1,%[token]\n" +" .insn rrf,0xb99c0000,%[qs],%[state],%[ccq],0" + : [ccq]"+&d" (_ccq), [qs]"+&d" (_queuestart), + [state]"+&d" (_state) + : [token]"d" (token) + :"memory" ,"cc" ,"1" ); *count = _ccq &0xff ; *start = _queuestart &0xff ; *state = _state &0xff ;
drivers/s390/cio/qdio_main.c +33 -29
94 lines not on this page · raw message
drivers/spi/spi-fsl-cpm.c +23 -0
@@ -25,6 +25,7 @@#include <linux/spi/spi.h> #include <linux/types.h> #include <linux/platform_device.h> +#include <linux/byteorder/generic.h> #include "spi-fsl-cpm.h" #include "spi-fsl-lib.h"
@@ -124,6 +125,21 @@ int fsl_spi_cpm_bufs(struct mpc8xxx_spi *mspi, mspi->rx_dma = mspi->dma_dummy_rx; mspi->map_rx_dma =0 ; } +if (t->bits_per_word ==16 && t->tx_buf) { +const u16 *src = t->tx_buf; +u16 *dst; +int i; + + dst =kmalloc (t->len,GFP_KERNEL ); +if (!dst) +return -ENOMEM ; + +for (i =0 ; i < t->len >>1 ; i++) + dst[i] =cpu_to_le16p (src + i); + + mspi->tx = dst; + mspi->map_tx_dma =1 ; + }if (mspi->map_tx_dma) {void *nonconst_tx = (void *)mspi->tx;/* shut up gcc */
@@ -177,6 +193,13 @@ void fsl_spi_cpm_bufs_complete(struct mpc8xxx_spi *mspi)if (mspi->map_rx_dma)dma_unmap_single (dev, mspi->rx_dma, t->len,DMA_FROM_DEVICE ); mspi->xfer_in_progress =NULL ; + +if (t->bits_per_word ==16 && t->rx_buf) { +int i; + +for (i =0 ; i < t->len; i +=2 ) +le16_to_cpus (t->rx_buf + i); + } }EXPORT_SYMBOL_GPL (fsl_spi_cpm_bufs_complete);
drivers/spi/spi-fsl-spi.c +40 -25
95 lines not on this page · raw message
drivers/spi/spi-imx.c +18 -6
@@ -237,6 +237,18 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi,return true; } +/* +* Note the number of natively supported chip selects for MX51 is 4. Some +* devices may have less actual SS pins but the register map supports 4. When +* using gpio chip selects the cs values passed into the macros below can go +* outside the range 0 - 3. We therefore need to limit the cs value to avoid +* corrupting bits outside the allocated locations. +* +* The simplest way to do this is to just mask the cs bits to 2 bits. This +* still allows all 4 native chip selects to work as well as gpio chip selects +* (which can use any of the 4 chip select configurations). +*/ +#define MX51_ECSPI_CTRL 0x08#define MX51_ECSPI_CTRL_ENABLE (1 << 0)#define MX51_ECSPI_CTRL_XCH (1 << 2)
@@ -245,16 +257,16 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi,#define MX51_ECSPI_CTRL_DRCTL (drctl) ((drctl) << 16)#define MX51_ECSPI_CTRL_POSTDIV_OFFSET 8#define MX51_ECSPI_CTRL_PREDIV_OFFSET 12 -#define MX51_ECSPI_CTRL_CS (cs) ((cs) << 18) +#define MX51_ECSPI_CTRL_CS (cs) ((cs & 3) << 18)#define MX51_ECSPI_CTRL_BL_OFFSET 20#define MX51_ECSPI_CTRL_BL_MASK (0xfff << 20)#define MX51_ECSPI_CONFIG 0x0c -#define MX51_ECSPI_CONFIG_SCLKPHA (cs) (1 << ((cs) + 0)) -#define MX51_ECSPI_CONFIG_SCLKPOL (cs) (1 << ((cs) + 4)) -#define MX51_ECSPI_CONFIG_SBBCTRL (cs) (1 << ((cs) + 8)) -#define MX51_ECSPI_CONFIG_SSBPOL (cs) (1 << ((cs) + 12)) -#define MX51_ECSPI_CONFIG_SCLKCTL (cs) (1 << ((cs) + 20)) +#define MX51_ECSPI_CONFIG_SCLKPHA (cs) (1 << ((cs & 3) + 0)) +#define MX51_ECSPI_CONFIG_SCLKPOL (cs) (1 << ((cs & 3) + 4)) +#define MX51_ECSPI_CONFIG_SBBCTRL (cs) (1 << ((cs & 3) + 8)) +#define MX51_ECSPI_CONFIG_SSBPOL (cs) (1 << ((cs & 3) + 12)) +#define MX51_ECSPI_CONFIG_SCLKCTL (cs) (1 << ((cs & 3) + 20))#define MX51_ECSPI_INT 0x10#define MX51_ECSPI_INT_TEEN (1 << 0)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3 -3
@@ -61,9 +61,9 @@ static const struct rtl819x_ops rtl819xp_ops = { };static struct pci_device_id rtl8192_pci_id_tbl[] = { - {RTL_PCI_DEVICE (0x10ec ,0x8192 , rtl819xp_ops)}, - {RTL_PCI_DEVICE (0x07aa ,0x0044 , rtl819xp_ops)}, - {RTL_PCI_DEVICE (0x07aa ,0x0047 , rtl819xp_ops)}, + {PCI_DEVICE (0x10ec ,0x8192 )}, + {PCI_DEVICE (0x07aa ,0x0044 )}, + {PCI_DEVICE (0x07aa ,0x0047 )}, {} };
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -5
@@ -67,11 +67,6 @@#define IS_HARDWARE_TYPE_8192SE (_priv) \ (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192SE) -#define RTL_PCI_DEVICE (vend, dev, cfg) \ - .vendor = (vend), .device = (dev), \ - .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \ - .driver_data = (kernel_ulong_t)&(cfg) -#define TOTAL_CAM_ENTRY 32#define CAM_CONTENT_COUNT 8
drivers/tty/serial/8250/8250_core.c +1 -0
@@ -1125,6 +1125,7 @@ void serial8250_unregister_port(int line) uart->port.type =PORT_UNKNOWN ; uart->port.dev = &serial8250_isa_devs->dev; uart->capabilities =0 ; +serial8250_init_port (uart);serial8250_apply_quirks (uart);uart_add_one_port (&serial8250_reg, &uart->port); }else {
drivers/tty/serial/8250/8250_pci.c +5 -0
@@ -1648,6 +1648,8 @@ pci_wch_ch38x_setup(struct serial_private *priv,#define PCI_SUBDEVICE_ID_SIIG_DUAL_30 0x2530#define PCI_VENDOR_ID_ADVANTECH 0x13fe#define PCI_DEVICE_ID_INTEL_CE4100_UART 0x2e66 +#define PCI_DEVICE_ID_ADVANTECH_PCI1600 0x1600 +#define PCI_DEVICE_ID_ADVANTECH_PCI1600_1611 0x1611#define PCI_DEVICE_ID_ADVANTECH_PCI3620 0x3620#define PCI_DEVICE_ID_ADVANTECH_PCI3618 0x3618#define PCI_DEVICE_ID_ADVANTECH_PCIf618 0xf618
@@ -3840,6 +3842,9 @@ static SIMPLE_DEV_PM_OPS(pciserial_pm_ops, pciserial_suspend_one, pciserial_resume_one);static const struct pci_device_id serial_pci_tbl[] = { + {PCI_VENDOR_ID_ADVANTECH ,PCI_DEVICE_ID_ADVANTECH_PCI1600 , +PCI_DEVICE_ID_ADVANTECH_PCI1600_1611 ,PCI_ANY_ID ,0 ,0 , + pbn_b0_4_921600 },/* Advantech use PCI_DEVICE_ID_ADVANTECH_PCI3620 (0x3620) as 'PCI_SUBVENDOR_ID' */ {PCI_VENDOR_ID_ADVANTECH ,PCI_DEVICE_ID_ADVANTECH_PCI3620 ,PCI_DEVICE_ID_ADVANTECH_PCI3620 ,0x0001 ,0 ,0 ,
drivers/tty/serial/arc_uart.c +4 -3
@@ -613,10 +613,11 @@ static int arc_serial_probe(struct platform_device *pdev) } uart->baud = val; - port->membase =of_iomap (np,0 ); -if (!port->membase) + port->membase =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (port->membase)) {/* No point of dev_err since UART itself is hosed here */ -return -ENXIO ; +return PTR_ERR (port->membase); + } port->irq =irq_of_parse_and_map (np,0 );
drivers/tty/vt/vc_screen.c +38 -19
102 lines not on this page · raw message
drivers/usb/core/usb.c +76 -0
82 lines not on this page · raw message
drivers/usb/gadget/function/u_ether.c +4 -35
@@ -17,6 +17,8 @@#include <linux/etherdevice.h> #include <linux/ethtool.h> #include <linux/if_vlan.h> +#include <linux/string_helpers.h> +#include <linux/usb/composite.h> #include "u_ether.h"
@@ -102,41 +104,6 @@ static inline int qlen(struct usb_gadget *gadget, unsigned qmult)/*-------------------------------------------------------------------------*/ -/* REVISIT there must be a better way than having two sets -* of debug calls ... -*/ - -#undef DBG -#undef VDBG -#undef ERROR -#undef INFO - -#define xprintk(d, level, fmt, args...) \ - printk(level "%s: " fmt , (d)->net->name , ## args) - -#ifdef DEBUG -#undef DEBUG -#define DBG(dev, fmt, args...) \ - xprintk(dev , KERN_DEBUG , fmt , ## args) -#else -#define DBG(dev, fmt, args...) \ - do { } while (0) -#endif /* DEBUG */ - -#ifdef VERBOSE_DEBUG -#define VDBG DBG -#else -#define VDBG(dev, fmt, args...) \ - do { } while (0) -#endif /* DEBUG */ - -#define ERROR(dev, fmt, args...) \ - xprintk(dev , KERN_ERR , fmt , ## args) -#define INFO(dev, fmt, args...) \ - xprintk(dev , KERN_INFO , fmt , ## args) - -/*-------------------------------------------------------------------------*/ -/* NETWORK DRIVER HOOKUP (to the layer above this driver) */ static void eth_get_drvinfo (struct net_device *net,struct ethtool_drvinfo *p)
@@ -974,6 +941,8 @@ int gether_get_host_addr_cdc(struct net_device *net, char *host_addr, int len) dev =netdev_priv (net);snprintf (host_addr, len,"%pm" , dev->host_mac); +string_upper (host_addr, host_addr); +return strlen (host_addr); }EXPORT_SYMBOL_GPL (gether_get_host_addr_cdc);
drivers/usb/misc/sisusbvga/sisusb.c +14 -0
@@ -3016,6 +3016,20 @@ static int sisusb_probe(struct usb_interface *intf,struct usb_device *dev =interface_to_usbdev (intf);struct sisusb_usb_data *sisusb;int retval =0 , i; +static const u8 ep_addresses[] = { +SISUSB_EP_GFX_IN |USB_DIR_IN , +SISUSB_EP_GFX_OUT |USB_DIR_OUT , +SISUSB_EP_GFX_BULK_OUT |USB_DIR_OUT , +SISUSB_EP_GFX_LBULK_OUT |USB_DIR_OUT , +SISUSB_EP_BRIDGE_IN |USB_DIR_IN , +SISUSB_EP_BRIDGE_OUT |USB_DIR_OUT , +0 }; + +/* Are the expected endpoints present? */ +if (!usb_check_bulk_endpoints (intf, ep_addresses)) { +dev_err (&intf->dev,"Invalid USB2VGA device\n" ); +return -EINVAL ; + }dev_info (&dev->dev,"USB2VGA dongle found at address %d\n" , dev->devnum);
drivers/usb/storage/scsiglue.c +21 -7
@@ -392,22 +392,25 @@ static DEF_SCSI_QCMD(queuecommand)***********************************************************************/ /* Command timeout and abort */ -static int command_abort (struct scsi_cmnd *srb) +static int command_abort_matching (struct us_data *us,struct scsi_cmnd *srb_match) { -struct us_data *us =host_to_us (srb->device->host); - -usb_stor_dbg (us,"%s called\n" , __func__); -/* * us->srb together with the TIMED_OUT, RESETTING, and ABORTING * bits are protected by the host lock. */ scsi_lock (us_to_host (us)); -/* Is this command still active? */ -if (us->srb != srb) { +/* is there any active pending command to abort ? */ +if (!us->srb) {scsi_unlock (us_to_host (us));usb_stor_dbg (us,"-- nothing to abort\n" ); +return SUCCESS ; + } + +/* Does the command match the passed srb if any ? */ +if (srb_match && us->srb != srb_match) { +scsi_unlock (us_to_host (us)); +usb_stor_dbg (us,"-- pending command mismatch\n" );return FAILED ; }
@@ -430,6 +433,14 @@ static int command_abort(struct scsi_cmnd *srb)return SUCCESS ; } +static int command_abort (struct scsi_cmnd *srb) +{ +struct us_data *us =host_to_us (srb->device->host); + +usb_stor_dbg (us,"%s called\n" , __func__); +return command_abort_matching (us, srb); +} +/* * This invokes the transport reset mechanism to reset the state of the * device
@@ -441,6 +452,9 @@ static int device_reset(struct scsi_cmnd *srb)usb_stor_dbg (us,"%s called\n" , __func__); +/* abort any pending command before reset */ +command_abort_matching (us,NULL ); +/* lock the device pointers and do the reset */ mutex_lock (&(us->dev_mutex)); result = us->transport_reset (us);
drivers/usb/typec/altmodes/displayport.c +4 -0
@@ -501,6 +501,10 @@ static ssize_t pin_assignment_show(struct device *dev,mutex_unlock (&dp->lock); +/* get_current_pin_assignments can return 0 when no matching pin assignments are found */ +if (len ==0 ) + len++; + buf[len -1 ] ='\n' ;return len; }
drivers/usb/typec/tcpm.c +15 -1
@@ -1006,7 +1006,21 @@ static bool svdm_consume_svids(struct tcpm_port *port, const __le32 *payload, pmdata->svids[pmdata->nsvids++] = svid;tcpm_log (port,"SVID %d: 0x%x" , pmdata->nsvids, svid); } -return true; + +/* +* PD3.0 Spec 6.4.4.3.2: The SVIDs are returned 2 per VDO (see Table +* 6-43), and can be returned maximum 6 VDOs per response (see Figure +* 6-19). If the Respondersupports 12 or more SVID then the Discover +* SVIDs Command Shall be executed multiple times until a Discover +* SVIDs VDO is returned ending either with a SVID value of 0x0000 in +* the last part of the last VDO or with a VDO containing two SVIDs +* with values of 0x0000. +* +* However, some odd dockers support SVIDs less than 12 but without +* 0x0000 in the last VDO, so we need to break the Discover SVIDs +* request and return false here. +*/ +return cnt ==7 ; abort:tcpm_log (port,"SVID_DISCOVERY_MAX(%d) too low!" ,SVID_DISCOVERY_MAX );return false;
drivers/xen/pvcalls-back.c +4 -5
@@ -330,8 +330,10 @@ static struct sock_mapping *pvcalls_new_active_socket(void *page; map =kzalloc (sizeof (*map),GFP_KERNEL ); -if (map ==NULL ) +if (map ==NULL ) { +sock_release (sock);return NULL ; + } map->fedata = fedata; map->sock = sock;
@@ -423,10 +425,8 @@ static int pvcalls_back_connect(struct xenbus_device *dev, req->u.connect.ref, req->u.connect.evtchn, sock); -if (!map) { +if (!map) ret = -EFAULT ; -sock_release (sock); - } out: rsp =RING_GET_RESPONSE (&fedata->ring, fedata->ring.rsp_prod_pvt++);
@@ -567,7 +567,6 @@ static void __pvcalls_back_accept(struct work_struct *work) sock);if (!map) { ret = -EFAULT ; -sock_release (sock); goto out_error; }
fs/btrfs/disk-io.c +9 -0
@@ -4348,7 +4348,11 @@ static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root)*/ inode =igrab (&btrfs_inode->vfs_inode);if (inode) { +unsigned int nofs_flag; + + nofs_flag =memalloc_nofs_save ();invalidate_inode_pages2 (inode->i_mapping); +memalloc_nofs_restore (nofs_flag);iput (inode); }spin_lock (&root->delalloc_lock);
@@ -4466,7 +4470,12 @@ static void btrfs_cleanup_bg_io(struct btrfs_block_group_cache *cache) inode = cache->io_ctl.inode;if (inode) { +unsigned int nofs_flag; + + nofs_flag =memalloc_nofs_save ();invalidate_inode_pages2 (inode->i_mapping); +memalloc_nofs_restore (nofs_flag); +BTRFS_I (inode)->generation =0 ; cache->io_ctl.inode =NULL ;iput (inode);
fs/btrfs/free-space-cache.c +4 -3
@@ -783,15 +783,16 @@ static int __load_free_space_cache(struct btrfs_root *root, struct inode *inode, }spin_lock (&ctl->tree_lock); ret =link_free_space (ctl, e); - ctl->total_bitmaps++; - ctl->op->recalc_thresholds (ctl); -spin_unlock (&ctl->tree_lock);if (ret) { +spin_unlock (&ctl->tree_lock);btrfs_err (fs_info,"Duplicate entries in free space cache, dumping" );kmem_cache_free (btrfs_free_space_cachep, e); goto free_cache; } + ctl->total_bitmaps++; + ctl->op->recalc_thresholds (ctl); +spin_unlock (&ctl->tree_lock);list_add_tail (&e->list, &bitmaps); }
fs/btrfs/inode.c +6 -6
@@ -6620,7 +6620,7 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,if (IS_ERR (trans))return PTR_ERR (trans); - err =btrfs_find_free_ino (root, &objectid); + err =btrfs_find_free_objectid (root, &objectid);if (err) goto out_unlock;
@@ -6684,7 +6684,7 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,if (IS_ERR (trans))return PTR_ERR (trans); - err =btrfs_find_free_ino (root, &objectid); + err =btrfs_find_free_objectid (root, &objectid);if (err) goto out_unlock;
@@ -6837,7 +6837,7 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)if (IS_ERR (trans))return PTR_ERR (trans); - err =btrfs_find_free_ino (root, &objectid); + err =btrfs_find_free_objectid (root, &objectid);if (err) goto out_fail;
@@ -9819,7 +9819,7 @@ static int btrfs_whiteout_for_rename(struct btrfs_trans_handle *trans,u64 objectid;u64 index; - ret =btrfs_find_free_ino (root, &objectid); + ret =btrfs_find_free_objectid (root, &objectid);if (ret)return ret;
@@ -10316,7 +10316,7 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,if (IS_ERR (trans))return PTR_ERR (trans); - err =btrfs_find_free_ino (root, &objectid); + err =btrfs_find_free_objectid (root, &objectid);if (err) goto out_unlock;
@@ -10600,7 +10600,7 @@ static int btrfs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)if (IS_ERR (trans))return PTR_ERR (trans); - ret =btrfs_find_free_ino (root, &objectid); + ret =btrfs_find_free_objectid (root, &objectid);if (ret) goto out;
fs/ceph/snap.c +13 -0
@@ -976,6 +976,19 @@ void ceph_handle_snap(struct ceph_mds_client *mdsc,continue ;adjust_snap_realm_parent (mdsc, child, realm->ino); } + }else { +/* +* In the non-split case both 'num_split_inos' and +* 'num_split_realms' should be 0, making this a no-op. +* However the MDS happens to populate 'split_realms' list +* in one of the UPDATE op cases by mistake. +* +* Skip both lists just in case to ensure that 'p' is +* positioned at the start of realm info, as expected by +* ceph_update_snap_trace(). +*/ + p +=sizeof (u64) * num_split_inos; + p +=sizeof (u64) * num_split_realms; }/*
fs/ext2/ext2.h +1 -0
@@ -177,6 +177,7 @@ static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)#define EXT2_MIN_BLOCK_SIZE 1024#define EXT2_MAX_BLOCK_SIZE 4096#define EXT2_MIN_BLOCK_LOG_SIZE 10 +#define EXT2_MAX_BLOCK_LOG_SIZE 16#define EXT2_BLOCK_SIZE (s) ((s)->s_blocksize)#define EXT2_ADDR_PER_BLOCK (s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))#define EXT2_BLOCK_SIZE_BITS (s) ((s)->s_blocksize_bits)
fs/ext2/super.c +7 -0
@@ -978,6 +978,13 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) goto failed_mount; } +if (le32_to_cpu (es->s_log_block_size) > + (EXT2_MAX_BLOCK_LOG_SIZE -BLOCK_SIZE_BITS )) { +ext2_msg (sb,KERN_ERR , +"Invalid log block size: %u" , +le32_to_cpu (es->s_log_block_size)); + goto failed_mount; + } blocksize =BLOCK_SIZE <<le32_to_cpu (sbi->s_es->s_log_block_size);if (sbi->s_mount_opt &EXT2_MOUNT_DAX ) {
fs/ext4/mballoc.c +41 -24
107 lines not on this page · raw message
fs/f2fs/checkpoint.c +10 -2
@@ -273,8 +273,15 @@ static int __f2fs_write_meta_page(struct page *page,trace_f2fs_writepage (page,META ); -if (unlikely (f2fs_cp_error (sbi))) +if (unlikely (f2fs_cp_error (sbi))) { +if (is_sbi_flag_set (sbi,SBI_IS_CLOSE )) { +ClearPageUptodate (page); +dec_page_count (sbi,F2FS_DIRTY_META ); +unlock_page (page); +return 0 ; + } goto redirty_out; + }if (unlikely (is_sbi_flag_set (sbi,SBI_POR_DOING ))) goto redirty_out;if (wbc->for_reclaim && page->index <GET_SUM_BLOCK (sbi,0 ))
@@ -1185,7 +1192,8 @@ void f2fs_wait_on_all_pages_writeback(struct f2fs_sb_info *sbi)if (!get_pages (sbi,F2FS_WB_CP_DATA ))break ; -if (unlikely (f2fs_cp_error (sbi))) +if (unlikely (f2fs_cp_error (sbi) && + !is_sbi_flag_set (sbi,SBI_IS_CLOSE )))break ;io_schedule_timeout (5 *HZ );
fs/f2fs/data.c +2 -1
@@ -1885,7 +1885,8 @@ static int __write_data_page(struct page *page, bool *submitted,* don't drop any dirty dentry pages for keeping lastest * directory structure. */ -if (S_ISDIR (inode->i_mode)) +if (S_ISDIR (inode->i_mode) && + !is_sbi_flag_set (sbi,SBI_IS_CLOSE )) goto redirty_out; goto out; }
fs/gfs2/glops.c +2 -1
@@ -339,6 +339,7 @@ static int inode_go_demote_ok(const struct gfs2_glock *gl)static int gfs2_dinode_in (struct gfs2_inode *ip,const void *buf) { +struct gfs2_sbd *sdp =GFS2_SB (&ip->i_inode);const struct gfs2_dinode *str = buf;struct timespec64 atime;u16 height, depth;
@@ -378,7 +379,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)/* i_diskflags and i_eattr must be set before gfs2_set_inode_flags() */ gfs2_set_inode_flags (&ip->i_inode); height =be16_to_cpu (str->di_height); -if (unlikely (height >GFS2_MAX_META_HEIGHT )) +if (unlikely (height > sdp->sd_max_height)) goto corrupt; ip->i_height = (u8 )height;
fs/hfsplus/inode.c +23 -5
@@ -476,7 +476,11 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)if (type ==HFSPLUS_FOLDER ) {struct hfsplus_cat_folder *folder = &entry.folder; -WARN_ON (fd->entrylength <sizeof (struct hfsplus_cat_folder )); +if (fd->entrylength <sizeof (struct hfsplus_cat_folder )) { +pr_err ("bad catalog folder entry\n" ); + res = -EIO ; + goto out; + }hfs_bnode_read (fd->bnode, &entry, fd->entryoffset,sizeof (struct hfsplus_cat_folder ));hfsplus_get_perms (inode, &folder->permissions,1 );
@@ -496,7 +500,11 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) }else if (type ==HFSPLUS_FILE ) {struct hfsplus_cat_file *file = &entry.file; -WARN_ON (fd->entrylength <sizeof (struct hfsplus_cat_file )); +if (fd->entrylength <sizeof (struct hfsplus_cat_file )) { +pr_err ("bad catalog file entry\n" ); + res = -EIO ; + goto out; + }hfs_bnode_read (fd->bnode, &entry, fd->entryoffset,sizeof (struct hfsplus_cat_file ));
@@ -527,6 +535,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)pr_err ("bad catalog entry used to create inode\n" ); res = -EIO ; } +out:return res; }
@@ -535,6 +544,7 @@ int hfsplus_cat_write_inode(struct inode *inode)struct inode *main_inode = inode;struct hfs_find_data fd;hfsplus_cat_entry entry; +int res =0 ;if (HFSPLUS_IS_RSRC (inode)) main_inode =HFSPLUS_I (inode)->rsrc_inode;
@@ -553,7 +563,11 @@ int hfsplus_cat_write_inode(struct inode *inode)if (S_ISDIR (main_inode->i_mode)) {struct hfsplus_cat_folder *folder = &entry.folder; -WARN_ON (fd.entrylength <sizeof (struct hfsplus_cat_folder )); +if (fd.entrylength <sizeof (struct hfsplus_cat_folder )) { +pr_err ("bad catalog folder entry\n" ); + res = -EIO ; + goto out; + }hfs_bnode_read (fd.bnode, &entry, fd.entryoffset,sizeof (struct hfsplus_cat_folder ));/* simple node checks? */
@@ -578,7 +592,11 @@ int hfsplus_cat_write_inode(struct inode *inode) }else {struct hfsplus_cat_file *file = &entry.file; -WARN_ON (fd.entrylength <sizeof (struct hfsplus_cat_file )); +if (fd.entrylength <sizeof (struct hfsplus_cat_file )) { +pr_err ("bad catalog file entry\n" ); + res = -EIO ; + goto out; + }hfs_bnode_read (fd.bnode, &entry, fd.entryoffset,sizeof (struct hfsplus_cat_file ));hfsplus_inode_write_fork (inode, &file->data_fork);
@@ -599,5 +617,5 @@ int hfsplus_cat_write_inode(struct inode *inode)set_bit (HFSPLUS_I_CAT_DIRTY , &HFSPLUS_I (inode)->flags); out:hfs_find_exit (&fd); -return 0 ; +return res; }
fs/nilfs2/inode.c +18 -0
@@ -930,6 +930,7 @@ void nilfs_evict_inode(struct inode *inode)struct nilfs_transaction_info ti;struct super_block *sb = inode->i_sb;struct nilfs_inode_info *ii =NILFS_I (inode); +struct the_nilfs *nilfs;int ret;if (inode->i_nlink || !ii->i_root ||unlikely (is_bad_inode (inode))) {
@@ -942,6 +943,23 @@ void nilfs_evict_inode(struct inode *inode)truncate_inode_pages_final (&inode->i_data); + nilfs = sb->s_fs_info; +if (unlikely (sb_rdonly (sb) || !nilfs->ns_writer)) { +/* +* If this inode is about to be disposed after the file system +* has been degraded to read-only due to file system corruption +* or after the writer has been detached, do not make any +* changes that cause writes, just clear it. +* Do this check after read-locking ns_segctor_sem by +* nilfs_transaction_begin() in order to avoid a race with +* the writer detach operation. +*/ +clear_inode (inode); +nilfs_clear_inode (inode); +nilfs_transaction_abort (sb); +return ; + } +/* TODO: some of the following operations may fail. */ nilfs_truncate_bmap (ii,0 );nilfs_mark_inode_dirty (inode);
fs/statfs.c +2 -2
@@ -114,6 +114,7 @@ static int do_statfs_native(struct kstatfs *st, struct statfs __user *p)if (sizeof (buf) ==sizeof (*st))memcpy (&buf, st,sizeof (*st));else { +memset (&buf,0 ,sizeof (buf));if (sizeof buf.f_blocks ==4 ) { if ((st->f_blocks | st->f_bfree | st->f_bavail | st->f_bsize | st->f_frsize) &
@@ -142,7 +143,6 @@ static int do_statfs_native(struct kstatfs *st, struct statfs __user *p) buf.f_namelen = st->f_namelen; buf.f_frsize = st->f_frsize; buf.f_flags = st->f_flags; -memset (buf.f_spare,0 ,sizeof (buf.f_spare)); }if (copy_to_user (p, &buf,sizeof (buf)))return -EFAULT ;
@@ -155,6 +155,7 @@ static int do_statfs64(struct kstatfs *st, struct statfs64 __user *p)if (sizeof (buf) ==sizeof (*st))memcpy (&buf, st,sizeof (*st));else { +memset (&buf,0 ,sizeof (buf)); buf.f_type = st->f_type; buf.f_bsize = st->f_bsize; buf.f_blocks = st->f_blocks;
@@ -166,7 +167,6 @@ static int do_statfs64(struct kstatfs *st, struct statfs64 __user *p) buf.f_namelen = st->f_namelen; buf.f_frsize = st->f_frsize; buf.f_flags = st->f_flags; -memset (buf.f_spare,0 ,sizeof (buf.f_spare)); }if (copy_to_user (p, &buf,sizeof (buf)))return -EFAULT ;
include/linux/cpuhotplug.h +0 -1
@@ -111,7 +111,6 @@ enum cpuhp_state {CPUHP_AP_PERF_X86_CSTATE_STARTING ,CPUHP_AP_PERF_XTENSA_STARTING ,CPUHP_AP_MIPS_OP_LOONGSON3_STARTING , -CPUHP_AP_ARM_SDEI_STARTING ,CPUHP_AP_ARM_VFP_STARTING ,CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING , CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING,
include/linux/platform_device.h +3 -0
@@ -51,6 +51,9 @@ extern struct device platform_bus;extern void arch_setup_pdev_archdata (struct platform_device *);extern struct resource *platform_get_resource (struct platform_device *,unsigned int ,unsigned int ); +extern void __iomem * +devm_platform_ioremap_resource (struct platform_device *pdev, +unsigned int index);extern int platform_get_irq (struct platform_device *,unsigned int );extern int platform_irq_count (struct platform_device *); extern struct resource *platform_get_resource_byname(struct platform_device *,
include/linux/power/bq27xxx_battery.h +1 -0
@@ -63,6 +63,7 @@ struct bq27xxx_device_info {struct bq27xxx_access_methods bus;struct bq27xxx_reg_cache cache;int charge_design_full; +bool removed;unsigned long last_update;struct delayed_work work;struct power_supply *bat;
include/linux/sched/task_stack.h +1 -1
@@ -23,7 +23,7 @@ static inline void *task_stack_page(const struct task_struct *task)#define setup_thread_stack (new,old) do { } while(0) -static inline unsigned long *end_of_stack (const struct task_struct *task) +static __always_inline unsigned long *end_of_stack (const struct task_struct *task) {#ifdef CONFIG_STACK_GROWSUP return (unsigned long *)((unsigned long )task->stack +THREAD_SIZE ) -1 ;
include/linux/string_helpers.h +15 -0
@@ -2,6 +2,7 @@#ifndef _LINUX_STRING_HELPERS_H_#define _LINUX_STRING_HELPERS_H_ +#include <linux/ctype.h> #include <linux/types.h> struct file ;
@@ -72,6 +73,20 @@ static inline int string_escape_str_any_np(const char *src, char *dst,return string_escape_str (src, dst, sz,ESCAPE_ANY_NP , only); } +static inline void string_upper (char *dst,const char *src) +{ +do { + *dst++ =toupper (*src); + }while (*src++); +} + +static inline void string_lower (char *dst,const char *src) +{ +do { + *dst++ =tolower (*src); + }while (*src++); +} +char *kstrdup_quotable (const char *src,gfp_t gfp);char *kstrdup_quotable_cmdline (struct task_struct *task,gfp_t gfp);char *kstrdup_quotable_file (struct file *file,gfp_t gfp);
include/linux/usb.h +5 -0
@@ -279,6 +279,11 @@ void usb_put_intf(struct usb_interface *intf);#define USB_MAXINTERFACES 32#define USB_MAXIADS (USB_MAXINTERFACES/2) +bool usb_check_bulk_endpoints ( +const struct usb_interface *intf,const u8 *ep_addrs); +bool usb_check_int_endpoints ( +const struct usb_interface *intf,const u8 *ep_addrs); +/* * USB Resume Timer: Every Host controller driver should drive the resume * signalling on the bus for the amount of time defined by this macro.
include/net/ip6_tunnel.h +1 -1
@@ -57,7 +57,7 @@ struct ip6_tnl {/* These fields used only by GRE */ __u32 i_seqno;/* The last seen seqno */ -__u32 o_seqno;/* The last output seqno */ +atomic_t o_seqno;/* The last output seqno */ int hlen;/* tun_hlen + encap_hlen */ int tun_hlen;/* Precalculated header length */ int encap_hlen;/* Encap header length (FOU,GUE) */
include/net/ip_tunnels.h +1 -1
@@ -113,7 +113,7 @@ struct ip_tunnel {/* These four fields used only by GRE */ u32 i_seqno;/* The last seen seqno */ -u32 o_seqno;/* The last output seqno */ +atomic_t o_seqno;/* The last output seqno */ int tun_hlen;/* Precalculated header length */ /* These four fields used only by ERSPAN */
include/net/netfilter/nf_tables.h +9 -6
@@ -191,14 +191,13 @@ static inline enum nft_registers nft_type_to_reg(enum nft_data_types type) }int nft_parse_u32_check (const struct nlattr *attr,int max,u32 *dest); -unsigned int nft_parse_register (const struct nlattr *attr);int nft_dump_register (struct sk_buff *skb,unsigned int attr,unsigned int reg); -int nft_validate_register_load (enum nft_registers reg,unsigned int len); -int nft_validate_register_store (const struct nft_ctx *ctx, -enum nft_registers reg, -const struct nft_data *data, -enum nft_data_types type,unsigned int len); +int nft_parse_register_load (const struct nlattr *attr,u8 *sreg,u32 len); +int nft_parse_register_store (const struct nft_ctx *ctx, +const struct nlattr *attr,u8 *dreg, +const struct nft_data *data, +enum nft_data_types type,unsigned int len);/** * struct nft_userdata - user defined data associated with an object
@@ -226,6 +225,10 @@ struct nft_set_elem {u32 buf[NFT_DATA_VALUE_MAXLEN /sizeof (u32)];struct nft_data val; } key; +union { +u32 buf[NFT_DATA_VALUE_MAXLEN /sizeof (u32)]; +struct nft_data val; + } data;void *priv; };
include/net/netfilter/nf_tables_core.h +5 -4
@@ -21,13 +21,14 @@ void nf_tables_core_module_exit(void);struct nft_cmp_fast_expr {u32 data; -enum nft_registers sreg:8 ; +u32 mask; +u8 sreg;u8 len; };struct nft_immediate_expr {struct nft_data data; -enum nft_registers dreg:8 ; +u8 dreg;u8 dlen; };
@@ -47,14 +48,14 @@ struct nft_payload { enum nft_payload_bases base:8;u8 offset;u8 len; - enum nft_registers dreg:8; +u8 dreg; };struct nft_payload_set {enum nft_payload_bases base:8 ;u8 offset;u8 len; -enum nft_registers sreg:8 ; +u8 sreg;u8 csum_type;u8 csum_offset;u8 csum_flags;
include/net/netfilter/nft_fib.h +1 -1
@@ -3,7 +3,7 @@#define _NFT_FIB_H_struct nft_fib { -enum nft_registers dreg:8 ; +u8 dreg;u8 result;u32 flags; };
include/net/netfilter/nft_masq.h +2 -2
@@ -4,8 +4,8 @@struct nft_masq {u32 flags; -enum nft_registers sreg_proto_min:8 ; -enum nft_registers sreg_proto_max:8 ; +u8 sreg_proto_min; +u8 sreg_proto_max; };extern const struct nla_policy nft_masq_policy[];
include/net/netfilter/nft_redir.h +2 -2
@@ -3,8 +3,8 @@#define _NFT_REDIR_H_struct nft_redir { -enum nft_registers sreg_proto_min:8 ; -enum nft_registers sreg_proto_max:8 ; +u8 sreg_proto_min; +u8 sreg_proto_max;u16 flags; };
include/net/sock.h +16 -6
@@ -1130,7 +1130,7 @@ struct proto {unsigned int inuse_idx;#endif -bool (*stream_memory_free)(const struct sock *sk); +bool (*stream_memory_free)(const struct sock *sk,int wake);bool (*stream_memory_read)(const struct sock *sk);/* Memory pressure */ void (*enter_memory_pressure)(struct sock *sk);
@@ -1212,19 +1212,29 @@ static inline void sk_refcnt_debug_release(const struct sock *sk)#define sk_refcnt_debug_release (sk) do { } while (0)#endif /* SOCK_REFCNT_DEBUG */ -static inline bool sk_stream_memory_free (const struct sock *sk) +static inline bool __sk_stream_memory_free (const struct sock *sk,int wake) {if (sk->sk_wmem_queued >= sk->sk_sndbuf)return false;return sk->sk_prot->stream_memory_free ? - sk->sk_prot->stream_memory_free (sk) : true; + sk->sk_prot->stream_memory_free (sk, wake) : true; } -static inline bool sk_stream_is_writeable (const struct sock *sk) +static inline bool sk_stream_memory_free (const struct sock *sk) +{ +return __sk_stream_memory_free (sk,0 ); +} + +static inline bool __sk_stream_is_writeable (const struct sock *sk,int wake) {return sk_stream_wspace (sk) >=sk_stream_min_wspace (sk) && -sk_stream_memory_free (sk); +__sk_stream_memory_free (sk, wake); +} + +static inline bool sk_stream_is_writeable (const struct sock *sk) +{ +return __sk_stream_is_writeable (sk,0 ); } static inline int sk_under_cgroup_hierarchy(struct sock *sk,
@@ -2406,7 +2416,7 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,__sock_recv_ts_and_drops (msg, sk, skb); else if (unlikely(sock_flag(sk, SOCK_TIMESTAMP))) sock_write_timestamp(sk, skb->tstamp); - else if (unlikely(sk->sk_stamp == SK_DEFAULT_STAMP)) + else if (unlikely(sock_read_timestamp(sk) == SK_DEFAULT_STAMP)) sock_write_timestamp(sk, 0); }
include/net/tcp.h +7 -2
@@ -389,6 +389,7 @@ void tcp_update_metrics(struct sock *sk);void tcp_init_metrics (struct sock *sk);void tcp_metrics_init (void );bool tcp_peer_is_proven (struct request_sock *req,struct dst_entry *dst); +void __tcp_close (struct sock *sk,long timeout);void tcp_close (struct sock *sk,long timeout);void tcp_init_sock (struct sock *sk);void tcp_init_transfer (struct sock *sk,int bpf_op);
@@ -1884,12 +1885,16 @@ static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp)return tp->notsent_lowat ?:READ_ONCE (net->ipv4.sysctl_tcp_notsent_lowat); } -static inline bool tcp_stream_memory_free (const struct sock *sk) +/* @wake is one when sk_stream_write_space() calls us. +* This sends EPOLLOUT only if notsent_bytes is half the limit. +* This mimics the strategy used in sock_def_write_space(). +*/ +static inline bool tcp_stream_memory_free (const struct sock *sk,int wake) {const struct tcp_sock *tp =tcp_sk (sk);u32 notsent_bytes =READ_ONCE (tp->write_seq) - tp->snd_nxt; -return notsent_bytes <tcp_notsent_lowat (tp); +return (notsent_bytes << wake) <tcp_notsent_lowat (tp); }#ifdef CONFIG_PROC_FS
include/uapi/sound/skl-tplg-interface.h +2 -1
@@ -64,7 +64,8 @@ enum skl_ch_cfg {SKL_CH_CFG_DUAL_MONO =9 ,SKL_CH_CFG_I2S_DUAL_STEREO_0 =10 ,SKL_CH_CFG_I2S_DUAL_STEREO_1 =11 , -SKL_CH_CFG_4_CHANNEL =12 , +SKL_CH_CFG_7_1 =12 , +SKL_CH_CFG_4_CHANNEL =SKL_CH_CFG_7_1 , SKL_CH_CFG_INVALID };
kernel/bpf/verifier.c +1 -1
@@ -5936,7 +5936,7 @@ static int convert_ctx_accesses(struct bpf_verifier_env *env) insn_buf[cnt++] =BPF_ALU64_IMM (BPF_RSH , insn->dst_reg, shift); - insn_buf[cnt++] =BPF_ALU64_IMM (BPF_AND , insn->dst_reg, + insn_buf[cnt++] =BPF_ALU32_IMM (BPF_AND , insn->dst_reg, (1ULL << size *8 ) -1 ); } }
lib/cpu_rmap.c +4 -1
@@ -235,7 +235,8 @@ void free_irq_cpu_rmap(struct cpu_rmap *rmap)for (index =0 ; index < rmap->used; index++) { glue = rmap->obj[index]; -irq_set_affinity_notifier (glue->notify.irq,NULL ); +if (glue) +irq_set_affinity_notifier (glue->notify.irq,NULL ); }cpu_rmap_put (rmap);
@@ -271,6 +272,7 @@ static void irq_cpu_rmap_release(struct kref *ref) container_of(ref, struct irq_glue, notify.kref);cpu_rmap_put (glue->rmap); + glue->rmap->obj[glue->index] =NULL ;kfree (glue); }
@@ -300,6 +302,7 @@ int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq) rc =irq_set_affinity_notifier (irq, &glue->notify);if (rc) {cpu_rmap_put (glue->rmap); + rmap->obj[glue->index] =NULL ;kfree (glue); }return rc;
net/8021q/vlan_dev.c +2 -2
@@ -115,8 +115,8 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,* NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs... */ -if (veth->h_vlan_proto != vlan->vlan_proto || - vlan->flags &VLAN_FLAG_REORDER_HDR ) { +if (vlan->flags &VLAN_FLAG_REORDER_HDR || + veth->h_vlan_proto != vlan->vlan_proto) {u16 vlan_tci; vlan_tci = vlan->vlan_id; vlan_tci |=vlan_dev_get_egress_qos_mask (dev, skb->priority);
net/bluetooth/l2cap_core.c +0 -1
@@ -4392,7 +4392,6 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, chan =l2cap_get_chan_by_scid (conn, scid);if (!chan) { -mutex_unlock (&conn->chan_lock);return 0 ; }
net/core/datagram.c +10 -5
@@ -837,18 +837,21 @@ __poll_t datagram_poll(struct file *file, struct socket *sock, {struct sock *sk = sock->sk;__poll_t mask; +u8 shutdown;sock_poll_wait (file, sock, wait); mask =0 ;/* exceptional events? */ -if (sk->sk_err || !skb_queue_empty_lockless (&sk->sk_error_queue)) +if (READ_ONCE (sk->sk_err) || + !skb_queue_empty_lockless (&sk->sk_error_queue)) mask |=EPOLLERR | (sock_flag (sk,SOCK_SELECT_ERR_QUEUE ) ?EPOLLPRI :0 ); -if (sk->sk_shutdown &RCV_SHUTDOWN ) + shutdown =READ_ONCE (sk->sk_shutdown); +if (shutdown &RCV_SHUTDOWN ) mask |=EPOLLRDHUP |EPOLLIN |EPOLLRDNORM ; -if (sk->sk_shutdown ==SHUTDOWN_MASK ) +if (shutdown ==SHUTDOWN_MASK ) mask |=EPOLLHUP ;/* readable? */
@@ -857,10 +860,12 @@ __poll_t datagram_poll(struct file *file, struct socket *sock,/* Connection-based need to check for termination and startup */ if (connection_based (sk)) { -if (sk->sk_state ==TCP_CLOSE ) +int state =READ_ONCE (sk->sk_state); + +if (state ==TCP_CLOSE ) mask |=EPOLLHUP ;/* connection hasn't started yet? */ -if (sk->sk_state ==TCP_SYN_SENT ) +if (state ==TCP_SYN_SENT )return mask; }
net/core/dev.c +2 -0
@@ -2303,6 +2303,8 @@ int __netif_set_xps_queue(struct net_device *dev, const unsigned long *mask,bool active = false;unsigned int nr_ids; +WARN_ON_ONCE (index >= dev->num_tx_queues); +if (dev->num_tc) {/* Do not allow XPS on subordinate device directly */ num_tc = dev->num_tc;
net/core/skbuff.c +3 -1
@@ -4446,8 +4446,10 @@ void __skb_tstamp_tx(struct sk_buff *orig_skb, }else { skb =skb_clone (orig_skb,GFP_ATOMIC ); -if (skb_orphan_frags_rx (skb,GFP_ATOMIC )) +if (skb_orphan_frags_rx (skb,GFP_ATOMIC )) { +kfree_skb (skb);return ; + } }if (!skb)return ;
net/core/stream.c +1 -1
@@ -32,7 +32,7 @@ void sk_stream_write_space(struct sock *sk)struct socket *sock = sk->sk_socket;struct socket_wq *wq; -if (sk_stream_is_writeable (sk) && sock) { +if (__sk_stream_is_writeable (sk,1 ) && sock) {clear_bit (SOCK_NOSPACE , &sock->flags);rcu_read_lock ();
net/ipv4/af_inet.c +1 -1
@@ -865,7 +865,7 @@ int inet_shutdown(struct socket *sock, int how)EPOLLHUP, even on eg. unconnected UDP sockets -- RR */ /* fall through */ default : - sk->sk_shutdown |= how; +WRITE_ONCE (sk->sk_shutdown, sk->sk_shutdown | how);if (sk->sk_prot->shutdown) sk->sk_prot->shutdown (sk, how);break ;
net/ipv4/ip_gre.c +3 -3
@@ -440,7 +440,7 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev,/* Push GRE header. */ gre_build_header (skb, tunnel->tun_hlen, flags, proto, tunnel->parms.o_key, - (flags &TUNNEL_SEQ ) ?htonl (tunnel->o_seqno++) :0 ); + (flags &TUNNEL_SEQ ) ?htonl (atomic_fetch_inc (&tunnel->o_seqno)) :0 );ip_tunnel_xmit (skb, dev, tnl_params, tnl_params->protocol); }
@@ -546,7 +546,7 @@ static void gre_fb_xmit(struct sk_buff *skb, struct net_device *dev, (TUNNEL_CSUM |TUNNEL_KEY |TUNNEL_SEQ );gre_build_header (skb, tunnel_hlen, flags, proto,tunnel_id_to_key32 (tun_info->key.tun_id), - (flags &TUNNEL_SEQ ) ?htonl (tunnel->o_seqno++) :0 ); + (flags &TUNNEL_SEQ ) ?htonl (atomic_fetch_inc (&tunnel->o_seqno)) :0 ); df = key->tun_flags &TUNNEL_DONT_FRAGMENT ?htons (IP_DF ) :0 ;
@@ -635,7 +635,7 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev) }gre_build_header (skb,8 ,TUNNEL_SEQ , - proto,0 ,htonl (tunnel->o_seqno++)); + proto,0 ,htonl (atomic_fetch_inc (&tunnel->o_seqno))); df = key->tun_flags &TUNNEL_DONT_FRAGMENT ?htons (IP_DF ) :0 ;
net/ipv4/netfilter/nft_dup_ipv4.c +9 -9
@@ -16,8 +16,8 @@#include <net/netfilter/ipv4/nf_dup_ipv4.h> struct nft_dup_ipv4 { -enum nft_registers sreg_addr:8 ; -enum nft_registers sreg_dev:8 ; +u8 sreg_addr; +u8 sreg_dev; }; static void nft_dup_ipv4_eval(const struct nft_expr *expr,
@@ -43,16 +43,16 @@ static int nft_dup_ipv4_init(const struct nft_ctx *ctx,if (tb[NFTA_DUP_SREG_ADDR ] ==NULL )return -EINVAL ; - priv->sreg_addr =nft_parse_register (tb[NFTA_DUP_SREG_ADDR ]); - err =nft_validate_register_load (priv->sreg_addr,sizeof (struct in_addr )); + err =nft_parse_register_load (tb[NFTA_DUP_SREG_ADDR ], &priv->sreg_addr, +sizeof (struct in_addr ));if (err <0 )return err; -if (tb[NFTA_DUP_SREG_DEV ] !=NULL ) { - priv->sreg_dev =nft_parse_register (tb[NFTA_DUP_SREG_DEV ]); -return nft_validate_register_load (priv->sreg_dev,sizeof (int )); - } -return 0 ; +if (tb[NFTA_DUP_SREG_DEV ]) + err =nft_parse_register_load (tb[NFTA_DUP_SREG_DEV ], + &priv->sreg_dev,sizeof (int )); + +return err; }static int nft_dup_ipv4_dump (struct sk_buff *skb,const struct nft_expr *expr)
net/ipv4/tcp.c +17 -10
@@ -515,6 +515,7 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)__poll_t mask;struct sock *sk = sock->sk;const struct tcp_sock *tp =tcp_sk (sk); +u8 shutdown;int state;sock_poll_wait (file, sock, wait);
@@ -557,9 +558,10 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)* NOTE. Check for TCP_CLOSE is added. The goal is to prevent * blocking on fresh not-connected or disconnected socket. --ANK */ -if (sk->sk_shutdown ==SHUTDOWN_MASK || state ==TCP_CLOSE ) + shutdown =READ_ONCE (sk->sk_shutdown); +if (shutdown ==SHUTDOWN_MASK || state ==TCP_CLOSE ) mask |=EPOLLHUP ; -if (sk->sk_shutdown &RCV_SHUTDOWN ) +if (shutdown &RCV_SHUTDOWN ) mask |=EPOLLIN |EPOLLRDNORM |EPOLLRDHUP ;/* Connected or passive Fast Open socket? */
@@ -575,8 +577,8 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)if (tcp_stream_is_readable (tp, target, sk)) mask |=EPOLLIN |EPOLLRDNORM ; -if (!(sk->sk_shutdown &SEND_SHUTDOWN )) { -if (sk_stream_is_writeable (sk)) { +if (!(shutdown &SEND_SHUTDOWN )) { +if (__sk_stream_is_writeable (sk,1 )) { mask |=EPOLLOUT |EPOLLWRNORM ; }else {/* send SIGIO later */ sk_set_bit (SOCKWQ_ASYNC_NOSPACE , sk);
@@ -588,7 +590,7 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)* pairs with the input side. */ smp_mb__after_atomic (); -if (sk_stream_is_writeable (sk)) +if (__sk_stream_is_writeable (sk,1 )) mask |=EPOLLOUT |EPOLLWRNORM ; } }else
@@ -2338,14 +2340,13 @@ bool tcp_check_oom(struct sock *sk, int shift)return too_many_orphans || out_of_socket_memory; } -void tcp_close (struct sock *sk,long timeout) +void __tcp_close (struct sock *sk,long timeout) {struct sk_buff *skb;int data_was_unread =0 ;int state; -lock_sock (sk); - sk->sk_shutdown =SHUTDOWN_MASK ; +WRITE_ONCE (sk->sk_shutdown,SHUTDOWN_MASK );if (sk->sk_state ==TCP_LISTEN ) {tcp_set_state (sk,TCP_CLOSE );
@@ -2505,6 +2506,12 @@ void tcp_close(struct sock *sk, long timeout) out:bh_unlock_sock (sk);local_bh_enable (); +} + +void tcp_close (struct sock *sk,long timeout) +{ +lock_sock (sk); +__tcp_close (sk, timeout);release_sock (sk);sock_put (sk); }
@@ -2593,7 +2600,7 @@ int tcp_disconnect(struct sock *sk, int flags)if (!(sk->sk_userlocks &SOCK_BINDADDR_LOCK ))inet_reset_saddr (sk); - sk->sk_shutdown =0 ; +WRITE_ONCE (sk->sk_shutdown,0 );sock_reset_flag (sk,SOCK_DONE ); tp->srtt_us =0 ; tp->rcv_rtt_last_tsecr =0 ;
@@ -3802,7 +3809,7 @@ void tcp_done(struct sock *sk)if (req)reqsk_fastopen_remove (sk, req, false); - sk->sk_shutdown =SHUTDOWN_MASK ; +WRITE_ONCE (sk->sk_shutdown,SHUTDOWN_MASK );if (!sock_flag (sk,SOCK_DEAD )) sk->sk_state_change (sk);
net/ipv4/tcp_input.c +2 -2
@@ -4130,7 +4130,7 @@ void tcp_fin(struct sock *sk)inet_csk_schedule_ack (sk); - sk->sk_shutdown |=RCV_SHUTDOWN ; +WRITE_ONCE (sk->sk_shutdown, sk->sk_shutdown |RCV_SHUTDOWN );sock_set_flag (sk,SOCK_DONE );switch (sk->sk_state) {
@@ -6209,7 +6209,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)break ;tcp_set_state (sk,TCP_FIN_WAIT2 ); - sk->sk_shutdown |=SEND_SHUTDOWN ; +WRITE_ONCE (sk->sk_shutdown, sk->sk_shutdown |SEND_SHUTDOWN );sk_dst_confirm (sk);
net/ipv4/udplite.c +2 -0
@@ -64,6 +64,8 @@ struct proto udplite_prot = { .get_port = udp_v4_get_port, .memory_allocated = &udp_memory_allocated, .sysctl_mem = sysctl_udp_mem, + .sysctl_wmem_offset = offsetof(struct net, ipv4.sysctl_udp_wmem_min), + .sysctl_rmem_offset = offsetof(struct net, ipv4.sysctl_udp_rmem_min), .obj_size = sizeof(struct udp_sock), .h.udp_table = &udplite_table, #ifdef CONFIG_COMPAT
net/ipv6/exthdrs_core.c +2 -0
@@ -142,6 +142,8 @@ int ipv6_find_tlv(const struct sk_buff *skb, int offset, int type) optlen =1 ;break ;default : +if (len <2 ) + goto bad; optlen = nh[offset +1 ] +2 ;if (optlen > len) goto bad;
net/ipv6/ip6_gre.c +21 -15
@@ -731,6 +731,7 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, {struct ip6_tnl *tunnel =netdev_priv (dev);__be16 protocol; +__be16 flags;if (dev->type ==ARPHRD_ETHER )IPCB (skb)->flags =0 ;
@@ -740,16 +741,12 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,else fl6->daddr = tunnel->parms.raddr; -if (skb_cow_head (skb, dev->needed_headroom ?: tunnel->hlen)) -return -ENOMEM ; -/* Push GRE header. */ protocol = (dev->type ==ARPHRD_ETHER ) ?htons (ETH_P_TEB ) : proto;if (tunnel->parms.collect_md) {struct ip_tunnel_info *tun_info;const struct ip_tunnel_key *key; -__be16 flags;int tun_hlen; tun_info =skb_tunnel_info (skb);
@@ -770,19 +767,25 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, (TUNNEL_CSUM |TUNNEL_KEY |TUNNEL_SEQ ); tun_hlen =gre_calc_hlen (flags); +if (skb_cow_head (skb, dev->needed_headroom ?: tun_hlen + tunnel->encap_hlen)) +return -ENOMEM ; +gre_build_header (skb, tun_hlen, flags, protocol,tunnel_id_to_key32 (tun_info->key.tun_id), - (flags &TUNNEL_SEQ ) ?htonl (tunnel->o_seqno++) + (flags &TUNNEL_SEQ ) ?htonl (atomic_fetch_inc (&tunnel->o_seqno)) :0 ); }else { -if (tunnel->parms.o_flags &TUNNEL_SEQ ) - tunnel->o_seqno++; +if (skb_cow_head (skb, dev->needed_headroom ?: tunnel->hlen)) +return -ENOMEM ; + + flags = tunnel->parms.o_flags; -gre_build_header (skb, tunnel->tun_hlen, tunnel->parms.o_flags, +gre_build_header (skb, tunnel->tun_hlen, flags, protocol, tunnel->parms.o_key, -htonl (tunnel->o_seqno)); + (flags &TUNNEL_SEQ ) ?htonl (atomic_fetch_inc (&tunnel->o_seqno)) + :0 ); } return ip6_tnl_xmit(skb, dev, dsfield, fl6, encap_limit, pmtu,
@@ -1018,12 +1021,14 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,ntohl (tun_id),ntohl (md->u.index), truncate, false); + proto =htons (ETH_P_ERSPAN ); }else if (md->version ==2 ) {erspan_build_header_v2 (skb,ntohl (tun_id), md->u.md2.dir,get_hwid (&md->u.md2), truncate, false); + proto =htons (ETH_P_ERSPAN2 ); }else { goto tx_err; }
@@ -1046,25 +1051,26 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,break ; } -if (t->parms.erspan_ver ==1 ) +if (t->parms.erspan_ver ==1 ) {erspan_build_header (skb,ntohl (t->parms.o_key), t->parms.index, truncate, false); -else if (t->parms.erspan_ver ==2 ) + proto =htons (ETH_P_ERSPAN ); + }else if (t->parms.erspan_ver ==2 ) {erspan_build_header_v2 (skb,ntohl (t->parms.o_key), t->parms.dir, t->parms.hwid, truncate, false); -else + proto =htons (ETH_P_ERSPAN2 ); + }else { goto tx_err; + } fl6.daddr = t->parms.raddr; }/* Push GRE header. */ - proto = (t->parms.erspan_ver ==1 ) ?htons (ETH_P_ERSPAN ) - :htons (ETH_P_ERSPAN2 );
Lines of this file are not shown. View the raw message.
net/netfilter/nf_tables_api.c +148 -80
228 lines not on this page · raw message
sound/pci/hda/patch_realtek.c +265 -59
324 lines not on this page · raw message
tools/power/cpupower/utils/idle_monitor/mperf_monitor.c +14 -17
Lines of this file are not shown. View the raw message.
tools/testing/selftests/memfd/fuse_test.c +1 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.