Merge 4.19.164 into android-4.19-stable

Changes in 4.19.164
	Kbuild: do not emit debug info for assembly with LLVM_IAS=1
	x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S
	spi: bcm2835aux: Fix use-after-free on unbind
	spi: bcm2835aux: Restore err assignment in bcm2835aux_spi_probe
	iwlwifi: pcie: limit memory read spin time
	arm64: dts: rockchip: Assign a fixed index to mmc devices on rk3399 boards.
	iwlwifi: mvm: fix kernel panic in case of assert during CSA
	powerpc: Drop -me200 addition to build flags
	ARC: stack unwinding: don't assume non-current task is sleeping
	scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE
	irqchip/gic-v3-its: Unconditionally save/restore the ITS state on suspend
	soc: fsl: dpio: Get the cpumask through cpumask_of(cpu)
	platform/x86: thinkpad_acpi: Do not report SW_TABLET_MODE on Yoga 11e
	platform/x86: thinkpad_acpi: Add BAT1 is primary battery quirk for Thinkpad Yoga 11e 4th gen
	platform/x86: acer-wmi: add automatic keyboard background light toggle key as KEY_LIGHTS_TOGGLE
	platform/x86: intel-vbtn: Support for tablet mode on HP Pavilion 13 x360 PC
	Input: cm109 - do not stomp on control URB
	Input: i8042 - add Acer laptops to the i8042 reset list
	pinctrl: amd: remove debounce filter setting in IRQ type setting
	mmc: block: Fixup condition for CMD13 polling for RPMB requests
	kbuild: avoid static_assert for genksyms
	scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()"
	x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP
	x86/membarrier: Get rid of a dubious optimization
	x86/apic/vector: Fix ordering in vector assignment
	compiler.h: fix barrier_data() on clang
	PCI: qcom: Add missing reset for ipq806x
	mac80211: mesh: fix mesh_pathtbl_init() error path
	net: stmmac: free tx skb buffer in stmmac_resume()
	tcp: select sane initial rcvq_space.space for big MSS
	tcp: fix cwnd-limited bug for TSO deferral where we send nothing
	net/mlx4_en: Avoid scheduling restart task if it is already running
	lan743x: fix for potential NULL pointer dereference with bare card
	net/mlx4_en: Handle TX error CQE
	net: stmmac: delete the eee_ctrl_timer after napi disabled
	net: stmmac: dwmac-meson8b: fix mask definition of the m250_sel mux
	net: bridge: vlan: fix error return code in __vlan_add()
	ktest.pl: If size of log is too big to email, email error message
	USB: dummy-hcd: Fix uninitialized array use in init()
	USB: add RESET_RESUME quirk for Snapscan 1212
	ALSA: usb-audio: Fix potential out-of-bounds shift
	ALSA: usb-audio: Fix control 'access overflow' errors from chmap
	xhci: Give USB2 ports time to enter U3 in bus suspend
	USB: UAS: introduce a quirk to set no_write_same
	USB: sisusbvga: Make console support depend on BROKEN
	ALSA: pcm: oss: Fix potential out-of-bounds shift
	serial: 8250_omap: Avoid FIFO corruption caused by MDR1 access
	drm/xen-front: Fix misused IS_ERR_OR_NULL checks
	drm: fix drm_dp_mst_port refcount leaks in drm_dp_mst_allocate_vcpi
	arm64: lse: fix LSE atomics with LLVM's integrated assembler
	arm64: lse: Fix LSE atomics with LLVM
	arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S
	x86/resctrl: Remove unused struct mbm_state::chunks_bw
	x86/resctrl: Fix incorrect local bandwidth when mba_sc is enabled
	pinctrl: merrifield: Set default bias in case no particular value given
	pinctrl: baytrail: Avoid clearing debounce value when turning it off
	ARM: dts: sun8i: v3s: fix GIC node memory range
	gpio: mvebu: fix potential user-after-free on probe
	scsi: bnx2i: Requires MMU
	xsk: Fix xsk_poll()'s return type
	can: softing: softing_netdev_open(): fix error handling
	clk: renesas: r9a06g032: Drop __packed for portability
	block: factor out requeue handling from dispatch code
	netfilter: x_tables: Switch synchronization to RCU
	gpio: eic-sprd: break loop when getting NULL device resource
	selftests/bpf/test_offload.py: Reset ethtool features after failed setting
	RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait
	ixgbe: avoid premature Rx buffer reuse
	drm/tegra: replace idr_init() by idr_init_base()
	kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling
	drm/tegra: sor: Disable clocks on error in tegra_sor_init()
	arm64: syscall: exit userspace before unmasking exceptions
	vxlan: Add needed_headroom for lower device
	vxlan: Copy needed_tailroom from lowerdev
	scsi: mpt3sas: Increase IOCInit request timeout to 30s
	dm table: Remove BUG_ON(in_interrupt())
	soc/tegra: fuse: Fix index bug in get_process_id
	USB: serial: option: add interface-number sanity check to flag handling
	USB: gadget: f_acm: add support for SuperSpeed Plus
	USB: gadget: f_midi: setup SuperSpeed Plus descriptors
	usb: gadget: f_fs: Re-use SS descriptors for SuperSpeedPlus
	USB: gadget: f_rndis: fix bitrate for SuperSpeed and above
	usb: chipidea: ci_hdrc_imx: Pass DISABLE_DEVICE_STREAMING flag to imx6ul
	ARM: dts: exynos: fix roles of USB 3.0 ports on Odroid XU
	ARM: dts: exynos: fix USB 3.0 VBUS control and over-current pins on Exynos5410
	ARM: dts: exynos: fix USB 3.0 pins supply being turned off on Odroid XU
	coresight: tmc-etr: Check if page is valid before dma_map_page()
	scsi: megaraid_sas: Check user-provided offsets
	HID: i2c-hid: add Vero K147 to descriptor override
	serial_core: Check for port state when tty is in error state
	Bluetooth: Fix slab-out-of-bounds read in hci_le_direct_adv_report_evt()
	quota: Sanity-check quota file headers on load
	media: msi2500: assign SPI bus number dynamically
	crypto: af_alg - avoid undefined behavior accessing salg_name
	md: fix a warning caused by a race between concurrent md_ioctl()s
	perf cs-etm: Change tuple from traceID-CPU# to traceID-metadata
	perf cs-etm: Move definition of 'traceid_list' global variable from header file
	drm/gma500: fix double free of gma_connector
	drm/tve200: Fix handling of platform_get_irq() error
	soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()
	soc: mediatek: Check if power domains can be powered on at boot time
	soc: qcom: geni: More properly switch to DMA mode
	RDMA/bnxt_re: Set queue pair state when being queried
	selinux: fix error initialization in inode_doinit_with_dentry()
	ARM: dts: aspeed: s2600wf: Fix VGA memory region location
	RDMA/rxe: Compute PSN windows correctly
	x86/mm/ident_map: Check for errors from ident_pud_init()
	ARM: p2v: fix handling of LPAE translation in BE mode
	x86/apic: Fix x2apic enablement without interrupt remapping
	sched/deadline: Fix sched_dl_global_validate()
	sched: Reenable interrupts in do_sched_yield()
	crypto: talitos - Endianess in current_desc_hdr()
	crypto: talitos - Fix return type of current_desc_hdr()
	crypto: inside-secure - Fix sizeof() mismatch
	powerpc/64: Set up a kernel stack for secondaries before cpu_restore()
	spi: img-spfi: fix reference leak in img_spfi_resume
	drm/msm/dsi_pll_10nm: restore VCO rate during restore_state
	ASoC: pcm: DRAIN support reactivation
	selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling
	arm64: dts: exynos: Include common syscon restart/poweroff for Exynos7
	arm64: dts: exynos: Correct psci compatible used on Exynos7
	Bluetooth: Fix null pointer dereference in hci_event_packet()
	Bluetooth: hci_h5: fix memory leak in h5_close
	spi: spi-ti-qspi: fix reference leak in ti_qspi_setup
	spi: tegra20-slink: fix reference leak in slink ops of tegra20
	spi: tegra20-sflash: fix reference leak in tegra_sflash_resume
	spi: tegra114: fix reference leak in tegra spi ops
	spi: bcm63xx-hsspi: fix missing clk_disable_unprepare() on error in bcm63xx_hsspi_resume
	mwifiex: fix mwifiex_shutdown_sw() causing sw reset failure
	ASoC: wm8998: Fix PM disable depth imbalance on error
	ASoC: arizona: Fix a wrong free in wm8997_probe
	RDMa/mthca: Work around -Wenum-conversion warning
	MIPS: BCM47XX: fix kconfig dependency bug for BCM47XX_BCMA
	crypto: qat - fix status check in qat_hal_put_rel_rd_xfer()
	staging: greybus: codecs: Fix reference counter leak in error handling
	staging: gasket: interrupt: fix the missed eventfd_ctx_put() in gasket_interrupt.c
	media: tm6000: Fix sizeof() mismatches
	media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm()
	ASoC: meson: fix COMPILE_TEST error
	scsi: core: Fix VPD LUN ID designator priorities
	media: solo6x10: fix missing snd_card_free in error handling case
	video: fbdev: atmel_lcdfb: fix return error code in atmel_lcdfb_of_init()
	drm/omap: dmm_tiler: fix return error code in omap_dmm_probe()
	Input: ads7846 - fix race that causes missing releases
	Input: ads7846 - fix integer overflow on Rt calculation
	Input: ads7846 - fix unaligned access on 7845
	usb/max3421: fix return error code in max3421_probe()
	spi: mxs: fix reference leak in mxs_spi_probe
	powerpc/feature: Fix CPU_FTRS_ALWAYS by removing CPU_FTRS_GENERIC_32
	crypto: crypto4xx - Replace bitwise OR with logical OR in crypto4xx_build_pd
	crypto: omap-aes - Fix PM disable depth imbalance in omap_aes_probe
	spi: fix resource leak for drivers without .remove callback
	soc: ti: knav_qmss: fix reference leak in knav_queue_probe
	soc: ti: Fix reference imbalance in knav_dma_probe
	drivers: soc: ti: knav_qmss_queue: Fix error return code in knav_queue_probe
	Input: omap4-keypad - fix runtime PM error handling
	RDMA/cxgb4: Validate the number of CQEs
	memstick: fix a double-free bug in memstick_check
	ARM: dts: at91: sama5d4_xplained: add pincontrol for USB Host
	ARM: dts: at91: sama5d3_xplained: add pincontrol for USB Host
	orinoco: Move context allocation after processing the skb
	cw1200: fix missing destroy_workqueue() on error in cw1200_init_common
	dmaengine: mv_xor_v2: Fix error return code in mv_xor_v2_probe()
	media: siano: fix memory leak of debugfs members in smsdvb_hotplug
	platform/x86: mlx-platform: Remove PSU EEPROM from default platform configuration
	platform/x86: mlx-platform: Remove PSU EEPROM from MSN274x platform configuration
	samples: bpf: Fix lwt_len_hist reusing previous BPF map
	mips: cdmm: fix use-after-free in mips_cdmm_bus_discover
	media: max2175: fix max2175_set_csm_mode() error code
	slimbus: qcom-ngd-ctrl: Avoid sending power requests without QMI
	HSI: omap_ssi: Don't jump to free ID in ssi_add_controller()
	ARM: dts: Remove non-existent i2c1 from 98dx3236
	arm64: dts: rockchip: Set dr_mode to "host" for OTG on rk3328-roc-cc
	power: supply: axp288_charger: Fix HP Pavilion x2 10 DMI matching
	power: supply: bq24190_charger: fix reference leak
	genirq/irqdomain: Don't try to free an interrupt that has no mapping
	PCI: Bounds-check command-line resource alignment requests
	PCI: Fix overflow in command-line resource alignment requests
	PCI: iproc: Fix out-of-bound array accesses
	arm64: dts: meson: fix spi-max-frequency on Khadas VIM2
	ARM: dts: at91: at91sam9rl: fix ADC triggers
	platform/x86: dell-smbios-base: Fix error return code in dell_smbios_init
	ath10k: Fix the parsing error in service available event
	ath10k: Fix an error handling path
	ath10k: Release some resources in an error handling path
	NFSv4.2: condition READDIR's mask for security label based on LSM state
	SUNRPC: xprt_load_transport() needs to support the netid "rdma6"
	lockd: don't use interval-based rebinding over TCP
	NFS: switch nfsiod to be an UNBOUND workqueue.
	vfio-pci: Use io_remap_pfn_range() for PCI IO memory
	media: saa7146: fix array overflow in vidioc_s_audio()
	clocksource/drivers/cadence_ttc: Fix memory leak in ttc_setup_clockevent()
	ARM: dts: at91: sama5d2: map securam as device
	pinctrl: falcon: add missing put_device() call in pinctrl_falcon_probe()
	arm64: dts: rockchip: Fix UART pull-ups on rk3328
	memstick: r592: Fix error return in r592_probe()
	net/mlx5: Properly convey driver version to firmware
	ASoC: jz4740-i2s: add missed checks for clk_get()
	dm ioctl: fix error return code in target_message
	clocksource/drivers/arm_arch_timer: Correct fault programming of CNTKCTL_EL1.EVNTI
	cpufreq: highbank: Add missing MODULE_DEVICE_TABLE
	cpufreq: mediatek: Add missing MODULE_DEVICE_TABLE
	cpufreq: st: Add missing MODULE_DEVICE_TABLE
	cpufreq: loongson1: Add missing MODULE_ALIAS
	cpufreq: scpi: Add missing MODULE_ALIAS
	scsi: qedi: Fix missing destroy_workqueue() on error in __qedi_probe
	scsi: pm80xx: Fix error return in pm8001_pci_probe()
	seq_buf: Avoid type mismatch for seq_buf_init
	scsi: fnic: Fix error return code in fnic_probe()
	platform/x86: mlx-platform: Fix item counter assignment for MSN2700, MSN24xx systems
	powerpc/pseries/hibernation: drop pseries_suspend_begin() from suspend ops
	powerpc/pseries/hibernation: remove redundant cacheinfo update
	usb: ehci-omap: Fix PM disable depth umbalance in ehci_hcd_omap_probe
	usb: oxu210hp-hcd: Fix memory leak in oxu_create
	speakup: fix uninitialized flush_lock
	nfsd: Fix message level for normal termination
	nfs_common: need lock during iterate through the list
	x86/kprobes: Restore BTF if the single-stepping is cancelled
	bus: fsl-mc: fix error return code in fsl_mc_object_allocate()
	clk: tegra: Fix duplicated SE clock entry
	extcon: max77693: Fix modalias string
	mac80211: don't set set TDLS STA bandwidth wider than possible
	ASoC: wm_adsp: remove "ctl" from list on error in wm_adsp_create_control()
	irqchip/alpine-msi: Fix freeing of interrupts on allocation error path
	watchdog: sirfsoc: Add missing dependency on HAS_IOMEM
	watchdog: sprd: remove watchdog disable from resume fail path
	watchdog: sprd: check busy bit before new loading rather than after that
	watchdog: Fix potential dereferencing of null pointer
	um: Monitor error events in IRQ controller
	um: tty: Fix handling of close in tty lines
	um: chan_xterm: Fix fd leak
	nfc: s3fwrn5: Release the nfc firmware
	powerpc/ps3: use dma_mapping_error()
	checkpatch: fix unescaped left brace
	net: bcmgenet: Fix a resource leak in an error handling path in the probe functin
	net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function
	net: korina: fix return value
	libnvdimm/label: Return -ENXIO for no slot in __blk_label_update
	watchdog: qcom: Avoid context switch in restart handler
	watchdog: coh901327: add COMMON_CLK dependency
	clk: ti: Fix memleak in ti_fapll_synth_setup
	pwm: zx: Add missing cleanup in error path
	pwm: lp3943: Dynamically allocate PWM chip base
	perf record: Fix memory leak when using '--user-regs=?' to list registers
	qlcnic: Fix error code in probe
	clk: s2mps11: Fix a resource leak in error handling paths in the probe function
	clk: sunxi-ng: Make sure divider tables have sentinel
	kconfig: fix return value of do_error_if()
	ARM: sunxi: Add machine match for the Allwinner V3 SoC
	cfg80211: initialize rekey_data
	fix namespaced fscaps when !CONFIG_SECURITY
	lwt: Disable BH too in run_lwt_bpf()
	Input: cros_ec_keyb - send 'scancodes' in addition to key events
	Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
	media: gspca: Fix memory leak in probe
	media: sunxi-cir: ensure IR is handled when it is continuous
	media: netup_unidvb: Don't leak SPI master in probe error path
	media: ipu3-cio2: Remove traces of returned buffers
	media: ipu3-cio2: Return actual subdev format
	media: ipu3-cio2: Serialise access to pad format
	media: ipu3-cio2: Validate mbus format in setting subdev format
	media: ipu3-cio2: Make the field on subdev format V4L2_FIELD_NONE
	Input: cyapa_gen6 - fix out-of-bounds stack access
	ALSA: hda/ca0132 - Change Input Source enum strings.
	PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup()
	Revert "ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks"
	ACPI: PNP: compare the string length in the matching_id()
	ALSA: hda: Fix regressions on clear and reconfig sysfs
	ALSA: hda/realtek - Enable headset mic of ASUS X430UN with ALC256
	ALSA: hda/realtek - Enable headset mic of ASUS Q524UQK with ALC255
	ALSA: pcm: oss: Fix a few more UBSAN fixes
	ALSA: hda/realtek: Add quirk for MSI-GP73
	ALSA: hda/realtek: Apply jack fixup for Quanta NL3
	ALSA: usb-audio: Add VID to support native DSD reproduction on FiiO devices
	ALSA: usb-audio: Disable sample read check if firmware doesn't give back
	s390/smp: perform initial CPU reset also for SMT siblings
	s390/kexec_file: fix diag308 subcode when loading crash kernel
	s390/dasd: fix hanging device offline processing
	s390/dasd: prevent inconsistent LCU device data
	s390/dasd: fix list corruption of pavgroup group list
	s390/dasd: fix list corruption of lcu list
	staging: comedi: mf6x4: Fix AI end-of-conversion detection
	powerpc/perf: Exclude kernel samples while counting events in user space.
	crypto: ecdh - avoid unaligned accesses in ecdh_set_secret()
	EDAC/amd64: Fix PCI component registration
	USB: serial: mos7720: fix parallel-port state restore
	USB: serial: digi_acceleport: fix write-wakeup deadlocks
	USB: serial: keyspan_pda: fix dropped unthrottle interrupts
	USB: serial: keyspan_pda: fix write deadlock
	USB: serial: keyspan_pda: fix stalled writes
	USB: serial: keyspan_pda: fix write-wakeup use-after-free
	USB: serial: keyspan_pda: fix tx-unthrottle use-after-free
	USB: serial: keyspan_pda: fix write unthrottling
	ext4: fix a memory leak of ext4_free_data
	ext4: fix deadlock with fs freezing and EA inodes
	KVM: arm64: Introduce handling of AArch32 TTBCR2 traps
	ARM: dts: pandaboard: fix pinmux for gpio user button of Pandaboard ES
	ARM: dts: at91: sama5d2: fix CAN message ram offset and size
	powerpc: Fix incorrect stw{, ux, u, x} instructions in __set_pte_at
	powerpc/rtas: Fix typo of ibm,open-errinjct in RTAS filter
	powerpc/xmon: Change printk() to pr_cont()
	powerpc/powernv/memtrace: Don't leak kernel memory to user space
	powerpc/powernv/memtrace: Fix crashing the kernel when enabling concurrently
	ima: Don't modify file descriptor mode on the fly
	ceph: fix race in concurrent __ceph_remove_cap invocations
	SMB3: avoid confusing warning message on mount to Azure
	SMB3.1.1: do not log warning message if server doesn't populate salt
	ubifs: wbuf: Don't leak kernel memory to flash
	jffs2: Fix GC exit abnormally
	jfs: Fix array index bounds check in dbAdjTree
	drm/dp_aux_dev: check aux_dev before use in drm_dp_aux_dev_get_by_minor()
	spi: spi-sh: Fix use-after-free on unbind
	spi: davinci: Fix use-after-free on unbind
	spi: pic32: Don't leak DMA channels in probe error path
	spi: rb4xx: Don't leak SPI master in probe error path
	spi: sc18is602: Don't leak SPI master in probe error path
	spi: st-ssc4: Fix unbalanced pm_runtime_disable() in probe error path
	spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
	soc: qcom: smp2p: Safely acquire spinlock without IRQs
	mtd: spinand: Fix OOB read
	mtd: parser: cmdline: Fix parsing of part-names with colons
	mtd: rawnand: qcom: Fix DMA sync on FLASH_STATUS register read
	scsi: lpfc: Fix invalid sleeping context in lpfc_sli4_nvmet_alloc()
	scsi: lpfc: Re-fix use after free in lpfc_rq_buf_free()
	iio: buffer: Fix demux update
	iio: adc: rockchip_saradc: fix missing clk_disable_unprepare() on error in rockchip_saradc_resume
	iio:light:rpr0521: Fix timestamp alignment and prevent data leak.
	iio:light:st_uvis25: Fix timestamp alignment and prevent data leak.
	iio:pressure:mpl3115: Force alignment of buffer
	iio:imu:bmi160: Fix too large a buffer.
	md/cluster: block reshape with remote resync job
	md/cluster: fix deadlock when node is doing resync job
	pinctrl: sunxi: Always call chained_irq_{enter, exit} in sunxi_pinctrl_irq_handler
	clk: mvebu: a3700: fix the XTAL MODE pin to MPP1_9
	xen-blkback: set ring->xenblkd to NULL after kthread_stop()
	xen/xenbus: Allow watches discard events before queueing
	xen/xenbus: Add 'will_handle' callback support in xenbus_watch_path()
	xen/xenbus/xen_bus_type: Support will_handle watch callback
	xen/xenbus: Count pending messages for each watch
	xenbus/xenbus_backend: Disallow pending watch messages
	libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels
	platform/x86: intel-vbtn: Allow switch events on Acer Switch Alpha 12
	PCI: Fix pci_slot_release() NULL pointer dereference
	platform/x86: mlx-platform: remove an unused variable
	Linux 4.19.164

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8e2d24b45393ee2360186893d4e578e20156c7f1
This commit is contained in:
Greg Kroah-Hartman
2020-12-30 12:19:31 +01:00
351 changed files with 2083 additions and 1111 deletions

View File

@@ -5023,6 +5023,7 @@
device); device);
j = NO_REPORT_LUNS (don't use report luns j = NO_REPORT_LUNS (don't use report luns
command, uas only); command, uas only);
k = NO_SAME (do not use WRITE_SAME, uas only)
l = NOT_LOCKABLE (don't try to lock and l = NOT_LOCKABLE (don't try to lock and
unlock ejectable media, not on uas); unlock ejectable media, not on uas);
m = MAX_SECTORS_64 (don't transfer more m = MAX_SECTORS_64 (don't transfer more

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 4 VERSION = 4
PATCHLEVEL = 19 PATCHLEVEL = 19
SUBLEVEL = 163 SUBLEVEL = 164
EXTRAVERSION = EXTRAVERSION =
NAME = "People's Front" NAME = "People's Front"
@@ -779,6 +779,7 @@ ifneq ($(LLVM_IAS),1)
KBUILD_AFLAGS += -Wa,-gdwarf-2 KBUILD_AFLAGS += -Wa,-gdwarf-2
endif endif
endif endif
ifdef CONFIG_DEBUG_INFO_DWARF4 ifdef CONFIG_DEBUG_INFO_DWARF4
KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,) KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,)
endif endif

View File

@@ -41,15 +41,15 @@
#ifdef CONFIG_ARC_DW2_UNWIND #ifdef CONFIG_ARC_DW2_UNWIND
static void seed_unwind_frame_info(struct task_struct *tsk, static int
struct pt_regs *regs, seed_unwind_frame_info(struct task_struct *tsk, struct pt_regs *regs,
struct unwind_frame_info *frame_info) struct unwind_frame_info *frame_info)
{ {
/* /*
* synchronous unwinding (e.g. dump_stack) * synchronous unwinding (e.g. dump_stack)
* - uses current values of SP and friends * - uses current values of SP and friends
*/ */
if (tsk == NULL && regs == NULL) { if (regs == NULL && (tsk == NULL || tsk == current)) {
unsigned long fp, sp, blink, ret; unsigned long fp, sp, blink, ret;
frame_info->task = current; frame_info->task = current;
@@ -68,11 +68,15 @@ static void seed_unwind_frame_info(struct task_struct *tsk,
frame_info->call_frame = 0; frame_info->call_frame = 0;
} else if (regs == NULL) { } else if (regs == NULL) {
/* /*
* Asynchronous unwinding of sleeping task * Asynchronous unwinding of a likely sleeping task
* - Gets SP etc from task's pt_regs (saved bottom of kernel * - first ensure it is actually sleeping
* mode stack of task) * - if so, it will be in __switch_to, kernel mode SP of task
* is safe-kept and BLINK at a well known location in there
*/ */
if (tsk->state == TASK_RUNNING)
return -1;
frame_info->task = tsk; frame_info->task = tsk;
frame_info->regs.r27 = TSK_K_FP(tsk); frame_info->regs.r27 = TSK_K_FP(tsk);
@@ -106,6 +110,8 @@ static void seed_unwind_frame_info(struct task_struct *tsk,
frame_info->regs.r63 = regs->ret; frame_info->regs.r63 = regs->ret;
frame_info->call_frame = 0; frame_info->call_frame = 0;
} }
return 0;
} }
#endif #endif
@@ -119,7 +125,8 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs,
unsigned int address; unsigned int address;
struct unwind_frame_info frame_info; struct unwind_frame_info frame_info;
seed_unwind_frame_info(tsk, regs, &frame_info); if (seed_unwind_frame_info(tsk, regs, &frame_info))
return 0;
while (1) { while (1) {
address = UNW_PC(&frame_info); address = UNW_PC(&frame_info);

View File

@@ -266,11 +266,6 @@
reg = <0x11000 0x100>; reg = <0x11000 0x100>;
}; };
&i2c1 {
compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
reg = <0x11100 0x100>;
};
&mpic { &mpic {
reg = <0x20a00 0x2d0>, <0x21070 0x58>; reg = <0x20a00 0x2d0>, <0x21070 0x58>;
}; };

View File

@@ -22,9 +22,9 @@
#size-cells = <1>; #size-cells = <1>;
ranges; ranges;
vga_memory: framebuffer@7f000000 { vga_memory: framebuffer@9f000000 {
no-map; no-map;
reg = <0x7f000000 0x01000000>; reg = <0x9f000000 0x01000000>; /* 16M */
}; };
}; };

View File

@@ -243,6 +243,11 @@
atmel,pins = atmel,pins =
<AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */ <AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */
}; };
pinctrl_usb_default: usb_default {
atmel,pins =
<AT91_PIOE 3 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
AT91_PIOE 4 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
};
}; };
}; };
}; };
@@ -260,6 +265,8 @@
&pioE 3 GPIO_ACTIVE_LOW &pioE 3 GPIO_ACTIVE_LOW
&pioE 4 GPIO_ACTIVE_LOW &pioE 4 GPIO_ACTIVE_LOW
>; >;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_default>;
status = "okay"; status = "okay";
}; };

View File

@@ -170,6 +170,11 @@
atmel,pins = atmel,pins =
<AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; <AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
}; };
pinctrl_usb_default: usb_default {
atmel,pins =
<AT91_PIOE 11 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
AT91_PIOE 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
};
pinctrl_key_gpio: key_gpio_0 { pinctrl_key_gpio: key_gpio_0 {
atmel,pins = atmel,pins =
<AT91_PIOE 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; <AT91_PIOE 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
@@ -195,6 +200,8 @@
&pioE 11 GPIO_ACTIVE_HIGH &pioE 11 GPIO_ACTIVE_HIGH
&pioE 14 GPIO_ACTIVE_HIGH &pioE 14 GPIO_ACTIVE_HIGH
>; >;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usb_default>;
status = "okay"; status = "okay";
}; };

View File

@@ -277,23 +277,26 @@
atmel,adc-use-res = "highres"; atmel,adc-use-res = "highres";
trigger0 { trigger0 {
trigger-name = "timer-counter-0"; trigger-name = "external-rising";
trigger-value = <0x1>; trigger-value = <0x1>;
trigger-external;
}; };
trigger1 { trigger1 {
trigger-name = "timer-counter-1"; trigger-name = "external-falling";
trigger-value = <0x3>; trigger-value = <0x2>;
trigger-external;
}; };
trigger2 { trigger2 {
trigger-name = "timer-counter-2"; trigger-name = "external-any";
trigger-value = <0x5>; trigger-value = <0x3>;
trigger-external;
}; };
trigger3 { trigger3 {
trigger-name = "external"; trigger-name = "continuous";
trigger-value = <0x13>; trigger-value = <0x6>;
trigger-external;
}; };
}; };

View File

@@ -324,6 +324,8 @@
regulator-name = "vddq_lcd"; regulator-name = "vddq_lcd";
regulator-min-microvolt = <1800000>; regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>; regulator-max-microvolt = <1800000>;
/* Supplies also GPK and GPJ */
regulator-always-on;
}; };
ldo8_reg: LDO8 { ldo8_reg: LDO8 {
@@ -626,11 +628,11 @@
}; };
&usbdrd_dwc3_0 { &usbdrd_dwc3_0 {
dr_mode = "host"; dr_mode = "peripheral";
}; };
&usbdrd_dwc3_1 { &usbdrd_dwc3_1 {
dr_mode = "peripheral"; dr_mode = "host";
}; };
&usbdrd3_0 { &usbdrd3_0 {

View File

@@ -560,6 +560,34 @@
interrupt-controller; interrupt-controller;
#interrupt-cells = <2>; #interrupt-cells = <2>;
}; };
usb3_1_oc: usb3-1-oc {
samsung,pins = "gpk2-4", "gpk2-5";
samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
};
usb3_1_vbusctrl: usb3-1-vbusctrl {
samsung,pins = "gpk2-6", "gpk2-7";
samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
};
usb3_0_oc: usb3-0-oc {
samsung,pins = "gpk3-0", "gpk3-1";
samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
};
usb3_0_vbusctrl: usb3-0-vbusctrl {
samsung,pins = "gpk3-2", "gpk3-3";
samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
};
}; };
&pinctrl_2 { &pinctrl_2 {

View File

@@ -392,6 +392,8 @@
&usbdrd3_0 { &usbdrd3_0 {
clocks = <&clock CLK_USBD300>; clocks = <&clock CLK_USBD300>;
clock-names = "usbdrd30"; clock-names = "usbdrd30";
pinctrl-names = "default";
pinctrl-0 = <&usb3_0_oc>, <&usb3_0_vbusctrl>;
}; };
&usbdrd_phy0 { &usbdrd_phy0 {
@@ -403,6 +405,8 @@
&usbdrd3_1 { &usbdrd3_1 {
clocks = <&clock CLK_USBD301>; clocks = <&clock CLK_USBD301>;
clock-names = "usbdrd30"; clock-names = "usbdrd30";
pinctrl-names = "default";
pinctrl-0 = <&usb3_1_oc>, <&usb3_1_vbusctrl>;
}; };
&usbdrd_dwc3_1 { &usbdrd_dwc3_1 {

View File

@@ -49,7 +49,7 @@
button_pins: pinmux_button_pins { button_pins: pinmux_button_pins {
pinctrl-single,pins = < pinctrl-single,pins = <
OMAP4_IOPAD(0x11b, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio_113 */ OMAP4_IOPAD(0x0fc, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio_113 */
>; >;
}; };
}; };

View File

@@ -1247,6 +1247,7 @@
clocks = <&securam_clk>; clocks = <&securam_clk>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
no-memory-wc;
ranges = <0 0xf8044000 0x1420>; ranges = <0 0xf8044000 0x1420>;
}; };
@@ -1297,7 +1298,7 @@
can0: can@f8054000 { can0: can@f8054000 {
compatible = "bosch,m_can"; compatible = "bosch,m_can";
reg = <0xf8054000 0x4000>, <0x210000 0x4000>; reg = <0xf8054000 0x4000>, <0x210000 0x1c00>;
reg-names = "m_can", "message_ram"; reg-names = "m_can", "message_ram";
interrupts = <56 IRQ_TYPE_LEVEL_HIGH 7>, interrupts = <56 IRQ_TYPE_LEVEL_HIGH 7>,
<64 IRQ_TYPE_LEVEL_HIGH 7>; <64 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -1490,7 +1491,7 @@
can1: can@fc050000 { can1: can@fc050000 {
compatible = "bosch,m_can"; compatible = "bosch,m_can";
reg = <0xfc050000 0x4000>, <0x210000 0x4000>; reg = <0xfc050000 0x4000>, <0x210000 0x3800>;
reg-names = "m_can", "message_ram"; reg-names = "m_can", "message_ram";
interrupts = <57 IRQ_TYPE_LEVEL_HIGH 7>, interrupts = <57 IRQ_TYPE_LEVEL_HIGH 7>,
<65 IRQ_TYPE_LEVEL_HIGH 7>; <65 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -1500,7 +1501,7 @@
assigned-clocks = <&can1_gclk>; assigned-clocks = <&can1_gclk>;
assigned-clock-parents = <&utmi>; assigned-clock-parents = <&utmi>;
assigned-clock-rates = <40000000>; assigned-clock-rates = <40000000>;
bosch,mram-cfg = <0x1100 0 0 64 0 0 32 32>; bosch,mram-cfg = <0x1c00 0 0 64 0 0 32 32>;
status = "disabled"; status = "disabled";
}; };

View File

@@ -419,7 +419,7 @@
gic: interrupt-controller@1c81000 { gic: interrupt-controller@1c81000 {
compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
reg = <0x01c81000 0x1000>, reg = <0x01c81000 0x1000>,
<0x01c82000 0x1000>, <0x01c82000 0x2000>,
<0x01c84000 0x2000>, <0x01c84000 0x2000>,
<0x01c86000 0x2000>; <0x01c86000 0x2000>;
interrupt-controller; interrupt-controller;

View File

@@ -674,12 +674,8 @@ ARM_BE8(rev16 ip, ip)
ldrcc r7, [r4], #4 @ use branch for delay slot ldrcc r7, [r4], #4 @ use branch for delay slot
bcc 1b bcc 1b
bx lr bx lr
#else
#ifdef CONFIG_CPU_ENDIAN_BE8
moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction
#else #else
moveq r0, #0x400000 @ set bit 22, mov to mvn instruction moveq r0, #0x400000 @ set bit 22, mov to mvn instruction
#endif
b 2f b 2f
1: ldr ip, [r7, r3] 1: ldr ip, [r7, r3]
#ifdef CONFIG_CPU_ENDIAN_BE8 #ifdef CONFIG_CPU_ENDIAN_BE8
@@ -688,7 +684,7 @@ ARM_BE8(rev16 ip, ip)
tst ip, #0x000f0000 @ check the rotation field tst ip, #0x000f0000 @ check the rotation field
orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24
biceq ip, ip, #0x00004000 @ clear bit 22 biceq ip, ip, #0x00004000 @ clear bit 22
orreq ip, ip, r0 @ mask in offset bits 7-0 orreq ip, ip, r0, ror #8 @ mask in offset bits 7-0
#else #else
bic ip, ip, #0x000000ff bic ip, ip, #0x000000ff
tst ip, #0xf00 @ check the rotation field tst ip, #0xf00 @ check the rotation field

View File

@@ -330,6 +330,7 @@ static int __init rmobile_init_pm_domains(void)
pmd = of_get_child_by_name(np, "pm-domains"); pmd = of_get_child_by_name(np, "pm-domains");
if (!pmd) { if (!pmd) {
iounmap(base);
pr_warn("%pOF lacks pm-domains node\n", np); pr_warn("%pOF lacks pm-domains node\n", np);
continue; continue;
} }

View File

@@ -66,6 +66,7 @@ static const char * const sun8i_board_dt_compat[] = {
"allwinner,sun8i-h2-plus", "allwinner,sun8i-h2-plus",
"allwinner,sun8i-h3", "allwinner,sun8i-h3",
"allwinner,sun8i-r40", "allwinner,sun8i-r40",
"allwinner,sun8i-v3",
"allwinner,sun8i-v3s", "allwinner,sun8i-v3s",
NULL, NULL,
}; };

View File

@@ -399,7 +399,7 @@
#size-cells = <1>; #size-cells = <1>;
compatible = "winbond,w25q16", "jedec,spi-nor"; compatible = "winbond,w25q16", "jedec,spi-nor";
reg = <0>; reg = <0>;
spi-max-frequency = <3000000>; spi-max-frequency = <104000000>;
}; };
}; };

View File

@@ -62,8 +62,10 @@
}; };
psci { psci {
compatible = "arm,psci-0.2"; compatible = "arm,psci";
method = "smc"; method = "smc";
cpu_off = <0x84000002>;
cpu_on = <0xC4000003>;
}; };
soc: soc { soc: soc {
@@ -494,13 +496,6 @@
pmu_system_controller: system-controller@105c0000 { pmu_system_controller: system-controller@105c0000 {
compatible = "samsung,exynos7-pmu", "syscon"; compatible = "samsung,exynos7-pmu", "syscon";
reg = <0x105c0000 0x5000>; reg = <0x105c0000 0x5000>;
reboot: syscon-reboot {
compatible = "syscon-reboot";
regmap = <&pmu_system_controller>;
offset = <0x0400>;
mask = <0x1>;
};
}; };
rtc: rtc@10590000 { rtc: rtc@10590000 {
@@ -638,3 +633,4 @@
}; };
#include "exynos7-pinctrl.dtsi" #include "exynos7-pinctrl.dtsi"
#include "arm/exynos-syscon-restart.dtsi"

View File

@@ -255,6 +255,7 @@
}; };
&usb20_otg { &usb20_otg {
dr_mode = "host";
status = "okay"; status = "okay";
}; };

View File

@@ -1085,8 +1085,8 @@
uart0 { uart0 {
uart0_xfer: uart0-xfer { uart0_xfer: uart0-xfer {
rockchip,pins = <1 RK_PB1 1 &pcfg_pull_up>, rockchip,pins = <1 RK_PB1 1 &pcfg_pull_none>,
<1 RK_PB0 1 &pcfg_pull_none>; <1 RK_PB0 1 &pcfg_pull_up>;
}; };
uart0_cts: uart0-cts { uart0_cts: uart0-cts {
@@ -1104,8 +1104,8 @@
uart1 { uart1 {
uart1_xfer: uart1-xfer { uart1_xfer: uart1-xfer {
rockchip,pins = <3 RK_PA4 4 &pcfg_pull_up>, rockchip,pins = <3 RK_PA4 4 &pcfg_pull_none>,
<3 RK_PA6 4 &pcfg_pull_none>; <3 RK_PA6 4 &pcfg_pull_up>;
}; };
uart1_cts: uart1-cts { uart1_cts: uart1-cts {
@@ -1123,15 +1123,15 @@
uart2-0 { uart2-0 {
uart2m0_xfer: uart2m0-xfer { uart2m0_xfer: uart2m0-xfer {
rockchip,pins = <1 RK_PA0 2 &pcfg_pull_up>, rockchip,pins = <1 RK_PA0 2 &pcfg_pull_none>,
<1 RK_PA1 2 &pcfg_pull_none>; <1 RK_PA1 2 &pcfg_pull_up>;
}; };
}; };
uart2-1 { uart2-1 {
uart2m1_xfer: uart2m1-xfer { uart2m1_xfer: uart2m1-xfer {
rockchip,pins = <2 RK_PA0 1 &pcfg_pull_up>, rockchip,pins = <2 RK_PA0 1 &pcfg_pull_none>,
<2 RK_PA1 1 &pcfg_pull_none>; <2 RK_PA1 1 &pcfg_pull_up>;
}; };
}; };

View File

@@ -29,6 +29,9 @@
i2c6 = &i2c6; i2c6 = &i2c6;
i2c7 = &i2c7; i2c7 = &i2c7;
i2c8 = &i2c8; i2c8 = &i2c8;
mmc0 = &sdio0;
mmc1 = &sdmmc;
mmc2 = &sdhci;
serial0 = &uart0; serial0 = &uart0;
serial1 = &uart1; serial1 = &uart1;
serial2 = &uart2; serial2 = &uart2;

View File

@@ -32,7 +32,9 @@ static inline void atomic_##op(int i, atomic_t *v) \
register int w0 asm ("w0") = i; \ register int w0 asm ("w0") = i; \
register atomic_t *x1 asm ("x1") = v; \ register atomic_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN(__LL_SC_ATOMIC(op), \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN(__LL_SC_ATOMIC(op), \
" " #asm_op " %w[i], %[v]\n") \ " " #asm_op " %w[i], %[v]\n") \
: [i] "+r" (w0), [v] "+Q" (v->counter) \ : [i] "+r" (w0), [v] "+Q" (v->counter) \
: "r" (x1) \ : "r" (x1) \
@@ -52,7 +54,9 @@ static inline int atomic_fetch_##op##name(int i, atomic_t *v) \
register int w0 asm ("w0") = i; \ register int w0 asm ("w0") = i; \
register atomic_t *x1 asm ("x1") = v; \ register atomic_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC(fetch_##op##name), \ __LL_SC_ATOMIC(fetch_##op##name), \
/* LSE atomics */ \ /* LSE atomics */ \
@@ -84,7 +88,9 @@ static inline int atomic_add_return##name(int i, atomic_t *v) \
register int w0 asm ("w0") = i; \ register int w0 asm ("w0") = i; \
register atomic_t *x1 asm ("x1") = v; \ register atomic_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC(add_return##name) \ __LL_SC_ATOMIC(add_return##name) \
__nops(1), \ __nops(1), \
@@ -110,7 +116,9 @@ static inline void atomic_and(int i, atomic_t *v)
register int w0 asm ("w0") = i; register int w0 asm ("w0") = i;
register atomic_t *x1 asm ("x1") = v; register atomic_t *x1 asm ("x1") = v;
asm volatile(ARM64_LSE_ATOMIC_INSN( asm volatile(
__LSE_PREAMBLE
ARM64_LSE_ATOMIC_INSN(
/* LL/SC */ /* LL/SC */
__LL_SC_ATOMIC(and) __LL_SC_ATOMIC(and)
__nops(1), __nops(1),
@@ -128,7 +136,9 @@ static inline int atomic_fetch_and##name(int i, atomic_t *v) \
register int w0 asm ("w0") = i; \ register int w0 asm ("w0") = i; \
register atomic_t *x1 asm ("x1") = v; \ register atomic_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC(fetch_and##name) \ __LL_SC_ATOMIC(fetch_and##name) \
__nops(1), \ __nops(1), \
@@ -154,7 +164,9 @@ static inline void atomic_sub(int i, atomic_t *v)
register int w0 asm ("w0") = i; register int w0 asm ("w0") = i;
register atomic_t *x1 asm ("x1") = v; register atomic_t *x1 asm ("x1") = v;
asm volatile(ARM64_LSE_ATOMIC_INSN( asm volatile(
__LSE_PREAMBLE
ARM64_LSE_ATOMIC_INSN(
/* LL/SC */ /* LL/SC */
__LL_SC_ATOMIC(sub) __LL_SC_ATOMIC(sub)
__nops(1), __nops(1),
@@ -172,7 +184,9 @@ static inline int atomic_sub_return##name(int i, atomic_t *v) \
register int w0 asm ("w0") = i; \ register int w0 asm ("w0") = i; \
register atomic_t *x1 asm ("x1") = v; \ register atomic_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC(sub_return##name) \ __LL_SC_ATOMIC(sub_return##name) \
__nops(2), \ __nops(2), \
@@ -200,7 +214,9 @@ static inline int atomic_fetch_sub##name(int i, atomic_t *v) \
register int w0 asm ("w0") = i; \ register int w0 asm ("w0") = i; \
register atomic_t *x1 asm ("x1") = v; \ register atomic_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC(fetch_sub##name) \ __LL_SC_ATOMIC(fetch_sub##name) \
__nops(1), \ __nops(1), \
@@ -229,7 +245,9 @@ static inline void atomic64_##op(long i, atomic64_t *v) \
register long x0 asm ("x0") = i; \ register long x0 asm ("x0") = i; \
register atomic64_t *x1 asm ("x1") = v; \ register atomic64_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN(__LL_SC_ATOMIC64(op), \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN(__LL_SC_ATOMIC64(op), \
" " #asm_op " %[i], %[v]\n") \ " " #asm_op " %[i], %[v]\n") \
: [i] "+r" (x0), [v] "+Q" (v->counter) \ : [i] "+r" (x0), [v] "+Q" (v->counter) \
: "r" (x1) \ : "r" (x1) \
@@ -249,7 +267,9 @@ static inline long atomic64_fetch_##op##name(long i, atomic64_t *v) \
register long x0 asm ("x0") = i; \ register long x0 asm ("x0") = i; \
register atomic64_t *x1 asm ("x1") = v; \ register atomic64_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC64(fetch_##op##name), \ __LL_SC_ATOMIC64(fetch_##op##name), \
/* LSE atomics */ \ /* LSE atomics */ \
@@ -281,7 +301,9 @@ static inline long atomic64_add_return##name(long i, atomic64_t *v) \
register long x0 asm ("x0") = i; \ register long x0 asm ("x0") = i; \
register atomic64_t *x1 asm ("x1") = v; \ register atomic64_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC64(add_return##name) \ __LL_SC_ATOMIC64(add_return##name) \
__nops(1), \ __nops(1), \
@@ -307,7 +329,9 @@ static inline void atomic64_and(long i, atomic64_t *v)
register long x0 asm ("x0") = i; register long x0 asm ("x0") = i;
register atomic64_t *x1 asm ("x1") = v; register atomic64_t *x1 asm ("x1") = v;
asm volatile(ARM64_LSE_ATOMIC_INSN( asm volatile(
__LSE_PREAMBLE
ARM64_LSE_ATOMIC_INSN(
/* LL/SC */ /* LL/SC */
__LL_SC_ATOMIC64(and) __LL_SC_ATOMIC64(and)
__nops(1), __nops(1),
@@ -325,7 +349,9 @@ static inline long atomic64_fetch_and##name(long i, atomic64_t *v) \
register long x0 asm ("x0") = i; \ register long x0 asm ("x0") = i; \
register atomic64_t *x1 asm ("x1") = v; \ register atomic64_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC64(fetch_and##name) \ __LL_SC_ATOMIC64(fetch_and##name) \
__nops(1), \ __nops(1), \
@@ -351,7 +377,9 @@ static inline void atomic64_sub(long i, atomic64_t *v)
register long x0 asm ("x0") = i; register long x0 asm ("x0") = i;
register atomic64_t *x1 asm ("x1") = v; register atomic64_t *x1 asm ("x1") = v;
asm volatile(ARM64_LSE_ATOMIC_INSN( asm volatile(
__LSE_PREAMBLE
ARM64_LSE_ATOMIC_INSN(
/* LL/SC */ /* LL/SC */
__LL_SC_ATOMIC64(sub) __LL_SC_ATOMIC64(sub)
__nops(1), __nops(1),
@@ -369,7 +397,9 @@ static inline long atomic64_sub_return##name(long i, atomic64_t *v) \
register long x0 asm ("x0") = i; \ register long x0 asm ("x0") = i; \
register atomic64_t *x1 asm ("x1") = v; \ register atomic64_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC64(sub_return##name) \ __LL_SC_ATOMIC64(sub_return##name) \
__nops(2), \ __nops(2), \
@@ -397,7 +427,9 @@ static inline long atomic64_fetch_sub##name(long i, atomic64_t *v) \
register long x0 asm ("x0") = i; \ register long x0 asm ("x0") = i; \
register atomic64_t *x1 asm ("x1") = v; \ register atomic64_t *x1 asm ("x1") = v; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_ATOMIC64(fetch_sub##name) \ __LL_SC_ATOMIC64(fetch_sub##name) \
__nops(1), \ __nops(1), \
@@ -422,7 +454,9 @@ static inline long atomic64_dec_if_positive(atomic64_t *v)
{ {
register long x0 asm ("x0") = (long)v; register long x0 asm ("x0") = (long)v;
asm volatile(ARM64_LSE_ATOMIC_INSN( asm volatile(
__LSE_PREAMBLE
ARM64_LSE_ATOMIC_INSN(
/* LL/SC */ /* LL/SC */
__LL_SC_ATOMIC64(dec_if_positive) __LL_SC_ATOMIC64(dec_if_positive)
__nops(6), __nops(6),
@@ -455,7 +489,9 @@ static inline unsigned long __cmpxchg_case_##name(volatile void *ptr, \
register unsigned long x1 asm ("x1") = old; \ register unsigned long x1 asm ("x1") = old; \
register unsigned long x2 asm ("x2") = new; \ register unsigned long x2 asm ("x2") = new; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_CMPXCHG(name) \ __LL_SC_CMPXCHG(name) \
__nops(2), \ __nops(2), \
@@ -507,7 +543,9 @@ static inline long __cmpxchg_double##name(unsigned long old1, \
register unsigned long x3 asm ("x3") = new2; \ register unsigned long x3 asm ("x3") = new2; \
register unsigned long x4 asm ("x4") = (unsigned long)ptr; \ register unsigned long x4 asm ("x4") = (unsigned long)ptr; \
\ \
asm volatile(ARM64_LSE_ATOMIC_INSN( \ asm volatile( \
__LSE_PREAMBLE \
ARM64_LSE_ATOMIC_INSN( \
/* LL/SC */ \ /* LL/SC */ \
__LL_SC_CMPXCHG_DBL(name) \ __LL_SC_CMPXCHG_DBL(name) \
__nops(3), \ __nops(3), \

View File

@@ -165,6 +165,7 @@ enum vcpu_sysreg {
#define c2_TTBR1 (TTBR1_EL1 * 2) /* Translation Table Base Register 1 */ #define c2_TTBR1 (TTBR1_EL1 * 2) /* Translation Table Base Register 1 */
#define c2_TTBR1_high (c2_TTBR1 + 1) /* TTBR1 top 32 bits */ #define c2_TTBR1_high (c2_TTBR1 + 1) /* TTBR1 top 32 bits */
#define c2_TTBCR (TCR_EL1 * 2) /* Translation Table Base Control R. */ #define c2_TTBCR (TCR_EL1 * 2) /* Translation Table Base Control R. */
#define c2_TTBCR2 (c2_TTBCR + 1) /* Translation Table Base Control R. 2 */
#define c3_DACR (DACR32_EL2 * 2)/* Domain Access Control Register */ #define c3_DACR (DACR32_EL2 * 2)/* Domain Access Control Register */
#define c5_DFSR (ESR_EL1 * 2) /* Data Fault Status Register */ #define c5_DFSR (ESR_EL1 * 2) /* Data Fault Status Register */
#define c5_IFSR (IFSR32_EL2 * 2)/* Instruction Fault Status Register */ #define c5_IFSR (IFSR32_EL2 * 2)/* Instruction Fault Status Register */

View File

@@ -4,6 +4,8 @@
#if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS) #if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS)
#define __LSE_PREAMBLE ".arch_extension lse\n"
#include <linux/compiler_types.h> #include <linux/compiler_types.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/stringify.h> #include <linux/stringify.h>

View File

@@ -102,8 +102,8 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
regs->syscallno = scno; regs->syscallno = scno;
cortex_a76_erratum_1463225_svc_handler(); cortex_a76_erratum_1463225_svc_handler();
user_exit_irqoff();
local_daif_restore(DAIF_PROCCTX); local_daif_restore(DAIF_PROCCTX);
user_exit();
if (has_syscall_work(flags)) { if (has_syscall_work(flags)) {
/* set default errno for user-issued syscall(-1) */ /* set default errno for user-issued syscall(-1) */

View File

@@ -1661,6 +1661,7 @@ static const struct sys_reg_desc cp15_regs[] = {
{ Op1( 0), CRn( 2), CRm( 0), Op2( 0), access_vm_reg, NULL, c2_TTBR0 }, { Op1( 0), CRn( 2), CRm( 0), Op2( 0), access_vm_reg, NULL, c2_TTBR0 },
{ Op1( 0), CRn( 2), CRm( 0), Op2( 1), access_vm_reg, NULL, c2_TTBR1 }, { Op1( 0), CRn( 2), CRm( 0), Op2( 1), access_vm_reg, NULL, c2_TTBR1 },
{ Op1( 0), CRn( 2), CRm( 0), Op2( 2), access_vm_reg, NULL, c2_TTBCR }, { Op1( 0), CRn( 2), CRm( 0), Op2( 2), access_vm_reg, NULL, c2_TTBCR },
{ Op1( 0), CRn( 2), CRm( 0), Op2( 3), access_vm_reg, NULL, c2_TTBCR2 },
{ Op1( 0), CRn( 3), CRm( 0), Op2( 0), access_vm_reg, NULL, c3_DACR }, { Op1( 0), CRn( 3), CRm( 0), Op2( 0), access_vm_reg, NULL, c3_DACR },
{ Op1( 0), CRn( 5), CRm( 0), Op2( 0), access_vm_reg, NULL, c5_DFSR }, { Op1( 0), CRn( 5), CRm( 0), Op2( 0), access_vm_reg, NULL, c5_DFSR },
{ Op1( 0), CRn( 5), CRm( 0), Op2( 1), access_vm_reg, NULL, c5_IFSR }, { Op1( 0), CRn( 5), CRm( 0), Op2( 1), access_vm_reg, NULL, c5_IFSR },

View File

@@ -68,9 +68,8 @@
stp \ptr, \regB, [\regC], \val stp \ptr, \regB, [\regC], \val
.endm .endm
.weak memcpy
ENTRY(__memcpy) ENTRY(__memcpy)
ENTRY(memcpy) WEAK(memcpy)
#include "copy_template.S" #include "copy_template.S"
ret ret
ENDPIPROC(memcpy) ENDPIPROC(memcpy)

View File

@@ -57,9 +57,8 @@ C_h .req x12
D_l .req x13 D_l .req x13
D_h .req x14 D_h .req x14
.weak memmove
ENTRY(__memmove) ENTRY(__memmove)
ENTRY(memmove) WEAK(memmove)
cmp dstin, src cmp dstin, src
b.lo __memcpy b.lo __memcpy
add tmp1, src, count add tmp1, src, count

View File

@@ -54,9 +54,8 @@ dst .req x8
tmp3w .req w9 tmp3w .req w9
tmp3 .req x9 tmp3 .req x9
.weak memset
ENTRY(__memset) ENTRY(__memset)
ENTRY(memset) WEAK(memset)
mov dst, dstin /* Preserve return value. */ mov dst, dstin /* Preserve return value. */
and A_lw, val, #255 and A_lw, val, #255
orr A_lw, A_lw, A_lw, lsl #8 orr A_lw, A_lw, A_lw, lsl #8

View File

@@ -27,6 +27,7 @@ config BCM47XX_BCMA
select BCMA select BCMA
select BCMA_HOST_SOC select BCMA_HOST_SOC
select BCMA_DRIVER_MIPS select BCMA_DRIVER_MIPS
select BCMA_DRIVER_PCI if PCI
select BCMA_DRIVER_PCI_HOSTMODE if PCI select BCMA_DRIVER_PCI_HOSTMODE if PCI
select BCMA_DRIVER_GPIO select BCMA_DRIVER_GPIO
default y default y

View File

@@ -251,7 +251,6 @@ endif
cpu-as-$(CONFIG_4xx) += -Wa,-m405 cpu-as-$(CONFIG_4xx) += -Wa,-m405
cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec)
cpu-as-$(CONFIG_E200) += -Wa,-me200
cpu-as-$(CONFIG_E500) += -Wa,-me500 cpu-as-$(CONFIG_E500) += -Wa,-me500
# When using '-many -mpower4' gas will first try and find a matching power4 # When using '-many -mpower4' gas will first try and find a matching power4

View File

@@ -434,9 +434,9 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
if (pte_val(*ptep) & _PAGE_HASHPTE) if (pte_val(*ptep) & _PAGE_HASHPTE)
flush_hash_entry(mm, ptep, addr); flush_hash_entry(mm, ptep, addr);
__asm__ __volatile__("\ __asm__ __volatile__("\
stw%U0%X0 %2,%0\n\ stw%X0 %2,%0\n\
eieio\n\ eieio\n\
stw%U0%X0 %L2,%1" stw%X1 %L2,%1"
: "=m" (*ptep), "=m" (*((unsigned char *)ptep+4)) : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
: "r" (pte) : "memory"); : "r" (pte) : "memory");

View File

@@ -411,7 +411,6 @@ static inline void cpu_feature_keys_init(void) { }
CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \ CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \
CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT) CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT)
#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
/* 64-bit CPUs */ /* 64-bit CPUs */
#define CPU_FTRS_PPC970 (CPU_FTR_LWSYNC | \ #define CPU_FTRS_PPC970 (CPU_FTR_LWSYNC | \
@@ -509,8 +508,6 @@ enum {
CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX | CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX |
CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 | CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 |
CPU_FTRS_CLASSIC32 | CPU_FTRS_CLASSIC32 |
#else
CPU_FTRS_GENERIC_32 |
#endif #endif
#ifdef CONFIG_PPC_8xx #ifdef CONFIG_PPC_8xx
CPU_FTRS_8XX | CPU_FTRS_8XX |
@@ -585,8 +582,6 @@ enum {
CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX & CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX &
CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 & CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 &
CPU_FTRS_CLASSIC32 & CPU_FTRS_CLASSIC32 &
#else
CPU_FTRS_GENERIC_32 &
#endif #endif
#ifdef CONFIG_PPC_8xx #ifdef CONFIG_PPC_8xx
CPU_FTRS_8XX & CPU_FTRS_8XX &

View File

@@ -151,9 +151,9 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
*/ */
if (IS_ENABLED(CONFIG_PPC32) && IS_ENABLED(CONFIG_PTE_64BIT) && !percpu) { if (IS_ENABLED(CONFIG_PPC32) && IS_ENABLED(CONFIG_PTE_64BIT) && !percpu) {
__asm__ __volatile__("\ __asm__ __volatile__("\
stw%U0%X0 %2,%0\n\ stw%X0 %2,%0\n\
eieio\n\ eieio\n\
stw%U0%X0 %L2,%1" stw%X1 %L2,%1"
: "=m" (*ptep), "=m" (*((unsigned char *)ptep+4)) : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
: "r" (pte) : "memory"); : "r" (pte) : "memory");
return; return;

View File

@@ -423,6 +423,10 @@ generic_secondary_common_init:
/* From now on, r24 is expected to be logical cpuid */ /* From now on, r24 is expected to be logical cpuid */
mr r24,r5 mr r24,r5
/* Create a temp kernel stack for use before relocation is on. */
ld r1,PACAEMERGSP(r13)
subi r1,r1,STACK_FRAME_OVERHEAD
/* See if we need to call a cpu state restore handler */ /* See if we need to call a cpu state restore handler */
LOAD_REG_ADDR(r23, cur_cpu_spec) LOAD_REG_ADDR(r23, cur_cpu_spec)
ld r23,0(r23) ld r23,0(r23)
@@ -451,10 +455,6 @@ generic_secondary_common_init:
sync /* order paca.run and cur_cpu_spec */ sync /* order paca.run and cur_cpu_spec */
isync /* In case code patching happened */ isync /* In case code patching happened */
/* Create a temp kernel stack for use before relocation is on. */
ld r1,PACAEMERGSP(r13)
subi r1,r1,STACK_FRAME_OVERHEAD
b __secondary_start b __secondary_start
#endif /* SMP */ #endif /* SMP */

View File

@@ -1095,7 +1095,7 @@ static struct rtas_filter rtas_filters[] __ro_after_init = {
{ "ibm,display-message", -1, 0, -1, -1, -1 }, { "ibm,display-message", -1, 0, -1, -1, -1 },
{ "ibm,errinjct", -1, 2, -1, -1, -1, 1024 }, { "ibm,errinjct", -1, 2, -1, -1, -1, 1024 },
{ "ibm,close-errinjct", -1, -1, -1, -1, -1 }, { "ibm,close-errinjct", -1, -1, -1, -1, -1 },
{ "ibm,open-errinct", -1, -1, -1, -1, -1 }, { "ibm,open-errinjct", -1, -1, -1, -1, -1 },
{ "ibm,get-config-addr-info2", -1, -1, -1, -1, -1 }, { "ibm,get-config-addr-info2", -1, -1, -1, -1, -1 },
{ "ibm,get-dynamic-sensor-state", -1, 1, -1, -1, -1 }, { "ibm,get-dynamic-sensor-state", -1, 1, -1, -1, -1 },
{ "ibm,get-indices", -1, 2, 3, -1, -1 }, { "ibm,get-indices", -1, 2, 3, -1, -1 },

View File

@@ -929,8 +929,6 @@ void __init setup_arch(char **cmdline_p)
/* On BookE, setup per-core TLB data structures. */ /* On BookE, setup per-core TLB data structures. */
setup_tlb_core_data(); setup_tlb_core_data();
smp_release_cpus();
#endif #endif
/* Print various info about the machine that has been gathered so far. */ /* Print various info about the machine that has been gathered so far. */
@@ -964,6 +962,8 @@ void __init setup_arch(char **cmdline_p)
exc_lvl_early_init(); exc_lvl_early_init();
emergency_stack_init(); emergency_stack_init();
smp_release_cpus();
initmem_init(); initmem_init();
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE

View File

@@ -2056,6 +2056,16 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
local64_set(&event->hw.period_left, left); local64_set(&event->hw.period_left, left);
perf_event_update_userpage(event); perf_event_update_userpage(event);
/*
* Due to hardware limitation, sometimes SIAR could sample a kernel
* address even when freeze on supervisor state (kernel) is set in
* MMCR2. Check attr.exclude_kernel and address to drop the sample in
* these cases.
*/
if (event->attr.exclude_kernel && record)
if (is_kernel_addr(mfspr(SPRN_SIAR)))
record = 0;
/* /*
* Finally record data if requested. * Finally record data if requested.
*/ */

View File

@@ -33,6 +33,7 @@ struct memtrace_entry {
char name[16]; char name[16];
}; };
static DEFINE_MUTEX(memtrace_mutex);
static u64 memtrace_size; static u64 memtrace_size;
static struct memtrace_entry *memtrace_array; static struct memtrace_entry *memtrace_array;
@@ -70,6 +71,23 @@ static int change_memblock_state(struct memory_block *mem, void *arg)
return 0; return 0;
} }
static void memtrace_clear_range(unsigned long start_pfn,
unsigned long nr_pages)
{
unsigned long pfn;
/*
* As pages are offline, we cannot trust the memmap anymore. As HIGHMEM
* does not apply, avoid passing around "struct page" and use
* clear_page() instead directly.
*/
for (pfn = start_pfn; pfn < start_pfn + nr_pages; pfn++) {
if (IS_ALIGNED(pfn, PAGES_PER_SECTION))
cond_resched();
clear_page(__va(PFN_PHYS(pfn)));
}
}
/* called with device_hotplug_lock held */ /* called with device_hotplug_lock held */
static bool memtrace_offline_pages(u32 nid, u64 start_pfn, u64 nr_pages) static bool memtrace_offline_pages(u32 nid, u64 start_pfn, u64 nr_pages)
{ {
@@ -114,6 +132,11 @@ static u64 memtrace_alloc_node(u32 nid, u64 size)
lock_device_hotplug(); lock_device_hotplug();
for (base_pfn = end_pfn; base_pfn > start_pfn; base_pfn -= nr_pages) { for (base_pfn = end_pfn; base_pfn > start_pfn; base_pfn -= nr_pages) {
if (memtrace_offline_pages(nid, base_pfn, nr_pages) == true) { if (memtrace_offline_pages(nid, base_pfn, nr_pages) == true) {
/*
* Clear the range while we still have a linear
* mapping.
*/
memtrace_clear_range(base_pfn, nr_pages);
/* /*
* Remove memory in memory block size chunks so that * Remove memory in memory block size chunks so that
* iomem resources are always split to the same size and * iomem resources are always split to the same size and
@@ -272,6 +295,7 @@ static int memtrace_online(void)
static int memtrace_enable_set(void *data, u64 val) static int memtrace_enable_set(void *data, u64 val)
{ {
int rc = -EAGAIN;
u64 bytes; u64 bytes;
/* /*
@@ -284,25 +308,31 @@ static int memtrace_enable_set(void *data, u64 val)
return -EINVAL; return -EINVAL;
} }
mutex_lock(&memtrace_mutex);
/* Re-add/online previously removed/offlined memory */ /* Re-add/online previously removed/offlined memory */
if (memtrace_size) { if (memtrace_size) {
if (memtrace_online()) if (memtrace_online())
return -EAGAIN; goto out_unlock;
} }
if (!val) if (!val) {
return 0; rc = 0;
goto out_unlock;
}
/* Offline and remove memory */ /* Offline and remove memory */
if (memtrace_init_regions_runtime(val)) if (memtrace_init_regions_runtime(val))
return -EINVAL; goto out_unlock;
if (memtrace_init_debugfs()) if (memtrace_init_debugfs())
return -EINVAL; goto out_unlock;
memtrace_size = val; memtrace_size = val;
rc = 0;
return 0; out_unlock:
mutex_unlock(&memtrace_mutex);
return rc;
} }
static int memtrace_enable_get(void *data, u64 *val) static int memtrace_enable_get(void *data, u64 *val)

View File

@@ -26,7 +26,6 @@
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/rtas.h> #include <asm/rtas.h>
#include <asm/topology.h> #include <asm/topology.h>
#include "../../kernel/cacheinfo.h"
static u64 stream_id; static u64 stream_id;
static struct device suspend_dev; static struct device suspend_dev;
@@ -91,9 +90,7 @@ static void pseries_suspend_enable_irqs(void)
* Update configuration which can be modified based on device tree * Update configuration which can be modified based on device tree
* changes during resume. * changes during resume.
*/ */
cacheinfo_cpu_offline(smp_processor_id());
post_mobility_fixup(); post_mobility_fixup();
cacheinfo_cpu_online(smp_processor_id());
} }
/** /**
@@ -223,7 +220,6 @@ static struct bus_type suspend_subsys = {
static const struct platform_suspend_ops pseries_suspend_ops = { static const struct platform_suspend_ops pseries_suspend_ops = {
.valid = suspend_valid_only_mem, .valid = suspend_valid_only_mem,
.begin = pseries_suspend_begin,
.prepare_late = pseries_prepare_late, .prepare_late = pseries_prepare_late,
.enter = pseries_suspend_enter, .enter = pseries_suspend_enter,
}; };

View File

@@ -182,7 +182,7 @@ void xmon_printf(const char *format, ...)
if (n && rc == 0) { if (n && rc == 0) {
/* No udbg hooks, fallback to printk() - dangerous */ /* No udbg hooks, fallback to printk() - dangerous */
printk("%s", xmon_outbuf); pr_cont("%s", xmon_outbuf);
} }
} }

View File

@@ -863,24 +863,12 @@ static void smp_start_secondary(void *cpuvoid)
/* Upping and downing of CPUs */ /* Upping and downing of CPUs */
int __cpu_up(unsigned int cpu, struct task_struct *tidle) int __cpu_up(unsigned int cpu, struct task_struct *tidle)
{ {
struct pcpu *pcpu; struct pcpu *pcpu = pcpu_devices + cpu;
int base, i, rc; int rc;
pcpu = pcpu_devices + cpu;
if (pcpu->state != CPU_STATE_CONFIGURED) if (pcpu->state != CPU_STATE_CONFIGURED)
return -EIO; return -EIO;
base = smp_get_base_cpu(cpu); if (pcpu_sigp_retry(pcpu, SIGP_INITIAL_CPU_RESET, 0) !=
for (i = 0; i <= smp_cpu_mtid; i++) {
if (base + i < nr_cpu_ids)
if (cpu_online(base + i))
break;
}
/*
* If this is the first CPU of the core to get online
* do an initial CPU reset.
*/
if (i > smp_cpu_mtid &&
pcpu_sigp_retry(pcpu_devices + base, SIGP_INITIAL_CPU_RESET, 0) !=
SIGP_CC_ORDER_CODE_ACCEPTED) SIGP_CC_ORDER_CODE_ACCEPTED)
return -EIO; return -EIO;

View File

@@ -61,14 +61,15 @@
jh 10b jh 10b
.endm .endm
.macro START_NEXT_KERNEL base .macro START_NEXT_KERNEL base subcode
lg %r4,kernel_entry-\base(%r13) lg %r4,kernel_entry-\base(%r13)
lg %r5,load_psw_mask-\base(%r13) lg %r5,load_psw_mask-\base(%r13)
ogr %r4,%r5 ogr %r4,%r5
stg %r4,0(%r0) stg %r4,0(%r0)
xgr %r0,%r0 xgr %r0,%r0
diag %r0,%r0,0x308 lghi %r1,\subcode
diag %r0,%r1,0x308
.endm .endm
.text .text
@@ -123,7 +124,7 @@ ENTRY(purgatory_start)
je .start_crash_kernel je .start_crash_kernel
/* start normal kernel */ /* start normal kernel */
START_NEXT_KERNEL .base_crash START_NEXT_KERNEL .base_crash 0
.return_old_kernel: .return_old_kernel:
lmg %r6,%r15,gprregs-.base_crash(%r13) lmg %r6,%r15,gprregs-.base_crash(%r13)
@@ -227,7 +228,7 @@ ENTRY(purgatory_start)
MEMCPY %r9,%r10,%r11 MEMCPY %r9,%r10,%r11
/* start crash kernel */ /* start crash kernel */
START_NEXT_KERNEL .base_dst START_NEXT_KERNEL .base_dst 1
load_psw_mask: load_psw_mask:

View File

@@ -26,10 +26,10 @@ int generic_read(int fd, char *c_out, void *unused)
n = read(fd, c_out, sizeof(*c_out)); n = read(fd, c_out, sizeof(*c_out));
if (n > 0) if (n > 0)
return n; return n;
else if (errno == EAGAIN)
return 0;
else if (n == 0) else if (n == 0)
return -EIO; return -EIO;
else if (errno == EAGAIN)
return 0;
return -errno; return -errno;
} }

View File

@@ -18,6 +18,7 @@
struct xterm_chan { struct xterm_chan {
int pid; int pid;
int helper_pid; int helper_pid;
int chan_fd;
char *title; char *title;
int device; int device;
int raw; int raw;
@@ -33,6 +34,7 @@ static void *xterm_init(char *str, int device, const struct chan_opts *opts)
return NULL; return NULL;
*data = ((struct xterm_chan) { .pid = -1, *data = ((struct xterm_chan) { .pid = -1,
.helper_pid = -1, .helper_pid = -1,
.chan_fd = -1,
.device = device, .device = device,
.title = opts->xterm_title, .title = opts->xterm_title,
.raw = opts->raw } ); .raw = opts->raw } );
@@ -149,6 +151,7 @@ static int xterm_open(int input, int output, int primary, void *d,
goto out_kill; goto out_kill;
} }
data->chan_fd = fd;
new = xterm_fd(fd, &data->helper_pid); new = xterm_fd(fd, &data->helper_pid);
if (new < 0) { if (new < 0) {
err = new; err = new;
@@ -206,6 +209,8 @@ static void xterm_close(int fd, void *d)
os_kill_process(data->helper_pid, 0); os_kill_process(data->helper_pid, 0);
data->helper_pid = -1; data->helper_pid = -1;
if (data->chan_fd != -1)
os_close_file(data->chan_fd);
os_close_file(fd); os_close_file(fd);
} }

View File

@@ -48,7 +48,7 @@ int os_epoll_triggered(int index, int events)
int os_event_mask(int irq_type) int os_event_mask(int irq_type)
{ {
if (irq_type == IRQ_READ) if (irq_type == IRQ_READ)
return EPOLLIN | EPOLLPRI; return EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLRDHUP;
if (irq_type == IRQ_WRITE) if (irq_type == IRQ_WRITE)
return EPOLLOUT; return EPOLLOUT;
return 0; return 0;

View File

@@ -252,6 +252,7 @@ static inline u64 native_x2apic_icr_read(void)
extern int x2apic_mode; extern int x2apic_mode;
extern int x2apic_phys; extern int x2apic_phys;
extern void __init x2apic_set_max_apicid(u32 apicid);
extern void __init check_x2apic(void); extern void __init check_x2apic(void);
extern void x2apic_setup(void); extern void x2apic_setup(void);
static inline int x2apic_enabled(void) static inline int x2apic_enabled(void)

View File

@@ -148,6 +148,7 @@ enum page_cache_mode {
#endif #endif
#define _PAGE_CACHE_MASK (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT) #define _PAGE_CACHE_MASK (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)
#define _PAGE_LARGE_CACHE_MASK (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT_LARGE)
#define _PAGE_NOCACHE (cachemode2protval(_PAGE_CACHE_MODE_UC)) #define _PAGE_NOCACHE (cachemode2protval(_PAGE_CACHE_MODE_UC))
#define _PAGE_CACHE_WP (cachemode2protval(_PAGE_CACHE_MODE_WP)) #define _PAGE_CACHE_WP (cachemode2protval(_PAGE_CACHE_MODE_WP))

View File

@@ -16,12 +16,13 @@ static inline void sync_core_before_usermode(void)
/* With PTI, we unconditionally serialize before running user code. */ /* With PTI, we unconditionally serialize before running user code. */
if (static_cpu_has(X86_FEATURE_PTI)) if (static_cpu_has(X86_FEATURE_PTI))
return; return;
/* /*
* Return from interrupt and NMI is done through iret, which is core * Even if we're in an interrupt, we might reschedule before returning,
* serializing. * in which case we could switch to a different thread in the same mm
* and return using SYSRET or SYSEXIT. Instead of trying to keep
* track of our need to sync the core, just sync right away.
*/ */
if (in_irq() || in_nmi())
return;
sync_core(); sync_core();
} }

View File

@@ -1813,20 +1813,22 @@ static __init void try_to_enable_x2apic(int remap_mode)
return; return;
if (remap_mode != IRQ_REMAP_X2APIC_MODE) { if (remap_mode != IRQ_REMAP_X2APIC_MODE) {
/* IR is required if there is APIC ID > 255 even when running /*
* under KVM * Using X2APIC without IR is not architecturally supported
* on bare metal but may be supported in guests.
*/ */
if (max_physical_apicid > 255 || if (!x86_init.hyper.x2apic_available()) {
!x86_init.hyper.x2apic_available()) {
pr_info("x2apic: IRQ remapping doesn't support X2APIC mode\n"); pr_info("x2apic: IRQ remapping doesn't support X2APIC mode\n");
x2apic_disable(); x2apic_disable();
return; return;
} }
/* /*
* without IR all CPUs can be addressed by IOAPIC/MSI * Without IR, all CPUs can be addressed by IOAPIC/MSI only
* only in physical mode * in physical mode, and CPUs with an APIC ID that cannnot
* be addressed must not be brought online.
*/ */
x2apic_set_max_apicid(255);
x2apic_phys = 1; x2apic_phys = 1;
} }
x2apic_enable(); x2apic_enable();

View File

@@ -274,20 +274,24 @@ static int assign_irq_vector_any_locked(struct irq_data *irqd)
const struct cpumask *affmsk = irq_data_get_affinity_mask(irqd); const struct cpumask *affmsk = irq_data_get_affinity_mask(irqd);
int node = irq_data_get_node(irqd); int node = irq_data_get_node(irqd);
if (node == NUMA_NO_NODE) if (node != NUMA_NO_NODE) {
goto all;
/* Try the intersection of @affmsk and node mask */ /* Try the intersection of @affmsk and node mask */
cpumask_and(vector_searchmask, cpumask_of_node(node), affmsk); cpumask_and(vector_searchmask, cpumask_of_node(node), affmsk);
if (!assign_vector_locked(irqd, vector_searchmask)) if (!assign_vector_locked(irqd, vector_searchmask))
return 0; return 0;
/* Try the node mask */ }
if (!assign_vector_locked(irqd, cpumask_of_node(node)))
return 0;
all:
/* Try the full affinity mask */ /* Try the full affinity mask */
cpumask_and(vector_searchmask, affmsk, cpu_online_mask); cpumask_and(vector_searchmask, affmsk, cpu_online_mask);
if (!assign_vector_locked(irqd, vector_searchmask)) if (!assign_vector_locked(irqd, vector_searchmask))
return 0; return 0;
if (node != NUMA_NO_NODE) {
/* Try the node mask */
if (!assign_vector_locked(irqd, cpumask_of_node(node)))
return 0;
}
/* Try the full online mask */ /* Try the full online mask */
return assign_vector_locked(irqd, cpu_online_mask); return assign_vector_locked(irqd, cpu_online_mask);
} }

View File

@@ -13,6 +13,12 @@
int x2apic_phys; int x2apic_phys;
static struct apic apic_x2apic_phys; static struct apic apic_x2apic_phys;
static u32 x2apic_max_apicid __ro_after_init;
void __init x2apic_set_max_apicid(u32 apicid)
{
x2apic_max_apicid = apicid;
}
static int __init set_x2apic_phys_mode(char *arg) static int __init set_x2apic_phys_mode(char *arg)
{ {
@@ -103,6 +109,9 @@ static int x2apic_phys_probe(void)
/* Common x2apic functions, also used by x2apic_cluster */ /* Common x2apic functions, also used by x2apic_cluster */
int x2apic_apic_id_valid(u32 apicid) int x2apic_apic_id_valid(u32 apicid)
{ {
if (x2apic_max_apicid && apicid > x2apic_max_apicid)
return 0;
return 1; return 1;
} }

View File

@@ -251,7 +251,6 @@ struct rftype {
* struct mbm_state - status for each MBM counter in each domain * struct mbm_state - status for each MBM counter in each domain
* @chunks: Total data moved (multiply by rdt_group.mon_scale to get bytes) * @chunks: Total data moved (multiply by rdt_group.mon_scale to get bytes)
* @prev_msr Value of IA32_QM_CTR for this RMID last time we read it * @prev_msr Value of IA32_QM_CTR for this RMID last time we read it
* @chunks_bw Total local data moved. Used for bandwidth calculation
* @prev_bw_msr:Value of previous IA32_QM_CTR for bandwidth counting * @prev_bw_msr:Value of previous IA32_QM_CTR for bandwidth counting
* @prev_bw The most recent bandwidth in MBps * @prev_bw The most recent bandwidth in MBps
* @delta_bw Difference between the current and previous bandwidth * @delta_bw Difference between the current and previous bandwidth
@@ -260,7 +259,6 @@ struct rftype {
struct mbm_state { struct mbm_state {
u64 chunks; u64 chunks;
u64 prev_msr; u64 prev_msr;
u64 chunks_bw;
u64 prev_bw_msr; u64 prev_bw_msr;
u32 prev_bw; u32 prev_bw;
u32 delta_bw; u32 delta_bw;

View File

@@ -290,8 +290,6 @@ static void mbm_bw_count(u32 rmid, struct rmid_read *rr)
return; return;
chunks = mbm_overflow_count(m->prev_bw_msr, tval); chunks = mbm_overflow_count(m->prev_bw_msr, tval);
m->chunks_bw += chunks;
m->chunks = m->chunks_bw;
cur_bw = (chunks * r->mon_scale) >> 20; cur_bw = (chunks * r->mon_scale) >> 20;
if (m->delta_comp) if (m->delta_comp)
@@ -461,15 +459,14 @@ static void mbm_update(struct rdt_domain *d, int rmid)
} }
if (is_mbm_local_enabled()) { if (is_mbm_local_enabled()) {
rr.evtid = QOS_L3_MBM_LOCAL_EVENT_ID; rr.evtid = QOS_L3_MBM_LOCAL_EVENT_ID;
__mon_event_count(rmid, &rr);
/* /*
* Call the MBA software controller only for the * Call the MBA software controller only for the
* control groups and when user has enabled * control groups and when user has enabled
* the software controller explicitly. * the software controller explicitly.
*/ */
if (!is_mba_sc(NULL)) if (is_mba_sc(NULL))
__mon_event_count(rmid, &rr);
else
mbm_bw_count(rmid, &rr); mbm_bw_count(rmid, &rr);
} }
} }

View File

@@ -1041,6 +1041,11 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
* So clear it by resetting the current kprobe: * So clear it by resetting the current kprobe:
*/ */
regs->flags &= ~X86_EFLAGS_TF; regs->flags &= ~X86_EFLAGS_TF;
/*
* Since the single step (trap) has been cancelled,
* we need to restore BTF here.
*/
restore_btf();
/* /*
* If the TF flag was set before the kprobe hit, * If the TF flag was set before the kprobe hit,

View File

@@ -14,8 +14,6 @@
* to a jmp to memcpy_erms which does the REP; MOVSB mem copy. * to a jmp to memcpy_erms which does the REP; MOVSB mem copy.
*/ */
.weak memcpy
/* /*
* memcpy - Copy a memory block. * memcpy - Copy a memory block.
* *
@@ -28,7 +26,9 @@
* rax original destination * rax original destination
*/ */
ENTRY(__memcpy) ENTRY(__memcpy)
ENTRY(memcpy) .weak memcpy
.p2align 4, 0x90
memcpy:
ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \ ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \
"jmp memcpy_erms", X86_FEATURE_ERMS "jmp memcpy_erms", X86_FEATURE_ERMS

View File

@@ -25,8 +25,8 @@
* rax: dest * rax: dest
*/ */
.weak memmove .weak memmove
.p2align 4, 0x90
ENTRY(memmove) memmove:
ENTRY(__memmove) ENTRY(__memmove)
/* Handle more 32 bytes in loop */ /* Handle more 32 bytes in loop */

View File

@@ -6,8 +6,6 @@
#include <asm/alternative-asm.h> #include <asm/alternative-asm.h>
#include <asm/export.h> #include <asm/export.h>
.weak memset
/* /*
* ISO C memset - set a memory block to a byte value. This function uses fast * ISO C memset - set a memory block to a byte value. This function uses fast
* string to get better performance than the original function. The code is * string to get better performance than the original function. The code is
@@ -19,7 +17,9 @@
* *
* rax original destination * rax original destination
*/ */
ENTRY(memset) .weak memset
.p2align 4, 0x90
memset:
ENTRY(__memset) ENTRY(__memset)
/* /*
* Some CPUs support enhanced REP MOVSB/STOSB feature. It is recommended * Some CPUs support enhanced REP MOVSB/STOSB feature. It is recommended

View File

@@ -62,6 +62,7 @@ static int ident_p4d_init(struct x86_mapping_info *info, p4d_t *p4d_page,
unsigned long addr, unsigned long end) unsigned long addr, unsigned long end)
{ {
unsigned long next; unsigned long next;
int result;
for (; addr < end; addr = next) { for (; addr < end; addr = next) {
p4d_t *p4d = p4d_page + p4d_index(addr); p4d_t *p4d = p4d_page + p4d_index(addr);
@@ -73,13 +74,20 @@ static int ident_p4d_init(struct x86_mapping_info *info, p4d_t *p4d_page,
if (p4d_present(*p4d)) { if (p4d_present(*p4d)) {
pud = pud_offset(p4d, 0); pud = pud_offset(p4d, 0);
ident_pud_init(info, pud, addr, next); result = ident_pud_init(info, pud, addr, next);
if (result)
return result;
continue; continue;
} }
pud = (pud_t *)info->alloc_pgt_page(info->context); pud = (pud_t *)info->alloc_pgt_page(info->context);
if (!pud) if (!pud)
return -ENOMEM; return -ENOMEM;
ident_pud_init(info, pud, addr, next);
result = ident_pud_init(info, pud, addr, next);
if (result)
return result;
set_p4d(p4d, __p4d(__pa(pud) | info->kernpg_flag)); set_p4d(p4d, __p4d(__pa(pud) | info->kernpg_flag));
} }

View File

@@ -47,8 +47,8 @@
#define PMD_FLAGS_LARGE (__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL) #define PMD_FLAGS_LARGE (__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL)
#define PMD_FLAGS_DEC PMD_FLAGS_LARGE #define PMD_FLAGS_DEC PMD_FLAGS_LARGE
#define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_CACHE_MASK) | \ #define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_LARGE_CACHE_MASK) | \
(_PAGE_PAT | _PAGE_PWT)) (_PAGE_PAT_LARGE | _PAGE_PWT))
#define PMD_FLAGS_ENC (PMD_FLAGS_LARGE | _PAGE_ENC) #define PMD_FLAGS_ENC (PMD_FLAGS_LARGE | _PAGE_ENC)

View File

@@ -321,8 +321,14 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next,
/* /*
* The membarrier system call requires a full memory barrier and * The membarrier system call requires a full memory barrier and
* core serialization before returning to user-space, after * core serialization before returning to user-space, after
* storing to rq->curr. Writing to CR3 provides that full * storing to rq->curr, when changing mm. This is because
* memory barrier and core serializing instruction. * membarrier() sends IPIs to all CPUs that are in the target mm
* to make them issue memory barriers. However, if another CPU
* switches to/from the target mm concurrently with
* membarrier(), it can cause that CPU not to receive an IPI
* when it really should issue a memory barrier. Writing to CR3
* provides that full memory barrier and core serializing
* instruction.
*/ */
if (real_prev == next) { if (real_prev == next) {
VM_WARN_ON(this_cpu_read(cpu_tlbstate.ctxs[prev_asid].ctx_id) != VM_WARN_ON(this_cpu_read(cpu_tlbstate.ctxs[prev_asid].ctx_id) !=

View File

@@ -1118,6 +1118,23 @@ static void blk_mq_update_dispatch_busy(struct blk_mq_hw_ctx *hctx, bool busy)
#define BLK_MQ_RESOURCE_DELAY 3 /* ms units */ #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */
static void blk_mq_handle_dev_resource(struct request *rq,
struct list_head *list)
{
struct request *next =
list_first_entry_or_null(list, struct request, queuelist);
/*
* If an I/O scheduler has been configured and we got a driver tag for
* the next request already, free it.
*/
if (next)
blk_mq_put_driver_tag(next);
list_add(&rq->queuelist, list);
__blk_mq_requeue_request(rq);
}
/* /*
* Returns true if we did some work AND can potentially do more. * Returns true if we did some work AND can potentially do more.
*/ */
@@ -1185,17 +1202,7 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
ret = q->mq_ops->queue_rq(hctx, &bd); ret = q->mq_ops->queue_rq(hctx, &bd);
if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE) { if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE) {
/* blk_mq_handle_dev_resource(rq, list);
* If an I/O scheduler has been configured and we got a
* driver tag for the next request already, free it
* again.
*/
if (!list_empty(list)) {
nxt = list_first_entry(list, struct request, queuelist);
blk_mq_put_driver_tag(nxt);
}
list_add(&rq->queuelist, list);
__blk_mq_requeue_request(rq);
break; break;
} }

View File

@@ -151,7 +151,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
const u32 allowed = CRYPTO_ALG_KERN_DRIVER_ONLY; const u32 allowed = CRYPTO_ALG_KERN_DRIVER_ONLY;
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
struct alg_sock *ask = alg_sk(sk); struct alg_sock *ask = alg_sk(sk);
struct sockaddr_alg *sa = (void *)uaddr; struct sockaddr_alg_new *sa = (void *)uaddr;
const struct af_alg_type *type; const struct af_alg_type *type;
void *private; void *private;
int err; int err;
@@ -159,7 +159,11 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
if (sock->state == SS_CONNECTED) if (sock->state == SS_CONNECTED)
return -EINVAL; return -EINVAL;
if (addr_len < sizeof(*sa)) BUILD_BUG_ON(offsetof(struct sockaddr_alg_new, salg_name) !=
offsetof(struct sockaddr_alg, salg_name));
BUILD_BUG_ON(offsetof(struct sockaddr_alg, salg_name) != sizeof(*sa));
if (addr_len < sizeof(*sa) + 1)
return -EINVAL; return -EINVAL;
/* If caller uses non-allowed flag, return error. */ /* If caller uses non-allowed flag, return error. */
@@ -167,7 +171,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
return -EINVAL; return -EINVAL;
sa->salg_type[sizeof(sa->salg_type) - 1] = 0; sa->salg_type[sizeof(sa->salg_type) - 1] = 0;
sa->salg_name[sizeof(sa->salg_name) + addr_len - sizeof(*sa) - 1] = 0; sa->salg_name[addr_len - sizeof(*sa) - 1] = 0;
type = alg_get_type(sa->salg_type); type = alg_get_type(sa->salg_type);
if (IS_ERR(type) && PTR_ERR(type) == -ENOENT) { if (IS_ERR(type) && PTR_ERR(type) == -ENOENT) {

View File

@@ -57,12 +57,13 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf,
return ecc_gen_privkey(ctx->curve_id, ctx->ndigits, return ecc_gen_privkey(ctx->curve_id, ctx->ndigits,
ctx->private_key); ctx->private_key);
if (ecc_is_key_valid(ctx->curve_id, ctx->ndigits,
(const u64 *)params.key, params.key_size) < 0)
return -EINVAL;
memcpy(ctx->private_key, params.key, params.key_size); memcpy(ctx->private_key, params.key, params.key_size);
if (ecc_is_key_valid(ctx->curve_id, ctx->ndigits,
ctx->private_key, params.key_size) < 0) {
memzero_explicit(ctx->private_key, params.key_size);
return -EINVAL;
}
return 0; return 0;
} }

View File

@@ -320,6 +320,9 @@ static bool matching_id(const char *idstr, const char *list_id)
{ {
int i; int i;
if (strlen(idstr) != strlen(list_id))
return false;
if (memcmp(idstr, list_id, 3)) if (memcmp(idstr, list_id, 3))
return false; return false;

View File

@@ -703,7 +703,7 @@ static void acpi_pm_notify_work_func(struct acpi_device_wakeup_context *context)
static DEFINE_MUTEX(acpi_wakeup_lock); static DEFINE_MUTEX(acpi_wakeup_lock);
static int __acpi_device_wakeup_enable(struct acpi_device *adev, static int __acpi_device_wakeup_enable(struct acpi_device *adev,
u32 target_state, int max_count) u32 target_state)
{ {
struct acpi_device_wakeup *wakeup = &adev->wakeup; struct acpi_device_wakeup *wakeup = &adev->wakeup;
acpi_status status; acpi_status status;
@@ -711,9 +711,10 @@ static int __acpi_device_wakeup_enable(struct acpi_device *adev,
mutex_lock(&acpi_wakeup_lock); mutex_lock(&acpi_wakeup_lock);
if (wakeup->enable_count >= max_count) if (wakeup->enable_count >= INT_MAX) {
acpi_handle_info(adev->handle, "Wakeup enable count out of bounds!\n");
goto out; goto out;
}
if (wakeup->enable_count > 0) if (wakeup->enable_count > 0)
goto inc; goto inc;
@@ -750,7 +751,7 @@ static int __acpi_device_wakeup_enable(struct acpi_device *adev,
*/ */
static int acpi_device_wakeup_enable(struct acpi_device *adev, u32 target_state) static int acpi_device_wakeup_enable(struct acpi_device *adev, u32 target_state)
{ {
return __acpi_device_wakeup_enable(adev, target_state, 1); return __acpi_device_wakeup_enable(adev, target_state);
} }
/** /**
@@ -780,8 +781,12 @@ static void acpi_device_wakeup_disable(struct acpi_device *adev)
mutex_unlock(&acpi_wakeup_lock); mutex_unlock(&acpi_wakeup_lock);
} }
static int __acpi_pm_set_device_wakeup(struct device *dev, bool enable, /**
int max_count) * acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device.
* @dev: Device to enable/disable to generate wakeup events.
* @enable: Whether to enable or disable the wakeup functionality.
*/
int acpi_pm_set_device_wakeup(struct device *dev, bool enable)
{ {
struct acpi_device *adev; struct acpi_device *adev;
int error; int error;
@@ -801,36 +806,14 @@ static int __acpi_pm_set_device_wakeup(struct device *dev, bool enable,
return 0; return 0;
} }
error = __acpi_device_wakeup_enable(adev, acpi_target_system_state(), error = __acpi_device_wakeup_enable(adev, acpi_target_system_state());
max_count);
if (!error) if (!error)
dev_dbg(dev, "Wakeup enabled by ACPI\n"); dev_dbg(dev, "Wakeup enabled by ACPI\n");
return error; return error;
} }
/**
* acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device.
* @dev: Device to enable/disable to generate wakeup events.
* @enable: Whether to enable or disable the wakeup functionality.
*/
int acpi_pm_set_device_wakeup(struct device *dev, bool enable)
{
return __acpi_pm_set_device_wakeup(dev, enable, 1);
}
EXPORT_SYMBOL_GPL(acpi_pm_set_device_wakeup); EXPORT_SYMBOL_GPL(acpi_pm_set_device_wakeup);
/**
* acpi_pm_set_bridge_wakeup - Enable/disable remote wakeup for given bridge.
* @dev: Bridge device to enable/disable to generate wakeup events.
* @enable: Whether to enable or disable the wakeup functionality.
*/
int acpi_pm_set_bridge_wakeup(struct device *dev, bool enable)
{
return __acpi_pm_set_device_wakeup(dev, enable, INT_MAX);
}
EXPORT_SYMBOL_GPL(acpi_pm_set_bridge_wakeup);
/** /**
* acpi_dev_pm_low_power - Put ACPI device into a low-power state. * acpi_dev_pm_low_power - Put ACPI device into a low-power state.
* @dev: Device to put into a low-power state. * @dev: Device to put into a low-power state.

View File

@@ -549,7 +549,7 @@ static acpi_status acpi_dev_process_resource(struct acpi_resource *ares,
ret = c->preproc(ares, c->preproc_data); ret = c->preproc(ares, c->preproc_data);
if (ret < 0) { if (ret < 0) {
c->error = ret; c->error = ret;
return AE_CTRL_TERMINATE; return AE_ABORT_METHOD;
} else if (ret > 0) { } else if (ret > 0) {
return AE_OK; return AE_OK;
} }

View File

@@ -264,6 +264,7 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif)
if (ring->xenblkd) { if (ring->xenblkd) {
kthread_stop(ring->xenblkd); kthread_stop(ring->xenblkd);
ring->xenblkd = NULL;
wake_up(&ring->shutdown_wq); wake_up(&ring->shutdown_wq);
} }
@@ -651,7 +652,8 @@ static int xen_blkbk_probe(struct xenbus_device *dev,
/* setup back pointer */ /* setup back pointer */
be->blkif->be = be; be->blkif->be = be;
err = xenbus_watch_pathfmt(dev, &be->backend_watch, backend_changed, err = xenbus_watch_pathfmt(dev, &be->backend_watch, NULL,
backend_changed,
"%s/%s", dev->nodename, "physical-device"); "%s/%s", dev->nodename, "physical-device");
if (err) if (err)
goto fail; goto fail;

View File

@@ -257,6 +257,9 @@ static int h5_close(struct hci_uart *hu)
skb_queue_purge(&h5->rel); skb_queue_purge(&h5->rel);
skb_queue_purge(&h5->unrel); skb_queue_purge(&h5->unrel);
kfree_skb(h5->rx_skb);
h5->rx_skb = NULL;
if (h5->vnd && h5->vnd->close) if (h5->vnd && h5->vnd->close)
h5->vnd->close(h5); h5->vnd->close(h5);

View File

@@ -292,8 +292,10 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev,
goto error; goto error;
mc_adev = resource->data; mc_adev = resource->data;
if (!mc_adev) if (!mc_adev) {
error = -EINVAL;
goto error; goto error;
}
*new_mc_adev = mc_adev; *new_mc_adev = mc_adev;
return 0; return 0;

View File

@@ -544,10 +544,8 @@ static void mips_cdmm_bus_discover(struct mips_cdmm_bus *bus)
dev_set_name(&dev->dev, "cdmm%u-%u", cpu, id); dev_set_name(&dev->dev, "cdmm%u-%u", cpu, id);
++id; ++id;
ret = device_register(&dev->dev); ret = device_register(&dev->dev);
if (ret) { if (ret)
put_device(&dev->dev); put_device(&dev->dev);
kfree(dev);
}
} }
} }

View File

@@ -211,6 +211,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev)
return ret; return ret;
err_reg: err_reg:
of_node_put(s2mps11_clks[0].clk_np);
while (--i >= 0) while (--i >= 0)
clkdev_drop(s2mps11_clks[i].lookup); clkdev_drop(s2mps11_clks[i].lookup);

View File

@@ -15,8 +15,8 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#define NB_GPIO1_LATCH 0xC #define NB_GPIO1_LATCH 0x8
#define XTAL_MODE BIT(31) #define XTAL_MODE BIT(9)
static int armada_3700_xtal_clock_probe(struct platform_device *pdev) static int armada_3700_xtal_clock_probe(struct platform_device *pdev)
{ {

View File

@@ -51,7 +51,7 @@ struct r9a06g032_clkdesc {
u16 sel, g1, r1, g2, r2; u16 sel, g1, r1, g2, r2;
} dual; } dual;
}; };
} __packed; };
#define I_GATE(_clk, _rst, _rdy, _midle, _scon, _mirack, _mistat) \ #define I_GATE(_clk, _rst, _rdy, _midle, _scon, _mirack, _mistat) \
{ .gate = _clk, .reset = _rst, \ { .gate = _clk, .reset = _rst, \

View File

@@ -381,6 +381,7 @@ static struct clk_div_table ths_div_table[] = {
{ .val = 1, .div = 2 }, { .val = 1, .div = 2 },
{ .val = 2, .div = 4 }, { .val = 2, .div = 4 },
{ .val = 3, .div = 6 }, { .val = 3, .div = 6 },
{ /* Sentinel */ },
}; };
static const char * const ths_parents[] = { "osc24M" }; static const char * const ths_parents[] = { "osc24M" };
static struct ccu_div ths_clk = { static struct ccu_div ths_clk = {

View File

@@ -328,6 +328,7 @@ static struct clk_div_table ths_div_table[] = {
{ .val = 1, .div = 2 }, { .val = 1, .div = 2 },
{ .val = 2, .div = 4 }, { .val = 2, .div = 4 },
{ .val = 3, .div = 6 }, { .val = 3, .div = 6 },
{ /* Sentinel */ },
}; };
static SUNXI_CCU_DIV_TABLE_WITH_GATE(ths_clk, "ths", "osc24M", static SUNXI_CCU_DIV_TABLE_WITH_GATE(ths_clk, "ths", "osc24M",
0x074, 0, 2, ths_div_table, BIT(31), 0); 0x074, 0, 2, ths_div_table, BIT(31), 0);

View File

@@ -233,6 +233,7 @@ enum clk_id {
tegra_clk_sdmmc4, tegra_clk_sdmmc4,
tegra_clk_sdmmc4_8, tegra_clk_sdmmc4_8,
tegra_clk_se, tegra_clk_se,
tegra_clk_se_10,
tegra_clk_soc_therm, tegra_clk_soc_therm,
tegra_clk_soc_therm_8, tegra_clk_soc_therm_8,
tegra_clk_sor0, tegra_clk_sor0,

View File

@@ -650,7 +650,7 @@ static struct tegra_periph_init_data periph_clks[] = {
INT8("host1x", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_HOST1X, 28, 0, tegra_clk_host1x_8), INT8("host1x", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_HOST1X, 28, 0, tegra_clk_host1x_8),
INT8("host1x", mux_pllc4_out1_pllc_pllc4_out2_pllp_clkm_plla_pllc4_out0, CLK_SOURCE_HOST1X, 28, 0, tegra_clk_host1x_9), INT8("host1x", mux_pllc4_out1_pllc_pllc4_out2_pllp_clkm_plla_pllc4_out0, CLK_SOURCE_HOST1X, 28, 0, tegra_clk_host1x_9),
INT8("se", mux_pllp_pllc2_c_c3_pllm_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se), INT8("se", mux_pllp_pllc2_c_c3_pllm_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se),
INT8("se", mux_pllp_pllc2_c_c3_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se), INT8("se", mux_pllp_pllc2_c_c3_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se_10),
INT8("2d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_2D, 21, 0, tegra_clk_gr2d_8), INT8("2d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_2D, 21, 0, tegra_clk_gr2d_8),
INT8("3d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_3D, 24, 0, tegra_clk_gr3d_8), INT8("3d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_3D, 24, 0, tegra_clk_gr3d_8),
INT8("vic03", mux_pllm_pllc_pllp_plla_pllc2_c3_clkm, CLK_SOURCE_VIC03, 178, 0, tegra_clk_vic03), INT8("vic03", mux_pllm_pllc_pllp_plla_pllc2_c3_clkm, CLK_SOURCE_VIC03, 178, 0, tegra_clk_vic03),

View File

@@ -497,6 +497,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd,
{ {
struct clk_init_data *init; struct clk_init_data *init;
struct fapll_synth *synth; struct fapll_synth *synth;
struct clk *clk = ERR_PTR(-ENOMEM);
init = kzalloc(sizeof(*init), GFP_KERNEL); init = kzalloc(sizeof(*init), GFP_KERNEL);
if (!init) if (!init)
@@ -519,13 +520,19 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd,
synth->hw.init = init; synth->hw.init = init;
synth->clk_pll = pll_clk; synth->clk_pll = pll_clk;
return clk_register(NULL, &synth->hw); clk = clk_register(NULL, &synth->hw);
if (IS_ERR(clk)) {
pr_err("failed to register clock\n");
goto free;
}
return clk;
free: free:
kfree(synth); kfree(synth);
kfree(init); kfree(init);
return ERR_PTR(-ENOMEM); return clk;
} }
static void __init ti_fapll_setup(struct device_node *node) static void __init ti_fapll_setup(struct device_node *node)

View File

@@ -829,15 +829,24 @@ static void arch_timer_evtstrm_enable(int divider)
static void arch_timer_configure_evtstream(void) static void arch_timer_configure_evtstream(void)
{ {
int evt_stream_div, pos; int evt_stream_div, lsb;
/*
* As the event stream can at most be generated at half the frequency
* of the counter, use half the frequency when computing the divider.
*/
evt_stream_div = arch_timer_rate / ARCH_TIMER_EVT_STREAM_FREQ / 2;
/*
* Find the closest power of two to the divisor. If the adjacent bit
* of lsb (last set bit, starts from 0) is set, then we use (lsb + 1).
*/
lsb = fls(evt_stream_div) - 1;
if (lsb > 0 && (evt_stream_div & BIT(lsb - 1)))
lsb++;
/* Find the closest power of two to the divisor */
evt_stream_div = arch_timer_rate / ARCH_TIMER_EVT_STREAM_FREQ;
pos = fls(evt_stream_div);
if (pos > 1 && !(evt_stream_div & (1 << (pos - 2))))
pos--;
/* enable event stream */ /* enable event stream */
arch_timer_evtstrm_enable(min(pos, 15)); arch_timer_evtstrm_enable(max(0, min(lsb, 15)));
} }
static void arch_counter_set_user_access(void) static void arch_counter_set_user_access(void)

View File

@@ -419,10 +419,8 @@ static int __init ttc_setup_clockevent(struct clk *clk,
ttcce->ttc.clk = clk; ttcce->ttc.clk = clk;
err = clk_prepare_enable(ttcce->ttc.clk); err = clk_prepare_enable(ttcce->ttc.clk);
if (err) { if (err)
kfree(ttcce); goto out_kfree;
return err;
}
ttcce->ttc.clk_rate_change_nb.notifier_call = ttcce->ttc.clk_rate_change_nb.notifier_call =
ttc_rate_change_clockevent_cb; ttc_rate_change_clockevent_cb;
@@ -432,7 +430,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
&ttcce->ttc.clk_rate_change_nb); &ttcce->ttc.clk_rate_change_nb);
if (err) { if (err) {
pr_warn("Unable to register clock notifier.\n"); pr_warn("Unable to register clock notifier.\n");
return err; goto out_kfree;
} }
ttcce->ttc.freq = clk_get_rate(ttcce->ttc.clk); ttcce->ttc.freq = clk_get_rate(ttcce->ttc.clk);
@@ -461,15 +459,17 @@ static int __init ttc_setup_clockevent(struct clk *clk,
err = request_irq(irq, ttc_clock_event_interrupt, err = request_irq(irq, ttc_clock_event_interrupt,
IRQF_TIMER, ttcce->ce.name, ttcce); IRQF_TIMER, ttcce->ce.name, ttcce);
if (err) { if (err)
kfree(ttcce); goto out_kfree;
return err;
}
clockevents_config_and_register(&ttcce->ce, clockevents_config_and_register(&ttcce->ce,
ttcce->ttc.freq / PRESCALE, 1, 0xfffe); ttcce->ttc.freq / PRESCALE, 1, 0xfffe);
return 0; return 0;
out_kfree:
kfree(ttcce);
return err;
} }
/** /**

View File

@@ -104,6 +104,13 @@ static int hb_cpufreq_driver_init(void)
} }
module_init(hb_cpufreq_driver_init); module_init(hb_cpufreq_driver_init);
static const struct of_device_id __maybe_unused hb_cpufreq_of_match[] = {
{ .compatible = "calxeda,highbank" },
{ .compatible = "calxeda,ecx-2000" },
{ },
};
MODULE_DEVICE_TABLE(of, hb_cpufreq_of_match);
MODULE_AUTHOR("Mark Langsdorf <mark.langsdorf@calxeda.com>"); MODULE_AUTHOR("Mark Langsdorf <mark.langsdorf@calxeda.com>");
MODULE_DESCRIPTION("Calxeda Highbank cpufreq driver"); MODULE_DESCRIPTION("Calxeda Highbank cpufreq driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");

View File

@@ -217,6 +217,7 @@ static struct platform_driver ls1x_cpufreq_platdrv = {
module_platform_driver(ls1x_cpufreq_platdrv); module_platform_driver(ls1x_cpufreq_platdrv);
MODULE_ALIAS("platform:ls1x-cpufreq");
MODULE_AUTHOR("Kelvin Cheung <keguang.zhang@gmail.com>"); MODULE_AUTHOR("Kelvin Cheung <keguang.zhang@gmail.com>");
MODULE_DESCRIPTION("Loongson1 CPUFreq driver"); MODULE_DESCRIPTION("Loongson1 CPUFreq driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");

View File

@@ -554,6 +554,7 @@ static const struct of_device_id mtk_cpufreq_machines[] __initconst = {
{ } { }
}; };
MODULE_DEVICE_TABLE(of, mtk_cpufreq_machines);
static int __init mtk_cpufreq_driver_init(void) static int __init mtk_cpufreq_driver_init(void)
{ {

View File

@@ -252,6 +252,7 @@ static struct platform_driver scpi_cpufreq_platdrv = {
}; };
module_platform_driver(scpi_cpufreq_platdrv); module_platform_driver(scpi_cpufreq_platdrv);
MODULE_ALIAS("platform:scpi-cpufreq");
MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>"); MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>");
MODULE_DESCRIPTION("ARM SCPI CPUFreq interface driver"); MODULE_DESCRIPTION("ARM SCPI CPUFreq interface driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");

View File

@@ -295,6 +295,13 @@ static int sti_cpufreq_init(void)
} }
module_init(sti_cpufreq_init); module_init(sti_cpufreq_init);
static const struct of_device_id __maybe_unused sti_cpufreq_of_match[] = {
{ .compatible = "st,stih407" },
{ .compatible = "st,stih410" },
{ },
};
MODULE_DEVICE_TABLE(of, sti_cpufreq_of_match);
MODULE_DESCRIPTION("STMicroelectronics CPUFreq/OPP driver"); MODULE_DESCRIPTION("STMicroelectronics CPUFreq/OPP driver");
MODULE_AUTHOR("Ajitpal Singh <ajitpal.singh@st.com>"); MODULE_AUTHOR("Ajitpal Singh <ajitpal.singh@st.com>");
MODULE_AUTHOR("Lee Jones <lee.jones@linaro.org>"); MODULE_AUTHOR("Lee Jones <lee.jones@linaro.org>");

View File

@@ -926,7 +926,7 @@ int crypto4xx_build_pd(struct crypto_async_request *req,
} }
pd->pd_ctl.w = PD_CTL_HOST_READY | pd->pd_ctl.w = PD_CTL_HOST_READY |
((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) | ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) ||
(crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ?
PD_CTL_HASH_FINAL : 0); PD_CTL_HASH_FINAL : 0);
pd->pd_ctl_len.w = 0x00400000 | (assoclen + datalen); pd->pd_ctl_len.w = 0x00400000 | (assoclen + datalen);

View File

@@ -1066,7 +1066,7 @@ static int safexcel_probe(struct platform_device *pdev)
priv->ring[i].rdr_req = devm_kcalloc(dev, priv->ring[i].rdr_req = devm_kcalloc(dev,
EIP197_DEFAULT_RING_SIZE, EIP197_DEFAULT_RING_SIZE,
sizeof(priv->ring[i].rdr_req), sizeof(*priv->ring[i].rdr_req),
GFP_KERNEL); GFP_KERNEL);
if (!priv->ring[i].rdr_req) { if (!priv->ring[i].rdr_req) {
ret = -ENOMEM; ret = -ENOMEM;

View File

@@ -1163,7 +1163,7 @@ static int omap_aes_probe(struct platform_device *pdev)
if (err < 0) { if (err < 0) {
dev_err(dev, "%s: failed to get_sync(%d)\n", dev_err(dev, "%s: failed to get_sync(%d)\n",
__func__, err); __func__, err);
goto err_res; goto err_pm_disable;
} }
omap_aes_dma_stop(dd); omap_aes_dma_stop(dd);
@@ -1276,6 +1276,7 @@ static int omap_aes_probe(struct platform_device *pdev)
omap_aes_dma_cleanup(dd); omap_aes_dma_cleanup(dd);
err_irq: err_irq:
tasklet_kill(&dd->done_task); tasklet_kill(&dd->done_task);
err_pm_disable:
pm_runtime_disable(dev); pm_runtime_disable(dev);
err_res: err_res:
dd = NULL; dd = NULL;

View File

@@ -1189,7 +1189,7 @@ static int qat_hal_put_rel_rd_xfer(struct icp_qat_fw_loader_handle *handle,
unsigned short mask; unsigned short mask;
unsigned short dr_offset = 0x10; unsigned short dr_offset = 0x10;
status = ctx_enables = qat_hal_rd_ae_csr(handle, ae, CTX_ENABLES); ctx_enables = qat_hal_rd_ae_csr(handle, ae, CTX_ENABLES);
if (CE_INUSE_CONTEXTS & ctx_enables) { if (CE_INUSE_CONTEXTS & ctx_enables) {
if (ctx & 0x1) { if (ctx & 0x1) {
pr_err("QAT: bad 4-ctx mode,ctx=0x%x\n", ctx); pr_err("QAT: bad 4-ctx mode,ctx=0x%x\n", ctx);

View File

@@ -474,7 +474,7 @@ DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE)
/* /*
* locate current (offending) descriptor * locate current (offending) descriptor
*/ */
static u32 current_desc_hdr(struct device *dev, int ch) static __be32 current_desc_hdr(struct device *dev, int ch)
{ {
struct talitos_private *priv = dev_get_drvdata(dev); struct talitos_private *priv = dev_get_drvdata(dev);
int tail, iter; int tail, iter;
@@ -492,7 +492,7 @@ static u32 current_desc_hdr(struct device *dev, int ch)
iter = tail; iter = tail;
while (priv->chan[ch].fifo[iter].dma_desc != cur_desc && while (priv->chan[ch].fifo[iter].dma_desc != cur_desc &&
priv->chan[ch].fifo[iter].desc->next_desc != cur_desc) { priv->chan[ch].fifo[iter].desc->next_desc != cpu_to_be32(cur_desc)) {
iter = (iter + 1) & (priv->fifo_len - 1); iter = (iter + 1) & (priv->fifo_len - 1);
if (iter == tail) { if (iter == tail) {
dev_err(dev, "couldn't locate current descriptor\n"); dev_err(dev, "couldn't locate current descriptor\n");
@@ -500,7 +500,7 @@ static u32 current_desc_hdr(struct device *dev, int ch)
} }
} }
if (priv->chan[ch].fifo[iter].desc->next_desc == cur_desc) { if (priv->chan[ch].fifo[iter].desc->next_desc == cpu_to_be32(cur_desc)) {
struct talitos_edesc *edesc; struct talitos_edesc *edesc;
edesc = container_of(priv->chan[ch].fifo[iter].desc, edesc = container_of(priv->chan[ch].fifo[iter].desc,
@@ -515,13 +515,13 @@ static u32 current_desc_hdr(struct device *dev, int ch)
/* /*
* user diagnostics; report root cause of error based on execution unit status * user diagnostics; report root cause of error based on execution unit status
*/ */
static void report_eu_error(struct device *dev, int ch, u32 desc_hdr) static void report_eu_error(struct device *dev, int ch, __be32 desc_hdr)
{ {
struct talitos_private *priv = dev_get_drvdata(dev); struct talitos_private *priv = dev_get_drvdata(dev);
int i; int i;
if (!desc_hdr) if (!desc_hdr)
desc_hdr = in_be32(priv->chan[ch].reg + TALITOS_DESCBUF); desc_hdr = cpu_to_be32(in_be32(priv->chan[ch].reg + TALITOS_DESCBUF));
switch (desc_hdr & DESC_HDR_SEL0_MASK) { switch (desc_hdr & DESC_HDR_SEL0_MASK) {
case DESC_HDR_SEL0_AFEU: case DESC_HDR_SEL0_AFEU:

View File

@@ -777,8 +777,10 @@ static int mv_xor_v2_probe(struct platform_device *pdev)
goto disable_clk; goto disable_clk;
msi_desc = first_msi_entry(&pdev->dev); msi_desc = first_msi_entry(&pdev->dev);
if (!msi_desc) if (!msi_desc) {
ret = -ENODEV;
goto free_msi_irqs; goto free_msi_irqs;
}
xor_dev->msi_desc = msi_desc; xor_dev->msi_desc = msi_desc;
ret = devm_request_irq(&pdev->dev, msi_desc->irq, ret = devm_request_irq(&pdev->dev, msi_desc->irq,

View File

@@ -18,6 +18,9 @@ static struct msr __percpu *msrs;
/* Per-node stuff */ /* Per-node stuff */
static struct ecc_settings **ecc_stngs; static struct ecc_settings **ecc_stngs;
/* Device for the PCI component */
static struct device *pci_ctl_dev;
/* /*
* Valid scrub rates for the K8 hardware memory scrubber. We map the scrubbing * Valid scrub rates for the K8 hardware memory scrubber. We map the scrubbing
* bandwidth to a valid bit pattern. The 'set' operation finds the 'matching- * bandwidth to a valid bit pattern. The 'set' operation finds the 'matching-
@@ -2563,6 +2566,9 @@ reserve_mc_sibling_devs(struct amd64_pvt *pvt, u16 pci_id1, u16 pci_id2)
return -ENODEV; return -ENODEV;
} }
if (!pci_ctl_dev)
pci_ctl_dev = &pvt->F0->dev;
edac_dbg(1, "F0: %s\n", pci_name(pvt->F0)); edac_dbg(1, "F0: %s\n", pci_name(pvt->F0));
edac_dbg(1, "F3: %s\n", pci_name(pvt->F3)); edac_dbg(1, "F3: %s\n", pci_name(pvt->F3));
edac_dbg(1, "F6: %s\n", pci_name(pvt->F6)); edac_dbg(1, "F6: %s\n", pci_name(pvt->F6));
@@ -2587,6 +2593,9 @@ reserve_mc_sibling_devs(struct amd64_pvt *pvt, u16 pci_id1, u16 pci_id2)
return -ENODEV; return -ENODEV;
} }
if (!pci_ctl_dev)
pci_ctl_dev = &pvt->F2->dev;
edac_dbg(1, "F1: %s\n", pci_name(pvt->F1)); edac_dbg(1, "F1: %s\n", pci_name(pvt->F1));
edac_dbg(1, "F2: %s\n", pci_name(pvt->F2)); edac_dbg(1, "F2: %s\n", pci_name(pvt->F2));
edac_dbg(1, "F3: %s\n", pci_name(pvt->F3)); edac_dbg(1, "F3: %s\n", pci_name(pvt->F3));
@@ -3441,21 +3450,10 @@ static void remove_one_instance(unsigned int nid)
static void setup_pci_device(void) static void setup_pci_device(void)
{ {
struct mem_ctl_info *mci;
struct amd64_pvt *pvt;
if (pci_ctl) if (pci_ctl)
return; return;
mci = edac_mc_find(0); pci_ctl = edac_pci_create_generic_ctl(pci_ctl_dev, EDAC_MOD_STR);
if (!mci)
return;
pvt = mci->pvt_info;
if (pvt->umc)
pci_ctl = edac_pci_create_generic_ctl(&pvt->F0->dev, EDAC_MOD_STR);
else
pci_ctl = edac_pci_create_generic_ctl(&pvt->F2->dev, EDAC_MOD_STR);
if (!pci_ctl) { if (!pci_ctl) {
pr_warn("%s(): Unable to create PCI control\n", __func__); pr_warn("%s(): Unable to create PCI control\n", __func__);
pr_warn("%s(): PCI error report via EDAC not set\n", __func__); pr_warn("%s(): PCI error report via EDAC not set\n", __func__);
@@ -3535,6 +3533,8 @@ static int __init amd64_edac_init(void)
return 0; return 0;
err_pci: err_pci:
pci_ctl_dev = NULL;
msrs_free(msrs); msrs_free(msrs);
msrs = NULL; msrs = NULL;
@@ -3566,6 +3566,8 @@ static void __exit amd64_edac_exit(void)
kfree(ecc_stngs); kfree(ecc_stngs);
ecc_stngs = NULL; ecc_stngs = NULL;
pci_ctl_dev = NULL;
msrs_free(msrs); msrs_free(msrs);
msrs = NULL; msrs = NULL;
} }

View File

@@ -1275,4 +1275,4 @@ module_platform_driver(max77693_muic_driver);
MODULE_DESCRIPTION("Maxim MAX77693 Extcon driver"); MODULE_DESCRIPTION("Maxim MAX77693 Extcon driver");
MODULE_AUTHOR("Chanwoo Choi <cw00.choi@samsung.com>"); MODULE_AUTHOR("Chanwoo Choi <cw00.choi@samsung.com>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:extcon-max77693"); MODULE_ALIAS("platform:max77693-muic");

View File

@@ -599,7 +599,7 @@ static int sprd_eic_probe(struct platform_device *pdev)
*/ */
res = platform_get_resource(pdev, IORESOURCE_MEM, i); res = platform_get_resource(pdev, IORESOURCE_MEM, i);
if (!res) if (!res)
continue; break;
sprd_eic->base[i] = devm_ioremap_resource(&pdev->dev, res); sprd_eic->base[i] = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(sprd_eic->base[i])) if (IS_ERR(sprd_eic->base[i]))

View File

@@ -1191,6 +1191,13 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip); devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip);
/* Some MVEBU SoCs have simple PWM support for GPIO lines */
if (IS_ENABLED(CONFIG_PWM)) {
err = mvebu_pwm_probe(pdev, mvchip, id);
if (err)
return err;
}
/* Some gpio controllers do not provide irq support */ /* Some gpio controllers do not provide irq support */
if (!have_irqs) if (!have_irqs)
return 0; return 0;
@@ -1200,7 +1207,8 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
if (!mvchip->domain) { if (!mvchip->domain) {
dev_err(&pdev->dev, "couldn't allocate irq domain %s (DT).\n", dev_err(&pdev->dev, "couldn't allocate irq domain %s (DT).\n",
mvchip->chip.label); mvchip->chip.label);
return -ENODEV; err = -ENODEV;
goto err_pwm;
} }
err = irq_alloc_domain_generic_chips( err = irq_alloc_domain_generic_chips(
@@ -1248,14 +1256,12 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
mvchip); mvchip);
} }
/* Some MVEBU SoCs have simple PWM support for GPIO lines */
if (IS_ENABLED(CONFIG_PWM))
return mvebu_pwm_probe(pdev, mvchip, id);
return 0; return 0;
err_domain: err_domain:
irq_domain_remove(mvchip->domain); irq_domain_remove(mvchip->domain);
err_pwm:
pwmchip_remove(&mvchip->mvpwm->chip);
return err; return err;
} }

View File

@@ -60,7 +60,7 @@ static struct drm_dp_aux_dev *drm_dp_aux_dev_get_by_minor(unsigned index)
mutex_lock(&aux_idr_mutex); mutex_lock(&aux_idr_mutex);
aux_dev = idr_find(&aux_idr, index); aux_dev = idr_find(&aux_idr, index);
if (!kref_get_unless_zero(&aux_dev->refcount)) if (aux_dev && !kref_get_unless_zero(&aux_dev->refcount))
aux_dev = NULL; aux_dev = NULL;
mutex_unlock(&aux_idr_mutex); mutex_unlock(&aux_idr_mutex);

View File

@@ -2767,11 +2767,11 @@ bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr,
{ {
int ret; int ret;
port = drm_dp_get_validated_port_ref(mgr, port); if (slots < 0)
if (!port)
return false; return false;
if (slots < 0) port = drm_dp_get_validated_port_ref(mgr, port);
if (!port)
return false; return false;
if (port->vcpi.vcpi > 0) { if (port->vcpi.vcpi > 0) {
@@ -2786,6 +2786,7 @@ bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr,
if (ret) { if (ret) {
DRM_DEBUG_KMS("failed to init vcpi slots=%d max=63 ret=%d\n", DRM_DEBUG_KMS("failed to init vcpi slots=%d max=63 ret=%d\n",
DIV_ROUND_UP(pbn, mgr->pbn_div), ret); DIV_ROUND_UP(pbn, mgr->pbn_div), ret);
drm_dp_put_port(port);
goto out; goto out;
} }
DRM_DEBUG_KMS("initing vcpi for pbn=%d slots=%d\n", DRM_DEBUG_KMS("initing vcpi for pbn=%d slots=%d\n",

View File

@@ -2124,7 +2124,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev
DRM_INFO("failed to retrieve link info, disabling eDP\n"); DRM_INFO("failed to retrieve link info, disabling eDP\n");
cdv_intel_dp_encoder_destroy(encoder); cdv_intel_dp_encoder_destroy(encoder);
cdv_intel_dp_destroy(connector); cdv_intel_dp_destroy(connector);
goto err_priv; goto err_connector;
} else { } else {
DRM_DEBUG_KMS("DPCD: Rev=%x LN_Rate=%x LN_CNT=%x LN_DOWNSP=%x\n", DRM_DEBUG_KMS("DPCD: Rev=%x LN_Rate=%x LN_CNT=%x LN_DOWNSP=%x\n",
intel_dp->dpcd[0], intel_dp->dpcd[1], intel_dp->dpcd[0], intel_dp->dpcd[1],

Some files were not shown because too many files have changed in this diff Show More