This is the 4.19.238 stable release

-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmJZYdEACgkQONu9yGCS
 aT4TOA//QvLAUigiHT1OP1mgJtr4p8EIeCtB26Z7U+PDpe1bq2XojW1Qosflcp26
 /7auxf503Ju+wjKFjqzAD3Nwvl11M8Be/YOjJdAU5XHNO3eD2O+1Nwk8t1XELF1S
 xA7QUk9OjrAosjrH1QpUOVB5nZps8qSB83QwfUAE8j0qvWvio3zxrRbv+aWyaP+P
 n7B7kxMLL65Obvgkkepn5247t2v1kiauZSmigr7e0i7OZ5af3uEscg3gUDLOsfud
 ib1VmKGXMQHnyV6FRrPMMrZwcKutc55wGMG/XOCIRzCS5MUgtDRU9biNzsxS+w8W
 DO83BD01LIWKJ4Z6yhBTlR2IVCH9dW2zGbXDWXvCk4FD4+mpwJYfV64mAS/OUPI4
 j61l9pKvDipRTsoTq9EZ7aNJv99O+L9abxQMRIHa0z/NrOaqmhd4VKvlw+BU8x9a
 vbNY4B0A3WBWe+rSVVKurxT1YIyrLiSmcTrXQn+ViptOZrAvlUcTqf5NU6JXVLiT
 RZJscnEV5uMDanxictWmp1zWsy1pqv9NQiKNXcJ31AnUN7+xT722H26Z7bX0a5/3
 HJ97zwgsfgJfePhXGW7HUh7/NRNfzYha0VkYxPkE7vMQ6P3UjniE4R+Kg+QiNdGR
 Fil85X0KiOOAuwWpS36Aj2vmvV6QmMWJZh9HSSpRMIpTbKAU+t4=
 =fkd3
 -----END PGP SIGNATURE-----

Merge 4.19.238 into android-4.19-stable

Changes in 4.19.238
	USB: serial: pl2303: add IBM device IDs
	USB: serial: simple: add Nokia phone driver
	netdevice: add the case if dev is NULL
	xfrm: fix tunnel model fragmentation behavior
	virtio_console: break out of buf poll on remove
	ethernet: sun: Free the coherent when failing in probing
	spi: Fix invalid sgs value
	net:mcf8390: Use platform_get_irq() to get the interrupt
	spi: Fix erroneous sgs value with min_t()
	af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register
	fuse: fix pipe buffer lifetime for direct_io
	tpm: fix reference counting for struct tpm_chip
	block: Add a helper to validate the block size
	virtio-blk: Use blk_validate_block_size() to validate block size
	USB: usb-storage: Fix use of bitfields for hardware data in ene_ub6250.c
	xhci: make xhci_handshake timeout for xhci_reset() adjustable
	coresight: Fix TRCCONFIGR.QE sysfs interface
	iio: afe: rescale: use s64 for temporary scale calculations
	iio: inkern: apply consumer scale on IIO_VAL_INT cases
	iio: inkern: apply consumer scale when no channel scale is available
	iio: inkern: make a best effort on offset calculation
	clk: uniphier: Fix fixed-rate initialization
	ptrace: Check PTRACE_O_SUSPEND_SECCOMP permission on PTRACE_SEIZE
	Documentation: add link to stable release candidate tree
	Documentation: update stable tree link
	SUNRPC: avoid race between mod_timer() and del_timer_sync()
	NFSD: prevent underflow in nfssvc_decode_writeargs()
	NFSD: prevent integer overflow on 32 bit systems
	f2fs: fix to unlock page correctly in error path of is_alive()
	pinctrl: samsung: drop pin banks references on error paths
	can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path
	jffs2: fix use-after-free in jffs2_clear_xattr_subsystem
	jffs2: fix memory leak in jffs2_do_mount_fs
	jffs2: fix memory leak in jffs2_scan_medium
	mm/pages_alloc.c: don't create ZONE_MOVABLE beyond the end of a node
	mm: invalidate hwpoison page cache page in fault path
	mempolicy: mbind_range() set_policy() after vma_merge()
	scsi: libsas: Fix sas_ata_qc_issue() handling of NCQ NON DATA commands
	qed: display VF trust config
	qed: validate and restrict untrusted VFs vlan promisc mode
	Revert "Input: clear BTN_RIGHT/MIDDLE on buttonpads"
	ALSA: cs4236: fix an incorrect NULL check on list iterator
	ALSA: hda/realtek: Fix audio regression on Mi Notebook Pro 2020
	mm,hwpoison: unmap poisoned page before invalidation
	drbd: fix potential silent data corruption
	powerpc/kvm: Fix kvm_use_magic_page
	ACPI: properties: Consistently return -ENOENT if there are no more references
	drivers: hamradio: 6pack: fix UAF bug caused by mod_timer()
	block: don't merge across cgroup boundaries if blkcg is enabled
	drm/edid: check basic audio support on CEA extension block
	video: fbdev: sm712fb: Fix crash in smtcfb_read()
	video: fbdev: atari: Atari 2 bpp (STe) palette bugfix
	ARM: dts: at91: sama5d2: Fix PMERRLOC resource size
	ARM: dts: exynos: fix UART3 pins configuration in Exynos5250
	ARM: dts: exynos: add missing HDMI supplies on SMDK5250
	ARM: dts: exynos: add missing HDMI supplies on SMDK5420
	carl9170: fix missing bit-wise or operator for tx_params
	thermal: int340x: Increase bitmap size
	lib/raid6/test: fix multiple definition linking error
	DEC: Limit PMAX memory probing to R3k systems
	media: davinci: vpif: fix unbalanced runtime PM get
	brcmfmac: firmware: Allocate space for default boardrev in nvram
	brcmfmac: pcie: Replace brcmf_pcie_copy_mem_todev with memcpy_toio
	PCI: pciehp: Clear cmd_busy bit in polling mode
	regulator: qcom_smd: fix for_each_child.cocci warnings
	crypto: authenc - Fix sleep in atomic context in decrypt_tail
	crypto: mxs-dcp - Fix scatterlist processing
	spi: tegra114: Add missing IRQ check in tegra_spi_probe
	selftests/x86: Add validity check and allow field splitting
	spi: pxa2xx-pci: Balance reference count for PCI DMA device
	hwmon: (pmbus) Add mutex to regulator ops
	hwmon: (sch56xx-common) Replace WDOG_ACTIVE with WDOG_HW_RUNNING
	block: don't delete queue kobject before its children
	PM: hibernate: fix __setup handler error handling
	PM: suspend: fix return value of __setup handler
	hwrng: atmel - disable trng on failure path
	crypto: vmx - add missing dependencies
	clocksource/drivers/timer-of: Check return value of of_iomap in timer_of_base_init()
	ACPI: APEI: fix return value of __setup handlers
	crypto: ccp - ccp_dmaengine_unregister release dma channels
	hwmon: (pmbus) Add Vin unit off handling
	clocksource: acpi_pm: fix return value of __setup handler
	sched/debug: Remove mpol_get/put and task_lock/unlock from sched_show_numa
	perf/core: Fix address filter parser for multiple filters
	perf/x86/intel/pt: Fix address filter config for 32-bit kernel
	media: coda: Fix missing put_device() call in coda_get_vdoa_data
	video: fbdev: smscufx: Fix null-ptr-deref in ufx_usb_probe()
	video: fbdev: fbcvt.c: fix printing in fb_cvt_print_name()
	ARM: dts: qcom: ipq4019: fix sleep clock
	soc: ti: wkup_m3_ipc: Fix IRQ check in wkup_m3_ipc_probe
	media: em28xx: initialize refcount before kref_get
	media: usb: go7007: s2250-board: fix leak in probe()
	ASoC: rt5663: check the return value of devm_kzalloc() in rt5663_parse_dp()
	ASoC: ti: davinci-i2s: Add check for clk_enable()
	ALSA: spi: Add check for clk_enable()
	arm64: dts: ns2: Fix spi-cpol and spi-cpha property
	arm64: dts: broadcom: Fix sata nodename
	printk: fix return value of printk.devkmsg __setup handler
	ASoC: mxs-saif: Handle errors for clk_enable
	ASoC: atmel_ssc_dai: Handle errors for clk_enable
	memory: emif: Add check for setup_interrupts
	memory: emif: check the pointer temp in get_device_details()
	ALSA: firewire-lib: fix uninitialized flag for AV/C deferred transaction
	media: stk1160: If start stream fails, return buffers with VB2_BUF_STATE_QUEUED
	ASoC: atmel: Add missing of_node_put() in at91sam9g20ek_audio_probe
	ASoC: wm8350: Handle error for wm8350_register_irq
	ASoC: fsi: Add check for clk_enable
	video: fbdev: omapfb: Add missing of_node_put() in dvic_probe_of
	ASoC: dmaengine: do not use a NULL prepare_slave_config() callback
	ASoC: mxs: Fix error handling in mxs_sgtl5000_probe
	ASoC: imx-es8328: Fix error return code in imx_es8328_probe()
	ASoC: msm8916-wcd-digital: Fix missing clk_disable_unprepare() in msm8916_wcd_digital_probe
	mmc: davinci_mmc: Handle error for clk_enable
	drm/bridge: Fix free wrong object in sii8620_init_rcp_input_dev
	ath10k: fix memory overwrite of the WoWLAN wakeup packet pattern
	Bluetooth: hci_serdev: call init_rwsem() before p->open()
	mtd: onenand: Check for error irq
	drm/edid: Don't clear formats if using deep color
	drm/amd/display: Fix a NULL pointer dereference in amdgpu_dm_connector_add_common_modes()
	ath9k_htc: fix uninit value bugs
	KVM: PPC: Fix vmx/vsx mixup in mmio emulation
	power: reset: gemini-poweroff: Fix IRQ check in gemini_poweroff_probe
	ray_cs: Check ioremap return value
	power: supply: ab8500: Fix memory leak in ab8500_fg_sysfs_init
	HID: i2c-hid: fix GET/SET_REPORT for unnumbered reports
	iwlwifi: Fix -EIO error code that is never returned
	dm crypt: fix get_key_size compiler warning if !CONFIG_KEYS
	scsi: pm8001: Fix command initialization in pm80XX_send_read_log()
	scsi: pm8001: Fix command initialization in pm8001_chip_ssp_tm_req()
	scsi: pm8001: Fix payload initialization in pm80xx_set_thermal_config()
	scsi: pm8001: Fix abort all task initialization
	TOMOYO: fix __setup handlers return values
	ext2: correct max file size computing
	drm/tegra: Fix reference leak in tegra_dsi_ganged_probe
	power: supply: bq24190_charger: Fix bq24190_vbus_is_enabled() wrong false return
	drm/bridge: cdns-dsi: Make sure to to create proper aliases for dt
	powerpc/Makefile: Don't pass -mcpu=powerpc64 when building 32-bit
	KVM: x86: Fix emulation in writing cr8
	KVM: x86/emulator: Defer not-present segment check in __load_segment_descriptor()
	hv_balloon: rate-limit "Unhandled message" warning
	i2c: xiic: Make bus names unique
	power: supply: wm8350-power: Handle error for wm8350_register_irq
	power: supply: wm8350-power: Add missing free in free_charger_irq
	PCI: Reduce warnings on possible RW1C corruption
	powerpc/sysdev: fix incorrect use to determine if list is empty
	mfd: mc13xxx: Add check for mc13xxx_irq_request
	vxcan: enable local echo for sent CAN frames
	MIPS: RB532: fix return value of __setup handler
	mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init
	USB: storage: ums-realtek: fix error code in rts51x_read_mem()
	af_netlink: Fix shift out of bounds in group mask calculation
	i2c: mux: demux-pinctrl: do not deactivate a master that is not active
	selftests/bpf/test_lirc_mode2.sh: Exit with proper code
	tcp: ensure PMTU updates are processed during fastopen
	mfd: asic3: Add missing iounmap() on error asic3_mfd_probe
	mxser: fix xmit_buf leak in activate when LSR == 0xff
	pwm: lpc18xx-sct: Initialize driver data and hardware before pwmchip_add()
	staging:iio:adc:ad7280a: Fix handing of device address bit reversing.
	clk: qcom: ipq8074: Use floor ops for SDCC1 clock
	serial: 8250_mid: Balance reference count for PCI DMA device
	serial: 8250: Fix race condition in RTS-after-send handling
	iio: adc: Add check for devm_request_threaded_irq
	dma-debug: fix return value of __setup handlers
	clk: qcom: clk-rcg2: Update the frac table for pixel clock
	remoteproc: qcom_wcnss: Add missing of_node_put() in wcnss_alloc_memory_region
	clk: actions: Terminate clk_div_table with sentinel element
	clk: loongson1: Terminate clk_div_table with sentinel element
	clk: clps711x: Terminate clk_div_table with sentinel element
	clk: tegra: tegra124-emc: Fix missing put_device() call in emc_ensure_emc_driver
	NFS: remove unneeded check in decode_devicenotify_args()
	pinctrl: mediatek: Fix missing of_node_put() in mtk_pctrl_init
	pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe
	pinctrl/rockchip: Add missing of_node_put() in rockchip_pinctrl_probe
	tty: hvc: fix return value of __setup handler
	kgdboc: fix return value of __setup handler
	kgdbts: fix return value of __setup handler
	jfs: fix divide error in dbNextAG
	netfilter: nf_conntrack_tcp: preserve liberal flag in tcp options
	clk: qcom: gcc-msm8994: Fix gpll4 width
	xen: fix is_xen_pmu()
	net: phy: broadcom: Fix brcm_fet_config_init()
	qlcnic: dcb: default to returning -EOPNOTSUPP
	net/x25: Fix null-ptr-deref caused by x25_disconnect
	NFSv4/pNFS: Fix another issue with a list iterator pointing to the head
	lib/test: use after free in register_test_dev_kmod()
	selinux: use correct type for context length
	loop: use sysfs_emit() in the sysfs xxx show()
	Fix incorrect type in assignment of ipv6 port for audit
	irqchip/qcom-pdc: Fix broken locking
	irqchip/nvic: Release nvic_base upon failure
	bfq: fix use-after-free in bfq_dispatch_request
	ACPICA: Avoid walking the ACPI Namespace if it is not there
	lib/raid6/test/Makefile: Use $(pound) instead of \# for Make 4.3
	Revert "Revert "block, bfq: honor already-setup queue merges""
	ACPI/APEI: Limit printable size of BERT table data
	PM: core: keep irq flags in device_pm_check_callbacks()
	spi: tegra20: Use of_device_get_match_data()
	ext4: don't BUG if someone dirty pages without asking ext4 first
	ntfs: add sanity check on allocation size
	video: fbdev: nvidiafb: Use strscpy() to prevent buffer overflow
	video: fbdev: w100fb: Reset global state
	video: fbdev: cirrusfb: check pixclock to avoid divide by zero
	video: fbdev: omapfb: acx565akm: replace snprintf with sysfs_emit
	ARM: dts: qcom: fix gic_irq_domain_translate warnings for msm8960
	ARM: dts: bcm2837: Add the missing L1/L2 cache information
	video: fbdev: omapfb: panel-dsi-cm: Use sysfs_emit() instead of snprintf()
	video: fbdev: omapfb: panel-tpo-td043mtea1: Use sysfs_emit() instead of snprintf()
	video: fbdev: udlfb: replace snprintf in show functions with sysfs_emit
	ASoC: soc-core: skip zero num_dai component in searching dai name
	media: cx88-mpeg: clear interrupt status register before streaming video
	ARM: tegra: tamonten: Fix I2C3 pad setting
	ARM: mmp: Fix failure to remove sram device
	video: fbdev: sm712fb: Fix crash in smtcfb_write()
	media: Revert "media: em28xx: add missing em28xx_close_extension"
	media: hdpvr: initialize dev->worker at hdpvr_register_videodev
	mmc: host: Return an error when ->enable_sdio_irq() ops is missing
	powerpc/lib/sstep: Fix 'sthcx' instruction
	powerpc/lib/sstep: Fix build errors with newer binutils
	powerpc: Fix build errors with newer binutils
	scsi: qla2xxx: Fix stuck session in gpdb
	scsi: qla2xxx: Fix warning for missing error code
	scsi: qla2xxx: Check for firmware dump already collected
	scsi: qla2xxx: Suppress a kernel complaint in qla_create_qpair()
	scsi: qla2xxx: Fix incorrect reporting of task management failure
	scsi: qla2xxx: Fix hang due to session stuck
	scsi: qla2xxx: Reduce false trigger to login
	scsi: qla2xxx: Use correct feature type field during RFF_ID processing
	KVM: Prevent module exit until all VMs are freed
	KVM: x86: fix sending PV IPI
	ubifs: rename_whiteout: Fix double free for whiteout_ui->data
	ubifs: Fix deadlock in concurrent rename whiteout and inode writeback
	ubifs: Add missing iput if do_tmpfile() failed in rename whiteout
	ubifs: setflags: Make dirtied_ino_d 8 bytes aligned
	ubifs: Fix read out-of-bounds in ubifs_wbuf_write_nolock()
	ubifs: rename_whiteout: correct old_dir size computing
	can: mcba_usb: mcba_usb_start_xmit(): fix double dev_kfree_skb in error path
	can: mcba_usb: properly check endpoint type
	gfs2: Make sure FITRIM minlen is rounded up to fs block size
	pinctrl: pinconf-generic: Print arguments for bias-pull-*
	ubi: Fix race condition between ctrl_cdev_ioctl and ubi_cdev_ioctl
	ACPI: CPPC: Avoid out of bounds access when parsing _CPC data
	mm/mmap: return 1 from stack_guard_gap __setup() handler
	mm/memcontrol: return 1 from cgroup.memory __setup() handler
	mm/usercopy: return 1 from hardened_usercopy __setup() handler
	bpf: Fix comment for helper bpf_current_task_under_cgroup()
	ubi: fastmap: Return error code if memory allocation fails in add_aeb()
	ASoC: topology: Allow TLV control to be either read or write
	ARM: dts: spear1340: Update serial node properties
	ARM: dts: spear13xx: Update SPI dma properties
	um: Fix uml_mconsole stop/go
	openvswitch: Fixed nd target mask field in the flow dump.
	KVM: x86: Forbid VMM to set SYNIC/STIMER MSRs when SynIC wasn't activated
	ubifs: Rectify space amount budget for mkdir/tmpfile operations
	rtc: wm8350: Handle error for wm8350_register_irq
	riscv module: remove (NOLOAD)
	ARM: 9187/1: JIVE: fix return value of __setup handler
	KVM: x86/svm: Clear reserved bits written to PerfEvtSeln MSRs
	drm: Add orientation quirk for GPD Win Max
	ath5k: fix OOB in ath5k_eeprom_read_pcal_info_5111
	drm/amd/amdgpu/amdgpu_cs: fix refcount leak of a dma_fence obj
	ptp: replace snprintf with sysfs_emit
	powerpc: dts: t104xrdb: fix phy type for FMAN 4/5
	scsi: mvsas: Replace snprintf() with sysfs_emit()
	scsi: bfa: Replace snprintf() with sysfs_emit()
	power: supply: axp20x_battery: properly report current when discharging
	powerpc: Set crashkernel offset to mid of RMA region
	PCI: aardvark: Fix support for MSI interrupts
	iommu/arm-smmu-v3: fix event handling soft lockup
	usb: ehci: add pci device support for Aspeed platforms
	PCI: pciehp: Add Qualcomm quirk for Command Completed erratum
	ipv4: Invalidate neighbour for broadcast address upon address addition
	dm ioctl: prevent potential spectre v1 gadget
	drm/amdkfd: make CRAT table missing message informational only
	scsi: pm8001: Fix pm8001_mpi_task_abort_resp()
	scsi: aha152x: Fix aha152x_setup() __setup handler return value
	net/smc: correct settings of RMB window update limit
	macvtap: advertise link netns via netlink
	bnxt_en: Eliminate unintended link toggle during FW reset
	MIPS: fix fortify panic when copying asm exception handlers
	scsi: libfc: Fix use after free in fc_exch_abts_resp()
	usb: dwc3: omap: fix "unbalanced disables for smps10_out1" on omap5evm
	xtensa: fix DTC warning unit_address_format
	Bluetooth: Fix use after free in hci_send_acl
	init/main.c: return 1 from handled __setup() functions
	minix: fix bug when opening a file with O_DIRECT
	w1: w1_therm: fixes w1_seq for ds28ea00 sensors
	NFSv4: Protect the state recovery thread against direct reclaim
	xen: delay xen_hvm_init_time_ops() if kdump is boot on vcpu>=32
	clk: Enforce that disjoints limits are invalid
	SUNRPC/call_alloc: async tasks mustn't block waiting for memory
	NFS: swap IO handling is slightly different for O_DIRECT IO
	NFS: swap-out must always use STABLE writes.
	serial: samsung_tty: do not unlock port->lock for uart_write_wakeup()
	virtio_console: eliminate anonymous module_init & module_exit
	jfs: prevent NULL deref in diFree
	parisc: Fix CPU affinity for Lasi, WAX and Dino chips
	net: add missing SOF_TIMESTAMPING_OPT_ID support
	mm: fix race between MADV_FREE reclaim and blkdev direct IO read
	KVM: arm64: Check arm64_get_bp_hardening_data() didn't return NULL
	drm/amdgpu: fix off by one in amdgpu_gfx_kiq_acquire()
	Drivers: hv: vmbus: Fix potential crash on module unload
	scsi: zorro7xx: Fix a resource leak in zorro7xx_remove_one()
	net: stmmac: Fix unset max_speed difference between DT and non-DT platforms
	drm/imx: Fix memory leak in imx_pd_connector_get_modes
	net: openvswitch: don't send internal clone attribute to the userspace.
	rxrpc: fix a race in rxrpc_exit_net()
	qede: confirm skb is allocated before using
	spi: bcm-qspi: fix MSPI only access with bcm_qspi_exec_mem_op()
	drbd: Fix five use after free bugs in get_initial_state
	Revert "mmc: sdhci-xenon: fix annoying 1.8V regulator warning"
	mmc: renesas_sdhi: don't overwrite TAP settings when HS400 tuning is complete
	mmmremap.c: avoid pointless invalidate_range_start/end on mremap(old_size=0)
	mm/mempolicy: fix mpol_new leak in shared_policy_replace
	x86/pm: Save the MSR validity status at context setup
	x86/speculation: Restore speculation related MSRs during S3 resume
	btrfs: fix qgroup reserve overflow the qgroup limit
	arm64: patch_text: Fixup last cpu should be master
	ata: sata_dwc_460ex: Fix crash due to OOB write
	perf: qcom_l2_pmu: fix an incorrect NULL check on list iterator
	irqchip/gic-v3: Fix GICR_CTLR.RWP polling
	tools build: Filter out options and warnings not supported by clang
	tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts
	dmaengine: Revert "dmaengine: shdma: Fix runtime PM imbalance on error"
	mm: don't skip swap entry even if zap_details specified
	arm64: module: remove (NOLOAD) from linker script
	mm/sparsemem: fix 'mem_section' will never be NULL gcc 12 warning
	cgroup: Use open-time credentials for process migraton perm checks
	cgroup: Allocate cgroup_file_ctx for kernfs_open_file->priv
	cgroup: Use open-time cgroup namespace for process migration perm checks
	selftests: cgroup: Make cg_create() use 0755 for permission instead of 0644
	selftests: cgroup: Test open-time credential usage for migration checks
	selftests: cgroup: Test open-time cgroup namespace usage for migration checks
	xfrm: policy: match with both mark and mask on user interfaces
	drm/amdgpu: Check if fd really is an amdgpu fd.
	drm/amdkfd: Use drm_priv to pass VM from KFD to amdgpu
	Linux 4.19.238

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I55a3615d2fbf9bde9ac152456701b36a6c9d20b6
This commit is contained in:
Greg Kroah-Hartman 2022-04-18 09:57:50 +02:00
commit ce7025b713
357 changed files with 2463 additions and 1110 deletions

View file

@ -174,7 +174,16 @@ Trees
- The finalized and tagged releases of all stable kernels can be found - The finalized and tagged releases of all stable kernels can be found
in separate branches per version at: in separate branches per version at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
- The release candidate of all stable kernel versions can be found at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/
.. warning::
The -stable-rc tree is a snapshot in time of the stable-queue tree and
will change frequently, hence will be rebased often. It should only be
used for testing purposes (e.g. to be consumed by CI systems).
Review committee Review committee

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 = 237 SUBLEVEL = 238
EXTRAVERSION = EXTRAVERSION =
NAME = "People's Front" NAME = "People's Front"

View file

@ -38,12 +38,26 @@
#size-cells = <0>; #size-cells = <0>;
enable-method = "brcm,bcm2836-smp"; // for ARM 32-bit enable-method = "brcm,bcm2836-smp"; // for ARM 32-bit
/* Source for d/i-cache-line-size and d/i-cache-sets
* https://developer.arm.com/documentation/ddi0500/e/level-1-memory-system
* /about-the-l1-memory-system?lang=en
*
* Source for d/i-cache-size
* https://magpi.raspberrypi.com/articles/raspberry-pi-3-specs-benchmarks
*/
cpu0: cpu@0 { cpu0: cpu@0 {
device_type = "cpu"; device_type = "cpu";
compatible = "arm,cortex-a53"; compatible = "arm,cortex-a53";
reg = <0>; reg = <0>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000d8>; cpu-release-addr = <0x0 0x000000d8>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
next-level-cache = <&l2>;
}; };
cpu1: cpu@1 { cpu1: cpu@1 {
@ -52,6 +66,13 @@
reg = <1>; reg = <1>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000e0>; cpu-release-addr = <0x0 0x000000e0>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
next-level-cache = <&l2>;
}; };
cpu2: cpu@2 { cpu2: cpu@2 {
@ -60,6 +81,13 @@
reg = <2>; reg = <2>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000e8>; cpu-release-addr = <0x0 0x000000e8>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
next-level-cache = <&l2>;
}; };
cpu3: cpu@3 { cpu3: cpu@3 {
@ -68,6 +96,27 @@
reg = <3>; reg = <3>;
enable-method = "spin-table"; enable-method = "spin-table";
cpu-release-addr = <0x0 0x000000f0>; cpu-release-addr = <0x0 0x000000f0>;
d-cache-size = <0x8000>;
d-cache-line-size = <64>;
d-cache-sets = <128>; // 32KiB(size)/64(line-size)=512ways/4-way set
i-cache-size = <0x8000>;
i-cache-line-size = <64>;
i-cache-sets = <256>; // 32KiB(size)/64(line-size)=512ways/2-way set
next-level-cache = <&l2>;
};
/* Source for cache-line-size + cache-sets
* https://developer.arm.com/documentation/ddi0500
* /e/level-2-memory-system/about-the-l2-memory-system?lang=en
* Source for cache-size
* https://datasheets.raspberrypi.com/cm/cm1-and-cm3-datasheet.pdf
*/
l2: l2-cache0 {
compatible = "cache";
cache-size = <0x80000>;
cache-line-size = <64>;
cache-sets = <512>; // 512KiB(size)/64(line-size)=8192ways/16-way set
cache-level = <2>;
}; };
}; };
}; };

View file

@ -260,7 +260,7 @@
}; };
uart3_data: uart3-data { uart3_data: uart3-data {
samsung,pins = "gpa1-4", "gpa1-4"; samsung,pins = "gpa1-4", "gpa1-5";
samsung,pin-function = <EXYNOS_PIN_FUNC_2>; samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>;
samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>; samsung,pin-drv = <EXYNOS4_PIN_DRV_LV1>;

View file

@ -116,6 +116,9 @@
status = "okay"; status = "okay";
ddc = <&i2c_2>; ddc = <&i2c_2>;
hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>; hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
vdd-supply = <&ldo8_reg>;
vdd_osc-supply = <&ldo10_reg>;
vdd_pll-supply = <&ldo8_reg>;
}; };
&i2c_0 { &i2c_0 {

View file

@ -131,6 +131,9 @@
hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>; hpd-gpios = <&gpx3 7 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default"; pinctrl-names = "default";
pinctrl-0 = <&hdmi_hpd_irq>; pinctrl-0 = <&hdmi_hpd_irq>;
vdd-supply = <&ldo6_reg>;
vdd_osc-supply = <&ldo7_reg>;
vdd_pll-supply = <&ldo6_reg>;
}; };
&hsi2c_4 { &hsi2c_4 {

View file

@ -135,7 +135,8 @@
clocks { clocks {
sleep_clk: sleep_clk { sleep_clk: sleep_clk {
compatible = "fixed-clock"; compatible = "fixed-clock";
clock-frequency = <32768>; clock-frequency = <32000>;
clock-output-names = "gcc_sleep_clk_src";
#clock-cells = <0>; #clock-cells = <0>;
}; };

View file

@ -140,7 +140,9 @@
reg = <0x108000 0x1000>; reg = <0x108000 0x1000>;
qcom,ipc = <&l2cc 0x8 2>; qcom,ipc = <&l2cc 0x8 2>;
interrupts = <0 19 0>, <0 21 0>, <0 22 0>; interrupts = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
<GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "ack", "err", "wakeup"; interrupt-names = "ack", "err", "wakeup";
regulators { regulators {
@ -186,7 +188,7 @@
compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm"; compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
reg = <0x16440000 0x1000>, reg = <0x16440000 0x1000>,
<0x16400000 0x1000>; <0x16400000 0x1000>;
interrupts = <0 154 0x0>; interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>; clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>;
clock-names = "core", "iface"; clock-names = "core", "iface";
status = "disabled"; status = "disabled";
@ -312,7 +314,7 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
reg = <0x16080000 0x1000>; reg = <0x16080000 0x1000>;
interrupts = <0 147 0>; interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
spi-max-frequency = <24000000>; spi-max-frequency = <24000000>;
cs-gpios = <&msmgpio 8 0>; cs-gpios = <&msmgpio 8 0>;

View file

@ -1125,7 +1125,7 @@
pmecc: ecc-engine@f8014070 { pmecc: ecc-engine@f8014070 {
compatible = "atmel,sama5d2-pmecc"; compatible = "atmel,sama5d2-pmecc";
reg = <0xf8014070 0x490>, reg = <0xf8014070 0x490>,
<0xf8014500 0x100>; <0xf8014500 0x200>;
}; };
}; };

View file

@ -142,9 +142,9 @@
reg = <0xb4100000 0x1000>; reg = <0xb4100000 0x1000>;
interrupts = <0 105 0x4>; interrupts = <0 105 0x4>;
status = "disabled"; status = "disabled";
dmas = <&dwdma0 12 0 1>, dmas = <&dwdma0 13 0 1>,
<&dwdma0 13 1 0>; <&dwdma0 12 1 0>;
dma-names = "tx", "rx"; dma-names = "rx", "tx";
}; };
thermal@e07008c4 { thermal@e07008c4 {

View file

@ -290,9 +290,9 @@
#size-cells = <0>; #size-cells = <0>;
interrupts = <0 31 0x4>; interrupts = <0 31 0x4>;
status = "disabled"; status = "disabled";
dmas = <&dwdma0 4 0 0>, dmas = <&dwdma0 5 0 0>,
<&dwdma0 5 0 0>; <&dwdma0 4 0 0>;
dma-names = "tx", "rx"; dma-names = "rx", "tx";
}; };
rtc@e0580000 { rtc@e0580000 {

View file

@ -183,8 +183,8 @@
}; };
conf_ata { conf_ata {
nvidia,pins = "ata", "atb", "atc", "atd", "ate", nvidia,pins = "ata", "atb", "atc", "atd", "ate",
"cdev1", "cdev2", "dap1", "dtb", "gma", "cdev1", "cdev2", "dap1", "dtb", "dtf",
"gmb", "gmc", "gmd", "gme", "gpu7", "gma", "gmb", "gmc", "gmd", "gme", "gpu7",
"gpv", "i2cp", "irrx", "irtx", "pta", "gpv", "i2cp", "irrx", "irtx", "pta",
"rm", "slxa", "slxk", "spia", "spib", "rm", "slxa", "slxk", "spia", "spib",
"uac"; "uac";
@ -203,7 +203,7 @@
}; };
conf_crtp { conf_crtp {
nvidia,pins = "crtp", "dap2", "dap3", "dap4", nvidia,pins = "crtp", "dap2", "dap3", "dap4",
"dtc", "dte", "dtf", "gpu", "sdio1", "dtc", "dte", "gpu", "sdio1",
"slxc", "slxd", "spdi", "spdo", "spig", "slxc", "slxd", "spdi", "spdo", "spig",
"uda"; "uda";
nvidia,pull = <TEGRA_PIN_PULL_NONE>; nvidia,pull = <TEGRA_PIN_PULL_NONE>;

View file

@ -76,6 +76,8 @@ static int sram_probe(struct platform_device *pdev)
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
platform_set_drvdata(pdev, info);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "no memory resource defined\n"); dev_err(&pdev->dev, "no memory resource defined\n");
@ -111,8 +113,6 @@ static int sram_probe(struct platform_device *pdev)
list_add(&info->node, &sram_bank_list); list_add(&info->node, &sram_bank_list);
mutex_unlock(&sram_lock); mutex_unlock(&sram_lock);
platform_set_drvdata(pdev, info);
dev_info(&pdev->dev, "initialized\n"); dev_info(&pdev->dev, "initialized\n");
return 0; return 0;
@ -131,17 +131,19 @@ static int sram_remove(struct platform_device *pdev)
struct sram_bank_info *info; struct sram_bank_info *info;
info = platform_get_drvdata(pdev); info = platform_get_drvdata(pdev);
if (info == NULL)
return -ENODEV;
mutex_lock(&sram_lock); if (info->sram_size) {
list_del(&info->node); mutex_lock(&sram_lock);
mutex_unlock(&sram_lock); list_del(&info->node);
mutex_unlock(&sram_lock);
gen_pool_destroy(info->gpool);
iounmap(info->sram_virt);
kfree(info->pool_name);
}
gen_pool_destroy(info->gpool);
iounmap(info->sram_virt);
kfree(info->pool_name);
kfree(info); kfree(info);
return 0; return 0;
} }

View file

@ -237,11 +237,11 @@ static int __init jive_mtdset(char *options)
unsigned long set; unsigned long set;
if (options == NULL || options[0] == '\0') if (options == NULL || options[0] == '\0')
return 0; return 1;
if (kstrtoul(options, 10, &set)) { if (kstrtoul(options, 10, &set)) {
printk(KERN_ERR "failed to parse mtdset=%s\n", options); printk(KERN_ERR "failed to parse mtdset=%s\n", options);
return 0; return 1;
} }
switch (set) { switch (set) {
@ -256,7 +256,7 @@ static int __init jive_mtdset(char *options)
"using default.", set); "using default.", set);
} }
return 0; return 1;
} }
/* parse the mtdset= option given to the kernel command line */ /* parse the mtdset= option given to the kernel command line */

View file

@ -111,8 +111,8 @@
compatible = "silabs,si3226x"; compatible = "silabs,si3226x";
reg = <0>; reg = <0>;
spi-max-frequency = <5000000>; spi-max-frequency = <5000000>;
spi-cpha = <1>; spi-cpha;
spi-cpol = <1>; spi-cpol;
pl022,hierarchy = <0>; pl022,hierarchy = <0>;
pl022,interface = <0>; pl022,interface = <0>;
pl022,slave-tx-disable = <0>; pl022,slave-tx-disable = <0>;
@ -135,8 +135,8 @@
at25,byte-len = <0x8000>; at25,byte-len = <0x8000>;
at25,addr-mode = <2>; at25,addr-mode = <2>;
at25,page-size = <64>; at25,page-size = <64>;
spi-cpha = <1>; spi-cpha;
spi-cpol = <1>; spi-cpol;
pl022,hierarchy = <0>; pl022,hierarchy = <0>;
pl022,interface = <0>; pl022,interface = <0>;
pl022,slave-tx-disable = <0>; pl022,slave-tx-disable = <0>;

View file

@ -687,7 +687,7 @@
}; };
}; };
sata: ahci@663f2000 { sata: sata@663f2000 {
compatible = "brcm,iproc-ahci", "generic-ahci"; compatible = "brcm,iproc-ahci", "generic-ahci";
reg = <0x663f2000 0x1000>; reg = <0x663f2000 0x1000>;
dma-coherent; dma-coherent;

View file

@ -439,7 +439,8 @@ static inline void *kvm_get_hyp_vector(void)
int slot = -1; int slot = -1;
if ((cpus_have_const_cap(ARM64_HARDEN_BRANCH_PREDICTOR) || if ((cpus_have_const_cap(ARM64_HARDEN_BRANCH_PREDICTOR) ||
cpus_have_const_cap(ARM64_SPECTRE_BHB)) && data->template_start) { cpus_have_const_cap(ARM64_SPECTRE_BHB)) &&
data && data->template_start) {
vect = kern_hyp_va(kvm_ksym_ref(__bp_harden_hyp_vecs_start)); vect = kern_hyp_va(kvm_ksym_ref(__bp_harden_hyp_vecs_start));
slot = data->hyp_vectors_slot; slot = data->hyp_vectors_slot;
} }

View file

@ -204,8 +204,8 @@ static int __kprobes aarch64_insn_patch_text_cb(void *arg)
int i, ret = 0; int i, ret = 0;
struct aarch64_insn_patch *pp = arg; struct aarch64_insn_patch *pp = arg;
/* The first CPU becomes master */ /* The last CPU becomes master */
if (atomic_inc_return(&pp->cpu_count) == 1) { if (atomic_inc_return(&pp->cpu_count) == num_online_cpus()) {
for (i = 0; ret == 0 && i < pp->insn_cnt; i++) for (i = 0; ret == 0 && i < pp->insn_cnt; i++)
ret = aarch64_insn_patch_text_nosync(pp->text_addrs[i], ret = aarch64_insn_patch_text_nosync(pp->text_addrs[i],
pp->new_insns[i]); pp->new_insns[i]);

View file

@ -1,5 +1,5 @@
SECTIONS { SECTIONS {
.plt 0 (NOLOAD) : { BYTE(0) } .plt 0 : { BYTE(0) }
.init.plt 0 (NOLOAD) : { BYTE(0) } .init.plt 0 : { BYTE(0) }
.text.ftrace_trampoline 0 (NOLOAD) : { BYTE(0) } .text.ftrace_trampoline 0 : { BYTE(0) }
} }

View file

@ -5,4 +5,4 @@
lib-y += init.o memory.o cmdline.o identify.o console.o lib-y += init.o memory.o cmdline.o identify.o console.o
lib-$(CONFIG_32BIT) += locore.o lib-$(CONFIG_CPU_R3000) += locore.o

View file

@ -47,16 +47,11 @@
*/ */
#define REX_PROM_MAGIC 0x30464354 #define REX_PROM_MAGIC 0x30464354
#ifdef CONFIG_64BIT /* KN04 and KN05 are REX PROMs, so only do the check for R3k systems. */
static inline bool prom_is_rex(u32 magic)
#define prom_is_rex(magic) 1 /* KN04 and KN05 are REX PROMs. */ {
return !IS_ENABLED(CONFIG_CPU_R3000) || magic == REX_PROM_MAGIC;
#else /* !CONFIG_64BIT */ }
#define prom_is_rex(magic) ((magic) == REX_PROM_MAGIC)
#endif /* !CONFIG_64BIT */
/* /*
* 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and * 3MIN/MAXINE PROM entry points for DS5000/1xx's, DS5000/xx's and

View file

@ -16,7 +16,7 @@ static inline void setup_8250_early_printk_port(unsigned long base,
unsigned int reg_shift, unsigned int timeout) {} unsigned int reg_shift, unsigned int timeout) {}
#endif #endif
extern void set_handler(unsigned long offset, void *addr, unsigned long len); void set_handler(unsigned long offset, const void *addr, unsigned long len);
extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len); extern void set_uncached_handler(unsigned long offset, void *addr, unsigned long len);
typedef void (*vi_handler_t)(void); typedef void (*vi_handler_t)(void);

View file

@ -1978,19 +1978,19 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
* If no shadow set is selected then use the default handler * If no shadow set is selected then use the default handler
* that does normal register saving and standard interrupt exit * that does normal register saving and standard interrupt exit
*/ */
extern char except_vec_vi, except_vec_vi_lui; extern const u8 except_vec_vi[], except_vec_vi_lui[];
extern char except_vec_vi_ori, except_vec_vi_end; extern const u8 except_vec_vi_ori[], except_vec_vi_end[];
extern char rollback_except_vec_vi; extern const u8 rollback_except_vec_vi[];
char *vec_start = using_rollback_handler() ? const u8 *vec_start = using_rollback_handler() ?
&rollback_except_vec_vi : &except_vec_vi; rollback_except_vec_vi : except_vec_vi;
#if defined(CONFIG_CPU_MICROMIPS) || defined(CONFIG_CPU_BIG_ENDIAN) #if defined(CONFIG_CPU_MICROMIPS) || defined(CONFIG_CPU_BIG_ENDIAN)
const int lui_offset = &except_vec_vi_lui - vec_start + 2; const int lui_offset = except_vec_vi_lui - vec_start + 2;
const int ori_offset = &except_vec_vi_ori - vec_start + 2; const int ori_offset = except_vec_vi_ori - vec_start + 2;
#else #else
const int lui_offset = &except_vec_vi_lui - vec_start; const int lui_offset = except_vec_vi_lui - vec_start;
const int ori_offset = &except_vec_vi_ori - vec_start; const int ori_offset = except_vec_vi_ori - vec_start;
#endif #endif
const int handler_len = &except_vec_vi_end - vec_start; const int handler_len = except_vec_vi_end - vec_start;
if (handler_len > VECTORSPACING) { if (handler_len > VECTORSPACING) {
/* /*
@ -2210,7 +2210,7 @@ void per_cpu_trap_init(bool is_boot_cpu)
} }
/* Install CPU exception handler */ /* Install CPU exception handler */
void set_handler(unsigned long offset, void *addr, unsigned long size) void set_handler(unsigned long offset, const void *addr, unsigned long size)
{ {
#ifdef CONFIG_CPU_MICROMIPS #ifdef CONFIG_CPU_MICROMIPS
memcpy((void *)(ebase + offset), ((unsigned char *)addr - 1), size); memcpy((void *)(ebase + offset), ((unsigned char *)addr - 1), size);

View file

@ -315,11 +315,9 @@ static int __init plat_setup_devices(void)
static int __init setup_kmac(char *s) static int __init setup_kmac(char *s)
{ {
printk(KERN_INFO "korina mac = %s\n", s); printk(KERN_INFO "korina mac = %s\n", s);
if (!mac_pton(s, korina_dev0_data.mac)) { if (!mac_pton(s, korina_dev0_data.mac))
printk(KERN_ERR "Invalid mac\n"); printk(KERN_ERR "Invalid mac\n");
return -EINVAL; return 1;
}
return 0;
} }
__setup("kmac=", setup_kmac); __setup("kmac=", setup_kmac);

View file

@ -167,7 +167,7 @@ else
CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5)) CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,$(call cc-option,-mtune=power5))
CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mcpu=power5,-mcpu=power4) CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mcpu=power5,-mcpu=power4)
endif endif
else else ifdef CONFIG_PPC_BOOK3E_64
CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64 CFLAGS-$(CONFIG_GENERIC_CPU) += -mcpu=powerpc64
endif endif

View file

@ -139,12 +139,12 @@
fman@400000 { fman@400000 {
ethernet@e6000 { ethernet@e6000 {
phy-handle = <&phy_rgmii_0>; phy-handle = <&phy_rgmii_0>;
phy-connection-type = "rgmii"; phy-connection-type = "rgmii-id";
}; };
ethernet@e8000 { ethernet@e8000 {
phy-handle = <&phy_rgmii_1>; phy-handle = <&phy_rgmii_1>;
phy-connection-type = "rgmii"; phy-connection-type = "rgmii-id";
}; };
mdio0: mdio@fc000 { mdio0: mdio@fc000 {

View file

@ -372,25 +372,37 @@ static inline void __raw_writeq_be(unsigned long v, volatile void __iomem *addr)
*/ */
static inline void __raw_rm_writeb(u8 val, volatile void __iomem *paddr) static inline void __raw_rm_writeb(u8 val, volatile void __iomem *paddr)
{ {
__asm__ __volatile__("stbcix %0,0,%1" __asm__ __volatile__(".machine push; \
.machine power6; \
stbcix %0,0,%1; \
.machine pop;"
: : "r" (val), "r" (paddr) : "memory"); : : "r" (val), "r" (paddr) : "memory");
} }
static inline void __raw_rm_writew(u16 val, volatile void __iomem *paddr) static inline void __raw_rm_writew(u16 val, volatile void __iomem *paddr)
{ {
__asm__ __volatile__("sthcix %0,0,%1" __asm__ __volatile__(".machine push; \
.machine power6; \
sthcix %0,0,%1; \
.machine pop;"
: : "r" (val), "r" (paddr) : "memory"); : : "r" (val), "r" (paddr) : "memory");
} }
static inline void __raw_rm_writel(u32 val, volatile void __iomem *paddr) static inline void __raw_rm_writel(u32 val, volatile void __iomem *paddr)
{ {
__asm__ __volatile__("stwcix %0,0,%1" __asm__ __volatile__(".machine push; \
.machine power6; \
stwcix %0,0,%1; \
.machine pop;"
: : "r" (val), "r" (paddr) : "memory"); : : "r" (val), "r" (paddr) : "memory");
} }
static inline void __raw_rm_writeq(u64 val, volatile void __iomem *paddr) static inline void __raw_rm_writeq(u64 val, volatile void __iomem *paddr)
{ {
__asm__ __volatile__("stdcix %0,0,%1" __asm__ __volatile__(".machine push; \
.machine power6; \
stdcix %0,0,%1; \
.machine pop;"
: : "r" (val), "r" (paddr) : "memory"); : : "r" (val), "r" (paddr) : "memory");
} }
@ -402,7 +414,10 @@ static inline void __raw_rm_writeq_be(u64 val, volatile void __iomem *paddr)
static inline u8 __raw_rm_readb(volatile void __iomem *paddr) static inline u8 __raw_rm_readb(volatile void __iomem *paddr)
{ {
u8 ret; u8 ret;
__asm__ __volatile__("lbzcix %0,0, %1" __asm__ __volatile__(".machine push; \
.machine power6; \
lbzcix %0,0, %1; \
.machine pop;"
: "=r" (ret) : "r" (paddr) : "memory"); : "=r" (ret) : "r" (paddr) : "memory");
return ret; return ret;
} }
@ -410,7 +425,10 @@ static inline u8 __raw_rm_readb(volatile void __iomem *paddr)
static inline u16 __raw_rm_readw(volatile void __iomem *paddr) static inline u16 __raw_rm_readw(volatile void __iomem *paddr)
{ {
u16 ret; u16 ret;
__asm__ __volatile__("lhzcix %0,0, %1" __asm__ __volatile__(".machine push; \
.machine power6; \
lhzcix %0,0, %1; \
.machine pop;"
: "=r" (ret) : "r" (paddr) : "memory"); : "=r" (ret) : "r" (paddr) : "memory");
return ret; return ret;
} }
@ -418,7 +436,10 @@ static inline u16 __raw_rm_readw(volatile void __iomem *paddr)
static inline u32 __raw_rm_readl(volatile void __iomem *paddr) static inline u32 __raw_rm_readl(volatile void __iomem *paddr)
{ {
u32 ret; u32 ret;
__asm__ __volatile__("lwzcix %0,0, %1" __asm__ __volatile__(".machine push; \
.machine power6; \
lwzcix %0,0, %1; \
.machine pop;"
: "=r" (ret) : "r" (paddr) : "memory"); : "=r" (ret) : "r" (paddr) : "memory");
return ret; return ret;
} }
@ -426,7 +447,10 @@ static inline u32 __raw_rm_readl(volatile void __iomem *paddr)
static inline u64 __raw_rm_readq(volatile void __iomem *paddr) static inline u64 __raw_rm_readq(volatile void __iomem *paddr)
{ {
u64 ret; u64 ret;
__asm__ __volatile__("ldcix %0,0, %1" __asm__ __volatile__(".machine push; \
.machine power6; \
ldcix %0,0, %1; \
.machine pop;"
: "=r" (ret) : "r" (paddr) : "memory"); : "=r" (ret) : "r" (paddr) : "memory");
return ret; return ret;
} }

View file

@ -217,8 +217,11 @@ extern long __get_user_bad(void);
*/ */
#define __get_user_atomic_128_aligned(kaddr, uaddr, err) \ #define __get_user_atomic_128_aligned(kaddr, uaddr, err) \
__asm__ __volatile__( \ __asm__ __volatile__( \
".machine push\n" \
".machine altivec\n" \
"1: lvx 0,0,%1 # get user\n" \ "1: lvx 0,0,%1 # get user\n" \
" stvx 0,0,%2 # put kernel\n" \ " stvx 0,0,%2 # put kernel\n" \
".machine pop\n" \
"2:\n" \ "2:\n" \
".section .fixup,\"ax\"\n" \ ".section .fixup,\"ax\"\n" \
"3: li %0,%3\n" \ "3: li %0,%3\n" \

View file

@ -680,7 +680,7 @@ static void kvm_use_magic_page(void)
on_each_cpu(kvm_map_magic_page, &features, 1); on_each_cpu(kvm_map_magic_page, &features, 1);
/* Quick self-test to see if the mapping works */ /* Quick self-test to see if the mapping works */
if (!fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) { if (fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) {
kvm_patching_worked = false; kvm_patching_worked = false;
return; return;
} }

View file

@ -148,11 +148,18 @@ void __init reserve_crashkernel(void)
if (!crashk_res.start) { if (!crashk_res.start) {
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
/* /*
* On 64bit we split the RMO in half but cap it at half of * On the LPAR platform place the crash kernel to mid of
* a small SLB (128MB) since the crash kernel needs to place * RMA size (512MB or more) to ensure the crash kernel
* itself and some stacks to be in the first segment. * gets enough space to place itself and some stack to be
* in the first segment. At the same time normal kernel
* also get enough space to allocate memory for essential
* system resource in the first segment. Keep the crash
* kernel starts at 128MB offset on other platforms.
*/ */
crashk_res.start = min(0x8000000ULL, (ppc64_rma_size / 2)); if (firmware_has_feature(FW_FEATURE_LPAR))
crashk_res.start = ppc64_rma_size / 2;
else
crashk_res.start = min(0x8000000ULL, (ppc64_rma_size / 2));
#else #else
crashk_res.start = KDUMP_KERNELBASE; crashk_res.start = KDUMP_KERNELBASE;
#endif #endif

View file

@ -1357,6 +1357,12 @@ int __init early_init_dt_scan_rtas(unsigned long node,
entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL); entryp = of_get_flat_dt_prop(node, "linux,rtas-entry", NULL);
sizep = of_get_flat_dt_prop(node, "rtas-size", NULL); sizep = of_get_flat_dt_prop(node, "rtas-size", NULL);
#ifdef CONFIG_PPC64
/* need this feature to decide the crashkernel offset */
if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL))
powerpc_firmware_features |= FW_FEATURE_LPAR;
#endif
if (basep && entryp && sizep) { if (basep && entryp && sizep) {
rtas.base = *basep; rtas.base = *basep;
rtas.entry = *entryp; rtas.entry = *entryp;

View file

@ -1479,7 +1479,7 @@ int kvmppc_handle_vmx_load(struct kvm_run *run, struct kvm_vcpu *vcpu,
{ {
enum emulation_result emulated = EMULATE_DONE; enum emulation_result emulated = EMULATE_DONE;
if (vcpu->arch.mmio_vsx_copy_nums > 2) if (vcpu->arch.mmio_vmx_copy_nums > 2)
return EMULATE_FAIL; return EMULATE_FAIL;
while (vcpu->arch.mmio_vmx_copy_nums) { while (vcpu->arch.mmio_vmx_copy_nums) {
@ -1576,7 +1576,7 @@ int kvmppc_handle_vmx_store(struct kvm_run *run, struct kvm_vcpu *vcpu,
unsigned int index = rs & KVM_MMIO_REG_MASK; unsigned int index = rs & KVM_MMIO_REG_MASK;
enum emulation_result emulated = EMULATE_DONE; enum emulation_result emulated = EMULATE_DONE;
if (vcpu->arch.mmio_vsx_copy_nums > 2) if (vcpu->arch.mmio_vmx_copy_nums > 2)
return EMULATE_FAIL; return EMULATE_FAIL;
vcpu->arch.io_gpr = rs; vcpu->arch.io_gpr = rs;

View file

@ -910,7 +910,10 @@ NOKPROBE_SYMBOL(emulate_dcbz);
#define __put_user_asmx(x, addr, err, op, cr) \ #define __put_user_asmx(x, addr, err, op, cr) \
__asm__ __volatile__( \ __asm__ __volatile__( \
".machine push\n" \
".machine power8\n" \
"1: " op " %2,0,%3\n" \ "1: " op " %2,0,%3\n" \
".machine pop\n" \
" mfcr %1\n" \ " mfcr %1\n" \
"2:\n" \ "2:\n" \
".section .fixup,\"ax\"\n" \ ".section .fixup,\"ax\"\n" \
@ -923,7 +926,10 @@ NOKPROBE_SYMBOL(emulate_dcbz);
#define __get_user_asmx(x, addr, err, op) \ #define __get_user_asmx(x, addr, err, op) \
__asm__ __volatile__( \ __asm__ __volatile__( \
".machine push\n" \
".machine power8\n" \
"1: "op" %1,0,%2\n" \ "1: "op" %1,0,%2\n" \
".machine pop\n" \
"2:\n" \ "2:\n" \
".section .fixup,\"ax\"\n" \ ".section .fixup,\"ax\"\n" \
"3: li %0,%3\n" \ "3: li %0,%3\n" \
@ -2806,7 +2812,7 @@ int emulate_loadstore(struct pt_regs *regs, struct instruction_op *op)
__put_user_asmx(op->val, ea, err, "stbcx.", cr); __put_user_asmx(op->val, ea, err, "stbcx.", cr);
break; break;
case 2: case 2:
__put_user_asmx(op->val, ea, err, "stbcx.", cr); __put_user_asmx(op->val, ea, err, "sthcx.", cr);
break; break;
#endif #endif
case 4: case 4:

View file

@ -47,7 +47,11 @@ static unsigned long rng_whiten(struct powernv_rng *rng, unsigned long val)
unsigned long parity; unsigned long parity;
/* Calculate the parity of the value */ /* Calculate the parity of the value */
asm ("popcntd %0,%1" : "=r" (parity) : "r" (val)); asm (".machine push; \
.machine power7; \
popcntd %0,%1; \
.machine pop;"
: "=r" (parity) : "r" (val));
/* xor our value with the previous mask */ /* xor our value with the previous mask */
val ^= rng->mask; val ^= rng->mask;

View file

@ -90,7 +90,7 @@ static LIST_HEAD(gtms);
*/ */
struct gtm_timer *gtm_get_timer16(void) struct gtm_timer *gtm_get_timer16(void)
{ {
struct gtm *gtm = NULL; struct gtm *gtm;
int i; int i;
list_for_each_entry(gtm, &gtms, list_node) { list_for_each_entry(gtm, &gtms, list_node) {
@ -107,7 +107,7 @@ struct gtm_timer *gtm_get_timer16(void)
spin_unlock_irq(&gtm->lock); spin_unlock_irq(&gtm->lock);
} }
if (gtm) if (!list_empty(&gtms))
return ERR_PTR(-EBUSY); return ERR_PTR(-EBUSY);
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
} }

View file

@ -2,7 +2,7 @@
/* Copyright (C) 2017 Andes Technology Corporation */ /* Copyright (C) 2017 Andes Technology Corporation */
SECTIONS { SECTIONS {
.plt (NOLOAD) : { BYTE(0) } .plt : { BYTE(0) }
.got (NOLOAD) : { BYTE(0) } .got : { BYTE(0) }
.got.plt (NOLOAD) : { BYTE(0) } .got.plt : { BYTE(0) }
} }

View file

@ -218,7 +218,7 @@ void mconsole_go(struct mc_request *req)
void mconsole_stop(struct mc_request *req) void mconsole_stop(struct mc_request *req)
{ {
deactivate_fd(req->originating_fd, MCONSOLE_IRQ); block_signals();
os_set_fd_block(req->originating_fd, 1); os_set_fd_block(req->originating_fd, 1);
mconsole_reply(req, "stopped", 0, 0); mconsole_reply(req, "stopped", 0, 0);
for (;;) { for (;;) {
@ -242,6 +242,7 @@ void mconsole_stop(struct mc_request *req)
os_set_fd_block(req->originating_fd, 0); os_set_fd_block(req->originating_fd, 0);
reactivate_fd(req->originating_fd, MCONSOLE_IRQ); reactivate_fd(req->originating_fd, MCONSOLE_IRQ);
mconsole_reply(req, "", 0, 0); mconsole_reply(req, "", 0, 0);
unblock_signals();
} }
static DEFINE_SPINLOCK(mc_devices_lock); static DEFINE_SPINLOCK(mc_devices_lock);

View file

@ -460,7 +460,7 @@ static u64 pt_config_filters(struct perf_event *event)
pt->filters.filter[range].msr_b = filter->msr_b; pt->filters.filter[range].msr_b = filter->msr_b;
} }
rtit_ctl |= filter->config << pt_address_ranges[range].reg_off; rtit_ctl |= (u64)filter->config << pt_address_ranges[range].reg_off;
} }
return rtit_ctl; return rtit_ctl;

View file

@ -480,7 +480,7 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector)
} else if (apic_id < min && max - apic_id < KVM_IPI_CLUSTER_SIZE) { } else if (apic_id < min && max - apic_id < KVM_IPI_CLUSTER_SIZE) {
ipi_bitmap <<= min - apic_id; ipi_bitmap <<= min - apic_id;
min = apic_id; min = apic_id;
} else if (apic_id < min + KVM_IPI_CLUSTER_SIZE) { } else if (apic_id > min && apic_id < min + KVM_IPI_CLUSTER_SIZE) {
max = apic_id < max ? max : apic_id; max = apic_id < max ? max : apic_id;
} else { } else {
ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap, ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,

View file

@ -1669,11 +1669,6 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
goto exception; goto exception;
} }
if (!seg_desc.p) {
err_vec = (seg == VCPU_SREG_SS) ? SS_VECTOR : NP_VECTOR;
goto exception;
}
dpl = seg_desc.dpl; dpl = seg_desc.dpl;
switch (seg) { switch (seg) {
@ -1713,6 +1708,10 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
case VCPU_SREG_TR: case VCPU_SREG_TR:
if (seg_desc.s || (seg_desc.type != 1 && seg_desc.type != 9)) if (seg_desc.s || (seg_desc.type != 1 && seg_desc.type != 9))
goto exception; goto exception;
if (!seg_desc.p) {
err_vec = NP_VECTOR;
goto exception;
}
old_desc = seg_desc; old_desc = seg_desc;
seg_desc.type |= 2; /* busy */ seg_desc.type |= 2; /* busy */
ret = ctxt->ops->cmpxchg_emulated(ctxt, desc_addr, &old_desc, &seg_desc, ret = ctxt->ops->cmpxchg_emulated(ctxt, desc_addr, &old_desc, &seg_desc,
@ -1737,6 +1736,11 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
break; break;
} }
if (!seg_desc.p) {
err_vec = (seg == VCPU_SREG_SS) ? SS_VECTOR : NP_VECTOR;
goto exception;
}
if (seg_desc.s) { if (seg_desc.s) {
/* mark segment as accessed */ /* mark segment as accessed */
if (!(seg_desc.type & 1)) { if (!(seg_desc.type & 1)) {

View file

@ -237,7 +237,7 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
struct kvm_vcpu *vcpu = synic_to_vcpu(synic); struct kvm_vcpu *vcpu = synic_to_vcpu(synic);
int ret; int ret;
if (!synic->active && !host) if (!synic->active && (!host || data))
return 1; return 1;
trace_kvm_hv_synic_set_msr(vcpu->vcpu_id, msr, data, host); trace_kvm_hv_synic_set_msr(vcpu->vcpu_id, msr, data, host);
@ -283,6 +283,9 @@ static int synic_set_msr(struct kvm_vcpu_hv_synic *synic,
case HV_X64_MSR_EOM: { case HV_X64_MSR_EOM: {
int i; int i;
if (!synic->active)
break;
for (i = 0; i < ARRAY_SIZE(synic->sint); i++) for (i = 0; i < ARRAY_SIZE(synic->sint); i++)
kvm_hv_notify_acked_sint(vcpu, i); kvm_hv_notify_acked_sint(vcpu, i);
break; break;
@ -544,6 +547,12 @@ static int stimer_start(struct kvm_vcpu_hv_stimer *stimer)
static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config, static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config,
bool host) bool host)
{ {
struct kvm_vcpu *vcpu = stimer_to_vcpu(stimer);
struct kvm_vcpu_hv_synic *synic = vcpu_to_synic(vcpu);
if (!synic->active && (!host || config))
return 1;
trace_kvm_hv_stimer_set_config(stimer_to_vcpu(stimer)->vcpu_id, trace_kvm_hv_stimer_set_config(stimer_to_vcpu(stimer)->vcpu_id,
stimer->index, config, host); stimer->index, config, host);
@ -558,6 +567,12 @@ static int stimer_set_config(struct kvm_vcpu_hv_stimer *stimer, u64 config,
static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count, static int stimer_set_count(struct kvm_vcpu_hv_stimer *stimer, u64 count,
bool host) bool host)
{ {
struct kvm_vcpu *vcpu = stimer_to_vcpu(stimer);
struct kvm_vcpu_hv_synic *synic = vcpu_to_synic(vcpu);
if (!synic->active && (!host || count))
return 1;
trace_kvm_hv_stimer_set_count(stimer_to_vcpu(stimer)->vcpu_id, trace_kvm_hv_stimer_set_count(stimer_to_vcpu(stimer)->vcpu_id,
stimer->index, count, host); stimer->index, count, host);

View file

@ -2045,10 +2045,7 @@ void kvm_set_lapic_tscdeadline_msr(struct kvm_vcpu *vcpu, u64 data)
void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8) void kvm_lapic_set_tpr(struct kvm_vcpu *vcpu, unsigned long cr8)
{ {
struct kvm_lapic *apic = vcpu->arch.apic; apic_set_tpr(vcpu->arch.apic, (cr8 & 0x0f) << 4);
apic_set_tpr(apic, ((cr8 & 0x0f) << 4)
| (kvm_lapic_get_reg(apic, APIC_TASKPRI) & 4));
} }
u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu) u64 kvm_lapic_get_cr8(struct kvm_vcpu *vcpu)

View file

@ -247,12 +247,10 @@ static int amd_pmu_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
/* MSR_EVNTSELn */ /* MSR_EVNTSELn */
pmc = get_gp_pmc_amd(pmu, msr, PMU_TYPE_EVNTSEL); pmc = get_gp_pmc_amd(pmu, msr, PMU_TYPE_EVNTSEL);
if (pmc) { if (pmc) {
if (data == pmc->eventsel) data &= ~pmu->reserved_bits;
return 0; if (data != pmc->eventsel)
if (!(data & pmu->reserved_bits)) {
reprogram_gp_counter(pmc, data); reprogram_gp_counter(pmc, data);
return 0; return 0;
}
} }
return 1; return 1;

View file

@ -41,7 +41,8 @@ static void msr_save_context(struct saved_context *ctxt)
struct saved_msr *end = msr + ctxt->saved_msrs.num; struct saved_msr *end = msr + ctxt->saved_msrs.num;
while (msr < end) { while (msr < end) {
msr->valid = !rdmsrl_safe(msr->info.msr_no, &msr->info.reg.q); if (msr->valid)
rdmsrl(msr->info.msr_no, msr->info.reg.q);
msr++; msr++;
} }
} }
@ -426,8 +427,10 @@ static int msr_build_context(const u32 *msr_id, const int num)
} }
for (i = saved_msrs->num, j = 0; i < total_num; i++, j++) { for (i = saved_msrs->num, j = 0; i < total_num; i++, j++) {
u64 dummy;
msr_array[i].info.msr_no = msr_id[j]; msr_array[i].info.msr_no = msr_id[j];
msr_array[i].valid = false; msr_array[i].valid = !rdmsrl_safe(msr_id[j], &dummy);
msr_array[i].info.reg.q = 0; msr_array[i].info.reg.q = 0;
} }
saved_msrs->num = total_num; saved_msrs->num = total_num;
@ -514,10 +517,24 @@ static int pm_cpu_check(const struct x86_cpu_id *c)
return ret; return ret;
} }
static void pm_save_spec_msr(void)
{
u32 spec_msr_id[] = {
MSR_IA32_SPEC_CTRL,
MSR_IA32_TSX_CTRL,
MSR_TSX_FORCE_ABORT,
MSR_IA32_MCU_OPT_CTRL,
MSR_AMD64_LS_CFG,
};
msr_build_context(spec_msr_id, ARRAY_SIZE(spec_msr_id));
}
static int pm_check_save_msr(void) static int pm_check_save_msr(void)
{ {
dmi_check_system(msr_save_dmi_table); dmi_check_system(msr_save_dmi_table);
pm_cpu_check(msr_save_cpu_table); pm_cpu_check(msr_save_cpu_table);
pm_save_spec_msr();
return 0; return 0;
} }

View file

@ -505,10 +505,7 @@ irqreturn_t xen_pmu_irq_handler(int irq, void *dev_id)
return ret; return ret;
} }
bool is_xen_pmu(int cpu) bool is_xen_pmu;
{
return (get_xenpmu_data() != NULL);
}
void xen_pmu_init(int cpu) void xen_pmu_init(int cpu)
{ {
@ -519,7 +516,7 @@ void xen_pmu_init(int cpu)
BUILD_BUG_ON(sizeof(struct xen_pmu_data) > PAGE_SIZE); BUILD_BUG_ON(sizeof(struct xen_pmu_data) > PAGE_SIZE);
if (xen_hvm_domain()) if (xen_hvm_domain() || (cpu != 0 && !is_xen_pmu))
return; return;
xenpmu_data = (struct xen_pmu_data *)get_zeroed_page(GFP_KERNEL); xenpmu_data = (struct xen_pmu_data *)get_zeroed_page(GFP_KERNEL);
@ -540,7 +537,8 @@ void xen_pmu_init(int cpu)
per_cpu(xenpmu_shared, cpu).xenpmu_data = xenpmu_data; per_cpu(xenpmu_shared, cpu).xenpmu_data = xenpmu_data;
per_cpu(xenpmu_shared, cpu).flags = 0; per_cpu(xenpmu_shared, cpu).flags = 0;
if (cpu == 0) { if (!is_xen_pmu) {
is_xen_pmu = true;
perf_register_guest_info_callbacks(&xen_guest_cbs); perf_register_guest_info_callbacks(&xen_guest_cbs);
xen_pmu_arch_init(); xen_pmu_arch_init();
} }

View file

@ -4,6 +4,8 @@
#include <xen/interface/xenpmu.h> #include <xen/interface/xenpmu.h>
extern bool is_xen_pmu;
irqreturn_t xen_pmu_irq_handler(int irq, void *dev_id); irqreturn_t xen_pmu_irq_handler(int irq, void *dev_id);
#ifdef CONFIG_XEN_HAVE_VPMU #ifdef CONFIG_XEN_HAVE_VPMU
void xen_pmu_init(int cpu); void xen_pmu_init(int cpu);
@ -12,7 +14,6 @@ void xen_pmu_finish(int cpu);
static inline void xen_pmu_init(int cpu) {} static inline void xen_pmu_init(int cpu) {}
static inline void xen_pmu_finish(int cpu) {} static inline void xen_pmu_finish(int cpu) {}
#endif #endif
bool is_xen_pmu(int cpu);
bool pmu_msr_read(unsigned int msr, uint64_t *val, int *err); bool pmu_msr_read(unsigned int msr, uint64_t *val, int *err);
bool pmu_msr_write(unsigned int msr, uint32_t low, uint32_t high, int *err); bool pmu_msr_write(unsigned int msr, uint32_t low, uint32_t high, int *err);
int pmu_apic_update(uint32_t reg); int pmu_apic_update(uint32_t reg);

View file

@ -18,6 +18,12 @@ static void __init xen_hvm_smp_prepare_boot_cpu(void)
*/ */
xen_vcpu_setup(0); xen_vcpu_setup(0);
/*
* Called again in case the kernel boots on vcpu >= MAX_VIRT_CPUS.
* Refer to comments in xen_hvm_init_time_ops().
*/
xen_hvm_init_time_ops();
/* /*
* The alternative logic (which patches the unlock/lock) runs before * The alternative logic (which patches the unlock/lock) runs before
* the smp bootup up code is activated. Hence we need to set this up * the smp bootup up code is activated. Hence we need to set this up

View file

@ -126,7 +126,7 @@ int xen_smp_intr_init_pv(unsigned int cpu)
per_cpu(xen_irq_work, cpu).irq = rc; per_cpu(xen_irq_work, cpu).irq = rc;
per_cpu(xen_irq_work, cpu).name = callfunc_name; per_cpu(xen_irq_work, cpu).name = callfunc_name;
if (is_xen_pmu(cpu)) { if (is_xen_pmu) {
pmu_name = kasprintf(GFP_KERNEL, "pmu%d", cpu); pmu_name = kasprintf(GFP_KERNEL, "pmu%d", cpu);
rc = bind_virq_to_irqhandler(VIRQ_XENPMU, cpu, rc = bind_virq_to_irqhandler(VIRQ_XENPMU, cpu,
xen_pmu_irq_handler, xen_pmu_irq_handler,

View file

@ -547,6 +547,11 @@ static void xen_hvm_setup_cpu_clockevents(void)
void __init xen_hvm_init_time_ops(void) void __init xen_hvm_init_time_ops(void)
{ {
static bool hvm_time_initialized;
if (hvm_time_initialized)
return;
/* /*
* vector callback is needed otherwise we cannot receive interrupts * vector callback is needed otherwise we cannot receive interrupts
* on cpu > 0 and at this point we don't know how many cpus are * on cpu > 0 and at this point we don't know how many cpus are
@ -556,7 +561,22 @@ void __init xen_hvm_init_time_ops(void)
return; return;
if (!xen_feature(XENFEAT_hvm_safe_pvclock)) { if (!xen_feature(XENFEAT_hvm_safe_pvclock)) {
pr_info("Xen doesn't support pvclock on HVM, disable pv timer"); pr_info_once("Xen doesn't support pvclock on HVM, disable pv timer");
return;
}
/*
* Only MAX_VIRT_CPUS 'vcpu_info' are embedded inside 'shared_info'.
* The __this_cpu_read(xen_vcpu) is still NULL when Xen HVM guest
* boots on vcpu >= MAX_VIRT_CPUS (e.g., kexec), To access
* __this_cpu_read(xen_vcpu) via xen_clocksource_read() will panic.
*
* The xen_hvm_init_time_ops() should be called again later after
* __this_cpu_read(xen_vcpu) is available.
*/
if (!__this_cpu_read(xen_vcpu)) {
pr_info("Delay xen_init_time_common() as kernel is running on vcpu=%d\n",
xen_vcpu_nr(0));
return; return;
} }
@ -568,5 +588,7 @@ void __init xen_hvm_init_time_ops(void)
x86_platform.calibrate_tsc = xen_tsc_khz; x86_platform.calibrate_tsc = xen_tsc_khz;
x86_platform.get_wallclock = xen_get_wallclock; x86_platform.get_wallclock = xen_get_wallclock;
x86_platform.set_wallclock = xen_set_wallclock; x86_platform.set_wallclock = xen_set_wallclock;
hvm_time_initialized = true;
} }
#endif #endif

View file

@ -8,19 +8,19 @@
reg = <0x00000000 0x08000000>; reg = <0x00000000 0x08000000>;
bank-width = <2>; bank-width = <2>;
device-width = <2>; device-width = <2>;
partition@0x0 { partition@0 {
label = "data"; label = "data";
reg = <0x00000000 0x06000000>; reg = <0x00000000 0x06000000>;
}; };
partition@0x6000000 { partition@6000000 {
label = "boot loader area"; label = "boot loader area";
reg = <0x06000000 0x00800000>; reg = <0x06000000 0x00800000>;
}; };
partition@0x6800000 { partition@6800000 {
label = "kernel image"; label = "kernel image";
reg = <0x06800000 0x017e0000>; reg = <0x06800000 0x017e0000>;
}; };
partition@0x7fe0000 { partition@7fe0000 {
label = "boot environment"; label = "boot environment";
reg = <0x07fe0000 0x00020000>; reg = <0x07fe0000 0x00020000>;
}; };

View file

@ -8,19 +8,19 @@
reg = <0x08000000 0x01000000>; reg = <0x08000000 0x01000000>;
bank-width = <2>; bank-width = <2>;
device-width = <2>; device-width = <2>;
partition@0x0 { partition@0 {
label = "boot loader area"; label = "boot loader area";
reg = <0x00000000 0x00400000>; reg = <0x00000000 0x00400000>;
}; };
partition@0x400000 { partition@400000 {
label = "kernel image"; label = "kernel image";
reg = <0x00400000 0x00600000>; reg = <0x00400000 0x00600000>;
}; };
partition@0xa00000 { partition@a00000 {
label = "data"; label = "data";
reg = <0x00a00000 0x005e0000>; reg = <0x00a00000 0x005e0000>;
}; };
partition@0xfe0000 { partition@fe0000 {
label = "boot environment"; label = "boot environment";
reg = <0x00fe0000 0x00020000>; reg = <0x00fe0000 0x00020000>;
}; };

View file

@ -8,11 +8,11 @@
reg = <0x08000000 0x00400000>; reg = <0x08000000 0x00400000>;
bank-width = <2>; bank-width = <2>;
device-width = <2>; device-width = <2>;
partition@0x0 { partition@0 {
label = "boot loader area"; label = "boot loader area";
reg = <0x00000000 0x003f0000>; reg = <0x00000000 0x003f0000>;
}; };
partition@0x3f0000 { partition@3f0000 {
label = "boot environment"; label = "boot environment";
reg = <0x003f0000 0x00010000>; reg = <0x003f0000 0x00010000>;
}; };

View file

@ -2155,6 +2155,15 @@ bfq_setup_merge(struct bfq_queue *bfqq, struct bfq_queue *new_bfqq)
* are likely to increase the throughput. * are likely to increase the throughput.
*/ */
bfqq->new_bfqq = new_bfqq; bfqq->new_bfqq = new_bfqq;
/*
* The above assignment schedules the following redirections:
* each time some I/O for bfqq arrives, the process that
* generated that I/O is disassociated from bfqq and
* associated with new_bfqq. Here we increases new_bfqq->ref
* in advance, adding the number of processes that are
* expected to be associated with new_bfqq as they happen to
* issue I/O.
*/
new_bfqq->ref += process_refs; new_bfqq->ref += process_refs;
return new_bfqq; return new_bfqq;
} }
@ -2214,6 +2223,10 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq,
{ {
struct bfq_queue *in_service_bfqq, *new_bfqq; struct bfq_queue *in_service_bfqq, *new_bfqq;
/* if a merge has already been setup, then proceed with that first */
if (bfqq->new_bfqq)
return bfqq->new_bfqq;
/* /*
* Prevent bfqq from being merged if it has been created too * Prevent bfqq from being merged if it has been created too
* long ago. The idea is that true cooperating processes, and * long ago. The idea is that true cooperating processes, and
@ -2228,9 +2241,6 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq,
if (bfq_too_late_for_merging(bfqq)) if (bfq_too_late_for_merging(bfqq))
return NULL; return NULL;
if (bfqq->new_bfqq)
return bfqq->new_bfqq;
if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq)) if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq))
return NULL; return NULL;
@ -4122,7 +4132,7 @@ static struct request *bfq_dispatch_request(struct blk_mq_hw_ctx *hctx)
struct bfq_data *bfqd = hctx->queue->elevator->elevator_data; struct bfq_data *bfqd = hctx->queue->elevator->elevator_data;
struct request *rq; struct request *rq;
struct bfq_queue *in_serv_queue; struct bfq_queue *in_serv_queue;
bool waiting_rq, idle_timer_disabled; bool waiting_rq, idle_timer_disabled = false;
spin_lock_irq(&bfqd->lock); spin_lock_irq(&bfqd->lock);
@ -4130,14 +4140,15 @@ static struct request *bfq_dispatch_request(struct blk_mq_hw_ctx *hctx)
waiting_rq = in_serv_queue && bfq_bfqq_wait_request(in_serv_queue); waiting_rq = in_serv_queue && bfq_bfqq_wait_request(in_serv_queue);
rq = __bfq_dispatch_request(hctx); rq = __bfq_dispatch_request(hctx);
if (in_serv_queue == bfqd->in_service_queue) {
idle_timer_disabled = idle_timer_disabled =
waiting_rq && !bfq_bfqq_wait_request(in_serv_queue); waiting_rq && !bfq_bfqq_wait_request(in_serv_queue);
}
spin_unlock_irq(&bfqd->lock); spin_unlock_irq(&bfqd->lock);
bfq_update_dispatch_stats(hctx->queue, rq,
bfq_update_dispatch_stats(hctx->queue, rq, in_serv_queue, idle_timer_disabled ? in_serv_queue : NULL,
idle_timer_disabled); idle_timer_disabled);
return rq; return rq;
} }

View file

@ -7,6 +7,8 @@
#include <linux/bio.h> #include <linux/bio.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/blkdev.h>
#include <linux/blk-cgroup.h>
#include <trace/events/block.h> #include <trace/events/block.h>
@ -486,6 +488,9 @@ static inline int ll_new_hw_segment(struct request_queue *q,
if (req->nr_phys_segments + nr_phys_segs > queue_max_segments(q)) if (req->nr_phys_segments + nr_phys_segs > queue_max_segments(q))
goto no_merge; goto no_merge;
if (!blk_cgroup_mergeable(req, bio))
goto no_merge;
if (blk_integrity_merge_bio(q, req, bio) == false) if (blk_integrity_merge_bio(q, req, bio) == false)
goto no_merge; goto no_merge;
@ -613,6 +618,9 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req,
if (total_phys_segments > queue_max_segments(q)) if (total_phys_segments > queue_max_segments(q))
return 0; return 0;
if (!blk_cgroup_mergeable(req, next->bio))
return 0;
if (blk_integrity_merge_rq(q, req, next) == false) if (blk_integrity_merge_rq(q, req, next) == false)
return 0; return 0;
@ -850,6 +858,10 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
if (rq->rq_disk != bio->bi_disk || req_no_special_merge(rq)) if (rq->rq_disk != bio->bi_disk || req_no_special_merge(rq))
return false; return false;
/* don't merge across cgroup boundaries */
if (!blk_cgroup_mergeable(rq, bio))
return false;
/* only merge integrity protected bio into ditto rq */ /* only merge integrity protected bio into ditto rq */
if (blk_integrity_merge_bio(rq->q, rq, bio) == false) if (blk_integrity_merge_bio(rq->q, rq, bio) == false)
return false; return false;

View file

@ -993,8 +993,6 @@ void blk_unregister_queue(struct gendisk *disk)
blk_mq_unregister_dev(disk_to_dev(disk), q); blk_mq_unregister_dev(disk_to_dev(disk), q);
mutex_unlock(&q->sysfs_lock); mutex_unlock(&q->sysfs_lock);
kobject_uevent(&q->kobj, KOBJ_REMOVE);
kobject_del(&q->kobj);
blk_trace_remove_sysfs(disk_to_dev(disk)); blk_trace_remove_sysfs(disk_to_dev(disk));
mutex_lock(&q->sysfs_lock); mutex_lock(&q->sysfs_lock);
@ -1002,5 +1000,9 @@ void blk_unregister_queue(struct gendisk *disk)
elv_unregister_queue(q); elv_unregister_queue(q);
mutex_unlock(&q->sysfs_lock); mutex_unlock(&q->sysfs_lock);
/* Now that we've deleted all child objects, we can delete the queue. */
kobject_uevent(&q->kobj, KOBJ_REMOVE);
kobject_del(&q->kobj);
kobject_put(&disk_to_dev(disk)->kobj); kobject_put(&disk_to_dev(disk)->kobj);
} }

View file

@ -268,7 +268,7 @@ static int crypto_authenc_decrypt_tail(struct aead_request *req,
dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen);
skcipher_request_set_tfm(skreq, ctx->enc); skcipher_request_set_tfm(skreq, ctx->enc);
skcipher_request_set_callback(skreq, aead_request_flags(req), skcipher_request_set_callback(skreq, flags,
req->base.complete, req->base.data); req->base.complete, req->base.data);
skcipher_request_set_crypt(skreq, src, dst, skcipher_request_set_crypt(skreq, src, dst,
req->cryptlen - authsize, req->iv); req->cryptlen - authsize, req->iv);

View file

@ -169,6 +169,9 @@ acpi_ns_walk_namespace(acpi_object_type type,
if (start_node == ACPI_ROOT_OBJECT) { if (start_node == ACPI_ROOT_OBJECT) {
start_node = acpi_gbl_root_node; start_node = acpi_gbl_root_node;
if (!start_node) {
return_ACPI_STATUS(AE_NO_NAMESPACE);
}
} }
/* Null child means "get first node" */ /* Null child means "get first node" */

View file

@ -31,6 +31,7 @@
#undef pr_fmt #undef pr_fmt
#define pr_fmt(fmt) "BERT: " fmt #define pr_fmt(fmt) "BERT: " fmt
#define ACPI_BERT_PRINT_MAX_LEN 1024
static int bert_disable; static int bert_disable;
@ -59,8 +60,11 @@ static void __init bert_print_all(struct acpi_bert_region *region,
} }
pr_info_once("Error records from previous boot:\n"); pr_info_once("Error records from previous boot:\n");
if (region_len < ACPI_BERT_PRINT_MAX_LEN)
cper_estatus_print(KERN_INFO HW_ERR, estatus); cper_estatus_print(KERN_INFO HW_ERR, estatus);
else
pr_info_once("Max print length exceeded, table data is available at:\n"
"/sys/firmware/acpi/tables/data/BERT");
/* /*
* Because the boot error source is "one-time polled" type, * Because the boot error source is "one-time polled" type,
@ -82,7 +86,7 @@ static int __init setup_bert_disable(char *str)
{ {
bert_disable = 1; bert_disable = 1;
return 0; return 1;
} }
__setup("bert_disable", setup_bert_disable); __setup("bert_disable", setup_bert_disable);

View file

@ -899,7 +899,7 @@ EXPORT_SYMBOL_GPL(erst_clear);
static int __init setup_erst_disable(char *str) static int __init setup_erst_disable(char *str)
{ {
erst_disable = 1; erst_disable = 1;
return 0; return 1;
} }
__setup("erst_disable", setup_erst_disable); __setup("erst_disable", setup_erst_disable);

View file

@ -215,7 +215,7 @@ err:
static int __init setup_hest_disable(char *str) static int __init setup_hest_disable(char *str)
{ {
hest_disable = HEST_DISABLED; hest_disable = HEST_DISABLED;
return 0; return 1;
} }
__setup("hest_disable", setup_hest_disable); __setup("hest_disable", setup_hest_disable);

View file

@ -742,6 +742,11 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
cpc_obj = &out_obj->package.elements[0]; cpc_obj = &out_obj->package.elements[0];
if (cpc_obj->type == ACPI_TYPE_INTEGER) { if (cpc_obj->type == ACPI_TYPE_INTEGER) {
num_ent = cpc_obj->integer.value; num_ent = cpc_obj->integer.value;
if (num_ent <= 1) {
pr_debug("Unexpected _CPC NumEntries value (%d) for CPU:%d\n",
num_ent, pr->id);
goto out_free;
}
} else { } else {
pr_debug("Unexpected entry type(%d) for NumEntries\n", pr_debug("Unexpected entry type(%d) for NumEntries\n",
cpc_obj->type); cpc_obj->type);

View file

@ -618,7 +618,7 @@ int __acpi_node_get_property_reference(const struct fwnode_handle *fwnode,
*/ */
if (obj->type == ACPI_TYPE_LOCAL_REFERENCE) { if (obj->type == ACPI_TYPE_LOCAL_REFERENCE) {
if (index) if (index)
return -EINVAL; return -ENOENT;
ret = acpi_bus_get_device(obj->reference.handle, &device); ret = acpi_bus_get_device(obj->reference.handle, &device);
if (ret) if (ret)

View file

@ -149,7 +149,11 @@ struct sata_dwc_device {
#endif #endif
}; };
#define SATA_DWC_QCMD_MAX 32 /*
* Allow one extra special slot for commands and DMA management
* to account for libata internal commands.
*/
#define SATA_DWC_QCMD_MAX (ATA_MAX_QUEUE + 1)
struct sata_dwc_device_port { struct sata_dwc_device_port {
struct sata_dwc_device *hsdev; struct sata_dwc_device *hsdev;

View file

@ -2163,7 +2163,9 @@ static bool pm_ops_is_empty(const struct dev_pm_ops *ops)
void device_pm_check_callbacks(struct device *dev) void device_pm_check_callbacks(struct device *dev)
{ {
spin_lock_irq(&dev->power.lock); unsigned long flags;
spin_lock_irqsave(&dev->power.lock, flags);
dev->power.no_pm_callbacks = dev->power.no_pm_callbacks =
(!dev->bus || (pm_ops_is_empty(dev->bus->pm) && (!dev->bus || (pm_ops_is_empty(dev->bus->pm) &&
!dev->bus->suspend && !dev->bus->resume)) && !dev->bus->suspend && !dev->bus->resume)) &&
@ -2172,7 +2174,7 @@ void device_pm_check_callbacks(struct device *dev)
(!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) && (!dev->pm_domain || pm_ops_is_empty(&dev->pm_domain->ops)) &&
(!dev->driver || (pm_ops_is_empty(dev->driver->pm) && (!dev->driver || (pm_ops_is_empty(dev->driver->pm) &&
!dev->driver->suspend && !dev->driver->resume)); !dev->driver->suspend && !dev->driver->resume));
spin_unlock_irq(&dev->power.lock); spin_unlock_irqrestore(&dev->power.lock, flags);
} }
bool dev_pm_smart_suspend_and_suspended(struct device *dev) bool dev_pm_smart_suspend_and_suspended(struct device *dev)

View file

@ -1688,22 +1688,22 @@ struct sib_info {
}; };
void drbd_bcast_event(struct drbd_device *device, const struct sib_info *sib); void drbd_bcast_event(struct drbd_device *device, const struct sib_info *sib);
extern void notify_resource_state(struct sk_buff *, extern int notify_resource_state(struct sk_buff *,
unsigned int, unsigned int,
struct drbd_resource *, struct drbd_resource *,
struct resource_info *, struct resource_info *,
enum drbd_notification_type); enum drbd_notification_type);
extern void notify_device_state(struct sk_buff *, extern int notify_device_state(struct sk_buff *,
unsigned int, unsigned int,
struct drbd_device *, struct drbd_device *,
struct device_info *, struct device_info *,
enum drbd_notification_type); enum drbd_notification_type);
extern void notify_connection_state(struct sk_buff *, extern int notify_connection_state(struct sk_buff *,
unsigned int, unsigned int,
struct drbd_connection *, struct drbd_connection *,
struct connection_info *, struct connection_info *,
enum drbd_notification_type); enum drbd_notification_type);
extern void notify_peer_device_state(struct sk_buff *, extern int notify_peer_device_state(struct sk_buff *,
unsigned int, unsigned int,
struct drbd_peer_device *, struct drbd_peer_device *,
struct peer_device_info *, struct peer_device_info *,

View file

@ -4598,7 +4598,7 @@ static int nla_put_notification_header(struct sk_buff *msg,
return drbd_notification_header_to_skb(msg, &nh, true); return drbd_notification_header_to_skb(msg, &nh, true);
} }
void notify_resource_state(struct sk_buff *skb, int notify_resource_state(struct sk_buff *skb,
unsigned int seq, unsigned int seq,
struct drbd_resource *resource, struct drbd_resource *resource,
struct resource_info *resource_info, struct resource_info *resource_info,
@ -4640,16 +4640,17 @@ void notify_resource_state(struct sk_buff *skb,
if (err && err != -ESRCH) if (err && err != -ESRCH)
goto failed; goto failed;
} }
return; return 0;
nla_put_failure: nla_put_failure:
nlmsg_free(skb); nlmsg_free(skb);
failed: failed:
drbd_err(resource, "Error %d while broadcasting event. Event seq:%u\n", drbd_err(resource, "Error %d while broadcasting event. Event seq:%u\n",
err, seq); err, seq);
return err;
} }
void notify_device_state(struct sk_buff *skb, int notify_device_state(struct sk_buff *skb,
unsigned int seq, unsigned int seq,
struct drbd_device *device, struct drbd_device *device,
struct device_info *device_info, struct device_info *device_info,
@ -4689,16 +4690,17 @@ void notify_device_state(struct sk_buff *skb,
if (err && err != -ESRCH) if (err && err != -ESRCH)
goto failed; goto failed;
} }
return; return 0;
nla_put_failure: nla_put_failure:
nlmsg_free(skb); nlmsg_free(skb);
failed: failed:
drbd_err(device, "Error %d while broadcasting event. Event seq:%u\n", drbd_err(device, "Error %d while broadcasting event. Event seq:%u\n",
err, seq); err, seq);
return err;
} }
void notify_connection_state(struct sk_buff *skb, int notify_connection_state(struct sk_buff *skb,
unsigned int seq, unsigned int seq,
struct drbd_connection *connection, struct drbd_connection *connection,
struct connection_info *connection_info, struct connection_info *connection_info,
@ -4738,16 +4740,17 @@ void notify_connection_state(struct sk_buff *skb,
if (err && err != -ESRCH) if (err && err != -ESRCH)
goto failed; goto failed;
} }
return; return 0;
nla_put_failure: nla_put_failure:
nlmsg_free(skb); nlmsg_free(skb);
failed: failed:
drbd_err(connection, "Error %d while broadcasting event. Event seq:%u\n", drbd_err(connection, "Error %d while broadcasting event. Event seq:%u\n",
err, seq); err, seq);
return err;
} }
void notify_peer_device_state(struct sk_buff *skb, int notify_peer_device_state(struct sk_buff *skb,
unsigned int seq, unsigned int seq,
struct drbd_peer_device *peer_device, struct drbd_peer_device *peer_device,
struct peer_device_info *peer_device_info, struct peer_device_info *peer_device_info,
@ -4788,13 +4791,14 @@ void notify_peer_device_state(struct sk_buff *skb,
if (err && err != -ESRCH) if (err && err != -ESRCH)
goto failed; goto failed;
} }
return; return 0;
nla_put_failure: nla_put_failure:
nlmsg_free(skb); nlmsg_free(skb);
failed: failed:
drbd_err(peer_device, "Error %d while broadcasting event. Event seq:%u\n", drbd_err(peer_device, "Error %d while broadcasting event. Event seq:%u\n",
err, seq); err, seq);
return err;
} }
void notify_helper(enum drbd_notification_type type, void notify_helper(enum drbd_notification_type type,
@ -4845,7 +4849,7 @@ fail:
err, seq); err, seq);
} }
static void notify_initial_state_done(struct sk_buff *skb, unsigned int seq) static int notify_initial_state_done(struct sk_buff *skb, unsigned int seq)
{ {
struct drbd_genlmsghdr *dh; struct drbd_genlmsghdr *dh;
int err; int err;
@ -4859,11 +4863,12 @@ static void notify_initial_state_done(struct sk_buff *skb, unsigned int seq)
if (nla_put_notification_header(skb, NOTIFY_EXISTS)) if (nla_put_notification_header(skb, NOTIFY_EXISTS))
goto nla_put_failure; goto nla_put_failure;
genlmsg_end(skb, dh); genlmsg_end(skb, dh);
return; return 0;
nla_put_failure: nla_put_failure:
nlmsg_free(skb); nlmsg_free(skb);
pr_err("Error %d sending event. Event seq:%u\n", err, seq); pr_err("Error %d sending event. Event seq:%u\n", err, seq);
return err;
} }
static void free_state_changes(struct list_head *list) static void free_state_changes(struct list_head *list)
@ -4890,6 +4895,7 @@ static int get_initial_state(struct sk_buff *skb, struct netlink_callback *cb)
unsigned int seq = cb->args[2]; unsigned int seq = cb->args[2];
unsigned int n; unsigned int n;
enum drbd_notification_type flags = 0; enum drbd_notification_type flags = 0;
int err = 0;
/* There is no need for taking notification_mutex here: it doesn't /* There is no need for taking notification_mutex here: it doesn't
matter if the initial state events mix with later state chage matter if the initial state events mix with later state chage
@ -4898,32 +4904,32 @@ static int get_initial_state(struct sk_buff *skb, struct netlink_callback *cb)
cb->args[5]--; cb->args[5]--;
if (cb->args[5] == 1) { if (cb->args[5] == 1) {
notify_initial_state_done(skb, seq); err = notify_initial_state_done(skb, seq);
goto out; goto out;
} }
n = cb->args[4]++; n = cb->args[4]++;
if (cb->args[4] < cb->args[3]) if (cb->args[4] < cb->args[3])
flags |= NOTIFY_CONTINUES; flags |= NOTIFY_CONTINUES;
if (n < 1) { if (n < 1) {
notify_resource_state_change(skb, seq, state_change->resource, err = notify_resource_state_change(skb, seq, state_change->resource,
NOTIFY_EXISTS | flags); NOTIFY_EXISTS | flags);
goto next; goto next;
} }
n--; n--;
if (n < state_change->n_connections) { if (n < state_change->n_connections) {
notify_connection_state_change(skb, seq, &state_change->connections[n], err = notify_connection_state_change(skb, seq, &state_change->connections[n],
NOTIFY_EXISTS | flags); NOTIFY_EXISTS | flags);
goto next; goto next;
} }
n -= state_change->n_connections; n -= state_change->n_connections;
if (n < state_change->n_devices) { if (n < state_change->n_devices) {
notify_device_state_change(skb, seq, &state_change->devices[n], err = notify_device_state_change(skb, seq, &state_change->devices[n],
NOTIFY_EXISTS | flags); NOTIFY_EXISTS | flags);
goto next; goto next;
} }
n -= state_change->n_devices; n -= state_change->n_devices;
if (n < state_change->n_devices * state_change->n_connections) { if (n < state_change->n_devices * state_change->n_connections) {
notify_peer_device_state_change(skb, seq, &state_change->peer_devices[n], err = notify_peer_device_state_change(skb, seq, &state_change->peer_devices[n],
NOTIFY_EXISTS | flags); NOTIFY_EXISTS | flags);
goto next; goto next;
} }
@ -4938,7 +4944,10 @@ next:
cb->args[4] = 0; cb->args[4] = 0;
} }
out: out:
return skb->len; if (err)
return err;
else
return skb->len;
} }
int drbd_adm_get_initial_state(struct sk_buff *skb, struct netlink_callback *cb) int drbd_adm_get_initial_state(struct sk_buff *skb, struct netlink_callback *cb)

View file

@ -207,7 +207,8 @@ void start_new_tl_epoch(struct drbd_connection *connection)
void complete_master_bio(struct drbd_device *device, void complete_master_bio(struct drbd_device *device,
struct bio_and_error *m) struct bio_and_error *m)
{ {
m->bio->bi_status = errno_to_blk_status(m->error); if (unlikely(m->error))
m->bio->bi_status = errno_to_blk_status(m->error);
bio_endio(m->bio); bio_endio(m->bio);
dec_ap_bio(device); dec_ap_bio(device);
} }

View file

@ -1549,7 +1549,7 @@ int drbd_bitmap_io_from_worker(struct drbd_device *device,
return rv; return rv;
} }
void notify_resource_state_change(struct sk_buff *skb, int notify_resource_state_change(struct sk_buff *skb,
unsigned int seq, unsigned int seq,
struct drbd_resource_state_change *resource_state_change, struct drbd_resource_state_change *resource_state_change,
enum drbd_notification_type type) enum drbd_notification_type type)
@ -1562,10 +1562,10 @@ void notify_resource_state_change(struct sk_buff *skb,
.res_susp_fen = resource_state_change->susp_fen[NEW], .res_susp_fen = resource_state_change->susp_fen[NEW],
}; };
notify_resource_state(skb, seq, resource, &resource_info, type); return notify_resource_state(skb, seq, resource, &resource_info, type);
} }
void notify_connection_state_change(struct sk_buff *skb, int notify_connection_state_change(struct sk_buff *skb,
unsigned int seq, unsigned int seq,
struct drbd_connection_state_change *connection_state_change, struct drbd_connection_state_change *connection_state_change,
enum drbd_notification_type type) enum drbd_notification_type type)
@ -1576,10 +1576,10 @@ void notify_connection_state_change(struct sk_buff *skb,
.conn_role = connection_state_change->peer_role[NEW], .conn_role = connection_state_change->peer_role[NEW],
}; };
notify_connection_state(skb, seq, connection, &connection_info, type); return notify_connection_state(skb, seq, connection, &connection_info, type);
} }
void notify_device_state_change(struct sk_buff *skb, int notify_device_state_change(struct sk_buff *skb,
unsigned int seq, unsigned int seq,
struct drbd_device_state_change *device_state_change, struct drbd_device_state_change *device_state_change,
enum drbd_notification_type type) enum drbd_notification_type type)
@ -1589,10 +1589,10 @@ void notify_device_state_change(struct sk_buff *skb,
.dev_disk_state = device_state_change->disk_state[NEW], .dev_disk_state = device_state_change->disk_state[NEW],
}; };
notify_device_state(skb, seq, device, &device_info, type); return notify_device_state(skb, seq, device, &device_info, type);
} }
void notify_peer_device_state_change(struct sk_buff *skb, int notify_peer_device_state_change(struct sk_buff *skb,
unsigned int seq, unsigned int seq,
struct drbd_peer_device_state_change *p, struct drbd_peer_device_state_change *p,
enum drbd_notification_type type) enum drbd_notification_type type)
@ -1606,7 +1606,7 @@ void notify_peer_device_state_change(struct sk_buff *skb,
.peer_resync_susp_dependency = p->resync_susp_dependency[NEW], .peer_resync_susp_dependency = p->resync_susp_dependency[NEW],
}; };
notify_peer_device_state(skb, seq, peer_device, &peer_device_info, type); return notify_peer_device_state(skb, seq, peer_device, &peer_device_info, type);
} }
static void broadcast_state_change(struct drbd_state_change *state_change) static void broadcast_state_change(struct drbd_state_change *state_change)
@ -1614,7 +1614,7 @@ static void broadcast_state_change(struct drbd_state_change *state_change)
struct drbd_resource_state_change *resource_state_change = &state_change->resource[0]; struct drbd_resource_state_change *resource_state_change = &state_change->resource[0];
bool resource_state_has_changed; bool resource_state_has_changed;
unsigned int n_device, n_connection, n_peer_device, n_peer_devices; unsigned int n_device, n_connection, n_peer_device, n_peer_devices;
void (*last_func)(struct sk_buff *, unsigned int, void *, int (*last_func)(struct sk_buff *, unsigned int, void *,
enum drbd_notification_type) = NULL; enum drbd_notification_type) = NULL;
void *uninitialized_var(last_arg); void *uninitialized_var(last_arg);

View file

@ -44,19 +44,19 @@ extern struct drbd_state_change *remember_old_state(struct drbd_resource *, gfp_
extern void copy_old_to_new_state_change(struct drbd_state_change *); extern void copy_old_to_new_state_change(struct drbd_state_change *);
extern void forget_state_change(struct drbd_state_change *); extern void forget_state_change(struct drbd_state_change *);
extern void notify_resource_state_change(struct sk_buff *, extern int notify_resource_state_change(struct sk_buff *,
unsigned int, unsigned int,
struct drbd_resource_state_change *, struct drbd_resource_state_change *,
enum drbd_notification_type type); enum drbd_notification_type type);
extern void notify_connection_state_change(struct sk_buff *, extern int notify_connection_state_change(struct sk_buff *,
unsigned int, unsigned int,
struct drbd_connection_state_change *, struct drbd_connection_state_change *,
enum drbd_notification_type type); enum drbd_notification_type type);
extern void notify_device_state_change(struct sk_buff *, extern int notify_device_state_change(struct sk_buff *,
unsigned int, unsigned int,
struct drbd_device_state_change *, struct drbd_device_state_change *,
enum drbd_notification_type type); enum drbd_notification_type type);
extern void notify_peer_device_state_change(struct sk_buff *, extern int notify_peer_device_state_change(struct sk_buff *,
unsigned int, unsigned int,
struct drbd_peer_device_state_change *, struct drbd_peer_device_state_change *,
enum drbd_notification_type type); enum drbd_notification_type type);

View file

@ -808,33 +808,33 @@ static ssize_t loop_attr_backing_file_show(struct loop_device *lo, char *buf)
static ssize_t loop_attr_offset_show(struct loop_device *lo, char *buf) static ssize_t loop_attr_offset_show(struct loop_device *lo, char *buf)
{ {
return sprintf(buf, "%llu\n", (unsigned long long)lo->lo_offset); return sysfs_emit(buf, "%llu\n", (unsigned long long)lo->lo_offset);
} }
static ssize_t loop_attr_sizelimit_show(struct loop_device *lo, char *buf) static ssize_t loop_attr_sizelimit_show(struct loop_device *lo, char *buf)
{ {
return sprintf(buf, "%llu\n", (unsigned long long)lo->lo_sizelimit); return sysfs_emit(buf, "%llu\n", (unsigned long long)lo->lo_sizelimit);
} }
static ssize_t loop_attr_autoclear_show(struct loop_device *lo, char *buf) static ssize_t loop_attr_autoclear_show(struct loop_device *lo, char *buf)
{ {
int autoclear = (lo->lo_flags & LO_FLAGS_AUTOCLEAR); int autoclear = (lo->lo_flags & LO_FLAGS_AUTOCLEAR);
return sprintf(buf, "%s\n", autoclear ? "1" : "0"); return sysfs_emit(buf, "%s\n", autoclear ? "1" : "0");
} }
static ssize_t loop_attr_partscan_show(struct loop_device *lo, char *buf) static ssize_t loop_attr_partscan_show(struct loop_device *lo, char *buf)
{ {
int partscan = (lo->lo_flags & LO_FLAGS_PARTSCAN); int partscan = (lo->lo_flags & LO_FLAGS_PARTSCAN);
return sprintf(buf, "%s\n", partscan ? "1" : "0"); return sysfs_emit(buf, "%s\n", partscan ? "1" : "0");
} }
static ssize_t loop_attr_dio_show(struct loop_device *lo, char *buf) static ssize_t loop_attr_dio_show(struct loop_device *lo, char *buf)
{ {
int dio = (lo->lo_flags & LO_FLAGS_DIRECT_IO); int dio = (lo->lo_flags & LO_FLAGS_DIRECT_IO);
return sprintf(buf, "%s\n", dio ? "1" : "0"); return sysfs_emit(buf, "%s\n", dio ? "1" : "0");
} }
LOOP_ATTR_RO(backing_file); LOOP_ATTR_RO(backing_file);

View file

@ -824,9 +824,17 @@ static int virtblk_probe(struct virtio_device *vdev)
err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE, err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE,
struct virtio_blk_config, blk_size, struct virtio_blk_config, blk_size,
&blk_size); &blk_size);
if (!err) if (!err) {
err = blk_validate_block_size(blk_size);
if (err) {
dev_err(&vdev->dev,
"virtio_blk: invalid block size: 0x%x\n",
blk_size);
goto out_free_tags;
}
blk_queue_logical_block_size(q, blk_size); blk_queue_logical_block_size(q, blk_size);
else } else
blk_size = queue_logical_block_size(q); blk_size = queue_logical_block_size(q);
/* Use topology information if available */ /* Use topology information if available */

View file

@ -288,6 +288,8 @@ int hci_uart_register_device(struct hci_uart *hu,
if (err) if (err)
return err; return err;
percpu_init_rwsem(&hu->proto_lock);
err = p->open(hu); err = p->open(hu);
if (err) if (err)
goto err_open; goto err_open;
@ -310,7 +312,6 @@ int hci_uart_register_device(struct hci_uart *hu,
INIT_WORK(&hu->init_ready, hci_uart_init_work); INIT_WORK(&hu->init_ready, hci_uart_init_work);
INIT_WORK(&hu->write_work, hci_uart_write_work); INIT_WORK(&hu->write_work, hci_uart_write_work);
percpu_init_rwsem(&hu->proto_lock);
/* Only when vendor specific setup callback is provided, consider /* Only when vendor specific setup callback is provided, consider
* the manufacturer information valid. This avoids filling in the * the manufacturer information valid. This avoids filling in the

View file

@ -96,6 +96,7 @@ static int atmel_trng_probe(struct platform_device *pdev)
err_register: err_register:
clk_disable_unprepare(trng->clk); clk_disable_unprepare(trng->clk);
atmel_trng_disable(trng);
return ret; return ret;
} }

View file

@ -163,14 +163,6 @@ static void tpm_dev_release(struct device *dev)
kfree(chip); kfree(chip);
} }
static void tpm_devs_release(struct device *dev)
{
struct tpm_chip *chip = container_of(dev, struct tpm_chip, devs);
/* release the master device reference */
put_device(&chip->dev);
}
/** /**
* tpm_class_shutdown() - prepare the TPM device for loss of power. * tpm_class_shutdown() - prepare the TPM device for loss of power.
* @dev: device to which the chip is associated. * @dev: device to which the chip is associated.
@ -234,7 +226,6 @@ struct tpm_chip *tpm_chip_alloc(struct device *pdev,
chip->dev_num = rc; chip->dev_num = rc;
device_initialize(&chip->dev); device_initialize(&chip->dev);
device_initialize(&chip->devs);
chip->dev.class = tpm_class; chip->dev.class = tpm_class;
chip->dev.class->shutdown_pre = tpm_class_shutdown; chip->dev.class->shutdown_pre = tpm_class_shutdown;
@ -242,29 +233,12 @@ struct tpm_chip *tpm_chip_alloc(struct device *pdev,
chip->dev.parent = pdev; chip->dev.parent = pdev;
chip->dev.groups = chip->groups; chip->dev.groups = chip->groups;
chip->devs.parent = pdev;
chip->devs.class = tpmrm_class;
chip->devs.release = tpm_devs_release;
/* get extra reference on main device to hold on
* behalf of devs. This holds the chip structure
* while cdevs is in use. The corresponding put
* is in the tpm_devs_release (TPM2 only)
*/
if (chip->flags & TPM_CHIP_FLAG_TPM2)
get_device(&chip->dev);
if (chip->dev_num == 0) if (chip->dev_num == 0)
chip->dev.devt = MKDEV(MISC_MAJOR, TPM_MINOR); chip->dev.devt = MKDEV(MISC_MAJOR, TPM_MINOR);
else else
chip->dev.devt = MKDEV(MAJOR(tpm_devt), chip->dev_num); chip->dev.devt = MKDEV(MAJOR(tpm_devt), chip->dev_num);
chip->devs.devt =
MKDEV(MAJOR(tpm_devt), chip->dev_num + TPM_NUM_DEVICES);
rc = dev_set_name(&chip->dev, "tpm%d", chip->dev_num); rc = dev_set_name(&chip->dev, "tpm%d", chip->dev_num);
if (rc)
goto out;
rc = dev_set_name(&chip->devs, "tpmrm%d", chip->dev_num);
if (rc) if (rc)
goto out; goto out;
@ -272,9 +246,7 @@ struct tpm_chip *tpm_chip_alloc(struct device *pdev,
chip->flags |= TPM_CHIP_FLAG_VIRTUAL; chip->flags |= TPM_CHIP_FLAG_VIRTUAL;
cdev_init(&chip->cdev, &tpm_fops); cdev_init(&chip->cdev, &tpm_fops);
cdev_init(&chip->cdevs, &tpmrm_fops);
chip->cdev.owner = THIS_MODULE; chip->cdev.owner = THIS_MODULE;
chip->cdevs.owner = THIS_MODULE;
rc = tpm2_init_space(&chip->work_space, TPM2_SPACE_BUFFER_SIZE); rc = tpm2_init_space(&chip->work_space, TPM2_SPACE_BUFFER_SIZE);
if (rc) { if (rc) {
@ -286,7 +258,6 @@ struct tpm_chip *tpm_chip_alloc(struct device *pdev,
return chip; return chip;
out: out:
put_device(&chip->devs);
put_device(&chip->dev); put_device(&chip->dev);
return ERR_PTR(rc); return ERR_PTR(rc);
} }
@ -335,14 +306,9 @@ static int tpm_add_char_device(struct tpm_chip *chip)
} }
if (chip->flags & TPM_CHIP_FLAG_TPM2) { if (chip->flags & TPM_CHIP_FLAG_TPM2) {
rc = cdev_device_add(&chip->cdevs, &chip->devs); rc = tpm_devs_add(chip);
if (rc) { if (rc)
dev_err(&chip->devs, goto err_del_cdev;
"unable to cdev_device_add() %s, major %d, minor %d, err=%d\n",
dev_name(&chip->devs), MAJOR(chip->devs.devt),
MINOR(chip->devs.devt), rc);
return rc;
}
} }
/* Make the chip available. */ /* Make the chip available. */
@ -350,6 +316,10 @@ static int tpm_add_char_device(struct tpm_chip *chip)
idr_replace(&dev_nums_idr, chip, chip->dev_num); idr_replace(&dev_nums_idr, chip, chip->dev_num);
mutex_unlock(&idr_lock); mutex_unlock(&idr_lock);
return 0;
err_del_cdev:
cdev_device_del(&chip->cdev, &chip->dev);
return rc; return rc;
} }
@ -508,7 +478,7 @@ void tpm_chip_unregister(struct tpm_chip *chip)
hwrng_unregister(&chip->hwrng); hwrng_unregister(&chip->hwrng);
tpm_bios_log_teardown(chip); tpm_bios_log_teardown(chip);
if (chip->flags & TPM_CHIP_FLAG_TPM2) if (chip->flags & TPM_CHIP_FLAG_TPM2)
cdev_device_del(&chip->cdevs, &chip->devs); tpm_devs_remove(chip);
tpm_del_char_device(chip); tpm_del_char_device(chip);
} }
EXPORT_SYMBOL_GPL(tpm_chip_unregister); EXPORT_SYMBOL_GPL(tpm_chip_unregister);

View file

@ -605,6 +605,8 @@ int tpm2_prepare_space(struct tpm_chip *chip, struct tpm_space *space, u32 cc,
u8 *cmd); u8 *cmd);
int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space, int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space,
u32 cc, u8 *buf, size_t *bufsiz); u32 cc, u8 *buf, size_t *bufsiz);
int tpm_devs_add(struct tpm_chip *chip);
void tpm_devs_remove(struct tpm_chip *chip);
void tpm_bios_log_setup(struct tpm_chip *chip); void tpm_bios_log_setup(struct tpm_chip *chip);
void tpm_bios_log_teardown(struct tpm_chip *chip); void tpm_bios_log_teardown(struct tpm_chip *chip);

View file

@ -536,3 +536,68 @@ int tpm2_commit_space(struct tpm_chip *chip, struct tpm_space *space,
return 0; return 0;
} }
/*
* Put the reference to the main device.
*/
static void tpm_devs_release(struct device *dev)
{
struct tpm_chip *chip = container_of(dev, struct tpm_chip, devs);
/* release the master device reference */
put_device(&chip->dev);
}
/*
* Remove the device file for exposed TPM spaces and release the device
* reference. This may also release the reference to the master device.
*/
void tpm_devs_remove(struct tpm_chip *chip)
{
cdev_device_del(&chip->cdevs, &chip->devs);
put_device(&chip->devs);
}
/*
* Add a device file to expose TPM spaces. Also take a reference to the
* main device.
*/
int tpm_devs_add(struct tpm_chip *chip)
{
int rc;
device_initialize(&chip->devs);
chip->devs.parent = chip->dev.parent;
chip->devs.class = tpmrm_class;
/*
* Get extra reference on main device to hold on behalf of devs.
* This holds the chip structure while cdevs is in use. The
* corresponding put is in the tpm_devs_release.
*/
get_device(&chip->dev);
chip->devs.release = tpm_devs_release;
chip->devs.devt = MKDEV(MAJOR(tpm_devt), chip->dev_num + TPM_NUM_DEVICES);
cdev_init(&chip->cdevs, &tpmrm_fops);
chip->cdevs.owner = THIS_MODULE;
rc = dev_set_name(&chip->devs, "tpmrm%d", chip->dev_num);
if (rc)
goto err_put_devs;
rc = cdev_device_add(&chip->cdevs, &chip->devs);
if (rc) {
dev_err(&chip->devs,
"unable to cdev_device_add() %s, major %d, minor %d, err=%d\n",
dev_name(&chip->devs), MAJOR(chip->devs.devt),
MINOR(chip->devs.devt), rc);
goto err_put_devs;
}
return 0;
err_put_devs:
put_device(&chip->devs);
return rc;
}

View file

@ -1985,6 +1985,13 @@ static void virtcons_remove(struct virtio_device *vdev)
list_del(&portdev->list); list_del(&portdev->list);
spin_unlock_irq(&pdrvdata_lock); spin_unlock_irq(&pdrvdata_lock);
/* Device is going away, exit any polling for buffers */
virtio_break_device(vdev);
if (use_multiport(portdev))
flush_work(&portdev->control_work);
else
flush_work(&portdev->config_work);
/* Disable interrupts for vqs */ /* Disable interrupts for vqs */
vdev->config->reset(vdev); vdev->config->reset(vdev);
/* Finish up work that's lined up */ /* Finish up work that's lined up */
@ -2258,7 +2265,7 @@ static struct virtio_driver virtio_rproc_serial = {
.remove = virtcons_remove, .remove = virtcons_remove,
}; };
static int __init init(void) static int __init virtio_console_init(void)
{ {
int err; int err;
@ -2295,7 +2302,7 @@ free:
return err; return err;
} }
static void __exit fini(void) static void __exit virtio_console_fini(void)
{ {
reclaim_dma_bufs(); reclaim_dma_bufs();
@ -2305,8 +2312,8 @@ static void __exit fini(void)
class_destroy(pdrvdata.class); class_destroy(pdrvdata.class);
debugfs_remove_recursive(pdrvdata.debugfs_dir); debugfs_remove_recursive(pdrvdata.debugfs_dir);
} }
module_init(init); module_init(virtio_console_init);
module_exit(fini); module_exit(virtio_console_fini);
MODULE_DESCRIPTION("Virtio console driver"); MODULE_DESCRIPTION("Virtio console driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");

View file

@ -160,6 +160,7 @@ static struct clk_div_table hdmia_div_table[] = {
static struct clk_div_table rmii_div_table[] = { static struct clk_div_table rmii_div_table[] = {
{0, 4}, {1, 10}, {0, 4}, {1, 10},
{0, 0}
}; };
/* divider clocks */ /* divider clocks */

View file

@ -138,7 +138,7 @@ static struct clk_div_table rmii_ref_div_table[] = {
static struct clk_div_table usb3_mac_div_table[] = { static struct clk_div_table usb3_mac_div_table[] = {
{ 1, 2 }, { 2, 3 }, { 3, 4 }, { 1, 2 }, { 2, 3 }, { 3, 4 },
{ 0, 8 }, { 0, 0 }
}; };
static struct clk_div_table i2s_div_table[] = { static struct clk_div_table i2s_div_table[] = {

View file

@ -32,11 +32,13 @@ static const struct clk_div_table spi_div_table[] = {
{ .val = 1, .div = 8, }, { .val = 1, .div = 8, },
{ .val = 2, .div = 2, }, { .val = 2, .div = 2, },
{ .val = 3, .div = 1, }, { .val = 3, .div = 1, },
{ /* sentinel */ }
}; };
static const struct clk_div_table timer_div_table[] = { static const struct clk_div_table timer_div_table[] = {
{ .val = 0, .div = 256, }, { .val = 0, .div = 256, },
{ .val = 1, .div = 1, }, { .val = 1, .div = 1, },
{ /* sentinel */ }
}; };
struct clps711x_clk { struct clps711x_clk {

View file

@ -550,6 +550,24 @@ static void clk_core_get_boundaries(struct clk_core *core,
*max_rate = min(*max_rate, clk_user->max_rate); *max_rate = min(*max_rate, clk_user->max_rate);
} }
static bool clk_core_check_boundaries(struct clk_core *core,
unsigned long min_rate,
unsigned long max_rate)
{
struct clk *user;
lockdep_assert_held(&prepare_lock);
if (min_rate > core->max_rate || max_rate < core->min_rate)
return false;
hlist_for_each_entry(user, &core->clks, clks_node)
if (min_rate > user->max_rate || max_rate < user->min_rate)
return false;
return true;
}
void clk_hw_set_rate_range(struct clk_hw *hw, unsigned long min_rate, void clk_hw_set_rate_range(struct clk_hw *hw, unsigned long min_rate,
unsigned long max_rate) unsigned long max_rate)
{ {
@ -2604,6 +2622,11 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max)
clk->min_rate = min; clk->min_rate = min;
clk->max_rate = max; clk->max_rate = max;
if (!clk_core_check_boundaries(clk->core, min, max)) {
ret = -EINVAL;
goto out;
}
rate = clk_core_get_rate_nolock(clk->core); rate = clk_core_get_rate_nolock(clk->core);
if (rate < min || rate > max) { if (rate < min || rate > max) {
/* /*
@ -2632,6 +2655,7 @@ int clk_set_rate_range(struct clk *clk, unsigned long min, unsigned long max)
} }
} }
out:
if (clk->exclusive_count) if (clk->exclusive_count)
clk_core_rate_protect(clk->core); clk_core_rate_protect(clk->core);

View file

@ -40,6 +40,7 @@ static const struct clk_div_table ahb_div_table[] = {
[1] = { .val = 1, .div = 4 }, [1] = { .val = 1, .div = 4 },
[2] = { .val = 2, .div = 3 }, [2] = { .val = 2, .div = 3 },
[3] = { .val = 3, .div = 3 }, [3] = { .val = 3, .div = 3 },
[4] = { /* sentinel */ }
}; };
void __init ls1x_clk_init(void) void __init ls1x_clk_init(void)

View file

@ -625,6 +625,7 @@ static const struct frac_entry frac_table_pixel[] = {
{ 2, 9 }, { 2, 9 },
{ 4, 9 }, { 4, 9 },
{ 1, 1 }, { 1, 1 },
{ 2, 3 },
{ } { }
}; };

View file

@ -1082,7 +1082,7 @@ static struct clk_rcg2 sdcc1_apps_clk_src = {
.name = "sdcc1_apps_clk_src", .name = "sdcc1_apps_clk_src",
.parent_names = gcc_xo_gpll0_gpll2_gpll0_out_main_div2, .parent_names = gcc_xo_gpll0_gpll2_gpll0_out_main_div2,
.num_parents = 4, .num_parents = 4,
.ops = &clk_rcg2_ops, .ops = &clk_rcg2_floor_ops,
}, },
}; };

View file

@ -115,6 +115,7 @@ static struct clk_alpha_pll gpll4_early = {
static struct clk_alpha_pll_postdiv gpll4 = { static struct clk_alpha_pll_postdiv gpll4 = {
.offset = 0x1dc0, .offset = 0x1dc0,
.width = 4,
.regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT], .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
.clkr.hw.init = &(struct clk_init_data) .clkr.hw.init = &(struct clk_init_data)
{ {

View file

@ -190,6 +190,7 @@ static struct tegra_emc *emc_ensure_emc_driver(struct tegra_clk_emc *tegra)
tegra->emc = platform_get_drvdata(pdev); tegra->emc = platform_get_drvdata(pdev);
if (!tegra->emc) { if (!tegra->emc) {
put_device(&pdev->dev);
pr_err("%s: cannot find EMC driver\n", __func__); pr_err("%s: cannot find EMC driver\n", __func__);
return NULL; return NULL;
} }

View file

@ -33,6 +33,7 @@ struct clk_hw *uniphier_clk_register_fixed_rate(struct device *dev,
init.name = name; init.name = name;
init.ops = &clk_fixed_rate_ops; init.ops = &clk_fixed_rate_ops;
init.flags = 0;
init.parent_names = NULL; init.parent_names = NULL;
init.num_parents = 0; init.num_parents = 0;

View file

@ -230,8 +230,10 @@ static int __init parse_pmtmr(char *arg)
int ret; int ret;
ret = kstrtouint(arg, 16, &base); ret = kstrtouint(arg, 16, &base);
if (ret) if (ret) {
return ret; pr_warn("PMTMR: invalid 'pmtmr=' value: '%s'\n", arg);
return 1;
}
pr_info("PMTMR IOPort override: 0x%04x -> 0x%04x\n", pmtmr_ioport, pr_info("PMTMR IOPort override: 0x%04x -> 0x%04x\n", pmtmr_ioport,
base); base);

View file

@ -164,9 +164,9 @@ static __init int timer_of_base_init(struct device_node *np,
of_base->base = of_base->name ? of_base->base = of_base->name ?
of_io_request_and_map(np, of_base->index, of_base->name) : of_io_request_and_map(np, of_base->index, of_base->name) :
of_iomap(np, of_base->index); of_iomap(np, of_base->index);
if (IS_ERR(of_base->base)) { if (IS_ERR_OR_NULL(of_base->base)) {
pr_err("Failed to iomap (%s)\n", of_base->name); pr_err("Failed to iomap (%s:%s)\n", np->name, of_base->name);
return PTR_ERR(of_base->base); return of_base->base ? PTR_ERR(of_base->base) : -ENOMEM;
} }
return 0; return 0;

View file

@ -631,6 +631,20 @@ static int ccp_terminate_all(struct dma_chan *dma_chan)
return 0; return 0;
} }
static void ccp_dma_release(struct ccp_device *ccp)
{
struct ccp_dma_chan *chan;
struct dma_chan *dma_chan;
unsigned int i;
for (i = 0; i < ccp->cmd_q_count; i++) {
chan = ccp->ccp_dma_chan + i;
dma_chan = &chan->dma_chan;
tasklet_kill(&chan->cleanup_tasklet);
list_del_rcu(&dma_chan->device_node);
}
}
int ccp_dmaengine_register(struct ccp_device *ccp) int ccp_dmaengine_register(struct ccp_device *ccp)
{ {
struct ccp_dma_chan *chan; struct ccp_dma_chan *chan;
@ -732,6 +746,7 @@ int ccp_dmaengine_register(struct ccp_device *ccp)
return 0; return 0;
err_reg: err_reg:
ccp_dma_release(ccp);
kmem_cache_destroy(ccp->dma_desc_cache); kmem_cache_destroy(ccp->dma_desc_cache);
err_cache: err_cache:
@ -745,6 +760,7 @@ void ccp_dmaengine_unregister(struct ccp_device *ccp)
struct dma_device *dma_dev = &ccp->dma_dev; struct dma_device *dma_dev = &ccp->dma_dev;
dma_async_device_unregister(dma_dev); dma_async_device_unregister(dma_dev);
ccp_dma_release(ccp);
kmem_cache_destroy(ccp->dma_desc_cache); kmem_cache_destroy(ccp->dma_desc_cache);
kmem_cache_destroy(ccp->dma_cmd_cache); kmem_cache_destroy(ccp->dma_cmd_cache);

View file

@ -328,7 +328,7 @@ static int mxs_dcp_aes_block_crypt(struct crypto_async_request *arq)
memset(key + AES_KEYSIZE_128, 0, AES_KEYSIZE_128); memset(key + AES_KEYSIZE_128, 0, AES_KEYSIZE_128);
} }
for_each_sg(req->src, src, sg_nents(src), i) { for_each_sg(req->src, src, sg_nents(req->src), i) {
src_buf = sg_virt(src); src_buf = sg_virt(src);
len = sg_dma_len(src); len = sg_dma_len(src);
tlen += len; tlen += len;

View file

@ -1,7 +1,11 @@
config CRYPTO_DEV_VMX_ENCRYPT config CRYPTO_DEV_VMX_ENCRYPT
tristate "Encryption acceleration support on P8 CPU" tristate "Encryption acceleration support on P8 CPU"
depends on CRYPTO_DEV_VMX depends on CRYPTO_DEV_VMX
select CRYPTO_AES
select CRYPTO_CBC
select CRYPTO_CTR
select CRYPTO_GHASH select CRYPTO_GHASH
select CRYPTO_XTS
default m default m
help help
Support for VMX cryptographic acceleration instructions on Power8 CPU. Support for VMX cryptographic acceleration instructions on Power8 CPU.

View file

@ -118,10 +118,8 @@ static dma_cookie_t shdma_tx_submit(struct dma_async_tx_descriptor *tx)
ret = pm_runtime_get(schan->dev); ret = pm_runtime_get(schan->dev);
spin_unlock_irq(&schan->chan_lock); spin_unlock_irq(&schan->chan_lock);
if (ret < 0) { if (ret < 0)
dev_err(schan->dev, "%s(): GET = %d\n", __func__, ret); dev_err(schan->dev, "%s(): GET = %d\n", __func__, ret);
pm_runtime_put(schan->dev);
}
pm_runtime_barrier(schan->dev); pm_runtime_barrier(schan->dev);

View file

@ -955,6 +955,8 @@ struct amdgpu_gfx {
DECLARE_BITMAP (pipe_reserve_bitmap, AMDGPU_MAX_COMPUTE_QUEUES); DECLARE_BITMAP (pipe_reserve_bitmap, AMDGPU_MAX_COMPUTE_QUEUES);
}; };
int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv);
int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm,
unsigned size, struct amdgpu_ib *ib); unsigned size, struct amdgpu_ib *ib);
void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib, void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib,

View file

@ -1044,11 +1044,15 @@ int amdgpu_amdkfd_gpuvm_acquire_process_vm(struct kgd_dev *kgd,
struct dma_fence **ef) struct dma_fence **ef)
{ {
struct amdgpu_device *adev = get_amdgpu_device(kgd); struct amdgpu_device *adev = get_amdgpu_device(kgd);
struct drm_file *drm_priv = filp->private_data; struct amdgpu_fpriv *drv_priv;
struct amdgpu_fpriv *drv_priv = drm_priv->driver_priv; struct amdgpu_vm *avm;
struct amdgpu_vm *avm = &drv_priv->vm;
int ret; int ret;
ret = amdgpu_file_to_fpriv(filp, &drv_priv);
if (ret)
return ret;
avm = &drv_priv->vm;
/* Already a compute VM? */ /* Already a compute VM? */
if (avm->process_info) if (avm->process_info)
return -EINVAL; return -EINVAL;

View file

@ -1469,6 +1469,7 @@ int amdgpu_cs_fence_to_handle_ioctl(struct drm_device *dev, void *data,
return 0; return 0;
default: default:
dma_fence_put(fence);
return -EINVAL; return -EINVAL;
} }
} }

View file

@ -1132,6 +1132,22 @@ static const struct file_operations amdgpu_driver_kms_fops = {
#endif #endif
}; };
int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv)
{
struct drm_file *file;
if (!filp)
return -EINVAL;
if (filp->f_op != &amdgpu_driver_kms_fops) {
return -EINVAL;
}
file = filp->private_data;
*fpriv = file->driver_priv;
return 0;
}
static bool static bool
amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe, amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
bool in_vblank_irq, int *vpos, int *hpos, bool in_vblank_irq, int *vpos, int *hpos,

View file

@ -173,7 +173,7 @@ static int amdgpu_gfx_kiq_acquire(struct amdgpu_device *adev,
* adev->gfx.mec.num_pipe_per_mec * adev->gfx.mec.num_pipe_per_mec
* adev->gfx.mec.num_queue_per_pipe; * adev->gfx.mec.num_queue_per_pipe;
while (queue_bit-- >= 0) { while (--queue_bit >= 0) {
if (test_bit(queue_bit, adev->gfx.mec.queue_bitmap)) if (test_bit(queue_bit, adev->gfx.mec.queue_bitmap))
continue; continue;

View file

@ -54,16 +54,20 @@ static int amdgpu_sched_process_priority_override(struct amdgpu_device *adev,
enum drm_sched_priority priority) enum drm_sched_priority priority)
{ {
struct file *filp = fget(fd); struct file *filp = fget(fd);
struct drm_file *file;
struct amdgpu_fpriv *fpriv; struct amdgpu_fpriv *fpriv;
struct amdgpu_ctx *ctx; struct amdgpu_ctx *ctx;
uint32_t id; uint32_t id;
int r;
if (!filp) if (!filp)
return -EINVAL; return -EINVAL;
file = filp->private_data; r = amdgpu_file_to_fpriv(filp, &fpriv);
fpriv = file->driver_priv; if (r) {
fput(filp);
return r;
}
idr_for_each_entry(&fpriv->ctx_mgr.ctx_handles, ctx, id) idr_for_each_entry(&fpriv->ctx_mgr.ctx_handles, ctx, id)
amdgpu_ctx_priority_override(ctx, priority); amdgpu_ctx_priority_override(ctx, priority);

View file

@ -733,7 +733,7 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size)
/* Fetch the CRAT table from ACPI */ /* Fetch the CRAT table from ACPI */
status = acpi_get_table(CRAT_SIGNATURE, 0, &crat_table); status = acpi_get_table(CRAT_SIGNATURE, 0, &crat_table);
if (status == AE_NOT_FOUND) { if (status == AE_NOT_FOUND) {
pr_warn("CRAT table not found\n"); pr_info("CRAT table not found\n");
return -ENODATA; return -ENODATA;
} else if (ACPI_FAILURE(status)) { } else if (ACPI_FAILURE(status)) {
const char *err = acpi_format_exception(status); const char *err = acpi_format_exception(status);

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