Linux 6.1.61
Greg Kroah-Hartman
maintainerI'm announcing the release of the 6.1.61 kernel.
All users of the 6.1 kernel series must upgrade.
The updated 6.1.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-6.1.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/arm/boot/dts/omap4-l4-abe.dtsi | 6 + arch/arm/boot/dts/omap4-l4.dtsi | 2 arch/arm/boot/dts/omap5-l4-abe.dtsi | 6 + arch/arm/mach-omap1/timer32k.c | 14 ++-- arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 1 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 10 ++ arch/sparc/lib/checksum_32.S | 2 arch/x86/include/asm/i8259.h | 2 arch/x86/include/asm/intel-family.h | 2 arch/x86/kernel/acpi/boot.c | 3 arch/x86/kernel/i8259.c | 38 ++++++++-- arch/x86/kvm/pmu.h | 6 + arch/x86/kvm/svm/pmu.c | 2 arch/x86/kvm/vmx/pmu_intel.c | 4 - block/blk-throttle.c | 6 + drivers/ata/libata-scsi.c | 5 - drivers/clk/clk.c | 21 +++--- drivers/clk/ti/clk-44xx.c | 5 + drivers/clk/ti/clk-54xx.c | 4 + drivers/crypto/virtio/virtio_crypto_common.h | 3 drivers/crypto/virtio/virtio_crypto_core.c | 14 +++- drivers/firewire/sbp2.c | 1 drivers/firmware/imx/imx-dsp.c | 2 drivers/gpu/drm/amd/amdgpu/vi.c | 2 drivers/gpu/drm/display/drm_dp_mst_topology.c | 6 - drivers/gpu/drm/i915/i915_pmu.c | 9 ++ drivers/gpu/drm/logicvc/Kconfig | 2 drivers/i2c/busses/i2c-aspeed.c | 3 drivers/i2c/busses/i2c-stm32f7.c | 9 +- drivers/i2c/muxes/i2c-demux-pinctrl.c | 2 drivers/i2c/muxes/i2c-mux-gpmux.c | 2 drivers/i2c/muxes/i2c-mux-pinctrl.c | 2 drivers/iio/adc/exynos_adc.c | 24 ++++-- drivers/iio/adc/xilinx-xadc-core.c | 39 ++++------- drivers/iio/adc/xilinx-xadc.h | 2 drivers/iio/afe/iio-rescale.c | 19 ++++- drivers/mcb/mcb-lpc.c | 35 ++++++++-- drivers/mcb/mcb-parse.c | 15 ++-- drivers/misc/fastrpc.c | 34 ++++----- drivers/mmc/core/block.c | 38 ++++++++-- drivers/mmc/core/mmc_ops.c | 1 drivers/net/ethernet/adi/adin1110.c | 2 drivers/net/ethernet/intel/i40e/i40e.h | 2 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 2 drivers/net/ethernet/intel/iavf/iavf_main.c | 7 +- drivers/net/ethernet/intel/igb/igb_ethtool.c | 6 + drivers/net/ethernet/intel/igc/igc_ethtool.c | 35 +++++++--- drivers/net/ethernet/realtek/r8169_main.c | 6 - drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 2 drivers/net/gtp.c | 5 - drivers/net/ieee802154/adf7242.c | 5 - drivers/net/usb/r8152.c | 11 ++- drivers/net/usb/smsc95xx.c | 4 - drivers/nvmem/imx-ocotp.c | 6 - drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 17 +++- drivers/platform/x86/thinkpad_acpi.c | 73 +++++++++++++++++++++ drivers/scsi/sd.c | 39 ++++++++++- drivers/vhost/vhost.c | 4 - drivers/virtio/virtio_balloon.c | 6 + drivers/virtio/virtio_mmio.c | 19 ++++- drivers/virtio/virtio_pci_modern_dev.c | 2 fs/ext4/mballoc.c | 51 ++++++-------- fs/ext4/mballoc.h | 14 ++++ fs/nfsd/vfs.c | 12 +-- include/linux/hugetlb.h | 6 + include/linux/kasan.h | 6 - include/scsi/scsi_device.h | 20 +++++ include/uapi/linux/gtp.h | 2 io_uring/fdinfo.c | 18 +++-- kernel/events/core.c | 3 kernel/trace/trace_kprobe.c | 4 - lib/maple_tree.c | 2 lib/test_maple_tree.c | 35 ++++++---- mm/hugetlb.c | 48 +++++++++++-- mm/kasan/report.c | 4 - mm/migrate.c | 14 +++- mm/mmap.c | 6 - mm/page_alloc.c | 2 net/core/neighbour.c | 67 ++++++++++--------- net/ipv4/tcp_input.c | 9 +- net/vmw_vsock/virtio_transport.c | 18 ++++- sound/soc/codecs/wcd938x.c | 51 ++++++++------ tools/include/linux/rwsem.h | 40 +++++++++++ tools/objtool/check.c | 2 85 files changed, 788 insertions(+), 304 deletions(-)
Al Viro (2):
nfsd: lock_rename() needs both directories to live on the same fs
sparc32: fix a braino in fault handling in csum_and_copy_..._user()
Alain Volmat (1):
i2c: stm32f7: Fix PEC handling in case of SMBUS transfers
Alessandro Carminati (1):
clk: Sanitize possible_parent_show to Handle Return Value of of_clk_get_parent_name
Alexandru Matei (1):
vsock/virtio: initialize the_virtio_vsock before using VQs
Baokun Li (3):
ext4: add two helper functions extent_logical_end() and pa_logical_end()
ext4: fix BUG in ext4_mb_new_inode_pa() due to overflow
ext4: avoid overlapping preallocations due to overflow
Christian Loehle (1):
mmc: block: ioctl: do write error check for spi
Christophe JAILLET (1):
net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show()
Christopher Obbard (2):
arm64: dts: rockchip: Add i2s0-2ch-bus-bclk-off pins to RK3399
arm64: dts: rockchip: Fix i2s0 pin conflict on ROCK Pi 4 boards
Damien Le Moal (1):
scsi: sd: Introduce manage_shutdown device flag
David Lazar (1):
platform/x86: Add s2idle quirk for more Lenovo laptops
Dell Jin (1):
net: ethernet: adi: adin1110: Fix uninitialized variable
Douglas Anderson (4):
r8152: Increase USB control msg timeout to 5000ms as per spec
r8152: Run the unload routine if we have errors during probe
r8152: Cancel hw_phy_work if we have an error in probe
r8152: Release firmware if we have an error in probe
Ekansh Gupta (4):
misc: fastrpc: Reset metadata buffer to avoid incorrect free
misc: fastrpc: Free DMA handles for RPC calls with no arguments
misc: fastrpc: Clean buffers on remote invocation failures
misc: fastrpc: Unmap only if buffer is unmapped from DSP
Eric Auger (1):
vhost: Allow null msg.size on VHOST_IOTLB_INVALIDATE
Eric Dumazet (1):
neighbour: fix various data-races
Fred Chen (1):
tcp: fix wrong RTO timeout when received SACK reneging
Gavin Shan (1):
virtio_balloon: Fix endless deflation and inflation on arm64
Greg Kroah-Hartman (1):
Linux 6.1.61
Gregory Price (1):
mm/migrate: fix do_pages_move for compat pointers
Haibo Li (1):
kasan: print the original fault addr when access invalid shadow
Hao Ge (1):
firmware/imx-dsp: Fix use_after_free in imx_dsp_setup_channels()
Herve Codina (3):
i2c: muxes: i2c-mux-pinctrl: Use of_get_i2c_adapter_by_node()
i2c: muxes: i2c-mux-gpmux: Use of_get_i2c_adapter_by_node()
i2c: muxes: i2c-demux-pinctrl: Use of_get_i2c_adapter_by_node()
Ivan Vecera (2):
i40e: Fix I40E_FLAG_VF_VLAN_PRUNING value
i40e: Fix wrong check for I40E_TXR_FLAGS_WB_ON_ITR
Jens Axboe (1):
io_uring/fdinfo: lock SQ thread while retrieving thread cpu/pid
Jian Zhang (1):
i2c: aspeed: Fix i2c bus hang in slave read
Johan Hovold (2):
ASoC: codecs: wcd938x: fix regulator leaks on probe errors
ASoC: codecs: wcd938x: fix runtime PM imbalance on remove
John Sperbeck (1):
objtool/x86: add missing embedded_insn check
Kemeng Shi (1):
mm/page_alloc: correct start page when guard page debug is enabled
Khazhismel Kumykov (1):
blk-throttle: check for overflow in calculate_bytes_allowed
Krzysztof Kozlowski (2):
ASoC: codecs: wcd938x: Simplify with dev_err_probe
pinctrl: qcom: lpass-lpi: fix concurrent register updates
Kunwu Chan (1):
treewide: Spelling fix in comment
Liam R. Howlett (1):
maple_tree: add GFP_KERNEL to allocations in mas_expected_entries()
Linus Walleij (1):
iio: afe: rescale: Accept only offset channels
Lukasz Majczak (1):
drm/dp_mst: Fix NULL deref in get_mst_branch_device_by_guid_helper()
Marek Szyprowski (1):
iio: exynos-adc: request second interupt only when touchscreen mode is used
Mario Limonciello (1):
drm/amd: Disable ASPM for VI w/ all Intel systems
Mateusz Palczewski (1):
igb: Fix potential memory leak in igb_add_ethtool_nfc_entry
Maximilian Heyne (1):
virtio-mmio: fix memory leak of vm_dev
Michal Schmidt (2):
iavf: initialize waitqueues before starting watchdog_task
iavf: in iavf_down, disable queues when removing the driver
Mirsad Goran Todorovac (3):
r8169: fix the KCSAN reported data-race in rtl_tx() while reading tp->cur_tx
r8169: fix the KCSAN reported data-race in rtl_tx while reading TxDescArray[entry].opts1
r8169: fix the KCSAN reported data race in rtl_rx while reading desc->opts1Pablo Neira Ayuso (2):
gtp: uapi: fix GTPA_MAX
gtp: fix fragmentation needed check with gso
Peng Fan (3):
nvmem: imx: correct nregs for i.MX6ULL
nvmem: imx: correct nregs for i.MX6SLL
nvmem: imx: correct nregs for i.MX6UL
Peter Zijlstra (1):
perf/core: Fix potential NULL deref
Randy Dunlap (1):
ARM: OMAP: timer32K: fix all kernel-doc warnings
Rik van Riel (2):
hugetlbfs: clear resv_map pointer if mmap fails
hugetlbfs: extend hugetlb_vma_lock to private VMAs
Robert Hancock (2):
iio: adc: xilinx-xadc: Don't clobber preset voltage/temperature thresholds
iio: adc: xilinx-xadc: Correct temperature offset/scale for UltraScale
Rodríguez Barbarin, José Javier (2):
mcb: Return actual parsed size when reading chameleon table
mcb-lpc: Reallocate memory region to avoid memory overlapping
Roman Kagan (1):
KVM: x86/pmu: Truncate counter value to allowed width on write
Sasha Neftin (1):
igc: Fix ambiguity in the ethtool advertising
Sebastian Ott (1):
mm: fix vm_brk_flags() to not bail out while holding lock
Shigeru Yoshida (1):
net: usb: smsc95xx: Fix uninit-value access in smsc95xx_read_reg
Sui Jingfeng (1):
drm/logicvc: Kconfig: select REGMAP and REGMAP_MMIO
Thomas Gleixner (1):
x86/i8259: Skip probing when ACPI/MADT advertises PCAT compatibility
Tony Lindgren (2):
clk: ti: Fix missing omap4 mcbsp functional clock and aliases
clk: ti: Fix missing omap5 mcbsp functional clock and aliases
Tony Luck (1):
x86/cpu: Add model number for Intel Arrow Lake mobile processor
Ulf Hansson (2):
mmc: core: Align to common busy polling behaviour for mmc ioctls
mmc: core: Fix error propagation for some ioctl commands
Umesh Nerlige Ramappa (1):
drm/i915/pmu: Check if pmu is closed before stopping event
Uwe Kleine-König (1):
ASoC: codecs: wcd938x: Convert to platform remove callback returning void
Xuan Zhuo (1):
virtio_pci: fix the common cfg map size
Yujie Liu (1):
tracing/kprobes: Fix the description of variable length arguments
zhenwei pi (1):
virtio-crypto: handle config changed by work queue
Greg Kroah-Hartman
maintainerMakefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 6 PATCHLEVEL = 1 -SUBLEVEL = 60 +SUBLEVEL = 61 EXTRAVERSION = NAME = Curry Ramen
arch/arm/boot/dts/omap4-l4-abe.dtsi +6 -0
@@ -109,6 +109,8 @@ mcbsp1: mcbsp@0 { reg = <0x0 0xff>, /* MPU private access */ <0x49022000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP4_MCBSP1_CLKCTRL 24>; + clock-names = "fck"; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "common"; ti,buffer-size = <128>;
@@ -142,6 +144,8 @@ mcbsp2: mcbsp@0 { reg = <0x0 0xff>, /* MPU private access */ <0x49024000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP4_MCBSP2_CLKCTRL 24>; + clock-names = "fck"; interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "common"; ti,buffer-size = <128>;
@@ -175,6 +179,8 @@ mcbsp3: mcbsp@0 { reg = <0x0 0xff>, /* MPU private access */ <0x49026000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP4_MCBSP3_CLKCTRL 24>; + clock-names = "fck"; interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "common"; ti,buffer-size = <128>;
arch/arm/boot/dts/omap4-l4.dtsi +2 -0
@@ -2043,6 +2043,8 @@ mcbsp4: mcbsp@0 { compatible = "ti,omap4-mcbsp"; reg = <0x0 0xff>; /* L4 Interconnect */ reg-names = "mpu"; + clocks = <&l4_per_clkctrl OMAP4_MCBSP4_CLKCTRL 24>; + clock-names = "fck"; interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "common"; ti,buffer-size = <128>;
arch/arm/boot/dts/omap5-l4-abe.dtsi +6 -0
@@ -109,6 +109,8 @@ mcbsp1: mcbsp@0 { reg = <0x0 0xff>, /* MPU private access */ <0x49022000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP5_MCBSP1_CLKCTRL 24>; + clock-names = "fck"; interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "common"; ti,buffer-size = <128>;
@@ -142,6 +144,8 @@ mcbsp2: mcbsp@0 { reg = <0x0 0xff>, /* MPU private access */ <0x49024000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP5_MCBSP2_CLKCTRL 24>; + clock-names = "fck"; interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "common"; ti,buffer-size = <128>;
@@ -175,6 +179,8 @@ mcbsp3: mcbsp@0 { reg = <0x0 0xff>, /* MPU private access */ <0x49026000 0xff>; /* L3 Interconnect */ reg-names = "mpu", "dma"; + clocks = <&abe_clkctrl OMAP5_MCBSP3_CLKCTRL 24>; + clock-names = "fck"; interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "common"; ti,buffer-size = <128>;
arch/arm/mach-omap1/timer32k.c +7 -7
@@ -176,17 +176,18 @@ static u64 notrace omap_32k_read_sched_clock(void)return sync32k_cnt_reg ?readl_relaxed (sync32k_cnt_reg) :0 ; } +static struct timespec64 persistent_ts; +static cycles_t cycles; +static unsigned int persistent_mult, persistent_shift; +/** * omap_read_persistent_clock64 - Return time from a persistent clock. +* @ts: &struct timespec64 for the returned time * * Reads the time from a source which isn't disabled during PM, the * 32k sync timer. Convert the cycles elapsed since last read into * nsecs and adds to a monotonically increasing timespec64. */ -static struct timespec64 persistent_ts; -static cycles_t cycles; -static unsigned int persistent_mult, persistent_shift; -static void omap_read_persistent_clock64 (struct timespec64 *ts) {unsigned long long nsecs;
@@ -206,10 +207,9 @@ static void omap_read_persistent_clock64(struct timespec64 *ts)/** * omap_init_clocksource_32k - setup and register counter 32k as a * kernel clocksource -* @pbase: base addr of counter_32k module -* @size: size of counter_32k to map +* @vbase: base addr of counter_32k module * -* Returns 0 upon success or negative error code upon failure. +* Returns: %0 upon success or negative error code upon failure. * */ static int __init omap_init_clocksource_32k (void __iomem *vbase)
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +1 -0
@@ -493,6 +493,7 @@ &i2c4 { &i2s0 { pinctrl-0 = <&i2s0_2ch_bus>; + pinctrl-1 = <&i2s0_2ch_bus_bclk_off>; rockchip,capture-channels = <2>; rockchip,playback-channels = <2>; status = "okay";
arch/arm64/boot/dts/rockchip/rk3399.dtsi +10 -0
@@ -2396,6 +2396,16 @@ i2s0_2ch_bus: i2s0-2ch-bus { <4 RK_PA0 1 &pcfg_pull_none>; }; + i2s0_2ch_bus_bclk_off: i2s0-2ch-bus-bclk-off { + rockchip,pins = + <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>, + <3 RK_PD1 1 &pcfg_pull_none>, + <3 RK_PD2 1 &pcfg_pull_none>, + <3 RK_PD3 1 &pcfg_pull_none>, + <3 RK_PD7 1 &pcfg_pull_none>, + <4 RK_PA0 1 &pcfg_pull_none>; + }; + i2s0_8ch_bus: i2s0-8ch-bus { rockchip,pins = <3 RK_PD0 1 &pcfg_pull_none>,
arch/sparc/lib/checksum_32.S +1 -1
@@ -453,5 +453,5 @@ ccslow: cmp %g1, 0 * we only bother with faults on loads... */ cc_fault: - ret + retl clr %o0
arch/x86/include/asm/i8259.h +2 -0
@@ -69,6 +69,8 @@ struct legacy_pic {void (*make_irq)(unsigned int irq); }; +void legacy_pic_pcat_compat (void ); +extern struct legacy_pic *legacy_pic;extern struct legacy_pic null_legacy_pic;
arch/x86/include/asm/intel-family.h +2 -0
@@ -27,6 +27,7 @@* _X - regular server parts * _D - micro server parts * _N,_P - other mobile parts +* _H - premium mobile parts * _S - other client parts * * Historical OPTDIFFs:
@@ -125,6 +126,7 @@#define INTEL_FAM6_LUNARLAKE_M 0xBD +#define INTEL_FAM6_ARROWLAKE_H 0xC5#define INTEL_FAM6_ARROWLAKE 0xC6/* "Small Core" Processors (Atom/E-Core) */
arch/x86/kernel/acpi/boot.c +3 -0
@@ -147,6 +147,9 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)pr_debug ("Local APIC address 0x%08x\n" , madt->address); } +if (madt->flags &ACPI_MADT_PCAT_COMPAT ) +legacy_pic_pcat_compat (); +/* ACPI 6.3 and newer support the online capable bit. */ if (acpi_gbl_FADT.header.revision > 6 || (acpi_gbl_FADT.header.revision == 6 &&
arch/x86/kernel/i8259.c +30 -8
@@ -32,6 +32,7 @@*/ static void init_8259A (int auto_eoi); +static bool pcat_compat__ro_after_init ;static int i8259A_auto_eoi;DEFINE_RAW_SPINLOCK (i8259A_lock);
@@ -301,15 +302,32 @@ static void unmask_8259A(void)static int probe_8259A (void ) { +unsigned char new_val, probe_val = ~(1 <<PIC_CASCADE_IR );unsigned long flags; -unsigned char probe_val = ~(1 <<PIC_CASCADE_IR ); -unsigned char new_val; + +/* +* If MADT has the PCAT_COMPAT flag set, then do not bother probing +* for the PIC. Some BIOSes leave the PIC uninitialized and probing +* fails. +* +* Right now this causes problems as quite some code depends on +* nr_legacy_irqs() > 0 or has_legacy_pic() == true. This is silly +* when the system has an IO/APIC because then PIC is not required +* at all, except for really old machines where the timer interrupt +* must be routed through the PIC. So just pretend that the PIC is +* there and let legacy_pic->init() initialize it for nothing. +* +* Alternatively this could just try to initialize the PIC and +* repeat the probe, but for cases where there is no PIC that's +* just pointless. +*/ +if (pcat_compat) +return nr_legacy_irqs (); +/* -* Check to see if we have a PIC. -* Mask all except the cascade and read -* back the value we just wrote. If we don't -* have a PIC, we will read 0xff as opposed to the -* value we wrote. +* Check to see if we have a PIC. Mask all except the cascade and +* read back the value we just wrote. If we don't have a PIC, we +* will read 0xff as opposed to the value we wrote. */ raw_spin_lock_irqsave (&i8259A_lock, flags);
@@ -431,5 +449,9 @@ static int __init i8259A_init_ops(void)return 0 ; } -device_initcall (i8259A_init_ops); + +void __init legacy_pic_pcat_compat (void ) +{ + pcat_compat = true; +}
arch/x86/kvm/pmu.h +6 -0
@@ -63,6 +63,12 @@ static inline u64 pmc_read_counter(struct kvm_pmc *pmc)return counter &pmc_bitmask (pmc); } +static inline void pmc_write_counter (struct kvm_pmc *pmc,u64 val) +{ + pmc->counter += val -pmc_read_counter (pmc); + pmc->counter &=pmc_bitmask (pmc); +} +static inline void pmc_release_perf_event (struct kvm_pmc *pmc) {if (pmc->perf_event) {
arch/x86/kvm/svm/pmu.c +1 -1
@@ -149,7 +149,7 @@ static int amd_pmu_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)/* MSR_PERFCTRn */ pmc =get_gp_pmc_amd (pmu, msr,PMU_TYPE_COUNTER );if (pmc) { - pmc->counter += data -pmc_read_counter (pmc); +pmc_write_counter (pmc, data);pmc_update_sample_period (pmc);return 0 ; }
arch/x86/kvm/vmx/pmu_intel.c +2 -2
@@ -461,11 +461,11 @@ static int intel_pmu_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)if (!msr_info->host_initiated && !(msr &MSR_PMC_FULL_WIDTH_BIT )) data = (s64 )(s32 )data; - pmc->counter += data -pmc_read_counter (pmc); +pmc_write_counter (pmc, data);pmc_update_sample_period (pmc);return 0 ; }else if ((pmc =get_fixed_pmc (pmu, msr))) { - pmc->counter += data -pmc_read_counter (pmc); +pmc_write_counter (pmc, data);pmc_update_sample_period (pmc);return 0 ; }else if ((pmc =get_gp_pmc (pmu, msr,MSR_P6_EVNTSEL0 ))) {
block/blk-throttle.c +6 -0
@@ -723,6 +723,12 @@ static unsigned int calculate_io_allowed(u32 iops_limit,static u64 calculate_bytes_allowed (u64 bps_limit,unsigned long jiffy_elapsed) { +/* +* Can result be wider than 64 bits? +* We check against 62, not 64, due to ilog2 truncation. +*/ +if (ilog2 (bps_limit) +ilog2 (jiffy_elapsed) -ilog2 (HZ ) >62 ) +return U64_MAX ;return mul_u64_u64_div_u64 (bps_limit, (u64 )jiffy_elapsed, (u64 )HZ ); }
drivers/ata/libata-scsi.c +3 -2
@@ -1084,10 +1084,11 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev)/* * Ask the sd driver to issue START STOP UNIT on runtime suspend -* and resume only. For system level suspend/resume, devices -* power state is handled directly by libata EH. +* and resume and shutdown only. For system level suspend/resume, +* devices power state is handled directly by libata EH. */ sdev->manage_runtime_start_stop = true; + sdev->manage_shutdown = true; }/*
drivers/clk/clk.c +12 -9
@@ -3340,6 +3340,7 @@ static void possible_parent_show(struct seq_file *s, struct clk_core *core, unsigned int i, char terminator) {struct clk_core *parent; +const char *name =NULL ;/* * Go through the following options to fetch a parent's name.
@@ -3354,18 +3355,20 @@ static void possible_parent_show(struct seq_file *s, struct clk_core *core,* registered (yet). */ parent =clk_core_get_parent_by_index (core, i); -if (parent) +if (parent) {seq_puts (s, parent->name); -else if (core->parents[i].name) + }else if (core->parents[i].name) {seq_puts (s, core->parents[i].name); -else if (core->parents[i].fw_name) + }else if (core->parents[i].fw_name) {seq_printf (s,"<%s>(fw)" , core->parents[i].fw_name); -else if (core->parents[i].index >=0 ) -seq_puts (s, -of_clk_get_parent_name (core->of_node, - core->parents[i].index)); -else -seq_puts (s,"(missing)" ); + }else { +if (core->parents[i].index >=0 ) + name =of_clk_get_parent_name (core->of_node, core->parents[i].index); +if (!name) + name ="(missing)" ; + +seq_puts (s, name); + }seq_putc (s, terminator); }
drivers/clk/ti/clk-44xx.c +5 -0
@@ -749,9 +749,14 @@ static struct ti_dt_clk omap44xx_clks[] = {DT_CLK (NULL ,"mcbsp1_sync_mux_ck" ,"abe-clkctrl:0028:26" ),DT_CLK (NULL ,"mcbsp2_sync_mux_ck" ,"abe-clkctrl:0030:26" ),DT_CLK (NULL ,"mcbsp3_sync_mux_ck" ,"abe-clkctrl:0038:26" ), +DT_CLK ("40122000.mcbsp" ,"prcm_fck" ,"abe-clkctrl:0028:26" ), +DT_CLK ("40124000.mcbsp" ,"prcm_fck" ,"abe-clkctrl:0030:26" ), +DT_CLK ("40126000.mcbsp" ,"prcm_fck" ,"abe-clkctrl:0038:26" ),DT_CLK (NULL ,"mcbsp4_sync_mux_ck" ,"l4-per-clkctrl:00c0:26" ), +DT_CLK ("48096000.mcbsp" ,"prcm_fck" ,"l4-per-clkctrl:00c0:26" ),DT_CLK (NULL ,"ocp2scp_usb_phy_phy_48m" ,"l3-init-clkctrl:00c0:8" ),DT_CLK (NULL ,"otg_60m_gfclk" ,"l3-init-clkctrl:0040:24" ), +DT_CLK (NULL ,"pad_fck" ,"pad_clks_ck" ),DT_CLK (NULL ,"per_mcbsp4_gfclk" ,"l4-per-clkctrl:00c0:24" ),DT_CLK (NULL ,"pmd_stm_clock_mux_ck" ,"emu-sys-clkctrl:0000:20" ), DT_CLK(NULL, "pmd_trace_clk_mux_ck", "emu-sys-clkctrl:0000:22"),
drivers/clk/ti/clk-54xx.c +4 -0
@@ -565,15 +565,19 @@ static struct ti_dt_clk omap54xx_clks[] = {DT_CLK (NULL ,"gpio8_dbclk" ,"l4per-clkctrl:00f8:8" ),DT_CLK (NULL ,"mcbsp1_gfclk" ,"abe-clkctrl:0028:24" ),DT_CLK (NULL ,"mcbsp1_sync_mux_ck" ,"abe-clkctrl:0028:26" ), +DT_CLK ("40122000.mcbsp" ,"prcm_fck" ,"abe-clkctrl:0028:26" ),DT_CLK (NULL ,"mcbsp2_gfclk" ,"abe-clkctrl:0030:24" ),DT_CLK (NULL ,"mcbsp2_sync_mux_ck" ,"abe-clkctrl:0030:26" ), +DT_CLK ("40124000.mcbsp" ,"prcm_fck" ,"abe-clkctrl:0030:26" ),DT_CLK (NULL ,"mcbsp3_gfclk" ,"abe-clkctrl:0038:24" ),DT_CLK (NULL ,"mcbsp3_sync_mux_ck" ,"abe-clkctrl:0038:26" ), +DT_CLK ("40126000.mcbsp" ,"prcm_fck" ,"abe-clkctrl:0038:26" ),DT_CLK (NULL ,"mmc1_32khz_clk" ,"l3init-clkctrl:0008:8" ),DT_CLK (NULL ,"mmc1_fclk" ,"l3init-clkctrl:0008:25" ),DT_CLK (NULL ,"mmc1_fclk_mux" ,"l3init-clkctrl:0008:24" ),DT_CLK (NULL ,"mmc2_fclk" ,"l3init-clkctrl:0010:25" ),DT_CLK (NULL ,"mmc2_fclk_mux" ,"l3init-clkctrl:0010:24" ), +DT_CLK (NULL ,"pad_fck" ,"pad_clks_ck" ),DT_CLK (NULL ,"sata_ref_clk" ,"l3init-clkctrl:0068:8" ),DT_CLK (NULL ,"timer10_gfclk_mux" ,"l4per-clkctrl:0008:24" ), DT_CLK(NULL, "timer11_gfclk_mux", "l4per-clkctrl:0010:24"),
drivers/crypto/virtio/virtio_crypto_common.h +3 -0
@@ -35,6 +35,9 @@ struct virtio_crypto {struct virtqueue *ctrl_vq;struct data_queue *data_vq; +/* Work struct for config space updates */ +struct work_struct config_work; +/* To protect the vq operations for the controlq */ spinlock_t ctrl_lock;
drivers/crypto/virtio/virtio_crypto_core.c +13 -1
@@ -335,6 +335,14 @@ static void virtcrypto_del_vqs(struct virtio_crypto *vcrypto)virtcrypto_free_queues (vcrypto); } +static void vcrypto_config_changed_work (struct work_struct *work) +{ +struct virtio_crypto *vcrypto = + container_of(work, struct virtio_crypto, config_work); + +virtcrypto_update_status (vcrypto); +} +static int virtcrypto_probe (struct virtio_device *vdev) {int err = -EFAULT ;
@@ -454,6 +462,8 @@ static int virtcrypto_probe(struct virtio_device *vdev)if (err) goto free_engines; +INIT_WORK (&vcrypto->config_work, vcrypto_config_changed_work); +return 0 ; free_engines:
@@ -489,6 +499,7 @@ static void virtcrypto_remove(struct virtio_device *vdev)dev_info (&vdev->dev,"Start virtcrypto_remove.\n" ); +flush_work (&vcrypto->config_work);if (virtcrypto_dev_started (vcrypto))virtcrypto_dev_stop (vcrypto);virtio_reset_device (vdev);
@@ -503,7 +514,7 @@ static void virtcrypto_config_changed(struct virtio_device *vdev) {struct virtio_crypto *vcrypto = vdev->priv; -virtcrypto_update_status (vcrypto); +schedule_work (&vcrypto->config_work); }#ifdef CONFIG_PM_SLEEP
@@ -511,6 +522,7 @@ static int virtcrypto_freeze(struct virtio_device *vdev) {struct virtio_crypto *vcrypto = vdev->priv; +flush_work (&vcrypto->config_work);virtio_reset_device (vdev);virtcrypto_free_unused_reqs (vcrypto);if (virtcrypto_dev_started (vcrypto))
drivers/firewire/sbp2.c +1 -0
@@ -1521,6 +1521,7 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)if (sbp2_param_exclusive_login) { sdev->manage_system_start_stop = true; sdev->manage_runtime_start_stop = true; + sdev->manage_shutdown = true; }if (sdev->type ==TYPE_ROM )
drivers/firmware/imx/imx-dsp.c +1 -1
@@ -115,11 +115,11 @@ static int imx_dsp_setup_channels(struct imx_dsp_ipc *dsp_ipc) dsp_chan->idx = i %2 ; dsp_chan->ch =mbox_request_channel_byname (cl, chan_name);if (IS_ERR (dsp_chan->ch)) { -kfree (dsp_chan->name); ret =PTR_ERR (dsp_chan->ch);if (ret != -EPROBE_DEFER )dev_err (dev,"Failed to request mbox chan %s ret %d\n" , chan_name, ret); +kfree (dsp_chan->name); goto out; }
drivers/gpu/drm/amd/amdgpu/vi.c +1 -1
@@ -1147,7 +1147,7 @@ static void vi_program_aspm(struct amdgpu_device *adev)bool bL1SS = false;bool bClkReqSupport = true; -if (!amdgpu_device_should_use_aspm (adev) || !amdgpu_device_aspm_support_quirk ()) +if (!amdgpu_device_should_use_aspm (adev) || !amdgpu_device_pcie_dynamic_switching_supported ())return ; if (adev->flags & AMD_IS_APU ||
drivers/gpu/drm/display/drm_dp_mst_topology.c +3 -3
@@ -2574,14 +2574,14 @@ static struct drm_dp_mst_branch *get_mst_branch_device_by_guid_helper(struct drm_dp_mst_branch *found_mstb;struct drm_dp_mst_port *port; +if (!mstb) +return NULL ; +if (memcmp (mstb->guid, guid,16 ) ==0 )return mstb;list_for_each_entry (port, &mstb->ports, next) { -if (!port->mstb) -continue ; - found_mstb =get_mst_branch_device_by_guid_helper (port->mstb, guid);if (found_mstb)
drivers/gpu/drm/i915/i915_pmu.c +9 -0
@@ -760,9 +760,18 @@ static void i915_pmu_event_start(struct perf_event *event, int flags)static void i915_pmu_event_stop (struct perf_event *event,int flags) { +struct drm_i915_private *i915 = +container_of (event->pmu,typeof (*i915), pmu.base); +struct i915_pmu *pmu = &i915->pmu; + +if (pmu->closed) + goto out; +if (flags &PERF_EF_UPDATE )i915_pmu_event_read (event);i915_pmu_disable (event); + +out: event->hw.state =PERF_HES_STOPPED ; }
drivers/gpu/drm/logicvc/Kconfig +2 -0
@@ -5,5 +5,7 @@ config DRM_LOGICVC select DRM_KMS_HELPER select DRM_KMS_DMA_HELPER select DRM_GEM_DMA_HELPER + select REGMAP + select REGMAP_MMIO help DRM display driver for the logiCVC programmable logic block from Xylon
drivers/i2c/busses/i2c-aspeed.c +2 -1
@@ -749,6 +749,8 @@ static void __aspeed_i2c_reg_slave(struct aspeed_i2c_bus *bus, u16 slave_addr) func_ctrl_reg_val =readl (bus->base +ASPEED_I2C_FUN_CTRL_REG ); func_ctrl_reg_val |=ASPEED_I2CD_SLAVE_EN ;writel (func_ctrl_reg_val, bus->base +ASPEED_I2C_FUN_CTRL_REG ); + + bus->slave_state =ASPEED_I2C_SLAVE_INACTIVE ; }static int aspeed_i2c_reg_slave (struct i2c_client *client)
@@ -765,7 +767,6 @@ static int aspeed_i2c_reg_slave(struct i2c_client *client)__aspeed_i2c_reg_slave (bus, client->addr); bus->slave = client; - bus->slave_state =ASPEED_I2C_SLAVE_INACTIVE ;spin_unlock_irqrestore (&bus->lock, flags);return 0 ;
drivers/i2c/busses/i2c-stm32f7.c +6 -3
@@ -1059,9 +1059,10 @@ static int stm32f7_i2c_smbus_xfer_msg(struct stm32f7_i2c_dev *i2c_dev,/* Configure PEC */ if ((flags &I2C_CLIENT_PEC ) && f7_msg->size !=I2C_SMBUS_QUICK ) { cr1 |=STM32F7_I2C_CR1_PECEN ; - cr2 |=STM32F7_I2C_CR2_PECBYTE ; -if (!f7_msg->read_write) +if (!f7_msg->read_write) { + cr2 |=STM32F7_I2C_CR2_PECBYTE ; f7_msg->count++; + } }else { cr1 &= ~STM32F7_I2C_CR1_PECEN ; cr2 &= ~STM32F7_I2C_CR2_PECBYTE ;
@@ -1149,8 +1150,10 @@ static void stm32f7_i2c_smbus_rep_start(struct stm32f7_i2c_dev *i2c_dev) f7_msg->stop = true;/* Add one byte for PEC if needed */ -if (cr1 &STM32F7_I2C_CR1_PECEN ) +if (cr1 &STM32F7_I2C_CR1_PECEN ) { + cr2 |=STM32F7_I2C_CR2_PECBYTE ; f7_msg->count++; + }/* Set number of bytes to be transferred */ cr2 &= ~(STM32F7_I2C_CR2_NBYTES_MASK );
drivers/i2c/muxes/i2c-demux-pinctrl.c +1 -1
@@ -61,7 +61,7 @@ static int i2c_demux_activate_master(struct i2c_demux_pinctrl_priv *priv, u32 neif (ret) goto err; - adap =of_find_i2c_adapter_by_node (priv->chan[new_chan].parent_np); + adap =of_get_i2c_adapter_by_node (priv->chan[new_chan].parent_np);if (!adap) { ret = -ENODEV ; goto err_with_revert;
drivers/i2c/muxes/i2c-mux-gpmux.c +1 -1
@@ -52,7 +52,7 @@ static struct i2c_adapter *mux_parent_adapter(struct device *dev)dev_err (dev,"Cannot parse i2c-parent\n" );return ERR_PTR (-ENODEV ); } - parent =of_find_i2c_adapter_by_node (parent_np); + parent =of_get_i2c_adapter_by_node (parent_np);of_node_put (parent_np);if (!parent)return ERR_PTR (-EPROBE_DEFER );
drivers/i2c/muxes/i2c-mux-pinctrl.c +1 -1
@@ -62,7 +62,7 @@ static struct i2c_adapter *i2c_mux_pinctrl_parent_adapter(struct device *dev)dev_err (dev,"Cannot parse i2c-parent\n" );return ERR_PTR (-ENODEV ); } - parent =of_find_i2c_adapter_by_node (parent_np); + parent =of_get_i2c_adapter_by_node (parent_np);of_node_put (parent_np);if (!parent)return ERR_PTR (-EPROBE_DEFER );
drivers/iio/adc/exynos_adc.c +14 -10
@@ -826,16 +826,26 @@ static int exynos_adc_probe(struct platform_device *pdev) } } +/* leave out any TS related code if unreachable */ +if (IS_REACHABLE (CONFIG_INPUT )) { + has_ts =of_property_read_bool (pdev->dev.of_node, +"has-touchscreen" ) || pdata; + } + irq =platform_get_irq (pdev,0 );if (irq <0 )return irq; info->irq = irq; - irq =platform_get_irq (pdev,1 ); -if (irq == -EPROBE_DEFER ) -return irq; +if (has_ts) { + irq =platform_get_irq (pdev,1 ); +if (irq == -EPROBE_DEFER ) +return irq; - info->tsirq = irq; + info->tsirq = irq; + }else { + info->tsirq =-1 ; + } info->dev = &pdev->dev;
@@ -900,12 +910,6 @@ static int exynos_adc_probe(struct platform_device *pdev)if (info->data->init_hw) info->data->init_hw (info); -/* leave out any TS related code if unreachable */ -if (IS_REACHABLE (CONFIG_INPUT )) { - has_ts =of_property_read_bool (pdev->dev.of_node, -"has-touchscreen" ) || pdata; - } -if (pdata) info->delay = pdata->delay;else
drivers/iio/adc/xilinx-xadc-core.c +14 -25
@@ -456,6 +456,9 @@ static const struct xadc_ops xadc_zynq_ops = { .interrupt_handler = xadc_zynq_interrupt_handler, .update_alarm = xadc_zynq_update_alarm, .type = XADC_TYPE_S7, + /* Temp in C = (val * 503.975) / 2**bits - 273.15 */ + .temp_scale = 503975, + .temp_offset = 273150, };static const unsigned int xadc_axi_reg_offsets[] = {
@@ -566,6 +569,9 @@ static const struct xadc_ops xadc_7s_axi_ops = { .interrupt_handler = xadc_axi_interrupt_handler, .flags = XADC_FLAGS_BUFFERED | XADC_FLAGS_IRQ_OPTIONAL, .type = XADC_TYPE_S7, + /* Temp in C = (val * 503.975) / 2**bits - 273.15 */ + .temp_scale = 503975, + .temp_offset = 273150, };static const struct xadc_ops xadc_us_axi_ops = {
@@ -577,6 +583,12 @@ static const struct xadc_ops xadc_us_axi_ops = { .interrupt_handler = xadc_axi_interrupt_handler, .flags = XADC_FLAGS_BUFFERED | XADC_FLAGS_IRQ_OPTIONAL, .type = XADC_TYPE_US, +/** +* Values below are for UltraScale+ (SYSMONE4) using internal reference. +* See https://docs.xilinx.com/v/u/en-US/ug580-ultrascale-sysmon +*/ + .temp_scale = 509314, + .temp_offset = 280231, }; static int _xadc_update_adc_reg(struct xadc *xadc, unsigned int reg,
@@ -948,8 +960,7 @@ static int xadc_read_raw(struct iio_dev *indio_dev, *val2 = bits;return IIO_VAL_FRACTIONAL_LOG2 ;case IIO_TEMP : -/* Temp in C = (val * 503.975) / 2**bits - 273.15 */ - *val =503975 ; + *val = xadc->ops->temp_scale; *val2 = bits;return IIO_VAL_FRACTIONAL_LOG2 ;default :
@@ -957,7 +968,7 @@ static int xadc_read_raw(struct iio_dev *indio_dev, }case IIO_CHAN_INFO_OFFSET :/* Only the temperature channel has an offset */ - *val = -((273150 << bits) /503975 ); + *val = -((xadc->ops->temp_offset << bits) / xadc->ops->temp_scale);return IIO_VAL_INT ;case IIO_CHAN_INFO_SAMP_FREQ : ret =xadc_read_samplerate (xadc);
@@ -1426,28 +1437,6 @@ static int xadc_probe(struct platform_device *pdev)if (ret)return ret; -/* Disable all alarms */ - ret =xadc_update_adc_reg (xadc,XADC_REG_CONF1 ,XADC_CONF1_ALARM_MASK , -XADC_CONF1_ALARM_MASK ); -if (ret) -return ret; - -/* Set thresholds to min/max */ -for (i =0 ; i <16 ; i++) { -/* -* Set max voltage threshold and both temperature thresholds to -* 0xffff, min voltage threshold to 0. -*/ -if (i %8 <4 || i ==7 ) - xadc->threshold[i] =0xffff ; -else - xadc->threshold[i] =0 ; - ret =xadc_write_adc_reg (xadc,XADC_REG_THRESHOLD (i), - xadc->threshold[i]); -if (ret) -return ret; - } -/* Go to non-buffered mode */ xadc_postdisable (indio_dev);
drivers/iio/adc/xilinx-xadc.h +2 -0
@@ -85,6 +85,8 @@ struct xadc_ops {unsigned int flags;enum xadc_type type; +int temp_scale; +int temp_offset; }; static inline int _xadc_read_adc_reg(struct xadc *xadc, unsigned int reg,
drivers/iio/afe/iio-rescale.c +15 -4
@@ -214,8 +214,18 @@ static int rescale_read_raw(struct iio_dev *indio_dev,return ret <0 ? ret : -EOPNOTSUPP ; } - ret =iio_read_channel_scale (rescale->source, &scale, &scale2); -return rescale_process_offset (rescale, ret, scale, scale2, +if (iio_channel_has_info (rescale->source->channel, +IIO_CHAN_INFO_SCALE )) { + ret =iio_read_channel_scale (rescale->source, &scale, &scale2); +return rescale_process_offset (rescale, ret, scale, scale2, + schan_off, val, val2); + } + +/* +* If we get here we have no scale so scale 1:1 but apply +* rescaler and offset, if any. +*/ +return rescale_process_offset (rescale,IIO_VAL_FRACTIONAL ,1 ,1 , schan_off, val, val2);default :return -EINVAL ;
@@ -280,8 +290,9 @@ static int rescale_configure_channel(struct device *dev, chan->type = rescale->cfg->type;if (iio_channel_has_info (schan,IIO_CHAN_INFO_RAW ) && -iio_channel_has_info (schan,IIO_CHAN_INFO_SCALE )) { -dev_info (dev,"using raw+scale source channel\n" ); + (iio_channel_has_info (schan,IIO_CHAN_INFO_SCALE ) || +iio_channel_has_info (schan,IIO_CHAN_INFO_OFFSET ))) { +dev_info (dev,"using raw+scale/offset source channel\n" ); }else if (iio_channel_has_info (schan,IIO_CHAN_INFO_PROCESSED )) {dev_info (dev,"using processed channel\n" ); rescale->chan_processed = true;
drivers/mcb/mcb-lpc.c +31 -4
@@ -23,7 +23,7 @@ static int mcb_lpc_probe(struct platform_device *pdev) {struct resource *res;struct priv *priv; -int ret =0 ; +int ret =0 , table_size; priv =devm_kzalloc (&pdev->dev,sizeof (*priv),GFP_KERNEL );if (!priv)
@@ -58,16 +58,43 @@ static int mcb_lpc_probe(struct platform_device *pdev) ret =chameleon_parse_cells (priv->bus, priv->mem->start, priv->base);if (ret <0 ) { -mcb_release_bus (priv->bus); -return ret; + 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->mem->start,resource_size (priv->mem)); + +/* Then, allocate it again with the actual chameleon table size */ + res =devm_request_mem_region (&pdev->dev, priv->mem->start, + 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->mem->start, table_size); +if (!priv->base) { +dev_err (&pdev->dev,"Cannot ioremap\n" ); + ret = -ENOMEM ; + goto out_mcb_bus; + } + +platform_set_drvdata (pdev, priv); + }mcb_bus_add_devices (priv->bus);return 0 ; +out_mcb_bus: +mcb_release_bus (priv->bus); +return ret; }static int mcb_lpc_remove (struct platform_device *pdev)
drivers/mcb/mcb-parse.c +10 -5
@@ -128,7 +128,7 @@ static void chameleon_parse_bar(void __iomem *base, } } -static int chameleon_get_bar (char __iomem **base,phys_addr_t mapbase, +static int chameleon_get_bar (void __iomem **base,phys_addr_t mapbase,struct chameleon_bar **cb) {struct chameleon_bar *c;
@@ -177,12 +177,13 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase, {struct chameleon_fpga_header *header;struct chameleon_bar *cb; -char __iomem *p = base; +void __iomem *p = base;int num_cells =0 ;uint32_t dtype;int bar_count;int ret;u32 hsize; +u32 table_size; hsize =sizeof (struct chameleon_fpga_header );
@@ -237,12 +238,16 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase, num_cells++; } -if (num_cells ==0 ) - num_cells = -EINVAL ; +if (num_cells ==0 ) { + ret = -EINVAL ; + goto free_bar; + } + table_size = p - base; +pr_debug ("%d cell(s) found. Chameleon table size: 0x%04x bytes\n" , num_cells, table_size);kfree (cb);kfree (header); -return num_cells; +return table_size; free_bar:kfree (cb);
drivers/misc/fastrpc.c +17 -17
@@ -903,6 +903,7 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)if (err)return err; +memset (ctx->buf->virt,0 , pkt_size); rpra = ctx->buf->virt; list =fastrpc_invoke_buf_start (rpra, ctx->nscalars); pages =fastrpc_phy_page_start (list, ctx->nscalars);
@@ -1035,6 +1036,7 @@ static int fastrpc_put_args(struct fastrpc_invoke_ctx *ctx, } } +/* Clean up fdlist which is updated by DSP */ for (i =0 ; i <FASTRPC_MAX_FDLIST ; i++) {if (!fdlist[i])break ;
@@ -1099,11 +1101,9 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,if (IS_ERR (ctx))return PTR_ERR (ctx); -if (ctx->nscalars) { - err =fastrpc_get_args (kernel, ctx); -if (err) - goto bail; - } + err =fastrpc_get_args (kernel, ctx); +if (err) + goto bail;/* make sure that all CPU memory writes are seen by DSP */ dma_wmb ();
@@ -1119,6 +1119,13 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel, err =wait_for_completion_interruptible (&ctx->work); } +if (err) + goto bail; + +/* make sure that all memory writes by DSP are seen by CPU */ +dma_rmb (); +/* populate all the output buffers with results */ + err =fastrpc_put_args (ctx, kernel);if (err) goto bail;
@@ -1127,15 +1134,6 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,if (err) goto bail; -if (ctx->nscalars) { -/* make sure that all memory writes by DSP are seen by CPU */ -dma_rmb (); -/* populate all the output buffers with results */ - err =fastrpc_put_args (ctx, kernel); -if (err) - goto bail; - } - bail:if (err != -ERESTARTSYS && err != -ETIMEDOUT ) {/* We are done with this compute context */
@@ -1785,11 +1783,13 @@ static int fastrpc_req_mem_unmap_impl(struct fastrpc_user *fl, struct fastrpc_me sc =FASTRPC_SCALARS (FASTRPC_RMID_INIT_MEM_UNMAP ,1 ,0 ); err =fastrpc_internal_invoke (fl, true,FASTRPC_INIT_HANDLE , sc, &args[0 ]); -fastrpc_map_put (map); -if (err) +if (err) {dev_err (dev,"unmmap\tpt fd = %d, 0x%09llx error\n" , map->fd, map->raddr); +return err; + } +fastrpc_map_put (map); -return err; +return 0 ; }static int fastrpc_req_mem_unmap (struct fastrpc_user *fl,char __user *argp)
drivers/mmc/core/block.c +31 -7
@@ -180,6 +180,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,int recovery_mode, struct mmc_queue *mq);static void mmc_blk_hsq_req_done (struct mmc_request *mrq); +static int mmc_spi_err_check (struct mmc_card *card); +static int mmc_blk_busy_cb (void *cb_data,bool *busy);static struct mmc_blk_data *mmc_blk_get (struct gendisk *disk) {
@@ -471,6 +473,8 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,struct mmc_data data = {};struct mmc_request mrq = {};struct scatterlist sg; +bool r1b_resp; +unsigned int busy_timeout_ms;int err;unsigned int target_part;
@@ -559,6 +563,12 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md, (cmd.opcode == MMC_SWITCH))return mmc_sanitize (card, idata->ic.cmd_timeout_ms); +/* If it's an R1B response we need some more preparations. */ + busy_timeout_ms = idata->ic.cmd_timeout_ms ? :MMC_BLK_TIMEOUT_MS ; + r1b_resp = (cmd.flags &MMC_RSP_R1B ) ==MMC_RSP_R1B ; +if (r1b_resp) +mmc_prepare_busy_cmd (card->host, &cmd, busy_timeout_ms); +mmc_wait_for_req (card->host, &mrq);memcpy (&idata->ic.response, cmd.resp,sizeof (cmd.resp));
@@ -610,13 +620,27 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,if (idata->ic.postsleep_min_us)usleep_range (idata->ic.postsleep_min_us, idata->ic.postsleep_max_us); -if (idata->rpmb || (cmd.flags &MMC_RSP_R1B ) ==MMC_RSP_R1B ) { -/* -* Ensure RPMB/R1B command has completed by polling CMD13 "Send Status". Here we -* allow to override the default timeout value if a custom timeout is specified. -*/ - err =mmc_poll_for_busy (card, idata->ic.cmd_timeout_ms ? :MMC_BLK_TIMEOUT_MS , - false,MMC_BUSY_IO ); +if (mmc_host_is_spi (card->host)) { +if (idata->ic.write_flag || r1b_resp || cmd.flags &MMC_RSP_SPI_BUSY ) +return mmc_spi_err_check (card); +return err; + } + +/* +* Ensure RPMB, writes and R1B responses are completed by polling with +* CMD13. Note that, usually we don't need to poll when using HW busy +* detection, but here it's needed since some commands may indicate the +* error through the R1 status bits. +*/ +if (idata->rpmb || idata->ic.write_flag || r1b_resp) { +struct mmc_blk_busy_data cb_data = { + .card = card, + }; + + err =__mmc_poll_for_busy (card->host,0 , busy_timeout_ms, + &mmc_blk_busy_cb, &cb_data); + + idata->ic.response[0 ] = cb_data.status; }return err;
drivers/mmc/core/mmc_ops.c +1 -0
@@ -575,6 +575,7 @@ bool mmc_prepare_busy_cmd(struct mmc_host *host, struct mmc_command *cmd, cmd->busy_timeout = timeout_ms;return true; } +EXPORT_SYMBOL_GPL (mmc_prepare_busy_cmd);/** * __mmc_switch - modify EXT_CSD register
drivers/net/ethernet/adi/adin1110.c +1 -1
@@ -294,7 +294,7 @@ static int adin1110_read_fifo(struct adin1110_port_priv *port_priv) {struct adin1110_priv *priv = port_priv->priv;u32 header_len =ADIN1110_RD_HEADER_LEN ; -struct spi_transfer t; +struct spi_transfer t = {0 };u32 frame_size_no_fcs;struct sk_buff *rxb;u32 frame_size;
drivers/net/ethernet/intel/i40e/i40e.h +1 -1
@@ -580,7 +580,6 @@ struct i40e_pf {#define I40E_FLAG_DISABLE_FW_LLDP BIT(24)#define I40E_FLAG_RS_FEC BIT(25)#define I40E_FLAG_BASE_R_FEC BIT(26) -#define I40E_FLAG_VF_VLAN_PRUNING BIT(27)/* TOTAL_PORT_SHUTDOWN * Allows to physically disable the link on the NIC's port. * If enabled, (after link down request from the OS)
@@ -603,6 +602,7 @@ struct i40e_pf {* in abilities field of i40e_aq_set_phy_config structure */ #define I40E_FLAG_TOTAL_PORT_SHUTDOWN_ENABLED BIT(27) +#define I40E_FLAG_VF_VLAN_PRUNING BIT(28)struct i40e_client_instance *cinst;bool stat_offsets_loaded;
drivers/net/ethernet/intel/i40e/i40e_txrx.c +1 -1
@@ -2770,7 +2770,7 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)return budget; } -if (vsi->back->flags &I40E_TXR_FLAGS_WB_ON_ITR ) +if (q_vector->tx.ring[0 ].flags &I40E_TXR_FLAGS_WB_ON_ITR ) q_vector->arm_wb_state = false;/* Exit the polling mode, but don't re-enable interrupts if stack might
drivers/net/ethernet/intel/iavf/iavf_main.c +4 -3
@@ -1449,9 +1449,9 @@ void iavf_down(struct iavf_adapter *adapter) adapter->aq_required |=IAVF_FLAG_AQ_DEL_FDIR_FILTER ;if (!list_empty (&adapter->adv_rss_list_head)) adapter->aq_required |=IAVF_FLAG_AQ_DEL_ADV_RSS_CFG ; - adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ; } + adapter->aq_required |=IAVF_FLAG_AQ_DISABLE_QUEUES ;mod_delayed_work (adapter->wq, &adapter->watchdog_task,0 ); }
@@ -5020,8 +5020,6 @@ static int iavf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)INIT_WORK (&adapter->finish_config, iavf_finish_config);INIT_DELAYED_WORK (&adapter->watchdog_task, iavf_watchdog_task);INIT_DELAYED_WORK (&adapter->client_task, iavf_client_task); -queue_delayed_work (adapter->wq, &adapter->watchdog_task, -msecs_to_jiffies (5 * (pdev->devfn &0x07 )));/* Setup the wait queue for indicating transition to down status */ init_waitqueue_head (&adapter->down_waitqueue);
@@ -5032,6 +5030,9 @@ static int iavf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)/* Setup the wait queue for indicating virtchannel events */ init_waitqueue_head (&adapter->vc_waitqueue); +queue_delayed_work (adapter->wq, &adapter->watchdog_task, +msecs_to_jiffies (5 * (pdev->devfn &0x07 ))); +/* Initialization goes on in the work. Do not add more of it below. */ return 0 ; err_ioremap:
drivers/net/ethernet/intel/igb/igb_ethtool.c +5 -1
@@ -2978,11 +2978,15 @@ static int igb_add_ethtool_nfc_entry(struct igb_adapter *adapter,if (err) goto err_out_w_lock; -igb_update_ethtool_nfc_entry (adapter, input, input->sw_idx); + err =igb_update_ethtool_nfc_entry (adapter, input, input->sw_idx); +if (err) + goto err_out_input_filter;spin_unlock (&adapter->nfc_lock);return 0 ; +err_out_input_filter: +igb_erase_filter (adapter, input); err_out_w_lock:spin_unlock (&adapter->nfc_lock); err_out:
drivers/net/ethernet/intel/igc/igc_ethtool.c +25 -10
@@ -1817,7 +1817,7 @@ igc_ethtool_set_link_ksettings(struct net_device *netdev,struct igc_adapter *adapter =netdev_priv (netdev);struct net_device *dev = adapter->netdev;struct igc_hw *hw = &adapter->hw; -u32 advertising; +u16 advertised =0 ;/* When adapter in resetting mode, autoneg/speed/duplex * cannot be changed
@@ -1842,18 +1842,33 @@ igc_ethtool_set_link_ksettings(struct net_device *netdev,while (test_and_set_bit (__IGC_RESETTING, &adapter->state))usleep_range (1000 ,2000 ); -ethtool_convert_link_mode_to_legacy_u32 (&advertising, - cmd->link_modes.advertising); -/* Converting to legacy u32 drops ETHTOOL_LINK_MODE_2500baseT_Full_BIT. -* We have to check this and convert it to ADVERTISE_2500_FULL -* (aka ETHTOOL_LINK_MODE_2500baseX_Full_BIT) explicitly. -*/ - if (ethtool_link_ksettings_test_link_mode(cmd, advertising, 2500baseT_Full)) - advertising |=ADVERTISE_2500_FULL ; +if (ethtool_link_ksettings_test_link_mode (cmd, advertising, + 2500baseT_Full)) + advertised |=ADVERTISE_2500_FULL ; + +if (ethtool_link_ksettings_test_link_mode (cmd, advertising, + 1000baseT_Full)) + advertised |=ADVERTISE_1000_FULL ; + +if (ethtool_link_ksettings_test_link_mode (cmd, advertising, + 100baseT_Full)) + advertised |=ADVERTISE_100_FULL ; + +if (ethtool_link_ksettings_test_link_mode (cmd, advertising, + 100baseT_Half)) + advertised |=ADVERTISE_100_HALF ; + +if (ethtool_link_ksettings_test_link_mode (cmd, advertising, + 10baseT_Full)) + advertised |=ADVERTISE_10_FULL ; + +if (ethtool_link_ksettings_test_link_mode (cmd, advertising, + 10baseT_Half)) + advertised |=ADVERTISE_10_HALF ;if (cmd->base.autoneg ==AUTONEG_ENABLE ) { hw->mac.autoneg =1 ; - hw->phy.autoneg_advertised = advertising; + hw->phy.autoneg_advertised = advertised;if (adapter->fc_autoneg) hw->fc.requested_mode = igc_fc_default; }else {
drivers/net/ethernet/realtek/r8169_main.c +3 -3
@@ -4343,7 +4343,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp,unsigned int entry = dirty_tx %NUM_TX_DESC ;u32 status; - status =le32_to_cpu (tp->TxDescArray[entry].opts1); + status =le32_to_cpu (READ_ONCE (tp->TxDescArray[entry].opts1));if (status & DescOwn)break ;
@@ -4380,7 +4380,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp,* If skb is NULL then we come here again once a tx irq is * triggered after the last fragment is marked transmitted. */ -if (tp->cur_tx != dirty_tx && skb) +if (READ_ONCE (tp->cur_tx) != dirty_tx && skb)rtl8169_doorbell (tp); } }
@@ -4413,7 +4413,7 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, int budgetdma_addr_t addr;u32 status; - status =le32_to_cpu (desc->opts1); + status =le32_to_cpu (READ_ONCE (desc->opts1));if (status & DescOwn)break ;
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c +1 -1
@@ -1217,7 +1217,7 @@ static int gelic_wl_set_encodeext(struct net_device *netdev, key_index = wl->current_key;if (!enc->length && (ext->ext_flags &IW_ENCODE_EXT_SET_TX_KEY )) { -/* reques to change default key index */ +/* request to change default key index */ pr_debug ("%s: request to change default key to %d\n" , __func__, key_index); wl->current_key = key_index;
drivers/net/gtp.c +3 -2
@@ -871,8 +871,9 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev,skb_dst_update_pmtu_no_confirm (skb, mtu); -if (!skb_is_gso (skb) && (iph->frag_off &htons (IP_DF )) && - mtu <ntohs (iph->tot_len)) { +if (iph->frag_off &htons (IP_DF ) && + ((!skb_is_gso (skb) && skb->len > mtu) || + (skb_is_gso (skb) && !skb_gso_validate_network_len (skb, mtu)))) {netdev_dbg (dev,"packet too big, fragmentation needed\n" );icmp_ndo_send (skb,ICMP_DEST_UNREACH ,ICMP_FRAG_NEEDED ,htonl (mtu));
drivers/net/ieee802154/adf7242.c +3 -2
@@ -1162,9 +1162,10 @@ static int adf7242_stats_show(struct seq_file *file, void *offset)static void adf7242_debugfs_init (struct adf7242_local *lp) { -char debugfs_dir_name[DNAME_INLINE_LEN +1 ] ="adf7242-" ; +char debugfs_dir_name[DNAME_INLINE_LEN +1 ]; -strncat (debugfs_dir_name,dev_name (&lp->spi->dev),DNAME_INLINE_LEN ); +snprintf (debugfs_dir_name,sizeof (debugfs_dir_name), +"adf7242-%s" ,dev_name (&lp->spi->dev)); lp->debugfs_root =debugfs_create_dir (debugfs_dir_name,NULL );
drivers/net/usb/r8152.c +8 -3
@@ -1211,7 +1211,7 @@ int get_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) ret =usb_control_msg (tp->udev, tp->pipe_ctrl_in,RTL8152_REQ_GET_REGS ,RTL8152_REQT_READ , - value, index, tmp, size,500 ); + value, index, tmp, size,USB_CTRL_GET_TIMEOUT );if (ret <0 )memset (data,0xff , size);else
@@ -1234,7 +1234,7 @@ int set_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data) ret =usb_control_msg (tp->udev, tp->pipe_ctrl_out,RTL8152_REQ_SET_REGS ,RTL8152_REQT_WRITE , - value, index, tmp, size,500 ); + value, index, tmp, size,USB_CTRL_SET_TIMEOUT );kfree (tmp);
@@ -9549,7 +9549,8 @@ u8 rtl8152_get_version(struct usb_interface *intf) ret =usb_control_msg (udev,usb_rcvctrlpipe (udev,0 ),RTL8152_REQ_GET_REGS ,RTL8152_REQT_READ , -PLA_TCR0 ,MCU_TYPE_PLA , tmp,sizeof (*tmp),500 ); +PLA_TCR0 ,MCU_TYPE_PLA , tmp,sizeof (*tmp), +USB_CTRL_GET_TIMEOUT );if (ret >0 ) ocp_data = (__le32_to_cpu (*tmp) >>16 ) &VERSION_MASK ;
@@ -9825,6 +9826,10 @@ static int rtl8152_probe(struct usb_interface *intf, out1:tasklet_kill (&tp->tx_tl); +cancel_delayed_work_sync (&tp->hw_phy_work); +if (tp->rtl_ops.unload) + tp->rtl_ops.unload (tp); +rtl8152_release_firmware (tp);usb_set_intfdata (intf,NULL ); out:free_netdev (netdev);
drivers/net/usb/smsc95xx.c +3 -1
@@ -95,7 +95,9 @@ static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index, ret =fn (dev,USB_VENDOR_REQUEST_READ_REGISTER ,USB_DIR_IN |USB_TYPE_VENDOR |USB_RECIP_DEVICE ,0 , index, &buf,4 ); -if (ret <0 ) { +if (ret <4 ) { + ret = ret <0 ? ret : -ENODATA ; +if (ret != -ENODEV )netdev_warn (dev->net,"Failed to read reg index 0x%08x: %d\n" , index, ret);
drivers/nvmem/imx-ocotp.c +3 -3
@@ -506,7 +506,7 @@ static const struct ocotp_params imx6sl_params = { };static const struct ocotp_params imx6sll_params = { - .nregs =128 , + .nregs =80 , .bank_address_words =0 , .set_timing = imx_ocotp_set_imx6_timing, .ctrl =IMX_OCOTP_BM_CTRL_DEFAULT ,
@@ -520,14 +520,14 @@ static const struct ocotp_params imx6sx_params = { };static const struct ocotp_params imx6ul_params = { - .nregs =128 , + .nregs =144 , .bank_address_words =0 , .set_timing = imx_ocotp_set_imx6_timing, .ctrl =IMX_OCOTP_BM_CTRL_DEFAULT , };static const struct ocotp_params imx6ull_params = { - .nregs =64 , + .nregs =80 , .bank_address_words =0 , .set_timing = imx_ocotp_set_imx6_timing, .ctrl =IMX_OCOTP_BM_CTRL_DEFAULT ,
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +11 -6
@@ -24,7 +24,8 @@ struct lpi_pinctrl {char __iomem *tlmm_base;char __iomem *slew_base;struct clk_bulk_data clks[MAX_LPI_NUM_CLKS ]; -struct mutex slew_access_lock; +/* Protects from concurrent register updates */ +struct mutex lock;const struct lpi_pinctrl_variant_data *data; };
@@ -94,9 +95,11 @@ static int lpi_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned int function,if (WARN_ON (i == g->nfuncs))return -EINVAL ; +mutex_lock (&pctrl->lock); val =lpi_gpio_read (pctrl, pin,LPI_GPIO_CFG_REG );u32p_replace_bits (&val, i,LPI_GPIO_FUNCTION_MASK );lpi_gpio_write (pctrl, pin,LPI_GPIO_CFG_REG , val); +mutex_unlock (&pctrl->lock);return 0 ; }
@@ -202,14 +205,14 @@ static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group,if (slew_offset ==LPI_NO_SLEW )break ; -mutex_lock (&pctrl->slew_access_lock); +mutex_lock (&pctrl->lock); sval =ioread32 (pctrl->slew_base +LPI_SLEW_RATE_CTL_REG ); sval &= ~(LPI_SLEW_RATE_MASK << slew_offset); sval |= arg << slew_offset;iowrite32 (sval, pctrl->slew_base +LPI_SLEW_RATE_CTL_REG ); -mutex_unlock (&pctrl->slew_access_lock); +mutex_unlock (&pctrl->lock);break ;default :return -EINVAL ;
@@ -225,6 +228,7 @@ static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group,lpi_gpio_write (pctrl, group,LPI_GPIO_VALUE_REG , val); } +mutex_lock (&pctrl->lock); val =lpi_gpio_read (pctrl, group,LPI_GPIO_CFG_REG );u32p_replace_bits (&val, pullup,LPI_GPIO_PULL_MASK );
@@ -233,6 +237,7 @@ static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group,u32p_replace_bits (&val, output_enabled,LPI_GPIO_OE_MASK );lpi_gpio_write (pctrl, group,LPI_GPIO_CFG_REG , val); +mutex_unlock (&pctrl->lock);return 0 ; }
@@ -432,7 +437,7 @@ int lpi_pinctrl_probe(struct platform_device *pdev) pctrl->chip.of_gpio_n_cells =2 ; pctrl->chip.can_sleep = false; -mutex_init (&pctrl->slew_access_lock); +mutex_init (&pctrl->lock); pctrl->ctrl =devm_pinctrl_register (dev, &pctrl->desc, pctrl);if (IS_ERR (pctrl->ctrl)) {
@@ -454,7 +459,7 @@ int lpi_pinctrl_probe(struct platform_device *pdev)return 0 ; err_pinctrl: -mutex_destroy (&pctrl->slew_access_lock); +mutex_destroy (&pctrl->lock);clk_bulk_disable_unprepare (MAX_LPI_NUM_CLKS , pctrl->clks);return ret;
@@ -466,7 +471,7 @@ int lpi_pinctrl_remove(struct platform_device *pdev)struct lpi_pinctrl *pctrl =platform_get_drvdata (pdev);int i; -mutex_destroy (&pctrl->slew_access_lock); +mutex_destroy (&pctrl->lock);clk_bulk_disable_unprepare (MAX_LPI_NUM_CLKS , pctrl->clks);for (i =0 ; i < pctrl->data->npins; i++)
drivers/platform/x86/thinkpad_acpi.c +73 -0
79 lines not on this page · raw message
drivers/scsi/sd.c +36 -3
@@ -221,7 +221,8 @@ manage_start_stop_show(struct device *dev,return sysfs_emit (buf,"%u\n" , sdp->manage_system_start_stop && - sdp->manage_runtime_start_stop); + sdp->manage_runtime_start_stop && + sdp->manage_shutdown); }static DEVICE_ATTR_RO (manage_start_stop);
@@ -287,6 +288,35 @@ manage_runtime_start_stop_store(struct device *dev, }static DEVICE_ATTR_RW (manage_runtime_start_stop); +static ssize_t manage_shutdown_show (struct device *dev, +struct device_attribute *attr,char *buf) +{ +struct scsi_disk *sdkp =to_scsi_disk (dev); +struct scsi_device *sdp = sdkp->device; + +return sysfs_emit (buf,"%u\n" , sdp->manage_shutdown); +} + +static ssize_t manage_shutdown_store (struct device *dev, +struct device_attribute *attr, +const char *buf,size_t count) +{ +struct scsi_disk *sdkp =to_scsi_disk (dev); +struct scsi_device *sdp = sdkp->device; +bool v; + +if (!capable (CAP_SYS_ADMIN )) +return -EACCES ; + +if (kstrtobool (buf, &v)) +return -EINVAL ; + + sdp->manage_shutdown = v; + +return count; +} +static DEVICE_ATTR_RW (manage_shutdown); +static ssize_t allow_restart_show (struct device *dev,struct device_attribute *attr,char *buf) {
@@ -619,6 +649,7 @@ static struct attribute *sd_disk_attrs[] = { &dev_attr_manage_start_stop.attr, &dev_attr_manage_system_start_stop.attr, &dev_attr_manage_runtime_start_stop.attr, + &dev_attr_manage_shutdown.attr, &dev_attr_protection_type.attr, &dev_attr_protection_mode.attr, &dev_attr_app_tag_own.attr,
@@ -3700,8 +3731,10 @@ static void sd_shutdown(struct device *dev)sd_sync_cache (sdkp,NULL ); } -if (system_state !=SYSTEM_RESTART && - sdkp->device->manage_system_start_stop) { +if ((system_state !=SYSTEM_RESTART && + sdkp->device->manage_system_start_stop) || + (system_state ==SYSTEM_POWER_OFF && + sdkp->device->manage_shutdown)) {sd_printk (KERN_NOTICE , sdkp,"Stopping disk\n" );sd_start_stop_device (sdkp,0 ); }
drivers/vhost/vhost.c +1 -3
@@ -1176,9 +1176,7 @@ ssize_t vhost_chr_write_iter(struct vhost_dev *dev, goto done; } -if ((msg.type ==VHOST_IOTLB_UPDATE || - msg.type ==VHOST_IOTLB_INVALIDATE ) && - msg.size ==0 ) { +if (msg.type ==VHOST_IOTLB_UPDATE && msg.size ==0 ) { ret = -EINVAL ; goto done; }
drivers/virtio/virtio_balloon.c +5 -1
@@ -395,7 +395,11 @@ static inline s64 towards_target(struct virtio_balloon *vb) virtio_cread_le(vb->vdev, struct virtio_balloon_config, num_pages, &num_pages); - target = num_pages; +/* +* Aligned up to guest page size to avoid inflating and deflating +* balloon endlessly. +*/ + target =ALIGN (num_pages,VIRTIO_BALLOON_PAGES_PER_PAGE );return target - vb->num_pages; }
drivers/virtio/virtio_mmio.c +14 -5
@@ -614,14 +614,17 @@ static int virtio_mmio_probe(struct platform_device *pdev)spin_lock_init (&vm_dev->lock); vm_dev->base =devm_platform_ioremap_resource (pdev,0 ); -if (IS_ERR (vm_dev->base)) -return PTR_ERR (vm_dev->base); +if (IS_ERR (vm_dev->base)) { + rc =PTR_ERR (vm_dev->base); + goto free_vm_dev; + }/* Check magic value */ magic =readl (vm_dev->base +VIRTIO_MMIO_MAGIC_VALUE );if (magic != ('v' |'i' <<8 |'r' <<16 |'t' <<24 )) {dev_warn (&pdev->dev,"Wrong magic value 0x%08lx!\n" , magic); -return -ENODEV ; + rc = -ENODEV ; + goto free_vm_dev; }/* Check device version */
@@ -629,7 +632,8 @@ static int virtio_mmio_probe(struct platform_device *pdev)if (vm_dev->version <1 || vm_dev->version >2 ) {dev_err (&pdev->dev,"Version %ld not supported!\n" , vm_dev->version); -return -ENXIO ; + rc = -ENXIO ; + goto free_vm_dev; } vm_dev->vdev.id.device =readl (vm_dev->base +VIRTIO_MMIO_DEVICE_ID );
@@ -638,7 +642,8 @@ static int virtio_mmio_probe(struct platform_device *pdev)* virtio-mmio device with an ID 0 is a (dummy) placeholder * with no function. End probing now with no error reported. */ -return -ENODEV ; + rc = -ENODEV ; + goto free_vm_dev; } vm_dev->vdev.id.vendor =readl (vm_dev->base +VIRTIO_MMIO_VENDOR_ID );
@@ -668,6 +673,10 @@ static int virtio_mmio_probe(struct platform_device *pdev)put_device (&vm_dev->vdev.dev);return rc; + +free_vm_dev: +kfree (vm_dev); +return rc; }static int virtio_mmio_remove (struct platform_device *pdev)
drivers/virtio/virtio_pci_modern_dev.c +1 -1
@@ -282,7 +282,7 @@ int vp_modern_probe(struct virtio_pci_modern_device *mdev) err = -EINVAL ; mdev->common =vp_modern_map_capability (mdev, common,sizeof (struct virtio_pci_common_cfg ),4 , -0 ,sizeof (struct virtio_pci_common_cfg ), +0 ,sizeof (struct virtio_pci_modern_common_cfg ),NULL ,NULL );if (!mdev->common) goto err_map_common;
fs/ext4/mballoc.c +22 -29
116 lines not on this page · raw message
fs/ext4/mballoc.h +14 -0
@@ -218,6 +218,20 @@ static inline ext4_fsblk_t ext4_grp_offs_to_block(struct super_block *sb, (fex->fe_start <<EXT4_SB (sb)->s_cluster_bits); } +static inline loff_t extent_logical_end (struct ext4_sb_info *sbi, +struct ext4_free_extent *fex) +{ +/* Use loff_t to avoid end exceeding ext4_lblk_t max. */ +return (loff_t )fex->fe_logical +EXT4_C2B (sbi, fex->fe_len); +} + +static inline loff_t pa_logical_end (struct ext4_sb_info *sbi, +struct ext4_prealloc_space *pa) +{ +/* Use loff_t to avoid end exceeding ext4_lblk_t max. */ +return (loff_t )pa->pa_lstart +EXT4_C2B (sbi, pa->pa_len); +} + typedef int (*ext4_mballoc_query_range_fn)( struct super_block *sb, ext4_group_t agno,
fs/nfsd/vfs.c +6 -6
@@ -1659,6 +1659,12 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,if (!flen ||isdotent (fname, flen) || !tlen ||isdotent (tname, tlen)) goto out; + err = (rqstp->rq_vers ==2 ) ? nfserr_acces : nfserr_xdev; +if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) + goto out; +if (ffhp->fh_export->ex_path.dentry != tfhp->fh_export->ex_path.dentry) + goto out; + retry: host_err =fh_want_write (ffhp);if (host_err) {
@@ -1690,12 +1696,6 @@ nfsd_rename(struct svc_rqst *rqstp, struct svc_fh *ffhp, char *fname, int flen,if (ndentry == trap) goto out_dput_new; - host_err = -EXDEV ; -if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) - goto out_dput_new; -if (ffhp->fh_export->ex_path.dentry != tfhp->fh_export->ex_path.dentry) - goto out_dput_new; -if ((ndentry->d_sb->s_export_op->flags &EXPORT_OP_CLOSE_BEFORE_UNLINK ) &&nfsd_has_cached_files (ndentry)) { close_cached = true;
include/linux/hugetlb.h +6 -0
@@ -70,6 +70,7 @@ struct resv_map {long adds_in_progress;struct list_head region_cache;long region_cache_count; +struct rw_semaphore rw_sema;#ifdef CONFIG_CGROUP_HUGETLB /* * On private mappings, the counter to uncharge reservations is stored
@@ -879,6 +880,11 @@ static inline bool hugepage_migration_supported(struct hstate *h)return arch_hugetlb_migration_supported (h); } +static inline bool __vma_private_lock (struct vm_area_struct *vma) +{ +return (!(vma->vm_flags &VM_MAYSHARE )) && vma->vm_private_data; +} +/* * Movability check is different as compared to migration check. * It determines whether or not a huge page should be placed on
include/linux/kasan.h +3 -3
@@ -471,10 +471,10 @@ static inline void kasan_free_module_shadow(const struct vm_struct *vm) {}#endif /* (CONFIG_KASAN_GENERIC || CONFIG_KASAN_SW_TAGS) && !CONFIG_KASAN_VMALLOC */ -#ifdef CONFIG_KASAN_INLINE +#ifdef CONFIG_KASAN void kasan_non_canonical_hook (unsigned long addr); -#else /* CONFIG_KASAN_INLINE */ +#else /* CONFIG_KASAN */ static inline void kasan_non_canonical_hook (unsigned long addr) { } -#endif /* CONFIG_KASAN_INLINE */ +#endif /* CONFIG_KASAN */ #endif /* LINUX_KASAN_H */
include/scsi/scsi_device.h +18 -2
@@ -162,8 +162,24 @@ struct scsi_device {* core. */ unsigned int eh_timeout;/* Error handling timeout */ -bool manage_system_start_stop;/* Let HLD (sd) manage system start/stop */ -bool manage_runtime_start_stop;/* Let HLD (sd) manage runtime start/stop */ +/* +* If true, let the high-level device driver (sd) manage the device +* power state for system suspend/resume (suspend to RAM and +* hibernation) operations. +*/ +bool manage_system_start_stop; + +/* +* If true, let the high-level device driver (sd) manage the device +* power state for runtime device suspand and resume operations. +*/ +bool manage_runtime_start_stop; + +/* +* If true, let the high-level device driver (sd) manage the device +* power state for system shutdown (power off) operations. +*/ +bool manage_shutdown; unsigned removable:1; unsigned changed:1; /* Data invalid due to media change */
include/uapi/linux/gtp.h +1 -1
@@ -33,6 +33,6 @@ enum gtp_attrs {GTPA_PAD , __GTPA_MAX, }; -#define GTPA_MAX (__GTPA_MAX + 1) +#define GTPA_MAX (__GTPA_MAX - 1)#endif /* _UAPI_LINUX_GTP_H_ */
io_uring/fdinfo.c +12 -6
@@ -51,7 +51,6 @@ static __cold int io_uring_show_cred(struct seq_file *m, unsigned int id,static __cold void __io_uring_show_fdinfo (struct io_ring_ctx *ctx,struct seq_file *m) { -struct io_sq_data *sq =NULL ;struct io_overflow_cqe *ocqe;struct io_rings *r = ctx->rings;unsigned int sq_mask = ctx->sq_entries -1 , cq_mask = ctx->cq_entries -1 ;
@@ -62,6 +61,7 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,unsigned int cq_shift =0 ;unsigned int sq_shift =0 ;unsigned int sq_entries, cq_entries; +int sq_pid =-1 , sq_cpu =-1 ;bool has_lock;unsigned int i;
@@ -139,13 +139,19 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, has_lock =mutex_trylock (&ctx->uring_lock);if (has_lock && (ctx->flags &IORING_SETUP_SQPOLL )) { - sq = ctx->sq_data; -if (!sq->thread) - sq =NULL ; +struct io_sq_data *sq = ctx->sq_data; + +if (mutex_trylock (&sq->lock)) { +if (sq->thread) { + sq_pid =task_pid_nr (sq->thread); + sq_cpu =task_cpu (sq->thread); + } +mutex_unlock (&sq->lock); + } } -seq_printf (m,"SqThread:\t%d\n" , sq ?task_pid_nr (sq->thread) :-1 ); -seq_printf (m,"SqThreadCpu:\t%d\n" , sq ?task_cpu (sq->thread) :-1 ); +seq_printf (m,"SqThread:\t%d\n" , sq_pid); +seq_printf (m,"SqThreadCpu:\t%d\n" , sq_cpu);seq_printf (m,"UserFiles:\t%u\n" , ctx->nr_user_files);for (i =0 ; has_lock && i < ctx->nr_user_files; i++) {struct file *f =io_file_from_index (&ctx->file_table, i);
kernel/events/core.c +2 -1
@@ -13293,7 +13293,8 @@ static int inherit_group(struct perf_event *parent_event, !perf_get_aux_event(child_ctr, leader))return -EINVAL ; } - leader->group_generation = parent_event->group_generation; +if (leader) + leader->group_generation = parent_event->group_generation;return 0 ; }
kernel/trace/trace_kprobe.c +2 -2
@@ -989,7 +989,7 @@ EXPORT_SYMBOL_GPL(kprobe_event_cmd_init);* @name: The name of the kprobe event * @loc: The location of the kprobe event * @kretprobe: Is this a return probe? -* @args: Variable number of arg (pairs), one pair for each field +* @...: Variable number of arg (pairs), one pair for each field * * NOTE: Users normally won't want to call this function directly, but * rather use the kprobe_event_gen_cmd_start() wrapper, which automatically
@@ -1062,7 +1062,7 @@ EXPORT_SYMBOL_GPL(__kprobe_event_gen_cmd_start);/** * __kprobe_event_add_fields - Add probe fields to a kprobe command from arg list * @cmd: A pointer to the dynevent_cmd struct representing the new event -* @args: Variable number of arg (pairs), one pair for each field +* @...: Variable number of arg (pairs), one pair for each field * * NOTE: Users normally won't want to call this function directly, but * rather use the kprobe_event_add_fields() wrapper, which
lib/maple_tree.c +1 -1
@@ -5913,7 +5913,7 @@ int mas_expected_entries(struct ma_state *mas, unsigned long nr_entries)/* Internal nodes */ nr_nodes +=DIV_ROUND_UP (nr_nodes, nonleaf_cap);/* Add working room for split (2 nodes) + new parents */ -mas_node_count (mas, nr_nodes +3 ); +mas_node_count_gfp (mas, nr_nodes +3 ,GFP_KERNEL );/* Detect if allocations run out */ mas->mas_flags |=MA_STATE_PREALLOC ;
lib/test_maple_tree.c +24 -11
@@ -9,6 +9,7 @@#include <linux/maple_tree.h> #include <linux/module.h> +#include <linux/rwsem.h> #define MTREE_ALLOC_MAX 0x2000000000000Ul#ifndef CONFIG_DEBUG_MAPLE_TREE
@@ -1678,17 +1679,21 @@ static noinline void __init check_forking(struct maple_tree *mt)void *val;MA_STATE (mas, mt,0 ,0 );MA_STATE (newmas, mt,0 ,0 ); +struct rw_semaphore newmt_lock; + +init_rwsem (&newmt_lock);for (i =0 ; i <= nr_entries; i++)mtree_store_range (mt, i*10 , i*10 +5 ,xa_mk_value (i),GFP_KERNEL );mt_set_non_kernel (99999 ); -mt_init_flags (&newmt,MT_FLAGS_ALLOC_RANGE ); +mt_init_flags (&newmt,MT_FLAGS_ALLOC_RANGE |MT_FLAGS_LOCK_EXTERN ); +mt_set_external_lock (&newmt, &newmt_lock); newmas.tree = &newmt;mas_reset (&newmas);mas_reset (&mas); -mas_lock (&newmas); +down_write (&newmt_lock); mas.index =0 ; mas.last =0 ;if (mas_expected_entries (&newmas, nr_entries)) {
@@ -1703,10 +1708,10 @@ static noinline void __init check_forking(struct maple_tree *mt) }rcu_read_unlock ();mas_destroy (&newmas); -mas_unlock (&newmas);mt_validate (&newmt);mt_set_non_kernel (0 ); -mtree_destroy (&newmt); +__mt_destroy (&newmt); +up_write (&newmt_lock); } static noinline void __init check_iteration(struct maple_tree *mt)
@@ -1818,6 +1823,10 @@ static noinline void __init bench_forking(struct maple_tree *mt)void *val;MA_STATE (mas, mt,0 ,0 );MA_STATE (newmas, mt,0 ,0 ); +struct rw_semaphore newmt_lock; + +init_rwsem (&newmt_lock); +mt_set_external_lock (&newmt, &newmt_lock);for (i =0 ; i <= nr_entries; i++) mtree_store_range(mt, i*10, i*10 + 5,
@@ -1832,7 +1841,7 @@ static noinline void __init bench_forking(struct maple_tree *mt) mas.index =0 ; mas.last =0 ;rcu_read_lock (); -mas_lock (&newmas); +down_write (&newmt_lock);if (mas_expected_entries (&newmas, nr_entries)) {printk ("OOM!" );BUG_ON (1 );
@@ -1843,11 +1852,11 @@ static noinline void __init bench_forking(struct maple_tree *mt) mas_store(&newmas, val); }mas_destroy (&newmas); -mas_unlock (&newmas);rcu_read_unlock ();mt_validate (&newmt);mt_set_non_kernel (0 ); -mtree_destroy (&newmt); +__mt_destroy (&newmt); +up_write (&newmt_lock); } }#endif
@@ -2453,6 +2462,10 @@ static noinline void __init check_dup_gaps(struct maple_tree *mt,void *tmp;MA_STATE (mas, mt,0 ,0 );MA_STATE (newmas, &newmt,0 ,0 ); +struct rw_semaphore newmt_lock; + +init_rwsem (&newmt_lock); +mt_set_external_lock (&newmt, &newmt_lock);if (!zero_start) i =1 ;
@@ -2462,9 +2475,9 @@ static noinline void __init check_dup_gaps(struct maple_tree *mt,mtree_store_range (mt, i*10 , (i+1 )*10 - gap,xa_mk_value (i),GFP_KERNEL ); -mt_init_flags (&newmt,MT_FLAGS_ALLOC_RANGE ); +mt_init_flags (&newmt,MT_FLAGS_ALLOC_RANGE |MT_FLAGS_LOCK_EXTERN );mt_set_non_kernel (99999 ); -mas_lock (&newmas); +down_write (&newmt_lock); ret =mas_expected_entries (&newmas, nr_entries);mt_set_non_kernel (0 );MT_BUG_ON (mt, ret !=0 );
@@ -2477,9 +2490,9 @@ static noinline void __init check_dup_gaps(struct maple_tree *mt, }rcu_read_unlock ();mas_destroy (&newmas); -mas_unlock (&newmas); -mtree_destroy (&newmt); +__mt_destroy (&newmt); +up_write (&newmt_lock); }/* Duplicate many sizes of trees. Mainly to test expected entry values */
mm/hugetlb.c +41 -7
116 lines not on this page · raw message
mm/kasan/report.c +1 -3
@@ -523,9 +523,8 @@ void kasan_report_async(void) }#endif /* CONFIG_KASAN_HW_TAGS */ -#ifdef CONFIG_KASAN_INLINE /* -* With CONFIG_KASAN_INLINE, accesses to bogus pointers (outside the high +* With CONFIG_KASAN, accesses to bogus pointers (outside the high * canonical half of the address space) cause out-of-bounds shadow memory reads * before the actual access. For addresses in the low canonical half of the * address space, as well as most non-canonical addresses, that out-of-bounds
@@ -561,4 +560,3 @@ void kasan_non_canonical_hook(unsigned long addr)pr_alert ("KASAN: %s in range [0x%016lx-0x%016lx]\n" , bug_type, orig_addr, orig_addr +KASAN_GRANULE_SIZE -1 ); } -#endif
mm/migrate.c +12 -2
@@ -1787,6 +1787,7 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,const int __user *nodes, int __user *status, int flags) { + compat_uptr_t __user *compat_pages = (void __user *)pages;int current_node =NUMA_NO_NODE ;LIST_HEAD (pagelist);int start, i;
@@ -1800,8 +1801,17 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes,int node; err = -EFAULT ; -if (get_user (p, pages + i)) - goto out_flush; +if (in_compat_syscall ()) { +compat_uptr_t cp; + +if (get_user (cp, compat_pages + i)) + goto out_flush; + + p =compat_ptr (cp); + }else { +if (get_user (p, pages + i)) + goto out_flush; + }if (get_user (node, nodes + i)) goto out_flush; addr = (unsigned long )untagged_addr (p);
mm/mmap.c +3 -3
@@ -3147,13 +3147,13 @@ int vm_brk_flags(unsigned long addr, unsigned long request, unsigned long flags)if (!len)return 0 ; -if (mmap_write_lock_killable (mm)) -return -EINTR ; -/* Until we need other flags, refuse anything except VM_EXEC. */ if ((flags & (~VM_EXEC )) !=0 )return -EINVAL ; +if (mmap_write_lock_killable (mm)) +return -EINTR ; + ret =check_brk_limits (addr, len);if (ret) goto limits_failed;
mm/page_alloc.c +1 -1
@@ -9638,6 +9638,7 @@ static void break_down_buddy_pages(struct zone *zone, struct page *page, next_page = page; current_buddy = page + size; } + page = next_page;if (set_page_guard (zone, current_buddy, high, migratetype))continue ;
@@ -9645,7 +9646,6 @@ static void break_down_buddy_pages(struct zone *zone, struct page *page,if (current_buddy != target) {add_to_free_list (current_buddy, zone, high, migratetype);set_buddy_order (current_buddy, high); - page = next_page; } } }
net/core/neighbour.c +35 -32
134 lines not on this page · raw message
net/ipv4/tcp_input.c +5 -4
@@ -2202,16 +2202,17 @@ void tcp_enter_loss(struct sock *sk)* restore sanity to the SACK scoreboard. If the apparent reneging * persists until this RTO then we'll clear the SACK scoreboard. */ -static bool tcp_check_sack_reneging (struct sock *sk,int flag) +static bool tcp_check_sack_reneging (struct sock *sk,int *ack_flag) { -if (flag &FLAG_SACK_RENEGING && - flag &FLAG_SND_UNA_ADVANCED ) { +if (*ack_flag &FLAG_SACK_RENEGING && + *ack_flag &FLAG_SND_UNA_ADVANCED ) {struct tcp_sock *tp =tcp_sk (sk);unsigned long delay =max (usecs_to_jiffies (tp->srtt_us >>4 ),msecs_to_jiffies (10 ));inet_csk_reset_xmit_timer (sk,ICSK_TIME_RETRANS , delay,TCP_RTO_MAX ); + *ack_flag &= ~FLAG_SET_XMIT_TIMER ;return true; }return false;
@@ -2981,7 +2982,7 @@ static void tcp_fastretrans_alert(struct sock *sk, const u32 prior_snd_una, tp->prior_ssthresh =0 ;/* B. In all the states check for reneging SACKs. */ -if (tcp_check_sack_reneging (sk, flag)) +if (tcp_check_sack_reneging (sk, ack_flag))return ;/* C. Check consistency of the current state. */
net/vmw_vsock/virtio_transport.c +17 -1
@@ -590,6 +590,11 @@ static int virtio_vsock_vqs_init(struct virtio_vsock *vsock)virtio_device_ready (vdev); +return 0 ; +} + +static void virtio_vsock_vqs_start (struct virtio_vsock *vsock) +{mutex_lock (&vsock->tx_lock); vsock->tx_run = true;mutex_unlock (&vsock->tx_lock);
@@ -604,7 +609,16 @@ static int virtio_vsock_vqs_init(struct virtio_vsock *vsock) vsock->event_run = true;mutex_unlock (&vsock->event_lock); -return 0 ; +/* virtio_transport_send_pkt() can queue packets once +* the_virtio_vsock is set, but they won't be processed until +* vsock->tx_run is set to true. We queue vsock->send_pkt_work +* when initialization finishes to send those packets queued +* earlier. +* We don't need to queue the other workers (rx, event) because +* as long as we don't fill the queues with empty buffers, the +* host can't send us any notification. +*/ +queue_work (virtio_vsock_workqueue, &vsock->send_pkt_work); }static void virtio_vsock_vqs_del (struct virtio_vsock *vsock)
@@ -707,6 +721,7 @@ static int virtio_vsock_probe(struct virtio_device *vdev) goto out;rcu_assign_pointer (the_virtio_vsock, vsock); +virtio_vsock_vqs_start (vsock);mutex_unlock (&the_virtio_vsock_mutex);
@@ -779,6 +794,7 @@ static int virtio_vsock_restore(struct virtio_device *vdev) goto out;rcu_assign_pointer (the_virtio_vsock, vsock); +virtio_vsock_vqs_start (vsock); out:mutex_unlock (&the_virtio_vsock_mutex);
sound/soc/codecs/wcd938x.c +30 -21
96 lines not on this page · raw message
tools/include/linux/rwsem.h new file +40 -0
@@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +#ifndef _TOOLS__RWSEM_H +#define _TOOLS__RWSEM_H + +#include <pthread.h> + +struct rw_semaphore { +pthread_rwlock_t lock; +}; + +static inline int init_rwsem (struct rw_semaphore *sem) +{ +return pthread_rwlock_init (&sem->lock,NULL ); +} + +static inline int exit_rwsem (struct rw_semaphore *sem) +{ +return pthread_rwlock_destroy (&sem->lock); +} + +static inline int down_read (struct rw_semaphore *sem) +{ +return pthread_rwlock_rdlock (&sem->lock); +} + +static inline int up_read (struct rw_semaphore *sem) +{ +return pthread_rwlock_unlock (&sem->lock); +} + +static inline int down_write (struct rw_semaphore *sem) +{ +return pthread_rwlock_wrlock (&sem->lock); +} + +static inline int up_write (struct rw_semaphore *sem) +{ +return pthread_rwlock_unlock (&sem->lock); +} +#endif /* _TOOLS_RWSEM_H */
tools/objtool/check.c +1 -1
@@ -2478,7 +2478,7 @@ static bool is_special_call(struct instruction *insn)if (!dest)return false; -if (dest->fentry) +if (dest->fentry || dest->embedded_insn)return true; }