Merge 5.4.269 into android11-5.4-lts
Changes in 5.4.269
PCI: mediatek: Clear interrupt status before dispatching handler
include/linux/units.h: add helpers for kelvin to/from Celsius conversion
units: Add Watt units
units: change from 'L' to 'UL'
units: add the HZ macros
serial: sc16is7xx: set safe default SPI clock frequency
spi: introduce SPI_MODE_X_MASK macro
serial: sc16is7xx: add check for unsupported SPI modes during probe
ext4: allow for the last group to be marked as trimmed
crypto: api - Disallow identical driver names
PM: hibernate: Enforce ordering during image compression/decompression
hwrng: core - Fix page fault dead lock on mmap-ed hwrng
rpmsg: virtio: Free driver_override when rpmsg_remove()
parisc/firmware: Fix F-extend for PDC addresses
arm64: dts: qcom: sdm845: fix USB wakeup interrupt types
mmc: core: Use mrq.sbc in close-ended ffu
nouveau/vmm: don't set addr on the fail path to avoid warning
ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path
rename(): fix the locking of subdirectories
block: Remove special-casing of compound pages
mtd: spinand: macronix: Fix MX35LFxGE4AD page size
fs: add mode_strip_sgid() helper
fs: move S_ISGID stripping into the vfs_*() helpers
powerpc: Use always instead of always-y in for crtsavres.o
x86/CPU/AMD: Fix disabling XSAVES on AMD family 0x17 due to erratum
net/smc: fix illegal rmb_desc access in SMC-D connection dump
vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING
llc: make llc_ui_sendmsg() more robust against bonding changes
llc: Drop support for ETH_P_TR_802_2.
net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv
tracing: Ensure visibility when inserting an element into tracing_map
afs: Hide silly-rename files from userspace
tcp: Add memory barrier to tcp_push()
netlink: fix potential sleeping issue in mqueue_flush_file
net/mlx5: DR, Use the right GVMI number for drop action
net/mlx5: Use kfree(ft->g) in arfs_create_groups()
net/mlx5e: fix a double-free in arfs_create_groups
netfilter: nf_tables: restrict anonymous set and map names to 16 bytes
netfilter: nf_tables: validate NFPROTO_* family
fjes: fix memleaks in fjes_hw_setup
net: fec: fix the unhandled context fault from smmu
btrfs: ref-verify: free ref cache before clearing mount opt
btrfs: tree-checker: fix inline ref size in error messages
btrfs: don't warn if discard range is not aligned to sector
btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args
rbd: don't move requests to the running list on errors
netfilter: nf_tables: reject QUEUE/DROP verdict parameters
gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
drm: Don't unref the same fb many times by mistake due to deadlock handling
drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking
drm/bridge: nxp-ptn3460: simplify some error checking
drm/exynos: fix accidental on-stack copy of exynos_drm_plane
drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
gpio: eic-sprd: Clear interrupt after set the interrupt type
spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan
tick/sched: Preserve number of idle sleeps across CPU hotplug events
x86/entry/ia32: Ensure s32 is sign extended to s64
powerpc/mm: Fix null-pointer dereference in pgtable_cache_add
powerpc: Fix build error due to is_valid_bugaddr()
powerpc/mm: Fix build failures due to arch_reserved_kernel_pages()
powerpc: pmd_move_must_withdraw() is only needed for CONFIG_TRANSPARENT_HUGEPAGE
powerpc/lib: Validate size for vector operations
x86/mce: Mark fatal MCE's page as poison to avoid panic in the kdump kernel
perf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file
regulator: core: Only increment use_count when enable_count changes
audit: Send netlink ACK before setting connection in auditd_set
ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop
PNP: ACPI: fix fortify warning
ACPI: extlog: fix NULL pointer dereference check
FS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree
UBSAN: array-index-out-of-bounds in dtSplitRoot
jfs: fix slab-out-of-bounds Read in dtSearch
jfs: fix array-index-out-of-bounds in dbAdjTree
jfs: fix uaf in jfs_evict_inode
pstore/ram: Fix crash when setting number of cpus to an odd number
crypto: stm32/crc32 - fix parsing list of devices
afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*()
rxrpc_find_service_conn_rcu: fix the usage of read_seqbegin_or_lock()
jfs: fix array-index-out-of-bounds in diNewExt
s390/ptrace: handle setting of fpc register correctly
KVM: s390: fix setting of fpc register
SUNRPC: Fix a suspicious RCU usage warning
ecryptfs: Reject casefold directory inodes
ext4: fix inconsistent between segment fstrim and full fstrim
ext4: unify the type of flexbg_size to unsigned int
ext4: remove unnecessary check from alloc_flex_gd()
ext4: avoid online resizing failures due to oversized flex bg
wifi: rt2x00: restart beacon queue when hardware reset
selftests/bpf: satisfy compiler by having explicit return in btf test
selftests/bpf: Fix pyperf180 compilation failure with clang18
scsi: lpfc: Fix possible file string name overflow when updating firmware
PCI: Add no PM reset quirk for NVIDIA Spectrum devices
bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk
ARM: dts: imx7d: Fix coresight funnel ports
ARM: dts: imx7s: Fix lcdif compatible
ARM: dts: imx7s: Fix nand-controller #size-cells
wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus()
bpf: Add map and need_defer parameters to .map_fd_put_ptr()
scsi: libfc: Don't schedule abort twice
scsi: libfc: Fix up timeout error in fc_fcp_rec_error()
ARM: dts: rockchip: fix rk3036 hdmi ports node
ARM: dts: imx25/27-eukrea: Fix RTC node name
ARM: dts: imx: Use flash@0,0 pattern
ARM: dts: imx27: Fix sram node
ARM: dts: imx1: Fix sram node
ARM: dts: imx25/27: Pass timing0
ARM: dts: imx27-apf27dev: Fix LED name
ARM: dts: imx23-sansa: Use preferred i2c-gpios properties
ARM: dts: imx23/28: Fix the DMA controller node name
block: prevent an integer overflow in bvec_try_merge_hw_page
md: Whenassemble the array, consult the superblock of the freshest device
arm64: dts: qcom: msm8996: Fix 'in-ports' is a required property
arm64: dts: qcom: msm8998: Fix 'out-ports' is a required property
wifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices
wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift()
wifi: cfg80211: free beacon_ies when overridden from hidden BSS
f2fs: fix to check return value of f2fs_reserve_new_block()
ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument
fast_dput(): handle underflows gracefully
RDMA/IPoIB: Fix error code return in ipoib_mcast_join
drm/drm_file: fix use of uninitialized variable
drm/framebuffer: Fix use of uninitialized variable
drm/mipi-dsi: Fix detach call without attach
media: stk1160: Fixed high volume of stk1160_dbg messages
media: rockchip: rga: fix swizzling for RGB formats
PCI: add INTEL_HDA_ARL to pci_ids.h
ALSA: hda: Intel: add HDA_ARL PCI ID support
drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time
IB/ipoib: Fix mcast list locking
media: ddbridge: fix an error code problem in ddb_probe
drm/msm/dpu: Ratelimit framedone timeout msgs
clk: hi3620: Fix memory leak in hi3620_mmc_clk_init()
clk: mmp: pxa168: Fix memory leak in pxa168_clk_init()
drm/amdgpu: Let KFD sync with VM fences
drm/amdgpu: Drop 'fence' check in 'to_amdgpu_amdkfd_fence()'
leds: trigger: panic: Don't register panic notifier if creating the trigger failed
um: Fix naming clash between UML and scheduler
um: Don't use vfprintf() for os_info()
um: net: Fix return type of uml_net_start_xmit()
i3c: master: cdns: Update maximum prescaler value for i2c clock
mfd: ti_am335x_tscadc: Fix TI SoC dependencies
PCI: Only override AMD USB controller if required
PCI: switchtec: Fix stdev_release() crash after surprise hot remove
usb: hub: Replace hardcoded quirk value with BIT() macro
fs/kernfs/dir: obey S_ISGID
PCI/AER: Decode Requester ID when no error info found
libsubcmd: Fix memory leak in uniq()
virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings
blk-mq: fix IO hang from sbitmap wakeup race
ceph: fix deadlock or deadcode of misusing dget()
drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()'
perf: Fix the nr_addr_filters fix
wifi: cfg80211: fix RCU dereference in __cfg80211_bss_update
scsi: isci: Fix an error code problem in isci_io_request_build()
net: remove unneeded break
ixgbe: Remove non-inclusive language
ixgbe: Refactor returning internal error codes
ixgbe: Refactor overtemp event handling
ixgbe: Fix an error handling path in ixgbe_read_iosf_sb_reg_x550()
ipv6: Ensure natural alignment of const ipv6 loopback and router addresses
llc: call sock_orphan() at release time
netfilter: nf_log: replace BUG_ON by WARN_ON_ONCE when putting logger
netfilter: nft_ct: sanitize layer 3 and 4 protocol number in custom expectations
net: ipv4: fix a memleak in ip_setup_cork
af_unix: fix lockdep positive in sk_diag_dump_icons()
net: sysfs: Fix /sys/class/net/<iface> path
HID: apple: Add support for the 2021 Magic Keyboard
HID: apple: Swap the Fn and Left Control keys on Apple keyboards
HID: apple: Add 2021 magic keyboard FN key mapping
bonding: remove print in bond_verify_device_path
dmaengine: fsl-qdma: Fix a memory leak related to the status queue DMA
dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA
phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV
phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP
net: stmmac: xgmac: fix handling of DPP safety error for DMA channels
selftests: net: avoid just another constant wait
atm: idt77252: fix a memleak in open_card_ubr0
hwmon: (aspeed-pwm-tacho) mutex for tach reading
hwmon: (coretemp) Fix out-of-bounds memory access
hwmon: (coretemp) Fix bogus core_id to attr name mapping
inet: read sk->sk_family once in inet_recv_error()
rxrpc: Fix response to PING RESPONSE ACKs to a dead call
tipc: Check the bearer type before calling tipc_udp_nl_bearer_add()
ppp_async: limit MRU to 64K
netfilter: nft_compat: reject unused compat flag
netfilter: nft_compat: restrict match/target protocol to u16
netfilter: nft_ct: reject direction for ct id
net/af_iucv: clean up a try_then_request_module()
USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e
USB: serial: option: add Fibocom FM101-GL variant
USB: serial: cp210x: add ID for IMST iM871A-USB
hrtimer: Report offline hrtimer enqueue
Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID
vhost: use kzalloc() instead of kmalloc() followed by memset()
net: stmmac: xgmac: use #define for string constants
net: stmmac: xgmac: fix a typo of register name in DPP safety handling
netfilter: nft_set_rbtree: skip end interval element from gc
btrfs: forbid creating subvol qgroups
btrfs: forbid deleting live subvol qgroup
btrfs: send: return EOPNOTSUPP on unknown flags
of: unittest: add overlay gpio test to catch gpio hog problem
of: unittest: Fix compile in the non-dynamic case
spi: ppc4xx: Drop write-only variable
ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work()
MIPS: Add 'memory' clobber to csum_ipv6_magic() inline assembler
i40e: Fix waiting for queues of all VSIs to be disabled
tracing/trigger: Fix to return error if failed to alloc snapshot
mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again
HID: wacom: generic: Avoid reporting a serial of '0' to userspace
HID: wacom: Do not register input devices until after hid_hw_start
USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT
usb: f_mass_storage: forbid async queue when shutdown happen
i2c: i801: Remove i801_set_block_buffer_mode
i2c: i801: Fix block process call transactions
scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock"
firewire: core: correct documentation of fw_csr_string() kernel API
kbuild: Fix changing ELF file type for output of gen_btf for big endian
nfc: nci: free rx_data_reassembly skb on NCI device cleanup
xen-netback: properly sync TX responses
ALSA: hda/realtek: Enable headset mic on Vaio VJFE-ADL
binder: signal epoll threads of self-work
misc: fastrpc: Mark all sessions as invalid in cb_remove
ext4: fix double-free of blocks due to wrong extents moved_len
tracing: Fix wasted memory in saved_cmdlines logic
staging: iio: ad5933: fix type mismatch regression
iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC
ring-buffer: Clean ring_buffer_poll_wait() error return
serial: max310x: set default value when reading clock ready bit
serial: max310x: improve crystal stable clock detection
x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6
x86/mm/ident_map: Use gbpages only where full GB page should be mapped.
mmc: slot-gpio: Allow non-sleeping GPIO ro
ALSA: hda/conexant: Add quirk for SWS JS201D
nilfs2: fix data corruption in dsync block recovery for small block sizes
nilfs2: fix hang in nilfs_lookup_dirty_data_buffers()
nfp: use correct macro for LengthSelect in BAR config
nfp: flower: prevent re-adding mac index for bonded port
irqchip/irq-brcmstb-l2: Add write memory barrier before exit
can: j1939: Fix UAF in j1939_sk_match_filter during setsockopt(SO_J1939_FILTER)
pmdomain: core: Move the unused cleanup to a _sync initcall
tracing: Inform kmemleak of saved_cmdlines allocation
Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"
bus: moxtet: Add spi device table
arch, mm: remove stale mentions of DISCONIGMEM
mips: Fix max_mapnr being uninitialized on early stages
KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache
netfilter: ipset: fix performance regression in swap operation
netfilter: ipset: Missing gc cancellations fixed
net: prevent mss overflow in skb_segment()
sched/membarrier: reduce the ability to hammer on sys_membarrier
nilfs2: fix potential bug in end_buffer_async_write
PM: runtime: add devm_pm_runtime_enable helper
PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend()
drm/msm/dsi: Enable runtime PM
lsm: new security_file_ioctl_compat() hook
netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval()
Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting""
net: bcmgenet: Fix EEE implementation
of: unittest: fix EXPECT text for gpio hog errors
of: gpio unittest kfree() wrong object
Linux 5.4.269
Change-Id: Iedabcdbe95a83593f102e237f2a80d2fc7206669
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
What: /sys/class/<iface>/queues/rx-<queue>/rps_cpus
|
||||
What: /sys/class/net/<iface>/queues/rx-<queue>/rps_cpus
|
||||
Date: March 2010
|
||||
KernelVersion: 2.6.35
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -8,7 +8,7 @@ Description:
|
||||
network device queue. Possible values depend on the number
|
||||
of available CPU(s) in the system.
|
||||
|
||||
What: /sys/class/<iface>/queues/rx-<queue>/rps_flow_cnt
|
||||
What: /sys/class/net/<iface>/queues/rx-<queue>/rps_flow_cnt
|
||||
Date: April 2010
|
||||
KernelVersion: 2.6.35
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -16,7 +16,7 @@ Description:
|
||||
Number of Receive Packet Steering flows being currently
|
||||
processed by this particular network device receive queue.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/tx_timeout
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/tx_timeout
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -24,7 +24,7 @@ Description:
|
||||
Indicates the number of transmit timeout events seen by this
|
||||
network interface transmit queue.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/tx_maxrate
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/tx_maxrate
|
||||
Date: March 2015
|
||||
KernelVersion: 4.1
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -32,7 +32,7 @@ Description:
|
||||
A Mbps max-rate set for the queue, a value of zero means disabled,
|
||||
default is disabled.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/xps_cpus
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/xps_cpus
|
||||
Date: November 2010
|
||||
KernelVersion: 2.6.38
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -42,7 +42,7 @@ Description:
|
||||
network device transmit queue. Possible vaules depend on the
|
||||
number of available CPU(s) in the system.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/xps_rxqs
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/xps_rxqs
|
||||
Date: June 2018
|
||||
KernelVersion: 4.18.0
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -53,7 +53,7 @@ Description:
|
||||
number of available receive queue(s) in the network device.
|
||||
Default is disabled.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -62,7 +62,7 @@ Description:
|
||||
of this particular network device transmit queue.
|
||||
Default value is 1000.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -70,7 +70,7 @@ Description:
|
||||
Indicates the number of bytes (objects) in flight on this
|
||||
network device transmit queue.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -79,7 +79,7 @@ Description:
|
||||
on this network device transmit queue. This value is clamped
|
||||
to be within the bounds defined by limit_max and limit_min.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
@@ -88,7 +88,7 @@ Description:
|
||||
queued on this network device transmit queue. See
|
||||
include/linux/dynamic_queue_limits.h for the default value.
|
||||
|
||||
What: /sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
|
||||
What: /sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
|
||||
Date: November 2011
|
||||
KernelVersion: 3.3
|
||||
Contact: netdev@vger.kernel.org
|
||||
|
||||
@@ -22,13 +22,16 @@ exclusive.
|
||||
3) object removal. Locking rules: caller locks parent, finds victim,
|
||||
locks victim and calls the method. Locks are exclusive.
|
||||
|
||||
4) rename() that is _not_ cross-directory. Locking rules: caller locks the
|
||||
parent and finds source and target. We lock both (provided they exist). If we
|
||||
need to lock two inodes of different type (dir vs non-dir), we lock directory
|
||||
first. If we need to lock two inodes of the same type, lock them in inode
|
||||
pointer order. Then call the method. All locks are exclusive.
|
||||
NB: we might get away with locking the the source (and target in exchange
|
||||
case) shared.
|
||||
4) rename() that is _not_ cross-directory. Locking rules: caller locks
|
||||
the parent and finds source and target. Then we decide which of the
|
||||
source and target need to be locked. Source needs to be locked if it's a
|
||||
non-directory; target - if it's a non-directory or about to be removed.
|
||||
Take the locks that need to be taken, in inode pointer order if need
|
||||
to take both (that can happen only when both source and target are
|
||||
non-directories - the source because it wouldn't be locked otherwise
|
||||
and the target because mixing directory and non-directory is allowed
|
||||
only with RENAME_EXCHANGE, and that won't be removing the target).
|
||||
After the locks had been taken, call the method. All locks are exclusive.
|
||||
|
||||
5) link creation. Locking rules:
|
||||
|
||||
@@ -44,7 +47,7 @@ rules:
|
||||
|
||||
* lock the filesystem
|
||||
* lock parents in "ancestors first" order. If one is not ancestor of
|
||||
the other, lock them in inode pointer order.
|
||||
the other, lock the parent of source first.
|
||||
* find source and target.
|
||||
* if old parent is equal to or is a descendent of target
|
||||
fail with -ENOTEMPTY
|
||||
@@ -54,10 +57,11 @@ rules:
|
||||
need to lock two inodes of different type (dir vs non-dir), we lock
|
||||
the directory first. If we need to lock two inodes of the same type,
|
||||
lock them in inode pointer order.
|
||||
* Lock subdirectories involved (source before target).
|
||||
* Lock non-directories involved, in inode pointer order.
|
||||
* call the method.
|
||||
|
||||
All ->i_rwsem are taken exclusive. Again, we might get away with locking
|
||||
the the source (and target in exchange case) shared.
|
||||
All ->i_rwsem are taken exclusive.
|
||||
|
||||
The rules above obviously guarantee that all directories that are going to be
|
||||
read, modified or removed by method will be locked by caller.
|
||||
@@ -67,6 +71,7 @@ If no directory is its own ancestor, the scheme above is deadlock-free.
|
||||
|
||||
Proof:
|
||||
|
||||
[XXX: will be updated once we are done massaging the lock_rename()]
|
||||
First of all, at any moment we have a linear ordering of the
|
||||
objects - A < B iff (A is an ancestor of B) or (B is not an ancestor
|
||||
of A and ptr(A) < ptr(B)).
|
||||
|
||||
@@ -95,7 +95,7 @@ symlink: exclusive
|
||||
mkdir: exclusive
|
||||
unlink: exclusive (both)
|
||||
rmdir: exclusive (both)(see below)
|
||||
rename: exclusive (all) (see below)
|
||||
rename: exclusive (both parents, some children) (see below)
|
||||
readlink: no
|
||||
get_link: no
|
||||
setattr: exclusive
|
||||
@@ -113,6 +113,9 @@ tmpfile: no
|
||||
Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_rwsem
|
||||
exclusive on victim.
|
||||
cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
|
||||
->unlink() and ->rename() have ->i_rwsem exclusive on all non-directories
|
||||
involved.
|
||||
->rename() has ->i_rwsem exclusive on any subdirectory that changes parent.
|
||||
|
||||
See Documentation/filesystems/directory-locking.rst for more detailed discussion
|
||||
of the locking scheme for directory operations.
|
||||
|
||||
@@ -858,3 +858,21 @@ be misspelled d_alloc_anon().
|
||||
[should've been added in 2016] stale comment in finish_open() nonwithstanding,
|
||||
failure exits in ->atomic_open() instances should *NOT* fput() the file,
|
||||
no matter what. Everything is handled by the caller.
|
||||
|
||||
---
|
||||
|
||||
**mandatory**
|
||||
|
||||
If ->rename() update of .. on cross-directory move needs an exclusion with
|
||||
directory modifications, do *not* lock the subdirectory in question in your
|
||||
->rename() - it's done by the caller now [that item should've been added in
|
||||
28eceeda130f "fs: Lock moved directories"].
|
||||
|
||||
---
|
||||
|
||||
**mandatory**
|
||||
|
||||
On same-directory ->rename() the (tautological) update of .. is not protected
|
||||
by any locks; just don't do it if the old parent is the same as the new one.
|
||||
We really can't lock two subdirectories in same-directory rename - not without
|
||||
deadlocks.
|
||||
|
||||
@@ -234,7 +234,7 @@ corresponding soft power control. In this case it is necessary to create
|
||||
a virtual widget - a widget with no control bits e.g.
|
||||
::
|
||||
|
||||
SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_DAPM_NOPM, 0, 0, NULL, 0),
|
||||
SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
|
||||
|
||||
This can be used to merge to signal paths together in software.
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 268
|
||||
SUBLEVEL = 269
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
pinctrl-0 = <&pinctrl_weim>;
|
||||
status = "okay";
|
||||
|
||||
nor: nor@0,0 {
|
||||
nor: flash@0,0 {
|
||||
compatible = "cfi-flash";
|
||||
reg = <0 0x00000000 0x02000000>;
|
||||
bank-width = <4>;
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
pinctrl-0 = <&pinctrl_weim>;
|
||||
status = "okay";
|
||||
|
||||
nor: nor@0,0 {
|
||||
nor: flash@0,0 {
|
||||
compatible = "cfi-flash";
|
||||
reg = <0 0x00000000 0x02000000>;
|
||||
bank-width = <2>;
|
||||
|
||||
@@ -268,9 +268,12 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
esram: esram@300000 {
|
||||
esram: sram@300000 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0x00300000 0x20000>;
|
||||
ranges = <0 0x00300000 0x20000>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -175,10 +175,8 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "i2c-gpio";
|
||||
gpios = <
|
||||
&gpio1 24 0 /* SDA */
|
||||
&gpio1 22 0 /* SCL */
|
||||
>;
|
||||
sda-gpios = <&gpio1 24 0>;
|
||||
scl-gpios = <&gpio1 22 0>;
|
||||
i2c-gpio,delay-us = <2>; /* ~100 kHz */
|
||||
};
|
||||
|
||||
@@ -186,10 +184,8 @@
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "i2c-gpio";
|
||||
gpios = <
|
||||
&gpio0 31 0 /* SDA */
|
||||
&gpio0 30 0 /* SCL */
|
||||
>;
|
||||
sda-gpios = <&gpio0 31 0>;
|
||||
scl-gpios = <&gpio0 30 0>;
|
||||
i2c-gpio,delay-us = <2>; /* ~100 kHz */
|
||||
|
||||
touch: touch@20 {
|
||||
|
||||
@@ -406,7 +406,7 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
dma_apbx: dma-apbx@80024000 {
|
||||
dma_apbx: dma-controller@80024000 {
|
||||
compatible = "fsl,imx23-dma-apbx";
|
||||
reg = <0x80024000 0x2000>;
|
||||
interrupts = <7 5 9 26
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
pinctrl-0 = <&pinctrl_i2c1>;
|
||||
status = "okay";
|
||||
|
||||
pcf8563@51 {
|
||||
rtc@51 {
|
||||
compatible = "nxp,pcf8563";
|
||||
reg = <0x51>;
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
bus-width = <18>;
|
||||
display-timings {
|
||||
native-mode = <&qvga_timings>;
|
||||
qvga_timings: 320x240 {
|
||||
qvga_timings: timing0 {
|
||||
clock-frequency = <6500000>;
|
||||
hactive = <320>;
|
||||
vactive = <240>;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
bus-width = <18>;
|
||||
display-timings {
|
||||
native-mode = <&dvi_svga_timings>;
|
||||
dvi_svga_timings: 800x600 {
|
||||
dvi_svga_timings: timing0 {
|
||||
clock-frequency = <40000000>;
|
||||
hactive = <800>;
|
||||
vactive = <600>;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
bus-width = <18>;
|
||||
display-timings {
|
||||
native-mode = <&dvi_vga_timings>;
|
||||
dvi_vga_timings: 640x480 {
|
||||
dvi_vga_timings: timing0 {
|
||||
clock-frequency = <31250000>;
|
||||
hactive = <640>;
|
||||
vactive = <480>;
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
bus-width = <18>;
|
||||
display-timings {
|
||||
native-mode = <&wvga_timings>;
|
||||
wvga_timings: 640x480 {
|
||||
wvga_timings: timing0 {
|
||||
hactive = <640>;
|
||||
vactive = <480>;
|
||||
hback-porch = <45>;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
fsl,pcr = <0xfae80083>; /* non-standard but required */
|
||||
display-timings {
|
||||
native-mode = <&timing0>;
|
||||
timing0: 800x480 {
|
||||
timing0: timing0 {
|
||||
clock-frequency = <33000033>;
|
||||
hactive = <800>;
|
||||
vactive = <480>;
|
||||
@@ -47,7 +47,7 @@
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&pinctrl_gpio_leds>;
|
||||
|
||||
user {
|
||||
led-user {
|
||||
label = "Heartbeat";
|
||||
gpios = <&gpio6 14 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "heartbeat";
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
pinctrl-0 = <&pinctrl_i2c1>;
|
||||
status = "okay";
|
||||
|
||||
pcf8563@51 {
|
||||
rtc@51 {
|
||||
compatible = "nxp,pcf8563";
|
||||
reg = <0x51>;
|
||||
};
|
||||
@@ -90,7 +90,7 @@
|
||||
&weim {
|
||||
status = "okay";
|
||||
|
||||
nor: nor@0,0 {
|
||||
nor: flash@0,0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
compatible = "cfi-flash";
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
display-timings {
|
||||
native-mode = <&timing0>;
|
||||
timing0: 320x240 {
|
||||
timing0: timing0 {
|
||||
clock-frequency = <6500000>;
|
||||
hactive = <320>;
|
||||
vactive = <240>;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
fsl,pcr = <0xf0c88080>; /* non-standard but required */
|
||||
display-timings {
|
||||
native-mode = <&timing0>;
|
||||
timing0: 640x480 {
|
||||
timing0: timing0 {
|
||||
hactive = <640>;
|
||||
vactive = <480>;
|
||||
hback-porch = <112>;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
display-timings {
|
||||
native-mode = <&timing0>;
|
||||
timing0: 240x320 {
|
||||
timing0: timing0 {
|
||||
clock-frequency = <5500000>;
|
||||
hactive = <240>;
|
||||
vactive = <320>;
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
&weim {
|
||||
status = "okay";
|
||||
|
||||
nor: nor@0,0 {
|
||||
nor: flash@0,0 {
|
||||
compatible = "cfi-flash";
|
||||
reg = <0 0x00000000 0x02000000>;
|
||||
bank-width = <2>;
|
||||
|
||||
@@ -588,6 +588,9 @@
|
||||
iram: iram@ffff4c00 {
|
||||
compatible = "mmio-sram";
|
||||
reg = <0xffff4c00 0xb400>;
|
||||
ranges = <0 0xffff4c00 0xb400>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -982,7 +982,7 @@
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
dma_apbx: dma-apbx@80024000 {
|
||||
dma_apbx: dma-controller@80024000 {
|
||||
compatible = "fsl,imx28-dma-apbx";
|
||||
reg = <0x80024000 0x2000>;
|
||||
interrupts = <78 79 66 0
|
||||
|
||||
@@ -204,9 +204,6 @@
|
||||
};
|
||||
|
||||
&ca_funnel_in_ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
ca_funnel_in_port1: endpoint {
|
||||
|
||||
@@ -183,7 +183,11 @@
|
||||
clock-names = "apb_pclk";
|
||||
|
||||
ca_funnel_in_ports: in-ports {
|
||||
port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
ca_funnel_in_port0: endpoint {
|
||||
remote-endpoint = <&etm0_out_port>;
|
||||
};
|
||||
@@ -765,7 +769,7 @@
|
||||
};
|
||||
|
||||
lcdif: lcdif@30730000 {
|
||||
compatible = "fsl,imx7d-lcdif", "fsl,imx28-lcdif";
|
||||
compatible = "fsl,imx7d-lcdif", "fsl,imx6sx-lcdif";
|
||||
reg = <0x30730000 0x10000>;
|
||||
interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clks IMX7D_LCDIF_PIXEL_ROOT_CLK>,
|
||||
@@ -1213,7 +1217,7 @@
|
||||
gpmi: gpmi-nand@33002000{
|
||||
compatible = "fsl,imx7d-gpmi-nand";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <0x33002000 0x2000>, <0x33004000 0x4000>;
|
||||
reg-names = "gpmi-nand", "bch";
|
||||
interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
@@ -337,12 +337,20 @@
|
||||
pinctrl-0 = <&hdmi_ctl>;
|
||||
status = "disabled";
|
||||
|
||||
hdmi_in: port {
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
hdmi_in_vop: endpoint@0 {
|
||||
|
||||
hdmi_in: port@0 {
|
||||
reg = <0>;
|
||||
remote-endpoint = <&vop_out_hdmi>;
|
||||
|
||||
hdmi_in_vop: endpoint {
|
||||
remote-endpoint = <&vop_out_hdmi>;
|
||||
};
|
||||
};
|
||||
|
||||
hdmi_out: port@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -433,6 +433,19 @@
|
||||
};
|
||||
};
|
||||
|
||||
etm {
|
||||
compatible = "qcom,coresight-remote-etm";
|
||||
|
||||
out-ports {
|
||||
port {
|
||||
modem_etm_out_funnel_in2: endpoint {
|
||||
remote-endpoint =
|
||||
<&funnel_in2_in_modem_etm>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
psci {
|
||||
compatible = "arm,psci-1.0";
|
||||
method = "smc";
|
||||
@@ -736,6 +749,14 @@
|
||||
clocks = <&rpmcc RPM_QDSS_CLK>, <&rpmcc RPM_QDSS_A_CLK>;
|
||||
clock-names = "apb_pclk", "atclk";
|
||||
|
||||
in-ports {
|
||||
port {
|
||||
funnel_in2_in_modem_etm: endpoint {
|
||||
remote-endpoint =
|
||||
<&modem_etm_out_funnel_in2>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
out-ports {
|
||||
port {
|
||||
|
||||
@@ -1396,9 +1396,11 @@
|
||||
|
||||
cpu = <&CPU4>;
|
||||
|
||||
port{
|
||||
etm4_out: endpoint {
|
||||
remote-endpoint = <&apss_funnel_in4>;
|
||||
out-ports {
|
||||
port{
|
||||
etm4_out: endpoint {
|
||||
remote-endpoint = <&apss_funnel_in4>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -1413,9 +1415,11 @@
|
||||
|
||||
cpu = <&CPU5>;
|
||||
|
||||
port{
|
||||
etm5_out: endpoint {
|
||||
remote-endpoint = <&apss_funnel_in5>;
|
||||
out-ports {
|
||||
port{
|
||||
etm5_out: endpoint {
|
||||
remote-endpoint = <&apss_funnel_in5>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -1430,9 +1434,11 @@
|
||||
|
||||
cpu = <&CPU6>;
|
||||
|
||||
port{
|
||||
etm6_out: endpoint {
|
||||
remote-endpoint = <&apss_funnel_in6>;
|
||||
out-ports {
|
||||
port{
|
||||
etm6_out: endpoint {
|
||||
remote-endpoint = <&apss_funnel_in6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -1447,9 +1453,11 @@
|
||||
|
||||
cpu = <&CPU7>;
|
||||
|
||||
port{
|
||||
etm7_out: endpoint {
|
||||
remote-endpoint = <&apss_funnel_in7>;
|
||||
out-ports {
|
||||
port{
|
||||
etm7_out: endpoint {
|
||||
remote-endpoint = <&apss_funnel_in7>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2718,8 +2718,8 @@
|
||||
|
||||
interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 488 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 489 IRQ_TYPE_LEVEL_HIGH>;
|
||||
<GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>,
|
||||
<GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>;
|
||||
interrupt-names = "hs_phy_irq", "ss_phy_irq",
|
||||
"dm_hs_phy_irq", "dp_hs_phy_irq";
|
||||
|
||||
@@ -2762,8 +2762,8 @@
|
||||
|
||||
interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 487 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 490 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 491 IRQ_TYPE_LEVEL_HIGH>;
|
||||
<GIC_SPI 490 IRQ_TYPE_EDGE_BOTH>,
|
||||
<GIC_SPI 491 IRQ_TYPE_EDGE_BOTH>;
|
||||
interrupt-names = "hs_phy_irq", "ss_phy_irq",
|
||||
"dm_hs_phy_irq", "dp_hs_phy_irq";
|
||||
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* This file contains NUMA specific variables and functions which can
|
||||
* be split away from DISCONTIGMEM and are used on NUMA machines with
|
||||
* contiguous memory.
|
||||
* This file contains NUMA specific variables and functions which are used on
|
||||
* NUMA machines with contiguous memory.
|
||||
* 2002/08/07 Erich Focht <efocht@ess.nec.de>
|
||||
* Populate cpu entries in sysfs for non-numa systems as well
|
||||
* Intel Corporation - Ashok Raj
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* This file contains NUMA specific variables and functions which can
|
||||
* be split away from DISCONTIGMEM and are used on NUMA machines with
|
||||
* contiguous memory.
|
||||
* This file contains NUMA specific variables and functions which are used on
|
||||
* NUMA machines with contiguous memory.
|
||||
*
|
||||
* 2002/08/07 Erich Focht <efocht@ess.nec.de>
|
||||
*/
|
||||
|
||||
@@ -276,7 +276,8 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
" .set pop"
|
||||
: "=&r" (sum), "=&r" (tmp)
|
||||
: "r" (saddr), "r" (daddr),
|
||||
"0" (htonl(len)), "r" (htonl(proto)), "r" (sum));
|
||||
"0" (htonl(len)), "r" (htonl(proto)), "r" (sum)
|
||||
: "memory");
|
||||
|
||||
return csum_fold(sum);
|
||||
}
|
||||
|
||||
@@ -20,10 +20,4 @@
|
||||
#define nid_to_addrbase(nid) 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DISCONTIGMEM
|
||||
|
||||
#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT)
|
||||
|
||||
#endif /* CONFIG_DISCONTIGMEM */
|
||||
|
||||
#endif /* _ASM_MMZONE_H_ */
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <asm/cpu-features.h>
|
||||
#include <asm/cpu-info.h>
|
||||
#include <asm/fpu.h>
|
||||
|
||||
#ifdef CONFIG_MIPS_FP_SUPPORT
|
||||
|
||||
@@ -309,6 +310,11 @@ void mips_set_personality_nan(struct arch_elf_state *state)
|
||||
struct cpuinfo_mips *c = &boot_cpu_data;
|
||||
struct task_struct *t = current;
|
||||
|
||||
/* Do this early so t->thread.fpu.fcr31 won't be clobbered in case
|
||||
* we are preempted before the lose_fpu(0) in start_thread.
|
||||
*/
|
||||
lose_fpu(0);
|
||||
|
||||
t->thread.fpu.fcr31 = c->fpu_csr31;
|
||||
switch (state->nan_2008) {
|
||||
case 0:
|
||||
|
||||
@@ -416,7 +416,12 @@ void __init paging_init(void)
|
||||
(highend_pfn - max_low_pfn) << (PAGE_SHIFT - 10));
|
||||
max_zone_pfns[ZONE_HIGHMEM] = max_low_pfn;
|
||||
}
|
||||
|
||||
max_mapnr = highend_pfn ? highend_pfn : max_low_pfn;
|
||||
#else
|
||||
max_mapnr = max_low_pfn;
|
||||
#endif
|
||||
high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
|
||||
|
||||
free_area_init_nodes(max_zone_pfns);
|
||||
}
|
||||
@@ -452,16 +457,6 @@ void __init mem_init(void)
|
||||
*/
|
||||
BUILD_BUG_ON(IS_ENABLED(CONFIG_32BIT) && (_PFN_SHIFT > PAGE_SHIFT));
|
||||
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
#ifdef CONFIG_DISCONTIGMEM
|
||||
#error "CONFIG_HIGHMEM and CONFIG_DISCONTIGMEM dont work together yet"
|
||||
#endif
|
||||
max_mapnr = highend_pfn ? highend_pfn : max_low_pfn;
|
||||
#else
|
||||
max_mapnr = max_low_pfn;
|
||||
#endif
|
||||
high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
|
||||
|
||||
maar_init();
|
||||
memblock_free_all();
|
||||
setup_zero_pages(); /* Setup zeroed pages. */
|
||||
|
||||
@@ -76,18 +76,12 @@
|
||||
* virt_to_page(k) convert a _valid_ virtual address to struct page *
|
||||
* virt_addr_valid(k) indicates whether a virtual address is valid
|
||||
*/
|
||||
#ifndef CONFIG_DISCONTIGMEM
|
||||
|
||||
#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
|
||||
#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
|
||||
|
||||
#define virt_to_page(kaddr) (pfn_to_page(__pa(kaddr) >> PAGE_SHIFT))
|
||||
#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
|
||||
|
||||
#else /* CONFIG_DISCONTIGMEM */
|
||||
#error CONFIG_DISCONTIGMEM is not supported yet.
|
||||
#endif /* !CONFIG_DISCONTIGMEM */
|
||||
|
||||
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -122,10 +122,10 @@ static unsigned long f_extend(unsigned long address)
|
||||
#ifdef CONFIG_64BIT
|
||||
if(unlikely(parisc_narrow_firmware)) {
|
||||
if((address & 0xff000000) == 0xf0000000)
|
||||
return 0xf0f0f0f000000000UL | (u32)address;
|
||||
return (0xfffffff0UL << 32) | (u32)address;
|
||||
|
||||
if((address & 0xf0000000) == 0xf0000000)
|
||||
return 0xffffffff00000000UL | (u32)address;
|
||||
return (0xffffffffUL << 32) | (u32)address;
|
||||
}
|
||||
#endif
|
||||
return address;
|
||||
|
||||
@@ -375,5 +375,9 @@ extern void *abatron_pteptrs[2];
|
||||
#include <asm/nohash/mmu.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FA_DUMP) || defined(CONFIG_PRESERVE_FA_DUMP)
|
||||
#define __HAVE_ARCH_RESERVED_KERNEL_PAGES
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ASM_POWERPC_MMU_H_ */
|
||||
|
||||
@@ -42,9 +42,6 @@ u64 memory_hotplug_max(void);
|
||||
#else
|
||||
#define memory_hotplug_max() memblock_end_of_DRAM()
|
||||
#endif /* CONFIG_NEED_MULTIPLE_NODES */
|
||||
#ifdef CONFIG_FA_DUMP
|
||||
#define __HAVE_ARCH_RESERVED_KERNEL_PAGES
|
||||
#endif
|
||||
|
||||
#endif /* __KERNEL__ */
|
||||
#endif /* _ASM_MMZONE_H_ */
|
||||
|
||||
@@ -1424,10 +1424,12 @@ static int emulate_instruction(struct pt_regs *regs)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_GENERIC_BUG
|
||||
int is_valid_bugaddr(unsigned long addr)
|
||||
{
|
||||
return is_kernel_addr(addr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MATH_EMULATION
|
||||
static int emulate_math(struct pt_regs *regs)
|
||||
|
||||
@@ -34,8 +34,8 @@ obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
|
||||
# 64-bit linker creates .sfpr on demand for final link (vmlinux),
|
||||
# so it is only needed for modules, and only for older linkers which
|
||||
# do not support --save-restore-funcs
|
||||
ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
|
||||
always-$(CONFIG_PPC64) += crtsavres.o
|
||||
ifeq ($(call ld-ifversion, -lt, 225000000, y)$(CONFIG_PPC64),yy)
|
||||
always += crtsavres.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \
|
||||
|
||||
@@ -469,6 +469,8 @@ static int do_fp_load(struct instruction_op *op, unsigned long ea,
|
||||
} u;
|
||||
|
||||
nb = GETSIZE(op->type);
|
||||
if (nb > sizeof(u))
|
||||
return -EINVAL;
|
||||
if (!address_ok(regs, ea, nb))
|
||||
return -EFAULT;
|
||||
rn = op->reg;
|
||||
@@ -519,6 +521,8 @@ static int do_fp_store(struct instruction_op *op, unsigned long ea,
|
||||
} u;
|
||||
|
||||
nb = GETSIZE(op->type);
|
||||
if (nb > sizeof(u))
|
||||
return -EINVAL;
|
||||
if (!address_ok(regs, ea, nb))
|
||||
return -EFAULT;
|
||||
rn = op->reg;
|
||||
@@ -563,6 +567,9 @@ static nokprobe_inline int do_vec_load(int rn, unsigned long ea,
|
||||
u8 b[sizeof(__vector128)];
|
||||
} u = {};
|
||||
|
||||
if (size > sizeof(u))
|
||||
return -EINVAL;
|
||||
|
||||
if (!address_ok(regs, ea & ~0xfUL, 16))
|
||||
return -EFAULT;
|
||||
/* align to multiple of size */
|
||||
@@ -590,6 +597,9 @@ static nokprobe_inline int do_vec_store(int rn, unsigned long ea,
|
||||
u8 b[sizeof(__vector128)];
|
||||
} u;
|
||||
|
||||
if (size > sizeof(u))
|
||||
return -EINVAL;
|
||||
|
||||
if (!address_ok(regs, ea & ~0xfUL, 16))
|
||||
return -EFAULT;
|
||||
/* align to multiple of size */
|
||||
|
||||
@@ -442,6 +442,7 @@ void ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr,
|
||||
set_pte_at(vma->vm_mm, addr, ptep, pte);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
/*
|
||||
* For hash translation mode, we use the deposited table to store hash slot
|
||||
* information and they are stored at PTRS_PER_PMD offset from related pmd
|
||||
@@ -463,6 +464,7 @@ int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Does the CPU support tlbie?
|
||||
|
||||
@@ -104,7 +104,7 @@ void pgtable_cache_add(unsigned int shift)
|
||||
* as to leave enough 0 bits in the address to contain it. */
|
||||
unsigned long minalign = max(MAX_PGTABLE_INDEX_SIZE + 1,
|
||||
HUGEPD_SHIFT_MASK + 1);
|
||||
struct kmem_cache *new;
|
||||
struct kmem_cache *new = NULL;
|
||||
|
||||
/* It would be nice if this was a BUILD_BUG_ON(), but at the
|
||||
* moment, gcc doesn't seem to recognize is_power_of_2 as a
|
||||
@@ -117,7 +117,8 @@ void pgtable_cache_add(unsigned int shift)
|
||||
|
||||
align = max_t(unsigned long, align, minalign);
|
||||
name = kasprintf(GFP_KERNEL, "pgtable-2^%d", shift);
|
||||
new = kmem_cache_create(name, table_size, align, 0, ctor(shift));
|
||||
if (name)
|
||||
new = kmem_cache_create(name, table_size, align, 0, ctor(shift));
|
||||
if (!new)
|
||||
panic("Could not allocate pgtable cache for order %d", shift);
|
||||
|
||||
|
||||
@@ -413,6 +413,7 @@ static int __poke_user(struct task_struct *child, addr_t addr, addr_t data)
|
||||
/*
|
||||
* floating point control reg. is in the thread structure
|
||||
*/
|
||||
save_fpu_regs();
|
||||
if ((unsigned int) data != 0 ||
|
||||
test_fp_ctl(data >> (BITS_PER_LONG - 32)))
|
||||
return -EINVAL;
|
||||
@@ -773,6 +774,7 @@ static int __poke_user_compat(struct task_struct *child,
|
||||
/*
|
||||
* floating point control reg. is in the thread structure
|
||||
*/
|
||||
save_fpu_regs();
|
||||
if (test_fp_ctl(tmp))
|
||||
return -EINVAL;
|
||||
child->thread.fpu.fpc = data;
|
||||
@@ -1006,9 +1008,7 @@ static int s390_fpregs_set(struct task_struct *target,
|
||||
int rc = 0;
|
||||
freg_t fprs[__NUM_FPRS];
|
||||
|
||||
if (target == current)
|
||||
save_fpu_regs();
|
||||
|
||||
save_fpu_regs();
|
||||
if (MACHINE_HAS_VX)
|
||||
convert_vx_to_fp(fprs, target->thread.fpu.vxrs);
|
||||
else
|
||||
|
||||
@@ -3348,10 +3348,6 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
|
||||
|
||||
vcpu_load(vcpu);
|
||||
|
||||
if (test_fp_ctl(fpu->fpc)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
vcpu->run->s.regs.fpc = fpu->fpc;
|
||||
if (MACHINE_HAS_VX)
|
||||
convert_fp_to_vx((__vector128 *) vcpu->run->s.regs.vrs,
|
||||
@@ -3359,7 +3355,6 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
|
||||
else
|
||||
memcpy(vcpu->run->s.regs.fprs, &fpu->fprs, sizeof(fpu->fprs));
|
||||
|
||||
out:
|
||||
vcpu_put(vcpu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ static int uml_net_close(struct net_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
static netdev_tx_t uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct uml_net_private *lp = netdev_priv(dev);
|
||||
unsigned long flags;
|
||||
|
||||
@@ -49,7 +49,7 @@ extern void do_uml_exitcalls(void);
|
||||
* Are we disallowed to sleep? Used to choose between GFP_KERNEL and
|
||||
* GFP_ATOMIC.
|
||||
*/
|
||||
extern int __cant_sleep(void);
|
||||
extern int __uml_cant_sleep(void);
|
||||
extern int get_current_pid(void);
|
||||
extern int copy_from_user_proc(void *to, void *from, int size);
|
||||
extern int cpu(void);
|
||||
|
||||
@@ -258,7 +258,7 @@ void arch_cpu_idle(void)
|
||||
local_irq_enable();
|
||||
}
|
||||
|
||||
int __cant_sleep(void) {
|
||||
int __uml_cant_sleep(void) {
|
||||
return in_atomic() || irqs_disabled() || in_interrupt();
|
||||
/* Is in_interrupt() really needed? */
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
|
||||
unsigned long stack, sp;
|
||||
int pid, fds[2], ret, n;
|
||||
|
||||
stack = alloc_stack(0, __cant_sleep());
|
||||
stack = alloc_stack(0, __uml_cant_sleep());
|
||||
if (stack == 0)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -69,7 +69,7 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv)
|
||||
data.pre_data = pre_data;
|
||||
data.argv = argv;
|
||||
data.fd = fds[1];
|
||||
data.buf = __cant_sleep() ? uml_kmalloc(PATH_MAX, UM_GFP_ATOMIC) :
|
||||
data.buf = __uml_cant_sleep() ? uml_kmalloc(PATH_MAX, UM_GFP_ATOMIC) :
|
||||
uml_kmalloc(PATH_MAX, UM_GFP_KERNEL);
|
||||
pid = clone(helper_child, (void *) sp, CLONE_VM, &data);
|
||||
if (pid < 0) {
|
||||
@@ -116,7 +116,7 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
|
||||
unsigned long stack, sp;
|
||||
int pid, status, err;
|
||||
|
||||
stack = alloc_stack(0, __cant_sleep());
|
||||
stack = alloc_stack(0, __uml_cant_sleep());
|
||||
if (stack == 0)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -166,23 +166,38 @@ __uml_setup("quiet", quiet_cmd_param,
|
||||
"quiet\n"
|
||||
" Turns off information messages during boot.\n\n");
|
||||
|
||||
/*
|
||||
* The os_info/os_warn functions will be called by helper threads. These
|
||||
* have a very limited stack size and using the libc formatting functions
|
||||
* may overflow the stack.
|
||||
* So pull in the kernel vscnprintf and use that instead with a fixed
|
||||
* on-stack buffer.
|
||||
*/
|
||||
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
|
||||
|
||||
void os_info(const char *fmt, ...)
|
||||
{
|
||||
char buf[256];
|
||||
va_list list;
|
||||
int len;
|
||||
|
||||
if (quiet_info)
|
||||
return;
|
||||
|
||||
va_start(list, fmt);
|
||||
vfprintf(stderr, fmt, list);
|
||||
len = vscnprintf(buf, sizeof(buf), fmt, list);
|
||||
fwrite(buf, len, 1, stderr);
|
||||
va_end(list);
|
||||
}
|
||||
|
||||
void os_warn(const char *fmt, ...)
|
||||
{
|
||||
char buf[256];
|
||||
va_list list;
|
||||
int len;
|
||||
|
||||
va_start(list, fmt);
|
||||
vfprintf(stderr, fmt, list);
|
||||
len = vscnprintf(buf, sizeof(buf), fmt, list);
|
||||
fwrite(buf, len, 1, stderr);
|
||||
va_end(list);
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ config X86_CMOV
|
||||
config X86_MINIMUM_CPU_FAMILY
|
||||
int
|
||||
default "64" if X86_64
|
||||
default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCRUSOE || MCORE2 || MK7 || MK8)
|
||||
default "6" if X86_32 && (MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MEFFICEON || MATOM || MCORE2 || MK7 || MK8)
|
||||
default "5" if X86_32 && X86_CMPXCHG64
|
||||
default "4"
|
||||
|
||||
|
||||
@@ -14,12 +14,29 @@ struct pt_regs;
|
||||
,,regs->di,,regs->si,,regs->dx \
|
||||
,,regs->r10,,regs->r8,,regs->r9) \
|
||||
|
||||
|
||||
/* SYSCALL_PT_ARGS is Adapted from s390x */
|
||||
#define SYSCALL_PT_ARG6(m, t1, t2, t3, t4, t5, t6) \
|
||||
SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5), m(t6, (regs->bp))
|
||||
#define SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5) \
|
||||
SYSCALL_PT_ARG4(m, t1, t2, t3, t4), m(t5, (regs->di))
|
||||
#define SYSCALL_PT_ARG4(m, t1, t2, t3, t4) \
|
||||
SYSCALL_PT_ARG3(m, t1, t2, t3), m(t4, (regs->si))
|
||||
#define SYSCALL_PT_ARG3(m, t1, t2, t3) \
|
||||
SYSCALL_PT_ARG2(m, t1, t2), m(t3, (regs->dx))
|
||||
#define SYSCALL_PT_ARG2(m, t1, t2) \
|
||||
SYSCALL_PT_ARG1(m, t1), m(t2, (regs->cx))
|
||||
#define SYSCALL_PT_ARG1(m, t1) m(t1, (regs->bx))
|
||||
#define SYSCALL_PT_ARGS(x, ...) SYSCALL_PT_ARG##x(__VA_ARGS__)
|
||||
|
||||
#define __SC_COMPAT_CAST(t, a) \
|
||||
(__typeof(__builtin_choose_expr(__TYPE_IS_L(t), 0, 0U))) \
|
||||
(unsigned int)a
|
||||
|
||||
/* Mapping of registers to parameters for syscalls on i386 */
|
||||
#define SC_IA32_REGS_TO_ARGS(x, ...) \
|
||||
__MAP(x,__SC_ARGS \
|
||||
,,(unsigned int)regs->bx,,(unsigned int)regs->cx \
|
||||
,,(unsigned int)regs->dx,,(unsigned int)regs->si \
|
||||
,,(unsigned int)regs->di,,(unsigned int)regs->bp)
|
||||
SYSCALL_PT_ARGS(x, __SC_COMPAT_CAST, \
|
||||
__MAP(x, __SC_TYPE, __VA_ARGS__)) \
|
||||
|
||||
#ifdef CONFIG_IA32_EMULATION
|
||||
/*
|
||||
|
||||
@@ -277,15 +277,6 @@ static void init_amd_k6(struct cpuinfo_x86 *c)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Work around Erratum 1386. The XSAVES instruction malfunctions in
|
||||
* certain circumstances on Zen1/2 uarch, and not all parts have had
|
||||
* updated microcode at the time of writing (March 2023).
|
||||
*
|
||||
* Affected parts all have no supervisor XSAVE states, meaning that
|
||||
* the XSAVEC instruction (which works fine) is equivalent.
|
||||
*/
|
||||
clear_cpu_cap(c, X86_FEATURE_XSAVES);
|
||||
}
|
||||
|
||||
static void init_amd_k7(struct cpuinfo_x86 *c)
|
||||
@@ -989,6 +980,17 @@ static void init_amd_zn(struct cpuinfo_x86 *c)
|
||||
if (c->x86 == 0x19 && !cpu_has(c, X86_FEATURE_BTC_NO))
|
||||
set_cpu_cap(c, X86_FEATURE_BTC_NO);
|
||||
}
|
||||
|
||||
/*
|
||||
* Work around Erratum 1386. The XSAVES instruction malfunctions in
|
||||
* certain circumstances on Zen1/2 uarch, and not all parts have had
|
||||
* updated microcode at the time of writing (March 2023).
|
||||
*
|
||||
* Affected parts all have no supervisor XSAVE states, meaning that
|
||||
* the XSAVEC instruction (which works fine) is equivalent.
|
||||
*/
|
||||
if (c->x86 == 0x17)
|
||||
clear_cpu_cap(c, X86_FEATURE_XSAVES);
|
||||
}
|
||||
|
||||
static bool cpu_has_zenbleed_microcode(void)
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <linux/export.h>
|
||||
#include <linux/jump_label.h>
|
||||
#include <linux/set_memory.h>
|
||||
#include <linux/kexec.h>
|
||||
|
||||
#include <asm/intel-family.h>
|
||||
#include <asm/processor.h>
|
||||
@@ -315,6 +316,7 @@ static noinstr void mce_panic(const char *msg, struct mce *final, char *exp)
|
||||
struct llist_node *pending;
|
||||
struct mce_evt_llist *l;
|
||||
int apei_err = 0;
|
||||
struct page *p;
|
||||
|
||||
/*
|
||||
* Allow instrumentation around external facilities usage. Not that it
|
||||
@@ -370,6 +372,20 @@ static noinstr void mce_panic(const char *msg, struct mce *final, char *exp)
|
||||
if (!fake_panic) {
|
||||
if (panic_timeout == 0)
|
||||
panic_timeout = mca_cfg.panic_timeout;
|
||||
|
||||
/*
|
||||
* Kdump skips the poisoned page in order to avoid
|
||||
* touching the error bits again. Poison the page even
|
||||
* if the error is fatal and the machine is about to
|
||||
* panic.
|
||||
*/
|
||||
if (kexec_crash_loaded()) {
|
||||
if (final && (final->status & MCI_STATUS_ADDRV)) {
|
||||
p = pfn_to_online_page(final->addr >> PAGE_SHIFT);
|
||||
if (p)
|
||||
SetPageHWPoison(p);
|
||||
}
|
||||
}
|
||||
panic(msg);
|
||||
} else
|
||||
pr_emerg(HW_ERR "Fake kernel panic: %s\n", msg);
|
||||
|
||||
@@ -26,18 +26,31 @@ static int ident_pud_init(struct x86_mapping_info *info, pud_t *pud_page,
|
||||
for (; addr < end; addr = next) {
|
||||
pud_t *pud = pud_page + pud_index(addr);
|
||||
pmd_t *pmd;
|
||||
bool use_gbpage;
|
||||
|
||||
next = (addr & PUD_MASK) + PUD_SIZE;
|
||||
if (next > end)
|
||||
next = end;
|
||||
|
||||
if (info->direct_gbpages) {
|
||||
/* if this is already a gbpage, this portion is already mapped */
|
||||
if (pud_large(*pud))
|
||||
continue;
|
||||
|
||||
/* Is using a gbpage allowed? */
|
||||
use_gbpage = info->direct_gbpages;
|
||||
|
||||
/* Don't use gbpage if it maps more than the requested region. */
|
||||
/* at the begining: */
|
||||
use_gbpage &= ((addr & ~PUD_MASK) == 0);
|
||||
/* ... or at the end: */
|
||||
use_gbpage &= ((next & ~PUD_MASK) == 0);
|
||||
|
||||
/* Never overwrite existing mappings */
|
||||
use_gbpage &= !pud_present(*pud);
|
||||
|
||||
if (use_gbpage) {
|
||||
pud_t pudval;
|
||||
|
||||
if (pud_present(*pud))
|
||||
continue;
|
||||
|
||||
addr &= PUD_MASK;
|
||||
pudval = __pud((addr - info->offset) | info->page_flag);
|
||||
set_pud(pud, pudval);
|
||||
continue;
|
||||
|
||||
@@ -181,10 +181,6 @@ static inline unsigned long ___pa(unsigned long va)
|
||||
#define pfn_valid(pfn) \
|
||||
((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
|
||||
|
||||
#ifdef CONFIG_DISCONTIGMEM
|
||||
# error CONFIG_DISCONTIGMEM not supported
|
||||
#endif
|
||||
|
||||
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
|
||||
#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
|
||||
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
|
||||
|
||||
@@ -710,7 +710,7 @@ static bool bio_try_merge_pc_page(struct request_queue *q, struct bio *bio,
|
||||
|
||||
if ((addr1 | mask) != (addr2 | mask))
|
||||
return false;
|
||||
if (bv->bv_len + len > queue_max_segment_size(q))
|
||||
if (len > queue_max_segment_size(q) - bv->bv_len)
|
||||
return false;
|
||||
return __bio_try_merge_page(bio, page, len, offset, same_page);
|
||||
}
|
||||
@@ -884,7 +884,7 @@ void bio_release_pages(struct bio *bio, bool mark_dirty)
|
||||
return;
|
||||
|
||||
bio_for_each_segment_all(bvec, bio, iter_all) {
|
||||
if (mark_dirty && !PageCompound(bvec->bv_page))
|
||||
if (mark_dirty)
|
||||
set_page_dirty_lock(bvec->bv_page);
|
||||
put_page(bvec->bv_page);
|
||||
}
|
||||
@@ -1692,8 +1692,7 @@ void bio_set_pages_dirty(struct bio *bio)
|
||||
struct bvec_iter_all iter_all;
|
||||
|
||||
bio_for_each_segment_all(bvec, bio, iter_all) {
|
||||
if (!PageCompound(bvec->bv_page))
|
||||
set_page_dirty_lock(bvec->bv_page);
|
||||
set_page_dirty_lock(bvec->bv_page);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1741,7 +1740,7 @@ void bio_check_pages_dirty(struct bio *bio)
|
||||
struct bvec_iter_all iter_all;
|
||||
|
||||
bio_for_each_segment_all(bvec, bio, iter_all) {
|
||||
if (!PageDirty(bvec->bv_page) && !PageCompound(bvec->bv_page))
|
||||
if (!PageDirty(bvec->bv_page))
|
||||
goto defer;
|
||||
}
|
||||
|
||||
|
||||
@@ -1157,6 +1157,22 @@ static bool blk_mq_mark_tag_wait(struct blk_mq_hw_ctx *hctx,
|
||||
wait->flags &= ~WQ_FLAG_EXCLUSIVE;
|
||||
__add_wait_queue(wq, wait);
|
||||
|
||||
/*
|
||||
* Add one explicit barrier since blk_mq_get_driver_tag() may
|
||||
* not imply barrier in case of failure.
|
||||
*
|
||||
* Order adding us to wait queue and allocating driver tag.
|
||||
*
|
||||
* The pair is the one implied in sbitmap_queue_wake_up() which
|
||||
* orders clearing sbitmap tag bits and waitqueue_active() in
|
||||
* __sbitmap_queue_wake_up(), since waitqueue_active() is lockless
|
||||
*
|
||||
* Otherwise, re-order of adding wait queue and getting driver tag
|
||||
* may cause __sbitmap_queue_wake_up() to wake up nothing because
|
||||
* the waitqueue_active() may not observe us in wait queue.
|
||||
*/
|
||||
smp_mb();
|
||||
|
||||
/*
|
||||
* It's possible that a tag was freed in the window between the
|
||||
* allocation failure and adding the hardware queue to the wait
|
||||
|
||||
@@ -217,6 +217,7 @@ static struct crypto_larval *__crypto_register_alg(struct crypto_alg *alg)
|
||||
}
|
||||
|
||||
if (!strcmp(q->cra_driver_name, alg->cra_name) ||
|
||||
!strcmp(q->cra_driver_name, alg->cra_driver_name) ||
|
||||
!strcmp(q->cra_name, alg->cra_driver_name))
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -316,9 +316,10 @@ static void __exit extlog_exit(void)
|
||||
{
|
||||
edac_set_report_status(old_edac_report_status);
|
||||
mce_unregister_decode_chain(&extlog_mce_dec);
|
||||
((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN;
|
||||
if (extlog_l1_addr)
|
||||
if (extlog_l1_addr) {
|
||||
((struct extlog_l1_head *)extlog_l1_addr)->flags &= ~FLAG_OS_OPTIN;
|
||||
acpi_os_unmap_iomem(extlog_l1_addr, l1_size);
|
||||
}
|
||||
if (elog_addr)
|
||||
acpi_os_unmap_iomem(elog_addr, elog_size);
|
||||
release_mem_region(elog_base, elog_size);
|
||||
|
||||
@@ -568,6 +568,15 @@ static const struct dmi_system_id video_dmi_table[] = {
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 3350"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.callback = video_set_report_key_events,
|
||||
.driver_data = (void *)((uintptr_t)REPORT_BRIGHTNESS_KEY_EVENTS),
|
||||
.ident = "COLORFUL X15 AT 23",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "COLORFUL"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "X15 AT 23"),
|
||||
},
|
||||
},
|
||||
/*
|
||||
* Some machines change the brightness themselves when a brightness
|
||||
* hotkey gets pressed, despite us telling them not to. In this case
|
||||
|
||||
@@ -433,6 +433,16 @@ binder_enqueue_thread_work_ilocked(struct binder_thread *thread,
|
||||
{
|
||||
WARN_ON(!list_empty(&thread->waiting_thread_node));
|
||||
binder_enqueue_work_ilocked(work, &thread->todo);
|
||||
|
||||
/* (e)poll-based threads require an explicit wakeup signal when
|
||||
* queuing their own work; they rely on these events to consume
|
||||
* messages without I/O block. Without it, threads risk waiting
|
||||
* indefinitely without handling the work.
|
||||
*/
|
||||
if (thread->looper & BINDER_LOOPER_STATE_POLL &&
|
||||
thread->pid == current->pid && !thread->process_todo)
|
||||
wake_up_interruptible_sync(&thread->wait);
|
||||
|
||||
thread->process_todo = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2935,6 +2935,8 @@ open_card_ubr0(struct idt77252_dev *card)
|
||||
vc->scq = alloc_scq(card, vc->class);
|
||||
if (!vc->scq) {
|
||||
printk("%s: can't get SCQ.\n", card->name);
|
||||
kfree(card->vcs[0]);
|
||||
card->vcs[0] = NULL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
@@ -920,7 +920,7 @@ static int __init genpd_power_off_unused(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
late_initcall(genpd_power_off_unused);
|
||||
late_initcall_sync(genpd_power_off_unused);
|
||||
|
||||
#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_GENERIC_DOMAINS_OF)
|
||||
|
||||
|
||||
@@ -3603,14 +3603,15 @@ static bool rbd_lock_add_request(struct rbd_img_request *img_req)
|
||||
static void rbd_lock_del_request(struct rbd_img_request *img_req)
|
||||
{
|
||||
struct rbd_device *rbd_dev = img_req->rbd_dev;
|
||||
bool need_wakeup;
|
||||
bool need_wakeup = false;
|
||||
|
||||
lockdep_assert_held(&rbd_dev->lock_rwsem);
|
||||
spin_lock(&rbd_dev->lock_lists_lock);
|
||||
rbd_assert(!list_empty(&img_req->lock_item));
|
||||
list_del_init(&img_req->lock_item);
|
||||
need_wakeup = (rbd_dev->lock_state == RBD_LOCK_STATE_RELEASING &&
|
||||
list_empty(&rbd_dev->running_list));
|
||||
if (!list_empty(&img_req->lock_item)) {
|
||||
list_del_init(&img_req->lock_item);
|
||||
need_wakeup = (rbd_dev->lock_state == RBD_LOCK_STATE_RELEASING &&
|
||||
list_empty(&rbd_dev->running_list));
|
||||
}
|
||||
spin_unlock(&rbd_dev->lock_lists_lock);
|
||||
if (need_wakeup)
|
||||
complete(&rbd_dev->releasing_wait);
|
||||
@@ -3997,14 +3998,19 @@ static void wake_lock_waiters(struct rbd_device *rbd_dev, int result)
|
||||
return;
|
||||
}
|
||||
|
||||
list_for_each_entry(img_req, &rbd_dev->acquiring_list, lock_item) {
|
||||
while (!list_empty(&rbd_dev->acquiring_list)) {
|
||||
img_req = list_first_entry(&rbd_dev->acquiring_list,
|
||||
struct rbd_img_request, lock_item);
|
||||
mutex_lock(&img_req->state_mutex);
|
||||
rbd_assert(img_req->state == RBD_IMG_EXCLUSIVE_LOCK);
|
||||
if (!result)
|
||||
list_move_tail(&img_req->lock_item,
|
||||
&rbd_dev->running_list);
|
||||
else
|
||||
list_del_init(&img_req->lock_item);
|
||||
rbd_img_schedule(img_req, result);
|
||||
mutex_unlock(&img_req->state_mutex);
|
||||
}
|
||||
|
||||
list_splice_tail_init(&rbd_dev->acquiring_list, &rbd_dev->running_list);
|
||||
}
|
||||
|
||||
static int get_lock_owner_info(struct rbd_device *rbd_dev,
|
||||
|
||||
@@ -833,6 +833,12 @@ static int moxtet_remove(struct spi_device *spi)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct spi_device_id moxtet_spi_ids[] = {
|
||||
{ "moxtet" },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(spi, moxtet_spi_ids);
|
||||
|
||||
static const struct of_device_id moxtet_dt_ids[] = {
|
||||
{ .compatible = "cznic,moxtet" },
|
||||
{},
|
||||
@@ -844,6 +850,7 @@ static struct spi_driver moxtet_spi_driver = {
|
||||
.name = "moxtet",
|
||||
.of_match_table = moxtet_dt_ids,
|
||||
},
|
||||
.id_table = moxtet_spi_ids,
|
||||
.probe = moxtet_probe,
|
||||
.remove = moxtet_remove,
|
||||
};
|
||||
|
||||
@@ -24,10 +24,13 @@
|
||||
#include <linux/random.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
#define RNG_MODULE_NAME "hw_random"
|
||||
|
||||
#define RNG_BUFFER_SIZE (SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES)
|
||||
|
||||
static struct hwrng *current_rng;
|
||||
/* the current rng has been explicitly chosen by user via sysfs */
|
||||
static int cur_rng_set_by_user;
|
||||
@@ -59,7 +62,7 @@ static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
|
||||
|
||||
static size_t rng_buffer_size(void)
|
||||
{
|
||||
return SMP_CACHE_BYTES < 32 ? 32 : SMP_CACHE_BYTES;
|
||||
return RNG_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
static void add_early_randomness(struct hwrng *rng)
|
||||
@@ -202,6 +205,7 @@ static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
|
||||
static ssize_t rng_dev_read(struct file *filp, char __user *buf,
|
||||
size_t size, loff_t *offp)
|
||||
{
|
||||
u8 buffer[RNG_BUFFER_SIZE];
|
||||
ssize_t ret = 0;
|
||||
int err = 0;
|
||||
int bytes_read, len;
|
||||
@@ -229,34 +233,37 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf,
|
||||
if (bytes_read < 0) {
|
||||
err = bytes_read;
|
||||
goto out_unlock_reading;
|
||||
}
|
||||
data_avail = bytes_read;
|
||||
}
|
||||
|
||||
if (!data_avail) {
|
||||
if (filp->f_flags & O_NONBLOCK) {
|
||||
} else if (bytes_read == 0 &&
|
||||
(filp->f_flags & O_NONBLOCK)) {
|
||||
err = -EAGAIN;
|
||||
goto out_unlock_reading;
|
||||
}
|
||||
} else {
|
||||
len = data_avail;
|
||||
|
||||
data_avail = bytes_read;
|
||||
}
|
||||
|
||||
len = data_avail;
|
||||
if (len) {
|
||||
if (len > size)
|
||||
len = size;
|
||||
|
||||
data_avail -= len;
|
||||
|
||||
if (copy_to_user(buf + ret, rng_buffer + data_avail,
|
||||
len)) {
|
||||
memcpy(buffer, rng_buffer + data_avail, len);
|
||||
}
|
||||
mutex_unlock(&reading_mutex);
|
||||
put_rng(rng);
|
||||
|
||||
if (len) {
|
||||
if (copy_to_user(buf + ret, buffer, len)) {
|
||||
err = -EFAULT;
|
||||
goto out_unlock_reading;
|
||||
goto out;
|
||||
}
|
||||
|
||||
size -= len;
|
||||
ret += len;
|
||||
}
|
||||
|
||||
mutex_unlock(&reading_mutex);
|
||||
put_rng(rng);
|
||||
|
||||
if (need_resched())
|
||||
schedule_timeout_interruptible(1);
|
||||
@@ -267,6 +274,7 @@ static ssize_t rng_dev_read(struct file *filp, char __user *buf,
|
||||
}
|
||||
}
|
||||
out:
|
||||
memzero_explicit(buffer, sizeof(buffer));
|
||||
return ret ? : err;
|
||||
|
||||
out_unlock_reading:
|
||||
|
||||
@@ -467,8 +467,10 @@ static void __init hi3620_mmc_clk_init(struct device_node *node)
|
||||
return;
|
||||
|
||||
clk_data->clks = kcalloc(num, sizeof(*clk_data->clks), GFP_KERNEL);
|
||||
if (!clk_data->clks)
|
||||
if (!clk_data->clks) {
|
||||
kfree(clk_data);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
struct hisi_mmc_clock *mmc_clk = &hi3620_mmc_clks[i];
|
||||
|
||||
@@ -258,18 +258,21 @@ static void __init pxa168_clk_init(struct device_node *np)
|
||||
pxa_unit->mpmu_base = of_iomap(np, 0);
|
||||
if (!pxa_unit->mpmu_base) {
|
||||
pr_err("failed to map mpmu registers\n");
|
||||
kfree(pxa_unit);
|
||||
return;
|
||||
}
|
||||
|
||||
pxa_unit->apmu_base = of_iomap(np, 1);
|
||||
if (!pxa_unit->apmu_base) {
|
||||
pr_err("failed to map apmu registers\n");
|
||||
kfree(pxa_unit);
|
||||
return;
|
||||
}
|
||||
|
||||
pxa_unit->apbc_base = of_iomap(np, 2);
|
||||
if (!pxa_unit->apbc_base) {
|
||||
pr_err("failed to map apbc registers\n");
|
||||
kfree(pxa_unit);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ static struct stm32_crc *stm32_crc_get_next_crc(void)
|
||||
struct stm32_crc *crc;
|
||||
|
||||
spin_lock_bh(&crc_list.lock);
|
||||
crc = list_first_entry(&crc_list.dev_list, struct stm32_crc, list);
|
||||
crc = list_first_entry_or_null(&crc_list.dev_list, struct stm32_crc, list);
|
||||
if (crc)
|
||||
list_move_tail(&crc->list, &crc_list.dev_list);
|
||||
spin_unlock_bh(&crc_list.lock);
|
||||
|
||||
@@ -502,11 +502,11 @@ static struct fsl_qdma_queue
|
||||
queue_temp = queue_head + i + (j * queue_num);
|
||||
|
||||
queue_temp->cq =
|
||||
dma_alloc_coherent(&pdev->dev,
|
||||
sizeof(struct fsl_qdma_format) *
|
||||
queue_size[i],
|
||||
&queue_temp->bus_addr,
|
||||
GFP_KERNEL);
|
||||
dmam_alloc_coherent(&pdev->dev,
|
||||
sizeof(struct fsl_qdma_format) *
|
||||
queue_size[i],
|
||||
&queue_temp->bus_addr,
|
||||
GFP_KERNEL);
|
||||
if (!queue_temp->cq)
|
||||
return NULL;
|
||||
queue_temp->block_base = fsl_qdma->block_base +
|
||||
@@ -551,11 +551,11 @@ static struct fsl_qdma_queue
|
||||
/*
|
||||
* Buffer for queue command
|
||||
*/
|
||||
status_head->cq = dma_alloc_coherent(&pdev->dev,
|
||||
sizeof(struct fsl_qdma_format) *
|
||||
status_size,
|
||||
&status_head->bus_addr,
|
||||
GFP_KERNEL);
|
||||
status_head->cq = dmam_alloc_coherent(&pdev->dev,
|
||||
sizeof(struct fsl_qdma_format) *
|
||||
status_size,
|
||||
&status_head->bus_addr,
|
||||
GFP_KERNEL);
|
||||
if (!status_head->cq) {
|
||||
devm_kfree(&pdev->dev, status_head);
|
||||
return NULL;
|
||||
@@ -1221,8 +1221,6 @@ static void fsl_qdma_cleanup_vchan(struct dma_device *dmadev)
|
||||
|
||||
static int fsl_qdma_remove(struct platform_device *pdev)
|
||||
{
|
||||
int i;
|
||||
struct fsl_qdma_queue *status;
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
struct fsl_qdma_engine *fsl_qdma = platform_get_drvdata(pdev);
|
||||
|
||||
@@ -1231,11 +1229,6 @@ static int fsl_qdma_remove(struct platform_device *pdev)
|
||||
of_dma_controller_free(np);
|
||||
dma_async_device_unregister(&fsl_qdma->dma_dev);
|
||||
|
||||
for (i = 0; i < fsl_qdma->block_number; i++) {
|
||||
status = fsl_qdma->status[i];
|
||||
dma_free_coherent(&pdev->dev, sizeof(struct fsl_qdma_format) *
|
||||
status->n_cq, status->cq, status->bus_addr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,10 +100,9 @@ static int textual_leaf_to_string(const u32 *block, char *buf, size_t size)
|
||||
* @buf: where to put the string
|
||||
* @size: size of @buf, in bytes
|
||||
*
|
||||
* The string is taken from a minimal ASCII text descriptor leaf after
|
||||
* the immediate entry with @key. The string is zero-terminated.
|
||||
* An overlong string is silently truncated such that it and the
|
||||
* zero byte fit into @size.
|
||||
* The string is taken from a minimal ASCII text descriptor leaf just after the entry with the
|
||||
* @key. The string is zero-terminated. An overlong string is silently truncated such that it
|
||||
* and the zero byte fit into @size.
|
||||
*
|
||||
* Returns strlen(buf) or a negative error code.
|
||||
*/
|
||||
|
||||
@@ -318,20 +318,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
|
||||
switch (flow_type) {
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IEV, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_DBNC_IC, 1);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_RISING:
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
state = sprd_eic_get(chip, offset);
|
||||
if (state)
|
||||
if (state) {
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_DBNC_IEV, 0);
|
||||
else
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_DBNC_IC, 1);
|
||||
} else {
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_DBNC_IEV, 1);
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_DBNC_IC, 1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
@@ -343,20 +350,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
|
||||
switch (flow_type) {
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_LATCH_INTCLR, 1);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_RISING:
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
state = sprd_eic_get(chip, offset);
|
||||
if (state)
|
||||
if (state) {
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_LATCH_INTPOL, 0);
|
||||
else
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_LATCH_INTCLR, 1);
|
||||
} else {
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_LATCH_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset,
|
||||
SPRD_EIC_LATCH_INTCLR, 1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUPP;
|
||||
@@ -370,29 +384,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
break;
|
||||
default:
|
||||
@@ -405,29 +424,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_FALLING:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_EDGE_BOTH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_edge_irq);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_HIGH:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
break;
|
||||
case IRQ_TYPE_LEVEL_LOW:
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 1);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTPOL, 0);
|
||||
sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTCLR, 1);
|
||||
irq_set_handler_locked(data, handle_level_irq);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1466,6 +1466,20 @@ static const struct dmi_system_id gpiolib_acpi_quirks[] = {
|
||||
.ignore_wake = "INT33FF:01@0",
|
||||
},
|
||||
},
|
||||
{
|
||||
/*
|
||||
* Spurious wakeups from TP_ATTN# pin
|
||||
* Found in BIOS 0.35
|
||||
* https://gitlab.freedesktop.org/drm/amd/-/issues/3073
|
||||
*/
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "GPD"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "G1619-04"),
|
||||
},
|
||||
.driver_data = &(struct acpi_gpiolib_dmi_quirk) {
|
||||
.ignore_wake = "PNP0C50:00@8",
|
||||
},
|
||||
},
|
||||
{} /* Terminating entry */
|
||||
};
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ struct amdgpu_amdkfd_fence *to_amdgpu_amdkfd_fence(struct dma_fence *f)
|
||||
return NULL;
|
||||
|
||||
fence = container_of(f, struct amdgpu_amdkfd_fence, base);
|
||||
if (fence && f->ops == &amdkfd_fence_ops)
|
||||
if (f->ops == &amdkfd_fence_ops)
|
||||
return fence;
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -847,6 +847,7 @@ bool amdgpu_device_need_post(struct amdgpu_device *adev)
|
||||
return true;
|
||||
|
||||
fw_ver = *((uint32_t *)adev->pm.fw->data + 69);
|
||||
release_firmware(adev->pm.fw);
|
||||
if (fw_ver < 0x00160e00)
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,8 @@ int amdgpu_sync_resv(struct amdgpu_device *adev,
|
||||
*/
|
||||
fence_owner = amdgpu_sync_get_owner(f);
|
||||
if (fence_owner == AMDGPU_FENCE_OWNER_KFD &&
|
||||
owner != AMDGPU_FENCE_OWNER_UNDEFINED)
|
||||
owner != AMDGPU_FENCE_OWNER_UNDEFINED &&
|
||||
owner != AMDGPU_FENCE_OWNER_KFD)
|
||||
continue;
|
||||
|
||||
if (amdgpu_sync_same_dev(adev, f)) {
|
||||
|
||||
@@ -54,13 +54,13 @@ static int ptn3460_read_bytes(struct ptn3460_bridge *ptn_bridge, char addr,
|
||||
int ret;
|
||||
|
||||
ret = i2c_master_send(ptn_bridge->client, &addr, 1);
|
||||
if (ret <= 0) {
|
||||
if (ret < 0) {
|
||||
DRM_ERROR("Failed to send i2c command, ret=%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = i2c_master_recv(ptn_bridge->client, buf, len);
|
||||
if (ret <= 0) {
|
||||
if (ret < 0) {
|
||||
DRM_ERROR("Failed to recv i2c data, ret=%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ static int ptn3460_write_byte(struct ptn3460_bridge *ptn_bridge, char addr,
|
||||
buf[1] = val;
|
||||
|
||||
ret = i2c_master_send(ptn_bridge->client, buf, ARRAY_SIZE(buf));
|
||||
if (ret <= 0) {
|
||||
if (ret < 0) {
|
||||
DRM_ERROR("Failed to send i2c command, ret=%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ int drm_open(struct inode *inode, struct file *filp)
|
||||
{
|
||||
struct drm_device *dev;
|
||||
struct drm_minor *minor;
|
||||
int retcode;
|
||||
int retcode = 0;
|
||||
int need_setup = 0;
|
||||
|
||||
minor = drm_minor_acquire(iminor(inode));
|
||||
|
||||
@@ -581,7 +581,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
|
||||
struct drm_framebuffer *fb;
|
||||
unsigned flags;
|
||||
int num_clips;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
@@ -300,7 +300,8 @@ static int mipi_dsi_remove_device_fn(struct device *dev, void *priv)
|
||||
{
|
||||
struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
|
||||
|
||||
mipi_dsi_detach(dsi);
|
||||
if (dsi->attached)
|
||||
mipi_dsi_detach(dsi);
|
||||
mipi_dsi_device_unregister(dsi);
|
||||
|
||||
return 0;
|
||||
@@ -323,11 +324,18 @@ EXPORT_SYMBOL(mipi_dsi_host_unregister);
|
||||
int mipi_dsi_attach(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
const struct mipi_dsi_host_ops *ops = dsi->host->ops;
|
||||
int ret;
|
||||
|
||||
if (!ops || !ops->attach)
|
||||
return -ENOSYS;
|
||||
|
||||
return ops->attach(dsi->host, dsi);
|
||||
ret = ops->attach(dsi->host, dsi);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dsi->attached = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(mipi_dsi_attach);
|
||||
|
||||
@@ -339,9 +347,14 @@ int mipi_dsi_detach(struct mipi_dsi_device *dsi)
|
||||
{
|
||||
const struct mipi_dsi_host_ops *ops = dsi->host->ops;
|
||||
|
||||
if (WARN_ON(!dsi->attached))
|
||||
return -EINVAL;
|
||||
|
||||
if (!ops || !ops->detach)
|
||||
return -ENOSYS;
|
||||
|
||||
dsi->attached = false;
|
||||
|
||||
return ops->detach(dsi->host, dsi);
|
||||
}
|
||||
EXPORT_SYMBOL(mipi_dsi_detach);
|
||||
|
||||
@@ -1203,6 +1203,7 @@ retry:
|
||||
out:
|
||||
if (fb)
|
||||
drm_framebuffer_put(fb);
|
||||
fb = NULL;
|
||||
if (plane->old_fb)
|
||||
drm_framebuffer_put(plane->old_fb);
|
||||
plane->old_fb = NULL;
|
||||
|
||||
@@ -318,9 +318,9 @@ static void decon_win_set_bldmod(struct decon_context *ctx, unsigned int win,
|
||||
static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win,
|
||||
struct drm_framebuffer *fb)
|
||||
{
|
||||
struct exynos_drm_plane plane = ctx->planes[win];
|
||||
struct exynos_drm_plane *plane = &ctx->planes[win];
|
||||
struct exynos_drm_plane_state *state =
|
||||
to_exynos_plane_state(plane.base.state);
|
||||
to_exynos_plane_state(plane->base.state);
|
||||
unsigned int alpha = state->base.alpha;
|
||||
unsigned int pixel_alpha;
|
||||
unsigned long val;
|
||||
|
||||
@@ -346,6 +346,7 @@ err_mode_config_cleanup:
|
||||
drm_mode_config_cleanup(drm);
|
||||
exynos_drm_cleanup_dma(drm);
|
||||
kfree(private);
|
||||
dev_set_drvdata(dev, NULL);
|
||||
err_free_drm:
|
||||
drm_dev_put(drm);
|
||||
|
||||
@@ -360,6 +361,7 @@ static void exynos_drm_unbind(struct device *dev)
|
||||
|
||||
exynos_drm_fbdev_fini(drm);
|
||||
drm_kms_helper_poll_fini(drm);
|
||||
drm_atomic_helper_shutdown(drm);
|
||||
|
||||
component_unbind_all(drm->dev, drm);
|
||||
drm_mode_config_cleanup(drm);
|
||||
@@ -397,9 +399,18 @@ static int exynos_drm_platform_remove(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void exynos_drm_platform_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
struct drm_device *drm = platform_get_drvdata(pdev);
|
||||
|
||||
if (drm)
|
||||
drm_atomic_helper_shutdown(drm);
|
||||
}
|
||||
|
||||
static struct platform_driver exynos_drm_platform_driver = {
|
||||
.probe = exynos_drm_platform_probe,
|
||||
.remove = exynos_drm_platform_remove,
|
||||
.shutdown = exynos_drm_platform_shutdown,
|
||||
.driver = {
|
||||
.name = "exynos-drm",
|
||||
.pm = &exynos_drm_pm_ops,
|
||||
|
||||
@@ -637,9 +637,9 @@ static void fimd_win_set_bldmod(struct fimd_context *ctx, unsigned int win,
|
||||
static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win,
|
||||
struct drm_framebuffer *fb, int width)
|
||||
{
|
||||
struct exynos_drm_plane plane = ctx->planes[win];
|
||||
struct exynos_drm_plane *plane = &ctx->planes[win];
|
||||
struct exynos_drm_plane_state *state =
|
||||
to_exynos_plane_state(plane.base.state);
|
||||
to_exynos_plane_state(plane->base.state);
|
||||
uint32_t pixel_format = fb->format->format;
|
||||
unsigned int alpha = state->base.alpha;
|
||||
u32 val = WINCONx_ENWIN;
|
||||
|
||||
@@ -1344,7 +1344,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev)
|
||||
for (i = 0; i < ctx->num_clocks; i++) {
|
||||
ret = clk_prepare_enable(ctx->clocks[i]);
|
||||
if (ret) {
|
||||
while (--i > 0)
|
||||
while (--i >= 0)
|
||||
clk_disable_unprepare(ctx->clocks[i]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,9 @@
|
||||
(p) ? ((p)->hw_pp ? (p)->hw_pp->idx - PINGPONG_0 : -1) : -1, \
|
||||
##__VA_ARGS__)
|
||||
|
||||
#define DPU_ERROR_ENC_RATELIMITED(e, fmt, ...) DPU_ERROR_RATELIMITED("enc%d " fmt,\
|
||||
(e) ? (e)->base.base.id : -1, ##__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* Two to anticipate panels that can do cmd/vid dynamic switching
|
||||
* plan is to create all possible physical encoder types, and switch between
|
||||
@@ -2151,7 +2154,7 @@ static void dpu_encoder_frame_done_timeout(struct timer_list *t)
|
||||
return;
|
||||
}
|
||||
|
||||
DPU_ERROR_ENC(dpu_enc, "frame done timeout\n");
|
||||
DPU_ERROR_ENC_RATELIMITED(dpu_enc, "frame done timeout\n");
|
||||
|
||||
event = DPU_ENCODER_FRAME_EVENT_ERROR;
|
||||
trace_dpu_enc_frame_done_timeout(DRMID(drm_enc), event);
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
} while (0)
|
||||
|
||||
#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__)
|
||||
#define DPU_ERROR_RATELIMITED(fmt, ...) pr_err_ratelimited("[dpu error]" fmt, ##__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* ktime_compare_safe - compare two ktime structures
|
||||
|
||||
@@ -108,6 +108,9 @@ nouveau_vma_new(struct nouveau_bo *nvbo, struct nouveau_vmm *vmm,
|
||||
} else {
|
||||
ret = nvif_vmm_get(&vmm->vmm, PTES, false, mem->mem.page, 0,
|
||||
mem->mem.size, &tmp);
|
||||
if (ret)
|
||||
goto done;
|
||||
|
||||
vma->addr = tmp.addr;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,12 @@ MODULE_PARM_DESC(swap_opt_cmd, "Swap the Option (\"Alt\") and Command (\"Flag\")
|
||||
"(For people who want to keep Windows PC keyboard muscle memory. "
|
||||
"[0] = as-is, Mac layout. 1 = swapped, Windows layout.)");
|
||||
|
||||
static unsigned int swap_fn_leftctrl;
|
||||
module_param(swap_fn_leftctrl, uint, 0644);
|
||||
MODULE_PARM_DESC(swap_fn_leftctrl, "Swap the Fn and left Control keys. "
|
||||
"(For people who want to keep PC keyboard muscle memory. "
|
||||
"[0] = as-is, Mac layout, 1 = swapped, PC layout)");
|
||||
|
||||
struct apple_sc {
|
||||
unsigned long quirks;
|
||||
unsigned int fn_on;
|
||||
@@ -64,6 +70,28 @@ struct apple_key_translation {
|
||||
u8 flags;
|
||||
};
|
||||
|
||||
static const struct apple_key_translation apple2021_fn_keys[] = {
|
||||
{ KEY_BACKSPACE, KEY_DELETE },
|
||||
{ KEY_ENTER, KEY_INSERT },
|
||||
{ KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY },
|
||||
{ KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY },
|
||||
{ KEY_F3, KEY_SCALE, APPLE_FLAG_FKEY },
|
||||
{ KEY_F4, KEY_SEARCH, APPLE_FLAG_FKEY },
|
||||
{ KEY_F5, KEY_MICMUTE, APPLE_FLAG_FKEY },
|
||||
{ KEY_F6, KEY_SLEEP, APPLE_FLAG_FKEY },
|
||||
{ KEY_F7, KEY_PREVIOUSSONG, APPLE_FLAG_FKEY },
|
||||
{ KEY_F8, KEY_PLAYPAUSE, APPLE_FLAG_FKEY },
|
||||
{ KEY_F9, KEY_NEXTSONG, APPLE_FLAG_FKEY },
|
||||
{ KEY_F10, KEY_MUTE, APPLE_FLAG_FKEY },
|
||||
{ KEY_F11, KEY_VOLUMEDOWN, APPLE_FLAG_FKEY },
|
||||
{ KEY_F12, KEY_VOLUMEUP, APPLE_FLAG_FKEY },
|
||||
{ KEY_UP, KEY_PAGEUP },
|
||||
{ KEY_DOWN, KEY_PAGEDOWN },
|
||||
{ KEY_LEFT, KEY_HOME },
|
||||
{ KEY_RIGHT, KEY_END },
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct apple_key_translation macbookair_fn_keys[] = {
|
||||
{ KEY_BACKSPACE, KEY_DELETE },
|
||||
{ KEY_ENTER, KEY_INSERT },
|
||||
@@ -163,6 +191,11 @@ static const struct apple_key_translation swapped_option_cmd_keys[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct apple_key_translation swapped_fn_leftctrl_keys[] = {
|
||||
{ KEY_FN, KEY_LEFTCTRL },
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct apple_key_translation *apple_find_translation(
|
||||
const struct apple_key_translation *table, u16 from)
|
||||
{
|
||||
@@ -184,14 +217,18 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
||||
bool do_translate;
|
||||
u16 code = 0;
|
||||
|
||||
if (usage->code == KEY_FN) {
|
||||
u16 fn_keycode = (swap_fn_leftctrl) ? (KEY_LEFTCTRL) : (KEY_FN);
|
||||
|
||||
if (usage->code == fn_keycode) {
|
||||
asc->fn_on = !!value;
|
||||
input_event(input, usage->type, usage->code, value);
|
||||
input_event(input, usage->type, KEY_FN, value);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fnmode) {
|
||||
if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
|
||||
if (hid->product == USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021)
|
||||
table = apple2021_fn_keys;
|
||||
else if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI &&
|
||||
hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS)
|
||||
table = macbookair_fn_keys;
|
||||
else if (hid->product < 0x21d || hid->product >= 0x300)
|
||||
@@ -271,6 +308,14 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input,
|
||||
}
|
||||
}
|
||||
|
||||
if (swap_fn_leftctrl) {
|
||||
trans = apple_find_translation(swapped_fn_leftctrl_keys, usage->code);
|
||||
if (trans) {
|
||||
input_event(input, usage->type, trans->to, value);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -341,6 +386,14 @@ static void apple_setup_input(struct input_dev *input)
|
||||
|
||||
for (trans = apple_iso_keyboard; trans->from; trans++)
|
||||
set_bit(trans->to, input->keybit);
|
||||
|
||||
for (trans = apple2021_fn_keys; trans->from; trans++)
|
||||
set_bit(trans->to, input->keybit);
|
||||
|
||||
if (swap_fn_leftctrl) {
|
||||
for (trans = swapped_fn_leftctrl_keys; trans->from; trans++)
|
||||
set_bit(trans->to, input->keybit);
|
||||
}
|
||||
}
|
||||
|
||||
static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi,
|
||||
@@ -596,6 +649,10 @@ static const struct hid_device_id apple_devices[] = {
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY),
|
||||
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021),
|
||||
.driver_data = APPLE_HAS_FN },
|
||||
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -175,6 +175,7 @@
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL3 0x8241
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242
|
||||
#define USB_DEVICE_ID_APPLE_IRCONTROL5 0x8243
|
||||
#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c
|
||||
|
||||
#define USB_VENDOR_ID_ASUS 0x0486
|
||||
#define USB_DEVICE_ID_ASUS_T91MT 0x0185
|
||||
|
||||
@@ -308,6 +308,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021) },
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_HID_APPLEIR)
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
|
||||
|
||||
@@ -2088,7 +2088,7 @@ static int wacom_allocate_inputs(struct wacom *wacom)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wacom_register_inputs(struct wacom *wacom)
|
||||
static int wacom_setup_inputs(struct wacom *wacom)
|
||||
{
|
||||
struct input_dev *pen_input_dev, *touch_input_dev, *pad_input_dev;
|
||||
struct wacom_wac *wacom_wac = &(wacom->wacom_wac);
|
||||
@@ -2107,10 +2107,6 @@ static int wacom_register_inputs(struct wacom *wacom)
|
||||
input_free_device(pen_input_dev);
|
||||
wacom_wac->pen_input = NULL;
|
||||
pen_input_dev = NULL;
|
||||
} else {
|
||||
error = input_register_device(pen_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = wacom_setup_touch_input_capabilities(touch_input_dev, wacom_wac);
|
||||
@@ -2119,10 +2115,6 @@ static int wacom_register_inputs(struct wacom *wacom)
|
||||
input_free_device(touch_input_dev);
|
||||
wacom_wac->touch_input = NULL;
|
||||
touch_input_dev = NULL;
|
||||
} else {
|
||||
error = input_register_device(touch_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = wacom_setup_pad_input_capabilities(pad_input_dev, wacom_wac);
|
||||
@@ -2131,7 +2123,34 @@ static int wacom_register_inputs(struct wacom *wacom)
|
||||
input_free_device(pad_input_dev);
|
||||
wacom_wac->pad_input = NULL;
|
||||
pad_input_dev = NULL;
|
||||
} else {
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wacom_register_inputs(struct wacom *wacom)
|
||||
{
|
||||
struct input_dev *pen_input_dev, *touch_input_dev, *pad_input_dev;
|
||||
struct wacom_wac *wacom_wac = &(wacom->wacom_wac);
|
||||
int error = 0;
|
||||
|
||||
pen_input_dev = wacom_wac->pen_input;
|
||||
touch_input_dev = wacom_wac->touch_input;
|
||||
pad_input_dev = wacom_wac->pad_input;
|
||||
|
||||
if (pen_input_dev) {
|
||||
error = input_register_device(pen_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (touch_input_dev) {
|
||||
error = input_register_device(touch_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (pad_input_dev) {
|
||||
error = input_register_device(pad_input_dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
@@ -2381,6 +2400,20 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = wacom_setup_inputs(wacom);
|
||||
if (error)
|
||||
goto fail;
|
||||
|
||||
if (features->type == HID_GENERIC)
|
||||
connect_mask |= HID_CONNECT_DRIVER;
|
||||
|
||||
/* Regular HID work starts now */
|
||||
error = hid_hw_start(hdev, connect_mask);
|
||||
if (error) {
|
||||
hid_err(hdev, "hw start failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = wacom_register_inputs(wacom);
|
||||
if (error)
|
||||
goto fail;
|
||||
@@ -2395,16 +2428,6 @@ static int wacom_parse_and_register(struct wacom *wacom, bool wireless)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (features->type == HID_GENERIC)
|
||||
connect_mask |= HID_CONNECT_DRIVER;
|
||||
|
||||
/* Regular HID work starts now */
|
||||
error = hid_hw_start(hdev, connect_mask);
|
||||
if (error) {
|
||||
hid_err(hdev, "hw start failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!wireless) {
|
||||
/* Note that if query fails it is not a hard failure */
|
||||
wacom_query_tablet_data(wacom);
|
||||
|
||||
@@ -2540,7 +2540,14 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
|
||||
wacom_wac->hid_data.tipswitch);
|
||||
input_report_key(input, wacom_wac->tool[0], sense);
|
||||
if (wacom_wac->serial[0]) {
|
||||
input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]);
|
||||
/*
|
||||
* xf86-input-wacom does not accept a serial number
|
||||
* of '0'. Report the low 32 bits if possible, but
|
||||
* if they are zero, report the upper ones instead.
|
||||
*/
|
||||
__u32 serial_lo = wacom_wac->serial[0] & 0xFFFFFFFFu;
|
||||
__u32 serial_hi = wacom_wac->serial[0] >> 32;
|
||||
input_event(input, EV_MSC, MSC_SERIAL, (int)(serial_lo ? serial_lo : serial_hi));
|
||||
input_report_abs(input, ABS_MISC, sense ? id : 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -194,6 +194,8 @@ struct aspeed_pwm_tacho_data {
|
||||
u8 fan_tach_ch_source[16];
|
||||
struct aspeed_cooling_device *cdev[8];
|
||||
const struct attribute_group *groups[3];
|
||||
/* protects access to shared ASPEED_PTCR_RESULT */
|
||||
struct mutex tach_lock;
|
||||
};
|
||||
|
||||
enum type { TYPEM, TYPEN, TYPEO };
|
||||
@@ -528,6 +530,8 @@ static int aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv,
|
||||
u8 fan_tach_ch_source, type, mode, both;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&priv->tach_lock);
|
||||
|
||||
regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0);
|
||||
regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0x1 << fan_tach_ch);
|
||||
|
||||
@@ -545,6 +549,8 @@ static int aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv,
|
||||
ASPEED_RPM_STATUS_SLEEP_USEC,
|
||||
usec);
|
||||
|
||||
mutex_unlock(&priv->tach_lock);
|
||||
|
||||
/* return -ETIMEDOUT if we didn't get an answer. */
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -909,6 +915,7 @@ static int aspeed_pwm_tacho_probe(struct platform_device *pdev)
|
||||
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
mutex_init(&priv->tach_lock);
|
||||
priv->regmap = devm_regmap_init(dev, NULL, (__force void *)regs,
|
||||
&aspeed_pwm_tacho_regmap_config);
|
||||
if (IS_ERR(priv->regmap))
|
||||
|
||||
@@ -380,7 +380,7 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
|
||||
}
|
||||
|
||||
static int create_core_attrs(struct temp_data *tdata, struct device *dev,
|
||||
int attr_no)
|
||||
int index)
|
||||
{
|
||||
int i;
|
||||
static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev,
|
||||
@@ -392,13 +392,20 @@ static int create_core_attrs(struct temp_data *tdata, struct device *dev,
|
||||
};
|
||||
|
||||
for (i = 0; i < tdata->attr_size; i++) {
|
||||
/*
|
||||
* We map the attr number to core id of the CPU
|
||||
* The attr number is always core id + 2
|
||||
* The Pkgtemp will always show up as temp1_*, if available
|
||||
*/
|
||||
int attr_no = tdata->is_pkg_data ? 1 : tdata->cpu_core_id + 2;
|
||||
|
||||
snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH,
|
||||
"temp%d_%s", attr_no, suffixes[i]);
|
||||
sysfs_attr_init(&tdata->sd_attrs[i].dev_attr.attr);
|
||||
tdata->sd_attrs[i].dev_attr.attr.name = tdata->attr_name[i];
|
||||
tdata->sd_attrs[i].dev_attr.attr.mode = 0444;
|
||||
tdata->sd_attrs[i].dev_attr.show = rd_ptr[i];
|
||||
tdata->sd_attrs[i].index = attr_no;
|
||||
tdata->sd_attrs[i].index = index;
|
||||
tdata->attrs[i] = &tdata->sd_attrs[i].dev_attr.attr;
|
||||
}
|
||||
tdata->attr_group.attrs = tdata->attrs;
|
||||
@@ -456,27 +463,22 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu,
|
||||
struct platform_data *pdata = platform_get_drvdata(pdev);
|
||||
struct cpuinfo_x86 *c = &cpu_data(cpu);
|
||||
u32 eax, edx;
|
||||
int err, index, attr_no;
|
||||
int err, index;
|
||||
|
||||
/*
|
||||
* Find attr number for sysfs:
|
||||
* We map the attr number to core id of the CPU
|
||||
* The attr number is always core id + 2
|
||||
* The Pkgtemp will always show up as temp1_*, if available
|
||||
* Get the index of tdata in pdata->core_data[]
|
||||
* tdata for package: pdata->core_data[1]
|
||||
* tdata for core: pdata->core_data[2] .. pdata->core_data[NUM_REAL_CORES + 1]
|
||||
*/
|
||||
if (pkg_flag) {
|
||||
attr_no = PKG_SYSFS_ATTR_NO;
|
||||
index = PKG_SYSFS_ATTR_NO;
|
||||
} else {
|
||||
index = ida_alloc(&pdata->ida, GFP_KERNEL);
|
||||
index = ida_alloc_max(&pdata->ida, NUM_REAL_CORES - 1, GFP_KERNEL);
|
||||
if (index < 0)
|
||||
return index;
|
||||
pdata->cpu_map[index] = topology_core_id(cpu);
|
||||
attr_no = index + BASE_SYSFS_ATTR_NO;
|
||||
}
|
||||
|
||||
if (attr_no > MAX_CORE_DATA - 1) {
|
||||
err = -ERANGE;
|
||||
goto ida_free;
|
||||
pdata->cpu_map[index] = topology_core_id(cpu);
|
||||
index += BASE_SYSFS_ATTR_NO;
|
||||
}
|
||||
|
||||
tdata = init_temp_data(cpu, pkg_flag);
|
||||
@@ -508,20 +510,20 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu,
|
||||
}
|
||||
}
|
||||
|
||||
pdata->core_data[attr_no] = tdata;
|
||||
pdata->core_data[index] = tdata;
|
||||
|
||||
/* Create sysfs interfaces */
|
||||
err = create_core_attrs(tdata, pdata->hwmon_dev, attr_no);
|
||||
err = create_core_attrs(tdata, pdata->hwmon_dev, index);
|
||||
if (err)
|
||||
goto exit_free;
|
||||
|
||||
return 0;
|
||||
exit_free:
|
||||
pdata->core_data[attr_no] = NULL;
|
||||
pdata->core_data[index] = NULL;
|
||||
kfree(tdata);
|
||||
ida_free:
|
||||
if (!pkg_flag)
|
||||
ida_free(&pdata->ida, index);
|
||||
ida_free(&pdata->ida, index - BASE_SYSFS_ATTR_NO);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -528,12 +528,13 @@ static int i801_block_transaction_by_block(struct i801_priv *priv,
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */
|
||||
/* Set block buffer mode */
|
||||
outb_p(inb_p(SMBAUXCTL(priv)) | SMBAUXCTL_E32B, SMBAUXCTL(priv));
|
||||
|
||||
/* Use 32-byte buffer to process this transaction */
|
||||
if (read_write == I2C_SMBUS_WRITE) {
|
||||
len = data->block[0];
|
||||
outb_p(len, SMBHSTDAT0(priv));
|
||||
inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */
|
||||
for (i = 0; i < len; i++)
|
||||
outb_p(data->block[i+1], SMBBLKDAT(priv));
|
||||
}
|
||||
@@ -549,6 +550,7 @@ static int i801_block_transaction_by_block(struct i801_priv *priv,
|
||||
return -EPROTO;
|
||||
|
||||
data->block[0] = len;
|
||||
inb_p(SMBHSTCNT(priv)); /* reset the data buffer index */
|
||||
for (i = 0; i < len; i++)
|
||||
data->block[i + 1] = inb_p(SMBBLKDAT(priv));
|
||||
}
|
||||
@@ -768,14 +770,6 @@ exit:
|
||||
return i801_check_post(priv, status);
|
||||
}
|
||||
|
||||
static int i801_set_block_buffer_mode(struct i801_priv *priv)
|
||||
{
|
||||
outb_p(inb_p(SMBAUXCTL(priv)) | SMBAUXCTL_E32B, SMBAUXCTL(priv));
|
||||
if ((inb_p(SMBAUXCTL(priv)) & SMBAUXCTL_E32B) == 0)
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Block transaction function */
|
||||
static int i801_block_transaction(struct i801_priv *priv,
|
||||
union i2c_smbus_data *data, char read_write,
|
||||
@@ -805,9 +799,8 @@ static int i801_block_transaction(struct i801_priv *priv,
|
||||
/* Experience has shown that the block buffer can only be used for
|
||||
SMBus (not I2C) block transactions, even though the datasheet
|
||||
doesn't mention this limitation. */
|
||||
if ((priv->features & FEATURE_BLOCK_BUFFER)
|
||||
&& command != I2C_SMBUS_I2C_BLOCK_DATA
|
||||
&& i801_set_block_buffer_mode(priv) == 0)
|
||||
if ((priv->features & FEATURE_BLOCK_BUFFER) &&
|
||||
command != I2C_SMBUS_I2C_BLOCK_DATA)
|
||||
result = i801_block_transaction_by_block(priv, data,
|
||||
read_write,
|
||||
command, hwpec);
|
||||
|
||||
@@ -74,7 +74,8 @@
|
||||
#define PRESCL_CTRL0 0x14
|
||||
#define PRESCL_CTRL0_I2C(x) ((x) << 16)
|
||||
#define PRESCL_CTRL0_I3C(x) (x)
|
||||
#define PRESCL_CTRL0_MAX GENMASK(9, 0)
|
||||
#define PRESCL_CTRL0_I3C_MAX GENMASK(9, 0)
|
||||
#define PRESCL_CTRL0_I2C_MAX GENMASK(15, 0)
|
||||
|
||||
#define PRESCL_CTRL1 0x18
|
||||
#define PRESCL_CTRL1_PP_LOW_MASK GENMASK(15, 8)
|
||||
@@ -1212,7 +1213,7 @@ static int cdns_i3c_master_bus_init(struct i3c_master_controller *m)
|
||||
return -EINVAL;
|
||||
|
||||
pres = DIV_ROUND_UP(sysclk_rate, (bus->scl_rate.i3c * 4)) - 1;
|
||||
if (pres > PRESCL_CTRL0_MAX)
|
||||
if (pres > PRESCL_CTRL0_I3C_MAX)
|
||||
return -ERANGE;
|
||||
|
||||
bus->scl_rate.i3c = sysclk_rate / ((pres + 1) * 4);
|
||||
@@ -1225,7 +1226,7 @@ static int cdns_i3c_master_bus_init(struct i3c_master_controller *m)
|
||||
max_i2cfreq = bus->scl_rate.i2c;
|
||||
|
||||
pres = (sysclk_rate / (max_i2cfreq * 5)) - 1;
|
||||
if (pres > PRESCL_CTRL0_MAX)
|
||||
if (pres > PRESCL_CTRL0_I2C_MAX)
|
||||
return -ERANGE;
|
||||
|
||||
bus->scl_rate.i2c = sysclk_rate / ((pres + 1) * 5);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user