Merge 4.19.312 into android-4.19-stable
Changes in 4.19.312
Documentation/hw-vuln: Update spectre doc
x86/cpu: Support AMD Automatic IBRS
x86/bugs: Use sysfs_emit()
timer/trace: Replace deprecated vsprintf pointer extension %pf by %ps
timer/trace: Improve timer tracing
timers: Prepare support for PREEMPT_RT
timers: Update kernel-doc for various functions
timers: Use del_timer_sync() even on UP
timers: Rename del_timer_sync() to timer_delete_sync()
wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach
smack: Set SMACK64TRANSMUTE only for dirs in smack_inode_setxattr()
smack: Handle SMACK64TRANSMUTE in smack_inode_setsecurity()
ARM: dts: mmp2-brownstone: Don't redeclare phandle references
arm: dts: marvell: Fix maxium->maxim typo in brownstone dts
media: xc4000: Fix atomicity violation in xc4000_get_frequency
KVM: Always flush async #PF workqueue when vCPU is being destroyed
sparc64: NMI watchdog: fix return value of __setup handler
sparc: vDSO: fix return value of __setup handler
crypto: qat - fix double free during reset
crypto: qat - resolve race condition during AER recovery
fat: fix uninitialized field in nostale filehandles
ubifs: Set page uptodate in the correct place
ubi: Check for too small LEB size in VTBL code
ubi: correct the calculation of fastmap size
parisc: Do not hardcode registers in checksum functions
parisc: Fix ip_fast_csum
parisc: Fix csum_ipv6_magic on 32-bit systems
parisc: Fix csum_ipv6_magic on 64-bit systems
parisc: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds
PM: suspend: Set mem_sleep_current during kernel command line setup
clk: qcom: gcc-ipq8074: fix terminating of frequency table arrays
clk: qcom: mmcc-apq8084: fix terminating of frequency table arrays
clk: qcom: mmcc-msm8974: fix terminating of frequency table arrays
powerpc/fsl: Fix mfpmr build errors with newer binutils
USB: serial: ftdi_sio: add support for GMC Z216C Adapter IR-USB
USB: serial: add device ID for VeriFone adapter
USB: serial: cp210x: add ID for MGP Instruments PDS100
USB: serial: option: add MeiG Smart SLM320 product
USB: serial: cp210x: add pid/vid for TDK NC0110013M and MM0110113M
PM: sleep: wakeirq: fix wake irq warning in system suspend
mmc: tmio: avoid concurrent runs of mmc_request_done()
fuse: don't unhash root
PCI: Drop pci_device_remove() test of pci_dev->driver
PCI/PM: Drain runtime-idle callbacks before driver removal
Revert "Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d""
dm-raid: fix lockdep waring in "pers->hot_add_disk"
mmc: core: Fix switch on gp3 partition
hwmon: (amc6821) add of_match table
ext4: fix corruption during on-line resize
slimbus: core: Remove usage of the deprecated ida_simple_xx() API
speakup: Fix 8bit characters from direct synth
kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1
vfio/platform: Disable virqfds on cleanup
soc: fsl: qbman: Always disable interrupts when taking cgr_lock
soc: fsl: qbman: Add helper for sanity checking cgr ops
soc: fsl: qbman: Add CGR update function
soc: fsl: qbman: Use raw spinlock for cgr_lock
s390/zcrypt: fix reference counting on zcrypt card objects
drm/imx/ipuv3: do not return negative values from .get_modes()
drm/vc4: hdmi: do not return negative values from .get_modes()
memtest: use {READ,WRITE}_ONCE in memory scanning
nilfs2: fix failure to detect DAT corruption in btree and direct mappings
nilfs2: use a more common logging style
nilfs2: prevent kernel bug at submit_bh_wbc()
x86/CPU/AMD: Update the Zenbleed microcode revisions
ahci: asm1064: correct count of reported ports
ahci: asm1064: asm1166: don't limit reported ports
comedi: comedi_test: Prevent timers rescheduling during deletion
netfilter: nf_tables: disallow anonymous set with timeout flag
netfilter: nf_tables: reject constant set with timeout
xfrm: Avoid clang fortify warning in copy_to_user_tmpl()
ALSA: hda/realtek - Fix headset Mic no show at resume back for Lenovo ALC897 platform
USB: usb-storage: Prevent divide-by-0 error in isd200_ata_command
usb: gadget: ncm: Fix handling of zero block length packets
usb: port: Don't try to peer unused USB ports based on location
tty: serial: fsl_lpuart: avoid idle preamble pending if CTS is enabled
vt: fix unicode buffer corruption when deleting characters
vt: fix memory overlapping when deleting chars in the buffer
mm/memory-failure: fix an incorrect use of tail pages
mm/migrate: set swap entry values of THP tail pages properly.
wifi: mac80211: check/clear fast rx for non-4addr sta VLAN changes
exec: Fix NOMMU linux_binprm::exec in transfer_args_to_stack()
usb: cdc-wdm: close race between read and workqueue
ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs
fs/aio: Check IOCB_AIO_RW before the struct aio_kiocb conversion
printk: Update @console_may_schedule in console_trylock_spinning()
btrfs: allocate btrfs_ioctl_defrag_range_args on stack
Revert "loop: Check for overflow while configuring loop"
loop: Call loop_config_discard() only after new config is applied
loop: Remove sector_t truncation checks
loop: Factor out setting loop device size
loop: Refactor loop_set_status() size calculation
loop: properly observe rotational flag of underlying device
perf/core: Fix reentry problem in perf_output_read_group()
efivarfs: Request at most 512 bytes for variable names
powerpc: xor_vmx: Add '-mhard-float' to CFLAGS
loop: Factor out configuring loop from status
loop: Check for overflow while configuring loop
loop: loop_set_status_from_info() check before assignment
usb: dwc2: host: Fix remote wakeup from hibernation
usb: dwc2: host: Fix hibernation flow
usb: dwc2: host: Fix ISOC flow in DDMA mode
usb: dwc2: gadget: LPM flow fix
usb: udc: remove warning when queue disabled ep
scsi: qla2xxx: Fix command flush on cable pull
x86/cpu: Enable STIBP on AMD if Automatic IBRS is enabled
scsi: lpfc: Correct size for wqe for memset()
USB: core: Fix deadlock in usb_deauthorize_interface()
nfc: nci: Fix uninit-value in nci_dev_up and nci_ntf_packet
mptcp: add sk_stop_timer_sync helper
tcp: properly terminate timers for kernel sockets
r8169: fix issue caused by buggy BIOS on certain boards with RTL8168d
Bluetooth: hci_event: set the conn encrypted before conn establishes
Bluetooth: Fix TOCTOU in HCI debugfs implementation
netfilter: nf_tables: disallow timeout for anonymous sets
net/rds: fix possible cp null dereference
Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped."
mm, vmscan: prevent infinite loop for costly GFP_NOIO | __GFP_RETRY_MAYFAIL allocations
netfilter: nf_tables: Fix potential data-race in __nft_flowtable_type_get()
net/sched: act_skbmod: prevent kernel-infoleak
net: stmmac: fix rx queue priority assignment
selftests: reuseaddr_conflict: add missing new line at the end of the output
ipv6: Fix infinite recursion in fib6_dump_done().
i40e: fix vf may be used uninitialized in this function warning
staging: mmal-vchiq: Avoid use of bool in structures
staging: mmal-vchiq: Allocate and free components as required
staging: mmal-vchiq: Fix client_component for 64 bit kernel
staging: vc04_services: changen strncpy() to strscpy_pad()
staging: vc04_services: fix information leak in create_component()
initramfs: factor out a helper to populate the initrd image
fs: add a vfs_fchown helper
fs: add a vfs_fchmod helper
initramfs: switch initramfs unpacking to struct file based APIs
init: open /initrd.image with O_LARGEFILE
erspan: Add type I version 0 support.
erspan: make sure erspan_base_hdr is present in skb->head
ASoC: ops: Fix wraparound for mask in snd_soc_get_volsw
ata: sata_sx4: fix pdc20621_get_from_dimm() on 64-bit
ata: sata_mv: Fix PCI device ID table declaration compilation warning
ALSA: hda/realtek: Update Panasonic CF-SZ6 quirk to support headset with microphone
wifi: ath9k: fix LNA selection in ath_ant_try_scan()
VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host()
arm64: dts: rockchip: fix rk3399 hdmi ports node
tools/power x86_energy_perf_policy: Fix file leak in get_pkg_num()
btrfs: handle chunk tree lookup error in btrfs_relocate_sys_chunks()
btrfs: export: handle invalid inode or root reference in btrfs_get_parent()
btrfs: send: handle path ref underflow in header iterate_inode_ref()
Bluetooth: btintel: Fix null ptr deref in btintel_read_version
Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails
sysv: don't call sb_bread() with pointers_lock held
scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc()
isofs: handle CDs with bad root inode but good Joliet root directory
media: sta2x11: fix irq handler cast
drm/amd/display: Fix nanosec stat overflow
SUNRPC: increase size of rpc_wait_queue.qlen from unsigned short to unsigned int
block: prevent division by zero in blk_rq_stat_sum()
Input: allocate keycode for Display refresh rate toggle
ktest: force $buildonly = 1 for 'make_warnings_file' test type
tools: iio: replace seekdir() in iio_generic_buffer
usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined
fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2
fbmon: prevent division by zero in fb_videomode_from_videomode()
tty: n_gsm: require CAP_NET_ADMIN to attach N_GSM0710 ldisc
drm/vkms: call drm_atomic_helper_shutdown before drm_dev_put()
virtio: reenable config if freezing device failed
x86/mm/pat: fix VM_PAT handling in COW mappings
Bluetooth: btintel: Fixe build regression
VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler()
erspan: Check IFLA_GRE_ERSPAN_VER is set.
ip_gre: do not report erspan version on GRE interface
initramfs: fix populate_initrd_image() section mismatch
amdkfd: use calloc instead of kzalloc to avoid integer overflow
Linux 4.19.312
Change-Id: Ic4c50de6afb4c88c8011be6cc93f960d2dc968e0
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
ec0ad95612
165 files changed
+1979
-1112
No files matched your search
@@ -484,11 +484,14 @@ Spectre variant 2
|
||||
|
||||
Systems which support enhanced IBRS (eIBRS) enable IBRS protection once at
|
||||
boot, by setting the IBRS bit, and they're automatically protected against
|
||||
Spectre v2 variant attacks, including cross-thread branch target injections
|
||||
on SMT systems (STIBP). In other words, eIBRS enables STIBP too.
|
||||
Spectre v2 variant attacks.
|
||||
|
||||
Legacy IBRS systems clear the IBRS bit on exit to userspace and
|
||||
therefore explicitly enable STIBP for that
|
||||
On Intel's enhanced IBRS systems, this includes cross-thread branch target
|
||||
injections on SMT systems (STIBP). In other words, Intel eIBRS enables
|
||||
STIBP, too.
|
||||
|
||||
AMD Automatic IBRS does not protect userspace, and Legacy IBRS systems clear
|
||||
the IBRS bit on exit to userspace, therefore both explicitly enable STIBP.
|
||||
|
||||
The retpoline mitigation is turned on by default on vulnerable
|
||||
CPUs. It can be forced on or off by the administrator
|
||||
@@ -622,9 +625,10 @@ kernel command line.
|
||||
retpoline,generic Retpolines
|
||||
retpoline,lfence LFENCE; indirect branch
|
||||
retpoline,amd alias for retpoline,lfence
|
||||
eibrs enhanced IBRS
|
||||
eibrs,retpoline enhanced IBRS + Retpolines
|
||||
eibrs,lfence enhanced IBRS + LFENCE
|
||||
eibrs Enhanced/Auto IBRS
|
||||
eibrs,retpoline Enhanced/Auto IBRS + Retpolines
|
||||
eibrs,lfence Enhanced/Auto IBRS + LFENCE
|
||||
ibrs use IBRS to protect kernel
|
||||
|
||||
Not specifying this option is equivalent to
|
||||
spectre_v2=auto.
|
||||
|
||||
@@ -4433,9 +4433,9 @@
|
||||
retpoline,generic - Retpolines
|
||||
retpoline,lfence - LFENCE; indirect branch
|
||||
retpoline,amd - alias for retpoline,lfence
|
||||
eibrs - enhanced IBRS
|
||||
eibrs,retpoline - enhanced IBRS + Retpolines
|
||||
eibrs,lfence - enhanced IBRS + LFENCE
|
||||
eibrs - Enhanced/Auto IBRS
|
||||
eibrs,retpoline - Enhanced/Auto IBRS + Retpolines
|
||||
eibrs,lfence - Enhanced/Auto IBRS + LFENCE
|
||||
ibrs - use IBRS to protect kernel
|
||||
|
||||
Not specifying this option is equivalent to
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 311
|
||||
SUBLEVEL = 312
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
|
||||
@@ -21,176 +21,174 @@
|
||||
memory {
|
||||
reg = <0x00000000 0x08000000>;
|
||||
};
|
||||
};
|
||||
|
||||
soc {
|
||||
apb@d4000000 {
|
||||
uart3: uart@d4018000 {
|
||||
status = "okay";
|
||||
};
|
||||
twsi1: i2c@d4011000 {
|
||||
status = "okay";
|
||||
pmic: max8925@3c {
|
||||
compatible = "maxium,max8925";
|
||||
reg = <0x3c>;
|
||||
interrupts = <1>;
|
||||
interrupt-parent = <&intcmux4>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
maxim,tsc-irq = <0>;
|
||||
&uart3 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
regulators {
|
||||
SDV1 {
|
||||
regulator-min-microvolt = <637500>;
|
||||
regulator-max-microvolt = <1425000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
SDV2 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2225000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
SDV3 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO1 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO2 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2250000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO3 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2250000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO4 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO5 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO6 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO7 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO8 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO9 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO10 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
};
|
||||
LDO11 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO12 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO13 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO14 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO15 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO16 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO17 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2250000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO18 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2250000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO19 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO20 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
};
|
||||
backlight {
|
||||
maxim,max8925-dual-string = <0>;
|
||||
};
|
||||
charger {
|
||||
batt-detect = <0>;
|
||||
topoff-threshold = <1>;
|
||||
fast-charge = <7>;
|
||||
no-temp-support = <0>;
|
||||
no-insert-detect = <0>;
|
||||
};
|
||||
};
|
||||
&twsi1 {
|
||||
status = "okay";
|
||||
pmic: max8925@3c {
|
||||
compatible = "maxim,max8925";
|
||||
reg = <0x3c>;
|
||||
interrupts = <1>;
|
||||
interrupt-parent = <&intcmux4>;
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <1>;
|
||||
maxim,tsc-irq = <0>;
|
||||
|
||||
regulators {
|
||||
SDV1 {
|
||||
regulator-min-microvolt = <637500>;
|
||||
regulator-max-microvolt = <1425000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
rtc: rtc@d4010000 {
|
||||
status = "okay";
|
||||
SDV2 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2225000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
SDV3 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO1 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO2 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2250000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO3 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2250000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO4 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO5 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO6 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO7 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO8 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO9 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO10 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
};
|
||||
LDO11 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO12 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO13 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO14 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO15 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO16 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO17 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2250000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO18 {
|
||||
regulator-min-microvolt = <650000>;
|
||||
regulator-max-microvolt = <2250000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO19 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
LDO20 {
|
||||
regulator-min-microvolt = <750000>;
|
||||
regulator-max-microvolt = <3900000>;
|
||||
regulator-boot-on;
|
||||
regulator-always-on;
|
||||
};
|
||||
};
|
||||
backlight {
|
||||
maxim,max8925-dual-string = <0>;
|
||||
};
|
||||
charger {
|
||||
batt-detect = <0>;
|
||||
topoff-threshold = <1>;
|
||||
fast-charge = <7>;
|
||||
no-temp-support = <0>;
|
||||
no-insert-detect = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&rtc {
|
||||
status = "okay";
|
||||
};
|
||||
@@ -1683,6 +1683,7 @@
|
||||
hdmi: hdmi@ff940000 {
|
||||
compatible = "rockchip,rk3399-dw-hdmi";
|
||||
reg = <0x0 0xff940000 0x0 0x20000>;
|
||||
reg-io-width = <4>;
|
||||
interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH 0>;
|
||||
clocks = <&cru PCLK_HDMI_CTRL>,
|
||||
<&cru SCLK_HDMI_SFR>,
|
||||
@@ -1691,13 +1692,16 @@
|
||||
<&cru PLL_VPLL>;
|
||||
clock-names = "iahb", "isfr", "cec", "grf", "vpll";
|
||||
power-domains = <&power RK3399_PD_HDCP>;
|
||||
reg-io-width = <4>;
|
||||
rockchip,grf = <&grf>;
|
||||
#sound-dai-cells = <0>;
|
||||
status = "disabled";
|
||||
|
||||
ports {
|
||||
hdmi_in: port {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
hdmi_in: port@0 {
|
||||
reg = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
@@ -1710,6 +1714,10 @@
|
||||
remote-endpoint = <&vopl_out_hdmi>;
|
||||
};
|
||||
};
|
||||
|
||||
hdmi_out: port@1 {
|
||||
reg = <1>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -42,31 +42,32 @@ extern __wsum csum_partial_copy_from_user(const void __user *src,
|
||||
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int sum;
|
||||
unsigned long t0, t1, t2;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
" ldws,ma 4(%1), %0\n"
|
||||
" addib,<= -4, %2, 2f\n"
|
||||
"\n"
|
||||
" ldws 4(%1), %%r20\n"
|
||||
" ldws 8(%1), %%r21\n"
|
||||
" add %0, %%r20, %0\n"
|
||||
" ldws,ma 12(%1), %%r19\n"
|
||||
" addc %0, %%r21, %0\n"
|
||||
" addc %0, %%r19, %0\n"
|
||||
"1: ldws,ma 4(%1), %%r19\n"
|
||||
" addib,< 0, %2, 1b\n"
|
||||
" addc %0, %%r19, %0\n"
|
||||
" ldws 4(%1), %4\n"
|
||||
" ldws 8(%1), %5\n"
|
||||
" add %0, %4, %0\n"
|
||||
" ldws,ma 12(%1), %3\n"
|
||||
" addc %0, %5, %0\n"
|
||||
" addc %0, %3, %0\n"
|
||||
"1: ldws,ma 4(%1), %3\n"
|
||||
" addib,> -1, %2, 1b\n"
|
||||
" addc %0, %3, %0\n"
|
||||
"\n"
|
||||
" extru %0, 31, 16, %%r20\n"
|
||||
" extru %0, 15, 16, %%r21\n"
|
||||
" addc %%r20, %%r21, %0\n"
|
||||
" extru %0, 15, 16, %%r21\n"
|
||||
" add %0, %%r21, %0\n"
|
||||
" extru %0, 31, 16, %4\n"
|
||||
" extru %0, 15, 16, %5\n"
|
||||
" addc %4, %5, %0\n"
|
||||
" extru %0, 15, 16, %5\n"
|
||||
" add %0, %5, %0\n"
|
||||
" subi -1, %0, %0\n"
|
||||
"2:\n"
|
||||
: "=r" (sum), "=r" (iph), "=r" (ihl)
|
||||
: "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (t0), "=r" (t1), "=r" (t2)
|
||||
: "1" (iph), "2" (ihl)
|
||||
: "r19", "r20", "r21", "memory");
|
||||
: "memory");
|
||||
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
@@ -126,6 +127,10 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
__u32 len, __u8 proto,
|
||||
__wsum sum)
|
||||
{
|
||||
unsigned long t0, t1, t2, t3;
|
||||
|
||||
len += proto; /* add 16-bit proto + len */
|
||||
|
||||
__asm__ __volatile__ (
|
||||
|
||||
#if BITS_PER_LONG > 32
|
||||
@@ -136,20 +141,20 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
** Try to keep 4 registers with "live" values ahead of the ALU.
|
||||
*/
|
||||
|
||||
" ldd,ma 8(%1), %%r19\n" /* get 1st saddr word */
|
||||
" ldd,ma 8(%2), %%r20\n" /* get 1st daddr word */
|
||||
" add %8, %3, %3\n"/* add 16-bit proto + len */
|
||||
" add %%r19, %0, %0\n"
|
||||
" ldd,ma 8(%1), %%r21\n" /* 2cd saddr */
|
||||
" ldd,ma 8(%2), %%r22\n" /* 2cd daddr */
|
||||
" add,dc %%r20, %0, %0\n"
|
||||
" add,dc %%r21, %0, %0\n"
|
||||
" add,dc %%r22, %0, %0\n"
|
||||
" depdi 0, 31, 32, %0\n"/* clear upper half of incoming checksum */
|
||||
" ldd,ma 8(%1), %4\n" /* get 1st saddr word */
|
||||
" ldd,ma 8(%2), %5\n" /* get 1st daddr word */
|
||||
" add %4, %0, %0\n"
|
||||
" ldd,ma 8(%1), %6\n" /* 2nd saddr */
|
||||
" ldd,ma 8(%2), %7\n" /* 2nd daddr */
|
||||
" add,dc %5, %0, %0\n"
|
||||
" add,dc %6, %0, %0\n"
|
||||
" add,dc %7, %0, %0\n"
|
||||
" add,dc %3, %0, %0\n" /* fold in proto+len | carry bit */
|
||||
" extrd,u %0, 31, 32, %%r19\n" /* copy upper half down */
|
||||
" depdi 0, 31, 32, %0\n" /* clear upper half */
|
||||
" add %%r19, %0, %0\n" /* fold into 32-bits */
|
||||
" addc 0, %0, %0\n" /* add carry */
|
||||
" extrd,u %0, 31, 32, %4\n"/* copy upper half down */
|
||||
" depdi 0, 31, 32, %0\n"/* clear upper half */
|
||||
" add,dc %4, %0, %0\n" /* fold into 32-bits, plus carry */
|
||||
" addc 0, %0, %0\n" /* add final carry */
|
||||
|
||||
#else
|
||||
|
||||
@@ -158,30 +163,30 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
** Insn stream is serialized on the carry bit here too.
|
||||
** result from the previous operation (eg r0 + x)
|
||||
*/
|
||||
|
||||
" ldw,ma 4(%1), %%r19\n" /* get 1st saddr word */
|
||||
" ldw,ma 4(%2), %%r20\n" /* get 1st daddr word */
|
||||
" add %8, %3, %3\n" /* add 16-bit proto + len */
|
||||
" add %%r19, %0, %0\n"
|
||||
" ldw,ma 4(%1), %%r21\n" /* 2cd saddr */
|
||||
" addc %%r20, %0, %0\n"
|
||||
" ldw,ma 4(%2), %%r22\n" /* 2cd daddr */
|
||||
" addc %%r21, %0, %0\n"
|
||||
" ldw,ma 4(%1), %%r19\n" /* 3rd saddr */
|
||||
" addc %%r22, %0, %0\n"
|
||||
" ldw,ma 4(%2), %%r20\n" /* 3rd daddr */
|
||||
" addc %%r19, %0, %0\n"
|
||||
" ldw,ma 4(%1), %%r21\n" /* 4th saddr */
|
||||
" addc %%r20, %0, %0\n"
|
||||
" ldw,ma 4(%2), %%r22\n" /* 4th daddr */
|
||||
" addc %%r21, %0, %0\n"
|
||||
" addc %%r22, %0, %0\n"
|
||||
" addc %3, %0, %0\n" /* fold in proto+len, catch carry */
|
||||
" ldw,ma 4(%1), %4\n" /* get 1st saddr word */
|
||||
" ldw,ma 4(%2), %5\n" /* get 1st daddr word */
|
||||
" add %4, %0, %0\n"
|
||||
" ldw,ma 4(%1), %6\n" /* 2nd saddr */
|
||||
" addc %5, %0, %0\n"
|
||||
" ldw,ma 4(%2), %7\n" /* 2nd daddr */
|
||||
" addc %6, %0, %0\n"
|
||||
" ldw,ma 4(%1), %4\n" /* 3rd saddr */
|
||||
" addc %7, %0, %0\n"
|
||||
" ldw,ma 4(%2), %5\n" /* 3rd daddr */
|
||||
" addc %4, %0, %0\n"
|
||||
" ldw,ma 4(%1), %6\n" /* 4th saddr */
|
||||
" addc %5, %0, %0\n"
|
||||
" ldw,ma 4(%2), %7\n" /* 4th daddr */
|
||||
" addc %6, %0, %0\n"
|
||||
" addc %7, %0, %0\n"
|
||||
" addc %3, %0, %0\n" /* fold in proto+len */
|
||||
" addc 0, %0, %0\n" /* add carry */
|
||||
|
||||
#endif
|
||||
: "=r" (sum), "=r" (saddr), "=r" (daddr), "=r" (len)
|
||||
: "0" (sum), "1" (saddr), "2" (daddr), "3" (len), "r" (proto)
|
||||
: "r19", "r20", "r21", "r22", "memory");
|
||||
: "=r" (sum), "=r" (saddr), "=r" (daddr), "=r" (len),
|
||||
"=r" (t0), "=r" (t1), "=r" (t2), "=r" (t3)
|
||||
: "0" (sum), "1" (saddr), "2" (daddr), "3" (len)
|
||||
: "memory");
|
||||
return csum_fold(sum);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,16 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
/* Performance Monitor Registers */
|
||||
#define mfpmr(rn) ({unsigned int rval; \
|
||||
asm volatile("mfpmr %0," __stringify(rn) \
|
||||
asm volatile(".machine push; " \
|
||||
".machine e300; " \
|
||||
"mfpmr %0," __stringify(rn) ";" \
|
||||
".machine pop; " \
|
||||
: "=r" (rval)); rval;})
|
||||
#define mtpmr(rn, v) asm volatile("mtpmr " __stringify(rn) ",%0" : : "r" (v))
|
||||
#define mtpmr(rn, v) asm volatile(".machine push; " \
|
||||
".machine e300; " \
|
||||
"mtpmr " __stringify(rn) ",%0; " \
|
||||
".machine pop; " \
|
||||
: : "r" (v))
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/* Freescale Book E Performance Monitor APU Registers */
|
||||
|
||||
@@ -46,6 +46,6 @@ obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
|
||||
obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
|
||||
|
||||
obj-$(CONFIG_ALTIVEC) += xor_vmx.o xor_vmx_glue.o
|
||||
CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec)
|
||||
CFLAGS_xor_vmx.o += -mhard-float -maltivec $(call cc-option,-mabi=altivec)
|
||||
|
||||
obj-$(CONFIG_PPC64) += $(obj64-y)
|
||||
@@ -273,7 +273,7 @@ static int __init setup_nmi_watchdog(char *str)
|
||||
if (!strncmp(str, "panic", 5))
|
||||
panic_on_timeout = 1;
|
||||
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
__setup("nmi_watchdog=", setup_nmi_watchdog);
|
||||
|
||||
|
||||
@@ -262,9 +262,8 @@ static __init int vdso_setup(char *s)
|
||||
unsigned long val;
|
||||
|
||||
err = kstrtoul(s, 10, &val);
|
||||
if (err)
|
||||
return err;
|
||||
vdso_enabled = val;
|
||||
return 0;
|
||||
if (!err)
|
||||
vdso_enabled = val;
|
||||
return 1;
|
||||
}
|
||||
__setup("vdso=", vdso_setup);
|
||||
@@ -369,6 +369,8 @@
|
||||
#define X86_FEATURE_ARCH_CAPABILITIES (18*32+29) /* IA32_ARCH_CAPABILITIES MSR (Intel) */
|
||||
#define X86_FEATURE_SPEC_CTRL_SSBD (18*32+31) /* "" Speculative Store Bypass Disable */
|
||||
|
||||
#define X86_FEATURE_AUTOIBRS (20*32+ 8) /* "" Automatic IBRS */
|
||||
|
||||
/*
|
||||
* BUG word(s)
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#define _EFER_SVME 12 /* Enable virtualization */
|
||||
#define _EFER_LMSLE 13 /* Long Mode Segment Limit Enable */
|
||||
#define _EFER_FFXSR 14 /* Enable Fast FXSAVE/FXRSTOR */
|
||||
#define _EFER_AUTOIBRS 21 /* Enable Automatic IBRS */
|
||||
|
||||
#define EFER_SCE (1<<_EFER_SCE)
|
||||
#define EFER_LME (1<<_EFER_LME)
|
||||
@@ -38,6 +39,7 @@
|
||||
#define EFER_SVME (1<<_EFER_SVME)
|
||||
#define EFER_LMSLE (1<<_EFER_LMSLE)
|
||||
#define EFER_FFXSR (1<<_EFER_FFXSR)
|
||||
#define EFER_AUTOIBRS (1<<_EFER_AUTOIBRS)
|
||||
|
||||
/* Intel MSRs. Some also available on other CPUs */
|
||||
|
||||
|
||||
@@ -988,11 +988,11 @@ static bool cpu_has_zenbleed_microcode(void)
|
||||
u32 good_rev = 0;
|
||||
|
||||
switch (boot_cpu_data.x86_model) {
|
||||
case 0x30 ... 0x3f: good_rev = 0x0830107a; break;
|
||||
case 0x60 ... 0x67: good_rev = 0x0860010b; break;
|
||||
case 0x68 ... 0x6f: good_rev = 0x08608105; break;
|
||||
case 0x70 ... 0x7f: good_rev = 0x08701032; break;
|
||||
case 0xa0 ... 0xaf: good_rev = 0x08a00008; break;
|
||||
case 0x30 ... 0x3f: good_rev = 0x0830107b; break;
|
||||
case 0x60 ... 0x67: good_rev = 0x0860010c; break;
|
||||
case 0x68 ... 0x6f: good_rev = 0x08608107; break;
|
||||
case 0x70 ... 0x7f: good_rev = 0x08701033; break;
|
||||
case 0xa0 ... 0xaf: good_rev = 0x08a00009; break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
|
||||
+62
-55
@@ -1153,19 +1153,21 @@ spectre_v2_user_select_mitigation(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* If no STIBP, enhanced IBRS is enabled, or SMT impossible, STIBP
|
||||
* If no STIBP, Intel enhanced IBRS is enabled, or SMT impossible, STIBP
|
||||
* is not required.
|
||||
*
|
||||
* Enhanced IBRS also protects against cross-thread branch target
|
||||
* Intel's Enhanced IBRS also protects against cross-thread branch target
|
||||
* injection in user-mode as the IBRS bit remains always set which
|
||||
* implicitly enables cross-thread protections. However, in legacy IBRS
|
||||
* mode, the IBRS bit is set only on kernel entry and cleared on return
|
||||
* to userspace. This disables the implicit cross-thread protection,
|
||||
* so allow for STIBP to be selected in that case.
|
||||
* to userspace. AMD Automatic IBRS also does not protect userspace.
|
||||
* These modes therefore disable the implicit cross-thread protection,
|
||||
* so allow for STIBP to be selected in those cases.
|
||||
*/
|
||||
if (!boot_cpu_has(X86_FEATURE_STIBP) ||
|
||||
!smt_possible ||
|
||||
spectre_v2_in_eibrs_mode(spectre_v2_enabled))
|
||||
(spectre_v2_in_eibrs_mode(spectre_v2_enabled) &&
|
||||
!boot_cpu_has(X86_FEATURE_AUTOIBRS)))
|
||||
return;
|
||||
|
||||
/*
|
||||
@@ -1187,9 +1189,9 @@ static const char * const spectre_v2_strings[] = {
|
||||
[SPECTRE_V2_NONE] = "Vulnerable",
|
||||
[SPECTRE_V2_RETPOLINE] = "Mitigation: Retpolines",
|
||||
[SPECTRE_V2_LFENCE] = "Mitigation: LFENCE",
|
||||
[SPECTRE_V2_EIBRS] = "Mitigation: Enhanced IBRS",
|
||||
[SPECTRE_V2_EIBRS_LFENCE] = "Mitigation: Enhanced IBRS + LFENCE",
|
||||
[SPECTRE_V2_EIBRS_RETPOLINE] = "Mitigation: Enhanced IBRS + Retpolines",
|
||||
[SPECTRE_V2_EIBRS] = "Mitigation: Enhanced / Automatic IBRS",
|
||||
[SPECTRE_V2_EIBRS_LFENCE] = "Mitigation: Enhanced / Automatic IBRS + LFENCE",
|
||||
[SPECTRE_V2_EIBRS_RETPOLINE] = "Mitigation: Enhanced / Automatic IBRS + Retpolines",
|
||||
[SPECTRE_V2_IBRS] = "Mitigation: IBRS",
|
||||
};
|
||||
|
||||
@@ -1258,7 +1260,7 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
|
||||
cmd == SPECTRE_V2_CMD_EIBRS_LFENCE ||
|
||||
cmd == SPECTRE_V2_CMD_EIBRS_RETPOLINE) &&
|
||||
!boot_cpu_has(X86_FEATURE_IBRS_ENHANCED)) {
|
||||
pr_err("%s selected but CPU doesn't have eIBRS. Switching to AUTO select\n",
|
||||
pr_err("%s selected but CPU doesn't have Enhanced or Automatic IBRS. Switching to AUTO select\n",
|
||||
mitigation_options[i].option);
|
||||
return SPECTRE_V2_CMD_AUTO;
|
||||
}
|
||||
@@ -1437,8 +1439,12 @@ static void __init spectre_v2_select_mitigation(void)
|
||||
pr_err(SPECTRE_V2_EIBRS_EBPF_MSG);
|
||||
|
||||
if (spectre_v2_in_ibrs_mode(mode)) {
|
||||
x86_spec_ctrl_base |= SPEC_CTRL_IBRS;
|
||||
update_spec_ctrl(x86_spec_ctrl_base);
|
||||
if (boot_cpu_has(X86_FEATURE_AUTOIBRS)) {
|
||||
msr_set_bit(MSR_EFER, _EFER_AUTOIBRS);
|
||||
} else {
|
||||
x86_spec_ctrl_base |= SPEC_CTRL_IBRS;
|
||||
update_spec_ctrl(x86_spec_ctrl_base);
|
||||
}
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
@@ -1522,8 +1528,8 @@ static void __init spectre_v2_select_mitigation(void)
|
||||
/*
|
||||
* Retpoline protects the kernel, but doesn't protect firmware. IBRS
|
||||
* and Enhanced IBRS protect firmware too, so enable IBRS around
|
||||
* firmware calls only when IBRS / Enhanced IBRS aren't otherwise
|
||||
* enabled.
|
||||
* firmware calls only when IBRS / Enhanced / Automatic IBRS aren't
|
||||
* otherwise enabled.
|
||||
*
|
||||
* Use "mode" to check Enhanced IBRS instead of boot_cpu_has(), because
|
||||
* the user might select retpoline on the kernel command line and if
|
||||
@@ -2133,69 +2139,69 @@ static const char * const l1tf_vmx_states[] = {
|
||||
static ssize_t l1tf_show_state(char *buf)
|
||||
{
|
||||
if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_AUTO)
|
||||
return sprintf(buf, "%s\n", L1TF_DEFAULT_MSG);
|
||||
return sysfs_emit(buf, "%s\n", L1TF_DEFAULT_MSG);
|
||||
|
||||
if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_EPT_DISABLED ||
|
||||
(l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_NEVER &&
|
||||
sched_smt_active())) {
|
||||
return sprintf(buf, "%s; VMX: %s\n", L1TF_DEFAULT_MSG,
|
||||
l1tf_vmx_states[l1tf_vmx_mitigation]);
|
||||
return sysfs_emit(buf, "%s; VMX: %s\n", L1TF_DEFAULT_MSG,
|
||||
l1tf_vmx_states[l1tf_vmx_mitigation]);
|
||||
}
|
||||
|
||||
return sprintf(buf, "%s; VMX: %s, SMT %s\n", L1TF_DEFAULT_MSG,
|
||||
l1tf_vmx_states[l1tf_vmx_mitigation],
|
||||
sched_smt_active() ? "vulnerable" : "disabled");
|
||||
return sysfs_emit(buf, "%s; VMX: %s, SMT %s\n", L1TF_DEFAULT_MSG,
|
||||
l1tf_vmx_states[l1tf_vmx_mitigation],
|
||||
sched_smt_active() ? "vulnerable" : "disabled");
|
||||
}
|
||||
|
||||
static ssize_t itlb_multihit_show_state(char *buf)
|
||||
{
|
||||
if (itlb_multihit_kvm_mitigation)
|
||||
return sprintf(buf, "KVM: Mitigation: Split huge pages\n");
|
||||
return sysfs_emit(buf, "KVM: Mitigation: Split huge pages\n");
|
||||
else
|
||||
return sprintf(buf, "KVM: Vulnerable\n");
|
||||
return sysfs_emit(buf, "KVM: Vulnerable\n");
|
||||
}
|
||||
#else
|
||||
static ssize_t l1tf_show_state(char *buf)
|
||||
{
|
||||
return sprintf(buf, "%s\n", L1TF_DEFAULT_MSG);
|
||||
return sysfs_emit(buf, "%s\n", L1TF_DEFAULT_MSG);
|
||||
}
|
||||
|
||||
static ssize_t itlb_multihit_show_state(char *buf)
|
||||
{
|
||||
return sprintf(buf, "Processor vulnerable\n");
|
||||
return sysfs_emit(buf, "Processor vulnerable\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
static ssize_t mds_show_state(char *buf)
|
||||
{
|
||||
if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
|
||||
return sprintf(buf, "%s; SMT Host state unknown\n",
|
||||
mds_strings[mds_mitigation]);
|
||||
return sysfs_emit(buf, "%s; SMT Host state unknown\n",
|
||||
mds_strings[mds_mitigation]);
|
||||
}
|
||||
|
||||
if (boot_cpu_has(X86_BUG_MSBDS_ONLY)) {
|
||||
return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],
|
||||
(mds_mitigation == MDS_MITIGATION_OFF ? "vulnerable" :
|
||||
sched_smt_active() ? "mitigated" : "disabled"));
|
||||
return sysfs_emit(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],
|
||||
(mds_mitigation == MDS_MITIGATION_OFF ? "vulnerable" :
|
||||
sched_smt_active() ? "mitigated" : "disabled"));
|
||||
}
|
||||
|
||||
return sprintf(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],
|
||||
sched_smt_active() ? "vulnerable" : "disabled");
|
||||
return sysfs_emit(buf, "%s; SMT %s\n", mds_strings[mds_mitigation],
|
||||
sched_smt_active() ? "vulnerable" : "disabled");
|
||||
}
|
||||
|
||||
static ssize_t tsx_async_abort_show_state(char *buf)
|
||||
{
|
||||
if ((taa_mitigation == TAA_MITIGATION_TSX_DISABLED) ||
|
||||
(taa_mitigation == TAA_MITIGATION_OFF))
|
||||
return sprintf(buf, "%s\n", taa_strings[taa_mitigation]);
|
||||
return sysfs_emit(buf, "%s\n", taa_strings[taa_mitigation]);
|
||||
|
||||
if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
|
||||
return sprintf(buf, "%s; SMT Host state unknown\n",
|
||||
taa_strings[taa_mitigation]);
|
||||
return sysfs_emit(buf, "%s; SMT Host state unknown\n",
|
||||
taa_strings[taa_mitigation]);
|
||||
}
|
||||
|
||||
return sprintf(buf, "%s; SMT %s\n", taa_strings[taa_mitigation],
|
||||
sched_smt_active() ? "vulnerable" : "disabled");
|
||||
return sysfs_emit(buf, "%s; SMT %s\n", taa_strings[taa_mitigation],
|
||||
sched_smt_active() ? "vulnerable" : "disabled");
|
||||
}
|
||||
|
||||
static ssize_t mmio_stale_data_show_state(char *buf)
|
||||
@@ -2217,7 +2223,8 @@ static ssize_t mmio_stale_data_show_state(char *buf)
|
||||
|
||||
static char *stibp_state(void)
|
||||
{
|
||||
if (spectre_v2_in_eibrs_mode(spectre_v2_enabled))
|
||||
if (spectre_v2_in_eibrs_mode(spectre_v2_enabled) &&
|
||||
!boot_cpu_has(X86_FEATURE_AUTOIBRS))
|
||||
return "";
|
||||
|
||||
switch (spectre_v2_user_stibp) {
|
||||
@@ -2263,33 +2270,33 @@ static char *pbrsb_eibrs_state(void)
|
||||
static ssize_t spectre_v2_show_state(char *buf)
|
||||
{
|
||||
if (spectre_v2_enabled == SPECTRE_V2_LFENCE)
|
||||
return sprintf(buf, "Vulnerable: LFENCE\n");
|
||||
return sysfs_emit(buf, "Vulnerable: LFENCE\n");
|
||||
|
||||
if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled())
|
||||
return sprintf(buf, "Vulnerable: eIBRS with unprivileged eBPF\n");
|
||||
return sysfs_emit(buf, "Vulnerable: eIBRS with unprivileged eBPF\n");
|
||||
|
||||
if (sched_smt_active() && unprivileged_ebpf_enabled() &&
|
||||
spectre_v2_enabled == SPECTRE_V2_EIBRS_LFENCE)
|
||||
return sprintf(buf, "Vulnerable: eIBRS+LFENCE with unprivileged eBPF and SMT\n");
|
||||
return sysfs_emit(buf, "Vulnerable: eIBRS+LFENCE with unprivileged eBPF and SMT\n");
|
||||
|
||||
return sprintf(buf, "%s%s%s%s%s%s%s\n",
|
||||
spectre_v2_strings[spectre_v2_enabled],
|
||||
ibpb_state(),
|
||||
boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? ", IBRS_FW" : "",
|
||||
stibp_state(),
|
||||
boot_cpu_has(X86_FEATURE_RSB_CTXSW) ? ", RSB filling" : "",
|
||||
pbrsb_eibrs_state(),
|
||||
spectre_v2_module_string());
|
||||
return sysfs_emit(buf, "%s%s%s%s%s%s%s\n",
|
||||
spectre_v2_strings[spectre_v2_enabled],
|
||||
ibpb_state(),
|
||||
boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? ", IBRS_FW" : "",
|
||||
stibp_state(),
|
||||
boot_cpu_has(X86_FEATURE_RSB_CTXSW) ? ", RSB filling" : "",
|
||||
pbrsb_eibrs_state(),
|
||||
spectre_v2_module_string());
|
||||
}
|
||||
|
||||
static ssize_t srbds_show_state(char *buf)
|
||||
{
|
||||
return sprintf(buf, "%s\n", srbds_strings[srbds_mitigation]);
|
||||
return sysfs_emit(buf, "%s\n", srbds_strings[srbds_mitigation]);
|
||||
}
|
||||
|
||||
static ssize_t retbleed_show_state(char *buf)
|
||||
{
|
||||
return sprintf(buf, "%s\n", retbleed_strings[retbleed_mitigation]);
|
||||
return sysfs_emit(buf, "%s\n", retbleed_strings[retbleed_mitigation]);
|
||||
}
|
||||
|
||||
static ssize_t gds_show_state(char *buf)
|
||||
@@ -2301,26 +2308,26 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
|
||||
char *buf, unsigned int bug)
|
||||
{
|
||||
if (!boot_cpu_has_bug(bug))
|
||||
return sprintf(buf, "Not affected\n");
|
||||
return sysfs_emit(buf, "Not affected\n");
|
||||
|
||||
switch (bug) {
|
||||
case X86_BUG_CPU_MELTDOWN:
|
||||
if (boot_cpu_has(X86_FEATURE_PTI))
|
||||
return sprintf(buf, "Mitigation: PTI\n");
|
||||
return sysfs_emit(buf, "Mitigation: PTI\n");
|
||||
|
||||
if (hypervisor_is_type(X86_HYPER_XEN_PV))
|
||||
return sprintf(buf, "Unknown (XEN PV detected, hypervisor mitigation required)\n");
|
||||
return sysfs_emit(buf, "Unknown (XEN PV detected, hypervisor mitigation required)\n");
|
||||
|
||||
break;
|
||||
|
||||
case X86_BUG_SPECTRE_V1:
|
||||
return sprintf(buf, "%s\n", spectre_v1_strings[spectre_v1_mitigation]);
|
||||
return sysfs_emit(buf, "%s\n", spectre_v1_strings[spectre_v1_mitigation]);
|
||||
|
||||
case X86_BUG_SPECTRE_V2:
|
||||
return spectre_v2_show_state(buf);
|
||||
|
||||
case X86_BUG_SPEC_STORE_BYPASS:
|
||||
return sprintf(buf, "%s\n", ssb_strings[ssb_mode]);
|
||||
return sysfs_emit(buf, "%s\n", ssb_strings[ssb_mode]);
|
||||
|
||||
case X86_BUG_L1TF:
|
||||
if (boot_cpu_has(X86_FEATURE_L1TF_PTEINV))
|
||||
@@ -2353,7 +2360,7 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
|
||||
break;
|
||||
}
|
||||
|
||||
return sprintf(buf, "Vulnerable\n");
|
||||
return sysfs_emit(buf, "Vulnerable\n");
|
||||
}
|
||||
|
||||
ssize_t cpu_show_meltdown(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
|
||||
@@ -1025,7 +1025,7 @@ static const __initconst struct x86_cpu_id cpu_vuln_whitelist[] = {
|
||||
VULNWL_AMD(0x12, NO_MELTDOWN | NO_SSB | NO_L1TF | NO_MDS | NO_SWAPGS | NO_ITLB_MULTIHIT | NO_MMIO),
|
||||
|
||||
/* FAMILY_ANY must be last, otherwise 0x0f - 0x12 matches won't work */
|
||||
VULNWL_AMD(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS | NO_SWAPGS | NO_ITLB_MULTIHIT | NO_MMIO),
|
||||
VULNWL_AMD(X86_FAMILY_ANY, NO_MELTDOWN | NO_L1TF | NO_MDS | NO_SWAPGS | NO_ITLB_MULTIHIT | NO_MMIO | NO_EIBRS_PBRSB),
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -1133,8 +1133,16 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
|
||||
!cpu_has(c, X86_FEATURE_AMD_SSB_NO))
|
||||
setup_force_cpu_bug(X86_BUG_SPEC_STORE_BYPASS);
|
||||
|
||||
if (ia32_cap & ARCH_CAP_IBRS_ALL)
|
||||
/*
|
||||
* AMD's AutoIBRS is equivalent to Intel's eIBRS - use the Intel feature
|
||||
* flag and protect from vendor-specific bugs via the whitelist.
|
||||
*/
|
||||
if ((ia32_cap & ARCH_CAP_IBRS_ALL) || cpu_has(c, X86_FEATURE_AUTOIBRS)) {
|
||||
setup_force_cpu_cap(X86_FEATURE_IBRS_ENHANCED);
|
||||
if (!cpu_matches(cpu_vuln_whitelist, NO_EIBRS_PBRSB) &&
|
||||
!(ia32_cap & ARCH_CAP_PBRSB_NO))
|
||||
setup_force_cpu_bug(X86_BUG_EIBRS_PBRSB);
|
||||
}
|
||||
|
||||
if (!cpu_matches(cpu_vuln_whitelist, NO_MDS) &&
|
||||
!(ia32_cap & ARCH_CAP_MDS_NO)) {
|
||||
@@ -1196,11 +1204,6 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
|
||||
setup_force_cpu_bug(X86_BUG_RETBLEED);
|
||||
}
|
||||
|
||||
if (cpu_has(c, X86_FEATURE_IBRS_ENHANCED) &&
|
||||
!cpu_matches(cpu_vuln_whitelist, NO_EIBRS_PBRSB) &&
|
||||
!(ia32_cap & ARCH_CAP_PBRSB_NO))
|
||||
setup_force_cpu_bug(X86_BUG_EIBRS_PBRSB);
|
||||
|
||||
/*
|
||||
* Check if CPU is vulnerable to GDS. If running in a virtual machine on
|
||||
* an affected processor, the VMM may have disabled the use of GATHER by
|
||||
|
||||
+5
-18
@@ -26,31 +26,18 @@ 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 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) {
|
||||
if (info->direct_gbpages) {
|
||||
pud_t pudval;
|
||||
|
||||
if (pud_present(*pud))
|
||||
continue;
|
||||
|
||||
addr &= PUD_MASK;
|
||||
pudval = __pud((addr - info->offset) | info->page_flag);
|
||||
set_pud(pud, pudval);
|
||||
continue;
|
||||
|
||||
+36
-14
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "pat_internal.h"
|
||||
#include "mm_internal.h"
|
||||
#include "../../mm/internal.h" /* is_cow_mapping() */
|
||||
|
||||
#undef pr_fmt
|
||||
#define pr_fmt(fmt) "" fmt
|
||||
@@ -954,6 +955,38 @@ static void free_pfn_range(u64 paddr, unsigned long size)
|
||||
free_memtype(paddr, paddr + size);
|
||||
}
|
||||
|
||||
static int get_pat_info(struct vm_area_struct *vma, resource_size_t *paddr,
|
||||
pgprot_t *pgprot)
|
||||
{
|
||||
unsigned long prot;
|
||||
|
||||
VM_WARN_ON_ONCE(!(vma->vm_flags & VM_PAT));
|
||||
|
||||
/*
|
||||
* We need the starting PFN and cachemode used for track_pfn_remap()
|
||||
* that covered the whole VMA. For most mappings, we can obtain that
|
||||
* information from the page tables. For COW mappings, we might now
|
||||
* suddenly have anon folios mapped and follow_phys() will fail.
|
||||
*
|
||||
* Fallback to using vma->vm_pgoff, see remap_pfn_range_notrack(), to
|
||||
* detect the PFN. If we need the cachemode as well, we're out of luck
|
||||
* for now and have to fail fork().
|
||||
*/
|
||||
if (!follow_phys(vma, vma->vm_start, 0, &prot, paddr)) {
|
||||
if (pgprot)
|
||||
*pgprot = __pgprot(prot);
|
||||
return 0;
|
||||
}
|
||||
if (is_cow_mapping(vma->vm_flags)) {
|
||||
if (pgprot)
|
||||
return -EINVAL;
|
||||
*paddr = (resource_size_t)vma->vm_pgoff << PAGE_SHIFT;
|
||||
return 0;
|
||||
}
|
||||
WARN_ON_ONCE(1);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* track_pfn_copy is called when vma that is covering the pfnmap gets
|
||||
* copied through copy_page_range().
|
||||
@@ -964,20 +997,13 @@ static void free_pfn_range(u64 paddr, unsigned long size)
|
||||
int track_pfn_copy(struct vm_area_struct *vma)
|
||||
{
|
||||
resource_size_t paddr;
|
||||
unsigned long prot;
|
||||
unsigned long vma_size = vma->vm_end - vma->vm_start;
|
||||
pgprot_t pgprot;
|
||||
|
||||
if (vma->vm_flags & VM_PAT) {
|
||||
/*
|
||||
* reserve the whole chunk covered by vma. We need the
|
||||
* starting address and protection from pte.
|
||||
*/
|
||||
if (follow_phys(vma, vma->vm_start, 0, &prot, &paddr)) {
|
||||
WARN_ON_ONCE(1);
|
||||
if (get_pat_info(vma, &paddr, &pgprot))
|
||||
return -EINVAL;
|
||||
}
|
||||
pgprot = __pgprot(prot);
|
||||
/* reserve the whole chunk covered by vma. */
|
||||
return reserve_pfn_range(paddr, vma_size, &pgprot, 1);
|
||||
}
|
||||
|
||||
@@ -1052,7 +1078,6 @@ void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
|
||||
unsigned long size)
|
||||
{
|
||||
resource_size_t paddr;
|
||||
unsigned long prot;
|
||||
|
||||
if (vma && !(vma->vm_flags & VM_PAT))
|
||||
return;
|
||||
@@ -1060,11 +1085,8 @@ void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
|
||||
/* free the chunk starting from pfn or the whole chunk */
|
||||
paddr = (resource_size_t)pfn << PAGE_SHIFT;
|
||||
if (!paddr && !size) {
|
||||
if (follow_phys(vma, vma->vm_start, 0, &prot, &paddr)) {
|
||||
WARN_ON_ONCE(1);
|
||||
if (get_pat_info(vma, &paddr, NULL))
|
||||
return;
|
||||
}
|
||||
|
||||
size = vma->vm_end - vma->vm_start;
|
||||
}
|
||||
free_pfn_range(paddr, size);
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ void blk_rq_stat_init(struct blk_rq_stat *stat)
|
||||
/* src is a per-cpu stat, mean isn't initialized */
|
||||
void blk_rq_stat_sum(struct blk_rq_stat *dst, struct blk_rq_stat *src)
|
||||
{
|
||||
if (!src->nr_samples)
|
||||
if (dst->nr_samples + src->nr_samples <= dst->nr_samples)
|
||||
return;
|
||||
|
||||
dst->min = min(dst->min, src->min);
|
||||
|
||||
@@ -634,11 +634,6 @@ MODULE_PARM_DESC(mobile_lpm_policy, "Default LPM policy for mobile chipsets");
|
||||
static void ahci_pci_save_initial_config(struct pci_dev *pdev,
|
||||
struct ahci_host_priv *hpriv)
|
||||
{
|
||||
if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && pdev->device == 0x1166) {
|
||||
dev_info(&pdev->dev, "ASM1166 has only six ports\n");
|
||||
hpriv->saved_port_map = 0x3f;
|
||||
}
|
||||
|
||||
if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) {
|
||||
dev_info(&pdev->dev, "JMB361 has only one port\n");
|
||||
hpriv->force_port_map = 1;
|
||||
|
||||
+31
-32
@@ -796,37 +796,6 @@ static const struct ata_port_info mv_port_info[] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct pci_device_id mv_pci_tbl[] = {
|
||||
{ PCI_VDEVICE(MARVELL, 0x5040), chip_504x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
|
||||
{ PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
|
||||
/* RocketRAID 1720/174x have different identifiers */
|
||||
{ PCI_VDEVICE(TTI, 0x1720), chip_6042 },
|
||||
{ PCI_VDEVICE(TTI, 0x1740), chip_6042 },
|
||||
{ PCI_VDEVICE(TTI, 0x1742), chip_6042 },
|
||||
|
||||
{ PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x6042), chip_6042 },
|
||||
{ PCI_VDEVICE(MARVELL, 0x6080), chip_608x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x6081), chip_608x },
|
||||
|
||||
{ PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x },
|
||||
|
||||
/* Adaptec 1430SA */
|
||||
{ PCI_VDEVICE(ADAPTEC2, 0x0243), chip_7042 },
|
||||
|
||||
/* Marvell 7042 support */
|
||||
{ PCI_VDEVICE(MARVELL, 0x7042), chip_7042 },
|
||||
|
||||
/* Highpoint RocketRAID PCIe series */
|
||||
{ PCI_VDEVICE(TTI, 0x2300), chip_7042 },
|
||||
{ PCI_VDEVICE(TTI, 0x2310), chip_7042 },
|
||||
|
||||
{ } /* terminate list */
|
||||
};
|
||||
|
||||
static const struct mv_hw_ops mv5xxx_ops = {
|
||||
.phy_errata = mv5_phy_errata,
|
||||
.enable_leds = mv5_enable_leds,
|
||||
@@ -4320,6 +4289,36 @@ static int mv_pci_init_one(struct pci_dev *pdev,
|
||||
static int mv_pci_device_resume(struct pci_dev *pdev);
|
||||
#endif
|
||||
|
||||
static const struct pci_device_id mv_pci_tbl[] = {
|
||||
{ PCI_VDEVICE(MARVELL, 0x5040), chip_504x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x5041), chip_504x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x5080), chip_5080 },
|
||||
{ PCI_VDEVICE(MARVELL, 0x5081), chip_508x },
|
||||
/* RocketRAID 1720/174x have different identifiers */
|
||||
{ PCI_VDEVICE(TTI, 0x1720), chip_6042 },
|
||||
{ PCI_VDEVICE(TTI, 0x1740), chip_6042 },
|
||||
{ PCI_VDEVICE(TTI, 0x1742), chip_6042 },
|
||||
|
||||
{ PCI_VDEVICE(MARVELL, 0x6040), chip_604x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x6041), chip_604x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x6042), chip_6042 },
|
||||
{ PCI_VDEVICE(MARVELL, 0x6080), chip_608x },
|
||||
{ PCI_VDEVICE(MARVELL, 0x6081), chip_608x },
|
||||
|
||||
{ PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x },
|
||||
|
||||
/* Adaptec 1430SA */
|
||||
{ PCI_VDEVICE(ADAPTEC2, 0x0243), chip_7042 },
|
||||
|
||||
/* Marvell 7042 support */
|
||||
{ PCI_VDEVICE(MARVELL, 0x7042), chip_7042 },
|
||||
|
||||
/* Highpoint RocketRAID PCIe series */
|
||||
{ PCI_VDEVICE(TTI, 0x2300), chip_7042 },
|
||||
{ PCI_VDEVICE(TTI, 0x2310), chip_7042 },
|
||||
|
||||
{ } /* terminate list */
|
||||
};
|
||||
|
||||
static struct pci_driver mv_pci_driver = {
|
||||
.name = DRV_NAME,
|
||||
@@ -4332,6 +4331,7 @@ static struct pci_driver mv_pci_driver = {
|
||||
#endif
|
||||
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
|
||||
|
||||
/* move to PCI layer or libata core? */
|
||||
static int pci_go_64(struct pci_dev *pdev)
|
||||
@@ -4534,7 +4534,6 @@ static void __exit mv_exit(void)
|
||||
MODULE_AUTHOR("Brett Russ");
|
||||
MODULE_DESCRIPTION("SCSI low-level driver for Marvell SATA controllers");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_DEVICE_TABLE(pci, mv_pci_tbl);
|
||||
MODULE_VERSION(DRV_VERSION);
|
||||
MODULE_ALIAS("platform:" DRV_NAME);
|
||||
|
||||
|
||||
@@ -1020,8 +1020,7 @@ static void pdc20621_get_from_dimm(struct ata_host *host, void *psource,
|
||||
|
||||
offset -= (idx * window_size);
|
||||
idx++;
|
||||
dist = ((long) (window_size - (offset + size))) >= 0 ? size :
|
||||
(long) (window_size - offset);
|
||||
dist = min(size, window_size - offset);
|
||||
memcpy_fromio(psource, dimm_mmio + offset / 4, dist);
|
||||
|
||||
psource += dist;
|
||||
@@ -1069,8 +1068,7 @@ static void pdc20621_put_to_dimm(struct ata_host *host, void *psource,
|
||||
readl(mmio + PDC_DIMM_WINDOW_CTLR);
|
||||
offset -= (idx * window_size);
|
||||
idx++;
|
||||
dist = ((long)(s32)(window_size - (offset + size))) >= 0 ? size :
|
||||
(long) (window_size - offset);
|
||||
dist = min(size, window_size - offset);
|
||||
memcpy_toio(dimm_mmio + offset / 4, psource, dist);
|
||||
writel(0x01, mmio + PDC_GENERAL_CTLR);
|
||||
readl(mmio + PDC_GENERAL_CTLR);
|
||||
|
||||
@@ -376,8 +376,10 @@ void dev_pm_enable_wake_irq_complete(struct device *dev)
|
||||
return;
|
||||
|
||||
if (wirq->status & WAKE_IRQ_DEDICATED_MANAGED &&
|
||||
wirq->status & WAKE_IRQ_DEDICATED_REVERSE)
|
||||
wirq->status & WAKE_IRQ_DEDICATED_REVERSE) {
|
||||
enable_irq(wirq->irq);
|
||||
wirq->status |= WAKE_IRQ_DEDICATED_ENABLED;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -361,7 +361,7 @@ int btintel_read_version(struct hci_dev *hdev, struct intel_version *ver)
|
||||
return PTR_ERR(skb);
|
||||
}
|
||||
|
||||
if (skb->len != sizeof(*ver)) {
|
||||
if (!skb || skb->len != sizeof(*ver)) {
|
||||
bt_dev_err(hdev, "Intel version event size mismatch");
|
||||
kfree_skb(skb);
|
||||
return -EILSEQ;
|
||||
|
||||
@@ -980,6 +980,7 @@ static struct clk_rcg2 pcie0_axi_clk_src = {
|
||||
|
||||
static const struct freq_tbl ftbl_pcie_aux_clk_src[] = {
|
||||
F(19200000, P_XO, 1, 0, 0),
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct clk_rcg2 pcie0_aux_clk_src = {
|
||||
@@ -1085,6 +1086,7 @@ static const struct freq_tbl ftbl_sdcc_ice_core_clk_src[] = {
|
||||
F(19200000, P_XO, 1, 0, 0),
|
||||
F(160000000, P_GPLL0, 5, 0, 0),
|
||||
F(308570000, P_GPLL6, 3.5, 0, 0),
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct clk_rcg2 sdcc1_ice_core_clk_src = {
|
||||
|
||||
@@ -341,6 +341,7 @@ static struct freq_tbl ftbl_mmss_axi_clk[] = {
|
||||
F(333430000, P_MMPLL1, 3.5, 0, 0),
|
||||
F(400000000, P_MMPLL0, 2, 0, 0),
|
||||
F(466800000, P_MMPLL1, 2.5, 0, 0),
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct clk_rcg2 mmss_axi_clk_src = {
|
||||
@@ -365,6 +366,7 @@ static struct freq_tbl ftbl_ocmemnoc_clk[] = {
|
||||
F(150000000, P_GPLL0, 4, 0, 0),
|
||||
F(228570000, P_MMPLL0, 3.5, 0, 0),
|
||||
F(320000000, P_MMPLL0, 2.5, 0, 0),
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct clk_rcg2 ocmemnoc_clk_src = {
|
||||
|
||||
@@ -291,6 +291,7 @@ static struct freq_tbl ftbl_mmss_axi_clk[] = {
|
||||
F(291750000, P_MMPLL1, 4, 0, 0),
|
||||
F(400000000, P_MMPLL0, 2, 0, 0),
|
||||
F(466800000, P_MMPLL1, 2.5, 0, 0),
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct clk_rcg2 mmss_axi_clk_src = {
|
||||
@@ -315,6 +316,7 @@ static struct freq_tbl ftbl_ocmemnoc_clk[] = {
|
||||
F(150000000, P_GPLL0, 4, 0, 0),
|
||||
F(291750000, P_MMPLL1, 4, 0, 0),
|
||||
F(400000000, P_MMPLL0, 2, 0, 0),
|
||||
{ }
|
||||
};
|
||||
|
||||
static struct clk_rcg2 ocmemnoc_clk_src = {
|
||||
|
||||
@@ -139,18 +139,28 @@ static void adf_device_reset_worker(struct work_struct *work)
|
||||
if (adf_dev_init(accel_dev) || adf_dev_start(accel_dev)) {
|
||||
/* The device hanged and we can't restart it so stop here */
|
||||
dev_err(&GET_DEV(accel_dev), "Restart device failed\n");
|
||||
kfree(reset_data);
|
||||
if (reset_data->mode == ADF_DEV_RESET_ASYNC ||
|
||||
completion_done(&reset_data->compl))
|
||||
kfree(reset_data);
|
||||
WARN(1, "QAT: device restart failed. Device is unusable\n");
|
||||
return;
|
||||
}
|
||||
adf_dev_restarted_notify(accel_dev);
|
||||
clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status);
|
||||
|
||||
/* The dev is back alive. Notify the caller if in sync mode */
|
||||
if (reset_data->mode == ADF_DEV_RESET_SYNC)
|
||||
complete(&reset_data->compl);
|
||||
else
|
||||
/*
|
||||
* The dev is back alive. Notify the caller if in sync mode
|
||||
*
|
||||
* If device restart will take a more time than expected,
|
||||
* the schedule_reset() function can timeout and exit. This can be
|
||||
* detected by calling the completion_done() function. In this case
|
||||
* the reset_data structure needs to be freed here.
|
||||
*/
|
||||
if (reset_data->mode == ADF_DEV_RESET_ASYNC ||
|
||||
completion_done(&reset_data->compl))
|
||||
kfree(reset_data);
|
||||
else
|
||||
complete(&reset_data->compl);
|
||||
}
|
||||
|
||||
static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev,
|
||||
@@ -183,8 +193,9 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev,
|
||||
dev_err(&GET_DEV(accel_dev),
|
||||
"Reset device timeout expired\n");
|
||||
ret = -EFAULT;
|
||||
} else {
|
||||
kfree(reset_data);
|
||||
}
|
||||
kfree(reset_data);
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -440,7 +440,7 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *),
|
||||
void *data, bool duplicates, struct list_head *head)
|
||||
{
|
||||
const struct efivar_operations *ops;
|
||||
unsigned long variable_name_size = 1024;
|
||||
unsigned long variable_name_size = 512;
|
||||
efi_char16_t *variable_name;
|
||||
efi_status_t status;
|
||||
efi_guid_t vendor_guid;
|
||||
@@ -463,12 +463,13 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *),
|
||||
}
|
||||
|
||||
/*
|
||||
* Per EFI spec, the maximum storage allocated for both
|
||||
* the variable name and variable data is 1024 bytes.
|
||||
* A small set of old UEFI implementations reject sizes
|
||||
* above a certain threshold, the lowest seen in the wild
|
||||
* is 512.
|
||||
*/
|
||||
|
||||
do {
|
||||
variable_name_size = 1024;
|
||||
variable_name_size = 512;
|
||||
|
||||
status = ops->get_next_variable(&variable_name_size,
|
||||
variable_name,
|
||||
@@ -512,9 +513,13 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *),
|
||||
break;
|
||||
case EFI_NOT_FOUND:
|
||||
break;
|
||||
case EFI_BUFFER_TOO_SMALL:
|
||||
pr_warn("efivars: Variable name size exceeds maximum (%lu > 512)\n",
|
||||
variable_name_size);
|
||||
status = EFI_NOT_FOUND;
|
||||
break;
|
||||
default:
|
||||
printk(KERN_WARNING "efivars: get_next_variable: status=%lx\n",
|
||||
status);
|
||||
pr_warn("efivars: get_next_variable: status=%lx\n", status);
|
||||
status = EFI_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -923,8 +923,8 @@ static int kfd_ioctl_get_process_apertures_new(struct file *filp,
|
||||
* nodes, but not more than args->num_of_nodes as that is
|
||||
* the amount of memory allocated by user
|
||||
*/
|
||||
pa = kzalloc((sizeof(struct kfd_process_device_apertures) *
|
||||
args->num_of_nodes), GFP_KERNEL);
|
||||
pa = kcalloc(args->num_of_nodes, sizeof(struct kfd_process_device_apertures),
|
||||
GFP_KERNEL);
|
||||
if (!pa)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -51,10 +51,10 @@ void mod_stats_update_event(struct mod_stats *mod_stats,
|
||||
unsigned int length);
|
||||
|
||||
void mod_stats_update_flip(struct mod_stats *mod_stats,
|
||||
unsigned long timestamp_in_ns);
|
||||
unsigned long long timestamp_in_ns);
|
||||
|
||||
void mod_stats_update_vupdate(struct mod_stats *mod_stats,
|
||||
unsigned long timestamp_in_ns);
|
||||
unsigned long long timestamp_in_ns);
|
||||
|
||||
void mod_stats_update_freesync(struct mod_stats *mod_stats,
|
||||
unsigned int v_total_min,
|
||||
|
||||
@@ -72,14 +72,14 @@ static int imx_pd_connector_get_modes(struct drm_connector *connector)
|
||||
int ret;
|
||||
|
||||
if (!mode)
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
|
||||
ret = of_get_drm_display_mode(np, &imxpd->mode,
|
||||
&imxpd->bus_flags,
|
||||
OF_USE_NATIVE_MODE);
|
||||
if (ret) {
|
||||
drm_mode_destroy(connector->dev, mode);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_mode_copy(mode, &imxpd->mode);
|
||||
|
||||
@@ -276,7 +276,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)
|
||||
edid = drm_get_edid(connector, vc4->hdmi->ddc);
|
||||
cec_s_phys_addr_from_edid(vc4->hdmi->cec_adap, edid);
|
||||
if (!edid)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
|
||||
vc4_encoder->hdmi_monitor = drm_detect_hdmi_monitor(edid);
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ static void vkms_release(struct drm_device *dev)
|
||||
struct vkms_device *vkms = container_of(dev, struct vkms_device, drm);
|
||||
|
||||
platform_device_unregister(vkms->platform);
|
||||
drm_atomic_helper_shutdown(&vkms->drm);
|
||||
drm_mode_config_cleanup(&vkms->drm);
|
||||
drm_dev_fini(&vkms->drm);
|
||||
}
|
||||
@@ -137,6 +136,7 @@ static void __exit vkms_exit(void)
|
||||
}
|
||||
|
||||
drm_dev_unregister(&vkms_device->drm);
|
||||
drm_atomic_helper_shutdown(&vkms_device->drm);
|
||||
drm_dev_put(&vkms_device->drm);
|
||||
|
||||
kfree(vkms_device);
|
||||
|
||||
@@ -1003,10 +1003,21 @@ static const struct i2c_device_id amc6821_id[] = {
|
||||
|
||||
MODULE_DEVICE_TABLE(i2c, amc6821_id);
|
||||
|
||||
static const struct of_device_id __maybe_unused amc6821_of_match[] = {
|
||||
{
|
||||
.compatible = "ti,amc6821",
|
||||
.data = (void *)amc6821,
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(of, amc6821_of_match);
|
||||
|
||||
static struct i2c_driver amc6821_driver = {
|
||||
.class = I2C_CLASS_HWMON,
|
||||
.driver = {
|
||||
.name = "amc6821",
|
||||
.of_match_table = of_match_ptr(amc6821_of_match),
|
||||
},
|
||||
.probe = amc6821_probe,
|
||||
.id_table = amc6821_id,
|
||||
|
||||
@@ -1199,7 +1199,11 @@ static int rmi_driver_probe(struct device *dev)
|
||||
}
|
||||
rmi_driver_set_input_params(rmi_dev, data->input);
|
||||
data->input->phys = devm_kasprintf(dev, GFP_KERNEL,
|
||||
"%s/input0", dev_name(dev));
|
||||
"%s/input0", dev_name(dev));
|
||||
if (!data->input->phys) {
|
||||
retval = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
retval = rmi_init_functions(data);
|
||||
|
||||
@@ -4023,7 +4023,9 @@ static void raid_resume(struct dm_target *ti)
|
||||
* Take this opportunity to check whether any failed
|
||||
* devices are reachable again.
|
||||
*/
|
||||
mddev_lock_nointr(mddev);
|
||||
attempt_restore_of_faulty_devices(rs);
|
||||
mddev_unlock(mddev);
|
||||
}
|
||||
|
||||
if (test_and_clear_bit(RT_FLAG_RS_SUSPENDED, &rs->runtime_flags)) {
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
*/
|
||||
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/raid/pq.h>
|
||||
#include <linux/async_tx.h>
|
||||
@@ -6329,7 +6330,18 @@ static void raid5d(struct md_thread *thread)
|
||||
spin_unlock_irq(&conf->device_lock);
|
||||
md_check_recovery(mddev);
|
||||
spin_lock_irq(&conf->device_lock);
|
||||
|
||||
/*
|
||||
* Waiting on MD_SB_CHANGE_PENDING below may deadlock
|
||||
* seeing md_check_recovery() is needed to clear
|
||||
* the flag when using mdmon.
|
||||
*/
|
||||
continue;
|
||||
}
|
||||
|
||||
wait_event_lock_irq(mddev->sb_wait,
|
||||
!test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags),
|
||||
conf->device_lock);
|
||||
}
|
||||
pr_debug("%d stripes handled\n", handled);
|
||||
|
||||
|
||||
@@ -780,7 +780,7 @@ static const struct video_device video_dev_template = {
|
||||
/**
|
||||
* vip_irq - interrupt routine
|
||||
* @irq: Number of interrupt ( not used, correct number is assumed )
|
||||
* @vip: local data structure containing all information
|
||||
* @data: local data structure containing all information
|
||||
*
|
||||
* check for both frame interrupts set ( top and bottom ).
|
||||
* check FIFO overflow, but limit number of log messages after open.
|
||||
@@ -790,8 +790,9 @@ static const struct video_device video_dev_template = {
|
||||
*
|
||||
* IRQ_HANDLED, interrupt done.
|
||||
*/
|
||||
static irqreturn_t vip_irq(int irq, struct sta2x11_vip *vip)
|
||||
static irqreturn_t vip_irq(int irq, void *data)
|
||||
{
|
||||
struct sta2x11_vip *vip = data;
|
||||
unsigned int status;
|
||||
|
||||
status = reg_read(vip, DVP_ITS);
|
||||
@@ -1073,9 +1074,7 @@ static int sta2x11_vip_init_one(struct pci_dev *pdev,
|
||||
|
||||
spin_lock_init(&vip->slock);
|
||||
|
||||
ret = request_irq(pdev->irq,
|
||||
(irq_handler_t) vip_irq,
|
||||
IRQF_SHARED, KBUILD_MODNAME, vip);
|
||||
ret = request_irq(pdev->irq, vip_irq, IRQF_SHARED, KBUILD_MODNAME, vip);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "request_irq failed\n");
|
||||
ret = -ENODEV;
|
||||
|
||||
@@ -1527,10 +1527,10 @@ static int xc4000_get_frequency(struct dvb_frontend *fe, u32 *freq)
|
||||
{
|
||||
struct xc4000_priv *priv = fe->tuner_priv;
|
||||
|
||||
mutex_lock(&priv->lock);
|
||||
*freq = priv->freq_hz + priv->freq_offset;
|
||||
|
||||
if (debug) {
|
||||
mutex_lock(&priv->lock);
|
||||
if ((priv->cur_fw.type
|
||||
& (BASE | FM | DTV6 | DTV7 | DTV78 | DTV8)) == BASE) {
|
||||
u16 snr = 0;
|
||||
@@ -1541,8 +1541,8 @@ static int xc4000_get_frequency(struct dvb_frontend *fe, u32 *freq)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&priv->lock);
|
||||
}
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
dprintk(1, "%s()\n", __func__);
|
||||
|
||||
|
||||
@@ -242,7 +242,8 @@ static int dg_dispatch_as_host(u32 context_id, struct vmci_datagram *dg)
|
||||
|
||||
dg_info->in_dg_host_queue = true;
|
||||
dg_info->entry = dst_entry;
|
||||
memcpy(&dg_info->msg, dg, dg_size);
|
||||
dg_info->msg = *dg;
|
||||
memcpy(&dg_info->msg_payload, dg + 1, dg->payload_size);
|
||||
|
||||
INIT_WORK(&dg_info->work, dg_delayed_dispatch);
|
||||
schedule_work(&dg_info->work);
|
||||
@@ -385,7 +386,8 @@ int vmci_datagram_invoke_guest_handler(struct vmci_datagram *dg)
|
||||
|
||||
dg_info->in_dg_host_queue = false;
|
||||
dg_info->entry = dst_entry;
|
||||
memcpy(&dg_info->msg, dg, VMCI_DG_SIZE(dg));
|
||||
dg_info->msg = *dg;
|
||||
memcpy(&dg_info->msg_payload, dg + 1, dg->payload_size);
|
||||
|
||||
INIT_WORK(&dg_info->work, dg_delayed_dispatch);
|
||||
schedule_work(&dg_info->work);
|
||||
|
||||
@@ -852,10 +852,11 @@ static const struct block_device_operations mmc_bdops = {
|
||||
static int mmc_blk_part_switch_pre(struct mmc_card *card,
|
||||
unsigned int part_type)
|
||||
{
|
||||
const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_RPMB;
|
||||
const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_MASK;
|
||||
const unsigned int rpmb = EXT_CSD_PART_CONFIG_ACC_RPMB;
|
||||
int ret = 0;
|
||||
|
||||
if ((part_type & mask) == mask) {
|
||||
if ((part_type & mask) == rpmb) {
|
||||
if (card->ext_csd.cmdq_en) {
|
||||
ret = mmc_cmdq_disable(card);
|
||||
if (ret)
|
||||
@@ -870,10 +871,11 @@ static int mmc_blk_part_switch_pre(struct mmc_card *card,
|
||||
static int mmc_blk_part_switch_post(struct mmc_card *card,
|
||||
unsigned int part_type)
|
||||
{
|
||||
const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_RPMB;
|
||||
const unsigned int mask = EXT_CSD_PART_CONFIG_ACC_MASK;
|
||||
const unsigned int rpmb = EXT_CSD_PART_CONFIG_ACC_RPMB;
|
||||
int ret = 0;
|
||||
|
||||
if ((part_type & mask) == mask) {
|
||||
if ((part_type & mask) == rpmb) {
|
||||
mmc_retune_unpause(card->host);
|
||||
if (card->reenable_cmdq && !card->ext_csd.cmdq_en)
|
||||
ret = mmc_cmdq_enable(card);
|
||||
|
||||
@@ -213,6 +213,8 @@ static void tmio_mmc_reset_work(struct work_struct *work)
|
||||
else
|
||||
mrq->cmd->error = -ETIMEDOUT;
|
||||
|
||||
/* No new calls yet, but disallow concurrent tmio_mmc_done_work() */
|
||||
host->mrq = ERR_PTR(-EBUSY);
|
||||
host->cmd = NULL;
|
||||
host->data = NULL;
|
||||
|
||||
|
||||
@@ -95,9 +95,10 @@ size_t ubi_calc_fm_size(struct ubi_device *ubi)
|
||||
sizeof(struct ubi_fm_scan_pool) +
|
||||
sizeof(struct ubi_fm_scan_pool) +
|
||||
(ubi->peb_count * sizeof(struct ubi_fm_ec)) +
|
||||
(sizeof(struct ubi_fm_eba) +
|
||||
(ubi->peb_count * sizeof(__be32))) +
|
||||
sizeof(struct ubi_fm_volhdr) * UBI_MAX_VOLUMES;
|
||||
((sizeof(struct ubi_fm_eba) +
|
||||
sizeof(struct ubi_fm_volhdr)) *
|
||||
(UBI_MAX_VOLUMES + UBI_INT_VOL_COUNT)) +
|
||||
(ubi->peb_count * sizeof(__be32));
|
||||
return roundup(size, ubi->leb_size);
|
||||
}
|
||||
|
||||
|
||||
@@ -804,6 +804,12 @@ int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_attach_info *ai)
|
||||
* The number of supported volumes is limited by the eraseblock size
|
||||
* and by the UBI_MAX_VOLUMES constant.
|
||||
*/
|
||||
|
||||
if (ubi->leb_size < UBI_VTBL_RECORD_SIZE) {
|
||||
ubi_err(ubi, "LEB size too small for a volume record");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ubi->vtbl_slots = ubi->leb_size / UBI_VTBL_RECORD_SIZE;
|
||||
if (ubi->vtbl_slots > UBI_MAX_VOLUMES)
|
||||
ubi->vtbl_slots = UBI_MAX_VOLUMES;
|
||||
|
||||
@@ -1317,8 +1317,8 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
|
||||
{
|
||||
struct i40e_hw *hw = &pf->hw;
|
||||
struct i40e_vf *vf;
|
||||
int i, v;
|
||||
u32 reg;
|
||||
int i;
|
||||
|
||||
/* If we don't have any VFs, then there is nothing to reset */
|
||||
if (!pf->num_alloc_vfs)
|
||||
@@ -1329,11 +1329,10 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
|
||||
return false;
|
||||
|
||||
/* Begin reset on all VFs at once */
|
||||
for (v = 0; v < pf->num_alloc_vfs; v++) {
|
||||
vf = &pf->vf[v];
|
||||
for (vf = &pf->vf[0]; vf < &pf->vf[pf->num_alloc_vfs]; ++vf) {
|
||||
/* If VF is being reset no need to trigger reset again */
|
||||
if (!test_bit(I40E_VF_STATE_RESETTING, &vf->vf_states))
|
||||
i40e_trigger_vf_reset(&pf->vf[v], flr);
|
||||
i40e_trigger_vf_reset(vf, flr);
|
||||
}
|
||||
|
||||
/* HW requires some time to make sure it can flush the FIFO for a VF
|
||||
@@ -1342,14 +1341,13 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
|
||||
* the VFs using a simple iterator that increments once that VF has
|
||||
* finished resetting.
|
||||
*/
|
||||
for (i = 0, v = 0; i < 10 && v < pf->num_alloc_vfs; i++) {
|
||||
for (i = 0, vf = &pf->vf[0]; i < 10 && vf < &pf->vf[pf->num_alloc_vfs]; ++i) {
|
||||
usleep_range(10000, 20000);
|
||||
|
||||
/* Check each VF in sequence, beginning with the VF to fail
|
||||
* the previous check.
|
||||
*/
|
||||
while (v < pf->num_alloc_vfs) {
|
||||
vf = &pf->vf[v];
|
||||
while (vf < &pf->vf[pf->num_alloc_vfs]) {
|
||||
if (!test_bit(I40E_VF_STATE_RESETTING, &vf->vf_states)) {
|
||||
reg = rd32(hw, I40E_VPGEN_VFRSTAT(vf->vf_id));
|
||||
if (!(reg & I40E_VPGEN_VFRSTAT_VFRD_MASK))
|
||||
@@ -1359,7 +1357,7 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
|
||||
/* If the current VF has finished resetting, move on
|
||||
* to the next VF in sequence.
|
||||
*/
|
||||
v++;
|
||||
++vf;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1369,39 +1367,39 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
|
||||
/* Display a warning if at least one VF didn't manage to reset in
|
||||
* time, but continue on with the operation.
|
||||
*/
|
||||
if (v < pf->num_alloc_vfs)
|
||||
if (vf < &pf->vf[pf->num_alloc_vfs])
|
||||
dev_err(&pf->pdev->dev, "VF reset check timeout on VF %d\n",
|
||||
pf->vf[v].vf_id);
|
||||
vf->vf_id);
|
||||
usleep_range(10000, 20000);
|
||||
|
||||
/* Begin disabling all the rings associated with VFs, but do not wait
|
||||
* between each VF.
|
||||
*/
|
||||
for (v = 0; v < pf->num_alloc_vfs; v++) {
|
||||
for (vf = &pf->vf[0]; vf < &pf->vf[pf->num_alloc_vfs]; ++vf) {
|
||||
/* On initial reset, we don't have any queues to disable */
|
||||
if (pf->vf[v].lan_vsi_idx == 0)
|
||||
if (vf->lan_vsi_idx == 0)
|
||||
continue;
|
||||
|
||||
/* If VF is reset in another thread just continue */
|
||||
if (test_bit(I40E_VF_STATE_RESETTING, &vf->vf_states))
|
||||
continue;
|
||||
|
||||
i40e_vsi_stop_rings_no_wait(pf->vsi[pf->vf[v].lan_vsi_idx]);
|
||||
i40e_vsi_stop_rings_no_wait(pf->vsi[vf->lan_vsi_idx]);
|
||||
}
|
||||
|
||||
/* Now that we've notified HW to disable all of the VF rings, wait
|
||||
* until they finish.
|
||||
*/
|
||||
for (v = 0; v < pf->num_alloc_vfs; v++) {
|
||||
for (vf = &pf->vf[0]; vf < &pf->vf[pf->num_alloc_vfs]; ++vf) {
|
||||
/* On initial reset, we don't have any queues to disable */
|
||||
if (pf->vf[v].lan_vsi_idx == 0)
|
||||
if (vf->lan_vsi_idx == 0)
|
||||
continue;
|
||||
|
||||
/* If VF is reset in another thread just continue */
|
||||
if (test_bit(I40E_VF_STATE_RESETTING, &vf->vf_states))
|
||||
continue;
|
||||
|
||||
i40e_vsi_wait_queues_disabled(pf->vsi[pf->vf[v].lan_vsi_idx]);
|
||||
i40e_vsi_wait_queues_disabled(pf->vsi[vf->lan_vsi_idx]);
|
||||
}
|
||||
|
||||
/* Hw may need up to 50ms to finish disabling the RX queues. We
|
||||
@@ -1410,12 +1408,12 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
|
||||
mdelay(50);
|
||||
|
||||
/* Finish the reset on each VF */
|
||||
for (v = 0; v < pf->num_alloc_vfs; v++) {
|
||||
for (vf = &pf->vf[0]; vf < &pf->vf[pf->num_alloc_vfs]; ++vf) {
|
||||
/* If VF is reset in another thread just continue */
|
||||
if (test_bit(I40E_VF_STATE_RESETTING, &vf->vf_states))
|
||||
continue;
|
||||
|
||||
i40e_cleanup_reset_vf(&pf->vf[v]);
|
||||
i40e_cleanup_reset_vf(vf);
|
||||
}
|
||||
|
||||
i40e_flush(hw);
|
||||
|
||||
@@ -7303,6 +7303,15 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
|
||||
struct mii_bus *new_bus;
|
||||
int ret;
|
||||
|
||||
/* On some boards with this chip version the BIOS is buggy and misses
|
||||
* to reset the PHY page selector. This results in the PHY ID read
|
||||
* accessing registers on a different page, returning a more or
|
||||
* less random value. Fix this by resetting the page selector first.
|
||||
*/
|
||||
if (tp->mac_version == RTL_GIGA_MAC_VER_25 ||
|
||||
tp->mac_version == RTL_GIGA_MAC_VER_26)
|
||||
r8169_mdio_write(tp, 0x1f, 0);
|
||||
|
||||
new_bus = devm_mdiobus_alloc(&pdev->dev);
|
||||
if (!new_bus)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -84,19 +84,41 @@ static void dwmac4_rx_queue_priority(struct mac_device_info *hw,
|
||||
u32 prio, u32 queue)
|
||||
{
|
||||
void __iomem *ioaddr = hw->pcsr;
|
||||
u32 base_register;
|
||||
u32 value;
|
||||
u32 clear_mask = 0;
|
||||
u32 ctrl2, ctrl3;
|
||||
int i;
|
||||
|
||||
base_register = (queue < 4) ? GMAC_RXQ_CTRL2 : GMAC_RXQ_CTRL3;
|
||||
if (queue >= 4)
|
||||
ctrl2 = readl(ioaddr + GMAC_RXQ_CTRL2);
|
||||
ctrl3 = readl(ioaddr + GMAC_RXQ_CTRL3);
|
||||
|
||||
/* The software must ensure that the same priority
|
||||
* is not mapped to multiple Rx queues
|
||||
*/
|
||||
for (i = 0; i < 4; i++)
|
||||
clear_mask |= ((prio << GMAC_RXQCTRL_PSRQX_SHIFT(i)) &
|
||||
GMAC_RXQCTRL_PSRQX_MASK(i));
|
||||
|
||||
ctrl2 &= ~clear_mask;
|
||||
ctrl3 &= ~clear_mask;
|
||||
|
||||
/* First assign new priorities to a queue, then
|
||||
* clear them from others queues
|
||||
*/
|
||||
if (queue < 4) {
|
||||
ctrl2 |= (prio << GMAC_RXQCTRL_PSRQX_SHIFT(queue)) &
|
||||
GMAC_RXQCTRL_PSRQX_MASK(queue);
|
||||
|
||||
writel(ctrl2, ioaddr + GMAC_RXQ_CTRL2);
|
||||
writel(ctrl3, ioaddr + GMAC_RXQ_CTRL3);
|
||||
} else {
|
||||
queue -= 4;
|
||||
|
||||
value = readl(ioaddr + base_register);
|
||||
|
||||
value &= ~GMAC_RXQCTRL_PSRQX_MASK(queue);
|
||||
value |= (prio << GMAC_RXQCTRL_PSRQX_SHIFT(queue)) &
|
||||
ctrl3 |= (prio << GMAC_RXQCTRL_PSRQX_SHIFT(queue)) &
|
||||
GMAC_RXQCTRL_PSRQX_MASK(queue);
|
||||
writel(value, ioaddr + base_register);
|
||||
|
||||
writel(ctrl3, ioaddr + GMAC_RXQ_CTRL3);
|
||||
writel(ctrl2, ioaddr + GMAC_RXQ_CTRL2);
|
||||
}
|
||||
}
|
||||
|
||||
static void dwmac4_tx_queue_priority(struct mac_device_info *hw,
|
||||
|
||||
@@ -103,17 +103,41 @@ static void dwxgmac2_rx_queue_prio(struct mac_device_info *hw, u32 prio,
|
||||
u32 queue)
|
||||
{
|
||||
void __iomem *ioaddr = hw->pcsr;
|
||||
u32 value, reg;
|
||||
u32 clear_mask = 0;
|
||||
u32 ctrl2, ctrl3;
|
||||
int i;
|
||||
|
||||
reg = (queue < 4) ? XGMAC_RXQ_CTRL2 : XGMAC_RXQ_CTRL3;
|
||||
if (queue >= 4)
|
||||
ctrl2 = readl(ioaddr + XGMAC_RXQ_CTRL2);
|
||||
ctrl3 = readl(ioaddr + XGMAC_RXQ_CTRL3);
|
||||
|
||||
/* The software must ensure that the same priority
|
||||
* is not mapped to multiple Rx queues
|
||||
*/
|
||||
for (i = 0; i < 4; i++)
|
||||
clear_mask |= ((prio << XGMAC_PSRQ_SHIFT(i)) &
|
||||
XGMAC_PSRQ(i));
|
||||
|
||||
ctrl2 &= ~clear_mask;
|
||||
ctrl3 &= ~clear_mask;
|
||||
|
||||
/* First assign new priorities to a queue, then
|
||||
* clear them from others queues
|
||||
*/
|
||||
if (queue < 4) {
|
||||
ctrl2 |= (prio << XGMAC_PSRQ_SHIFT(queue)) &
|
||||
XGMAC_PSRQ(queue);
|
||||
|
||||
writel(ctrl2, ioaddr + XGMAC_RXQ_CTRL2);
|
||||
writel(ctrl3, ioaddr + XGMAC_RXQ_CTRL3);
|
||||
} else {
|
||||
queue -= 4;
|
||||
|
||||
value = readl(ioaddr + reg);
|
||||
value &= ~XGMAC_PSRQ(queue);
|
||||
value |= (prio << XGMAC_PSRQ_SHIFT(queue)) & XGMAC_PSRQ(queue);
|
||||
ctrl3 |= (prio << XGMAC_PSRQ_SHIFT(queue)) &
|
||||
XGMAC_PSRQ(queue);
|
||||
|
||||
writel(value, ioaddr + reg);
|
||||
writel(ctrl3, ioaddr + XGMAC_RXQ_CTRL3);
|
||||
writel(ctrl2, ioaddr + XGMAC_RXQ_CTRL2);
|
||||
}
|
||||
}
|
||||
|
||||
static void dwxgmac2_prog_mtl_rx_algorithms(struct mac_device_info *hw,
|
||||
|
||||
@@ -643,7 +643,7 @@ static void ath_ant_try_scan(struct ath_ant_comb *antcomb,
|
||||
conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA1;
|
||||
conf->alt_lna_conf = ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2;
|
||||
} else if (antcomb->rssi_sub >
|
||||
antcomb->rssi_lna1) {
|
||||
antcomb->rssi_lna2) {
|
||||
/* set to A-B */
|
||||
conf->main_lna_conf = ATH_ANT_DIV_COMB_LNA1;
|
||||
conf->alt_lna_conf = ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2;
|
||||
|
||||
@@ -690,8 +690,7 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
|
||||
scan_request = cfg->scan_request;
|
||||
cfg->scan_request = NULL;
|
||||
|
||||
if (timer_pending(&cfg->escan_timeout))
|
||||
del_timer_sync(&cfg->escan_timeout);
|
||||
timer_delete_sync(&cfg->escan_timeout);
|
||||
|
||||
if (fw_abort) {
|
||||
/* Do a scan abort to stop the driver's scan engine */
|
||||
@@ -7093,6 +7092,7 @@ void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg)
|
||||
wiphy_unregister(cfg->wiphy);
|
||||
kfree(cfg->ops);
|
||||
wl_deinit_priv(cfg);
|
||||
cancel_work_sync(&cfg->escan_timeout_work);
|
||||
brcmf_free_wiphy(cfg->wiphy);
|
||||
kfree(cfg);
|
||||
}
|
||||
@@ -439,16 +439,21 @@ static int pci_device_remove(struct device *dev)
|
||||
struct pci_dev *pci_dev = to_pci_dev(dev);
|
||||
struct pci_driver *drv = pci_dev->driver;
|
||||
|
||||
if (drv) {
|
||||
if (drv->remove) {
|
||||
pm_runtime_get_sync(dev);
|
||||
drv->remove(pci_dev);
|
||||
pm_runtime_put_noidle(dev);
|
||||
}
|
||||
pcibios_free_irq(pci_dev);
|
||||
pci_dev->driver = NULL;
|
||||
pci_iov_remove(pci_dev);
|
||||
if (drv->remove) {
|
||||
pm_runtime_get_sync(dev);
|
||||
/*
|
||||
* If the driver provides a .runtime_idle() callback and it has
|
||||
* started to run already, it may continue to run in parallel
|
||||
* with the code below, so wait until all of the runtime PM
|
||||
* activity has completed.
|
||||
*/
|
||||
pm_runtime_barrier(dev);
|
||||
drv->remove(pci_dev);
|
||||
pm_runtime_put_noidle(dev);
|
||||
}
|
||||
pcibios_free_irq(pci_dev);
|
||||
pci_dev->driver = NULL;
|
||||
pci_iov_remove(pci_dev);
|
||||
|
||||
/* Undo the runtime PM settings in local_pci_probe() */
|
||||
pm_runtime_put_sync(dev);
|
||||
|
||||
@@ -158,6 +158,7 @@ static inline struct zcrypt_queue *zcrypt_pick_queue(struct zcrypt_card *zc,
|
||||
{
|
||||
if (!zq || !try_module_get(zq->queue->ap_dev.drv->driver.owner))
|
||||
return NULL;
|
||||
zcrypt_card_get(zc);
|
||||
zcrypt_queue_get(zq);
|
||||
get_device(&zq->queue->ap_dev.device);
|
||||
atomic_add(weight, &zc->load);
|
||||
@@ -177,6 +178,7 @@ static inline void zcrypt_drop_queue(struct zcrypt_card *zc,
|
||||
atomic_sub(weight, &zq->load);
|
||||
put_device(&zq->queue->ap_dev.device);
|
||||
zcrypt_queue_put(zq);
|
||||
zcrypt_card_put(zc);
|
||||
module_put(mod);
|
||||
}
|
||||
|
||||
|
||||
@@ -601,8 +601,10 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
|
||||
/* Save the ELS cmd */
|
||||
elsiocb->drvrTimeout = cmd;
|
||||
|
||||
lpfc_sli4_resume_rpi(ndlp,
|
||||
lpfc_mbx_cmpl_resume_rpi, elsiocb);
|
||||
if (lpfc_sli4_resume_rpi(ndlp,
|
||||
lpfc_mbx_cmpl_resume_rpi,
|
||||
elsiocb))
|
||||
kfree(elsiocb);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1308,7 +1308,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba)
|
||||
wqe = &nvmewqe->wqe;
|
||||
|
||||
/* Initialize WQE */
|
||||
memset(wqe, 0, sizeof(union lpfc_wqe));
|
||||
memset(wqe, 0, sizeof(*wqe));
|
||||
|
||||
ctx_buf->iocbq->context1 = NULL;
|
||||
spin_lock(&phba->sli4_hba.sgl_list_lock);
|
||||
|
||||
@@ -1037,6 +1037,16 @@ void qlt_free_session_done(struct work_struct *work)
|
||||
"%s: sess %p logout completed\n", __func__, sess);
|
||||
}
|
||||
|
||||
/* check for any straggling io left behind */
|
||||
if (!(sess->flags & FCF_FCP2_DEVICE) &&
|
||||
qla2x00_eh_wait_for_pending_commands(sess->vha, sess->d_id.b24, 0, WAIT_TARGET)) {
|
||||
ql_log(ql_log_warn, vha, 0x3027,
|
||||
"IO not return. Resetting.\n");
|
||||
set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
|
||||
qla2xxx_wake_dpc(vha);
|
||||
qla2x00_wait_for_chip_reset(vha);
|
||||
}
|
||||
|
||||
if (sess->logo_ack_needed) {
|
||||
sess->logo_ack_needed = 0;
|
||||
qla24xx_async_notify_ack(vha, sess,
|
||||
|
||||
@@ -409,8 +409,8 @@ static int slim_device_alloc_laddr(struct slim_device *sbdev,
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
} else if (report_present) {
|
||||
ret = ida_simple_get(&ctrl->laddr_ida,
|
||||
0, SLIM_LA_MANAGER - 1, GFP_KERNEL);
|
||||
ret = ida_alloc_max(&ctrl->laddr_ida,
|
||||
SLIM_LA_MANAGER - 1, GFP_KERNEL);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
|
||||
@@ -976,7 +976,7 @@ struct qman_portal {
|
||||
/* linked-list of CSCN handlers. */
|
||||
struct list_head cgr_cbs;
|
||||
/* list lock */
|
||||
spinlock_t cgr_lock;
|
||||
raw_spinlock_t cgr_lock;
|
||||
struct work_struct congestion_work;
|
||||
struct work_struct mr_work;
|
||||
char irqname[MAX_IRQNAME];
|
||||
@@ -1194,7 +1194,7 @@ static int qman_create_portal(struct qman_portal *portal,
|
||||
/* if the given mask is NULL, assume all CGRs can be seen */
|
||||
qman_cgrs_fill(&portal->cgrs[0]);
|
||||
INIT_LIST_HEAD(&portal->cgr_cbs);
|
||||
spin_lock_init(&portal->cgr_lock);
|
||||
raw_spin_lock_init(&portal->cgr_lock);
|
||||
INIT_WORK(&portal->congestion_work, qm_congestion_task);
|
||||
INIT_WORK(&portal->mr_work, qm_mr_process_task);
|
||||
portal->bits = 0;
|
||||
@@ -1369,11 +1369,14 @@ static void qm_congestion_task(struct work_struct *work)
|
||||
union qm_mc_result *mcr;
|
||||
struct qman_cgr *cgr;
|
||||
|
||||
spin_lock(&p->cgr_lock);
|
||||
/*
|
||||
* FIXME: QM_MCR_TIMEOUT is 10ms, which is too long for a raw spinlock!
|
||||
*/
|
||||
raw_spin_lock_irq(&p->cgr_lock);
|
||||
qm_mc_start(&p->p);
|
||||
qm_mc_commit(&p->p, QM_MCC_VERB_QUERYCONGESTION);
|
||||
if (!qm_mc_result_timeout(&p->p, &mcr)) {
|
||||
spin_unlock(&p->cgr_lock);
|
||||
raw_spin_unlock_irq(&p->cgr_lock);
|
||||
dev_crit(p->config->dev, "QUERYCONGESTION timeout\n");
|
||||
qman_p_irqsource_add(p, QM_PIRQ_CSCI);
|
||||
return;
|
||||
@@ -1389,7 +1392,7 @@ static void qm_congestion_task(struct work_struct *work)
|
||||
list_for_each_entry(cgr, &p->cgr_cbs, node)
|
||||
if (cgr->cb && qman_cgrs_get(&c, cgr->cgrid))
|
||||
cgr->cb(p, cgr, qman_cgrs_get(&rr, cgr->cgrid));
|
||||
spin_unlock(&p->cgr_lock);
|
||||
raw_spin_unlock_irq(&p->cgr_lock);
|
||||
qman_p_irqsource_add(p, QM_PIRQ_CSCI);
|
||||
}
|
||||
|
||||
@@ -2346,7 +2349,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags,
|
||||
preempt_enable();
|
||||
|
||||
cgr->chan = p->config->channel;
|
||||
spin_lock(&p->cgr_lock);
|
||||
raw_spin_lock_irq(&p->cgr_lock);
|
||||
|
||||
if (opts) {
|
||||
struct qm_mcc_initcgr local_opts = *opts;
|
||||
@@ -2383,12 +2386,28 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags,
|
||||
qman_cgrs_get(&p->cgrs[1], cgr->cgrid))
|
||||
cgr->cb(p, cgr, 1);
|
||||
out:
|
||||
spin_unlock(&p->cgr_lock);
|
||||
raw_spin_unlock_irq(&p->cgr_lock);
|
||||
put_affine_portal();
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(qman_create_cgr);
|
||||
|
||||
static struct qman_portal *qman_cgr_get_affine_portal(struct qman_cgr *cgr)
|
||||
{
|
||||
struct qman_portal *p = get_affine_portal();
|
||||
|
||||
if (cgr->chan != p->config->channel) {
|
||||
/* attempt to delete from other portal than creator */
|
||||
dev_err(p->config->dev, "CGR not owned by current portal");
|
||||
dev_dbg(p->config->dev, " create 0x%x, delete 0x%x\n",
|
||||
cgr->chan, p->config->channel);
|
||||
put_affine_portal();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
int qman_delete_cgr(struct qman_cgr *cgr)
|
||||
{
|
||||
unsigned long irqflags;
|
||||
@@ -2396,19 +2415,13 @@ int qman_delete_cgr(struct qman_cgr *cgr)
|
||||
struct qm_mcc_initcgr local_opts;
|
||||
int ret = 0;
|
||||
struct qman_cgr *i;
|
||||
struct qman_portal *p = get_affine_portal();
|
||||
struct qman_portal *p = qman_cgr_get_affine_portal(cgr);
|
||||
|
||||
if (cgr->chan != p->config->channel) {
|
||||
/* attempt to delete from other portal than creator */
|
||||
dev_err(p->config->dev, "CGR not owned by current portal");
|
||||
dev_dbg(p->config->dev, " create 0x%x, delete 0x%x\n",
|
||||
cgr->chan, p->config->channel);
|
||||
if (!p)
|
||||
return -EINVAL;
|
||||
|
||||
ret = -EINVAL;
|
||||
goto put_portal;
|
||||
}
|
||||
memset(&local_opts, 0, sizeof(struct qm_mcc_initcgr));
|
||||
spin_lock_irqsave(&p->cgr_lock, irqflags);
|
||||
raw_spin_lock_irqsave(&p->cgr_lock, irqflags);
|
||||
list_del(&cgr->node);
|
||||
/*
|
||||
* If there are no other CGR objects for this CGRID in the list,
|
||||
@@ -2433,8 +2446,7 @@ int qman_delete_cgr(struct qman_cgr *cgr)
|
||||
/* add back to the list */
|
||||
list_add(&cgr->node, &p->cgr_cbs);
|
||||
release_lock:
|
||||
spin_unlock_irqrestore(&p->cgr_lock, irqflags);
|
||||
put_portal:
|
||||
raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags);
|
||||
put_affine_portal();
|
||||
return ret;
|
||||
}
|
||||
@@ -2465,6 +2477,54 @@ void qman_delete_cgr_safe(struct qman_cgr *cgr)
|
||||
}
|
||||
EXPORT_SYMBOL(qman_delete_cgr_safe);
|
||||
|
||||
static int qman_update_cgr(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts)
|
||||
{
|
||||
int ret;
|
||||
unsigned long irqflags;
|
||||
struct qman_portal *p = qman_cgr_get_affine_portal(cgr);
|
||||
|
||||
if (!p)
|
||||
return -EINVAL;
|
||||
|
||||
raw_spin_lock_irqsave(&p->cgr_lock, irqflags);
|
||||
ret = qm_modify_cgr(cgr, 0, opts);
|
||||
raw_spin_unlock_irqrestore(&p->cgr_lock, irqflags);
|
||||
put_affine_portal();
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct update_cgr_params {
|
||||
struct qman_cgr *cgr;
|
||||
struct qm_mcc_initcgr *opts;
|
||||
int ret;
|
||||
};
|
||||
|
||||
static void qman_update_cgr_smp_call(void *p)
|
||||
{
|
||||
struct update_cgr_params *params = p;
|
||||
|
||||
params->ret = qman_update_cgr(params->cgr, params->opts);
|
||||
}
|
||||
|
||||
int qman_update_cgr_safe(struct qman_cgr *cgr, struct qm_mcc_initcgr *opts)
|
||||
{
|
||||
struct update_cgr_params params = {
|
||||
.cgr = cgr,
|
||||
.opts = opts,
|
||||
};
|
||||
|
||||
preempt_disable();
|
||||
if (qman_cgr_cpus[cgr->cgrid] != smp_processor_id())
|
||||
smp_call_function_single(qman_cgr_cpus[cgr->cgrid],
|
||||
qman_update_cgr_smp_call, ¶ms,
|
||||
true);
|
||||
else
|
||||
params.ret = qman_update_cgr(cgr, opts);
|
||||
preempt_enable();
|
||||
return params.ret;
|
||||
}
|
||||
EXPORT_SYMBOL(qman_update_cgr_safe);
|
||||
|
||||
/* Cleanup FQs */
|
||||
|
||||
static int _qm_mr_consume_and_match_verb(struct qm_portal *p, int v)
|
||||
|
||||
@@ -87,6 +87,8 @@ struct waveform_private {
|
||||
struct comedi_device *dev; /* parent comedi device */
|
||||
u64 ao_last_scan_time; /* time of previous AO scan in usec */
|
||||
unsigned int ao_scan_period; /* AO scan period in usec */
|
||||
bool ai_timer_enable:1; /* should AI timer be running? */
|
||||
bool ao_timer_enable:1; /* should AO timer be running? */
|
||||
unsigned short ao_loopbacks[N_CHANS];
|
||||
};
|
||||
|
||||
@@ -236,8 +238,12 @@ static void waveform_ai_timer(struct timer_list *t)
|
||||
time_increment = devpriv->ai_convert_time - now;
|
||||
else
|
||||
time_increment = 1;
|
||||
mod_timer(&devpriv->ai_timer,
|
||||
jiffies + usecs_to_jiffies(time_increment));
|
||||
spin_lock(&dev->spinlock);
|
||||
if (devpriv->ai_timer_enable) {
|
||||
mod_timer(&devpriv->ai_timer,
|
||||
jiffies + usecs_to_jiffies(time_increment));
|
||||
}
|
||||
spin_unlock(&dev->spinlock);
|
||||
}
|
||||
|
||||
overrun:
|
||||
@@ -393,9 +399,12 @@ static int waveform_ai_cmd(struct comedi_device *dev,
|
||||
* Seem to need an extra jiffy here, otherwise timer expires slightly
|
||||
* early!
|
||||
*/
|
||||
spin_lock_bh(&dev->spinlock);
|
||||
devpriv->ai_timer_enable = true;
|
||||
devpriv->ai_timer.expires =
|
||||
jiffies + usecs_to_jiffies(devpriv->ai_convert_period) + 1;
|
||||
add_timer(&devpriv->ai_timer);
|
||||
spin_unlock_bh(&dev->spinlock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -404,6 +413,9 @@ static int waveform_ai_cancel(struct comedi_device *dev,
|
||||
{
|
||||
struct waveform_private *devpriv = dev->private;
|
||||
|
||||
spin_lock_bh(&dev->spinlock);
|
||||
devpriv->ai_timer_enable = false;
|
||||
spin_unlock_bh(&dev->spinlock);
|
||||
if (in_softirq()) {
|
||||
/* Assume we were called from the timer routine itself. */
|
||||
del_timer(&devpriv->ai_timer);
|
||||
@@ -495,8 +507,12 @@ static void waveform_ao_timer(struct timer_list *t)
|
||||
unsigned int time_inc = devpriv->ao_last_scan_time +
|
||||
devpriv->ao_scan_period - now;
|
||||
|
||||
mod_timer(&devpriv->ao_timer,
|
||||
jiffies + usecs_to_jiffies(time_inc));
|
||||
spin_lock(&dev->spinlock);
|
||||
if (devpriv->ao_timer_enable) {
|
||||
mod_timer(&devpriv->ao_timer,
|
||||
jiffies + usecs_to_jiffies(time_inc));
|
||||
}
|
||||
spin_unlock(&dev->spinlock);
|
||||
}
|
||||
|
||||
underrun:
|
||||
@@ -517,9 +533,12 @@ static int waveform_ao_inttrig_start(struct comedi_device *dev,
|
||||
async->inttrig = NULL;
|
||||
|
||||
devpriv->ao_last_scan_time = ktime_to_us(ktime_get());
|
||||
spin_lock_bh(&dev->spinlock);
|
||||
devpriv->ao_timer_enable = true;
|
||||
devpriv->ao_timer.expires =
|
||||
jiffies + usecs_to_jiffies(devpriv->ao_scan_period);
|
||||
add_timer(&devpriv->ao_timer);
|
||||
spin_unlock_bh(&dev->spinlock);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -604,6 +623,9 @@ static int waveform_ao_cancel(struct comedi_device *dev,
|
||||
struct waveform_private *devpriv = dev->private;
|
||||
|
||||
s->async->inttrig = NULL;
|
||||
spin_lock_bh(&dev->spinlock);
|
||||
devpriv->ao_timer_enable = false;
|
||||
spin_unlock_bh(&dev->spinlock);
|
||||
if (in_softirq()) {
|
||||
/* Assume we were called from the timer routine itself. */
|
||||
del_timer(&devpriv->ao_timer);
|
||||
|
||||
@@ -208,8 +208,10 @@ void spk_do_flush(void)
|
||||
wake_up_process(speakup_task);
|
||||
}
|
||||
|
||||
void synth_write(const char *buf, size_t count)
|
||||
void synth_write(const char *_buf, size_t count)
|
||||
{
|
||||
const unsigned char *buf = (const unsigned char *) _buf;
|
||||
|
||||
while (count--)
|
||||
synth_buffer_add(*buf++);
|
||||
synth_start();
|
||||
|
||||
@@ -31,8 +31,11 @@
|
||||
#define USE_VCHIQ_ARM
|
||||
#include "interface/vchi/vchi.h"
|
||||
|
||||
/* maximum number of components supported */
|
||||
#define VCHIQ_MMAL_MAX_COMPONENTS 4
|
||||
/*
|
||||
* maximum number of components supported.
|
||||
* This matches the maximum permitted by default on the VPU
|
||||
*/
|
||||
#define VCHIQ_MMAL_MAX_COMPONENTS 64
|
||||
|
||||
/*#define FULL_MSG_DUMP 1*/
|
||||
|
||||
@@ -165,8 +168,6 @@ struct vchiq_mmal_instance {
|
||||
/* protect accesses to context_map */
|
||||
struct mutex context_map_lock;
|
||||
|
||||
/* component to use next */
|
||||
int component_idx;
|
||||
struct vchiq_mmal_component component[VCHIQ_MMAL_MAX_COMPONENTS];
|
||||
};
|
||||
|
||||
@@ -845,9 +846,9 @@ static int port_info_get(struct vchiq_mmal_instance *instance,
|
||||
goto release_msg;
|
||||
|
||||
if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
|
||||
port->enabled = false;
|
||||
port->enabled = 0;
|
||||
else
|
||||
port->enabled = true;
|
||||
port->enabled = 1;
|
||||
|
||||
/* copy the values out of the message */
|
||||
port->handle = rmsg->u.port_info_get_reply.port_handle;
|
||||
@@ -919,9 +920,10 @@ static int create_component(struct vchiq_mmal_instance *instance,
|
||||
|
||||
/* build component create message */
|
||||
m.h.type = MMAL_MSG_TYPE_COMPONENT_CREATE;
|
||||
m.u.component_create.client_component = (u32)(unsigned long)component;
|
||||
strncpy(m.u.component_create.name, name,
|
||||
sizeof(m.u.component_create.name));
|
||||
m.u.component_create.client_component = component->client_component;
|
||||
strscpy_pad(m.u.component_create.name, name,
|
||||
sizeof(m.u.component_create.name));
|
||||
m.u.component_create.pid = 0;
|
||||
|
||||
ret = send_synchronous_mmal_msg(instance, &m,
|
||||
sizeof(m.u.component_create),
|
||||
@@ -1283,7 +1285,7 @@ static int port_disable(struct vchiq_mmal_instance *instance,
|
||||
if (!port->enabled)
|
||||
return 0;
|
||||
|
||||
port->enabled = false;
|
||||
port->enabled = 0;
|
||||
|
||||
ret = port_action_port(instance, port,
|
||||
MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
|
||||
@@ -1335,7 +1337,7 @@ static int port_enable(struct vchiq_mmal_instance *instance,
|
||||
if (ret)
|
||||
goto done;
|
||||
|
||||
port->enabled = true;
|
||||
port->enabled = 1;
|
||||
|
||||
if (port->buffer_cb) {
|
||||
/* send buffer headers to videocore */
|
||||
@@ -1502,7 +1504,7 @@ int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,
|
||||
pr_err("failed disconnecting src port\n");
|
||||
goto release_unlock;
|
||||
}
|
||||
src->connected->enabled = false;
|
||||
src->connected->enabled = 0;
|
||||
src->connected = NULL;
|
||||
}
|
||||
|
||||
@@ -1607,17 +1609,29 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
|
||||
{
|
||||
int ret;
|
||||
int idx; /* port index */
|
||||
struct vchiq_mmal_component *component;
|
||||
struct vchiq_mmal_component *component = NULL;
|
||||
|
||||
if (mutex_lock_interruptible(&instance->vchiq_mutex))
|
||||
return -EINTR;
|
||||
|
||||
if (instance->component_idx == VCHIQ_MMAL_MAX_COMPONENTS) {
|
||||
for (idx = 0; idx < VCHIQ_MMAL_MAX_COMPONENTS; idx++) {
|
||||
if (!instance->component[idx].in_use) {
|
||||
component = &instance->component[idx];
|
||||
component->in_use = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!component) {
|
||||
ret = -EINVAL; /* todo is this correct error? */
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
component = &instance->component[instance->component_idx];
|
||||
/* We need a handle to reference back to our component structure.
|
||||
* Use the array index in instance->component rather than rolling
|
||||
* another IDR.
|
||||
*/
|
||||
component->client_component = idx;
|
||||
|
||||
ret = create_component(instance, component, name);
|
||||
if (ret < 0)
|
||||
@@ -1666,8 +1680,6 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
|
||||
goto release_component;
|
||||
}
|
||||
|
||||
instance->component_idx++;
|
||||
|
||||
*component_out = component;
|
||||
|
||||
mutex_unlock(&instance->vchiq_mutex);
|
||||
@@ -1677,6 +1689,8 @@ int vchiq_mmal_component_init(struct vchiq_mmal_instance *instance,
|
||||
release_component:
|
||||
destroy_component(instance, component);
|
||||
unlock:
|
||||
if (component)
|
||||
component->in_use = 0;
|
||||
mutex_unlock(&instance->vchiq_mutex);
|
||||
|
||||
return ret;
|
||||
@@ -1698,6 +1712,8 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
|
||||
|
||||
ret = destroy_component(instance, component);
|
||||
|
||||
component->in_use = 0;
|
||||
|
||||
mutex_unlock(&instance->vchiq_mutex);
|
||||
|
||||
return ret;
|
||||
@@ -1746,7 +1762,7 @@ int vchiq_mmal_component_disable(struct vchiq_mmal_instance *instance,
|
||||
|
||||
ret = disable_component(instance, component);
|
||||
if (ret == 0)
|
||||
component->enabled = false;
|
||||
component->enabled = 0;
|
||||
|
||||
mutex_unlock(&instance->vchiq_mutex);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ typedef void (*vchiq_mmal_buffer_cb)(
|
||||
unsigned long length, u32 mmal_flags, s64 dts, s64 pts);
|
||||
|
||||
struct vchiq_mmal_port {
|
||||
bool enabled;
|
||||
u32 enabled:1;
|
||||
u32 handle;
|
||||
u32 type; /* port type, cached to use on port info set */
|
||||
u32 index; /* port index, cached to use on port info set */
|
||||
@@ -81,7 +81,8 @@ struct vchiq_mmal_port {
|
||||
};
|
||||
|
||||
struct vchiq_mmal_component {
|
||||
bool enabled;
|
||||
u32 in_use:1;
|
||||
u32 enabled:1;
|
||||
u32 handle; /* VideoCore handle for component */
|
||||
u32 inputs; /* Number of input ports */
|
||||
u32 outputs; /* Number of output ports */
|
||||
@@ -90,6 +91,7 @@ struct vchiq_mmal_component {
|
||||
struct vchiq_mmal_port input[MAX_PORT_COUNT]; /* input ports */
|
||||
struct vchiq_mmal_port output[MAX_PORT_COUNT]; /* output ports */
|
||||
struct vchiq_mmal_port clock[MAX_PORT_COUNT]; /* clock ports */
|
||||
u32 client_component; /* Used to ref back to client struct */
|
||||
};
|
||||
|
||||
int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance);
|
||||
|
||||
@@ -2435,6 +2435,9 @@ static int gsmld_open(struct tty_struct *tty)
|
||||
struct gsm_mux *gsm;
|
||||
int ret;
|
||||
|
||||
if (!capable(CAP_NET_ADMIN))
|
||||
return -EPERM;
|
||||
|
||||
if (tty->ops->write == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
@@ -1753,9 +1753,12 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
|
||||
UARTCTRL);
|
||||
|
||||
lpuart32_serial_setbrg(sport, baud);
|
||||
lpuart32_write(&sport->port, modem, UARTMODIR);
|
||||
lpuart32_write(&sport->port, ctrl, UARTCTRL);
|
||||
/* disable CTS before enabling UARTCTRL_TE to avoid pending idle preamble */
|
||||
lpuart32_write(&sport->port, modem & ~UARTMODIR_TXCTSE, UARTMODIR);
|
||||
/* restore control register */
|
||||
lpuart32_write(&sport->port, ctrl, UARTCTRL);
|
||||
/* re-enable the CTS if needed */
|
||||
lpuart32_write(&sport->port, modem, UARTMODIR);
|
||||
|
||||
spin_unlock_irqrestore(&sport->port.lock, flags);
|
||||
}
|
||||
|
||||
+2
-2
@@ -405,7 +405,7 @@ static void vc_uniscr_delete(struct vc_data *vc, unsigned int nr)
|
||||
char32_t *ln = uniscr->lines[vc->vc_y];
|
||||
unsigned int x = vc->vc_x, cols = vc->vc_cols;
|
||||
|
||||
memcpy(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
|
||||
memmove(&ln[x], &ln[x + nr], (cols - x - nr) * sizeof(*ln));
|
||||
memset32(&ln[cols - nr], ' ', nr);
|
||||
}
|
||||
}
|
||||
@@ -855,7 +855,7 @@ static void delete_char(struct vc_data *vc, unsigned int nr)
|
||||
unsigned short *p = (unsigned short *) vc->vc_pos;
|
||||
|
||||
vc_uniscr_delete(vc, nr);
|
||||
scr_memcpyw(p, p + nr, (vc->vc_cols - vc->vc_x - nr) * 2);
|
||||
scr_memmovew(p, p + nr, (vc->vc_cols - vc->vc_x - nr) * 2);
|
||||
scr_memsetw(p + vc->vc_cols - vc->vc_x - nr, vc->vc_video_erase_char,
|
||||
nr * 2);
|
||||
vc->vc_need_wrap = 0;
|
||||
|
||||
@@ -471,6 +471,7 @@ out_free_mem:
|
||||
static int service_outstanding_interrupt(struct wdm_device *desc)
|
||||
{
|
||||
int rv = 0;
|
||||
int used;
|
||||
|
||||
/* submit read urb only if the device is waiting for it */
|
||||
if (!desc->resp_count || !--desc->resp_count)
|
||||
@@ -485,7 +486,10 @@ static int service_outstanding_interrupt(struct wdm_device *desc)
|
||||
goto out;
|
||||
}
|
||||
|
||||
set_bit(WDM_RESPONDING, &desc->flags);
|
||||
used = test_and_set_bit(WDM_RESPONDING, &desc->flags);
|
||||
if (used)
|
||||
goto out;
|
||||
|
||||
spin_unlock_irq(&desc->iuspin);
|
||||
rv = usb_submit_urb(desc->response, GFP_KERNEL);
|
||||
spin_lock_irq(&desc->iuspin);
|
||||
|
||||
@@ -431,7 +431,7 @@ static int match_location(struct usb_device *peer_hdev, void *p)
|
||||
struct usb_hub *peer_hub = usb_hub_to_struct_hub(peer_hdev);
|
||||
struct usb_device *hdev = to_usb_device(port_dev->dev.parent->parent);
|
||||
|
||||
if (!peer_hub)
|
||||
if (!peer_hub || port_dev->connect_type == USB_PORT_NOT_USED)
|
||||
return 0;
|
||||
|
||||
hcd = bus_to_hcd(hdev->bus);
|
||||
@@ -442,7 +442,8 @@ static int match_location(struct usb_device *peer_hdev, void *p)
|
||||
|
||||
for (port1 = 1; port1 <= peer_hdev->maxchild; port1++) {
|
||||
peer = peer_hub->ports[port1 - 1];
|
||||
if (peer && peer->location == port_dev->location) {
|
||||
if (peer && peer->connect_type != USB_PORT_NOT_USED &&
|
||||
peer->location == port_dev->location) {
|
||||
link_peers_report(port_dev, peer);
|
||||
return 1; /* done */
|
||||
}
|
||||
|
||||
@@ -1069,14 +1069,24 @@ static ssize_t interface_authorized_store(struct device *dev,
|
||||
{
|
||||
struct usb_interface *intf = to_usb_interface(dev);
|
||||
bool val;
|
||||
struct kernfs_node *kn;
|
||||
|
||||
if (strtobool(buf, &val) != 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (val)
|
||||
if (val) {
|
||||
usb_authorize_interface(intf);
|
||||
else
|
||||
usb_deauthorize_interface(intf);
|
||||
} else {
|
||||
/*
|
||||
* Prevent deadlock if another process is concurrently
|
||||
* trying to unregister intf.
|
||||
*/
|
||||
kn = sysfs_break_active_protection(&dev->kobj, &attr->attr);
|
||||
if (kn) {
|
||||
usb_deauthorize_interface(intf);
|
||||
sysfs_unbreak_active_protection(kn);
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -716,8 +716,14 @@ struct dwc2_dregs_backup {
|
||||
* struct dwc2_hregs_backup - Holds host registers state before
|
||||
* entering partial power down
|
||||
* @hcfg: Backup of HCFG register
|
||||
* @hflbaddr: Backup of HFLBADDR register
|
||||
* @haintmsk: Backup of HAINTMSK register
|
||||
* @hcchar: Backup of HCCHAR register
|
||||
* @hcsplt: Backup of HCSPLT register
|
||||
* @hcintmsk: Backup of HCINTMSK register
|
||||
* @hctsiz: Backup of HCTSIZ register
|
||||
* @hdma: Backup of HCDMA register
|
||||
* @hcdmab: Backup of HCDMAB register
|
||||
* @hprt0: Backup of HPTR0 register
|
||||
* @hfir: Backup of HFIR register
|
||||
* @hptxfsiz: Backup of HPTXFSIZ register
|
||||
@@ -725,8 +731,14 @@ struct dwc2_dregs_backup {
|
||||
*/
|
||||
struct dwc2_hregs_backup {
|
||||
u32 hcfg;
|
||||
u32 hflbaddr;
|
||||
u32 haintmsk;
|
||||
u32 hcchar[MAX_EPS_CHANNELS];
|
||||
u32 hcsplt[MAX_EPS_CHANNELS];
|
||||
u32 hcintmsk[MAX_EPS_CHANNELS];
|
||||
u32 hctsiz[MAX_EPS_CHANNELS];
|
||||
u32 hcidma[MAX_EPS_CHANNELS];
|
||||
u32 hcidmab[MAX_EPS_CHANNELS];
|
||||
u32 hprt0;
|
||||
u32 hfir;
|
||||
u32 hptxfsiz;
|
||||
@@ -1052,6 +1064,7 @@ struct dwc2_hsotg {
|
||||
bool needs_byte_swap;
|
||||
|
||||
/* DWC OTG HW Release versions */
|
||||
#define DWC2_CORE_REV_4_30a 0x4f54430a
|
||||
#define DWC2_CORE_REV_2_71a 0x4f54271a
|
||||
#define DWC2_CORE_REV_2_72a 0x4f54272a
|
||||
#define DWC2_CORE_REV_2_80a 0x4f54280a
|
||||
@@ -1282,6 +1295,7 @@ int dwc2_backup_global_registers(struct dwc2_hsotg *hsotg);
|
||||
int dwc2_restore_global_registers(struct dwc2_hsotg *hsotg);
|
||||
|
||||
void dwc2_enable_acg(struct dwc2_hsotg *hsotg);
|
||||
void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg, bool remotewakeup);
|
||||
|
||||
/* This function should be called on every hardware interrupt. */
|
||||
irqreturn_t dwc2_handle_common_intr(int irq, void *dev);
|
||||
|
||||
@@ -349,10 +349,11 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
|
||||
* @hsotg: Programming view of DWC_otg controller
|
||||
*
|
||||
*/
|
||||
static void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg)
|
||||
void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg, bool remotewakeup)
|
||||
{
|
||||
u32 glpmcfg;
|
||||
u32 i = 0;
|
||||
u32 pcgctl;
|
||||
u32 dctl;
|
||||
|
||||
if (hsotg->lx_state != DWC2_L1) {
|
||||
dev_err(hsotg->dev, "Core isn't in DWC2_L1 state\n");
|
||||
@@ -361,37 +362,57 @@ static void dwc2_wakeup_from_lpm_l1(struct dwc2_hsotg *hsotg)
|
||||
|
||||
glpmcfg = dwc2_readl(hsotg, GLPMCFG);
|
||||
if (dwc2_is_device_mode(hsotg)) {
|
||||
dev_dbg(hsotg->dev, "Exit from L1 state\n");
|
||||
dev_dbg(hsotg->dev, "Exit from L1 state, remotewakeup=%d\n", remotewakeup);
|
||||
glpmcfg &= ~GLPMCFG_ENBLSLPM;
|
||||
glpmcfg &= ~GLPMCFG_HIRD_THRES_EN;
|
||||
glpmcfg &= ~GLPMCFG_HIRD_THRES_MASK;
|
||||
dwc2_writel(hsotg, glpmcfg, GLPMCFG);
|
||||
|
||||
do {
|
||||
glpmcfg = dwc2_readl(hsotg, GLPMCFG);
|
||||
pcgctl = dwc2_readl(hsotg, PCGCTL);
|
||||
pcgctl &= ~PCGCTL_ENBL_SLEEP_GATING;
|
||||
dwc2_writel(hsotg, pcgctl, PCGCTL);
|
||||
|
||||
if (!(glpmcfg & (GLPMCFG_COREL1RES_MASK |
|
||||
GLPMCFG_L1RESUMEOK | GLPMCFG_SLPSTS)))
|
||||
break;
|
||||
glpmcfg = dwc2_readl(hsotg, GLPMCFG);
|
||||
if (glpmcfg & GLPMCFG_ENBESL) {
|
||||
glpmcfg |= GLPMCFG_RSTRSLPSTS;
|
||||
dwc2_writel(hsotg, glpmcfg, GLPMCFG);
|
||||
}
|
||||
|
||||
udelay(1);
|
||||
} while (++i < 200);
|
||||
if (remotewakeup) {
|
||||
if (dwc2_hsotg_wait_bit_set(hsotg, GLPMCFG, GLPMCFG_L1RESUMEOK, 1000)) {
|
||||
dev_warn(hsotg->dev, "%s: timeout GLPMCFG_L1RESUMEOK\n", __func__);
|
||||
goto fail;
|
||||
return;
|
||||
}
|
||||
|
||||
if (i == 200) {
|
||||
dev_err(hsotg->dev, "Failed to exit L1 sleep state in 200us.\n");
|
||||
dctl = dwc2_readl(hsotg, DCTL);
|
||||
dctl |= DCTL_RMTWKUPSIG;
|
||||
dwc2_writel(hsotg, dctl, DCTL);
|
||||
|
||||
if (dwc2_hsotg_wait_bit_set(hsotg, GINTSTS, GINTSTS_WKUPINT, 1000)) {
|
||||
dev_warn(hsotg->dev, "%s: timeout GINTSTS_WKUPINT\n", __func__);
|
||||
goto fail;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
glpmcfg = dwc2_readl(hsotg, GLPMCFG);
|
||||
if (glpmcfg & GLPMCFG_COREL1RES_MASK || glpmcfg & GLPMCFG_SLPSTS ||
|
||||
glpmcfg & GLPMCFG_L1RESUMEOK) {
|
||||
goto fail;
|
||||
return;
|
||||
}
|
||||
dwc2_gadget_init_lpm(hsotg);
|
||||
|
||||
/* Inform gadget to exit from L1 */
|
||||
call_gadget(hsotg, resume);
|
||||
/* Change to L0 state */
|
||||
hsotg->lx_state = DWC2_L0;
|
||||
hsotg->bus_suspended = false;
|
||||
fail: dwc2_gadget_init_lpm(hsotg);
|
||||
} else {
|
||||
/* TODO */
|
||||
dev_err(hsotg->dev, "Host side LPM is not supported.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Change to L0 state */
|
||||
hsotg->lx_state = DWC2_L0;
|
||||
|
||||
/* Inform gadget to exit from L1 */
|
||||
call_gadget(hsotg, resume);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -412,7 +433,7 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg)
|
||||
dev_dbg(hsotg->dev, "%s lxstate = %d\n", __func__, hsotg->lx_state);
|
||||
|
||||
if (hsotg->lx_state == DWC2_L1) {
|
||||
dwc2_wakeup_from_lpm_l1(hsotg);
|
||||
dwc2_wakeup_from_lpm_l1(hsotg, false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1308,6 +1308,10 @@ static int dwc2_hsotg_ep_queue(struct usb_ep *ep, struct usb_request *req,
|
||||
ep->name, req, req->length, req->buf, req->no_interrupt,
|
||||
req->zero, req->short_not_ok);
|
||||
|
||||
if (hs->lx_state == DWC2_L1) {
|
||||
dwc2_wakeup_from_lpm_l1(hs, true);
|
||||
}
|
||||
|
||||
/* Prevent new request submission when controller is suspended */
|
||||
if (hs->lx_state != DWC2_L0) {
|
||||
dev_dbg(hs->dev, "%s: submit request only in active state\n",
|
||||
|
||||
+39
-8
@@ -2929,8 +2929,11 @@ enum dwc2_transaction_type dwc2_hcd_select_transactions(
|
||||
hsotg->available_host_channels--;
|
||||
}
|
||||
qh = list_entry(qh_ptr, struct dwc2_qh, qh_list_entry);
|
||||
if (dwc2_assign_and_init_hc(hsotg, qh))
|
||||
if (dwc2_assign_and_init_hc(hsotg, qh)) {
|
||||
if (hsotg->params.uframe_sched)
|
||||
hsotg->available_host_channels++;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Move the QH from the periodic ready schedule to the
|
||||
@@ -2963,8 +2966,11 @@ enum dwc2_transaction_type dwc2_hcd_select_transactions(
|
||||
hsotg->available_host_channels--;
|
||||
}
|
||||
|
||||
if (dwc2_assign_and_init_hc(hsotg, qh))
|
||||
if (dwc2_assign_and_init_hc(hsotg, qh)) {
|
||||
if (hsotg->params.uframe_sched)
|
||||
hsotg->available_host_channels++;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Move the QH from the non-periodic inactive schedule to the
|
||||
@@ -4320,6 +4326,8 @@ void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd,
|
||||
urb->actual_length);
|
||||
|
||||
if (usb_pipetype(urb->pipe) == PIPE_ISOCHRONOUS) {
|
||||
if (!hsotg->params.dma_desc_enable)
|
||||
urb->start_frame = qtd->qh->start_active_frame;
|
||||
urb->error_count = dwc2_hcd_urb_get_error_count(qtd->urb);
|
||||
for (i = 0; i < urb->number_of_packets; ++i) {
|
||||
urb->iso_frame_desc[i].actual_length =
|
||||
@@ -5480,9 +5488,16 @@ int dwc2_backup_host_registers(struct dwc2_hsotg *hsotg)
|
||||
/* Backup Host regs */
|
||||
hr = &hsotg->hr_backup;
|
||||
hr->hcfg = dwc2_readl(hsotg, HCFG);
|
||||
hr->hflbaddr = dwc2_readl(hsotg, HFLBADDR);
|
||||
hr->haintmsk = dwc2_readl(hsotg, HAINTMSK);
|
||||
for (i = 0; i < hsotg->params.host_channels; ++i)
|
||||
for (i = 0; i < hsotg->params.host_channels; ++i) {
|
||||
hr->hcchar[i] = dwc2_readl(hsotg, HCCHAR(i));
|
||||
hr->hcsplt[i] = dwc2_readl(hsotg, HCSPLT(i));
|
||||
hr->hcintmsk[i] = dwc2_readl(hsotg, HCINTMSK(i));
|
||||
hr->hctsiz[i] = dwc2_readl(hsotg, HCTSIZ(i));
|
||||
hr->hcidma[i] = dwc2_readl(hsotg, HCDMA(i));
|
||||
hr->hcidmab[i] = dwc2_readl(hsotg, HCDMAB(i));
|
||||
}
|
||||
|
||||
hr->hprt0 = dwc2_read_hprt0(hsotg);
|
||||
hr->hfir = dwc2_readl(hsotg, HFIR);
|
||||
@@ -5516,10 +5531,17 @@ int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg)
|
||||
hr->valid = false;
|
||||
|
||||
dwc2_writel(hsotg, hr->hcfg, HCFG);
|
||||
dwc2_writel(hsotg, hr->hflbaddr, HFLBADDR);
|
||||
dwc2_writel(hsotg, hr->haintmsk, HAINTMSK);
|
||||
|
||||
for (i = 0; i < hsotg->params.host_channels; ++i)
|
||||
for (i = 0; i < hsotg->params.host_channels; ++i) {
|
||||
dwc2_writel(hsotg, hr->hcchar[i], HCCHAR(i));
|
||||
dwc2_writel(hsotg, hr->hcsplt[i], HCSPLT(i));
|
||||
dwc2_writel(hsotg, hr->hcintmsk[i], HCINTMSK(i));
|
||||
dwc2_writel(hsotg, hr->hctsiz[i], HCTSIZ(i));
|
||||
dwc2_writel(hsotg, hr->hcidma[i], HCDMA(i));
|
||||
dwc2_writel(hsotg, hr->hcidmab[i], HCDMAB(i));
|
||||
}
|
||||
|
||||
dwc2_writel(hsotg, hr->hprt0, HPRT0);
|
||||
dwc2_writel(hsotg, hr->hfir, HFIR);
|
||||
@@ -5684,10 +5706,12 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup,
|
||||
dwc2_writel(hsotg, hr->hcfg, HCFG);
|
||||
|
||||
/* De-assert Wakeup Logic */
|
||||
gpwrdn = dwc2_readl(hsotg, GPWRDN);
|
||||
gpwrdn &= ~GPWRDN_PMUACTV;
|
||||
dwc2_writel(hsotg, gpwrdn, GPWRDN);
|
||||
udelay(10);
|
||||
if (!(rem_wakeup && hsotg->hw_params.snpsid >= DWC2_CORE_REV_4_30a)) {
|
||||
gpwrdn = dwc2_readl(hsotg, GPWRDN);
|
||||
gpwrdn &= ~GPWRDN_PMUACTV;
|
||||
dwc2_writel(hsotg, gpwrdn, GPWRDN);
|
||||
udelay(10);
|
||||
}
|
||||
|
||||
hprt0 = hr->hprt0;
|
||||
hprt0 |= HPRT0_PWR;
|
||||
@@ -5712,6 +5736,13 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup,
|
||||
hprt0 |= HPRT0_RES;
|
||||
dwc2_writel(hsotg, hprt0, HPRT0);
|
||||
|
||||
/* De-assert Wakeup Logic */
|
||||
if ((rem_wakeup && hsotg->hw_params.snpsid >= DWC2_CORE_REV_4_30a)) {
|
||||
gpwrdn = dwc2_readl(hsotg, GPWRDN);
|
||||
gpwrdn &= ~GPWRDN_PMUACTV;
|
||||
dwc2_writel(hsotg, gpwrdn, GPWRDN);
|
||||
udelay(10);
|
||||
}
|
||||
/* Wait for Resume time and then program HPRT again */
|
||||
mdelay(100);
|
||||
hprt0 &= ~HPRT0_RES;
|
||||
|
||||
@@ -589,7 +589,7 @@ static void dwc2_init_isoc_dma_desc(struct dwc2_hsotg *hsotg,
|
||||
idx = qh->td_last;
|
||||
inc = qh->host_interval;
|
||||
hsotg->frame_number = dwc2_hcd_get_frame_number(hsotg);
|
||||
cur_idx = dwc2_frame_list_idx(hsotg->frame_number);
|
||||
cur_idx = idx;
|
||||
next_idx = dwc2_desclist_idx_inc(qh->td_last, inc, qh->dev_speed);
|
||||
|
||||
/*
|
||||
@@ -896,6 +896,8 @@ static int dwc2_cmpl_host_isoc_dma_desc(struct dwc2_hsotg *hsotg,
|
||||
{
|
||||
struct dwc2_dma_desc *dma_desc;
|
||||
struct dwc2_hcd_iso_packet_desc *frame_desc;
|
||||
u16 frame_desc_idx;
|
||||
struct urb *usb_urb = qtd->urb->priv;
|
||||
u16 remain = 0;
|
||||
int rc = 0;
|
||||
|
||||
@@ -908,8 +910,11 @@ static int dwc2_cmpl_host_isoc_dma_desc(struct dwc2_hsotg *hsotg,
|
||||
DMA_FROM_DEVICE);
|
||||
|
||||
dma_desc = &qh->desc_list[idx];
|
||||
frame_desc_idx = (idx - qtd->isoc_td_first) & (usb_urb->number_of_packets - 1);
|
||||
|
||||
frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index_last];
|
||||
frame_desc = &qtd->urb->iso_descs[frame_desc_idx];
|
||||
if (idx == qtd->isoc_td_first)
|
||||
usb_urb->start_frame = dwc2_hcd_get_frame_number(hsotg);
|
||||
dma_desc->buf = (u32)(qtd->urb->dma + frame_desc->offset);
|
||||
if (chan->ep_is_in)
|
||||
remain = (dma_desc->status & HOST_DMA_ISOC_NBYTES_MASK) >>
|
||||
@@ -930,7 +935,7 @@ static int dwc2_cmpl_host_isoc_dma_desc(struct dwc2_hsotg *hsotg,
|
||||
frame_desc->status = 0;
|
||||
}
|
||||
|
||||
if (++qtd->isoc_frame_index == qtd->urb->packet_count) {
|
||||
if (++qtd->isoc_frame_index == usb_urb->number_of_packets) {
|
||||
/*
|
||||
* urb->status is not used for isoc transfers here. The
|
||||
* individual frame_desc status are used instead.
|
||||
@@ -1035,11 +1040,11 @@ static void dwc2_complete_isoc_xfer_ddma(struct dwc2_hsotg *hsotg,
|
||||
return;
|
||||
idx = dwc2_desclist_idx_inc(idx, qh->host_interval,
|
||||
chan->speed);
|
||||
if (!rc)
|
||||
if (rc == 0)
|
||||
continue;
|
||||
|
||||
if (rc == DWC2_CMPL_DONE)
|
||||
break;
|
||||
if (rc == DWC2_CMPL_DONE || rc == DWC2_CMPL_STOP)
|
||||
goto stop_scan;
|
||||
|
||||
/* rc == DWC2_CMPL_STOP */
|
||||
|
||||
|
||||
@@ -701,7 +701,7 @@
|
||||
#define TXSTS_QTOP_TOKEN_MASK (0x3 << 25)
|
||||
#define TXSTS_QTOP_TOKEN_SHIFT 25
|
||||
#define TXSTS_QTOP_TERMINATE BIT(24)
|
||||
#define TXSTS_QSPCAVAIL_MASK (0xff << 16)
|
||||
#define TXSTS_QSPCAVAIL_MASK (0x7f << 16)
|
||||
#define TXSTS_QSPCAVAIL_SHIFT 16
|
||||
#define TXSTS_FSPCAVAIL_MASK (0xffff << 0)
|
||||
#define TXSTS_FSPCAVAIL_SHIFT 0
|
||||
|
||||
@@ -1357,7 +1357,7 @@ parse_ntb:
|
||||
if (to_process == 1 &&
|
||||
(*(unsigned char *)(ntb_ptr + block_len) == 0x00)) {
|
||||
to_process--;
|
||||
} else if (to_process > 0) {
|
||||
} else if ((to_process > 0) && (block_len != 0)) {
|
||||
ntb_ptr = (unsigned char *)(ntb_ptr + block_len);
|
||||
goto parse_ntb;
|
||||
}
|
||||
|
||||
@@ -273,7 +273,9 @@ int usb_ep_queue(struct usb_ep *ep,
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (WARN_ON_ONCE(!ep->enabled && ep->address)) {
|
||||
if (!ep->enabled && ep->address) {
|
||||
pr_debug("USB gadget: queue request to disabled ep 0x%x (%s)\n",
|
||||
ep->address, ep->name);
|
||||
ret = -ESHUTDOWN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -585,6 +585,7 @@ done(struct sl811 *sl811, struct sl811h_ep *ep, u8 bank)
|
||||
finish_request(sl811, ep, urb, urbstat);
|
||||
}
|
||||
|
||||
#ifdef QUIRK2
|
||||
static inline u8 checkdone(struct sl811 *sl811)
|
||||
{
|
||||
u8 ctl;
|
||||
@@ -616,6 +617,7 @@ static inline u8 checkdone(struct sl811 *sl811)
|
||||
#endif
|
||||
return irqstat;
|
||||
}
|
||||
#endif
|
||||
|
||||
static irqreturn_t sl811h_irq(struct usb_hcd *hcd)
|
||||
{
|
||||
|
||||
@@ -57,6 +57,8 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */
|
||||
{ USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
|
||||
{ USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */
|
||||
{ USB_DEVICE(0x04BF, 0x1301) }, /* TDK Corporation NC0110013M - Network Controller */
|
||||
{ USB_DEVICE(0x04BF, 0x1303) }, /* TDK Corporation MM0110113M - i3 Micro Module */
|
||||
{ USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */
|
||||
{ USB_DEVICE(0x0846, 0x1100) }, /* NetGear Managed Switch M4100 series, M5300 series, M7100 series */
|
||||
{ USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
|
||||
@@ -145,6 +147,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
|
||||
{ USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */
|
||||
{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
|
||||
{ USB_DEVICE(0x10C4, 0x863C) }, /* MGP Instruments PDS100 */
|
||||
{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
|
||||
{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
|
||||
{ USB_DEVICE(0x10C4, 0x87ED) }, /* IMST USB-Stick for Smart Meter */
|
||||
@@ -178,6 +181,7 @@ static const struct usb_device_id id_table[] = {
|
||||
{ USB_DEVICE(0x10C4, 0xF004) }, /* Elan Digital Systems USBcount50 */
|
||||
{ USB_DEVICE(0x10C5, 0xEA61) }, /* Silicon Labs MobiData GPRS USB Modem */
|
||||
{ USB_DEVICE(0x10CE, 0xEA6A) }, /* Silicon Labs MobiData GPRS USB Modem 100EU */
|
||||
{ USB_DEVICE(0x11CA, 0x0212) }, /* Verifone USB to Printer (UART, CP2102) */
|
||||
{ USB_DEVICE(0x12B8, 0xEC60) }, /* Link G4 ECU */
|
||||
{ USB_DEVICE(0x12B8, 0xEC62) }, /* Link G4+ ECU */
|
||||
{ USB_DEVICE(0x13AD, 0x9999) }, /* Baltech card reader */
|
||||
|
||||
@@ -1045,6 +1045,8 @@ static const struct usb_device_id id_table_combined[] = {
|
||||
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_FALCONIA_JTAG_UNBUF_PID),
|
||||
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
|
||||
/* GMC devices */
|
||||
{ USB_DEVICE(GMC_VID, GMC_Z216C_PID) },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
|
||||
|
||||
@@ -1599,3 +1599,9 @@
|
||||
#define UBLOX_VID 0x1546
|
||||
#define UBLOX_C099F9P_ZED_PID 0x0502
|
||||
#define UBLOX_C099F9P_ODIN_PID 0x0503
|
||||
|
||||
/*
|
||||
* GMC devices
|
||||
*/
|
||||
#define GMC_VID 0x1cd7
|
||||
#define GMC_Z216C_PID 0x0217 /* GMC Z216C Adapter IR-USB */
|
||||
@@ -613,6 +613,11 @@ static void option_instat_callback(struct urb *urb);
|
||||
/* Luat Air72*U series based on UNISOC UIS8910 uses UNISOC's vendor ID */
|
||||
#define LUAT_PRODUCT_AIR720U 0x4e00
|
||||
|
||||
/* MeiG Smart Technology products */
|
||||
#define MEIGSMART_VENDOR_ID 0x2dee
|
||||
/* MeiG Smart SLM320 based on UNISOC UIS8910 */
|
||||
#define MEIGSMART_PRODUCT_SLM320 0x4d41
|
||||
|
||||
/* Device flags */
|
||||
|
||||
/* Highest interface number which can be used with NCTRL() and RSVD() */
|
||||
@@ -2282,6 +2287,7 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(MEIGSMART_VENDOR_ID, MEIGSMART_PRODUCT_SLM320, 0xff, 0, 0) },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(usb, option_ids);
|
||||
|
||||
@@ -1104,7 +1104,7 @@ static void isd200_dump_driveid(struct us_data *us, u16 *id)
|
||||
static int isd200_get_inquiry_data( struct us_data *us )
|
||||
{
|
||||
struct isd200_info *info = (struct isd200_info *)us->extra;
|
||||
int retStatus = ISD200_GOOD;
|
||||
int retStatus;
|
||||
u16 *id = info->id;
|
||||
|
||||
usb_stor_dbg(us, "Entering isd200_get_inquiry_data\n");
|
||||
@@ -1136,6 +1136,13 @@ static int isd200_get_inquiry_data( struct us_data *us )
|
||||
isd200_fix_driveid(id);
|
||||
isd200_dump_driveid(us, id);
|
||||
|
||||
/* Prevent division by 0 in isd200_scsi_to_ata() */
|
||||
if (id[ATA_ID_HEADS] == 0 || id[ATA_ID_SECTORS] == 0) {
|
||||
usb_stor_dbg(us, " Invalid ATA Identify data\n");
|
||||
retStatus = ISD200_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
memset(&info->InquiryData, 0, sizeof(info->InquiryData));
|
||||
|
||||
/* Standard IDE interface only supports disks */
|
||||
@@ -1201,6 +1208,7 @@ static int isd200_get_inquiry_data( struct us_data *us )
|
||||
}
|
||||
}
|
||||
|
||||
Done:
|
||||
usb_stor_dbg(us, "Leaving isd200_get_inquiry_data %08X\n", retStatus);
|
||||
|
||||
return(retStatus);
|
||||
@@ -1480,22 +1488,27 @@ static int isd200_init_info(struct us_data *us)
|
||||
|
||||
static int isd200_Initialization(struct us_data *us)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
usb_stor_dbg(us, "ISD200 Initialization...\n");
|
||||
|
||||
/* Initialize ISD200 info struct */
|
||||
|
||||
if (isd200_init_info(us) == ISD200_ERROR) {
|
||||
if (isd200_init_info(us) < 0) {
|
||||
usb_stor_dbg(us, "ERROR Initializing ISD200 Info struct\n");
|
||||
rc = -ENOMEM;
|
||||
} else {
|
||||
/* Get device specific data */
|
||||
|
||||
if (isd200_get_inquiry_data(us) != ISD200_GOOD)
|
||||
if (isd200_get_inquiry_data(us) != ISD200_GOOD) {
|
||||
usb_stor_dbg(us, "ISD200 Initialization Failure\n");
|
||||
else
|
||||
rc = -EINVAL;
|
||||
} else {
|
||||
usb_stor_dbg(us, "ISD200 Initialization complete\n");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -329,8 +329,11 @@ void vfio_platform_irq_cleanup(struct vfio_platform_device *vdev)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < vdev->num_irqs; i++)
|
||||
for (i = 0; i < vdev->num_irqs; i++) {
|
||||
vfio_virqfd_disable(&vdev->irqs[i].mask);
|
||||
vfio_virqfd_disable(&vdev->irqs[i].unmask);
|
||||
vfio_set_trigger(vdev, i, -1, NULL);
|
||||
}
|
||||
|
||||
vdev->num_irqs = 0;
|
||||
kfree(vdev->irqs);
|
||||
|
||||
@@ -1309,7 +1309,7 @@ int fb_get_mode(int flags, u32 val, struct fb_var_screeninfo *var, struct fb_inf
|
||||
int fb_videomode_from_videomode(const struct videomode *vm,
|
||||
struct fb_videomode *fbmode)
|
||||
{
|
||||
unsigned int htotal, vtotal;
|
||||
unsigned int htotal, vtotal, total;
|
||||
|
||||
fbmode->xres = vm->hactive;
|
||||
fbmode->left_margin = vm->hback_porch;
|
||||
@@ -1342,8 +1342,9 @@ int fb_videomode_from_videomode(const struct videomode *vm,
|
||||
vtotal = vm->vactive + vm->vfront_porch + vm->vback_porch +
|
||||
vm->vsync_len;
|
||||
/* prevent division by zero */
|
||||
if (htotal && vtotal) {
|
||||
fbmode->refresh = vm->pixelclock / (htotal * vtotal);
|
||||
total = htotal * vtotal;
|
||||
if (total) {
|
||||
fbmode->refresh = vm->pixelclock / total;
|
||||
/* a mode must have htotal and vtotal != 0 or it is invalid */
|
||||
} else {
|
||||
fbmode->refresh = 0;
|
||||
|
||||
@@ -129,7 +129,7 @@ static int hw_bitblt_1(void __iomem *engine, u8 op, u32 width, u32 height,
|
||||
|
||||
if (op != VIA_BITBLT_FILL) {
|
||||
tmp = src_mem ? 0 : src_addr;
|
||||
if (dst_addr & 0xE0000007) {
|
||||
if (tmp & 0xE0000007) {
|
||||
printk(KERN_WARNING "hw_bitblt_1: Unsupported source "
|
||||
"address %X\n", tmp);
|
||||
return -EINVAL;
|
||||
@@ -274,7 +274,7 @@ static int hw_bitblt_2(void __iomem *engine, u8 op, u32 width, u32 height,
|
||||
writel(tmp, engine + 0x18);
|
||||
|
||||
tmp = src_mem ? 0 : src_addr;
|
||||
if (dst_addr & 0xE0000007) {
|
||||
if (tmp & 0xE0000007) {
|
||||
printk(KERN_WARNING "hw_bitblt_2: Unsupported source "
|
||||
"address %X\n", tmp);
|
||||
return -EINVAL;
|
||||
|
||||
@@ -376,13 +376,19 @@ EXPORT_SYMBOL_GPL(unregister_virtio_device);
|
||||
int virtio_device_freeze(struct virtio_device *dev)
|
||||
{
|
||||
struct virtio_driver *drv = drv_to_virtio(dev->dev.driver);
|
||||
int ret;
|
||||
|
||||
virtio_config_disable(dev);
|
||||
|
||||
dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED;
|
||||
|
||||
if (drv && drv->freeze)
|
||||
return drv->freeze(dev);
|
||||
if (drv && drv->freeze) {
|
||||
ret = drv->freeze(dev);
|
||||
if (ret) {
|
||||
virtio_config_enable(dev);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -562,8 +562,8 @@ static int aio_setup_ring(struct kioctx *ctx, unsigned int nr_events)
|
||||
|
||||
void kiocb_set_cancel_fn(struct kiocb *iocb, kiocb_cancel_fn *cancel)
|
||||
{
|
||||
struct aio_kiocb *req = container_of(iocb, struct aio_kiocb, rw);
|
||||
struct kioctx *ctx = req->ki_ctx;
|
||||
struct aio_kiocb *req;
|
||||
struct kioctx *ctx;
|
||||
unsigned long flags;
|
||||
|
||||
/*
|
||||
@@ -573,9 +573,13 @@ void kiocb_set_cancel_fn(struct kiocb *iocb, kiocb_cancel_fn *cancel)
|
||||
if (!(iocb->ki_flags & IOCB_AIO_RW))
|
||||
return;
|
||||
|
||||
req = container_of(iocb, struct aio_kiocb, rw);
|
||||
|
||||
if (WARN_ON_ONCE(!list_empty(&req->ki_list)))
|
||||
return;
|
||||
|
||||
ctx = req->ki_ctx;
|
||||
|
||||
spin_lock_irqsave(&ctx->ctx_lock, flags);
|
||||
list_add_tail(&req->ki_list, &ctx->active_reqs);
|
||||
req->ki_cancel = cancel;
|
||||
|
||||
+8
-1
@@ -182,8 +182,15 @@ struct dentry *btrfs_get_parent(struct dentry *child)
|
||||
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
if (ret == 0) {
|
||||
/*
|
||||
* Key with offset of -1 found, there would have to exist an
|
||||
* inode with such number or a root with such id.
|
||||
*/
|
||||
ret = -EUCLEAN;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
BUG_ON(ret == 0); /* Key with offset of -1 found */
|
||||
if (path->slots[0] == 0) {
|
||||
ret = -ENOENT;
|
||||
goto fail;
|
||||
|
||||
+8
-17
@@ -2992,7 +2992,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
|
||||
{
|
||||
struct inode *inode = file_inode(file);
|
||||
struct btrfs_root *root = BTRFS_I(inode)->root;
|
||||
struct btrfs_ioctl_defrag_range_args *range;
|
||||
struct btrfs_ioctl_defrag_range_args range = {0};
|
||||
int ret;
|
||||
|
||||
ret = mnt_want_write_file(file);
|
||||
@@ -3024,37 +3024,28 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
|
||||
goto out;
|
||||
}
|
||||
|
||||
range = kzalloc(sizeof(*range), GFP_KERNEL);
|
||||
if (!range) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (argp) {
|
||||
if (copy_from_user(range, argp,
|
||||
sizeof(*range))) {
|
||||
if (copy_from_user(&range, argp, sizeof(range))) {
|
||||
ret = -EFAULT;
|
||||
kfree(range);
|
||||
goto out;
|
||||
}
|
||||
if (range->flags & ~BTRFS_DEFRAG_RANGE_FLAGS_SUPP) {
|
||||
if (range.flags & ~BTRFS_DEFRAG_RANGE_FLAGS_SUPP) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto out;
|
||||
}
|
||||
/* compression requires us to start the IO */
|
||||
if ((range->flags & BTRFS_DEFRAG_RANGE_COMPRESS)) {
|
||||
range->flags |= BTRFS_DEFRAG_RANGE_START_IO;
|
||||
range->extent_thresh = (u32)-1;
|
||||
if ((range.flags & BTRFS_DEFRAG_RANGE_COMPRESS)) {
|
||||
range.flags |= BTRFS_DEFRAG_RANGE_START_IO;
|
||||
range.extent_thresh = (u32)-1;
|
||||
}
|
||||
} else {
|
||||
/* the rest are all set to zero by kzalloc */
|
||||
range->len = (u64)-1;
|
||||
range.len = (u64)-1;
|
||||
}
|
||||
ret = btrfs_defrag_file(file_inode(file), file,
|
||||
range, BTRFS_OLDEST_GENERATION, 0);
|
||||
&range, BTRFS_OLDEST_GENERATION, 0);
|
||||
if (ret > 0)
|
||||
ret = 0;
|
||||
kfree(range);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
|
||||
+9
-1
@@ -958,7 +958,15 @@ static int iterate_inode_ref(struct btrfs_root *root, struct btrfs_path *path,
|
||||
ret = PTR_ERR(start);
|
||||
goto out;
|
||||
}
|
||||
BUG_ON(start < p->buf);
|
||||
if (unlikely(start < p->buf)) {
|
||||
btrfs_err(root->fs_info,
|
||||
"send: path ref buffer underflow for key (%llu %u %llu)",
|
||||
found_key->objectid,
|
||||
found_key->type,
|
||||
found_key->offset);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
p->start = start;
|
||||
} else {
|
||||
|
||||
+11
-1
@@ -2948,7 +2948,17 @@ again:
|
||||
mutex_unlock(&fs_info->delete_unused_bgs_mutex);
|
||||
goto error;
|
||||
}
|
||||
BUG_ON(ret == 0); /* Corruption */
|
||||
if (ret == 0) {
|
||||
/*
|
||||
* On the first search we would find chunk tree with
|
||||
* offset -1, which is not possible. On subsequent
|
||||
* loops this would find an existing item on an invalid
|
||||
* offset (one less than the previous one, wrong
|
||||
* alignment and size).
|
||||
*/
|
||||
ret = -EUCLEAN;
|
||||
goto error;
|
||||
}
|
||||
|
||||
ret = btrfs_previous_item(chunk_root, path, key.objectid,
|
||||
key.type);
|
||||
|
||||
@@ -823,6 +823,7 @@ int transfer_args_to_stack(struct linux_binprm *bprm,
|
||||
goto out;
|
||||
}
|
||||
|
||||
bprm->exec += *sp_location - MAX_ARG_PAGES * PAGE_SIZE;
|
||||
*sp_location = sp;
|
||||
|
||||
out:
|
||||
|
||||
+2
-1
@@ -1567,7 +1567,8 @@ exit_journal:
|
||||
int gdb_num = group / EXT4_DESC_PER_BLOCK(sb);
|
||||
int gdb_num_end = ((group + flex_gd->count - 1) /
|
||||
EXT4_DESC_PER_BLOCK(sb));
|
||||
int meta_bg = ext4_has_feature_meta_bg(sb);
|
||||
int meta_bg = ext4_has_feature_meta_bg(sb) &&
|
||||
gdb_num >= le32_to_cpu(es->s_first_meta_bg);
|
||||
sector_t padding_blocks = meta_bg ? 0 : sbi->s_sbh->b_blocknr -
|
||||
ext4_group_first_block_no(sb, 0);
|
||||
sector_t old_gdb = 0;
|
||||
|
||||
@@ -139,6 +139,12 @@ fat_encode_fh_nostale(struct inode *inode, __u32 *fh, int *lenp,
|
||||
fid->parent_i_gen = parent->i_generation;
|
||||
type = FILEID_FAT_WITH_PARENT;
|
||||
*lenp = FAT_FID_SIZE_WITH_PARENT;
|
||||
} else {
|
||||
/*
|
||||
* We need to initialize this field because the fh is actually
|
||||
* 12 bytes long
|
||||
*/
|
||||
fid->parent_i_pos_hi = 0;
|
||||
}
|
||||
|
||||
return type;
|
||||
|
||||
@@ -712,7 +712,6 @@ static inline u64 get_node_id(struct inode *inode)
|
||||
|
||||
static inline void fuse_make_bad(struct inode *inode)
|
||||
{
|
||||
remove_inode_hash(inode);
|
||||
set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state);
|
||||
}
|
||||
|
||||
|
||||
+5
-2
@@ -324,8 +324,11 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
|
||||
} else if ((inode->i_mode ^ attr->mode) & S_IFMT) {
|
||||
/* Inode has changed type, any I/O on the old should fail */
|
||||
fuse_make_bad(inode);
|
||||
iput(inode);
|
||||
goto retry;
|
||||
if (inode != d_inode(sb->s_root)) {
|
||||
remove_inode_hash(inode);
|
||||
iput(inode);
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
fi = get_fuse_inode(inode);
|
||||
|
||||
+16
-2
@@ -910,8 +910,22 @@ root_found:
|
||||
* we then decide whether to use the Joliet descriptor.
|
||||
*/
|
||||
inode = isofs_iget(s, sbi->s_firstdatazone, 0);
|
||||
if (IS_ERR(inode))
|
||||
goto out_no_root;
|
||||
|
||||
/*
|
||||
* Fix for broken CDs with a corrupt root inode but a correct Joliet
|
||||
* root directory.
|
||||
*/
|
||||
if (IS_ERR(inode)) {
|
||||
if (joliet_level && sbi->s_firstdatazone != first_data_zone) {
|
||||
printk(KERN_NOTICE
|
||||
"ISOFS: root inode is unusable. "
|
||||
"Disabling Rock Ridge and switching to Joliet.");
|
||||
sbi->s_rock = 0;
|
||||
inode = NULL;
|
||||
} else {
|
||||
goto out_no_root;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Fix for broken CDs with Rock Ridge and empty ISO root directory but
|
||||
|
||||
+19
-19
@@ -614,10 +614,10 @@ void nilfs_palloc_commit_free_entry(struct inode *inode,
|
||||
lock = nilfs_mdt_bgl_lock(inode, group);
|
||||
|
||||
if (!nilfs_clear_bit_atomic(lock, group_offset, bitmap))
|
||||
nilfs_msg(inode->i_sb, KERN_WARNING,
|
||||
"%s (ino=%lu): entry number %llu already freed",
|
||||
__func__, inode->i_ino,
|
||||
(unsigned long long)req->pr_entry_nr);
|
||||
nilfs_warn(inode->i_sb,
|
||||
"%s (ino=%lu): entry number %llu already freed",
|
||||
__func__, inode->i_ino,
|
||||
(unsigned long long)req->pr_entry_nr);
|
||||
else
|
||||
nilfs_palloc_group_desc_add_entries(desc, lock, 1);
|
||||
|
||||
@@ -655,10 +655,10 @@ void nilfs_palloc_abort_alloc_entry(struct inode *inode,
|
||||
lock = nilfs_mdt_bgl_lock(inode, group);
|
||||
|
||||
if (!nilfs_clear_bit_atomic(lock, group_offset, bitmap))
|
||||
nilfs_msg(inode->i_sb, KERN_WARNING,
|
||||
"%s (ino=%lu): entry number %llu already freed",
|
||||
__func__, inode->i_ino,
|
||||
(unsigned long long)req->pr_entry_nr);
|
||||
nilfs_warn(inode->i_sb,
|
||||
"%s (ino=%lu): entry number %llu already freed",
|
||||
__func__, inode->i_ino,
|
||||
(unsigned long long)req->pr_entry_nr);
|
||||
else
|
||||
nilfs_palloc_group_desc_add_entries(desc, lock, 1);
|
||||
|
||||
@@ -764,10 +764,10 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
|
||||
do {
|
||||
if (!nilfs_clear_bit_atomic(lock, group_offset,
|
||||
bitmap)) {
|
||||
nilfs_msg(inode->i_sb, KERN_WARNING,
|
||||
"%s (ino=%lu): entry number %llu already freed",
|
||||
__func__, inode->i_ino,
|
||||
(unsigned long long)entry_nrs[j]);
|
||||
nilfs_warn(inode->i_sb,
|
||||
"%s (ino=%lu): entry number %llu already freed",
|
||||
__func__, inode->i_ino,
|
||||
(unsigned long long)entry_nrs[j]);
|
||||
} else {
|
||||
n++;
|
||||
}
|
||||
@@ -809,10 +809,10 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
|
||||
ret = nilfs_palloc_delete_entry_block(inode,
|
||||
last_nrs[k]);
|
||||
if (ret && ret != -ENOENT)
|
||||
nilfs_msg(inode->i_sb, KERN_WARNING,
|
||||
"error %d deleting block that object (entry=%llu, ino=%lu) belongs to",
|
||||
ret, (unsigned long long)last_nrs[k],
|
||||
inode->i_ino);
|
||||
nilfs_warn(inode->i_sb,
|
||||
"error %d deleting block that object (entry=%llu, ino=%lu) belongs to",
|
||||
ret, (unsigned long long)last_nrs[k],
|
||||
inode->i_ino);
|
||||
}
|
||||
|
||||
desc_kaddr = kmap_atomic(desc_bh->b_page);
|
||||
@@ -827,9 +827,9 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
|
||||
if (nfree == nilfs_palloc_entries_per_group(inode)) {
|
||||
ret = nilfs_palloc_delete_bitmap_block(inode, group);
|
||||
if (ret && ret != -ENOENT)
|
||||
nilfs_msg(inode->i_sb, KERN_WARNING,
|
||||
"error %d deleting bitmap block of group=%lu, ino=%lu",
|
||||
ret, group, inode->i_ino);
|
||||
nilfs_warn(inode->i_sb,
|
||||
"error %d deleting bitmap block of group=%lu, ino=%lu",
|
||||
ret, group, inode->i_ino);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
+28
-23
@@ -352,10 +352,10 @@ static int nilfs_btree_node_broken(const struct nilfs_btree_node *node,
|
||||
(flags & NILFS_BTREE_NODE_ROOT) ||
|
||||
nchildren < 0 ||
|
||||
nchildren > NILFS_BTREE_NODE_NCHILDREN_MAX(size))) {
|
||||
nilfs_msg(inode->i_sb, KERN_CRIT,
|
||||
"bad btree node (ino=%lu, blocknr=%llu): level = %d, flags = 0x%x, nchildren = %d",
|
||||
inode->i_ino, (unsigned long long)blocknr, level,
|
||||
flags, nchildren);
|
||||
nilfs_crit(inode->i_sb,
|
||||
"bad btree node (ino=%lu, blocknr=%llu): level = %d, flags = 0x%x, nchildren = %d",
|
||||
inode->i_ino, (unsigned long long)blocknr, level,
|
||||
flags, nchildren);
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
@@ -382,9 +382,9 @@ static int nilfs_btree_root_broken(const struct nilfs_btree_node *node,
|
||||
level >= NILFS_BTREE_LEVEL_MAX ||
|
||||
nchildren < 0 ||
|
||||
nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX)) {
|
||||
nilfs_msg(inode->i_sb, KERN_CRIT,
|
||||
"bad btree root (ino=%lu): level = %d, flags = 0x%x, nchildren = %d",
|
||||
inode->i_ino, level, flags, nchildren);
|
||||
nilfs_crit(inode->i_sb,
|
||||
"bad btree root (ino=%lu): level = %d, flags = 0x%x, nchildren = %d",
|
||||
inode->i_ino, level, flags, nchildren);
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
@@ -451,10 +451,10 @@ static int nilfs_btree_bad_node(const struct nilfs_bmap *btree,
|
||||
{
|
||||
if (unlikely(nilfs_btree_node_get_level(node) != level)) {
|
||||
dump_stack();
|
||||
nilfs_msg(btree->b_inode->i_sb, KERN_CRIT,
|
||||
"btree level mismatch (ino=%lu): %d != %d",
|
||||
btree->b_inode->i_ino,
|
||||
nilfs_btree_node_get_level(node), level);
|
||||
nilfs_crit(btree->b_inode->i_sb,
|
||||
"btree level mismatch (ino=%lu): %d != %d",
|
||||
btree->b_inode->i_ino,
|
||||
nilfs_btree_node_get_level(node), level);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -519,7 +519,7 @@ static int __nilfs_btree_get_block(const struct nilfs_bmap *btree, __u64 ptr,
|
||||
|
||||
out_no_wait:
|
||||
if (!buffer_uptodate(bh)) {
|
||||
nilfs_msg(btree->b_inode->i_sb, KERN_ERR,
|
||||
nilfs_err(btree->b_inode->i_sb,
|
||||
"I/O error reading b-tree node block (ino=%lu, blocknr=%llu)",
|
||||
btree->b_inode->i_ino, (unsigned long long)ptr);
|
||||
brelse(bh);
|
||||
@@ -724,7 +724,7 @@ static int nilfs_btree_lookup_contig(const struct nilfs_bmap *btree,
|
||||
dat = nilfs_bmap_get_dat(btree);
|
||||
ret = nilfs_dat_translate(dat, ptr, &blocknr);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
goto dat_error;
|
||||
ptr = blocknr;
|
||||
}
|
||||
cnt = 1;
|
||||
@@ -743,7 +743,7 @@ static int nilfs_btree_lookup_contig(const struct nilfs_bmap *btree,
|
||||
if (dat) {
|
||||
ret = nilfs_dat_translate(dat, ptr2, &blocknr);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
goto dat_error;
|
||||
ptr2 = blocknr;
|
||||
}
|
||||
if (ptr2 != ptr + cnt || ++cnt == maxblocks)
|
||||
@@ -782,6 +782,11 @@ static int nilfs_btree_lookup_contig(const struct nilfs_bmap *btree,
|
||||
out:
|
||||
nilfs_btree_free_path(path);
|
||||
return ret;
|
||||
|
||||
dat_error:
|
||||
if (ret == -ENOENT)
|
||||
ret = -EINVAL; /* Notify bmap layer of metadata corruption */
|
||||
goto out;
|
||||
}
|
||||
|
||||
static void nilfs_btree_promote_key(struct nilfs_bmap *btree,
|
||||
@@ -2089,10 +2094,10 @@ static int nilfs_btree_propagate(struct nilfs_bmap *btree,
|
||||
ret = nilfs_btree_do_lookup(btree, path, key, NULL, level + 1, 0);
|
||||
if (ret < 0) {
|
||||
if (unlikely(ret == -ENOENT))
|
||||
nilfs_msg(btree->b_inode->i_sb, KERN_CRIT,
|
||||
"writing node/leaf block does not appear in b-tree (ino=%lu) at key=%llu, level=%d",
|
||||
btree->b_inode->i_ino,
|
||||
(unsigned long long)key, level);
|
||||
nilfs_crit(btree->b_inode->i_sb,
|
||||
"writing node/leaf block does not appear in b-tree (ino=%lu) at key=%llu, level=%d",
|
||||
btree->b_inode->i_ino,
|
||||
(unsigned long long)key, level);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -2129,11 +2134,11 @@ static void nilfs_btree_add_dirty_buffer(struct nilfs_bmap *btree,
|
||||
if (level < NILFS_BTREE_LEVEL_NODE_MIN ||
|
||||
level >= NILFS_BTREE_LEVEL_MAX) {
|
||||
dump_stack();
|
||||
nilfs_msg(btree->b_inode->i_sb, KERN_WARNING,
|
||||
"invalid btree level: %d (key=%llu, ino=%lu, blocknr=%llu)",
|
||||
level, (unsigned long long)key,
|
||||
btree->b_inode->i_ino,
|
||||
(unsigned long long)bh->b_blocknr);
|
||||
nilfs_warn(btree->b_inode->i_sb,
|
||||
"invalid btree level: %d (key=%llu, ino=%lu, blocknr=%llu)",
|
||||
level, (unsigned long long)key,
|
||||
btree->b_inode->i_ino,
|
||||
(unsigned long long)bh->b_blocknr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+4
-6
@@ -322,7 +322,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
|
||||
int ret, ncps, nicps, nss, count, i;
|
||||
|
||||
if (unlikely(start == 0 || start > end)) {
|
||||
nilfs_msg(cpfile->i_sb, KERN_ERR,
|
||||
nilfs_err(cpfile->i_sb,
|
||||
"cannot delete checkpoints: invalid range [%llu, %llu)",
|
||||
(unsigned long long)start, (unsigned long long)end);
|
||||
return -EINVAL;
|
||||
@@ -376,7 +376,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
|
||||
cpfile, cno);
|
||||
if (ret == 0)
|
||||
continue;
|
||||
nilfs_msg(cpfile->i_sb, KERN_ERR,
|
||||
nilfs_err(cpfile->i_sb,
|
||||
"error %d deleting checkpoint block",
|
||||
ret);
|
||||
break;
|
||||
@@ -981,12 +981,10 @@ int nilfs_cpfile_read(struct super_block *sb, size_t cpsize,
|
||||
int err;
|
||||
|
||||
if (cpsize > sb->s_blocksize) {
|
||||
nilfs_msg(sb, KERN_ERR,
|
||||
"too large checkpoint size: %zu bytes", cpsize);
|
||||
nilfs_err(sb, "too large checkpoint size: %zu bytes", cpsize);
|
||||
return -EINVAL;
|
||||
} else if (cpsize < NILFS_MIN_CHECKPOINT_SIZE) {
|
||||
nilfs_msg(sb, KERN_ERR,
|
||||
"too small checkpoint size: %zu bytes", cpsize);
|
||||
nilfs_err(sb, "too small checkpoint size: %zu bytes", cpsize);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -354,11 +354,11 @@ int nilfs_dat_move(struct inode *dat, __u64 vblocknr, sector_t blocknr)
|
||||
kaddr = kmap_atomic(entry_bh->b_page);
|
||||
entry = nilfs_palloc_block_get_entry(dat, vblocknr, entry_bh, kaddr);
|
||||
if (unlikely(entry->de_blocknr == cpu_to_le64(0))) {
|
||||
nilfs_msg(dat->i_sb, KERN_CRIT,
|
||||
"%s: invalid vblocknr = %llu, [%llu, %llu)",
|
||||
__func__, (unsigned long long)vblocknr,
|
||||
(unsigned long long)le64_to_cpu(entry->de_start),
|
||||
(unsigned long long)le64_to_cpu(entry->de_end));
|
||||
nilfs_crit(dat->i_sb,
|
||||
"%s: invalid vblocknr = %llu, [%llu, %llu)",
|
||||
__func__, (unsigned long long)vblocknr,
|
||||
(unsigned long long)le64_to_cpu(entry->de_start),
|
||||
(unsigned long long)le64_to_cpu(entry->de_end));
|
||||
kunmap_atomic(kaddr);
|
||||
brelse(entry_bh);
|
||||
return -EINVAL;
|
||||
@@ -485,11 +485,11 @@ int nilfs_dat_read(struct super_block *sb, size_t entry_size,
|
||||
int err;
|
||||
|
||||
if (entry_size > sb->s_blocksize) {
|
||||
nilfs_msg(sb, KERN_ERR, "too large DAT entry size: %zu bytes",
|
||||
nilfs_err(sb, "too large DAT entry size: %zu bytes",
|
||||
entry_size);
|
||||
return -EINVAL;
|
||||
} else if (entry_size < NILFS_MIN_DAT_ENTRY_SIZE) {
|
||||
nilfs_msg(sb, KERN_ERR, "too small DAT entry size: %zu bytes",
|
||||
nilfs_err(sb, "too small DAT entry size: %zu bytes",
|
||||
entry_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Loaded 100 of 165 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user