This is the 4.19.256 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmMHPc8ACgkQONu9yGCS aT7dvBAAtey5V7VviCe9tFUEkjDg9oB0YHu5I7J16ODhNgMV25xCoEmGD1fEZ4mr BWheee+8z7OmO/be0k+f95Sprd10zr6aFdvhkjRqvKcvm7gSR3hBryzDH65GVuM7 jWTa5RfJ2TWSAtJwjdMiRDnLbwsj51QXWaddnTcMtEBXvvU3aTNYkMLSBdz+xtjB 7S0DgTQNEaevz4GGw81zzmRWMoqlff/+rqyQitcFSr2teprGjSoRQbKzjlIU1D71 31jt1z0wEdeqDRu3S/VCPNQUd6oH+B2d+q7qjnuQkCt/GbhfW91Sw4fUCDFiKvYU KoZvVIo7fIhig9N4uLqqpP5vv23HMkAAPKMB12dt3ue1ozueEGiQ5fVdyFNcli6u M4b7woAooe0n/eL3jjPyk9U7Otg9Zj9+6LbOmnCZabkPPnYW3ik5s+kgrKBQYGhU hyd+ejnKdyqPzKK1JaJe0dk9ZhpwTPvd/4Hodiz+5wZqTXkB5nwBJHxXEeGv5O4R GfxkxN+kvLQkliADDXhohXQJfN3o4YplPNksHeDuh6PqMTHiqFJOnrVTS8Mkx4Y1 JVUsSVq3NsIzTIFOUMr6x8s3VTcSBWCMhWJpm3Afin39Zd9ZSenat4KNSN1IDYdR pkCYF/U051fKSqc9iq9bBilEQrdONG/x0GrTVTXTV1NCIVHMAh0= =U309 -----END PGP SIGNATURE----- Merge 4.19.256 into android-4.19-stable Changes in 4.19.256 Makefile: link with -z noexecstack --no-warn-rwx-segments x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments ALSA: bcd2000: Fix a UAF bug on the error path of probing wifi: mac80211_hwsim: fix race condition in pending packet wifi: mac80211_hwsim: add back erroneously removed cast wifi: mac80211_hwsim: use 32-bit skb cookie add barriers to buffer_uptodate and set_buffer_uptodate HID: wacom: Don't register pad_input for touch switch KVM: SVM: Don't BUG if userspace injects an interrupt with GIF=0 KVM: x86: Mark TSS busy during LTR emulation _after_ all fault checks KVM: x86: Set error code to segment selector on LLDT/LTR non-canonical #GP ALSA: hda/conexant: Add quirk for LENOVO 20149 Notebook model ALSA: hda/cirrus - support for iMac 12,1 model tty: vt: initialize unicode screen buffer vfs: Check the truncate maximum size in inode_newsize_ok() fs: Add missing umask strip in vfs_tmpfile thermal: sysfs: Fix cooling_device_stats_setup() error code path fbcon: Fix boundary checks for fbcon=vc:n1-n2 parameters usbnet: Fix linkwatch use-after-free on disconnect ovl: drop WARN_ON() dentry is NULL in ovl_encode_fh() parisc: Fix device names in /proc/iomem drm/nouveau: fix another off-by-one in nvbios_addr drm/amdgpu: Check BO's requested pinning domains against its preferred_domains bpf: Verifer, adjust_scalar_min_max_vals to always call update_reg_bounds() iio: light: isl29028: Fix the warning in isl29028_remove() fuse: limit nsec serial: mvebu-uart: uart2 error bits clearing md-raid10: fix KASAN warning ia64, processor: fix -Wincompatible-pointer-types in ia64_get_irr() PCI: Add defines for normal and subtractive PCI bridges powerpc/fsl-pci: Fix Class Code of PCIe Root Port powerpc/powernv: Avoid crashing if rng is NULL MIPS: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK USB: HCD: Fix URB giveback issue in tasklet function netfilter: nf_tables: do not allow SET_ID to refer to another table netfilter: nf_tables: fix null deref due to zeroed list head arm64: Do not forget syscall when starting a new thread. arm64: fix oops in concurrently setting insn_emulation sysctls ext2: Add more validity checks for inode counts ARM: dts: imx6ul: add missing properties for sram ARM: dts: imx6ul: change operating-points to uint32-matrix ARM: dts: imx6ul: fix lcdif node compatible ARM: dts: imx6ul: fix qspi node compatible ARM: OMAP2+: display: Fix refcount leak bug ACPI: EC: Remove duplicate ThinkPad X1 Carbon 6th entry from DMI quirks ACPI: PM: save NVS memory for Lenovo G40-45 ACPI: LPSS: Fix missing check in register_device_clock() arm64: dts: qcom: ipq8074: fix NAND node name PM: hibernate: defer device probing when resuming from hibernation selinux: Add boundary check in put_entry() ARM: findbit: fix overflowing offset meson-mx-socinfo: Fix refcount leak in meson_mx_socinfo_init ARM: bcm: Fix refcount leak in bcm_kona_smc_init x86/pmem: Fix platform-device leak in error path ARM: dts: ast2500-evb: fix board compatible soc: fsl: guts: machine variable might be unset ARM: OMAP2+: Fix refcount leak in omap3xxx_prm_late_init cpufreq: zynq: Fix refcount leak in zynq_get_revision ARM: dts: qcom: pm8841: add required thermal-sensor-cells bus: hisi_lpc: fix missing platform_device_put() in hisi_lpc_acpi_probe() arm64: dts: qcom: msm8916: Fix typo in pronto remoteproc node regulator: of: Fix refcount leak bug in of_get_regulation_constraints() nohz/full, sched/rt: Fix missed tick-reenabling bug in dequeue_task_rt() thermal/tools/tmon: Include pthread and time headers in tmon.h dm: return early from dm_pr_call() if DM device is suspended ath10k: do not enforce interrupt trigger type wifi: rtlwifi: fix error codes in rtl_debugfs_set_write_h2c() drm/radeon: fix potential buffer overflow in ni_set_mc_special_registers() drm/mediatek: Add pull-down MIPI operation in mtk_dsi_poweroff function i2c: Fix a potential use after free media: tw686x: Register the irq at the end of probe ath9k: fix use-after-free in ath9k_hif_usb_rx_cb wifi: iwlegacy: 4965: fix potential off-by-one overflow in il4965_rs_fill_link_cmd() drm: bridge: adv7511: Add check for mipi_dsi_driver_register media: hdpvr: fix error value returns in hdpvr_read drm/vc4: dsi: Correct DSI divider calculations drm/rockchip: vop: Don't crash for invalid duplicate_state() drm/mediatek: dpi: Remove output format of YUV drm: bridge: sii8620: fix possible off-by-one drm/msm/mdp5: Fix global state lock backoff crypto: hisilicon - Kunpeng916 crypto driver don't sleep when in softirq media: platform: mtk-mdp: Fix mdp_ipi_comm structure alignment mediatek: mt76: mac80211: Fix missing of_node_put() in mt76_led_init() tcp: make retransmitted SKB fit into the send window libbpf: Fix the name of a reused map selftests: timers: valid-adjtimex: build fix for newer toolchains selftests: timers: clocksource-switch: fix passing errors from child fs: check FMODE_LSEEK to control internal pipe splicing wifi: wil6210: debugfs: fix info leak in wil_write_file_wmi() wifi: p54: Fix an error handling path in p54spi_probe() wifi: p54: add missing parentheses in p54_flush() can: pch_can: do not report txerr and rxerr during bus-off can: rcar_can: do not report txerr and rxerr during bus-off can: sja1000: do not report txerr and rxerr during bus-off can: hi311x: do not report txerr and rxerr during bus-off can: sun4i_can: do not report txerr and rxerr during bus-off can: kvaser_usb_hydra: do not report txerr and rxerr during bus-off can: kvaser_usb_leaf: do not report txerr and rxerr during bus-off can: usb_8dev: do not report txerr and rxerr during bus-off can: error: specify the values of data[5..7] of CAN error frames can: pch_can: pch_can_error(): initialize errc before using it Bluetooth: hci_intel: Add check for platform_driver_register i2c: cadence: Support PEC for SMBus block read i2c: mux-gpmux: Add of_node_put() when breaking out of loop wifi: wil6210: debugfs: fix uninitialized variable use in `wil_write_file_wmi()` wifi: libertas: Fix possible refcount leak in if_usb_probe() net/mlx5e: Fix the value of MLX5E_MAX_RQ_NUM_MTTS netdevsim: Avoid allocation warnings triggered from user space net: rose: fix netdev reference changes dccp: put dccp_qpolicy_full() and dccp_qpolicy_push() in the same lock clk: renesas: r9a06g032: Fix UART clkgrp bitsel mtd: maps: Fix refcount leak in of_flash_probe_versatile mtd: maps: Fix refcount leak in ap_flash_init HID: cp2112: prevent a buffer overflow in cp2112_xfer() mtd: sm_ftl: Fix deadlock caused by cancel_work_sync in sm_release mtd: st_spi_fsm: Add a clk_disable_unprepare() in .probe()'s error path fpga: altera-pr-ip: fix unsigned comparison with less than zero usb: host: Fix refcount leak in ehci_hcd_ppc_of_probe usb: ohci-nxp: Fix refcount leak in ohci_hcd_nxp_probe misc: rtsx: Fix an error handling path in rtsx_pci_probe() clk: qcom: ipq8074: fix NSS port frequency tables clk: qcom: ipq8074: set BRANCH_HALT_DELAY flag for UBI clocks soundwire: bus_type: fix remove and shutdown support staging: rtl8192u: Fix sleep in atomic context bug in dm_fsync_timer_callback mmc: sdhci-of-esdhc: Fix refcount leak in esdhc_signal_voltage_switch memstick/ms_block: Fix some incorrect memory allocation memstick/ms_block: Fix a memory leak mmc: sdhci-of-at91: fix set_uhs_signaling rewriting of MC1R scsi: smartpqi: Fix DMA direction for RAID requests usb: gadget: udc: amd5536 depends on HAS_DMA RDMA/hfi1: fix potential memory leak in setup_base_ctxt() gpio: gpiolib-of: Fix refcount bugs in of_mm_gpiochip_add_data() mmc: cavium-octeon: Add of_node_put() when breaking out of loop mmc: cavium-thunderx: Add of_node_put() when breaking out of loop HID: alps: Declare U1_UNICORN_LEGACY support USB: serial: fix tty-port initialized comments platform/olpc: Fix uninitialized data in debugfs write mm/mmap.c: fix missing call to vm_unacct_memory in mmap_region RDMA/rxe: Fix error unwind in rxe_create_qp() null_blk: fix ida error handling in null_add_dev() ext4: recover csum seed of tmp_inode after migrating to extents jbd2: fix assertion 'jh->b_frozen_data == NULL' failure when journal aborted ASoC: mediatek: mt8173: Fix refcount leak in mt8173_rt5650_rt5676_dev_probe ASoC: mt6797-mt6351: Fix refcount leak in mt6797_mt6351_dev_probe ASoC: codecs: da7210: add check for i2c_add_driver ASoC: mediatek: mt8173-rt5650: Fix refcount leak in mt8173_rt5650_dev_probe serial: 8250_dw: Store LSR into lsr_saved_flags in dw8250_tx_wait_empty() profiling: fix shift too large makes kernel panic tty: n_gsm: fix non flow control frames during mux flow off tty: n_gsm: fix packet re-transmission without open control channel tty: n_gsm: fix race condition in gsmld_write() remoteproc: qcom: wcnss: Fix handling of IRQs vfio/ccw: Do not change FSM state in subchannel event tty: n_gsm: fix wrong T1 retry count handling tty: n_gsm: fix DM command tty: n_gsm: fix missing corner cases in gsmld_poll() iommu/exynos: Handle failed IOMMU device registration properly rpmsg: qcom_smd: Fix refcount leak in qcom_smd_parse_edge kfifo: fix kfifo_to_user() return type mfd: t7l66xb: Drop platform disable callback iommu/arm-smmu: qcom_iommu: Add of_node_put() when breaking out of loop s390/zcore: fix race when reading from hardware system area ASoC: qcom: q6dsp: Fix an off-by-one in q6adm_alloc_copp() video: fbdev: amba-clcd: Fix refcount leak bugs video: fbdev: sis: fix typos in SiS_GetModeID() powerpc/32: Do not allow selection of e5500 or e6500 CPUs on PPC32 powerpc/pci: Prefer PCI domain assignment via DT 'linux,pci-domain' and alias powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader powerpc/xive: Fix refcount leak in xive_get_max_prio powerpc/cell/axon_msi: Fix refcount leak in setup_msi_msg_address kprobes: Forbid probing on trampoline and BPF code areas powerpc/pci: Fix PHB numbering when using opal-phbid genelf: Use HAVE_LIBCRYPTO_SUPPORT, not the never defined HAVE_LIBCRYPTO scripts/faddr2line: Fix vmlinux detection on arm64 x86/numa: Use cpumask_available instead of hardcoded NULL check video: fbdev: arkfb: Fix a divide-by-zero bug in ark_set_pixclock() tools/thermal: Fix possible path truncations video: fbdev: vt8623fb: Check the size of screen before memset_io() video: fbdev: arkfb: Check the size of screen before memset_io() video: fbdev: s3fb: Check the size of screen before memset_io() scsi: zfcp: Fix missing auto port scan and thus missing target ports x86/olpc: fix 'logical not is only applied to the left hand side' spmi: trace: fix stack-out-of-bound access in SPMI tracing functions ext4: add EXT4_INODE_HAS_XATTR_SPACE macro in xattr.h ext4: make sure ext4_append() always allocates new block ext4: fix use-after-free in ext4_xattr_set_entry ext4: update s_overhead_clusters in the superblock during an on-line resize ext4: fix extent status tree race in writeback error recovery path ext4: correct max_inline_xattr_value_size computing ext4: correct the misjudgment in ext4_iget_extra_inode intel_th: pci: Add Raptor Lake-S CPU support intel_th: pci: Add Raptor Lake-S PCH support intel_th: pci: Add Meteor Lake-P support dm raid: fix address sanitizer warning in raid_resume dm raid: fix address sanitizer warning in raid_status dm writecache: set a default MAX_WRITEBACK_JOBS ACPI: CPPC: Do not prevent CPPC from working in the future net_sched: cls_route: remove from list when handle is 0 btrfs: reject log replay if there is unsupported RO compat flag KVM: Add infrastructure and macro to mark VM as bugged KVM: x86: Check lapic_in_kernel() before attempting to set a SynIC irq KVM: x86: Avoid theoretical NULL pointer dereference in kvm_irq_delivery_to_apic_fast() tcp: fix over estimation in sk_forced_mem_schedule() scsi: sg: Allow waiting for commands to complete on removed device Revert "net: usb: ax88179_178a needs FLAG_SEND_ZLP" Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm regression net/9p: Initialize the iounit field during fid creation net_sched: cls_route: disallow handle of 0 firmware: arm_scpi: Ensure scpi_info is not assigned if the probe fails powerpc/mm: Split dump_pagelinuxtables flag_array table powerpc/ptdump: Fix display of RW pages on FSL_BOOK3E ALSA: info: Fix llseek return value when using callback rds: add missing barrier to release_refill ata: libata-eh: Add missing command name mmc: pxamci: Fix another error handling path in pxamci_probe() mmc: pxamci: Fix an error handling path in pxamci_probe() btrfs: fix lost error handling when looking up extended ref on log replay tracing: Have filter accept "common_cpu" to be consistent can: ems_usb: fix clang's -Wunaligned-access warning apparmor: fix quiet_denied for file rules apparmor: fix absroot causing audited secids to begin with = apparmor: Fix failed mount permission check error message apparmor: fix aa_label_asxprint return check apparmor: fix overlapping attachment computation apparmor: fix reference count leak in aa_pivotroot() apparmor: Fix memleak in aa_simple_write_to_buffer() NFSv4: Fix races in the legacy idmapper upcall NFSv4.1: RECLAIM_COMPLETE must handle EACCES NFSv4/pnfs: Fix a use-after-free bug in open SUNRPC: Reinitialise the backchannel request buffers before reuse pinctrl: nomadik: Fix refcount leak in nmk_pinctrl_dt_subnode_to_map pinctrl: qcom: msm8916: Allow CAMSS GP clocks to be muxed ACPI: property: Return type of acpi_add_nondev_subnodes() should be bool geneve: do not use RT_TOS for IPv6 flowlabel vsock: Fix memory leak in vsock_connect() vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeout() tools build: Switch to new openssl API for test-libcrypto NTB: ntb_tool: uninitialized heap data in tool_fn_write() xen/xenbus: fix return type in xenbus_file_read() atm: idt77252: fix use-after-free bugs caused by tst_timer nios2: page fault et.al. are *not* restartable syscalls... nios2: don't leave NULLs in sys_call_table[] nios2: traced syscall does need to check the syscall number nios2: fix syscall restart checks nios2: restarts apply only to the first sigframe we build... nios2: add force_successful_syscall_return() netfilter: nf_tables: really skip inactive sets when allocating name powerpc/pci: Fix get_phb_number() locking i40e: Fix to stop tx_timeout recovery if GLOBR fails fec: Fix timer capture timing in `fec_ptp_enable_pps()` igb: Add lock to avoid data race gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file locking/atomic: Make test_and_*_bit() ordered on failure drm/meson: Fix refcount bugs in meson_vpu_has_available_connectors() PCI: Add ACS quirk for Broadcom BCM5750x NICs irqchip/tegra: Fix overflow implicit truncation warnings usb: host: ohci-ppc-of: Fix refcount leak bug usb: renesas: Fix refcount leak bug vboxguest: Do not use devm for irq clk: qcom: ipq8074: dont disable gcc_sleep_clk_src gadgetfs: ep_io - wait until IRQ finishes cxl: Fix a memory leak in an error handling path dmaengine: sprd: Cleanup in .remove() after pm_runtime_get_sync() failed drivers:md:fix a potential use-after-free bug ext4: avoid remove directory when directory is corrupted ext4: avoid resizing to a partial cluster size lib/list_debug.c: Detect uninitialized lists tty: serial: Fix refcount leak bug in ucc_uart.c vfio: Clear the caps->buf to NULL after free mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start riscv: mmap with PROT_WRITE but no PROT_READ is invalid RISC-V: Add fast call path of crash_kexec() watchdog: export lockup_detector_reconfigure ALSA: core: Add async signal helpers ALSA: timer: Use deferred fasync helper f2fs: fix to avoid use f2fs_bug_on() in f2fs_new_node_page() smb3: check xattr value length earlier powerpc/64: Init jump labels before parse_early_param() video: fbdev: i740fb: Check the argument of i740_calc_vclk() MIPS: tlbex: Explicitly compare _PAGE_NO_EXEC against 0 tee: add overflow check in register_shm_helper() tracing/probes: Have kprobes and uprobes use $COMM too btrfs: only write the sectors in the vertical stripe which has data stripes btrfs: raid56: don't trust any cached sector in __raid56_parity_recover() Linux 4.19.256 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Icc0d54b54bbf59d4f46e021d161581f330e9dea6
This commit is contained in:
commit
80792f5eeb
@ -59,7 +59,7 @@ Like with atomic_t, the rule of thumb is:
|
||||
- RMW operations that have a return value are fully ordered.
|
||||
|
||||
- RMW operations that are conditional are unordered on FAILURE,
|
||||
otherwise the above rules apply. In the case of test_and_{}_bit() operations,
|
||||
otherwise the above rules apply. In the case of test_and_set_bit_lock(),
|
||||
if the bit in memory is unchanged by the operation then it is deemed to have
|
||||
failed.
|
||||
|
||||
|
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 255
|
||||
SUBLEVEL = 256
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
|
@ -86,11 +86,12 @@ static void octeon2_usb_clocks_start(struct device *dev)
|
||||
"refclk-frequency", &clock_rate);
|
||||
if (i) {
|
||||
dev_err(dev, "No UCTL \"refclk-frequency\"\n");
|
||||
of_node_put(uctl_node);
|
||||
goto exit;
|
||||
}
|
||||
i = of_property_read_string(uctl_node,
|
||||
"refclk-type", &clock_type);
|
||||
|
||||
of_node_put(uctl_node);
|
||||
if (!i && strcmp("crystal", clock_type) == 0)
|
||||
is_crystal_clock = true;
|
||||
}
|
||||
|
@ -630,7 +630,7 @@ static __maybe_unused void build_convert_pte_to_entrylo(u32 **p,
|
||||
return;
|
||||
}
|
||||
|
||||
if (cpu_has_rixi && !!_PAGE_NO_EXEC) {
|
||||
if (cpu_has_rixi && _PAGE_NO_EXEC != 0) {
|
||||
if (fill_includes_sw_bits) {
|
||||
UASM_i_ROTR(p, reg, reg, ilog2(_PAGE_GLOBAL));
|
||||
} else {
|
||||
@ -2559,7 +2559,7 @@ static void check_pabits(void)
|
||||
unsigned long entry;
|
||||
unsigned pabits, fillbits;
|
||||
|
||||
if (!cpu_has_rixi || !_PAGE_NO_EXEC) {
|
||||
if (!cpu_has_rixi || _PAGE_NO_EXEC == 0) {
|
||||
/*
|
||||
* We'll only be making use of the fact that we can rotate bits
|
||||
* into the fill if the CPU supports RIXI, so don't bother
|
||||
|
@ -50,7 +50,8 @@
|
||||
stw r13, PT_R13(sp)
|
||||
stw r14, PT_R14(sp)
|
||||
stw r15, PT_R15(sp)
|
||||
stw r2, PT_ORIG_R2(sp)
|
||||
movi r24, -1
|
||||
stw r24, PT_ORIG_R2(sp)
|
||||
stw r7, PT_ORIG_R7(sp)
|
||||
|
||||
stw ra, PT_RA(sp)
|
||||
|
@ -74,6 +74,8 @@ extern void show_regs(struct pt_regs *);
|
||||
((struct pt_regs *)((unsigned long)current_thread_info() + THREAD_SIZE)\
|
||||
- 1)
|
||||
|
||||
#define force_successful_syscall_return() (current_pt_regs()->orig_r2 = -1)
|
||||
|
||||
int do_syscall_trace_enter(void);
|
||||
void do_syscall_trace_exit(void);
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
@ -185,6 +185,7 @@ ENTRY(handle_system_call)
|
||||
ldw r5, PT_R5(sp)
|
||||
|
||||
local_restart:
|
||||
stw r2, PT_ORIG_R2(sp)
|
||||
/* Check that the requested system call is within limits */
|
||||
movui r1, __NR_syscalls
|
||||
bgeu r2, r1, ret_invsyscall
|
||||
@ -192,7 +193,6 @@ local_restart:
|
||||
movhi r11, %hiadj(sys_call_table)
|
||||
add r1, r1, r11
|
||||
ldw r1, %lo(sys_call_table)(r1)
|
||||
beq r1, r0, ret_invsyscall
|
||||
|
||||
/* Check if we are being traced */
|
||||
GET_THREAD_INFO r11
|
||||
@ -213,6 +213,9 @@ local_restart:
|
||||
translate_rc_and_ret:
|
||||
movi r1, 0
|
||||
bge r2, zero, 3f
|
||||
ldw r1, PT_ORIG_R2(sp)
|
||||
addi r1, r1, 1
|
||||
beq r1, zero, 3f
|
||||
sub r2, zero, r2
|
||||
movi r1, 1
|
||||
3:
|
||||
@ -255,9 +258,9 @@ traced_system_call:
|
||||
ldw r6, PT_R6(sp)
|
||||
ldw r7, PT_R7(sp)
|
||||
|
||||
/* Fetch the syscall function, we don't need to check the boundaries
|
||||
* since this is already done.
|
||||
*/
|
||||
/* Fetch the syscall function. */
|
||||
movui r1, __NR_syscalls
|
||||
bgeu r2, r1, traced_invsyscall
|
||||
slli r1, r2, 2
|
||||
movhi r11,%hiadj(sys_call_table)
|
||||
add r1, r1, r11
|
||||
@ -276,6 +279,9 @@ traced_system_call:
|
||||
translate_rc_and_ret2:
|
||||
movi r1, 0
|
||||
bge r2, zero, 4f
|
||||
ldw r1, PT_ORIG_R2(sp)
|
||||
addi r1, r1, 1
|
||||
beq r1, zero, 4f
|
||||
sub r2, zero, r2
|
||||
movi r1, 1
|
||||
4:
|
||||
@ -287,6 +293,11 @@ end_translate_rc_and_ret2:
|
||||
RESTORE_SWITCH_STACK
|
||||
br ret_from_exception
|
||||
|
||||
/* If the syscall number was invalid return ENOSYS */
|
||||
traced_invsyscall:
|
||||
movi r2, -ENOSYS
|
||||
br translate_rc_and_ret2
|
||||
|
||||
Luser_return:
|
||||
GET_THREAD_INFO r11 /* get thread_info pointer */
|
||||
ldw r10, TI_FLAGS(r11) /* get thread_info->flags */
|
||||
@ -336,9 +347,6 @@ external_interrupt:
|
||||
/* skip if no interrupt is pending */
|
||||
beq r12, r0, ret_from_interrupt
|
||||
|
||||
movi r24, -1
|
||||
stw r24, PT_ORIG_R2(sp)
|
||||
|
||||
/*
|
||||
* Process an external hardware interrupt.
|
||||
*/
|
||||
|
@ -240,7 +240,7 @@ static int do_signal(struct pt_regs *regs)
|
||||
/*
|
||||
* If we were from a system call, check for system call restarting...
|
||||
*/
|
||||
if (regs->orig_r2 >= 0) {
|
||||
if (regs->orig_r2 >= 0 && regs->r1) {
|
||||
continue_addr = regs->ea;
|
||||
restart_addr = continue_addr - 4;
|
||||
retval = regs->r2;
|
||||
@ -261,6 +261,7 @@ static int do_signal(struct pt_regs *regs)
|
||||
regs->ea = restart_addr;
|
||||
break;
|
||||
}
|
||||
regs->orig_r2 = -1;
|
||||
}
|
||||
|
||||
if (get_signal(&ksig)) {
|
||||
|
@ -25,5 +25,6 @@
|
||||
#define __SYSCALL(nr, call) [nr] = (call),
|
||||
|
||||
void *sys_call_table[__NR_syscalls] = {
|
||||
[0 ... __NR_syscalls-1] = sys_ni_syscall,
|
||||
#include <asm/unistd.h>
|
||||
};
|
||||
|
@ -75,23 +75,35 @@ const struct dma_map_ops *get_pci_dma_ops(void)
|
||||
}
|
||||
EXPORT_SYMBOL(get_pci_dma_ops);
|
||||
|
||||
/*
|
||||
* This function should run under locking protection, specifically
|
||||
* hose_spinlock.
|
||||
*/
|
||||
static int get_phb_number(struct device_node *dn)
|
||||
{
|
||||
int ret, phb_id = -1;
|
||||
u32 prop_32;
|
||||
u64 prop;
|
||||
|
||||
/*
|
||||
* Try fixed PHB numbering first, by checking archs and reading
|
||||
* the respective device-tree properties. Firstly, try powernv by
|
||||
* reading "ibm,opal-phbid", only present in OPAL environment.
|
||||
* the respective device-tree properties. Firstly, try reading
|
||||
* standard "linux,pci-domain", then try reading "ibm,opal-phbid"
|
||||
* (only present in powernv OPAL environment), then try device-tree
|
||||
* alias and as the last try to use lower bits of "reg" property.
|
||||
*/
|
||||
ret = of_property_read_u64(dn, "ibm,opal-phbid", &prop);
|
||||
ret = of_get_pci_domain_nr(dn);
|
||||
if (ret >= 0) {
|
||||
prop = ret;
|
||||
ret = 0;
|
||||
}
|
||||
if (ret)
|
||||
ret = of_property_read_u64(dn, "ibm,opal-phbid", &prop);
|
||||
|
||||
if (ret) {
|
||||
ret = of_alias_get_id(dn, "pci");
|
||||
if (ret >= 0) {
|
||||
prop = ret;
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
if (ret) {
|
||||
u32 prop_32;
|
||||
ret = of_property_read_u32_index(dn, "reg", 1, &prop_32);
|
||||
prop = prop_32;
|
||||
}
|
||||
@ -99,18 +111,20 @@ static int get_phb_number(struct device_node *dn)
|
||||
if (!ret)
|
||||
phb_id = (int)(prop & (MAX_PHBS - 1));
|
||||
|
||||
spin_lock(&hose_spinlock);
|
||||
|
||||
/* We need to be sure to not use the same PHB number twice. */
|
||||
if ((phb_id >= 0) && !test_and_set_bit(phb_id, phb_bitmap))
|
||||
return phb_id;
|
||||
goto out_unlock;
|
||||
|
||||
/*
|
||||
* If not pseries nor powernv, or if fixed PHB numbering tried to add
|
||||
* the same PHB number twice, then fallback to dynamic PHB numbering.
|
||||
*/
|
||||
/* If everything fails then fallback to dynamic PHB numbering. */
|
||||
phb_id = find_first_zero_bit(phb_bitmap, MAX_PHBS);
|
||||
BUG_ON(phb_id >= MAX_PHBS);
|
||||
set_bit(phb_id, phb_bitmap);
|
||||
|
||||
out_unlock:
|
||||
spin_unlock(&hose_spinlock);
|
||||
|
||||
return phb_id;
|
||||
}
|
||||
|
||||
@ -121,10 +135,13 @@ struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
|
||||
phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
|
||||
if (phb == NULL)
|
||||
return NULL;
|
||||
spin_lock(&hose_spinlock);
|
||||
|
||||
phb->global_number = get_phb_number(dev);
|
||||
|
||||
spin_lock(&hose_spinlock);
|
||||
list_add_tail(&phb->list_node, &hose_list);
|
||||
spin_unlock(&hose_spinlock);
|
||||
|
||||
phb->dn = dev;
|
||||
phb->is_dynamic = slab_is_available();
|
||||
#ifdef CONFIG_PPC64
|
||||
|
@ -737,6 +737,13 @@ void __init early_init_devtree(void *params)
|
||||
of_scan_flat_dt(early_init_dt_scan_root, NULL);
|
||||
of_scan_flat_dt(early_init_dt_scan_memory_ppc, NULL);
|
||||
|
||||
/*
|
||||
* As generic code authors expect to be able to use static keys
|
||||
* in early_param() handlers, we initialize the static keys just
|
||||
* before parsing early params (it's fine to call jump_label_init()
|
||||
* more than once).
|
||||
*/
|
||||
jump_label_init();
|
||||
parse_early_param();
|
||||
|
||||
/* make sure we've parsed cmdline for mem= before this */
|
||||
|
@ -43,5 +43,12 @@ obj-$(CONFIG_HIGHMEM) += highmem.o
|
||||
obj-$(CONFIG_PPC_COPRO_BASE) += copro_fault.o
|
||||
obj-$(CONFIG_SPAPR_TCE_IOMMU) += mmu_context_iommu.o
|
||||
obj-$(CONFIG_PPC_PTDUMP) += dump_linuxpagetables.o
|
||||
ifdef CONFIG_PPC_PTDUMP
|
||||
obj-$(CONFIG_4xx) += dump_linuxpagetables-generic.o
|
||||
obj-$(CONFIG_PPC_8xx) += dump_linuxpagetables-8xx.o
|
||||
obj-$(CONFIG_PPC_BOOK3E_MMU) += dump_linuxpagetables-generic.o
|
||||
obj-$(CONFIG_PPC_BOOK3S_32) += dump_linuxpagetables-generic.o
|
||||
obj-$(CONFIG_PPC_BOOK3S_64) += dump_linuxpagetables-book3s64.o
|
||||
endif
|
||||
obj-$(CONFIG_PPC_HTDUMP) += dump_hashpagetable.o
|
||||
obj-$(CONFIG_PPC_MEM_KEYS) += pkeys.o
|
||||
|
82
arch/powerpc/mm/dump_linuxpagetables-8xx.c
Normal file
82
arch/powerpc/mm/dump_linuxpagetables-8xx.c
Normal file
@ -0,0 +1,82 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* From split of dump_linuxpagetables.c
|
||||
* Copyright 2016, Rashmica Gupta, IBM Corp.
|
||||
*
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <asm/pgtable.h>
|
||||
|
||||
#include "dump_linuxpagetables.h"
|
||||
|
||||
static const struct flag_info flag_array[] = {
|
||||
{
|
||||
.mask = _PAGE_PRIVILEGED,
|
||||
.val = 0,
|
||||
.set = "user",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_RO | _PAGE_NA,
|
||||
.val = 0,
|
||||
.set = "rw",
|
||||
}, {
|
||||
.mask = _PAGE_RO | _PAGE_NA,
|
||||
.val = _PAGE_RO,
|
||||
.set = "r ",
|
||||
}, {
|
||||
.mask = _PAGE_RO | _PAGE_NA,
|
||||
.val = _PAGE_NA,
|
||||
.set = " ",
|
||||
}, {
|
||||
.mask = _PAGE_EXEC,
|
||||
.val = _PAGE_EXEC,
|
||||
.set = " X ",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_PRESENT,
|
||||
.val = _PAGE_PRESENT,
|
||||
.set = "present",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_GUARDED,
|
||||
.val = _PAGE_GUARDED,
|
||||
.set = "guarded",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_DIRTY,
|
||||
.val = _PAGE_DIRTY,
|
||||
.set = "dirty",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_ACCESSED,
|
||||
.val = _PAGE_ACCESSED,
|
||||
.set = "accessed",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_NO_CACHE,
|
||||
.val = _PAGE_NO_CACHE,
|
||||
.set = "no cache",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_SPECIAL,
|
||||
.val = _PAGE_SPECIAL,
|
||||
.set = "special",
|
||||
}
|
||||
};
|
||||
|
||||
struct pgtable_level pg_level[5] = {
|
||||
{
|
||||
}, { /* pgd */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pud */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pmd */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pte */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
},
|
||||
};
|
115
arch/powerpc/mm/dump_linuxpagetables-book3s64.c
Normal file
115
arch/powerpc/mm/dump_linuxpagetables-book3s64.c
Normal file
@ -0,0 +1,115 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* From split of dump_linuxpagetables.c
|
||||
* Copyright 2016, Rashmica Gupta, IBM Corp.
|
||||
*
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <asm/pgtable.h>
|
||||
|
||||
#include "dump_linuxpagetables.h"
|
||||
|
||||
static const struct flag_info flag_array[] = {
|
||||
{
|
||||
.mask = _PAGE_PRIVILEGED,
|
||||
.val = 0,
|
||||
.set = "user",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_READ,
|
||||
.val = _PAGE_READ,
|
||||
.set = "r",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_WRITE,
|
||||
.val = _PAGE_WRITE,
|
||||
.set = "w",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_EXEC,
|
||||
.val = _PAGE_EXEC,
|
||||
.set = " X ",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_PTE,
|
||||
.val = _PAGE_PTE,
|
||||
.set = "pte",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_PRESENT,
|
||||
.val = _PAGE_PRESENT,
|
||||
.set = "present",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = H_PAGE_HASHPTE,
|
||||
.val = H_PAGE_HASHPTE,
|
||||
.set = "hpte",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_DIRTY,
|
||||
.val = _PAGE_DIRTY,
|
||||
.set = "dirty",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_ACCESSED,
|
||||
.val = _PAGE_ACCESSED,
|
||||
.set = "accessed",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_NON_IDEMPOTENT,
|
||||
.val = _PAGE_NON_IDEMPOTENT,
|
||||
.set = "non-idempotent",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_TOLERANT,
|
||||
.val = _PAGE_TOLERANT,
|
||||
.set = "tolerant",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = H_PAGE_BUSY,
|
||||
.val = H_PAGE_BUSY,
|
||||
.set = "busy",
|
||||
}, {
|
||||
#ifdef CONFIG_PPC_64K_PAGES
|
||||
.mask = H_PAGE_COMBO,
|
||||
.val = H_PAGE_COMBO,
|
||||
.set = "combo",
|
||||
}, {
|
||||
.mask = H_PAGE_4K_PFN,
|
||||
.val = H_PAGE_4K_PFN,
|
||||
.set = "4K_pfn",
|
||||
}, {
|
||||
#else /* CONFIG_PPC_64K_PAGES */
|
||||
.mask = H_PAGE_F_GIX,
|
||||
.val = H_PAGE_F_GIX,
|
||||
.set = "f_gix",
|
||||
.is_val = true,
|
||||
.shift = H_PAGE_F_GIX_SHIFT,
|
||||
}, {
|
||||
.mask = H_PAGE_F_SECOND,
|
||||
.val = H_PAGE_F_SECOND,
|
||||
.set = "f_second",
|
||||
}, {
|
||||
#endif /* CONFIG_PPC_64K_PAGES */
|
||||
.mask = _PAGE_SPECIAL,
|
||||
.val = _PAGE_SPECIAL,
|
||||
.set = "special",
|
||||
}
|
||||
};
|
||||
|
||||
struct pgtable_level pg_level[5] = {
|
||||
{
|
||||
}, { /* pgd */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pud */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pmd */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pte */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
},
|
||||
};
|
82
arch/powerpc/mm/dump_linuxpagetables-generic.c
Normal file
82
arch/powerpc/mm/dump_linuxpagetables-generic.c
Normal file
@ -0,0 +1,82 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* From split of dump_linuxpagetables.c
|
||||
* Copyright 2016, Rashmica Gupta, IBM Corp.
|
||||
*
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
#include <asm/pgtable.h>
|
||||
|
||||
#include "dump_linuxpagetables.h"
|
||||
|
||||
static const struct flag_info flag_array[] = {
|
||||
{
|
||||
.mask = _PAGE_USER,
|
||||
.val = _PAGE_USER,
|
||||
.set = "user",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_RW,
|
||||
.val = 0,
|
||||
.set = "r ",
|
||||
.clear = "rw",
|
||||
}, {
|
||||
#ifndef CONFIG_PPC_BOOK3S_32
|
||||
.mask = _PAGE_EXEC,
|
||||
.val = _PAGE_EXEC,
|
||||
.set = " X ",
|
||||
.clear = " ",
|
||||
}, {
|
||||
#endif
|
||||
.mask = _PAGE_PRESENT,
|
||||
.val = _PAGE_PRESENT,
|
||||
.set = "present",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_GUARDED,
|
||||
.val = _PAGE_GUARDED,
|
||||
.set = "guarded",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_DIRTY,
|
||||
.val = _PAGE_DIRTY,
|
||||
.set = "dirty",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_ACCESSED,
|
||||
.val = _PAGE_ACCESSED,
|
||||
.set = "accessed",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_WRITETHRU,
|
||||
.val = _PAGE_WRITETHRU,
|
||||
.set = "write through",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_NO_CACHE,
|
||||
.val = _PAGE_NO_CACHE,
|
||||
.set = "no cache",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_SPECIAL,
|
||||
.val = _PAGE_SPECIAL,
|
||||
.set = "special",
|
||||
}
|
||||
};
|
||||
|
||||
struct pgtable_level pg_level[5] = {
|
||||
{
|
||||
}, { /* pgd */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pud */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pmd */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pte */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
},
|
||||
};
|
@ -28,6 +28,8 @@
|
||||
#include <asm/page.h>
|
||||
#include <asm/pgalloc.h>
|
||||
|
||||
#include "dump_linuxpagetables.h"
|
||||
|
||||
#ifdef CONFIG_PPC32
|
||||
#define KERN_VIRT_START 0
|
||||
#endif
|
||||
@ -102,159 +104,6 @@ static struct addr_marker address_markers[] = {
|
||||
{ -1, NULL },
|
||||
};
|
||||
|
||||
struct flag_info {
|
||||
u64 mask;
|
||||
u64 val;
|
||||
const char *set;
|
||||
const char *clear;
|
||||
bool is_val;
|
||||
int shift;
|
||||
};
|
||||
|
||||
static const struct flag_info flag_array[] = {
|
||||
{
|
||||
.mask = _PAGE_USER | _PAGE_PRIVILEGED,
|
||||
.val = _PAGE_USER,
|
||||
.set = "user",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_RW | _PAGE_RO | _PAGE_NA,
|
||||
.val = _PAGE_RW,
|
||||
.set = "rw",
|
||||
}, {
|
||||
.mask = _PAGE_RW | _PAGE_RO | _PAGE_NA,
|
||||
.val = _PAGE_RO,
|
||||
.set = "ro",
|
||||
}, {
|
||||
#if _PAGE_NA != 0
|
||||
.mask = _PAGE_RW | _PAGE_RO | _PAGE_NA,
|
||||
.val = _PAGE_RO,
|
||||
.set = "na",
|
||||
}, {
|
||||
#endif
|
||||
.mask = _PAGE_EXEC,
|
||||
.val = _PAGE_EXEC,
|
||||
.set = " X ",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_PTE,
|
||||
.val = _PAGE_PTE,
|
||||
.set = "pte",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_PRESENT,
|
||||
.val = _PAGE_PRESENT,
|
||||
.set = "present",
|
||||
.clear = " ",
|
||||
}, {
|
||||
#ifdef CONFIG_PPC_BOOK3S_64
|
||||
.mask = H_PAGE_HASHPTE,
|
||||
.val = H_PAGE_HASHPTE,
|
||||
#else
|
||||
.mask = _PAGE_HASHPTE,
|
||||
.val = _PAGE_HASHPTE,
|
||||
#endif
|
||||
.set = "hpte",
|
||||
.clear = " ",
|
||||
}, {
|
||||
#ifndef CONFIG_PPC_BOOK3S_64
|
||||
.mask = _PAGE_GUARDED,
|
||||
.val = _PAGE_GUARDED,
|
||||
.set = "guarded",
|
||||
.clear = " ",
|
||||
}, {
|
||||
#endif
|
||||
.mask = _PAGE_DIRTY,
|
||||
.val = _PAGE_DIRTY,
|
||||
.set = "dirty",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_ACCESSED,
|
||||
.val = _PAGE_ACCESSED,
|
||||
.set = "accessed",
|
||||
.clear = " ",
|
||||
}, {
|
||||
#ifndef CONFIG_PPC_BOOK3S_64
|
||||
.mask = _PAGE_WRITETHRU,
|
||||
.val = _PAGE_WRITETHRU,
|
||||
.set = "write through",
|
||||
.clear = " ",
|
||||
}, {
|
||||
#endif
|
||||
#ifndef CONFIG_PPC_BOOK3S_64
|
||||
.mask = _PAGE_NO_CACHE,
|
||||
.val = _PAGE_NO_CACHE,
|
||||
.set = "no cache",
|
||||
.clear = " ",
|
||||
}, {
|
||||
#else
|
||||
.mask = _PAGE_NON_IDEMPOTENT,
|
||||
.val = _PAGE_NON_IDEMPOTENT,
|
||||
.set = "non-idempotent",
|
||||
.clear = " ",
|
||||
}, {
|
||||
.mask = _PAGE_TOLERANT,
|
||||
.val = _PAGE_TOLERANT,
|
||||
.set = "tolerant",
|
||||
.clear = " ",
|
||||
}, {
|
||||
#endif
|
||||
#ifdef CONFIG_PPC_BOOK3S_64
|
||||
.mask = H_PAGE_BUSY,
|
||||
.val = H_PAGE_BUSY,
|
||||
.set = "busy",
|
||||
}, {
|
||||
#ifdef CONFIG_PPC_64K_PAGES
|
||||
.mask = H_PAGE_COMBO,
|
||||
.val = H_PAGE_COMBO,
|
||||
.set = "combo",
|
||||
}, {
|
||||
.mask = H_PAGE_4K_PFN,
|
||||
.val = H_PAGE_4K_PFN,
|
||||
.set = "4K_pfn",
|
||||
}, {
|
||||
#else /* CONFIG_PPC_64K_PAGES */
|
||||
.mask = H_PAGE_F_GIX,
|
||||
.val = H_PAGE_F_GIX,
|
||||
.set = "f_gix",
|
||||
.is_val = true,
|
||||
.shift = H_PAGE_F_GIX_SHIFT,
|
||||
}, {
|
||||
.mask = H_PAGE_F_SECOND,
|
||||
.val = H_PAGE_F_SECOND,
|
||||
.set = "f_second",
|
||||
}, {
|
||||
#endif /* CONFIG_PPC_64K_PAGES */
|
||||
#endif
|
||||
.mask = _PAGE_SPECIAL,
|
||||
.val = _PAGE_SPECIAL,
|
||||
.set = "special",
|
||||
}
|
||||
};
|
||||
|
||||
struct pgtable_level {
|
||||
const struct flag_info *flag;
|
||||
size_t num;
|
||||
u64 mask;
|
||||
};
|
||||
|
||||
static struct pgtable_level pg_level[] = {
|
||||
{
|
||||
}, { /* pgd */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pud */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pmd */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
}, { /* pte */
|
||||
.flag = flag_array,
|
||||
.num = ARRAY_SIZE(flag_array),
|
||||
},
|
||||
};
|
||||
|
||||
static void dump_flag_info(struct pg_state *st, const struct flag_info
|
||||
*flag, u64 pte, int num)
|
||||
{
|
||||
|
19
arch/powerpc/mm/dump_linuxpagetables.h
Normal file
19
arch/powerpc/mm/dump_linuxpagetables.h
Normal file
@ -0,0 +1,19 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#include <linux/types.h>
|
||||
|
||||
struct flag_info {
|
||||
u64 mask;
|
||||
u64 val;
|
||||
const char *set;
|
||||
const char *clear;
|
||||
bool is_val;
|
||||
int shift;
|
||||
};
|
||||
|
||||
struct pgtable_level {
|
||||
const struct flag_info *flag;
|
||||
size_t num;
|
||||
u64 mask;
|
||||
};
|
||||
|
||||
extern struct pgtable_level pg_level[5];
|
@ -134,11 +134,11 @@ config POWER9_CPU
|
||||
|
||||
config E5500_CPU
|
||||
bool "Freescale e5500"
|
||||
depends on E500
|
||||
depends on PPC64 && E500
|
||||
|
||||
config E6500_CPU
|
||||
bool "Freescale e6500"
|
||||
depends on E500
|
||||
depends on PPC64 && E500
|
||||
|
||||
config 860_CPU
|
||||
bool "8xx family"
|
||||
|
@ -230,6 +230,7 @@ static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg)
|
||||
if (!prop) {
|
||||
dev_dbg(&dev->dev,
|
||||
"axon_msi: no msi-address-(32|64) properties found\n");
|
||||
of_node_put(dn);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
|
@ -684,6 +684,7 @@ spufs_init_isolated_loader(void)
|
||||
return;
|
||||
|
||||
loader = of_get_property(dn, "loader", &size);
|
||||
of_node_put(dn);
|
||||
if (!loader)
|
||||
return;
|
||||
|
||||
|
@ -631,6 +631,7 @@ static bool xive_get_max_prio(u8 *max_prio)
|
||||
}
|
||||
|
||||
reg = of_get_property(rootdn, "ibm,plat-res-int-priorities", &len);
|
||||
of_node_put(rootdn);
|
||||
if (!reg) {
|
||||
pr_err("Failed to read 'ibm,plat-res-int-priorities' property\n");
|
||||
return false;
|
||||
|
@ -26,9 +26,8 @@ static long riscv_sys_mmap(unsigned long addr, unsigned long len,
|
||||
if (unlikely(offset & (~PAGE_MASK >> page_shift_offset)))
|
||||
return -EINVAL;
|
||||
|
||||
if ((prot & PROT_WRITE) && (prot & PROT_EXEC))
|
||||
if (unlikely(!(prot & PROT_READ)))
|
||||
return -EINVAL;
|
||||
if (unlikely((prot & PROT_WRITE) && !(prot & PROT_READ)))
|
||||
return -EINVAL;
|
||||
|
||||
return ksys_mmap_pgoff(addr, len, prot, flags, fd,
|
||||
offset >> (PAGE_SHIFT - page_shift_offset));
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <linux/mm.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/kexec.h>
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/ptrace.h>
|
||||
@ -50,6 +51,9 @@ void die(struct pt_regs *regs, const char *str)
|
||||
|
||||
ret = notify_die(DIE_OOPS, str, regs, 0, regs->scause, SIGSEGV);
|
||||
|
||||
if (regs && kexec_should_crash(current))
|
||||
crash_kexec(regs);
|
||||
|
||||
bust_spinlocks(0);
|
||||
add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);
|
||||
spin_unlock_irq(&die_lock);
|
||||
|
@ -341,6 +341,9 @@ static int synic_set_irq(struct kvm_vcpu_hv_synic *synic, u32 sint)
|
||||
struct kvm_lapic_irq irq;
|
||||
int ret, vector;
|
||||
|
||||
if (KVM_BUG_ON(!lapic_in_kernel(vcpu), vcpu->kvm))
|
||||
return -EINVAL;
|
||||
|
||||
if (sint >= ARRAY_SIZE(synic->sint))
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -961,6 +961,10 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
|
||||
*r = -1;
|
||||
|
||||
if (irq->shorthand == APIC_DEST_SELF) {
|
||||
if (KVM_BUG_ON(!src, kvm)) {
|
||||
*r = 0;
|
||||
return true;
|
||||
}
|
||||
*r = kvm_apic_set_irq(src->vcpu, irq, dest_map);
|
||||
return true;
|
||||
}
|
||||
|
@ -826,7 +826,7 @@ void debug_cpumask_set_cpu(int cpu, int node, bool enable)
|
||||
return;
|
||||
}
|
||||
mask = node_to_cpumask_map[node];
|
||||
if (!mask) {
|
||||
if (!cpumask_available(mask)) {
|
||||
pr_err("node_to_cpumask_map[%i] NULL\n", node);
|
||||
dump_stack();
|
||||
return;
|
||||
@ -872,7 +872,7 @@ const struct cpumask *cpumask_of_node(int node)
|
||||
dump_stack();
|
||||
return cpu_none_mask;
|
||||
}
|
||||
if (node_to_cpumask_map[node] == NULL) {
|
||||
if (!cpumask_available(node_to_cpumask_map[node])) {
|
||||
printk(KERN_WARNING
|
||||
"cpumask_of_node(%d): no node_to_cpumask_map!\n",
|
||||
node);
|
||||
|
@ -85,7 +85,7 @@ static void send_ebook_state(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!!test_bit(SW_TABLET_MODE, ebook_switch_idev->sw) == state)
|
||||
if (test_bit(SW_TABLET_MODE, ebook_switch_idev->sw) == !!state)
|
||||
return; /* Nothing new to report. */
|
||||
|
||||
input_report_switch(ebook_switch_idev, SW_TABLET_MODE, state);
|
||||
|
@ -630,33 +630,6 @@ int pcc_data_alloc(int pcc_ss_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check if CPPC revision + num_ent combination is supported */
|
||||
static bool is_cppc_supported(int revision, int num_ent)
|
||||
{
|
||||
int expected_num_ent;
|
||||
|
||||
switch (revision) {
|
||||
case CPPC_V2_REV:
|
||||
expected_num_ent = CPPC_V2_NUM_ENT;
|
||||
break;
|
||||
case CPPC_V3_REV:
|
||||
expected_num_ent = CPPC_V3_NUM_ENT;
|
||||
break;
|
||||
default:
|
||||
pr_debug("Firmware exports unsupported CPPC revision: %d\n",
|
||||
revision);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (expected_num_ent != num_ent) {
|
||||
pr_debug("Firmware exports %d entries. Expected: %d for CPPC rev:%d\n",
|
||||
num_ent, expected_num_ent, revision);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* An example CPC table looks like the following.
|
||||
*
|
||||
@ -752,7 +725,6 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
|
||||
cpc_obj->type);
|
||||
goto out_free;
|
||||
}
|
||||
cpc_ptr->num_entries = num_ent;
|
||||
|
||||
/* Second entry should be revision. */
|
||||
cpc_obj = &out_obj->package.elements[1];
|
||||
@ -763,10 +735,32 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
|
||||
cpc_obj->type);
|
||||
goto out_free;
|
||||
}
|
||||
cpc_ptr->version = cpc_rev;
|
||||
|
||||
if (!is_cppc_supported(cpc_rev, num_ent))
|
||||
if (cpc_rev < CPPC_V2_REV) {
|
||||
pr_debug("Unsupported _CPC Revision (%d) for CPU:%d\n", cpc_rev,
|
||||
pr->id);
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
/*
|
||||
* Disregard _CPC if the number of entries in the return pachage is not
|
||||
* as expected, but support future revisions being proper supersets of
|
||||
* the v3 and only causing more entries to be returned by _CPC.
|
||||
*/
|
||||
if ((cpc_rev == CPPC_V2_REV && num_ent != CPPC_V2_NUM_ENT) ||
|
||||
(cpc_rev == CPPC_V3_REV && num_ent != CPPC_V3_NUM_ENT) ||
|
||||
(cpc_rev > CPPC_V3_REV && num_ent <= CPPC_V3_NUM_ENT)) {
|
||||
pr_debug("Unexpected number of _CPC return package entries (%d) for CPU:%d\n",
|
||||
num_ent, pr->id);
|
||||
goto out_free;
|
||||
}
|
||||
if (cpc_rev > CPPC_V3_REV) {
|
||||
num_ent = CPPC_V3_NUM_ENT;
|
||||
cpc_rev = CPPC_V3_REV;
|
||||
}
|
||||
|
||||
cpc_ptr->num_entries = num_ent;
|
||||
cpc_ptr->version = cpc_rev;
|
||||
|
||||
/* Iterate through remaining entries in _CPC */
|
||||
for (i = 2; i < num_ent; i++) {
|
||||
|
@ -132,10 +132,10 @@ static bool acpi_nondev_subnode_ok(acpi_handle scope,
|
||||
return acpi_nondev_subnode_data_ok(handle, link, list, parent);
|
||||
}
|
||||
|
||||
static int acpi_add_nondev_subnodes(acpi_handle scope,
|
||||
const union acpi_object *links,
|
||||
struct list_head *list,
|
||||
struct fwnode_handle *parent)
|
||||
static bool acpi_add_nondev_subnodes(acpi_handle scope,
|
||||
const union acpi_object *links,
|
||||
struct list_head *list,
|
||||
struct fwnode_handle *parent)
|
||||
{
|
||||
bool ret = false;
|
||||
int i;
|
||||
|
@ -2350,6 +2350,7 @@ const char *ata_get_cmd_descript(u8 command)
|
||||
{ ATA_CMD_WRITE_QUEUED_FUA_EXT, "WRITE DMA QUEUED FUA EXT" },
|
||||
{ ATA_CMD_FPDMA_READ, "READ FPDMA QUEUED" },
|
||||
{ ATA_CMD_FPDMA_WRITE, "WRITE FPDMA QUEUED" },
|
||||
{ ATA_CMD_NCQ_NON_DATA, "NCQ NON-DATA" },
|
||||
{ ATA_CMD_FPDMA_SEND, "SEND FPDMA QUEUED" },
|
||||
{ ATA_CMD_FPDMA_RECV, "RECEIVE FPDMA QUEUED" },
|
||||
{ ATA_CMD_PIO_READ, "READ SECTOR(S)" },
|
||||
|
@ -3767,6 +3767,7 @@ static void __exit idt77252_exit(void)
|
||||
card = idt77252_chain;
|
||||
dev = card->atmdev;
|
||||
idt77252_chain = card->next;
|
||||
del_timer_sync(&card->tst_timer);
|
||||
|
||||
if (dev->phy->stop)
|
||||
dev->phy->stop(dev);
|
||||
|
@ -1819,8 +1819,13 @@ static int null_add_dev(struct nullb_device *dev)
|
||||
blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, nullb->q);
|
||||
|
||||
mutex_lock(&lock);
|
||||
nullb->index = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);
|
||||
dev->index = nullb->index;
|
||||
rv = ida_simple_get(&nullb_indexes, 0, 0, GFP_KERNEL);
|
||||
if (rv < 0) {
|
||||
mutex_unlock(&lock);
|
||||
goto out_cleanup_zone;
|
||||
}
|
||||
nullb->index = rv;
|
||||
dev->index = rv;
|
||||
mutex_unlock(&lock);
|
||||
|
||||
blk_queue_logical_block_size(nullb->q, dev->blocksize);
|
||||
@ -1832,13 +1837,16 @@ static int null_add_dev(struct nullb_device *dev)
|
||||
|
||||
rv = null_gendisk_register(nullb);
|
||||
if (rv)
|
||||
goto out_cleanup_zone;
|
||||
goto out_ida_free;
|
||||
|
||||
mutex_lock(&lock);
|
||||
list_add_tail(&nullb->list, &nullb_list);
|
||||
mutex_unlock(&lock);
|
||||
|
||||
return 0;
|
||||
|
||||
out_ida_free:
|
||||
ida_free(&nullb_indexes, nullb->index);
|
||||
out_cleanup_zone:
|
||||
if (dev->zoned)
|
||||
null_zone_exit(dev);
|
||||
|
@ -1253,7 +1253,11 @@ static struct platform_driver intel_driver = {
|
||||
|
||||
int __init intel_init(void)
|
||||
{
|
||||
platform_driver_register(&intel_driver);
|
||||
int err;
|
||||
|
||||
err = platform_driver_register(&intel_driver);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return hci_uart_register_proto(&intel_proto);
|
||||
}
|
||||
|
@ -675,6 +675,7 @@ static struct clk_branch gcc_sleep_clk_src = {
|
||||
},
|
||||
.num_parents = 1,
|
||||
.ops = &clk_branch2_ops,
|
||||
.flags = CLK_IS_CRITICAL,
|
||||
},
|
||||
},
|
||||
};
|
||||
@ -1796,8 +1797,10 @@ static struct clk_regmap_div nss_port4_tx_div_clk_src = {
|
||||
static const struct freq_tbl ftbl_nss_port5_rx_clk_src[] = {
|
||||
F(19200000, P_XO, 1, 0, 0),
|
||||
F(25000000, P_UNIPHY1_RX, 12.5, 0, 0),
|
||||
F(25000000, P_UNIPHY0_RX, 5, 0, 0),
|
||||
F(78125000, P_UNIPHY1_RX, 4, 0, 0),
|
||||
F(125000000, P_UNIPHY1_RX, 2.5, 0, 0),
|
||||
F(125000000, P_UNIPHY0_RX, 1, 0, 0),
|
||||
F(156250000, P_UNIPHY1_RX, 2, 0, 0),
|
||||
F(312500000, P_UNIPHY1_RX, 1, 0, 0),
|
||||
{ }
|
||||
@ -1836,8 +1839,10 @@ static struct clk_regmap_div nss_port5_rx_div_clk_src = {
|
||||
static const struct freq_tbl ftbl_nss_port5_tx_clk_src[] = {
|
||||
F(19200000, P_XO, 1, 0, 0),
|
||||
F(25000000, P_UNIPHY1_TX, 12.5, 0, 0),
|
||||
F(25000000, P_UNIPHY0_TX, 5, 0, 0),
|
||||
F(78125000, P_UNIPHY1_TX, 4, 0, 0),
|
||||
F(125000000, P_UNIPHY1_TX, 2.5, 0, 0),
|
||||
F(125000000, P_UNIPHY0_TX, 1, 0, 0),
|
||||
F(156250000, P_UNIPHY1_TX, 2, 0, 0),
|
||||
F(312500000, P_UNIPHY1_TX, 1, 0, 0),
|
||||
{ }
|
||||
@ -1875,8 +1880,10 @@ static struct clk_regmap_div nss_port5_tx_div_clk_src = {
|
||||
|
||||
static const struct freq_tbl ftbl_nss_port6_rx_clk_src[] = {
|
||||
F(19200000, P_XO, 1, 0, 0),
|
||||
F(25000000, P_UNIPHY2_RX, 5, 0, 0),
|
||||
F(25000000, P_UNIPHY2_RX, 12.5, 0, 0),
|
||||
F(78125000, P_UNIPHY2_RX, 4, 0, 0),
|
||||
F(125000000, P_UNIPHY2_RX, 1, 0, 0),
|
||||
F(125000000, P_UNIPHY2_RX, 2.5, 0, 0),
|
||||
F(156250000, P_UNIPHY2_RX, 2, 0, 0),
|
||||
F(312500000, P_UNIPHY2_RX, 1, 0, 0),
|
||||
@ -1915,8 +1922,10 @@ static struct clk_regmap_div nss_port6_rx_div_clk_src = {
|
||||
|
||||
static const struct freq_tbl ftbl_nss_port6_tx_clk_src[] = {
|
||||
F(19200000, P_XO, 1, 0, 0),
|
||||
F(25000000, P_UNIPHY2_TX, 5, 0, 0),
|
||||
F(25000000, P_UNIPHY2_TX, 12.5, 0, 0),
|
||||
F(78125000, P_UNIPHY2_TX, 4, 0, 0),
|
||||
F(125000000, P_UNIPHY2_TX, 1, 0, 0),
|
||||
F(125000000, P_UNIPHY2_TX, 2.5, 0, 0),
|
||||
F(156250000, P_UNIPHY2_TX, 2, 0, 0),
|
||||
F(312500000, P_UNIPHY2_TX, 1, 0, 0),
|
||||
@ -3354,6 +3363,7 @@ static struct clk_branch gcc_nssnoc_ubi1_ahb_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi0_ahb_clk = {
|
||||
.halt_reg = 0x6820c,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x6820c,
|
||||
.enable_mask = BIT(0),
|
||||
@ -3371,6 +3381,7 @@ static struct clk_branch gcc_ubi0_ahb_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi0_axi_clk = {
|
||||
.halt_reg = 0x68200,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x68200,
|
||||
.enable_mask = BIT(0),
|
||||
@ -3388,6 +3399,7 @@ static struct clk_branch gcc_ubi0_axi_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi0_nc_axi_clk = {
|
||||
.halt_reg = 0x68204,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x68204,
|
||||
.enable_mask = BIT(0),
|
||||
@ -3405,6 +3417,7 @@ static struct clk_branch gcc_ubi0_nc_axi_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi0_core_clk = {
|
||||
.halt_reg = 0x68210,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x68210,
|
||||
.enable_mask = BIT(0),
|
||||
@ -3422,6 +3435,7 @@ static struct clk_branch gcc_ubi0_core_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi0_mpt_clk = {
|
||||
.halt_reg = 0x68208,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x68208,
|
||||
.enable_mask = BIT(0),
|
||||
@ -3439,6 +3453,7 @@ static struct clk_branch gcc_ubi0_mpt_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi1_ahb_clk = {
|
||||
.halt_reg = 0x6822c,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x6822c,
|
||||
.enable_mask = BIT(0),
|
||||
@ -3456,6 +3471,7 @@ static struct clk_branch gcc_ubi1_ahb_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi1_axi_clk = {
|
||||
.halt_reg = 0x68220,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x68220,
|
||||
.enable_mask = BIT(0),
|
||||
@ -3473,6 +3489,7 @@ static struct clk_branch gcc_ubi1_axi_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi1_nc_axi_clk = {
|
||||
.halt_reg = 0x68224,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x68224,
|
||||
.enable_mask = BIT(0),
|
||||
@ -3490,6 +3507,7 @@ static struct clk_branch gcc_ubi1_nc_axi_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi1_core_clk = {
|
||||
.halt_reg = 0x68230,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x68230,
|
||||
.enable_mask = BIT(0),
|
||||
@ -3507,6 +3525,7 @@ static struct clk_branch gcc_ubi1_core_clk = {
|
||||
|
||||
static struct clk_branch gcc_ubi1_mpt_clk = {
|
||||
.halt_reg = 0x68228,
|
||||
.halt_check = BRANCH_HALT_DELAY,
|
||||
.clkr = {
|
||||
.enable_reg = 0x68228,
|
||||
.enable_mask = BIT(0),
|
||||
|
@ -277,8 +277,8 @@ static const struct r9a06g032_clkdesc r9a06g032_clocks[] __initconst = {
|
||||
.name = "uart_group_012",
|
||||
.type = K_BITSEL,
|
||||
.source = 1 + R9A06G032_DIV_UART,
|
||||
/* R9A06G032_SYSCTRL_REG_PWRCTRL_PG1_PR2 */
|
||||
.dual.sel = ((0xec / 4) << 5) | 24,
|
||||
/* R9A06G032_SYSCTRL_REG_PWRCTRL_PG0_0 */
|
||||
.dual.sel = ((0x34 / 4) << 5) | 30,
|
||||
.dual.group = 0,
|
||||
},
|
||||
{
|
||||
@ -286,8 +286,8 @@ static const struct r9a06g032_clkdesc r9a06g032_clocks[] __initconst = {
|
||||
.name = "uart_group_34567",
|
||||
.type = K_BITSEL,
|
||||
.source = 1 + R9A06G032_DIV_P2_PG,
|
||||
/* R9A06G032_SYSCTRL_REG_PWRCTRL_PG0_0 */
|
||||
.dual.sel = ((0x34 / 4) << 5) | 30,
|
||||
/* R9A06G032_SYSCTRL_REG_PWRCTRL_PG1_PR2 */
|
||||
.dual.sel = ((0xec / 4) << 5) | 24,
|
||||
.dual.group = 1,
|
||||
},
|
||||
D_UGATE(CLK_UART0, "clk_uart0", UART_GROUP_012, 0, 0, 0x1b2, 0x1b3, 0x1b4, 0x1b5),
|
||||
|
@ -987,11 +987,8 @@ static int sprd_dma_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sprd_dma_dev *sdev = platform_get_drvdata(pdev);
|
||||
struct sprd_dma_chn *c, *cn;
|
||||
int ret;
|
||||
|
||||
ret = pm_runtime_get_sync(&pdev->dev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
pm_runtime_get_sync(&pdev->dev);
|
||||
|
||||
/* explicitly free the irq */
|
||||
if (sdev->irq > 0)
|
||||
|
@ -826,7 +826,7 @@ static int scpi_init_versions(struct scpi_drvinfo *info)
|
||||
info->firmware_version = le32_to_cpu(caps.platform_version);
|
||||
}
|
||||
/* Ignore error if not implemented */
|
||||
if (scpi_info->is_legacy && ret == -EOPNOTSUPP)
|
||||
if (info->is_legacy && ret == -EOPNOTSUPP)
|
||||
return 0;
|
||||
|
||||
return ret;
|
||||
@ -916,13 +916,14 @@ static int scpi_probe(struct platform_device *pdev)
|
||||
struct resource res;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = dev->of_node;
|
||||
struct scpi_drvinfo *scpi_drvinfo;
|
||||
|
||||
scpi_info = devm_kzalloc(dev, sizeof(*scpi_info), GFP_KERNEL);
|
||||
if (!scpi_info)
|
||||
scpi_drvinfo = devm_kzalloc(dev, sizeof(*scpi_drvinfo), GFP_KERNEL);
|
||||
if (!scpi_drvinfo)
|
||||
return -ENOMEM;
|
||||
|
||||
if (of_match_device(legacy_scpi_of_match, &pdev->dev))
|
||||
scpi_info->is_legacy = true;
|
||||
scpi_drvinfo->is_legacy = true;
|
||||
|
||||
count = of_count_phandle_with_args(np, "mboxes", "#mbox-cells");
|
||||
if (count < 0) {
|
||||
@ -930,19 +931,19 @@ static int scpi_probe(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
scpi_info->channels = devm_kcalloc(dev, count, sizeof(struct scpi_chan),
|
||||
GFP_KERNEL);
|
||||
if (!scpi_info->channels)
|
||||
scpi_drvinfo->channels =
|
||||
devm_kcalloc(dev, count, sizeof(struct scpi_chan), GFP_KERNEL);
|
||||
if (!scpi_drvinfo->channels)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = devm_add_action(dev, scpi_free_channels, scpi_info);
|
||||
ret = devm_add_action(dev, scpi_free_channels, scpi_drvinfo);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
for (; scpi_info->num_chans < count; scpi_info->num_chans++) {
|
||||
for (; scpi_drvinfo->num_chans < count; scpi_drvinfo->num_chans++) {
|
||||
resource_size_t size;
|
||||
int idx = scpi_info->num_chans;
|
||||
struct scpi_chan *pchan = scpi_info->channels + idx;
|
||||
int idx = scpi_drvinfo->num_chans;
|
||||
struct scpi_chan *pchan = scpi_drvinfo->channels + idx;
|
||||
struct mbox_client *cl = &pchan->cl;
|
||||
struct device_node *shmem = of_parse_phandle(np, "shmem", idx);
|
||||
|
||||
@ -986,49 +987,57 @@ static int scpi_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
scpi_info->commands = scpi_std_commands;
|
||||
scpi_drvinfo->commands = scpi_std_commands;
|
||||
|
||||
platform_set_drvdata(pdev, scpi_info);
|
||||
platform_set_drvdata(pdev, scpi_drvinfo);
|
||||
|
||||
if (scpi_info->is_legacy) {
|
||||
if (scpi_drvinfo->is_legacy) {
|
||||
/* Replace with legacy variants */
|
||||
scpi_ops.clk_set_val = legacy_scpi_clk_set_val;
|
||||
scpi_info->commands = scpi_legacy_commands;
|
||||
scpi_drvinfo->commands = scpi_legacy_commands;
|
||||
|
||||
/* Fill priority bitmap */
|
||||
for (idx = 0; idx < ARRAY_SIZE(legacy_hpriority_cmds); idx++)
|
||||
set_bit(legacy_hpriority_cmds[idx],
|
||||
scpi_info->cmd_priority);
|
||||
scpi_drvinfo->cmd_priority);
|
||||
}
|
||||
|
||||
ret = scpi_init_versions(scpi_info);
|
||||
scpi_info = scpi_drvinfo;
|
||||
|
||||
ret = scpi_init_versions(scpi_drvinfo);
|
||||
if (ret) {
|
||||
dev_err(dev, "incorrect or no SCP firmware found\n");
|
||||
scpi_info = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (scpi_info->is_legacy && !scpi_info->protocol_version &&
|
||||
!scpi_info->firmware_version)
|
||||
if (scpi_drvinfo->is_legacy && !scpi_drvinfo->protocol_version &&
|
||||
!scpi_drvinfo->firmware_version)
|
||||
dev_info(dev, "SCP Protocol legacy pre-1.0 firmware\n");
|
||||
else
|
||||
dev_info(dev, "SCP Protocol %lu.%lu Firmware %lu.%lu.%lu version\n",
|
||||
FIELD_GET(PROTO_REV_MAJOR_MASK,
|
||||
scpi_info->protocol_version),
|
||||
scpi_drvinfo->protocol_version),
|
||||
FIELD_GET(PROTO_REV_MINOR_MASK,
|
||||
scpi_info->protocol_version),
|
||||
scpi_drvinfo->protocol_version),
|
||||
FIELD_GET(FW_REV_MAJOR_MASK,
|
||||
scpi_info->firmware_version),
|
||||
scpi_drvinfo->firmware_version),
|
||||
FIELD_GET(FW_REV_MINOR_MASK,
|
||||
scpi_info->firmware_version),
|
||||
scpi_drvinfo->firmware_version),
|
||||
FIELD_GET(FW_REV_PATCH_MASK,
|
||||
scpi_info->firmware_version));
|
||||
scpi_info->scpi_ops = &scpi_ops;
|
||||
scpi_drvinfo->firmware_version));
|
||||
|
||||
ret = devm_device_add_groups(dev, versions_groups);
|
||||
if (ret)
|
||||
dev_err(dev, "unable to create sysfs version group\n");
|
||||
|
||||
return devm_of_platform_populate(dev);
|
||||
scpi_drvinfo->scpi_ops = &scpi_ops;
|
||||
|
||||
ret = devm_of_platform_populate(dev);
|
||||
if (ret)
|
||||
scpi_info = NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct of_device_id scpi_of_match[] = {
|
||||
|
@ -108,7 +108,7 @@ static int alt_pr_fpga_write(struct fpga_manager *mgr, const char *buf,
|
||||
u32 *buffer_32 = (u32 *)buf;
|
||||
size_t i = 0;
|
||||
|
||||
if (count <= 0)
|
||||
if (!count)
|
||||
return -EINVAL;
|
||||
|
||||
/* Write out the complete 32-bit chunks */
|
||||
|
@ -476,7 +476,8 @@ int of_mm_gpiochip_add_data(struct device_node *np,
|
||||
if (mm_gc->save_regs)
|
||||
mm_gc->save_regs(mm_gc);
|
||||
|
||||
mm_gc->gc.of_node = np;
|
||||
of_node_put(mm_gc->gc.of_node);
|
||||
mm_gc->gc.of_node = of_node_get(np);
|
||||
|
||||
ret = gpiochip_add_data(gc, data);
|
||||
if (ret)
|
||||
@ -484,6 +485,7 @@ int of_mm_gpiochip_add_data(struct device_node *np,
|
||||
|
||||
return 0;
|
||||
err2:
|
||||
of_node_put(np);
|
||||
iounmap(mm_gc->regs);
|
||||
err1:
|
||||
kfree(gc->label);
|
||||
|
@ -141,8 +141,11 @@ static bool meson_vpu_has_available_connectors(struct device *dev)
|
||||
for_each_endpoint_of_node(dev->of_node, ep) {
|
||||
/* If the endpoint node exists, consider it enabled */
|
||||
remote = of_graph_get_remote_port(ep);
|
||||
if (remote)
|
||||
if (remote) {
|
||||
of_node_put(remote);
|
||||
of_node_put(ep);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -835,6 +835,8 @@ static const struct hid_device_id alps_id[] = {
|
||||
USB_VENDOR_ID_ALPS_JP, HID_DEVICE_ID_ALPS_U1_DUAL) },
|
||||
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY,
|
||||
USB_VENDOR_ID_ALPS_JP, HID_DEVICE_ID_ALPS_U1) },
|
||||
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY,
|
||||
USB_VENDOR_ID_ALPS_JP, HID_DEVICE_ID_ALPS_U1_UNICORN_LEGACY) },
|
||||
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY,
|
||||
USB_VENDOR_ID_ALPS_JP, HID_DEVICE_ID_ALPS_T4_BTNLESS) },
|
||||
{ }
|
||||
|
@ -794,6 +794,11 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
|
||||
data->word = le16_to_cpup((__le16 *)buf);
|
||||
break;
|
||||
case I2C_SMBUS_I2C_BLOCK_DATA:
|
||||
if (read_length > I2C_SMBUS_BLOCK_MAX) {
|
||||
ret = -EINVAL;
|
||||
goto power_normal;
|
||||
}
|
||||
|
||||
memcpy(data->block + 1, buf, read_length);
|
||||
break;
|
||||
case I2C_SMBUS_BLOCK_DATA:
|
||||
|
@ -245,6 +245,21 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
|
||||
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x54a6),
|
||||
.driver_data = (kernel_ulong_t)&intel_th_2x,
|
||||
},
|
||||
{
|
||||
/* Raptor Lake-S CPU */
|
||||
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa76f),
|
||||
.driver_data = (kernel_ulong_t)&intel_th_2x,
|
||||
},
|
||||
{
|
||||
/* Raptor Lake-S */
|
||||
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7a26),
|
||||
.driver_data = (kernel_ulong_t)&intel_th_2x,
|
||||
},
|
||||
{
|
||||
/* Meteor Lake-P */
|
||||
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7e24),
|
||||
.driver_data = (kernel_ulong_t)&intel_th_2x,
|
||||
},
|
||||
{
|
||||
/* Rocket Lake CPU */
|
||||
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4c19),
|
||||
|
@ -353,8 +353,13 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id)
|
||||
ctrl_reg = cdns_i2c_readreg(CDNS_I2C_CR_OFFSET);
|
||||
ctrl_reg |= CDNS_I2C_CR_RW | CDNS_I2C_CR_CLR_FIFO;
|
||||
|
||||
/*
|
||||
* Receive up to I2C_SMBUS_BLOCK_MAX data bytes, plus one message length
|
||||
* byte, plus one checksum byte if PEC is enabled. p_msg->len will be 2 if
|
||||
* PEC is enabled, otherwise 1.
|
||||
*/
|
||||
if (id->p_msg->flags & I2C_M_RECV_LEN)
|
||||
id->recv_count = I2C_SMBUS_BLOCK_MAX + 1;
|
||||
id->recv_count = I2C_SMBUS_BLOCK_MAX + id->p_msg->len;
|
||||
|
||||
id->curr_recv_count = id->recv_count;
|
||||
|
||||
@ -540,6 +545,9 @@ static int cdns_i2c_process_msg(struct cdns_i2c *id, struct i2c_msg *msg,
|
||||
if (id->err_status & CDNS_I2C_IXR_ARB_LOST)
|
||||
return -EAGAIN;
|
||||
|
||||
if (msg->flags & I2C_M_RECV_LEN)
|
||||
msg->len += min_t(unsigned int, msg->buf[0], I2C_SMBUS_BLOCK_MAX);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -141,6 +141,7 @@ static int i2c_mux_probe(struct platform_device *pdev)
|
||||
return 0;
|
||||
|
||||
err_children:
|
||||
of_node_put(child);
|
||||
i2c_mux_del_adapters(muxc);
|
||||
err_parent:
|
||||
i2c_put_adapter(parent);
|
||||
|
@ -1222,8 +1222,10 @@ static int setup_base_ctxt(struct hfi1_filedata *fd,
|
||||
goto done;
|
||||
|
||||
ret = init_user_ctxt(fd, uctxt);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
hfi1_free_ctxt_rcv_groups(uctxt);
|
||||
goto done;
|
||||
}
|
||||
|
||||
user_init(uctxt);
|
||||
|
||||
|
@ -210,6 +210,14 @@ static void rxe_qp_init_misc(struct rxe_dev *rxe, struct rxe_qp *qp,
|
||||
spin_lock_init(&qp->grp_lock);
|
||||
spin_lock_init(&qp->state_lock);
|
||||
|
||||
spin_lock_init(&qp->req.task.state_lock);
|
||||
spin_lock_init(&qp->resp.task.state_lock);
|
||||
spin_lock_init(&qp->comp.task.state_lock);
|
||||
|
||||
spin_lock_init(&qp->sq.sq_lock);
|
||||
spin_lock_init(&qp->rq.producer_lock);
|
||||
spin_lock_init(&qp->rq.consumer_lock);
|
||||
|
||||
atomic_set(&qp->ssn, 0);
|
||||
atomic_set(&qp->skb_out, 0);
|
||||
}
|
||||
@ -258,7 +266,6 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp,
|
||||
qp->req.opcode = -1;
|
||||
qp->comp.opcode = -1;
|
||||
|
||||
spin_lock_init(&qp->sq.sq_lock);
|
||||
skb_queue_head_init(&qp->req_pkts);
|
||||
|
||||
rxe_init_task(rxe, &qp->req.task, qp,
|
||||
@ -308,9 +315,6 @@ static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp,
|
||||
}
|
||||
}
|
||||
|
||||
spin_lock_init(&qp->rq.producer_lock);
|
||||
spin_lock_init(&qp->rq.consumer_lock);
|
||||
|
||||
skb_queue_head_init(&qp->resp_pkts);
|
||||
|
||||
rxe_init_task(rxe, &qp->resp.task, qp,
|
||||
|
@ -640,7 +640,7 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
|
||||
|
||||
ret = iommu_device_register(&data->iommu);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_iommu_register;
|
||||
|
||||
platform_set_drvdata(pdev, data);
|
||||
|
||||
@ -667,6 +667,10 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev)
|
||||
pm_runtime_enable(dev);
|
||||
|
||||
return 0;
|
||||
|
||||
err_iommu_register:
|
||||
iommu_device_sysfs_remove(&data->iommu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __maybe_unused exynos_sysmmu_suspend(struct device *dev)
|
||||
|
@ -767,9 +767,12 @@ static bool qcom_iommu_has_secure_context(struct qcom_iommu_dev *qcom_iommu)
|
||||
{
|
||||
struct device_node *child;
|
||||
|
||||
for_each_child_of_node(qcom_iommu->dev->of_node, child)
|
||||
if (of_device_is_compatible(child, "qcom,msm-iommu-v1-sec"))
|
||||
for_each_child_of_node(qcom_iommu->dev->of_node, child) {
|
||||
if (of_device_is_compatible(child, "qcom,msm-iommu-v1-sec")) {
|
||||
of_node_put(child);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -157,10 +157,10 @@ static int tegra_ictlr_suspend(void)
|
||||
lic->cop_iep[i] = readl_relaxed(ictlr + ICTLR_COP_IEP_CLASS);
|
||||
|
||||
/* Disable COP interrupts */
|
||||
writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR);
|
||||
writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_COP_IER_CLR);
|
||||
|
||||
/* Disable CPU interrupts */
|
||||
writel_relaxed(~0ul, ictlr + ICTLR_CPU_IER_CLR);
|
||||
writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_CPU_IER_CLR);
|
||||
|
||||
/* Enable the wakeup sources of ictlr */
|
||||
writel_relaxed(lic->ictlr_wake_mask[i], ictlr + ICTLR_CPU_IER_SET);
|
||||
@ -181,12 +181,12 @@ static void tegra_ictlr_resume(void)
|
||||
|
||||
writel_relaxed(lic->cpu_iep[i],
|
||||
ictlr + ICTLR_CPU_IEP_CLASS);
|
||||
writel_relaxed(~0ul, ictlr + ICTLR_CPU_IER_CLR);
|
||||
writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_CPU_IER_CLR);
|
||||
writel_relaxed(lic->cpu_ier[i],
|
||||
ictlr + ICTLR_CPU_IER_SET);
|
||||
writel_relaxed(lic->cop_iep[i],
|
||||
ictlr + ICTLR_COP_IEP_CLASS);
|
||||
writel_relaxed(~0ul, ictlr + ICTLR_COP_IER_CLR);
|
||||
writel_relaxed(GENMASK(31, 0), ictlr + ICTLR_COP_IER_CLR);
|
||||
writel_relaxed(lic->cop_ier[i],
|
||||
ictlr + ICTLR_COP_IER_SET);
|
||||
}
|
||||
@ -321,7 +321,7 @@ static int __init tegra_ictlr_init(struct device_node *node,
|
||||
lic->base[i] = base;
|
||||
|
||||
/* Disable all interrupts */
|
||||
writel_relaxed(~0UL, base + ICTLR_CPU_IER_CLR);
|
||||
writel_relaxed(GENMASK(31, 0), base + ICTLR_CPU_IER_CLR);
|
||||
/* All interrupts target IRQ */
|
||||
writel_relaxed(0, base + ICTLR_CPU_IEP_CLASS);
|
||||
|
||||
|
@ -3533,7 +3533,7 @@ static void raid_status(struct dm_target *ti, status_type_t type,
|
||||
{
|
||||
struct raid_set *rs = ti->private;
|
||||
struct mddev *mddev = &rs->md;
|
||||
struct r5conf *conf = mddev->private;
|
||||
struct r5conf *conf = rs_is_raid456(rs) ? mddev->private : NULL;
|
||||
int i, max_nr_stripes = conf ? conf->max_nr_stripes : 0;
|
||||
unsigned long recovery;
|
||||
unsigned int raid_param_cnt = 1; /* at least 1 for chunksize */
|
||||
@ -3804,7 +3804,7 @@ static void attempt_restore_of_faulty_devices(struct raid_set *rs)
|
||||
|
||||
memset(cleared_failed_devices, 0, sizeof(cleared_failed_devices));
|
||||
|
||||
for (i = 0; i < mddev->raid_disks; i++) {
|
||||
for (i = 0; i < rs->raid_disks; i++) {
|
||||
r = &rs->dev[i].rdev;
|
||||
/* HM FIXME: enhance journal device recovery processing */
|
||||
if (test_bit(Journal, &r->flags))
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#define HIGH_WATERMARK 50
|
||||
#define LOW_WATERMARK 45
|
||||
#define MAX_WRITEBACK_JOBS 0
|
||||
#define MAX_WRITEBACK_JOBS min(0x10000000 / PAGE_SIZE, totalram_pages / 16)
|
||||
#define ENDIO_LATENCY 16
|
||||
#define WRITEBACK_LATENCY 64
|
||||
#define AUTOCOMMIT_BLOCKS_SSD 65536
|
||||
|
@ -2670,10 +2670,10 @@ static void raid5_end_write_request(struct bio *bi)
|
||||
if (!test_and_clear_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags))
|
||||
clear_bit(R5_LOCKED, &sh->dev[i].flags);
|
||||
set_bit(STRIPE_HANDLE, &sh->state);
|
||||
raid5_release_stripe(sh);
|
||||
|
||||
if (sh->batch_head && sh != sh->batch_head)
|
||||
raid5_release_stripe(sh->batch_head);
|
||||
raid5_release_stripe(sh);
|
||||
}
|
||||
|
||||
static void raid5_error(struct mddev *mddev, struct md_rdev *rdev)
|
||||
|
@ -1339,17 +1339,17 @@ static int msb_ftl_initialize(struct msb_data *msb)
|
||||
msb->zone_count = msb->block_count / MS_BLOCKS_IN_ZONE;
|
||||
msb->logical_block_count = msb->zone_count * 496 - 2;
|
||||
|
||||
msb->used_blocks_bitmap = kzalloc(msb->block_count / 8, GFP_KERNEL);
|
||||
msb->erased_blocks_bitmap = kzalloc(msb->block_count / 8, GFP_KERNEL);
|
||||
msb->used_blocks_bitmap = bitmap_zalloc(msb->block_count, GFP_KERNEL);
|
||||
msb->erased_blocks_bitmap = bitmap_zalloc(msb->block_count, GFP_KERNEL);
|
||||
msb->lba_to_pba_table =
|
||||
kmalloc_array(msb->logical_block_count, sizeof(u16),
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!msb->used_blocks_bitmap || !msb->lba_to_pba_table ||
|
||||
!msb->erased_blocks_bitmap) {
|
||||
kfree(msb->used_blocks_bitmap);
|
||||
bitmap_free(msb->used_blocks_bitmap);
|
||||
bitmap_free(msb->erased_blocks_bitmap);
|
||||
kfree(msb->lba_to_pba_table);
|
||||
kfree(msb->erased_blocks_bitmap);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@ -1961,7 +1961,8 @@ static int msb_bd_open(struct block_device *bdev, fmode_t mode)
|
||||
static void msb_data_clear(struct msb_data *msb)
|
||||
{
|
||||
kfree(msb->boot_page);
|
||||
kfree(msb->used_blocks_bitmap);
|
||||
bitmap_free(msb->used_blocks_bitmap);
|
||||
bitmap_free(msb->erased_blocks_bitmap);
|
||||
kfree(msb->lba_to_pba_table);
|
||||
kfree(msb->cache);
|
||||
msb->card = NULL;
|
||||
|
@ -412,11 +412,8 @@ err_noirq:
|
||||
|
||||
static int t7l66xb_remove(struct platform_device *dev)
|
||||
{
|
||||
struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
|
||||
struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
ret = pdata->disable(dev);
|
||||
clk_disable_unprepare(t7l66xb->clk48m);
|
||||
clk_put(t7l66xb->clk48m);
|
||||
clk_disable_unprepare(t7l66xb->clk32k);
|
||||
@ -427,8 +424,7 @@ static int t7l66xb_remove(struct platform_device *dev)
|
||||
mfd_remove_devices(&dev->dev);
|
||||
kfree(t7l66xb);
|
||||
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver t7l66xb_platform_driver = {
|
||||
|
@ -1479,7 +1479,7 @@ static int rtsx_pci_probe(struct pci_dev *pcidev,
|
||||
pcr->remap_addr = ioremap_nocache(base, len);
|
||||
if (!pcr->remap_addr) {
|
||||
ret = -ENOMEM;
|
||||
goto free_handle;
|
||||
goto free_idr;
|
||||
}
|
||||
|
||||
pcr->rtsx_resv_buf = dma_alloc_coherent(&(pcidev->dev),
|
||||
@ -1541,6 +1541,10 @@ disable_msi:
|
||||
pcr->rtsx_resv_buf, pcr->rtsx_resv_buf_addr);
|
||||
unmap:
|
||||
iounmap(pcr->remap_addr);
|
||||
free_idr:
|
||||
spin_lock(&rtsx_pci_lock);
|
||||
idr_remove(&rtsx_pci_idr, pcr->id);
|
||||
spin_unlock(&rtsx_pci_lock);
|
||||
free_handle:
|
||||
kfree(handle);
|
||||
free_pcr:
|
||||
|
@ -353,6 +353,7 @@ int afu_allocate_irqs(struct cxl_context *ctx, u32 count)
|
||||
|
||||
out:
|
||||
cxl_ops->release_irq_ranges(&ctx->irqs, ctx->afu->adapter);
|
||||
bitmap_free(ctx->irq_bitmap);
|
||||
afu_irq_name_free(ctx);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
@ -288,6 +288,7 @@ static int octeon_mmc_probe(struct platform_device *pdev)
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Error populating slots\n");
|
||||
octeon_mmc_set_shared_power(host, 0);
|
||||
of_node_put(cn);
|
||||
goto error;
|
||||
}
|
||||
i++;
|
||||
|
@ -138,8 +138,10 @@ static int thunder_mmc_probe(struct pci_dev *pdev,
|
||||
continue;
|
||||
|
||||
ret = cvm_mmc_of_slot_probe(&host->slot_pdev[i]->dev, host);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
of_node_put(child_node);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
@ -653,7 +653,7 @@ static int pxamci_probe(struct platform_device *pdev)
|
||||
|
||||
ret = pxamci_of_init(pdev, mmc);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto out;
|
||||
|
||||
host = mmc_priv(mmc);
|
||||
host->mmc = mmc;
|
||||
@ -677,7 +677,7 @@ static int pxamci_probe(struct platform_device *pdev)
|
||||
|
||||
ret = pxamci_init_ocr(host);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
goto out;
|
||||
|
||||
mmc->caps = 0;
|
||||
host->cmdat = 0;
|
||||
|
@ -117,8 +117,13 @@ static void sdhci_at91_set_power(struct sdhci_host *host, unsigned char mode,
|
||||
static void sdhci_at91_set_uhs_signaling(struct sdhci_host *host,
|
||||
unsigned int timing)
|
||||
{
|
||||
if (timing == MMC_TIMING_MMC_DDR52)
|
||||
sdhci_writeb(host, SDMMC_MC1R_DDR, SDMMC_MC1R);
|
||||
u8 mc1r;
|
||||
|
||||
if (timing == MMC_TIMING_MMC_DDR52) {
|
||||
mc1r = sdhci_readb(host, SDMMC_MC1R);
|
||||
mc1r |= SDMMC_MC1R_DDR;
|
||||
sdhci_writeb(host, mc1r, SDMMC_MC1R);
|
||||
}
|
||||
sdhci_set_uhs_signaling(host, timing);
|
||||
}
|
||||
|
||||
|
@ -704,6 +704,7 @@ static int esdhc_signal_voltage_switch(struct mmc_host *mmc,
|
||||
scfg_node = of_find_matching_node(NULL, scfg_device_ids);
|
||||
if (scfg_node)
|
||||
scfg_base = of_iomap(scfg_node, 0);
|
||||
of_node_put(scfg_node);
|
||||
if (scfg_base) {
|
||||
sdhciovselcr = SDHCIOVSELCR_TGLEN |
|
||||
SDHCIOVSELCR_VSELVAL;
|
||||
|
@ -2120,10 +2120,12 @@ static int stfsm_probe(struct platform_device *pdev)
|
||||
(long long)fsm->mtd.size, (long long)(fsm->mtd.size >> 20),
|
||||
fsm->mtd.erasesize, (fsm->mtd.erasesize >> 10));
|
||||
|
||||
return mtd_device_register(&fsm->mtd, NULL, 0);
|
||||
|
||||
ret = mtd_device_register(&fsm->mtd, NULL, 0);
|
||||
if (ret) {
|
||||
err_clk_unprepare:
|
||||
clk_disable_unprepare(fsm->clk);
|
||||
clk_disable_unprepare(fsm->clk);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -107,6 +107,7 @@ static int ap_flash_init(struct platform_device *pdev)
|
||||
return -ENODEV;
|
||||
}
|
||||
ebi_base = of_iomap(ebi, 0);
|
||||
of_node_put(ebi);
|
||||
if (!ebi_base)
|
||||
return -ENODEV;
|
||||
|
||||
@ -221,6 +222,7 @@ int of_flash_probe_versatile(struct platform_device *pdev,
|
||||
|
||||
versatile_flashprot = (enum versatile_flashprot)devid->data;
|
||||
rmap = syscon_node_to_regmap(sysnp);
|
||||
of_node_put(sysnp);
|
||||
if (IS_ERR(rmap))
|
||||
return PTR_ERR(rmap);
|
||||
|
||||
|
@ -1091,9 +1091,9 @@ static void sm_release(struct mtd_blktrans_dev *dev)
|
||||
{
|
||||
struct sm_ftl *ftl = dev->priv;
|
||||
|
||||
mutex_lock(&ftl->mutex);
|
||||
del_timer_sync(&ftl->timer);
|
||||
cancel_work_sync(&ftl->flush_work);
|
||||
mutex_lock(&ftl->mutex);
|
||||
sm_cache_flush(ftl);
|
||||
mutex_unlock(&ftl->mutex);
|
||||
}
|
||||
|
@ -500,6 +500,7 @@ static void pch_can_error(struct net_device *ndev, u32 status)
|
||||
if (!skb)
|
||||
return;
|
||||
|
||||
errc = ioread32(&priv->regs->errc);
|
||||
if (status & PCH_BUS_OFF) {
|
||||
pch_can_set_tx_all(priv, 0);
|
||||
pch_can_set_rx_all(priv, 0);
|
||||
@ -507,9 +508,11 @@ static void pch_can_error(struct net_device *ndev, u32 status)
|
||||
cf->can_id |= CAN_ERR_BUSOFF;
|
||||
priv->can.can_stats.bus_off++;
|
||||
can_bus_off(ndev);
|
||||
} else {
|
||||
cf->data[6] = errc & PCH_TEC;
|
||||
cf->data[7] = (errc & PCH_REC) >> 8;
|
||||
}
|
||||
|
||||
errc = ioread32(&priv->regs->errc);
|
||||
/* Warning interrupt. */
|
||||
if (status & PCH_EWARN) {
|
||||
state = CAN_STATE_ERROR_WARNING;
|
||||
@ -567,9 +570,6 @@ static void pch_can_error(struct net_device *ndev, u32 status)
|
||||
break;
|
||||
}
|
||||
|
||||
cf->data[6] = errc & PCH_TEC;
|
||||
cf->data[7] = (errc & PCH_REC) >> 8;
|
||||
|
||||
priv->can.state = state;
|
||||
netif_receive_skb(skb);
|
||||
|
||||
|
@ -233,11 +233,8 @@ static void rcar_can_error(struct net_device *ndev)
|
||||
if (eifr & (RCAR_CAN_EIFR_EWIF | RCAR_CAN_EIFR_EPIF)) {
|
||||
txerr = readb(&priv->regs->tecr);
|
||||
rxerr = readb(&priv->regs->recr);
|
||||
if (skb) {
|
||||
if (skb)
|
||||
cf->can_id |= CAN_ERR_CRTL;
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
}
|
||||
}
|
||||
if (eifr & RCAR_CAN_EIFR_BEIF) {
|
||||
int rx_errors = 0, tx_errors = 0;
|
||||
@ -337,6 +334,9 @@ static void rcar_can_error(struct net_device *ndev)
|
||||
can_bus_off(ndev);
|
||||
if (skb)
|
||||
cf->can_id |= CAN_ERR_BUSOFF;
|
||||
} else if (skb) {
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
}
|
||||
if (eifr & RCAR_CAN_EIFR_ORIF) {
|
||||
netdev_dbg(priv->ndev, "Receive overrun error interrupt\n");
|
||||
|
@ -405,9 +405,6 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
|
||||
txerr = priv->read_reg(priv, SJA1000_TXERR);
|
||||
rxerr = priv->read_reg(priv, SJA1000_RXERR);
|
||||
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
|
||||
if (isrc & IRQ_DOI) {
|
||||
/* data overrun interrupt */
|
||||
netdev_dbg(dev, "data overrun interrupt\n");
|
||||
@ -429,6 +426,10 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
|
||||
else
|
||||
state = CAN_STATE_ERROR_ACTIVE;
|
||||
}
|
||||
if (state != CAN_STATE_BUS_OFF) {
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
}
|
||||
if (isrc & IRQ_BEI) {
|
||||
/* bus error interrupt */
|
||||
priv->can.can_stats.bus_error++;
|
||||
|
@ -688,8 +688,6 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id)
|
||||
|
||||
txerr = hi3110_read(spi, HI3110_READ_TEC);
|
||||
rxerr = hi3110_read(spi, HI3110_READ_REC);
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
tx_state = txerr >= rxerr ? new_state : 0;
|
||||
rx_state = txerr <= rxerr ? new_state : 0;
|
||||
can_change_state(net, cf, tx_state, rx_state);
|
||||
@ -702,6 +700,9 @@ static irqreturn_t hi3110_can_ist(int irq, void *dev_id)
|
||||
hi3110_hw_sleep(spi);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -525,11 +525,6 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status)
|
||||
rxerr = (errc >> 16) & 0xFF;
|
||||
txerr = errc & 0xFF;
|
||||
|
||||
if (skb) {
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
}
|
||||
|
||||
if (isrc & SUN4I_INT_DATA_OR) {
|
||||
/* data overrun interrupt */
|
||||
netdev_dbg(dev, "data overrun interrupt\n");
|
||||
@ -560,6 +555,10 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status)
|
||||
else
|
||||
state = CAN_STATE_ERROR_ACTIVE;
|
||||
}
|
||||
if (skb && state != CAN_STATE_BUS_OFF) {
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
}
|
||||
if (isrc & SUN4I_INT_BUS_ERR) {
|
||||
/* bus error interrupt */
|
||||
netdev_dbg(dev, "bus error interrupt\n");
|
||||
|
@ -206,7 +206,7 @@ struct __packed ems_cpc_msg {
|
||||
__le32 ts_sec; /* timestamp in seconds */
|
||||
__le32 ts_nsec; /* timestamp in nano seconds */
|
||||
|
||||
union {
|
||||
union __packed {
|
||||
u8 generic[64];
|
||||
struct cpc_can_msg can_msg;
|
||||
struct cpc_can_params can_params;
|
||||
|
@ -890,8 +890,10 @@ static void kvaser_usb_hydra_update_state(struct kvaser_usb_net_priv *priv,
|
||||
new_state < CAN_STATE_BUS_OFF)
|
||||
priv->can.can_stats.restarts++;
|
||||
|
||||
cf->data[6] = bec->txerr;
|
||||
cf->data[7] = bec->rxerr;
|
||||
if (new_state != CAN_STATE_BUS_OFF) {
|
||||
cf->data[6] = bec->txerr;
|
||||
cf->data[7] = bec->rxerr;
|
||||
}
|
||||
|
||||
stats = &netdev->stats;
|
||||
stats->rx_packets++;
|
||||
@ -1045,8 +1047,10 @@ kvaser_usb_hydra_error_frame(struct kvaser_usb_net_priv *priv,
|
||||
shhwtstamps->hwtstamp = hwtstamp;
|
||||
|
||||
cf->can_id |= CAN_ERR_BUSERROR;
|
||||
cf->data[6] = bec.txerr;
|
||||
cf->data[7] = bec.rxerr;
|
||||
if (new_state != CAN_STATE_BUS_OFF) {
|
||||
cf->data[6] = bec.txerr;
|
||||
cf->data[7] = bec.rxerr;
|
||||
}
|
||||
|
||||
stats->rx_packets++;
|
||||
stats->rx_bytes += cf->can_dlc;
|
||||
|
@ -857,8 +857,10 @@ static void kvaser_usb_leaf_rx_error(const struct kvaser_usb *dev,
|
||||
break;
|
||||
}
|
||||
|
||||
cf->data[6] = es->txerr;
|
||||
cf->data[7] = es->rxerr;
|
||||
if (new_state != CAN_STATE_BUS_OFF) {
|
||||
cf->data[6] = es->txerr;
|
||||
cf->data[7] = es->rxerr;
|
||||
}
|
||||
|
||||
stats->rx_packets++;
|
||||
stats->rx_bytes += cf->can_dlc;
|
||||
|
@ -453,9 +453,10 @@ static void usb_8dev_rx_err_msg(struct usb_8dev_priv *priv,
|
||||
|
||||
if (rx_errors)
|
||||
stats->rx_errors++;
|
||||
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
if (priv->can.state != CAN_STATE_BUS_OFF) {
|
||||
cf->data[6] = txerr;
|
||||
cf->data[7] = rxerr;
|
||||
}
|
||||
|
||||
priv->bec.txerr = txerr;
|
||||
priv->bec.rxerr = rxerr;
|
||||
|
@ -141,11 +141,7 @@ static int fec_ptp_enable_pps(struct fec_enet_private *fep, uint enable)
|
||||
* NSEC_PER_SEC - ts.tv_nsec. Add the remaining nanoseconds
|
||||
* to current timer would be next second.
|
||||
*/
|
||||
tempval = readl(fep->hwp + FEC_ATIME_CTRL);
|
||||
tempval |= FEC_T_CTRL_CAPTURE;
|
||||
writel(tempval, fep->hwp + FEC_ATIME_CTRL);
|
||||
|
||||
tempval = readl(fep->hwp + FEC_ATIME);
|
||||
tempval = fep->cc.read(&fep->cc);
|
||||
/* Convert the ptp local counter to 1588 timestamp */
|
||||
ns = timecounter_cyc2time(&fep->tc, tempval);
|
||||
ts = ns_to_timespec64(ns);
|
||||
|
@ -397,7 +397,9 @@ static void i40e_tx_timeout(struct net_device *netdev)
|
||||
set_bit(__I40E_GLOBAL_RESET_REQUESTED, pf->state);
|
||||
break;
|
||||
default:
|
||||
netdev_err(netdev, "tx_timeout recovery unsuccessful\n");
|
||||
netdev_err(netdev, "tx_timeout recovery unsuccessful, device is in non-recoverable state.\n");
|
||||
set_bit(__I40E_DOWN_REQUESTED, pf->state);
|
||||
set_bit(__I40E_VSI_DOWN_REQUESTED, vsi->state);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -594,6 +594,8 @@ struct igb_adapter {
|
||||
struct igb_mac_addr *mac_table;
|
||||
struct vf_mac_filter vf_macs;
|
||||
struct vf_mac_filter *vf_mac_list;
|
||||
/* lock for VF resources */
|
||||
spinlock_t vfs_lock;
|
||||
};
|
||||
|
||||
/* flags controlling PTP/1588 function */
|
||||
|
@ -3517,6 +3517,7 @@ static int igb_disable_sriov(struct pci_dev *pdev)
|
||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||
struct igb_adapter *adapter = netdev_priv(netdev);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
unsigned long flags;
|
||||
|
||||
/* reclaim resources allocated to VFs */
|
||||
if (adapter->vf_data) {
|
||||
@ -3529,12 +3530,13 @@ static int igb_disable_sriov(struct pci_dev *pdev)
|
||||
pci_disable_sriov(pdev);
|
||||
msleep(500);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&adapter->vfs_lock, flags);
|
||||
kfree(adapter->vf_mac_list);
|
||||
adapter->vf_mac_list = NULL;
|
||||
kfree(adapter->vf_data);
|
||||
adapter->vf_data = NULL;
|
||||
adapter->vfs_allocated_count = 0;
|
||||
spin_unlock_irqrestore(&adapter->vfs_lock, flags);
|
||||
wr32(E1000_IOVCTL, E1000_IOVCTL_REUSE_VFQ);
|
||||
wrfl();
|
||||
msleep(100);
|
||||
@ -3694,7 +3696,9 @@ static void igb_remove(struct pci_dev *pdev)
|
||||
igb_release_hw_control(adapter);
|
||||
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
rtnl_lock();
|
||||
igb_disable_sriov(pdev);
|
||||
rtnl_unlock();
|
||||
#endif
|
||||
|
||||
unregister_netdev(netdev);
|
||||
@ -3855,6 +3859,9 @@ static int igb_sw_init(struct igb_adapter *adapter)
|
||||
|
||||
spin_lock_init(&adapter->nfc_lock);
|
||||
spin_lock_init(&adapter->stats64_lock);
|
||||
|
||||
/* init spinlock to avoid concurrency of VF resources */
|
||||
spin_lock_init(&adapter->vfs_lock);
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
switch (hw->mac.type) {
|
||||
case e1000_82576:
|
||||
@ -7601,8 +7608,10 @@ unlock:
|
||||
static void igb_msg_task(struct igb_adapter *adapter)
|
||||
{
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
unsigned long flags;
|
||||
u32 vf;
|
||||
|
||||
spin_lock_irqsave(&adapter->vfs_lock, flags);
|
||||
for (vf = 0; vf < adapter->vfs_allocated_count; vf++) {
|
||||
/* process any reset requests */
|
||||
if (!igb_check_for_rst(hw, vf))
|
||||
@ -7616,6 +7625,7 @@ static void igb_msg_task(struct igb_adapter *adapter)
|
||||
if (!igb_check_for_ack(hw, vf))
|
||||
igb_rcv_ack_from_vf(adapter, vf);
|
||||
}
|
||||
spin_unlock_irqrestore(&adapter->vfs_lock, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,7 +95,7 @@ struct page_pool;
|
||||
#define MLX5E_LOG_ALIGNED_MPWQE_PPW (ilog2(MLX5E_REQUIRED_WQE_MTTS))
|
||||
#define MLX5E_REQUIRED_MTTS(wqes) (wqes * MLX5E_REQUIRED_WQE_MTTS)
|
||||
#define MLX5E_MAX_RQ_NUM_MTTS \
|
||||
((1 << 16) * 2) /* So that MLX5_MTT_OCTW(num_mtts) fits into u16 */
|
||||
(ALIGN_DOWN(U16_MAX, 4) * 2) /* So that MLX5_MTT_OCTW(num_mtts) fits into u16 */
|
||||
#define MLX5E_ORDER2_MAX_PACKET_MTU (order_base_2(10 * 1024))
|
||||
#define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE_MPW \
|
||||
(ilog2(MLX5E_MAX_RQ_NUM_MTTS / MLX5E_REQUIRED_WQE_MTTS))
|
||||
|
@ -799,8 +799,7 @@ static struct dst_entry *geneve_get_v6_dst(struct sk_buff *skb,
|
||||
use_cache = false;
|
||||
}
|
||||
|
||||
fl6->flowlabel = ip6_make_flowinfo(RT_TOS(prio),
|
||||
info->key.label);
|
||||
fl6->flowlabel = ip6_make_flowinfo(prio, info->key.label);
|
||||
dst_cache = (struct dst_cache *)&info->dst_cache;
|
||||
if (use_cache) {
|
||||
dst = dst_cache_get_ip6(dst_cache, &fl6->saddr);
|
||||
|
@ -330,10 +330,12 @@ nsim_map_alloc_elem(struct bpf_offloaded_map *offmap, unsigned int idx)
|
||||
{
|
||||
struct nsim_bpf_bound_map *nmap = offmap->dev_priv;
|
||||
|
||||
nmap->entry[idx].key = kmalloc(offmap->map.key_size, GFP_USER);
|
||||
nmap->entry[idx].key = kmalloc(offmap->map.key_size,
|
||||
GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
|
||||
if (!nmap->entry[idx].key)
|
||||
return -ENOMEM;
|
||||
nmap->entry[idx].value = kmalloc(offmap->map.value_size, GFP_USER);
|
||||
nmap->entry[idx].value = kmalloc(offmap->map.value_size,
|
||||
GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
|
||||
if (!nmap->entry[idx].value) {
|
||||
kfree(nmap->entry[idx].key);
|
||||
nmap->entry[idx].key = NULL;
|
||||
@ -475,7 +477,7 @@ nsim_bpf_map_alloc(struct netdevsim *ns, struct bpf_offloaded_map *offmap)
|
||||
if (offmap->map.map_flags)
|
||||
return -EINVAL;
|
||||
|
||||
nmap = kzalloc(sizeof(*nmap), GFP_USER);
|
||||
nmap = kzalloc(sizeof(*nmap), GFP_KERNEL_ACCOUNT);
|
||||
if (!nmap)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -1706,7 +1706,7 @@ static const struct driver_info ax88179_info = {
|
||||
.link_reset = ax88179_link_reset,
|
||||
.reset = ax88179_reset,
|
||||
.stop = ax88179_stop,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
|
||||
.rx_fixup = ax88179_rx_fixup,
|
||||
.tx_fixup = ax88179_tx_fixup,
|
||||
};
|
||||
@ -1719,7 +1719,7 @@ static const struct driver_info ax88178a_info = {
|
||||
.link_reset = ax88179_link_reset,
|
||||
.reset = ax88179_reset,
|
||||
.stop = ax88179_stop,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
|
||||
.rx_fixup = ax88179_rx_fixup,
|
||||
.tx_fixup = ax88179_tx_fixup,
|
||||
};
|
||||
@ -1732,7 +1732,7 @@ static const struct driver_info cypress_GX3_info = {
|
||||
.link_reset = ax88179_link_reset,
|
||||
.reset = ax88179_reset,
|
||||
.stop = ax88179_stop,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
|
||||
.rx_fixup = ax88179_rx_fixup,
|
||||
.tx_fixup = ax88179_tx_fixup,
|
||||
};
|
||||
@ -1745,7 +1745,7 @@ static const struct driver_info dlink_dub1312_info = {
|
||||
.link_reset = ax88179_link_reset,
|
||||
.reset = ax88179_reset,
|
||||
.stop = ax88179_stop,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
|
||||
.rx_fixup = ax88179_rx_fixup,
|
||||
.tx_fixup = ax88179_tx_fixup,
|
||||
};
|
||||
@ -1758,7 +1758,7 @@ static const struct driver_info sitecom_info = {
|
||||
.link_reset = ax88179_link_reset,
|
||||
.reset = ax88179_reset,
|
||||
.stop = ax88179_stop,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
|
||||
.rx_fixup = ax88179_rx_fixup,
|
||||
.tx_fixup = ax88179_tx_fixup,
|
||||
};
|
||||
@ -1771,7 +1771,7 @@ static const struct driver_info samsung_info = {
|
||||
.link_reset = ax88179_link_reset,
|
||||
.reset = ax88179_reset,
|
||||
.stop = ax88179_stop,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
|
||||
.rx_fixup = ax88179_rx_fixup,
|
||||
.tx_fixup = ax88179_tx_fixup,
|
||||
};
|
||||
@ -1784,7 +1784,7 @@ static const struct driver_info lenovo_info = {
|
||||
.link_reset = ax88179_link_reset,
|
||||
.reset = ax88179_reset,
|
||||
.stop = ax88179_stop,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
|
||||
.rx_fixup = ax88179_rx_fixup,
|
||||
.tx_fixup = ax88179_tx_fixup,
|
||||
};
|
||||
@ -1797,7 +1797,7 @@ static const struct driver_info belkin_info = {
|
||||
.link_reset = ax88179_link_reset,
|
||||
.reset = ax88179_reset,
|
||||
.stop = ax88179_stop,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_SEND_ZLP,
|
||||
.flags = FLAG_ETHER | FLAG_FRAMING_AX,
|
||||
.rx_fixup = ax88179_rx_fixup,
|
||||
.tx_fixup = ax88179_tx_fixup,
|
||||
};
|
||||
|
@ -1002,20 +1002,14 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
|
||||
void *cmd;
|
||||
int cmdlen = len - sizeof(struct wmi_cmd_hdr);
|
||||
u16 cmdid;
|
||||
int rc, rc1;
|
||||
int rc1;
|
||||
|
||||
if (cmdlen < 0)
|
||||
if (cmdlen < 0 || *ppos != 0)
|
||||
return -EINVAL;
|
||||
|
||||
wmi = kmalloc(len, GFP_KERNEL);
|
||||
if (!wmi)
|
||||
return -ENOMEM;
|
||||
|
||||
rc = simple_write_to_buffer(wmi, len, ppos, buf, len);
|
||||
if (rc < 0) {
|
||||
kfree(wmi);
|
||||
return rc;
|
||||
}
|
||||
wmi = memdup_user(buf, len);
|
||||
if (IS_ERR(wmi))
|
||||
return PTR_ERR(wmi);
|
||||
|
||||
cmd = (cmdlen > 0) ? &wmi[1] : NULL;
|
||||
cmdid = le16_to_cpu(wmi->command_id);
|
||||
@ -1025,7 +1019,7 @@ static ssize_t wil_write_file_wmi(struct file *file, const char __user *buf,
|
||||
|
||||
wil_info(wil, "0x%04x[%d] -> %d\n", cmdid, cmdlen, rc1);
|
||||
|
||||
return rc;
|
||||
return len;
|
||||
}
|
||||
|
||||
static const struct file_operations fops_wmi = {
|
||||
|
@ -688,7 +688,7 @@ static void p54_flush(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
|
||||
* queues have already been stopped and no new frames can sneak
|
||||
* up from behind.
|
||||
*/
|
||||
while ((total = p54_flush_count(priv) && i--)) {
|
||||
while ((total = p54_flush_count(priv)) && i--) {
|
||||
/* waste time */
|
||||
msleep(20);
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ static int p54spi_request_firmware(struct ieee80211_hw *dev)
|
||||
|
||||
ret = p54_parse_firmware(dev, priv->firmware);
|
||||
if (ret) {
|
||||
release_firmware(priv->firmware);
|
||||
/* the firmware is released by the caller */
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -672,6 +672,7 @@ static int p54spi_probe(struct spi_device *spi)
|
||||
return 0;
|
||||
|
||||
err_free_common:
|
||||
release_firmware(priv->firmware);
|
||||
free_irq(gpio_to_irq(p54spi_gpio_irq), spi);
|
||||
err_free_gpio_irq:
|
||||
gpio_free(p54spi_gpio_irq);
|
||||
|
@ -283,6 +283,7 @@ static int if_usb_probe(struct usb_interface *intf,
|
||||
return 0;
|
||||
|
||||
err_get_fw:
|
||||
usb_put_dev(udev);
|
||||
lbs_remove_card(priv);
|
||||
err_add_card:
|
||||
if_usb_reset_device(cardp);
|
||||
|
@ -367,14 +367,16 @@ static ssize_t tool_fn_write(struct tool_ctx *tc,
|
||||
u64 bits;
|
||||
int n;
|
||||
|
||||
if (*offp)
|
||||
return 0;
|
||||
|
||||
buf = kmalloc(size + 1, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = simple_write_to_buffer(buf, size, offp, ubuf, size);
|
||||
if (ret < 0) {
|
||||
if (copy_from_user(buf, ubuf, size)) {
|
||||
kfree(buf);
|
||||
return ret;
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
buf[size] = 0;
|
||||
|
@ -4799,6 +4799,9 @@ static const struct pci_dev_acs_enabled {
|
||||
{ PCI_VENDOR_ID_AMPERE, 0xE00C, pci_quirk_xgene_acs },
|
||||
/* Broadcom multi-function device */
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0x16D7, pci_quirk_mf_endpoint_acs },
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0x1750, pci_quirk_mf_endpoint_acs },
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0x1751, pci_quirk_mf_endpoint_acs },
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0x1752, pci_quirk_mf_endpoint_acs },
|
||||
{ PCI_VENDOR_ID_BROADCOM, 0xD714, pci_quirk_brcm_acs },
|
||||
{ 0 }
|
||||
};
|
||||
|
@ -1455,8 +1455,10 @@ static int nmk_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
|
||||
|
||||
has_config = nmk_pinctrl_dt_get_config(np, &configs);
|
||||
np_config = of_parse_phandle(np, "ste,config", 0);
|
||||
if (np_config)
|
||||
if (np_config) {
|
||||
has_config |= nmk_pinctrl_dt_get_config(np_config, &configs);
|
||||
of_node_put(np_config);
|
||||
}
|
||||
if (has_config) {
|
||||
const char *gpio_name;
|
||||
const char *pin;
|
||||
|
@ -852,8 +852,8 @@ static const struct msm_pingroup msm8916_groups[] = {
|
||||
PINGROUP(28, pwr_modem_enabled_a, NA, NA, NA, NA, NA, qdss_tracedata_b, NA, atest_combodac),
|
||||
PINGROUP(29, cci_i2c, NA, NA, NA, NA, NA, qdss_tracedata_b, NA, atest_combodac),
|
||||
PINGROUP(30, cci_i2c, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
|
||||
PINGROUP(31, cci_timer0, NA, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(32, cci_timer1, NA, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(31, cci_timer0, flash_strobe, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(32, cci_timer1, flash_strobe, NA, NA, NA, NA, NA, NA, NA),
|
||||
PINGROUP(33, cci_async, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
|
||||
PINGROUP(34, pwr_nav_enabled_a, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
|
||||
PINGROUP(35, pwr_crypto_enabled_a, NA, NA, NA, NA, NA, NA, NA, qdss_tracedata_b),
|
||||
|
@ -170,7 +170,7 @@ static ssize_t ec_dbgfs_cmd_write(struct file *file, const char __user *buf,
|
||||
int i, m;
|
||||
unsigned char ec_cmd[EC_MAX_CMD_ARGS];
|
||||
unsigned int ec_cmd_int[EC_MAX_CMD_ARGS];
|
||||
char cmdbuf[64];
|
||||
char cmdbuf[64] = "";
|
||||
int ec_cmd_bytes;
|
||||
|
||||
mutex_lock(&ec_dbgfs_lock);
|
||||
|
@ -415,6 +415,7 @@ static int wcnss_request_irq(struct qcom_wcnss *wcnss,
|
||||
irq_handler_t thread_fn)
|
||||
{
|
||||
int ret;
|
||||
int irq_number;
|
||||
|
||||
ret = platform_get_irq_byname(pdev, name);
|
||||
if (ret < 0 && optional) {
|
||||
@ -425,14 +426,19 @@ static int wcnss_request_irq(struct qcom_wcnss *wcnss,
|
||||
return ret;
|
||||
}
|
||||
|
||||
irq_number = ret;
|
||||
|
||||
ret = devm_request_threaded_irq(&pdev->dev, ret,
|
||||
NULL, thread_fn,
|
||||
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
|
||||
"wcnss", wcnss);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "request %s IRQ failed\n", name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
/* Return the IRQ number if the IRQ was successfully acquired */
|
||||
return irq_number;
|
||||
}
|
||||
|
||||
static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss)
|
||||
|
@ -1364,6 +1364,7 @@ static int qcom_smd_parse_edge(struct device *dev,
|
||||
}
|
||||
|
||||
edge->ipc_regmap = syscon_node_to_regmap(syscon_np);
|
||||
of_node_put(syscon_np);
|
||||
if (IS_ERR(edge->ipc_regmap)) {
|
||||
ret = PTR_ERR(edge->ipc_regmap);
|
||||
goto put_node;
|
||||
|
@ -53,6 +53,7 @@ static struct dentry *zcore_reipl_file;
|
||||
static struct dentry *zcore_hsa_file;
|
||||
static struct ipl_parameter_block *ipl_block;
|
||||
|
||||
static DEFINE_MUTEX(hsa_buf_mutex);
|
||||
static char hsa_buf[PAGE_SIZE] __aligned(PAGE_SIZE);
|
||||
|
||||
/*
|
||||
@ -69,19 +70,24 @@ int memcpy_hsa_user(void __user *dest, unsigned long src, size_t count)
|
||||
if (!hsa_available)
|
||||
return -ENODATA;
|
||||
|
||||
mutex_lock(&hsa_buf_mutex);
|
||||
while (count) {
|
||||
if (sclp_sdias_copy(hsa_buf, src / PAGE_SIZE + 2, 1)) {
|
||||
TRACE("sclp_sdias_copy() failed\n");
|
||||
mutex_unlock(&hsa_buf_mutex);
|
||||
return -EIO;
|
||||
}
|
||||
offset = src % PAGE_SIZE;
|
||||
bytes = min(PAGE_SIZE - offset, count);
|
||||
if (copy_to_user(dest, hsa_buf + offset, bytes))
|
||||
if (copy_to_user(dest, hsa_buf + offset, bytes)) {
|
||||
mutex_unlock(&hsa_buf_mutex);
|
||||
return -EFAULT;
|
||||
}
|
||||
src += bytes;
|
||||
dest += bytes;
|
||||
count -= bytes;
|
||||
}
|
||||
mutex_unlock(&hsa_buf_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -99,9 +105,11 @@ int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count)
|
||||
if (!hsa_available)
|
||||
return -ENODATA;
|
||||
|
||||
mutex_lock(&hsa_buf_mutex);
|
||||
while (count) {
|
||||
if (sclp_sdias_copy(hsa_buf, src / PAGE_SIZE + 2, 1)) {
|
||||
TRACE("sclp_sdias_copy() failed\n");
|
||||
mutex_unlock(&hsa_buf_mutex);
|
||||
return -EIO;
|
||||
}
|
||||
offset = src % PAGE_SIZE;
|
||||
@ -111,6 +119,7 @@ int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count)
|
||||
dest += bytes;
|
||||
count -= bytes;
|
||||
}
|
||||
mutex_unlock(&hsa_buf_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -205,19 +205,11 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process)
|
||||
if (work_pending(&sch->todo_work))
|
||||
goto out_unlock;
|
||||
|
||||
if (cio_update_schib(sch)) {
|
||||
vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER);
|
||||
rc = 0;
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
private = dev_get_drvdata(&sch->dev);
|
||||
if (private->state == VFIO_CCW_STATE_NOT_OPER) {
|
||||
private->state = private->mdev ? VFIO_CCW_STATE_IDLE :
|
||||
VFIO_CCW_STATE_STANDBY;
|
||||
}
|
||||
rc = 0;
|
||||
|
||||
if (cio_update_schib(sch))
|
||||
vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER);
|
||||
|
||||
out_unlock:
|
||||
spin_unlock_irqrestore(sch->lock, flags);
|
||||
|
||||
|
@ -145,27 +145,33 @@ void zfcp_fc_enqueue_event(struct zfcp_adapter *adapter,
|
||||
|
||||
static int zfcp_fc_wka_port_get(struct zfcp_fc_wka_port *wka_port)
|
||||
{
|
||||
int ret = -EIO;
|
||||
|
||||
if (mutex_lock_interruptible(&wka_port->mutex))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
if (wka_port->status == ZFCP_FC_WKA_PORT_OFFLINE ||
|
||||
wka_port->status == ZFCP_FC_WKA_PORT_CLOSING) {
|
||||
wka_port->status = ZFCP_FC_WKA_PORT_OPENING;
|
||||
if (zfcp_fsf_open_wka_port(wka_port))
|
||||
if (zfcp_fsf_open_wka_port(wka_port)) {
|
||||
/* could not even send request, nothing to wait for */
|
||||
wka_port->status = ZFCP_FC_WKA_PORT_OFFLINE;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&wka_port->mutex);
|
||||
|
||||
wait_event(wka_port->completion_wq,
|
||||
wait_event(wka_port->opened,
|
||||
wka_port->status == ZFCP_FC_WKA_PORT_ONLINE ||
|
||||
wka_port->status == ZFCP_FC_WKA_PORT_OFFLINE);
|
||||
|
||||
if (wka_port->status == ZFCP_FC_WKA_PORT_ONLINE) {
|
||||
atomic_inc(&wka_port->refcount);
|
||||
return 0;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
return -EIO;
|
||||
out:
|
||||
mutex_unlock(&wka_port->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void zfcp_fc_wka_port_offline(struct work_struct *work)
|
||||
@ -181,9 +187,12 @@ static void zfcp_fc_wka_port_offline(struct work_struct *work)
|
||||
|
||||
wka_port->status = ZFCP_FC_WKA_PORT_CLOSING;
|
||||
if (zfcp_fsf_close_wka_port(wka_port)) {
|
||||
/* could not even send request, nothing to wait for */
|
||||
wka_port->status = ZFCP_FC_WKA_PORT_OFFLINE;
|
||||
wake_up(&wka_port->completion_wq);
|
||||
goto out;
|
||||
}
|
||||
wait_event(wka_port->closed,
|
||||
wka_port->status == ZFCP_FC_WKA_PORT_OFFLINE);
|
||||
out:
|
||||
mutex_unlock(&wka_port->mutex);
|
||||
}
|
||||
@ -193,13 +202,15 @@ static void zfcp_fc_wka_port_put(struct zfcp_fc_wka_port *wka_port)
|
||||
if (atomic_dec_return(&wka_port->refcount) != 0)
|
||||
return;
|
||||
/* wait 10 milliseconds, other reqs might pop in */
|
||||
schedule_delayed_work(&wka_port->work, HZ / 100);
|
||||
queue_delayed_work(wka_port->adapter->work_queue, &wka_port->work,
|
||||
msecs_to_jiffies(10));
|
||||
}
|
||||
|
||||
static void zfcp_fc_wka_port_init(struct zfcp_fc_wka_port *wka_port, u32 d_id,
|
||||
struct zfcp_adapter *adapter)
|
||||
{
|
||||
init_waitqueue_head(&wka_port->completion_wq);
|
||||
init_waitqueue_head(&wka_port->opened);
|
||||
init_waitqueue_head(&wka_port->closed);
|
||||
|
||||
wka_port->adapter = adapter;
|
||||
wka_port->d_id = d_id;
|
||||
|
@ -170,7 +170,8 @@ enum zfcp_fc_wka_status {
|
||||
/**
|
||||
* struct zfcp_fc_wka_port - representation of well-known-address (WKA) FC port
|
||||
* @adapter: Pointer to adapter structure this WKA port belongs to
|
||||
* @completion_wq: Wait for completion of open/close command
|
||||
* @opened: Wait for completion of open command
|
||||
* @closed: Wait for completion of close command
|
||||
* @status: Current status of WKA port
|
||||
* @refcount: Reference count to keep port open as long as it is in use
|
||||
* @d_id: FC destination id or well-known-address
|
||||
@ -180,7 +181,8 @@ enum zfcp_fc_wka_status {
|
||||
*/
|
||||
struct zfcp_fc_wka_port {
|
||||
struct zfcp_adapter *adapter;
|
||||
wait_queue_head_t completion_wq;
|
||||
wait_queue_head_t opened;
|
||||
wait_queue_head_t closed;
|
||||
enum zfcp_fc_wka_status status;
|
||||
atomic_t refcount;
|
||||
u32 d_id;
|
||||
|
@ -1592,7 +1592,7 @@ static void zfcp_fsf_open_wka_port_handler(struct zfcp_fsf_req *req)
|
||||
wka_port->status = ZFCP_FC_WKA_PORT_ONLINE;
|
||||
}
|
||||
out:
|
||||
wake_up(&wka_port->completion_wq);
|
||||
wake_up(&wka_port->opened);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1650,7 +1650,7 @@ static void zfcp_fsf_close_wka_port_handler(struct zfcp_fsf_req *req)
|
||||
}
|
||||
|
||||
wka_port->status = ZFCP_FC_WKA_PORT_OFFLINE;
|
||||
wake_up(&wka_port->completion_wq);
|
||||
wake_up(&wka_port->closed);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,7 +195,7 @@ static void sg_link_reserve(Sg_fd * sfp, Sg_request * srp, int size);
|
||||
static void sg_unlink_reserve(Sg_fd * sfp, Sg_request * srp);
|
||||
static Sg_fd *sg_add_sfp(Sg_device * sdp);
|
||||
static void sg_remove_sfp(struct kref *);
|
||||
static Sg_request *sg_get_rq_mark(Sg_fd * sfp, int pack_id);
|
||||
static Sg_request *sg_get_rq_mark(Sg_fd * sfp, int pack_id, bool *busy);
|
||||
static Sg_request *sg_add_request(Sg_fd * sfp);
|
||||
static int sg_remove_request(Sg_fd * sfp, Sg_request * srp);
|
||||
static Sg_device *sg_get_dev(int dev);
|
||||
@ -417,6 +417,7 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
|
||||
Sg_fd *sfp;
|
||||
Sg_request *srp;
|
||||
int req_pack_id = -1;
|
||||
bool busy;
|
||||
sg_io_hdr_t *hp;
|
||||
struct sg_header *old_hdr = NULL;
|
||||
int retval = 0;
|
||||
@ -464,25 +465,19 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
|
||||
} else
|
||||
req_pack_id = old_hdr->pack_id;
|
||||
}
|
||||
srp = sg_get_rq_mark(sfp, req_pack_id);
|
||||
srp = sg_get_rq_mark(sfp, req_pack_id, &busy);
|
||||
if (!srp) { /* now wait on packet to arrive */
|
||||
if (atomic_read(&sdp->detaching)) {
|
||||
retval = -ENODEV;
|
||||
goto free_old_hdr;
|
||||
}
|
||||
if (filp->f_flags & O_NONBLOCK) {
|
||||
retval = -EAGAIN;
|
||||
goto free_old_hdr;
|
||||
}
|
||||
retval = wait_event_interruptible(sfp->read_wait,
|
||||
(atomic_read(&sdp->detaching) ||
|
||||
(srp = sg_get_rq_mark(sfp, req_pack_id))));
|
||||
if (atomic_read(&sdp->detaching)) {
|
||||
retval = -ENODEV;
|
||||
goto free_old_hdr;
|
||||
}
|
||||
if (retval) {
|
||||
/* -ERESTARTSYS as signal hit process */
|
||||
((srp = sg_get_rq_mark(sfp, req_pack_id, &busy)) ||
|
||||
(!busy && atomic_read(&sdp->detaching))));
|
||||
if (!srp) {
|
||||
/* signal or detaching */
|
||||
if (!retval)
|
||||
retval = -ENODEV;
|
||||
goto free_old_hdr;
|
||||
}
|
||||
}
|
||||
@ -937,9 +932,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
|
||||
if (result < 0)
|
||||
return result;
|
||||
result = wait_event_interruptible(sfp->read_wait,
|
||||
(srp_done(sfp, srp) || atomic_read(&sdp->detaching)));
|
||||
if (atomic_read(&sdp->detaching))
|
||||
return -ENODEV;
|
||||
srp_done(sfp, srp));
|
||||
write_lock_irq(&sfp->rq_list_lock);
|
||||
if (srp->done) {
|
||||
srp->done = 2;
|
||||
@ -2083,19 +2076,28 @@ sg_unlink_reserve(Sg_fd * sfp, Sg_request * srp)
|
||||
}
|
||||
|
||||
static Sg_request *
|
||||
sg_get_rq_mark(Sg_fd * sfp, int pack_id)
|
||||
sg_get_rq_mark(Sg_fd * sfp, int pack_id, bool *busy)
|
||||
{
|
||||
Sg_request *resp;
|
||||
unsigned long iflags;
|
||||
|
||||
*busy = false;
|
||||
write_lock_irqsave(&sfp->rq_list_lock, iflags);
|
||||
list_for_each_entry(resp, &sfp->rq_list, entry) {
|
||||
/* look for requests that are ready + not SG_IO owned */
|
||||
if ((1 == resp->done) && (!resp->sg_io_owned) &&
|
||||
/* look for requests that are not SG_IO owned */
|
||||
if ((!resp->sg_io_owned) &&
|
||||
((-1 == pack_id) || (resp->header.pack_id == pack_id))) {
|
||||
resp->done = 2; /* guard against other readers */
|
||||
write_unlock_irqrestore(&sfp->rq_list_lock, iflags);
|
||||
return resp;
|
||||
switch (resp->done) {
|
||||
case 0: /* request active */
|
||||
*busy = true;
|
||||
break;
|
||||
case 1: /* request done; response ready to return */
|
||||
resp->done = 2; /* guard against other readers */
|
||||
write_unlock_irqrestore(&sfp->rq_list_lock, iflags);
|
||||
return resp;
|
||||
case 2: /* response already being returned */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
write_unlock_irqrestore(&sfp->rq_list_lock, iflags);
|
||||
@ -2149,6 +2151,15 @@ sg_remove_request(Sg_fd * sfp, Sg_request * srp)
|
||||
res = 1;
|
||||
}
|
||||
write_unlock_irqrestore(&sfp->rq_list_lock, iflags);
|
||||
|
||||
/*
|
||||
* If the device is detaching, wakeup any readers in case we just
|
||||
* removed the last response, which would leave nothing for them to
|
||||
* return other than -ENODEV.
|
||||
*/
|
||||
if (unlikely(atomic_read(&sfp->parentdp->detaching)))
|
||||
wake_up_interruptible_all(&sfp->read_wait);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -4638,10 +4638,10 @@ static int pqi_raid_submit_scsi_cmd_with_io_request(
|
||||
}
|
||||
|
||||
switch (scmd->sc_data_direction) {
|
||||
case DMA_TO_DEVICE:
|
||||
case DMA_FROM_DEVICE:
|
||||
request->data_direction = SOP_READ_FLAG;
|
||||
break;
|
||||
case DMA_FROM_DEVICE:
|
||||
case DMA_TO_DEVICE:
|
||||
request->data_direction = SOP_WRITE_FLAG;
|
||||
break;
|
||||
case DMA_NONE:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user