Merge 4.9.204 into android-4.9-q

Changes in 4.9.204
	net/mlx4_en: fix mlx4 ethtool -N insertion
	net: rtnetlink: prevent underflows in do_setvfinfo()
	sfc: Only cancel the PPS workqueue if it exists
	net/mlx5e: Fix set vf link state error flow
	net/sched: act_pedit: fix WARN() in the traffic path
	gpio: max77620: Fixup debounce delays
	tools: gpio: Correctly add make dependencies for gpio_utils
	Revert "fs: ocfs2: fix possible null-pointer dereferences in ocfs2_xa_prepare_entry()"
	mm/ksm.c: don't WARN if page is still mapped in remove_stable_node()
	platform/x86: asus-nb-wmi: Support ALS on the Zenbook UX430UQ
	platform/x86: asus-wmi: Only Tell EC the OS will handle display hotkeys from asus_nb_wmi
	mwifiex: Fix NL80211_TX_POWER_LIMITED
	ALSA: isight: fix leak of reference to firewire unit in error path of .probe callback
	printk: fix integer overflow in setup_log_buf()
	gfs2: Fix marking bitmaps non-full
	synclink_gt(): fix compat_ioctl()
	powerpc: Fix signedness bug in update_flash_db()
	powerpc/eeh: Fix use of EEH_PE_KEEP on wrong field
	brcmsmac: AP mode: update beacon when TIM changes
	ath10k: allocate small size dma memory in ath10k_pci_diag_write_mem
	spi: sh-msiof: fix deferred probing
	mmc: mediatek: fix cannot receive new request when msdc_cmd_is_ready fail
	btrfs: handle error of get_old_root
	gsmi: Fix bug in append_to_eventlog sysfs handler
	misc: mic: fix a DMA pool free failure
	m68k: fix command-line parsing when passed from u-boot
	amiflop: clean up on errors during setup
	scsi: ips: fix missing break in switch
	KVM/x86: Fix invvpid and invept register operand size in 64-bit mode
	scsi: isci: Use proper enumerated type in atapi_d2h_reg_frame_handler
	scsi: isci: Change sci_controller_start_task's return type to sci_status
	scsi: iscsi_tcp: Explicitly cast param in iscsi_sw_tcp_host_get_param
	clk: mmp2: fix the clock id for sdh2_clk and sdh3_clk
	ASoC: tegra_sgtl5000: fix device_node refcounting
	scsi: dc395x: fix dma API usage in srb_done
	scsi: dc395x: fix DMA API usage in sg_update_list
	net: fix warning in af_unix
	net: ena: Fix Kconfig dependency on X86
	xfs: fix use-after-free race in xfs_buf_rele
	kprobes, x86/ptrace.h: Make regs_get_kernel_stack_nth() not fault on bad stack
	ALSA: i2c/cs8427: Fix int to char conversion
	macintosh/windfarm_smu_sat: Fix debug output
	USB: misc: appledisplay: fix backlight update_status return code
	usbip: tools: fix atoi() on non-null terminated string
	SUNRPC: Fix a compile warning for cmpxchg64()
	sunrpc: safely reallow resvport min/max inversion
	atm: zatm: Fix empty body Clang warnings
	s390/perf: Return error when debug_register fails
	spi: omap2-mcspi: Set FIFO DMA trigger level to word length
	sparc: Fix parport build warnings.
	ceph: fix dentry leak in ceph_readdir_prepopulate
	rtc: s35390a: Change buf's type to u8 in s35390a_init
	f2fs: fix to spread clear_cold_data()
	mISDN: Fix type of switch control variable in ctrl_teimanager
	qlcnic: fix a return in qlcnic_dcb_get_capability()
	net: ethernet: ti: cpsw: unsync mcast entries while switch promisc mode
	mfd: arizona: Correct calling of runtime_put_sync
	mfd: mc13xxx-core: Fix PMIC shutdown when reading ADC values
	mfd: max8997: Enale irq-wakeup unconditionally
	selftests/ftrace: Fix to test kprobe $comm arg only if available
	thermal: rcar_thermal: Prevent hardware access during system suspend
	powerpc/process: Fix flush_all_to_thread for SPE
	sparc64: Rework xchg() definition to avoid warnings.
	fs/ocfs2/dlm/dlmdebug.c: fix a sleep-in-atomic-context bug in dlm_print_one_mle()
	mm/page-writeback.c: fix range_cyclic writeback vs writepages deadlock
	macsec: update operstate when lower device changes
	macsec: let the administrator set UP state even if lowerdev is down
	um: Make line/tty semantics use true write IRQ
	linux/bitmap.h: handle constant zero-size bitmaps correctly
	linux/bitmap.h: fix type of nbits in bitmap_shift_right()
	hfsplus: fix BUG on bnode parent update
	hfs: fix BUG on bnode parent update
	hfsplus: prevent btree data loss on ENOSPC
	hfs: prevent btree data loss on ENOSPC
	hfsplus: fix return value of hfsplus_get_block()
	hfs: fix return value of hfs_get_block()
	hfsplus: update timestamps on truncate()
	hfs: update timestamp on truncate()
	fs/hfs/extent.c: fix array out of bounds read of array extent
	mm/memory_hotplug: make add_memory() take the device_hotplug_lock
	igb: shorten maximum PHC timecounter update interval
	ntb_netdev: fix sleep time mismatch
	ntb: intel: fix return value for ndev_vec_mask()
	arm64: makefile fix build of .i file in external module case
	ocfs2: don't put and assigning null to bh allocated outside
	ocfs2: fix clusters leak in ocfs2_defrag_extent()
	net: do not abort bulk send on BQL status
	sched/fair: Don't increase sd->balance_interval on newidle balance
	audit: print empty EXECVE args
	wlcore: Fix the return value in case of error in 'wlcore_vendor_cmd_smart_config_start()'
	rtl8xxxu: Fix missing break in switch
	brcmsmac: never log "tid x is not agg'able" by default
	wireless: airo: potential buffer overflow in sprintf()
	rtlwifi: rtl8192de: Fix misleading REG_MCUFWDL information
	scsi: mpt3sas: Fix Sync cache command failure during driver unload
	scsi: mpt3sas: Fix driver modifying persistent data in Manufacturing page11
	scsi: megaraid_sas: Fix msleep granularity
	scsi: lpfc: fcoe: Fix link down issue after 1000+ link bounces
	dlm: fix invalid free
	dlm: don't leak kernel pointer to userspace
	ACPICA: Use %d for signed int print formatting instead of %u
	net: bcmgenet: return correct value 'ret' from bcmgenet_power_down
	sock: Reset dst when changing sk_mark via setsockopt
	pinctrl: qcom: spmi-gpio: fix gpio-hog related boot issues
	pinctrl: lpc18xx: Use define directive for PIN_CONFIG_GPIO_PIN_INT
	pinctrl: zynq: Use define directive for PIN_CONFIG_IO_STANDARD
	PCI: keystone: Use quirk to limit MRRS for K2G
	spi: omap2-mcspi: Fix DMA and FIFO event trigger size mismatch
	mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock
	Bluetooth: Fix invalid-free in bcsp_close()
	KVM: MMU: Do not treat ZONE_DEVICE pages as being reserved
	ath9k_hw: fix uninitialized variable data
	dm: use blk_set_queue_dying() in __dm_destroy()
	arm64: fix for bad_mode() handler to always result in panic
	cpufreq: Skip cpufreq resume if it's not suspended
	ocfs2: remove ocfs2_is_o2cb_active()
	ARM: 8904/1: skip nomap memblocks while finding the lowmem/highmem boundary
	ARC: perf: Accommodate big-endian CPU
	x86/insn: Fix awk regexp warnings
	x86/speculation: Fix incorrect MDS/TAA mitigation status
	x86/speculation: Fix redundant MDS mitigation message
	nfc: port100: handle command failure cleanly
	l2tp: don't use l2tp_tunnel_find() in l2tp_ip and l2tp_ip6
	media: vivid: Set vid_cap_streaming and vid_out_streaming to true
	media: vivid: Fix wrong locking that causes race conditions on streaming stop
	media: usbvision: Fix races among open, close, and disconnect
	cpufreq: Add NULL checks to show() and store() methods of cpufreq
	media: uvcvideo: Fix error path in control parsing failure
	media: b2c2-flexcop-usb: add sanity checking
	media: cxusb: detect cxusb_ctrl_msg error in query
	media: imon: invalid dereference in imon_touch_event
	virtio_console: reset on out of memory
	virtio_console: don't tie bufs to a vq
	virtio_console: allocate inbufs in add_port() only if it is needed
	virtio_ring: fix return code on DMA mapping fails
	virtio_console: fix uninitialized variable use
	virtio_console: drop custom control queue cleanup
	virtio_console: move removal code
	usbip: tools: fix fd leakage in the function of read_attr_usbip_status
	usb-serial: cp201x: support Mark-10 digital force gauge
	USB: chaoskey: fix error case of a timeout
	appledisplay: fix error handling in the scheduled work
	USB: serial: mos7840: add USB ID to support Moxa UPort 2210
	USB: serial: mos7720: fix remote wakeup
	USB: serial: mos7840: fix remote wakeup
	USB: serial: option: add support for DW5821e with eSIM support
	USB: serial: option: add support for Foxconn T77W968 LTE modules
	staging: comedi: usbduxfast: usbduxfast_ai_cmdtest rounding error
	powerpc/64s: support nospectre_v2 cmdline option
	powerpc/book3s64: Fix link stack flush on context switch
	KVM: PPC: Book3S HV: Flush link stack on guest exit to host kernel
	Linux 4.9.204

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2019-11-28 18:47:59 +01:00
170 changed files with 1260 additions and 624 deletions

View File

@@ -265,8 +265,11 @@ time with the option "mds=". The valid arguments for this option are:
============ ============================================================= ============ =============================================================
Not specifying this option is equivalent to "mds=full". Not specifying this option is equivalent to "mds=full". For processors
that are affected by both TAA (TSX Asynchronous Abort) and MDS,
specifying just "mds=off" without an accompanying "tsx_async_abort=off"
will have no effect as the same mitigation is used for both
vulnerabilities.
Mitigation selection guide Mitigation selection guide
-------------------------- --------------------------

View File

@@ -174,7 +174,10 @@ the option "tsx_async_abort=". The valid arguments for this option are:
CPU is not vulnerable to cross-thread TAA attacks. CPU is not vulnerable to cross-thread TAA attacks.
============ ============================================================= ============ =============================================================
Not specifying this option is equivalent to "tsx_async_abort=full". Not specifying this option is equivalent to "tsx_async_abort=full". For
processors that are affected by both TAA and MDS, specifying just
"tsx_async_abort=off" without an accompanying "mds=off" will have no
effect as the same mitigation is used for both vulnerabilities.
The kernel command line also allows to control the TSX feature using the The kernel command line also allows to control the TSX feature using the
parameter "tsx=" on CPUs which support TSX control. MSR_IA32_TSX_CTRL is used parameter "tsx=" on CPUs which support TSX control. MSR_IA32_TSX_CTRL is used

View File

@@ -2377,6 +2377,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
SMT on vulnerable CPUs SMT on vulnerable CPUs
off - Unconditionally disable MDS mitigation off - Unconditionally disable MDS mitigation
On TAA-affected machines, mds=off can be prevented by
an active TAA mitigation as both vulnerabilities are
mitigated with the same mechanism so in order to disable
this mitigation, you need to specify tsx_async_abort=off
too.
Not specifying this option is equivalent to Not specifying this option is equivalent to
mds=full. mds=full.
@@ -4623,6 +4629,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
vulnerable to cross-thread TAA attacks. vulnerable to cross-thread TAA attacks.
off - Unconditionally disable TAA mitigation off - Unconditionally disable TAA mitigation
On MDS-affected machines, tsx_async_abort=off can be
prevented by an active MDS mitigation as both vulnerabilities
are mitigated with the same mechanism so in order to disable
this mitigation, you need to specify mds=off too.
Not specifying this option is equivalent to Not specifying this option is equivalent to
tsx_async_abort=full. On CPUs which are MDS affected tsx_async_abort=full. On CPUs which are MDS affected
and deploy MDS mitigation, TAA mitigation is not and deploy MDS mitigation, TAA mitigation is not

View File

@@ -1,6 +1,6 @@
VERSION = 4 VERSION = 4
PATCHLEVEL = 9 PATCHLEVEL = 9
SUBLEVEL = 203 SUBLEVEL = 204
EXTRAVERSION = EXTRAVERSION =
NAME = Roaring Lionus NAME = Roaring Lionus

View File

@@ -488,8 +488,8 @@ static int arc_pmu_device_probe(struct platform_device *pdev)
/* loop thru all available h/w condition indexes */ /* loop thru all available h/w condition indexes */
for (j = 0; j < cc_bcr.c; j++) { for (j = 0; j < cc_bcr.c; j++) {
write_aux_reg(ARC_REG_CC_INDEX, j); write_aux_reg(ARC_REG_CC_INDEX, j);
cc_name.indiv.word0 = read_aux_reg(ARC_REG_CC_NAME0); cc_name.indiv.word0 = le32_to_cpu(read_aux_reg(ARC_REG_CC_NAME0));
cc_name.indiv.word1 = read_aux_reg(ARC_REG_CC_NAME1); cc_name.indiv.word1 = le32_to_cpu(read_aux_reg(ARC_REG_CC_NAME1));
/* See if it has been mapped to a perf event_id */ /* See if it has been mapped to a perf event_id */
for (i = 0; i < ARRAY_SIZE(arc_pmu_ev_hw_map); i++) { for (i = 0; i < ARRAY_SIZE(arc_pmu_ev_hw_map); i++) {

View File

@@ -1188,6 +1188,9 @@ void __init adjust_lowmem_bounds(void)
phys_addr_t block_start = reg->base; phys_addr_t block_start = reg->base;
phys_addr_t block_end = reg->base + reg->size; phys_addr_t block_end = reg->base + reg->size;
if (memblock_is_nomap(reg))
continue;
if (reg->base < vmalloc_limit) { if (reg->base < vmalloc_limit) {
if (block_end > lowmem_limit) if (block_end > lowmem_limit)
/* /*

View File

@@ -167,6 +167,7 @@ archclean:
$(Q)$(MAKE) $(clean)=$(boot) $(Q)$(MAKE) $(clean)=$(boot)
$(Q)$(MAKE) $(clean)=$(boot)/dts $(Q)$(MAKE) $(clean)=$(boot)/dts
ifeq ($(KBUILD_EXTMOD),)
# We need to generate vdso-offsets.h before compiling certain files in kernel/. # We need to generate vdso-offsets.h before compiling certain files in kernel/.
# In order to do that, we should use the archprepare target, but we can't since # In order to do that, we should use the archprepare target, but we can't since
# asm-offsets.h is included in some files used to generate vdso-offsets.h, and # asm-offsets.h is included in some files used to generate vdso-offsets.h, and
@@ -176,6 +177,7 @@ archclean:
prepare: vdso_prepare prepare: vdso_prepare
vdso_prepare: prepare0 vdso_prepare: prepare0
$(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso include/generated/vdso-offsets.h $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso include/generated/vdso-offsets.h
endif
define archhelp define archhelp
echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)' echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'

View File

@@ -651,7 +651,6 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
handler[reason], smp_processor_id(), esr, handler[reason], smp_processor_id(), esr,
esr_get_class_string(esr)); esr_get_class_string(esr));
die("Oops - bad mode", regs, 0);
local_irq_disable(); local_irq_disable();
panic("bad mode"); panic("bad mode");
} }

View File

@@ -103,5 +103,5 @@ __init void process_uboot_commandline(char *commandp, int size)
} }
parse_uboot_commandline(commandp, len); parse_uboot_commandline(commandp, len);
commandp[size - 1] = 0; commandp[len - 1] = 0;
} }

View File

@@ -124,7 +124,10 @@ extern int __ucmpdi2(u64, u64);
/* Patch sites */ /* Patch sites */
extern s32 patch__call_flush_count_cache; extern s32 patch__call_flush_count_cache;
extern s32 patch__flush_count_cache_return; extern s32 patch__flush_count_cache_return;
extern s32 patch__flush_link_stack_return;
extern s32 patch__call_kvm_flush_link_stack;
extern long flush_count_cache; extern long flush_count_cache;
extern long kvm_flush_link_stack;
#endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */ #endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */

View File

@@ -81,6 +81,9 @@ static inline bool security_ftr_enabled(unsigned long feature)
// Software required to flush count cache on context switch // Software required to flush count cache on context switch
#define SEC_FTR_FLUSH_COUNT_CACHE 0x0000000000000400ull #define SEC_FTR_FLUSH_COUNT_CACHE 0x0000000000000400ull
// Software required to flush link stack on context switch
#define SEC_FTR_FLUSH_LINK_STACK 0x0000000000001000ull
// Features enabled by default // Features enabled by default
#define SEC_FTR_DEFAULT \ #define SEC_FTR_DEFAULT \

View File

@@ -370,7 +370,7 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)
while (parent) { while (parent) {
if (!(parent->type & EEH_PE_INVALID)) if (!(parent->type & EEH_PE_INVALID))
break; break;
parent->type &= ~(EEH_PE_INVALID | EEH_PE_KEEP); parent->type &= ~EEH_PE_INVALID;
parent = parent->parent; parent = parent->parent;
} }

View File

@@ -510,6 +510,7 @@ flush_count_cache:
/* Save LR into r9 */ /* Save LR into r9 */
mflr r9 mflr r9
// Flush the link stack
.rept 64 .rept 64
bl .+4 bl .+4
.endr .endr
@@ -519,6 +520,11 @@ flush_count_cache:
.balign 32 .balign 32
/* Restore LR */ /* Restore LR */
1: mtlr r9 1: mtlr r9
// If we're just flushing the link stack, return here
3: nop
patch_site 3b patch__flush_link_stack_return
li r9,0x7fff li r9,0x7fff
mtctr r9 mtctr r9

View File

@@ -576,12 +576,11 @@ void flush_all_to_thread(struct task_struct *tsk)
if (tsk->thread.regs) { if (tsk->thread.regs) {
preempt_disable(); preempt_disable();
BUG_ON(tsk != current); BUG_ON(tsk != current);
save_all(tsk);
#ifdef CONFIG_SPE #ifdef CONFIG_SPE
if (tsk->thread.regs->msr & MSR_SPE) if (tsk->thread.regs->msr & MSR_SPE)
tsk->thread.spefscr = mfspr(SPRN_SPEFSCR); tsk->thread.spefscr = mfspr(SPRN_SPEFSCR);
#endif #endif
save_all(tsk);
preempt_enable(); preempt_enable();
} }

View File

@@ -25,11 +25,12 @@ enum count_cache_flush_type {
COUNT_CACHE_FLUSH_HW = 0x4, COUNT_CACHE_FLUSH_HW = 0x4,
}; };
static enum count_cache_flush_type count_cache_flush_type = COUNT_CACHE_FLUSH_NONE; static enum count_cache_flush_type count_cache_flush_type = COUNT_CACHE_FLUSH_NONE;
static bool link_stack_flush_enabled;
bool barrier_nospec_enabled; bool barrier_nospec_enabled;
static bool no_nospec; static bool no_nospec;
static bool btb_flush_enabled; static bool btb_flush_enabled;
#ifdef CONFIG_PPC_FSL_BOOK3E #if defined(CONFIG_PPC_FSL_BOOK3E) || defined(CONFIG_PPC_BOOK3S_64)
static bool no_spectrev2; static bool no_spectrev2;
#endif #endif
@@ -107,7 +108,7 @@ static __init int barrier_nospec_debugfs_init(void)
device_initcall(barrier_nospec_debugfs_init); device_initcall(barrier_nospec_debugfs_init);
#endif /* CONFIG_DEBUG_FS */ #endif /* CONFIG_DEBUG_FS */
#ifdef CONFIG_PPC_FSL_BOOK3E #if defined(CONFIG_PPC_FSL_BOOK3E) || defined(CONFIG_PPC_BOOK3S_64)
static int __init handle_nospectre_v2(char *p) static int __init handle_nospectre_v2(char *p)
{ {
no_spectrev2 = true; no_spectrev2 = true;
@@ -115,6 +116,9 @@ static int __init handle_nospectre_v2(char *p)
return 0; return 0;
} }
early_param("nospectre_v2", handle_nospectre_v2); early_param("nospectre_v2", handle_nospectre_v2);
#endif /* CONFIG_PPC_FSL_BOOK3E || CONFIG_PPC_BOOK3S_64 */
#ifdef CONFIG_PPC_FSL_BOOK3E
void setup_spectre_v2(void) void setup_spectre_v2(void)
{ {
if (no_spectrev2) if (no_spectrev2)
@@ -202,11 +206,19 @@ ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, c
if (ccd) if (ccd)
seq_buf_printf(&s, "Indirect branch cache disabled"); seq_buf_printf(&s, "Indirect branch cache disabled");
if (link_stack_flush_enabled)
seq_buf_printf(&s, ", Software link stack flush");
} else if (count_cache_flush_type != COUNT_CACHE_FLUSH_NONE) { } else if (count_cache_flush_type != COUNT_CACHE_FLUSH_NONE) {
seq_buf_printf(&s, "Mitigation: Software count cache flush"); seq_buf_printf(&s, "Mitigation: Software count cache flush");
if (count_cache_flush_type == COUNT_CACHE_FLUSH_HW) if (count_cache_flush_type == COUNT_CACHE_FLUSH_HW)
seq_buf_printf(&s, " (hardware accelerated)"); seq_buf_printf(&s, " (hardware accelerated)");
if (link_stack_flush_enabled)
seq_buf_printf(&s, ", Software link stack flush");
} else if (btb_flush_enabled) { } else if (btb_flush_enabled) {
seq_buf_printf(&s, "Mitigation: Branch predictor state flush"); seq_buf_printf(&s, "Mitigation: Branch predictor state flush");
} else { } else {
@@ -367,18 +379,49 @@ static __init int stf_barrier_debugfs_init(void)
device_initcall(stf_barrier_debugfs_init); device_initcall(stf_barrier_debugfs_init);
#endif /* CONFIG_DEBUG_FS */ #endif /* CONFIG_DEBUG_FS */
static void no_count_cache_flush(void)
{
count_cache_flush_type = COUNT_CACHE_FLUSH_NONE;
pr_info("count-cache-flush: software flush disabled.\n");
}
static void toggle_count_cache_flush(bool enable) static void toggle_count_cache_flush(bool enable)
{ {
if (!enable || !security_ftr_enabled(SEC_FTR_FLUSH_COUNT_CACHE)) { if (!security_ftr_enabled(SEC_FTR_FLUSH_COUNT_CACHE) &&
!security_ftr_enabled(SEC_FTR_FLUSH_LINK_STACK))
enable = false;
if (!enable) {
patch_instruction_site(&patch__call_flush_count_cache, PPC_INST_NOP); patch_instruction_site(&patch__call_flush_count_cache, PPC_INST_NOP);
count_cache_flush_type = COUNT_CACHE_FLUSH_NONE; #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
pr_info("count-cache-flush: software flush disabled.\n"); patch_instruction_site(&patch__call_kvm_flush_link_stack, PPC_INST_NOP);
#endif
pr_info("link-stack-flush: software flush disabled.\n");
link_stack_flush_enabled = false;
no_count_cache_flush();
return; return;
} }
// This enables the branch from _switch to flush_count_cache
patch_branch_site(&patch__call_flush_count_cache, patch_branch_site(&patch__call_flush_count_cache,
(u64)&flush_count_cache, BRANCH_SET_LINK); (u64)&flush_count_cache, BRANCH_SET_LINK);
#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
// This enables the branch from guest_exit_cont to kvm_flush_link_stack
patch_branch_site(&patch__call_kvm_flush_link_stack,
(u64)&kvm_flush_link_stack, BRANCH_SET_LINK);
#endif
pr_info("link-stack-flush: software flush enabled.\n");
link_stack_flush_enabled = true;
// If we just need to flush the link stack, patch an early return
if (!security_ftr_enabled(SEC_FTR_FLUSH_COUNT_CACHE)) {
patch_instruction_site(&patch__flush_link_stack_return, PPC_INST_BLR);
no_count_cache_flush();
return;
}
if (!security_ftr_enabled(SEC_FTR_BCCTR_FLUSH_ASSIST)) { if (!security_ftr_enabled(SEC_FTR_BCCTR_FLUSH_ASSIST)) {
count_cache_flush_type = COUNT_CACHE_FLUSH_SW; count_cache_flush_type = COUNT_CACHE_FLUSH_SW;
pr_info("count-cache-flush: full software flush sequence enabled.\n"); pr_info("count-cache-flush: full software flush sequence enabled.\n");
@@ -392,7 +435,26 @@ static void toggle_count_cache_flush(bool enable)
void setup_count_cache_flush(void) void setup_count_cache_flush(void)
{ {
toggle_count_cache_flush(true); bool enable = true;
if (no_spectrev2 || cpu_mitigations_off()) {
if (security_ftr_enabled(SEC_FTR_BCCTRL_SERIALISED) ||
security_ftr_enabled(SEC_FTR_COUNT_CACHE_DISABLED))
pr_warn("Spectre v2 mitigations not fully under software control, can't disable\n");
enable = false;
}
/*
* There's no firmware feature flag/hypervisor bit to tell us we need to
* flush the link stack on context switch. So we set it here if we see
* either of the Spectre v2 mitigations that aim to protect userspace.
*/
if (security_ftr_enabled(SEC_FTR_COUNT_CACHE_DISABLED) ||
security_ftr_enabled(SEC_FTR_FLUSH_COUNT_CACHE))
security_ftr_set(SEC_FTR_FLUSH_LINK_STACK);
toggle_count_cache_flush(enable);
} }
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS

View File

@@ -18,6 +18,7 @@
*/ */
#include <asm/ppc_asm.h> #include <asm/ppc_asm.h>
#include <asm/code-patching-asm.h>
#include <asm/kvm_asm.h> #include <asm/kvm_asm.h>
#include <asm/reg.h> #include <asm/reg.h>
#include <asm/mmu.h> #include <asm/mmu.h>
@@ -1266,6 +1267,10 @@ mc_cont:
bl kvmhv_accumulate_time bl kvmhv_accumulate_time
#endif #endif
/* Possibly flush the link stack here. */
1: nop
patch_site 1b patch__call_kvm_flush_link_stack
stw r12, STACK_SLOT_TRAP(r1) stw r12, STACK_SLOT_TRAP(r1)
mr r3, r12 mr r3, r12
/* Increment exit count, poke other threads to exit */ /* Increment exit count, poke other threads to exit */
@@ -1685,6 +1690,28 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
mtlr r0 mtlr r0
blr blr
.balign 32
.global kvm_flush_link_stack
kvm_flush_link_stack:
/* Save LR into r0 */
mflr r0
/* Flush the link stack. On Power8 it's up to 32 entries in size. */
.rept 32
bl .+4
.endr
/* And on Power9 it's up to 64. */
BEGIN_FTR_SECTION
.rept 32
bl .+4
.endr
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
/* Restore LR */
mtlr r0
blr
/* /*
* Check whether an HDSI is an HPTE not found fault or something else. * Check whether an HDSI is an HPTE not found fault or something else.
* If it is an HPTE not found fault that is due to the guest accessing * If it is an HPTE not found fault that is due to the guest accessing

View File

@@ -664,7 +664,7 @@ static int update_flash_db(void)
db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff); db_set_64(db, &os_area_db_id_rtc_diff, saved_params.rtc_diff);
count = os_area_flash_write(db, sizeof(struct os_area_db), pos); count = os_area_flash_write(db, sizeof(struct os_area_db), pos);
if (count < sizeof(struct os_area_db)) { if (count < 0 || count < sizeof(struct os_area_db)) {
pr_debug("%s: os_area_flash_write failed %zd\n", __func__, pr_debug("%s: os_area_flash_write failed %zd\n", __func__,
count); count);
error = count < 0 ? count : -EIO; error = count < 0 ? count : -EIO;

View File

@@ -616,7 +616,7 @@ static int dlpar_add_lmb(struct of_drconf_cell *lmb)
nid = memory_add_physaddr_to_nid(lmb->base_addr); nid = memory_add_physaddr_to_nid(lmb->base_addr);
/* Add the memory */ /* Add the memory */
rc = add_memory(nid, lmb->base_addr, block_sz); rc = __add_memory(nid, lmb->base_addr, block_sz);
if (rc) { if (rc) {
dlpar_remove_device_tree_lmb(lmb); dlpar_remove_device_tree_lmb(lmb);
dlpar_release_drc(lmb->drc_index); dlpar_release_drc(lmb->drc_index);

View File

@@ -1611,14 +1611,17 @@ static int __init init_cpum_sampling_pmu(void)
} }
sfdbg = debug_register(KMSG_COMPONENT, 2, 1, 80); sfdbg = debug_register(KMSG_COMPONENT, 2, 1, 80);
if (!sfdbg) if (!sfdbg) {
pr_err("Registering for s390dbf failed\n"); pr_err("Registering for s390dbf failed\n");
return -ENOMEM;
}
debug_register_view(sfdbg, &debug_sprintf_view); debug_register_view(sfdbg, &debug_sprintf_view);
err = register_external_irq(EXT_IRQ_MEASURE_ALERT, err = register_external_irq(EXT_IRQ_MEASURE_ALERT,
cpumf_measurement_alert); cpumf_measurement_alert);
if (err) { if (err) {
pr_cpumsf_err(RS_INIT_FAILURE_ALRT); pr_cpumsf_err(RS_INIT_FAILURE_ALRT);
debug_unregister(sfdbg);
goto out; goto out;
} }
@@ -1627,6 +1630,7 @@ static int __init init_cpum_sampling_pmu(void)
pr_cpumsf_err(RS_INIT_FAILURE_PERF); pr_cpumsf_err(RS_INIT_FAILURE_PERF);
unregister_external_irq(EXT_IRQ_MEASURE_ALERT, unregister_external_irq(EXT_IRQ_MEASURE_ALERT,
cpumf_measurement_alert); cpumf_measurement_alert);
debug_unregister(sfdbg);
goto out; goto out;
} }

View File

@@ -40,7 +40,12 @@ static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long
return val; return val;
} }
#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) #define xchg(ptr,x) \
({ __typeof__(*(ptr)) __ret; \
__ret = (__typeof__(*(ptr))) \
__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))); \
__ret; \
})
void __xchg_called_with_bad_pointer(void); void __xchg_called_with_bad_pointer(void);

View File

@@ -20,6 +20,7 @@
*/ */
#define HAS_DMA #define HAS_DMA
#ifdef CONFIG_PARPORT_PC_FIFO
static DEFINE_SPINLOCK(dma_spin_lock); static DEFINE_SPINLOCK(dma_spin_lock);
#define claim_dma_lock() \ #define claim_dma_lock() \
@@ -30,6 +31,7 @@ static DEFINE_SPINLOCK(dma_spin_lock);
#define release_dma_lock(__flags) \ #define release_dma_lock(__flags) \
spin_unlock_irqrestore(&dma_spin_lock, __flags); spin_unlock_irqrestore(&dma_spin_lock, __flags);
#endif
static struct sparc_ebus_info { static struct sparc_ebus_info {
struct ebus_dma_info info; struct ebus_dma_info info;

View File

@@ -260,7 +260,7 @@ static irqreturn_t line_write_interrupt(int irq, void *data)
if (err == 0) { if (err == 0) {
spin_unlock(&line->lock); spin_unlock(&line->lock);
return IRQ_NONE; return IRQ_NONE;
} else if (err < 0) { } else if ((err < 0) && (err != -EAGAIN)) {
line->head = line->buffer; line->head = line->buffer;
line->tail = line->buffer; line->tail = line->buffer;
} }

View File

@@ -199,24 +199,52 @@ static inline int regs_within_kernel_stack(struct pt_regs *regs,
(kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1))); (kernel_stack_pointer(regs) & ~(THREAD_SIZE - 1)));
} }
/**
* regs_get_kernel_stack_nth_addr() - get the address of the Nth entry on stack
* @regs: pt_regs which contains kernel stack pointer.
* @n: stack entry number.
*
* regs_get_kernel_stack_nth() returns the address of the @n th entry of the
* kernel stack which is specified by @regs. If the @n th entry is NOT in
* the kernel stack, this returns NULL.
*/
static inline unsigned long *regs_get_kernel_stack_nth_addr(struct pt_regs *regs, unsigned int n)
{
unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs);
addr += n;
if (regs_within_kernel_stack(regs, (unsigned long)addr))
return addr;
else
return NULL;
}
/* To avoid include hell, we can't include uaccess.h */
extern long probe_kernel_read(void *dst, const void *src, size_t size);
/** /**
* regs_get_kernel_stack_nth() - get Nth entry of the stack * regs_get_kernel_stack_nth() - get Nth entry of the stack
* @regs: pt_regs which contains kernel stack pointer. * @regs: pt_regs which contains kernel stack pointer.
* @n: stack entry number. * @n: stack entry number.
* *
* regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which * regs_get_kernel_stack_nth() returns @n th entry of the kernel stack which
* is specified by @regs. If the @n th entry is NOT in the kernel stack, * is specified by @regs. If the @n th entry is NOT in the kernel stack
* this returns 0. * this returns 0.
*/ */
static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs,
unsigned int n) unsigned int n)
{ {
unsigned long *addr = (unsigned long *)kernel_stack_pointer(regs); unsigned long *addr;
addr += n; unsigned long val;
if (regs_within_kernel_stack(regs, (unsigned long)addr)) long ret;
return *addr;
else addr = regs_get_kernel_stack_nth_addr(regs, n);
return 0; if (addr) {
ret = probe_kernel_read(&val, addr, sizeof(val));
if (!ret)
return val;
}
return 0;
} }
#define arch_has_single_step() (1) #define arch_has_single_step() (1)

View File

@@ -38,6 +38,7 @@ static void __init spectre_v2_select_mitigation(void);
static void __init ssb_select_mitigation(void); static void __init ssb_select_mitigation(void);
static void __init l1tf_select_mitigation(void); static void __init l1tf_select_mitigation(void);
static void __init mds_select_mitigation(void); static void __init mds_select_mitigation(void);
static void __init mds_print_mitigation(void);
static void __init taa_select_mitigation(void); static void __init taa_select_mitigation(void);
/* The base value of the SPEC_CTRL MSR that always has to be preserved. */ /* The base value of the SPEC_CTRL MSR that always has to be preserved. */
@@ -107,6 +108,12 @@ void __init check_bugs(void)
mds_select_mitigation(); mds_select_mitigation();
taa_select_mitigation(); taa_select_mitigation();
/*
* As MDS and TAA mitigations are inter-related, print MDS
* mitigation until after TAA mitigation selection is done.
*/
mds_print_mitigation();
arch_smt_update(); arch_smt_update();
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
@@ -244,6 +251,12 @@ static void __init mds_select_mitigation(void)
(mds_nosmt || cpu_mitigations_auto_nosmt())) (mds_nosmt || cpu_mitigations_auto_nosmt()))
cpu_smt_disable(false); cpu_smt_disable(false);
} }
}
static void __init mds_print_mitigation(void)
{
if (!boot_cpu_has_bug(X86_BUG_MDS) || cpu_mitigations_off())
return;
pr_info("%s\n", mds_strings[mds_mitigation]); pr_info("%s\n", mds_strings[mds_mitigation]);
} }
@@ -303,8 +316,12 @@ static void __init taa_select_mitigation(void)
return; return;
} }
/* TAA mitigation is turned off on the cmdline (tsx_async_abort=off) */ /*
if (taa_mitigation == TAA_MITIGATION_OFF) * TAA mitigation via VERW is turned off if both
* tsx_async_abort=off and mds=off are specified.
*/
if (taa_mitigation == TAA_MITIGATION_OFF &&
mds_mitigation == MDS_MITIGATION_OFF)
goto out; goto out;
if (boot_cpu_has(X86_FEATURE_MD_CLEAR)) if (boot_cpu_has(X86_FEATURE_MD_CLEAR))
@@ -338,6 +355,15 @@ static void __init taa_select_mitigation(void)
if (taa_nosmt || cpu_mitigations_auto_nosmt()) if (taa_nosmt || cpu_mitigations_auto_nosmt())
cpu_smt_disable(false); cpu_smt_disable(false);
/*
* Update MDS mitigation, if necessary, as the mds_user_clear is
* now enabled for TAA mitigation.
*/
if (mds_mitigation == MDS_MITIGATION_OFF &&
boot_cpu_has_bug(X86_BUG_MDS)) {
mds_mitigation = MDS_MITIGATION_FULL;
mds_select_mitigation();
}
out: out:
pr_info("%s\n", taa_strings[taa_mitigation]); pr_info("%s\n", taa_strings[taa_mitigation]);
} }

View File

@@ -2934,7 +2934,7 @@ static void transparent_hugepage_adjust(struct kvm_vcpu *vcpu,
* here. * here.
*/ */
if (!is_error_noslot_pfn(pfn) && !kvm_is_reserved_pfn(pfn) && if (!is_error_noslot_pfn(pfn) && !kvm_is_reserved_pfn(pfn) &&
level == PT_PAGE_TABLE_LEVEL && !kvm_is_zone_device_pfn(pfn) && level == PT_PAGE_TABLE_LEVEL &&
PageTransCompoundMap(pfn_to_page(pfn)) && PageTransCompoundMap(pfn_to_page(pfn)) &&
!mmu_gfn_lpage_is_disallowed(vcpu, gfn, PT_DIRECTORY_LEVEL)) { !mmu_gfn_lpage_is_disallowed(vcpu, gfn, PT_DIRECTORY_LEVEL)) {
unsigned long mask; unsigned long mask;
@@ -4890,9 +4890,9 @@ restart:
* the guest, and the guest page table is using 4K page size * the guest, and the guest page table is using 4K page size
* mapping if the indirect sp has level = 1. * mapping if the indirect sp has level = 1.
*/ */
if (sp->role.direct && if (sp->role.direct && !kvm_is_reserved_pfn(pfn) &&
!kvm_is_reserved_pfn(pfn) && !kvm_is_zone_device_pfn(pfn) &&
PageTransCompoundMap(pfn_to_page(pfn))) { PageTransCompoundMap(pfn_to_page(pfn))) {
drop_spte(kvm, sptep); drop_spte(kvm, sptep);
need_tlb_flush = 1; need_tlb_flush = 1;
goto restart; goto restart;

View File

@@ -1547,7 +1547,7 @@ static int __find_msr_index(struct vcpu_vmx *vmx, u32 msr)
return -1; return -1;
} }
static inline void __invvpid(int ext, u16 vpid, gva_t gva) static inline void __invvpid(unsigned long ext, u16 vpid, gva_t gva)
{ {
struct { struct {
u64 vpid : 16; u64 vpid : 16;
@@ -1561,7 +1561,7 @@ static inline void __invvpid(int ext, u16 vpid, gva_t gva)
: : "a"(&operand), "c"(ext) : "cc", "memory"); : : "a"(&operand), "c"(ext) : "cc", "memory");
} }
static inline void __invept(int ext, u64 eptp, gpa_t gpa) static inline void __invept(unsigned long ext, u64 eptp, gpa_t gpa)
{ {
struct { struct {
u64 eptp, gpa; u64 eptp, gpa;

View File

@@ -68,7 +68,7 @@ BEGIN {
lprefix1_expr = "\\((66|!F3)\\)" lprefix1_expr = "\\((66|!F3)\\)"
lprefix2_expr = "\\(F3\\)" lprefix2_expr = "\\(F3\\)"
lprefix3_expr = "\\((F2|!F3|66\\&F2)\\)" lprefix3_expr = "\\((F2|!F3|66&F2)\\)"
lprefix_expr = "\\((66|F2|F3)\\)" lprefix_expr = "\\((66|F2|F3)\\)"
max_lprefix = 4 max_lprefix = 4
@@ -256,7 +256,7 @@ function convert_operands(count,opnd, i,j,imm,mod)
return add_flags(imm, mod) return add_flags(imm, mod)
} }
/^[0-9a-f]+\:/ { /^[0-9a-f]+:/ {
if (NR == 1) if (NR == 1)
next next
# get index # get index

View File

@@ -228,7 +228,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
if (node < 0) if (node < 0)
node = memory_add_physaddr_to_nid(info->start_addr); node = memory_add_physaddr_to_nid(info->start_addr);
result = add_memory(node, info->start_addr, info->length); result = __add_memory(node, info->start_addr, info->length);
/* /*
* If the memory block has been used by the kernel, add_memory() * If the memory block has been used by the kernel, add_memory()

View File

@@ -126,7 +126,7 @@ static unsigned long dummy[2] = {0,0};
#define zin_n(r) inl(zatm_dev->base+r*4) #define zin_n(r) inl(zatm_dev->base+r*4)
#define zin(r) inl(zatm_dev->base+uPD98401_##r*4) #define zin(r) inl(zatm_dev->base+uPD98401_##r*4)
#define zout(v,r) outl(v,zatm_dev->base+uPD98401_##r*4) #define zout(v,r) outl(v,zatm_dev->base+uPD98401_##r*4)
#define zwait while (zin(CMR) & uPD98401_BUSY) #define zwait() do {} while (zin(CMR) & uPD98401_BUSY)
/* RX0, RX1, TX0, TX1 */ /* RX0, RX1, TX0, TX1 */
static const int mbx_entries[NR_MBX] = { 1024,1024,1024,1024 }; static const int mbx_entries[NR_MBX] = { 1024,1024,1024,1024 };
@@ -140,7 +140,7 @@ static const int mbx_esize[NR_MBX] = { 16,16,4,4 }; /* entry size in bytes */
static void zpokel(struct zatm_dev *zatm_dev,u32 value,u32 addr) static void zpokel(struct zatm_dev *zatm_dev,u32 value,u32 addr)
{ {
zwait; zwait();
zout(value,CER); zout(value,CER);
zout(uPD98401_IND_ACC | uPD98401_IA_BALL | zout(uPD98401_IND_ACC | uPD98401_IA_BALL |
(uPD98401_IA_TGT_CM << uPD98401_IA_TGT_SHIFT) | addr,CMR); (uPD98401_IA_TGT_CM << uPD98401_IA_TGT_SHIFT) | addr,CMR);
@@ -149,10 +149,10 @@ static void zpokel(struct zatm_dev *zatm_dev,u32 value,u32 addr)
static u32 zpeekl(struct zatm_dev *zatm_dev,u32 addr) static u32 zpeekl(struct zatm_dev *zatm_dev,u32 addr)
{ {
zwait; zwait();
zout(uPD98401_IND_ACC | uPD98401_IA_BALL | uPD98401_IA_RW | zout(uPD98401_IND_ACC | uPD98401_IA_BALL | uPD98401_IA_RW |
(uPD98401_IA_TGT_CM << uPD98401_IA_TGT_SHIFT) | addr,CMR); (uPD98401_IA_TGT_CM << uPD98401_IA_TGT_SHIFT) | addr,CMR);
zwait; zwait();
return zin(CER); return zin(CER);
} }
@@ -241,7 +241,7 @@ static void refill_pool(struct atm_dev *dev,int pool)
} }
if (first) { if (first) {
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
zwait; zwait();
zout(virt_to_bus(first),CER); zout(virt_to_bus(first),CER);
zout(uPD98401_ADD_BAT | (pool << uPD98401_POOL_SHIFT) | count, zout(uPD98401_ADD_BAT | (pool << uPD98401_POOL_SHIFT) | count,
CMR); CMR);
@@ -508,9 +508,9 @@ static int open_rx_first(struct atm_vcc *vcc)
} }
if (zatm_vcc->pool < 0) return -EMSGSIZE; if (zatm_vcc->pool < 0) return -EMSGSIZE;
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
zwait; zwait();
zout(uPD98401_OPEN_CHAN,CMR); zout(uPD98401_OPEN_CHAN,CMR);
zwait; zwait();
DPRINTK("0x%x 0x%x\n",zin(CMR),zin(CER)); DPRINTK("0x%x 0x%x\n",zin(CMR),zin(CER));
chan = (zin(CMR) & uPD98401_CHAN_ADDR) >> uPD98401_CHAN_ADDR_SHIFT; chan = (zin(CMR) & uPD98401_CHAN_ADDR) >> uPD98401_CHAN_ADDR_SHIFT;
spin_unlock_irqrestore(&zatm_dev->lock, flags); spin_unlock_irqrestore(&zatm_dev->lock, flags);
@@ -571,21 +571,21 @@ static void close_rx(struct atm_vcc *vcc)
pos = vcc->vci >> 1; pos = vcc->vci >> 1;
shift = (1-(vcc->vci & 1)) << 4; shift = (1-(vcc->vci & 1)) << 4;
zpokel(zatm_dev,zpeekl(zatm_dev,pos) & ~(0xffff << shift),pos); zpokel(zatm_dev,zpeekl(zatm_dev,pos) & ~(0xffff << shift),pos);
zwait; zwait();
zout(uPD98401_NOP,CMR); zout(uPD98401_NOP,CMR);
zwait; zwait();
zout(uPD98401_NOP,CMR); zout(uPD98401_NOP,CMR);
spin_unlock_irqrestore(&zatm_dev->lock, flags); spin_unlock_irqrestore(&zatm_dev->lock, flags);
} }
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
zwait; zwait();
zout(uPD98401_DEACT_CHAN | uPD98401_CHAN_RT | (zatm_vcc->rx_chan << zout(uPD98401_DEACT_CHAN | uPD98401_CHAN_RT | (zatm_vcc->rx_chan <<
uPD98401_CHAN_ADDR_SHIFT),CMR); uPD98401_CHAN_ADDR_SHIFT),CMR);
zwait; zwait();
udelay(10); /* why oh why ... ? */ udelay(10); /* why oh why ... ? */
zout(uPD98401_CLOSE_CHAN | uPD98401_CHAN_RT | (zatm_vcc->rx_chan << zout(uPD98401_CLOSE_CHAN | uPD98401_CHAN_RT | (zatm_vcc->rx_chan <<
uPD98401_CHAN_ADDR_SHIFT),CMR); uPD98401_CHAN_ADDR_SHIFT),CMR);
zwait; zwait();
if (!(zin(CMR) & uPD98401_CHAN_ADDR)) if (!(zin(CMR) & uPD98401_CHAN_ADDR))
printk(KERN_CRIT DEV_LABEL "(itf %d): can't close RX channel " printk(KERN_CRIT DEV_LABEL "(itf %d): can't close RX channel "
"%d\n",vcc->dev->number,zatm_vcc->rx_chan); "%d\n",vcc->dev->number,zatm_vcc->rx_chan);
@@ -699,7 +699,7 @@ printk("NONONONOO!!!!\n");
skb_queue_tail(&zatm_vcc->tx_queue,skb); skb_queue_tail(&zatm_vcc->tx_queue,skb);
DPRINTK("QRP=0x%08lx\n",zpeekl(zatm_dev,zatm_vcc->tx_chan*VC_SIZE/4+ DPRINTK("QRP=0x%08lx\n",zpeekl(zatm_dev,zatm_vcc->tx_chan*VC_SIZE/4+
uPD98401_TXVC_QRP)); uPD98401_TXVC_QRP));
zwait; zwait();
zout(uPD98401_TX_READY | (zatm_vcc->tx_chan << zout(uPD98401_TX_READY | (zatm_vcc->tx_chan <<
uPD98401_CHAN_ADDR_SHIFT),CMR); uPD98401_CHAN_ADDR_SHIFT),CMR);
spin_unlock_irqrestore(&zatm_dev->lock, flags); spin_unlock_irqrestore(&zatm_dev->lock, flags);
@@ -891,12 +891,12 @@ static void close_tx(struct atm_vcc *vcc)
} }
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
#if 0 #if 0
zwait; zwait();
zout(uPD98401_DEACT_CHAN | (chan << uPD98401_CHAN_ADDR_SHIFT),CMR); zout(uPD98401_DEACT_CHAN | (chan << uPD98401_CHAN_ADDR_SHIFT),CMR);
#endif #endif
zwait; zwait();
zout(uPD98401_CLOSE_CHAN | (chan << uPD98401_CHAN_ADDR_SHIFT),CMR); zout(uPD98401_CLOSE_CHAN | (chan << uPD98401_CHAN_ADDR_SHIFT),CMR);
zwait; zwait();
if (!(zin(CMR) & uPD98401_CHAN_ADDR)) if (!(zin(CMR) & uPD98401_CHAN_ADDR))
printk(KERN_CRIT DEV_LABEL "(itf %d): can't close TX channel " printk(KERN_CRIT DEV_LABEL "(itf %d): can't close TX channel "
"%d\n",vcc->dev->number,chan); "%d\n",vcc->dev->number,chan);
@@ -926,9 +926,9 @@ static int open_tx_first(struct atm_vcc *vcc)
zatm_vcc->tx_chan = 0; zatm_vcc->tx_chan = 0;
if (vcc->qos.txtp.traffic_class == ATM_NONE) return 0; if (vcc->qos.txtp.traffic_class == ATM_NONE) return 0;
spin_lock_irqsave(&zatm_dev->lock, flags); spin_lock_irqsave(&zatm_dev->lock, flags);
zwait; zwait();
zout(uPD98401_OPEN_CHAN,CMR); zout(uPD98401_OPEN_CHAN,CMR);
zwait; zwait();
DPRINTK("0x%x 0x%x\n",zin(CMR),zin(CER)); DPRINTK("0x%x 0x%x\n",zin(CMR),zin(CER));
chan = (zin(CMR) & uPD98401_CHAN_ADDR) >> uPD98401_CHAN_ADDR_SHIFT; chan = (zin(CMR) & uPD98401_CHAN_ADDR) >> uPD98401_CHAN_ADDR_SHIFT;
spin_unlock_irqrestore(&zatm_dev->lock, flags); spin_unlock_irqrestore(&zatm_dev->lock, flags);
@@ -1559,7 +1559,7 @@ static void zatm_phy_put(struct atm_dev *dev,unsigned char value,
struct zatm_dev *zatm_dev; struct zatm_dev *zatm_dev;
zatm_dev = ZATM_DEV(dev); zatm_dev = ZATM_DEV(dev);
zwait; zwait();
zout(value,CER); zout(value,CER);
zout(uPD98401_IND_ACC | uPD98401_IA_B0 | zout(uPD98401_IND_ACC | uPD98401_IA_B0 |
(uPD98401_IA_TGT_PHY << uPD98401_IA_TGT_SHIFT) | addr,CMR); (uPD98401_IA_TGT_PHY << uPD98401_IA_TGT_SHIFT) | addr,CMR);
@@ -1571,10 +1571,10 @@ static unsigned char zatm_phy_get(struct atm_dev *dev,unsigned long addr)
struct zatm_dev *zatm_dev; struct zatm_dev *zatm_dev;
zatm_dev = ZATM_DEV(dev); zatm_dev = ZATM_DEV(dev);
zwait; zwait();
zout(uPD98401_IND_ACC | uPD98401_IA_B0 | uPD98401_IA_RW | zout(uPD98401_IND_ACC | uPD98401_IA_B0 | uPD98401_IA_RW |
(uPD98401_IA_TGT_PHY << uPD98401_IA_TGT_SHIFT) | addr,CMR); (uPD98401_IA_TGT_PHY << uPD98401_IA_TGT_SHIFT) | addr,CMR);
zwait; zwait();
return zin(CER) & 0xff; return zin(CER) & 0xff;
} }

View File

@@ -500,15 +500,20 @@ memory_probe_store(struct device *dev, struct device_attribute *attr,
if (phys_addr & ((pages_per_block << PAGE_SHIFT) - 1)) if (phys_addr & ((pages_per_block << PAGE_SHIFT) - 1))
return -EINVAL; return -EINVAL;
ret = lock_device_hotplug_sysfs();
if (ret)
return ret;
nid = memory_add_physaddr_to_nid(phys_addr); nid = memory_add_physaddr_to_nid(phys_addr);
ret = add_memory(nid, phys_addr, ret = __add_memory(nid, phys_addr,
MIN_MEMORY_BLOCK_SIZE * sections_per_block); MIN_MEMORY_BLOCK_SIZE * sections_per_block);
if (ret) if (ret)
goto out; goto out;
ret = count; ret = count;
out: out:
unlock_device_hotplug();
return ret; return ret;
} }

View File

@@ -1699,11 +1699,41 @@ static const struct block_device_operations floppy_fops = {
.check_events = amiga_check_events, .check_events = amiga_check_events,
}; };
static struct gendisk *fd_alloc_disk(int drive)
{
struct gendisk *disk;
disk = alloc_disk(1);
if (!disk)
goto out;
disk->queue = blk_init_queue(do_fd_request, &amiflop_lock);
if (IS_ERR(disk->queue)) {
disk->queue = NULL;
goto out_put_disk;
}
unit[drive].trackbuf = kmalloc(FLOPPY_MAX_SECTORS * 512, GFP_KERNEL);
if (!unit[drive].trackbuf)
goto out_cleanup_queue;
return disk;
out_cleanup_queue:
blk_cleanup_queue(disk->queue);
disk->queue = NULL;
out_put_disk:
put_disk(disk);
out:
unit[drive].type->code = FD_NODRIVE;
return NULL;
}
static int __init fd_probe_drives(void) static int __init fd_probe_drives(void)
{ {
int drive,drives,nomem; int drive,drives,nomem;
printk(KERN_INFO "FD: probing units\nfound "); pr_info("FD: probing units\nfound");
drives=0; drives=0;
nomem=0; nomem=0;
for(drive=0;drive<FD_MAX_UNITS;drive++) { for(drive=0;drive<FD_MAX_UNITS;drive++) {
@@ -1711,27 +1741,17 @@ static int __init fd_probe_drives(void)
fd_probe(drive); fd_probe(drive);
if (unit[drive].type->code == FD_NODRIVE) if (unit[drive].type->code == FD_NODRIVE)
continue; continue;
disk = alloc_disk(1);
disk = fd_alloc_disk(drive);
if (!disk) { if (!disk) {
unit[drive].type->code = FD_NODRIVE; pr_cont(" no mem for fd%d", drive);
nomem = 1;
continue; continue;
} }
unit[drive].gendisk = disk; unit[drive].gendisk = disk;
disk->queue = blk_init_queue(do_fd_request, &amiflop_lock);
if (!disk->queue) {
unit[drive].type->code = FD_NODRIVE;
continue;
}
drives++; drives++;
if ((unit[drive].trackbuf = kmalloc(FLOPPY_MAX_SECTORS * 512, GFP_KERNEL)) == NULL) {
printk("no mem for "); pr_cont(" fd%d",drive);
unit[drive].type = &drive_types[num_dr_types - 1]; /* FD_NODRIVE */
drives--;
nomem = 1;
}
printk("fd%d ",drive);
disk->major = FLOPPY_MAJOR; disk->major = FLOPPY_MAJOR;
disk->first_minor = drive; disk->first_minor = drive;
disk->fops = &floppy_fops; disk->fops = &floppy_fops;
@@ -1742,11 +1762,11 @@ static int __init fd_probe_drives(void)
} }
if ((drives > 0) || (nomem == 0)) { if ((drives > 0) || (nomem == 0)) {
if (drives == 0) if (drives == 0)
printk("no drives"); pr_cont(" no drives");
printk("\n"); pr_cont("\n");
return drives; return drives;
} }
printk("\n"); pr_cont("\n");
return -ENOMEM; return -ENOMEM;
} }
@@ -1837,30 +1857,6 @@ out_blkdev:
return ret; return ret;
} }
#if 0 /* not safe to unload */
static int __exit amiga_floppy_remove(struct platform_device *pdev)
{
int i;
for( i = 0; i < FD_MAX_UNITS; i++) {
if (unit[i].type->code != FD_NODRIVE) {
struct request_queue *q = unit[i].gendisk->queue;
del_gendisk(unit[i].gendisk);
put_disk(unit[i].gendisk);
kfree(unit[i].trackbuf);
if (q)
blk_cleanup_queue(q);
}
}
blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);
free_irq(IRQ_AMIGA_CIAA_TB, NULL);
free_irq(IRQ_AMIGA_DSKBLK, NULL);
custom.dmacon = DMAF_DISK; /* disable DMA */
amiga_chip_free(raw_buf);
unregister_blkdev(FLOPPY_MAJOR, "fd");
}
#endif
static struct platform_driver amiga_floppy_driver = { static struct platform_driver amiga_floppy_driver = {
.driver = { .driver = {
.name = "amiga-floppy", .name = "amiga-floppy",

View File

@@ -605,6 +605,7 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count)
if (*ptr == 0xc0) { if (*ptr == 0xc0) {
BT_ERR("Short BCSP packet"); BT_ERR("Short BCSP packet");
kfree_skb(bcsp->rx_skb); kfree_skb(bcsp->rx_skb);
bcsp->rx_skb = NULL;
bcsp->rx_state = BCSP_W4_PKT_START; bcsp->rx_state = BCSP_W4_PKT_START;
bcsp->rx_count = 0; bcsp->rx_count = 0;
} else } else
@@ -620,6 +621,7 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count)
bcsp->rx_skb->data[2])) != bcsp->rx_skb->data[3]) { bcsp->rx_skb->data[2])) != bcsp->rx_skb->data[3]) {
BT_ERR("Error in BCSP hdr checksum"); BT_ERR("Error in BCSP hdr checksum");
kfree_skb(bcsp->rx_skb); kfree_skb(bcsp->rx_skb);
bcsp->rx_skb = NULL;
bcsp->rx_state = BCSP_W4_PKT_DELIMITER; bcsp->rx_state = BCSP_W4_PKT_DELIMITER;
bcsp->rx_count = 0; bcsp->rx_count = 0;
continue; continue;
@@ -644,6 +646,7 @@ static int bcsp_recv(struct hci_uart *hu, const void *data, int count)
bscp_get_crc(bcsp)); bscp_get_crc(bcsp));
kfree_skb(bcsp->rx_skb); kfree_skb(bcsp->rx_skb);
bcsp->rx_skb = NULL;
bcsp->rx_state = BCSP_W4_PKT_DELIMITER; bcsp->rx_state = BCSP_W4_PKT_DELIMITER;
bcsp->rx_count = 0; bcsp->rx_count = 0;
continue; continue;

View File

@@ -422,7 +422,7 @@ static void reclaim_dma_bufs(void)
} }
} }
static struct port_buffer *alloc_buf(struct virtqueue *vq, size_t buf_size, static struct port_buffer *alloc_buf(struct virtio_device *vdev, size_t buf_size,
int pages) int pages)
{ {
struct port_buffer *buf; struct port_buffer *buf;
@@ -445,7 +445,7 @@ static struct port_buffer *alloc_buf(struct virtqueue *vq, size_t buf_size,
return buf; return buf;
} }
if (is_rproc_serial(vq->vdev)) { if (is_rproc_serial(vdev)) {
/* /*
* Allocate DMA memory from ancestor. When a virtio * Allocate DMA memory from ancestor. When a virtio
* device is created by remoteproc, the DMA memory is * device is created by remoteproc, the DMA memory is
@@ -455,9 +455,9 @@ static struct port_buffer *alloc_buf(struct virtqueue *vq, size_t buf_size,
* DMA_MEMORY_INCLUDES_CHILDREN had been supported * DMA_MEMORY_INCLUDES_CHILDREN had been supported
* in dma-coherent.c * in dma-coherent.c
*/ */
if (!vq->vdev->dev.parent || !vq->vdev->dev.parent->parent) if (!vdev->dev.parent || !vdev->dev.parent->parent)
goto free_buf; goto free_buf;
buf->dev = vq->vdev->dev.parent->parent; buf->dev = vdev->dev.parent->parent;
/* Increase device refcnt to avoid freeing it */ /* Increase device refcnt to avoid freeing it */
get_device(buf->dev); get_device(buf->dev);
@@ -841,7 +841,7 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf,
count = min((size_t)(32 * 1024), count); count = min((size_t)(32 * 1024), count);
buf = alloc_buf(port->out_vq, count, 0); buf = alloc_buf(port->portdev->vdev, count, 0);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
@@ -960,7 +960,7 @@ static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe,
if (ret < 0) if (ret < 0)
goto error_out; goto error_out;
buf = alloc_buf(port->out_vq, 0, pipe->nrbufs); buf = alloc_buf(port->portdev->vdev, 0, pipe->nrbufs);
if (!buf) { if (!buf) {
ret = -ENOMEM; ret = -ENOMEM;
goto error_out; goto error_out;
@@ -1369,24 +1369,24 @@ static void set_console_size(struct port *port, u16 rows, u16 cols)
port->cons.ws.ws_col = cols; port->cons.ws.ws_col = cols;
} }
static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) static int fill_queue(struct virtqueue *vq, spinlock_t *lock)
{ {
struct port_buffer *buf; struct port_buffer *buf;
unsigned int nr_added_bufs; int nr_added_bufs;
int ret; int ret;
nr_added_bufs = 0; nr_added_bufs = 0;
do { do {
buf = alloc_buf(vq, PAGE_SIZE, 0); buf = alloc_buf(vq->vdev, PAGE_SIZE, 0);
if (!buf) if (!buf)
break; return -ENOMEM;
spin_lock_irq(lock); spin_lock_irq(lock);
ret = add_inbuf(vq, buf); ret = add_inbuf(vq, buf);
if (ret < 0) { if (ret < 0) {
spin_unlock_irq(lock); spin_unlock_irq(lock);
free_buf(buf, true); free_buf(buf, true);
break; return ret;
} }
nr_added_bufs++; nr_added_bufs++;
spin_unlock_irq(lock); spin_unlock_irq(lock);
@@ -1406,7 +1406,6 @@ static int add_port(struct ports_device *portdev, u32 id)
char debugfs_name[16]; char debugfs_name[16];
struct port *port; struct port *port;
dev_t devt; dev_t devt;
unsigned int nr_added_bufs;
int err; int err;
port = kmalloc(sizeof(*port), GFP_KERNEL); port = kmalloc(sizeof(*port), GFP_KERNEL);
@@ -1465,11 +1464,13 @@ static int add_port(struct ports_device *portdev, u32 id)
spin_lock_init(&port->outvq_lock); spin_lock_init(&port->outvq_lock);
init_waitqueue_head(&port->waitqueue); init_waitqueue_head(&port->waitqueue);
/* Fill the in_vq with buffers so the host can send us data. */ /* We can safely ignore ENOSPC because it means
nr_added_bufs = fill_queue(port->in_vq, &port->inbuf_lock); * the queue already has buffers. Buffers are removed
if (!nr_added_bufs) { * only by virtcons_remove(), not by unplug_port()
*/
err = fill_queue(port->in_vq, &port->inbuf_lock);
if (err < 0 && err != -ENOSPC) {
dev_err(port->dev, "Error allocating inbufs\n"); dev_err(port->dev, "Error allocating inbufs\n");
err = -ENOMEM;
goto free_device; goto free_device;
} }
@@ -1992,19 +1993,40 @@ static void remove_vqs(struct ports_device *portdev)
kfree(portdev->out_vqs); kfree(portdev->out_vqs);
} }
static void remove_controlq_data(struct ports_device *portdev) static void virtcons_remove(struct virtio_device *vdev)
{ {
struct port_buffer *buf; struct ports_device *portdev;
unsigned int len; struct port *port, *port2;
if (!use_multiport(portdev)) portdev = vdev->priv;
return;
while ((buf = virtqueue_get_buf(portdev->c_ivq, &len))) spin_lock_irq(&pdrvdata_lock);
free_buf(buf, true); list_del(&portdev->list);
spin_unlock_irq(&pdrvdata_lock);
while ((buf = virtqueue_detach_unused_buf(portdev->c_ivq))) /* Disable interrupts for vqs */
free_buf(buf, true); vdev->config->reset(vdev);
/* Finish up work that's lined up */
if (use_multiport(portdev))
cancel_work_sync(&portdev->control_work);
else
cancel_work_sync(&portdev->config_work);
list_for_each_entry_safe(port, port2, &portdev->ports, list)
unplug_port(port);
unregister_chrdev(portdev->chr_major, "virtio-portsdev");
/*
* When yanking out a device, we immediately lose the
* (device-side) queues. So there's no point in keeping the
* guest side around till we drop our final reference. This
* also means that any ports which are in an open state will
* have to just stop using the port, as the vqs are going
* away.
*/
remove_vqs(portdev);
kfree(portdev);
} }
/* /*
@@ -2073,6 +2095,7 @@ static int virtcons_probe(struct virtio_device *vdev)
spin_lock_init(&portdev->ports_lock); spin_lock_init(&portdev->ports_lock);
INIT_LIST_HEAD(&portdev->ports); INIT_LIST_HEAD(&portdev->ports);
INIT_LIST_HEAD(&portdev->list);
virtio_device_ready(portdev->vdev); virtio_device_ready(portdev->vdev);
@@ -2080,18 +2103,22 @@ static int virtcons_probe(struct virtio_device *vdev)
INIT_WORK(&portdev->control_work, &control_work_handler); INIT_WORK(&portdev->control_work, &control_work_handler);
if (multiport) { if (multiport) {
unsigned int nr_added_bufs;
spin_lock_init(&portdev->c_ivq_lock); spin_lock_init(&portdev->c_ivq_lock);
spin_lock_init(&portdev->c_ovq_lock); spin_lock_init(&portdev->c_ovq_lock);
nr_added_bufs = fill_queue(portdev->c_ivq, err = fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
&portdev->c_ivq_lock); if (err < 0) {
if (!nr_added_bufs) {
dev_err(&vdev->dev, dev_err(&vdev->dev,
"Error allocating buffers for control queue\n"); "Error allocating buffers for control queue\n");
err = -ENOMEM; /*
goto free_vqs; * The host might want to notify mgmt sw about device
* add failure.
*/
__send_control_msg(portdev, VIRTIO_CONSOLE_BAD_ID,
VIRTIO_CONSOLE_DEVICE_READY, 0);
/* Device was functional: we need full cleanup. */
virtcons_remove(vdev);
return err;
} }
} else { } else {
/* /*
@@ -2122,11 +2149,6 @@ static int virtcons_probe(struct virtio_device *vdev)
return 0; return 0;
free_vqs:
/* The host might want to notify mgmt sw about device add failure */
__send_control_msg(portdev, VIRTIO_CONSOLE_BAD_ID,
VIRTIO_CONSOLE_DEVICE_READY, 0);
remove_vqs(portdev);
free_chrdev: free_chrdev:
unregister_chrdev(portdev->chr_major, "virtio-portsdev"); unregister_chrdev(portdev->chr_major, "virtio-portsdev");
free: free:
@@ -2135,43 +2157,6 @@ fail:
return err; return err;
} }
static void virtcons_remove(struct virtio_device *vdev)
{
struct ports_device *portdev;
struct port *port, *port2;
portdev = vdev->priv;
spin_lock_irq(&pdrvdata_lock);
list_del(&portdev->list);
spin_unlock_irq(&pdrvdata_lock);
/* Disable interrupts for vqs */
vdev->config->reset(vdev);
/* Finish up work that's lined up */
if (use_multiport(portdev))
cancel_work_sync(&portdev->control_work);
else
cancel_work_sync(&portdev->config_work);
list_for_each_entry_safe(port, port2, &portdev->ports, list)
unplug_port(port);
unregister_chrdev(portdev->chr_major, "virtio-portsdev");
/*
* When yanking out a device, we immediately lose the
* (device-side) queues. So there's no point in keeping the
* guest side around till we drop our final reference. This
* also means that any ports which are in an open state will
* have to just stop using the port, as the vqs are going
* away.
*/
remove_controlq_data(portdev);
remove_vqs(portdev);
kfree(portdev);
}
static struct virtio_device_id id_table[] = { static struct virtio_device_id id_table[] = {
{ VIRTIO_ID_CONSOLE, VIRTIO_DEV_ANY_ID }, { VIRTIO_ID_CONSOLE, VIRTIO_DEV_ANY_ID },
{ 0 }, { 0 },
@@ -2202,15 +2187,16 @@ static int virtcons_freeze(struct virtio_device *vdev)
vdev->config->reset(vdev); vdev->config->reset(vdev);
virtqueue_disable_cb(portdev->c_ivq); if (use_multiport(portdev))
virtqueue_disable_cb(portdev->c_ivq);
cancel_work_sync(&portdev->control_work); cancel_work_sync(&portdev->control_work);
cancel_work_sync(&portdev->config_work); cancel_work_sync(&portdev->config_work);
/* /*
* Once more: if control_work_handler() was running, it would * Once more: if control_work_handler() was running, it would
* enable the cb as the last step. * enable the cb as the last step.
*/ */
virtqueue_disable_cb(portdev->c_ivq); if (use_multiport(portdev))
remove_controlq_data(portdev); virtqueue_disable_cb(portdev->c_ivq);
list_for_each_entry(port, &portdev->ports, list) { list_for_each_entry(port, &portdev->ports, list) {
virtqueue_disable_cb(port->in_vq); virtqueue_disable_cb(port->in_vq);

View File

@@ -227,8 +227,8 @@ static struct mmp_param_gate_clk apmu_gate_clks[] = {
/* The gate clocks has mux parent. */ /* The gate clocks has mux parent. */
{MMP2_CLK_SDH0, "sdh0_clk", "sdh_mix_clk", CLK_SET_RATE_PARENT, APMU_SDH0, 0x1b, 0x1b, 0x0, 0, &sdh_lock}, {MMP2_CLK_SDH0, "sdh0_clk", "sdh_mix_clk", CLK_SET_RATE_PARENT, APMU_SDH0, 0x1b, 0x1b, 0x0, 0, &sdh_lock},
{MMP2_CLK_SDH1, "sdh1_clk", "sdh_mix_clk", CLK_SET_RATE_PARENT, APMU_SDH1, 0x1b, 0x1b, 0x0, 0, &sdh_lock}, {MMP2_CLK_SDH1, "sdh1_clk", "sdh_mix_clk", CLK_SET_RATE_PARENT, APMU_SDH1, 0x1b, 0x1b, 0x0, 0, &sdh_lock},
{MMP2_CLK_SDH1, "sdh2_clk", "sdh_mix_clk", CLK_SET_RATE_PARENT, APMU_SDH2, 0x1b, 0x1b, 0x0, 0, &sdh_lock}, {MMP2_CLK_SDH2, "sdh2_clk", "sdh_mix_clk", CLK_SET_RATE_PARENT, APMU_SDH2, 0x1b, 0x1b, 0x0, 0, &sdh_lock},
{MMP2_CLK_SDH1, "sdh3_clk", "sdh_mix_clk", CLK_SET_RATE_PARENT, APMU_SDH3, 0x1b, 0x1b, 0x0, 0, &sdh_lock}, {MMP2_CLK_SDH3, "sdh3_clk", "sdh_mix_clk", CLK_SET_RATE_PARENT, APMU_SDH3, 0x1b, 0x1b, 0x0, 0, &sdh_lock},
{MMP2_CLK_DISP0, "disp0_clk", "disp0_div", CLK_SET_RATE_PARENT, APMU_DISP0, 0x1b, 0x1b, 0x0, 0, &disp0_lock}, {MMP2_CLK_DISP0, "disp0_clk", "disp0_div", CLK_SET_RATE_PARENT, APMU_DISP0, 0x1b, 0x1b, 0x0, 0, &disp0_lock},
{MMP2_CLK_DISP0_SPHY, "disp0_sphy_clk", "disp0_sphy_div", CLK_SET_RATE_PARENT, APMU_DISP0, 0x1024, 0x1024, 0x0, 0, &disp0_lock}, {MMP2_CLK_DISP0_SPHY, "disp0_sphy_clk", "disp0_sphy_div", CLK_SET_RATE_PARENT, APMU_DISP0, 0x1024, 0x1024, 0x0, 0, &disp0_lock},
{MMP2_CLK_DISP1, "disp1_clk", "disp1_div", CLK_SET_RATE_PARENT, APMU_DISP1, 0x1b, 0x1b, 0x0, 0, &disp1_lock}, {MMP2_CLK_DISP1, "disp1_clk", "disp1_div", CLK_SET_RATE_PARENT, APMU_DISP1, 0x1b, 0x1b, 0x0, 0, &disp1_lock},

View File

@@ -981,6 +981,9 @@ static ssize_t show(struct kobject *kobj, struct attribute *attr, char *buf)
struct freq_attr *fattr = to_attr(attr); struct freq_attr *fattr = to_attr(attr);
ssize_t ret; ssize_t ret;
if (!fattr->show)
return -EIO;
down_read(&policy->rwsem); down_read(&policy->rwsem);
ret = fattr->show(policy, buf); ret = fattr->show(policy, buf);
up_read(&policy->rwsem); up_read(&policy->rwsem);
@@ -995,6 +998,9 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
struct freq_attr *fattr = to_attr(attr); struct freq_attr *fattr = to_attr(attr);
ssize_t ret = -EINVAL; ssize_t ret = -EINVAL;
if (!fattr->store)
return -EIO;
get_online_cpus(); get_online_cpus();
if (cpu_online(policy->cpu)) { if (cpu_online(policy->cpu)) {
@@ -1753,6 +1759,9 @@ void cpufreq_resume(void)
if (!cpufreq_driver) if (!cpufreq_driver)
return; return;
if (unlikely(!cpufreq_suspended))
return;
cpufreq_suspended = false; cpufreq_suspended = false;
if (!has_target() && !cpufreq_driver->resume) if (!has_target() && !cpufreq_driver->resume)

View File

@@ -480,11 +480,10 @@ static ssize_t eventlog_write(struct file *filp, struct kobject *kobj,
if (count < sizeof(u32)) if (count < sizeof(u32))
return -EINVAL; return -EINVAL;
param.type = *(u32 *)buf; param.type = *(u32 *)buf;
count -= sizeof(u32);
buf += sizeof(u32); buf += sizeof(u32);
/* The remaining buffer is the data payload */ /* The remaining buffer is the data payload */
if (count > gsmi_dev.data_buf->length) if ((count - sizeof(u32)) > gsmi_dev.data_buf->length)
return -EINVAL; return -EINVAL;
param.data_len = count - sizeof(u32); param.data_len = count - sizeof(u32);
@@ -504,7 +503,7 @@ static ssize_t eventlog_write(struct file *filp, struct kobject *kobj,
spin_unlock_irqrestore(&gsmi_dev.lock, flags); spin_unlock_irqrestore(&gsmi_dev.lock, flags);
return rc; return (rc == 0) ? count : rc;
} }

View File

@@ -167,13 +167,13 @@ static int max77620_gpio_set_debounce(struct gpio_chip *gc,
case 0: case 0:
val = MAX77620_CNFG_GPIO_DBNC_None; val = MAX77620_CNFG_GPIO_DBNC_None;
break; break;
case 1000 ... 8000: case 1 ... 8000:
val = MAX77620_CNFG_GPIO_DBNC_8ms; val = MAX77620_CNFG_GPIO_DBNC_8ms;
break; break;
case 9000 ... 16000: case 8001 ... 16000:
val = MAX77620_CNFG_GPIO_DBNC_16ms; val = MAX77620_CNFG_GPIO_DBNC_16ms;
break; break;
case 17000 ... 32000: case 16001 ... 32000:
val = MAX77620_CNFG_GPIO_DBNC_32ms; val = MAX77620_CNFG_GPIO_DBNC_32ms;
break; break;
default: default:

View File

@@ -1180,8 +1180,7 @@ static int
ctrl_teimanager(struct manager *mgr, void *arg) ctrl_teimanager(struct manager *mgr, void *arg)
{ {
/* currently we only have one option */ /* currently we only have one option */
int *val = (int *)arg; unsigned int *val = (unsigned int *)arg;
int ret = 0;
switch (val[0]) { switch (val[0]) {
case IMCLEAR_L2: case IMCLEAR_L2:
@@ -1197,9 +1196,9 @@ ctrl_teimanager(struct manager *mgr, void *arg)
test_and_clear_bit(OPTION_L1_HOLD, &mgr->options); test_and_clear_bit(OPTION_L1_HOLD, &mgr->options);
break; break;
default: default:
ret = -EINVAL; return -EINVAL;
} }
return ret; return 0;
} }
/* This function does create a L2 for fixed TEI in NT Mode */ /* This function does create a L2 for fixed TEI in NT Mode */

View File

@@ -22,14 +22,6 @@
#define VERSION "1.0" #define VERSION "1.0"
#define DEBUG
#ifdef DEBUG
#define DBG(args...) printk(args)
#else
#define DBG(args...) do { } while(0)
#endif
/* If the cache is older than 800ms we'll refetch it */ /* If the cache is older than 800ms we'll refetch it */
#define MAX_AGE msecs_to_jiffies(800) #define MAX_AGE msecs_to_jiffies(800)
@@ -106,13 +98,10 @@ struct smu_sdbp_header *smu_sat_get_sdb_partition(unsigned int sat_id, int id,
buf[i+2] = data[3]; buf[i+2] = data[3];
buf[i+3] = data[2]; buf[i+3] = data[2];
} }
#ifdef DEBUG
DBG(KERN_DEBUG "sat %d partition %x:", sat_id, id);
for (i = 0; i < len; ++i)
DBG(" %x", buf[i]);
DBG("\n");
#endif
printk(KERN_DEBUG "sat %d partition %x:", sat_id, id);
print_hex_dump(KERN_DEBUG, " ", DUMP_PREFIX_OFFSET,
16, 1, buf, len, false);
if (size) if (size)
*size = len; *size = len;
return (struct smu_sdbp_header *) buf; return (struct smu_sdbp_header *) buf;
@@ -132,13 +121,13 @@ static int wf_sat_read_cache(struct wf_sat *sat)
if (err < 0) if (err < 0)
return err; return err;
sat->last_read = jiffies; sat->last_read = jiffies;
#ifdef LOTSA_DEBUG #ifdef LOTSA_DEBUG
{ {
int i; int i;
DBG(KERN_DEBUG "wf_sat_get: data is"); printk(KERN_DEBUG "wf_sat_get: data is");
for (i = 0; i < 16; ++i) print_hex_dump(KERN_DEBUG, " ", DUMP_PREFIX_OFFSET,
DBG(" %.2x", sat->cache[i]); 16, 1, sat->cache, 16, false);
DBG("\n");
} }
#endif #endif
return 0; return 0;

View File

@@ -1946,9 +1946,7 @@ static void __dm_destroy(struct mapped_device *md, bool wait)
set_bit(DMF_FREEING, &md->flags); set_bit(DMF_FREEING, &md->flags);
spin_unlock(&_minor_lock); spin_unlock(&_minor_lock);
spin_lock_irq(q->queue_lock); blk_set_queue_dying(q);
queue_flag_set(QUEUE_FLAG_DYING, q);
spin_unlock_irq(q->queue_lock);
if (dm_request_based(md) && md->kworker_task) if (dm_request_based(md) && md->kworker_task)
kthread_flush_worker(&md->kworker); kthread_flush_worker(&md->kworker);

View File

@@ -777,7 +777,11 @@ static int vivid_thread_vid_cap(void *data)
if (kthread_should_stop()) if (kthread_should_stop())
break; break;
mutex_lock(&dev->mutex); if (!mutex_trylock(&dev->mutex)) {
schedule_timeout_uninterruptible(1);
continue;
}
cur_jiffies = jiffies; cur_jiffies = jiffies;
if (dev->cap_seq_resync) { if (dev->cap_seq_resync) {
dev->jiffies_vid_cap = cur_jiffies; dev->jiffies_vid_cap = cur_jiffies;
@@ -930,8 +934,6 @@ void vivid_stop_generating_vid_cap(struct vivid_dev *dev, bool *pstreaming)
/* shutdown control thread */ /* shutdown control thread */
vivid_grab_controls(dev, false); vivid_grab_controls(dev, false);
mutex_unlock(&dev->mutex);
kthread_stop(dev->kthread_vid_cap); kthread_stop(dev->kthread_vid_cap);
dev->kthread_vid_cap = NULL; dev->kthread_vid_cap = NULL;
mutex_lock(&dev->mutex);
} }

View File

@@ -147,7 +147,11 @@ static int vivid_thread_vid_out(void *data)
if (kthread_should_stop()) if (kthread_should_stop())
break; break;
mutex_lock(&dev->mutex); if (!mutex_trylock(&dev->mutex)) {
schedule_timeout_uninterruptible(1);
continue;
}
cur_jiffies = jiffies; cur_jiffies = jiffies;
if (dev->out_seq_resync) { if (dev->out_seq_resync) {
dev->jiffies_vid_out = cur_jiffies; dev->jiffies_vid_out = cur_jiffies;
@@ -301,8 +305,6 @@ void vivid_stop_generating_vid_out(struct vivid_dev *dev, bool *pstreaming)
/* shutdown control thread */ /* shutdown control thread */
vivid_grab_controls(dev, false); vivid_grab_controls(dev, false);
mutex_unlock(&dev->mutex);
kthread_stop(dev->kthread_vid_out); kthread_stop(dev->kthread_vid_out);
dev->kthread_vid_out = NULL; dev->kthread_vid_out = NULL;
mutex_lock(&dev->mutex);
} }

View File

@@ -149,7 +149,11 @@ static int vivid_thread_sdr_cap(void *data)
if (kthread_should_stop()) if (kthread_should_stop())
break; break;
mutex_lock(&dev->mutex); if (!mutex_trylock(&dev->mutex)) {
schedule_timeout_uninterruptible(1);
continue;
}
cur_jiffies = jiffies; cur_jiffies = jiffies;
if (dev->sdr_cap_seq_resync) { if (dev->sdr_cap_seq_resync) {
dev->jiffies_sdr_cap = cur_jiffies; dev->jiffies_sdr_cap = cur_jiffies;
@@ -309,10 +313,8 @@ static void sdr_cap_stop_streaming(struct vb2_queue *vq)
} }
/* shutdown control thread */ /* shutdown control thread */
mutex_unlock(&dev->mutex);
kthread_stop(dev->kthread_sdr_cap); kthread_stop(dev->kthread_sdr_cap);
dev->kthread_sdr_cap = NULL; dev->kthread_sdr_cap = NULL;
mutex_lock(&dev->mutex);
} }
const struct vb2_ops vivid_sdr_cap_qops = { const struct vb2_ops vivid_sdr_cap_qops = {

View File

@@ -236,9 +236,6 @@ static int vid_cap_start_streaming(struct vb2_queue *vq, unsigned count)
if (vb2_is_streaming(&dev->vb_vid_out_q)) if (vb2_is_streaming(&dev->vb_vid_out_q))
dev->can_loop_video = vivid_vid_can_loop(dev); dev->can_loop_video = vivid_vid_can_loop(dev);
if (dev->kthread_vid_cap)
return 0;
dev->vid_cap_seq_count = 0; dev->vid_cap_seq_count = 0;
dprintk(dev, 1, "%s\n", __func__); dprintk(dev, 1, "%s\n", __func__);
for (i = 0; i < VIDEO_MAX_FRAME; i++) for (i = 0; i < VIDEO_MAX_FRAME; i++)

View File

@@ -158,9 +158,6 @@ static int vid_out_start_streaming(struct vb2_queue *vq, unsigned count)
if (vb2_is_streaming(&dev->vb_vid_cap_q)) if (vb2_is_streaming(&dev->vb_vid_cap_q))
dev->can_loop_video = vivid_vid_can_loop(dev); dev->can_loop_video = vivid_vid_can_loop(dev);
if (dev->kthread_vid_out)
return 0;
dev->vid_out_seq_count = 0; dev->vid_out_seq_count = 0;
dprintk(dev, 1, "%s\n", __func__); dprintk(dev, 1, "%s\n", __func__);
if (dev->start_streaming_error) { if (dev->start_streaming_error) {

View File

@@ -1644,8 +1644,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
spin_unlock_irqrestore(&ictx->kc_lock, flags); spin_unlock_irqrestore(&ictx->kc_lock, flags);
/* send touchscreen events through input subsystem if touchpad data */ /* send touchscreen events through input subsystem if touchpad data */
if (ictx->display_type == IMON_DISPLAY_TYPE_VGA && len == 8 && if (ictx->touch && len == 8 && buf[7] == 0x86) {
buf[7] == 0x86) {
imon_touch_event(ictx, buf); imon_touch_event(ictx, buf);
return; return;

View File

@@ -538,6 +538,9 @@ static int flexcop_usb_probe(struct usb_interface *intf,
struct flexcop_device *fc = NULL; struct flexcop_device *fc = NULL;
int ret; int ret;
if (intf->cur_altsetting->desc.bNumEndpoints < 1)
return -ENODEV;
if ((fc = flexcop_device_kmalloc(sizeof(struct flexcop_usb))) == NULL) { if ((fc = flexcop_device_kmalloc(sizeof(struct flexcop_usb))) == NULL) {
err("out of memory\n"); err("out of memory\n");
return -ENOMEM; return -ENOMEM;

View File

@@ -437,7 +437,8 @@ static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
u8 ircode[4]; u8 ircode[4];
int i; int i;
cxusb_ctrl_msg(d, CMD_GET_IR_CODE, NULL, 0, ircode, 4); if (cxusb_ctrl_msg(d, CMD_GET_IR_CODE, NULL, 0, ircode, 4) < 0)
return 0;
*event = 0; *event = 0;
*state = REMOTE_NO_KEY_PRESSED; *state = REMOTE_NO_KEY_PRESSED;

View File

@@ -332,6 +332,10 @@ static int usbvision_v4l2_open(struct file *file)
if (mutex_lock_interruptible(&usbvision->v4l2_lock)) if (mutex_lock_interruptible(&usbvision->v4l2_lock))
return -ERESTARTSYS; return -ERESTARTSYS;
if (usbvision->remove_pending) {
err_code = -ENODEV;
goto unlock;
}
if (usbvision->user) { if (usbvision->user) {
err_code = -EBUSY; err_code = -EBUSY;
} else { } else {
@@ -395,6 +399,7 @@ unlock:
static int usbvision_v4l2_close(struct file *file) static int usbvision_v4l2_close(struct file *file)
{ {
struct usb_usbvision *usbvision = video_drvdata(file); struct usb_usbvision *usbvision = video_drvdata(file);
int r;
PDEBUG(DBG_IO, "close"); PDEBUG(DBG_IO, "close");
@@ -409,9 +414,10 @@ static int usbvision_v4l2_close(struct file *file)
usbvision_scratch_free(usbvision); usbvision_scratch_free(usbvision);
usbvision->user--; usbvision->user--;
r = usbvision->remove_pending;
mutex_unlock(&usbvision->v4l2_lock); mutex_unlock(&usbvision->v4l2_lock);
if (usbvision->remove_pending) { if (r) {
printk(KERN_INFO "%s: Final disconnect\n", __func__); printk(KERN_INFO "%s: Final disconnect\n", __func__);
usbvision_release(usbvision); usbvision_release(usbvision);
return 0; return 0;
@@ -1095,6 +1101,11 @@ static int usbvision_radio_open(struct file *file)
if (mutex_lock_interruptible(&usbvision->v4l2_lock)) if (mutex_lock_interruptible(&usbvision->v4l2_lock))
return -ERESTARTSYS; return -ERESTARTSYS;
if (usbvision->remove_pending) {
err_code = -ENODEV;
goto out;
}
err_code = v4l2_fh_open(file); err_code = v4l2_fh_open(file);
if (err_code) if (err_code)
goto out; goto out;
@@ -1127,6 +1138,7 @@ out:
static int usbvision_radio_close(struct file *file) static int usbvision_radio_close(struct file *file)
{ {
struct usb_usbvision *usbvision = video_drvdata(file); struct usb_usbvision *usbvision = video_drvdata(file);
int r;
PDEBUG(DBG_IO, ""); PDEBUG(DBG_IO, "");
@@ -1139,9 +1151,10 @@ static int usbvision_radio_close(struct file *file)
usbvision_audio_off(usbvision); usbvision_audio_off(usbvision);
usbvision->radio = 0; usbvision->radio = 0;
usbvision->user--; usbvision->user--;
r = usbvision->remove_pending;
mutex_unlock(&usbvision->v4l2_lock); mutex_unlock(&usbvision->v4l2_lock);
if (usbvision->remove_pending) { if (r) {
printk(KERN_INFO "%s: Final disconnect\n", __func__); printk(KERN_INFO "%s: Final disconnect\n", __func__);
v4l2_fh_release(file); v4l2_fh_release(file);
usbvision_release(usbvision); usbvision_release(usbvision);
@@ -1568,6 +1581,7 @@ err_usb:
static void usbvision_disconnect(struct usb_interface *intf) static void usbvision_disconnect(struct usb_interface *intf)
{ {
struct usb_usbvision *usbvision = to_usbvision(usb_get_intfdata(intf)); struct usb_usbvision *usbvision = to_usbvision(usb_get_intfdata(intf));
int u;
PDEBUG(DBG_PROBE, ""); PDEBUG(DBG_PROBE, "");
@@ -1584,13 +1598,14 @@ static void usbvision_disconnect(struct usb_interface *intf)
v4l2_device_disconnect(&usbvision->v4l2_dev); v4l2_device_disconnect(&usbvision->v4l2_dev);
usbvision_i2c_unregister(usbvision); usbvision_i2c_unregister(usbvision);
usbvision->remove_pending = 1; /* Now all ISO data will be ignored */ usbvision->remove_pending = 1; /* Now all ISO data will be ignored */
u = usbvision->user;
usb_put_dev(usbvision->dev); usb_put_dev(usbvision->dev);
usbvision->dev = NULL; /* USB device is no more */ usbvision->dev = NULL; /* USB device is no more */
mutex_unlock(&usbvision->v4l2_lock); mutex_unlock(&usbvision->v4l2_lock);
if (usbvision->user) { if (u) {
printk(KERN_INFO "%s: In use, disconnect pending\n", printk(KERN_INFO "%s: In use, disconnect pending\n",
__func__); __func__);
wake_up_interruptible(&usbvision->wait_frame); wake_up_interruptible(&usbvision->wait_frame);

View File

@@ -2021,6 +2021,21 @@ static int uvc_probe(struct usb_interface *intf,
le16_to_cpu(udev->descriptor.idVendor), le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct)); le16_to_cpu(udev->descriptor.idProduct));
/* Initialize the media device. */
#ifdef CONFIG_MEDIA_CONTROLLER
dev->mdev.dev = &intf->dev;
strscpy(dev->mdev.model, dev->name, sizeof(dev->mdev.model));
if (udev->serial)
strscpy(dev->mdev.serial, udev->serial,
sizeof(dev->mdev.serial));
usb_make_path(udev, dev->mdev.bus_info, sizeof(dev->mdev.bus_info));
dev->mdev.hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
dev->mdev.driver_version = LINUX_VERSION_CODE;
media_device_init(&dev->mdev);
dev->vdev.mdev = &dev->mdev;
#endif
/* Parse the Video Class control descriptor. */ /* Parse the Video Class control descriptor. */
if (uvc_parse_control(dev) < 0) { if (uvc_parse_control(dev) < 0) {
uvc_trace(UVC_TRACE_PROBE, "Unable to parse UVC " uvc_trace(UVC_TRACE_PROBE, "Unable to parse UVC "
@@ -2041,20 +2056,7 @@ static int uvc_probe(struct usb_interface *intf,
"linux-uvc-devel mailing list.\n"); "linux-uvc-devel mailing list.\n");
} }
/* Initialize the media device and register the V4L2 device. */ /* Register the V4L2 device. */
#ifdef CONFIG_MEDIA_CONTROLLER
dev->mdev.dev = &intf->dev;
strlcpy(dev->mdev.model, dev->name, sizeof(dev->mdev.model));
if (udev->serial)
strlcpy(dev->mdev.serial, udev->serial,
sizeof(dev->mdev.serial));
strcpy(dev->mdev.bus_info, udev->devpath);
dev->mdev.hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
dev->mdev.driver_version = LINUX_VERSION_CODE;
media_device_init(&dev->mdev);
dev->vdev.mdev = &dev->mdev;
#endif
if (v4l2_device_register(&intf->dev, &dev->vdev) < 0) if (v4l2_device_register(&intf->dev, &dev->vdev) < 0)
goto error; goto error;

View File

@@ -52,8 +52,10 @@ int arizona_clk32k_enable(struct arizona *arizona)
if (ret != 0) if (ret != 0)
goto err_ref; goto err_ref;
ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]); ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]);
if (ret != 0) if (ret != 0) {
goto err_pm; pm_runtime_put_sync(arizona->dev);
goto err_ref;
}
break; break;
case ARIZONA_32KZ_MCLK2: case ARIZONA_32KZ_MCLK2:
ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK2]); ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK2]);
@@ -67,8 +69,6 @@ int arizona_clk32k_enable(struct arizona *arizona)
ARIZONA_CLK_32K_ENA); ARIZONA_CLK_32K_ENA);
} }
err_pm:
pm_runtime_put_sync(arizona->dev);
err_ref: err_ref:
if (ret != 0) if (ret != 0)
arizona->clk32k_ref--; arizona->clk32k_ref--;

View File

@@ -155,12 +155,6 @@ static struct max8997_platform_data *max8997_i2c_parse_dt_pdata(
pd->ono = irq_of_parse_and_map(dev->of_node, 1); pd->ono = irq_of_parse_and_map(dev->of_node, 1);
/*
* ToDo: the 'wakeup' member in the platform data is more of a linux
* specfic information. Hence, there is no binding for that yet and
* not parsed here.
*/
return pd; return pd;
} }
@@ -248,7 +242,7 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
*/ */
/* MAX8997 has a power button input. */ /* MAX8997 has a power button input. */
device_init_wakeup(max8997->dev, pdata->wakeup); device_init_wakeup(max8997->dev, true);
return ret; return ret;

View File

@@ -278,7 +278,8 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
if (ret) if (ret)
goto out; goto out;
adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2; adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2 |
MC13XXX_ADC0_CHRGRAWDIV;
adc1 = MC13XXX_ADC1_ADEN | MC13XXX_ADC1_ADTRIGIGN | MC13XXX_ADC1_ASC; adc1 = MC13XXX_ADC1_ADEN | MC13XXX_ADC1_ADTRIGIGN | MC13XXX_ADC1_ASC;
if (channel > 7) if (channel > 7)

View File

@@ -272,7 +272,7 @@ static int _scif_prog_signal(scif_epd_t epd, dma_addr_t dst, u64 val)
dma_fail: dma_fail:
if (!x100) if (!x100)
dma_pool_free(ep->remote_dev->signal_pool, status, dma_pool_free(ep->remote_dev->signal_pool, status,
status->src_dma_addr); src - offsetof(struct scif_status, val));
alloc_fail: alloc_fail:
return err; return err;
} }

View File

@@ -870,6 +870,7 @@ static void msdc_start_command(struct msdc_host *host,
WARN_ON(host->cmd); WARN_ON(host->cmd);
host->cmd = cmd; host->cmd = cmd;
mod_delayed_work(system_wq, &host->req_timeout, DAT_TIMEOUT);
if (!msdc_cmd_is_ready(host, mrq, cmd)) if (!msdc_cmd_is_ready(host, mrq, cmd))
return; return;
@@ -881,7 +882,6 @@ static void msdc_start_command(struct msdc_host *host,
cmd->error = 0; cmd->error = 0;
rawcmd = msdc_cmd_prepare_raw_cmd(host, mrq, cmd); rawcmd = msdc_cmd_prepare_raw_cmd(host, mrq, cmd);
mod_delayed_work(system_wq, &host->req_timeout, DAT_TIMEOUT);
sdr_set_bits(host->base + MSDC_INTEN, cmd_ints_mask); sdr_set_bits(host->base + MSDC_INTEN, cmd_ints_mask);
writel(cmd->arg, host->base + SDC_ARG); writel(cmd->arg, host->base + SDC_ARG);

View File

@@ -17,7 +17,7 @@ if NET_VENDOR_AMAZON
config ENA_ETHERNET config ENA_ETHERNET
tristate "Elastic Network Adapter (ENA) support" tristate "Elastic Network Adapter (ENA) support"
depends on (PCI_MSI && X86) depends on PCI_MSI && !CPU_BIG_ENDIAN
---help--- ---help---
This driver supports Elastic Network Adapter (ENA)" This driver supports Elastic Network Adapter (ENA)"

View File

@@ -1078,7 +1078,7 @@ static int bcmgenet_power_down(struct bcmgenet_priv *priv,
break; break;
} }
return 0; return ret;
} }
static void bcmgenet_power_up(struct bcmgenet_priv *priv, static void bcmgenet_power_up(struct bcmgenet_priv *priv,

View File

@@ -65,9 +65,15 @@
* *
* The 40 bit 82580 SYSTIM overflows every * The 40 bit 82580 SYSTIM overflows every
* 2^40 * 10^-9 / 60 = 18.3 minutes. * 2^40 * 10^-9 / 60 = 18.3 minutes.
*
* SYSTIM is converted to real time using a timecounter. As
* timecounter_cyc2time() allows old timestamps, the timecounter
* needs to be updated at least once per half of the SYSTIM interval.
* Scheduling of delayed work is not very accurate, so we aim for 8
* minutes to be sure the actual interval is shorter than 9.16 minutes.
*/ */
#define IGB_SYSTIM_OVERFLOW_PERIOD (HZ * 60 * 9) #define IGB_SYSTIM_OVERFLOW_PERIOD (HZ * 60 * 8)
#define IGB_PTP_TX_TIMEOUT (HZ * 15) #define IGB_PTP_TX_TIMEOUT (HZ * 15)
#define INCPERIOD_82576 BIT(E1000_TIMINCA_16NS_SHIFT) #define INCPERIOD_82576 BIT(E1000_TIMINCA_16NS_SHIFT)
#define INCVALUE_82576_MASK GENMASK(E1000_TIMINCA_16NS_SHIFT - 1, 0) #define INCVALUE_82576_MASK GENMASK(E1000_TIMINCA_16NS_SHIFT - 1, 0)

View File

@@ -1679,6 +1679,7 @@ static int mlx4_en_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
err = mlx4_en_get_flow(dev, cmd, cmd->fs.location); err = mlx4_en_get_flow(dev, cmd, cmd->fs.location);
break; break;
case ETHTOOL_GRXCLSRLALL: case ETHTOOL_GRXCLSRLALL:
cmd->data = MAX_NUM_OF_FS_RULES;
while ((!err || err == -ENOENT) && priority < cmd->rule_cnt) { while ((!err || err == -ENOENT) && priority < cmd->rule_cnt) {
err = mlx4_en_get_flow(dev, cmd, i); err = mlx4_en_get_flow(dev, cmd, i);
if (!err) if (!err)

View File

@@ -1757,7 +1757,7 @@ int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw,
unlock: unlock:
mutex_unlock(&esw->state_lock); mutex_unlock(&esw->state_lock);
return 0; return err;
} }
int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw, int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,

View File

@@ -883,7 +883,7 @@ static u8 qlcnic_dcb_get_capability(struct net_device *netdev, int capid,
struct qlcnic_adapter *adapter = netdev_priv(netdev); struct qlcnic_adapter *adapter = netdev_priv(netdev);
if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state)) if (!test_bit(QLCNIC_DCB_STATE, &adapter->dcb->state))
return 0; return 1;
switch (capid) { switch (capid) {
case DCB_CAP_ATTR_PG: case DCB_CAP_ATTR_PG:

View File

@@ -1320,7 +1320,8 @@ void efx_ptp_remove(struct efx_nic *efx)
(void)efx_ptp_disable(efx); (void)efx_ptp_disable(efx);
cancel_work_sync(&efx->ptp_data->work); cancel_work_sync(&efx->ptp_data->work);
cancel_work_sync(&efx->ptp_data->pps_work); if (efx->ptp_data->pps_workwq)
cancel_work_sync(&efx->ptp_data->pps_work);
skb_queue_purge(&efx->ptp_data->rxq); skb_queue_purge(&efx->ptp_data->rxq);
skb_queue_purge(&efx->ptp_data->txq); skb_queue_purge(&efx->ptp_data->txq);

View File

@@ -590,6 +590,7 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable)
/* Clear all mcast from ALE */ /* Clear all mcast from ALE */
cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS, -1); cpsw_ale_flush_multicast(ale, ALE_ALL_PORTS, -1);
__dev_mc_unsync(ndev, NULL);
/* Flood All Unicast Packets to Host port */ /* Flood All Unicast Packets to Host port */
cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1); cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1);

View File

@@ -2798,9 +2798,6 @@ static int macsec_dev_open(struct net_device *dev)
struct net_device *real_dev = macsec->real_dev; struct net_device *real_dev = macsec->real_dev;
int err; int err;
if (!(real_dev->flags & IFF_UP))
return -ENETDOWN;
err = dev_uc_add(real_dev, dev->dev_addr); err = dev_uc_add(real_dev, dev->dev_addr);
if (err < 0) if (err < 0)
return err; return err;
@@ -3275,6 +3272,9 @@ static int macsec_newlink(struct net *net, struct net_device *dev,
if (err < 0) if (err < 0)
goto del_dev; goto del_dev;
netif_stacked_transfer_operstate(real_dev, dev);
linkwatch_fire_event(dev);
macsec_generation++; macsec_generation++;
return 0; return 0;
@@ -3446,6 +3446,20 @@ static int macsec_notify(struct notifier_block *this, unsigned long event,
return NOTIFY_DONE; return NOTIFY_DONE;
switch (event) { switch (event) {
case NETDEV_DOWN:
case NETDEV_UP:
case NETDEV_CHANGE: {
struct macsec_dev *m, *n;
struct macsec_rxh_data *rxd;
rxd = macsec_data_rtnl(real_dev);
list_for_each_entry_safe(m, n, &rxd->secys, secys) {
struct net_device *dev = m->secy.netdev;
netif_stacked_transfer_operstate(real_dev, dev);
}
break;
}
case NETDEV_UNREGISTER: { case NETDEV_UNREGISTER: {
struct macsec_dev *m, *n; struct macsec_dev *m, *n;
struct macsec_rxh_data *rxd; struct macsec_rxh_data *rxd;

View File

@@ -236,7 +236,7 @@ static void ntb_netdev_tx_timer(unsigned long data)
struct ntb_netdev *dev = netdev_priv(ndev); struct ntb_netdev *dev = netdev_priv(ndev);
if (ntb_transport_tx_free_entry(dev->qp) < tx_stop) { if (ntb_transport_tx_free_entry(dev->qp) < tx_stop) {
mod_timer(&dev->tx_timer, jiffies + msecs_to_jiffies(tx_time)); mod_timer(&dev->tx_timer, jiffies + usecs_to_jiffies(tx_time));
} else { } else {
/* Make sure anybody stopping the queue after this sees the new /* Make sure anybody stopping the queue after this sees the new
* value of ntb_transport_tx_free_entry() * value of ntb_transport_tx_free_entry()

View File

@@ -1039,10 +1039,9 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
int ret = 0; int ret = 0;
u32 *buf; u32 *buf;
unsigned int completed_nbytes, orig_nbytes, remaining_bytes; unsigned int completed_nbytes, alloc_nbytes, remaining_bytes;
struct ath10k_ce_pipe *ce_diag; struct ath10k_ce_pipe *ce_diag;
void *data_buf = NULL; void *data_buf = NULL;
u32 ce_data; /* Host buffer address in CE space */
dma_addr_t ce_data_base = 0; dma_addr_t ce_data_base = 0;
int i; int i;
@@ -1056,9 +1055,10 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
* 1) 4-byte alignment * 1) 4-byte alignment
* 2) Buffer in DMA-able space * 2) Buffer in DMA-able space
*/ */
orig_nbytes = nbytes; alloc_nbytes = min_t(unsigned int, nbytes, DIAG_TRANSFER_LIMIT);
data_buf = (unsigned char *)dma_alloc_coherent(ar->dev, data_buf = (unsigned char *)dma_alloc_coherent(ar->dev,
orig_nbytes, alloc_nbytes,
&ce_data_base, &ce_data_base,
GFP_ATOMIC); GFP_ATOMIC);
if (!data_buf) { if (!data_buf) {
@@ -1066,9 +1066,6 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
goto done; goto done;
} }
/* Copy caller's data to allocated DMA buf */
memcpy(data_buf, data, orig_nbytes);
/* /*
* The address supplied by the caller is in the * The address supplied by the caller is in the
* Target CPU virtual address space. * Target CPU virtual address space.
@@ -1081,12 +1078,14 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
*/ */
address = ath10k_pci_targ_cpu_to_ce_addr(ar, address); address = ath10k_pci_targ_cpu_to_ce_addr(ar, address);
remaining_bytes = orig_nbytes; remaining_bytes = nbytes;
ce_data = ce_data_base;
while (remaining_bytes) { while (remaining_bytes) {
/* FIXME: check cast */ /* FIXME: check cast */
nbytes = min_t(int, remaining_bytes, DIAG_TRANSFER_LIMIT); nbytes = min_t(int, remaining_bytes, DIAG_TRANSFER_LIMIT);
/* Copy caller's data to allocated DMA buf */
memcpy(data_buf, data, nbytes);
/* Set up to receive directly into Target(!) address */ /* Set up to receive directly into Target(!) address */
ret = __ath10k_ce_rx_post_buf(ce_diag, &address, address); ret = __ath10k_ce_rx_post_buf(ce_diag, &address, address);
if (ret != 0) if (ret != 0)
@@ -1096,7 +1095,7 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
* Request CE to send caller-supplied data that * Request CE to send caller-supplied data that
* was copied to bounce buffer to Target(!) address. * was copied to bounce buffer to Target(!) address.
*/ */
ret = ath10k_ce_send_nolock(ce_diag, NULL, (u32)ce_data, ret = ath10k_ce_send_nolock(ce_diag, NULL, ce_data_base,
nbytes, 0, 0); nbytes, 0, 0);
if (ret != 0) if (ret != 0)
goto done; goto done;
@@ -1137,12 +1136,12 @@ int ath10k_pci_diag_write_mem(struct ath10k *ar, u32 address,
remaining_bytes -= nbytes; remaining_bytes -= nbytes;
address += nbytes; address += nbytes;
ce_data += nbytes; data += nbytes;
} }
done: done:
if (data_buf) { if (data_buf) {
dma_free_coherent(ar->dev, orig_nbytes, data_buf, dma_free_coherent(ar->dev, alloc_nbytes, data_buf,
ce_data_base); ce_data_base);
} }

View File

@@ -4115,7 +4115,7 @@ static void ar9003_hw_thermometer_apply(struct ath_hw *ah)
static void ar9003_hw_thermo_cal_apply(struct ath_hw *ah) static void ar9003_hw_thermo_cal_apply(struct ath_hw *ah)
{ {
u32 data, ko, kg; u32 data = 0, ko, kg;
if (!AR_SREV_9462_20_OR_LATER(ah)) if (!AR_SREV_9462_20_OR_LATER(ah))
return; return;

View File

@@ -502,6 +502,7 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
} }
spin_lock_bh(&wl->lock); spin_lock_bh(&wl->lock);
wl->wlc->vif = vif;
wl->mute_tx = false; wl->mute_tx = false;
brcms_c_mute(wl->wlc, false); brcms_c_mute(wl->wlc, false);
if (vif->type == NL80211_IFTYPE_STATION) if (vif->type == NL80211_IFTYPE_STATION)
@@ -519,6 +520,11 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
static void static void
brcms_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) brcms_ops_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{ {
struct brcms_info *wl = hw->priv;
spin_lock_bh(&wl->lock);
wl->wlc->vif = NULL;
spin_unlock_bh(&wl->lock);
} }
static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed) static int brcms_ops_config(struct ieee80211_hw *hw, u32 changed)
@@ -840,8 +846,8 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
status = brcms_c_aggregatable(wl->wlc, tid); status = brcms_c_aggregatable(wl->wlc, tid);
spin_unlock_bh(&wl->lock); spin_unlock_bh(&wl->lock);
if (!status) { if (!status) {
brcms_err(wl->wlc->hw->d11core, brcms_dbg_ht(wl->wlc->hw->d11core,
"START: tid %d is not agg\'able\n", tid); "START: tid %d is not agg\'able\n", tid);
return -EINVAL; return -EINVAL;
} }
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid); ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
@@ -937,6 +943,25 @@ static void brcms_ops_set_tsf(struct ieee80211_hw *hw,
spin_unlock_bh(&wl->lock); spin_unlock_bh(&wl->lock);
} }
static int brcms_ops_beacon_set_tim(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, bool set)
{
struct brcms_info *wl = hw->priv;
struct sk_buff *beacon = NULL;
u16 tim_offset = 0;
spin_lock_bh(&wl->lock);
if (wl->wlc->vif)
beacon = ieee80211_beacon_get_tim(hw, wl->wlc->vif,
&tim_offset, NULL);
if (beacon)
brcms_c_set_new_beacon(wl->wlc, beacon, tim_offset,
wl->wlc->vif->bss_conf.dtim_period);
spin_unlock_bh(&wl->lock);
return 0;
}
static const struct ieee80211_ops brcms_ops = { static const struct ieee80211_ops brcms_ops = {
.tx = brcms_ops_tx, .tx = brcms_ops_tx,
.start = brcms_ops_start, .start = brcms_ops_start,
@@ -955,6 +980,7 @@ static const struct ieee80211_ops brcms_ops = {
.flush = brcms_ops_flush, .flush = brcms_ops_flush,
.get_tsf = brcms_ops_get_tsf, .get_tsf = brcms_ops_get_tsf,
.set_tsf = brcms_ops_set_tsf, .set_tsf = brcms_ops_set_tsf,
.set_tim = brcms_ops_beacon_set_tim,
}; };
void brcms_dpc(unsigned long data) void brcms_dpc(unsigned long data)

View File

@@ -563,6 +563,7 @@ struct brcms_c_info {
struct wiphy *wiphy; struct wiphy *wiphy;
struct scb pri_scb; struct scb pri_scb;
struct ieee80211_vif *vif;
struct sk_buff *beacon; struct sk_buff *beacon;
u16 beacon_tim_offset; u16 beacon_tim_offset;

View File

@@ -5472,7 +5472,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
we have to add a spin lock... */ we have to add a spin lock... */
rc = readBSSListRid(ai, doLoseSync, &BSSList_rid); rc = readBSSListRid(ai, doLoseSync, &BSSList_rid);
while(rc == 0 && BSSList_rid.index != cpu_to_le16(0xffff)) { while(rc == 0 && BSSList_rid.index != cpu_to_le16(0xffff)) {
ptr += sprintf(ptr, "%pM %*s rssi = %d", ptr += sprintf(ptr, "%pM %.*s rssi = %d",
BSSList_rid.bssid, BSSList_rid.bssid,
(int)BSSList_rid.ssidLen, (int)BSSList_rid.ssidLen,
BSSList_rid.ssid, BSSList_rid.ssid,

View File

@@ -364,11 +364,20 @@ mwifiex_cfg80211_set_tx_power(struct wiphy *wiphy,
struct mwifiex_power_cfg power_cfg; struct mwifiex_power_cfg power_cfg;
int dbm = MBM_TO_DBM(mbm); int dbm = MBM_TO_DBM(mbm);
if (type == NL80211_TX_POWER_FIXED) { switch (type) {
case NL80211_TX_POWER_FIXED:
power_cfg.is_power_auto = 0; power_cfg.is_power_auto = 0;
power_cfg.is_power_fixed = 1;
power_cfg.power_level = dbm; power_cfg.power_level = dbm;
} else { break;
case NL80211_TX_POWER_LIMITED:
power_cfg.is_power_auto = 0;
power_cfg.is_power_fixed = 0;
power_cfg.power_level = dbm;
break;
case NL80211_TX_POWER_AUTOMATIC:
power_cfg.is_power_auto = 1; power_cfg.is_power_auto = 1;
break;
} }
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);

View File

@@ -265,6 +265,7 @@ struct mwifiex_ds_encrypt_key {
struct mwifiex_power_cfg { struct mwifiex_power_cfg {
u32 is_power_auto; u32 is_power_auto;
u32 is_power_fixed;
u32 power_level; u32 power_level;
}; };

View File

@@ -728,6 +728,9 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
txp_cfg = (struct host_cmd_ds_txpwr_cfg *) buf; txp_cfg = (struct host_cmd_ds_txpwr_cfg *) buf;
txp_cfg->action = cpu_to_le16(HostCmd_ACT_GEN_SET); txp_cfg->action = cpu_to_le16(HostCmd_ACT_GEN_SET);
if (!power_cfg->is_power_auto) { if (!power_cfg->is_power_auto) {
u16 dbm_min = power_cfg->is_power_fixed ?
dbm : priv->min_tx_power_level;
txp_cfg->mode = cpu_to_le32(1); txp_cfg->mode = cpu_to_le32(1);
pg_tlv = (struct mwifiex_types_power_group *) pg_tlv = (struct mwifiex_types_power_group *)
(buf + sizeof(struct host_cmd_ds_txpwr_cfg)); (buf + sizeof(struct host_cmd_ds_txpwr_cfg));
@@ -742,7 +745,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
pg->last_rate_code = 0x03; pg->last_rate_code = 0x03;
pg->modulation_class = MOD_CLASS_HR_DSSS; pg->modulation_class = MOD_CLASS_HR_DSSS;
pg->power_step = 0; pg->power_step = 0;
pg->power_min = (s8) dbm; pg->power_min = (s8) dbm_min;
pg->power_max = (s8) dbm; pg->power_max = (s8) dbm;
pg++; pg++;
/* Power group for modulation class OFDM */ /* Power group for modulation class OFDM */
@@ -750,7 +753,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
pg->last_rate_code = 0x07; pg->last_rate_code = 0x07;
pg->modulation_class = MOD_CLASS_OFDM; pg->modulation_class = MOD_CLASS_OFDM;
pg->power_step = 0; pg->power_step = 0;
pg->power_min = (s8) dbm; pg->power_min = (s8) dbm_min;
pg->power_max = (s8) dbm; pg->power_max = (s8) dbm;
pg++; pg++;
/* Power group for modulation class HTBW20 */ /* Power group for modulation class HTBW20 */
@@ -758,7 +761,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
pg->last_rate_code = 0x20; pg->last_rate_code = 0x20;
pg->modulation_class = MOD_CLASS_HT; pg->modulation_class = MOD_CLASS_HT;
pg->power_step = 0; pg->power_step = 0;
pg->power_min = (s8) dbm; pg->power_min = (s8) dbm_min;
pg->power_max = (s8) dbm; pg->power_max = (s8) dbm;
pg->ht_bandwidth = HT_BW_20; pg->ht_bandwidth = HT_BW_20;
pg++; pg++;
@@ -767,7 +770,7 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv,
pg->last_rate_code = 0x20; pg->last_rate_code = 0x20;
pg->modulation_class = MOD_CLASS_HT; pg->modulation_class = MOD_CLASS_HT;
pg->power_step = 0; pg->power_step = 0;
pg->power_min = (s8) dbm; pg->power_min = (s8) dbm_min;
pg->power_max = (s8) dbm; pg->power_max = (s8) dbm;
pg->ht_bandwidth = HT_BW_40; pg->ht_bandwidth = HT_BW_40;
} }

View File

@@ -5660,6 +5660,7 @@ static int rtl8xxxu_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
break; break;
case WLAN_CIPHER_SUITE_TKIP: case WLAN_CIPHER_SUITE_TKIP:
key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC; key->flags |= IEEE80211_KEY_FLAG_GENERATE_MMIC;
break;
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }

View File

@@ -234,7 +234,7 @@ static int _rtl92d_fw_init(struct ieee80211_hw *hw)
rtl_read_byte(rtlpriv, FW_MAC1_READY)); rtl_read_byte(rtlpriv, FW_MAC1_READY));
} }
RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG, RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
"Polling FW ready fail!! REG_MCUFWDL:0x%08ul\n", "Polling FW ready fail!! REG_MCUFWDL:0x%08x\n",
rtl_read_dword(rtlpriv, REG_MCUFWDL)); rtl_read_dword(rtlpriv, REG_MCUFWDL));
return -1; return -1;
} }

View File

@@ -66,7 +66,7 @@ wlcore_vendor_cmd_smart_config_start(struct wiphy *wiphy,
out: out:
mutex_unlock(&wl->mutex); mutex_unlock(&wl->mutex);
return 0; return ret;
} }
static int static int

View File

@@ -791,7 +791,7 @@ static int port100_send_frame_async(struct port100 *dev, struct sk_buff *out,
rc = port100_submit_urb_for_ack(dev, GFP_KERNEL); rc = port100_submit_urb_for_ack(dev, GFP_KERNEL);
if (rc) if (rc)
usb_unlink_urb(dev->out_urb); usb_kill_urb(dev->out_urb);
exit: exit:
mutex_unlock(&dev->out_urb_lock); mutex_unlock(&dev->out_urb_lock);

View File

@@ -330,7 +330,7 @@ static inline int ndev_db_clear_mask(struct intel_ntb_dev *ndev, u64 db_bits,
return 0; return 0;
} }
static inline int ndev_vec_mask(struct intel_ntb_dev *ndev, int db_vector) static inline u64 ndev_vec_mask(struct intel_ntb_dev *ndev, int db_vector)
{ {
u64 shift, mask; u64 shift, mask;

View File

@@ -43,6 +43,7 @@
#define PCIE_RC_K2HK 0xb008 #define PCIE_RC_K2HK 0xb008
#define PCIE_RC_K2E 0xb009 #define PCIE_RC_K2E 0xb009
#define PCIE_RC_K2L 0xb00a #define PCIE_RC_K2L 0xb00a
#define PCIE_RC_K2G 0xb00b
#define to_keystone_pcie(x) container_of(x, struct keystone_pcie, pp) #define to_keystone_pcie(x) container_of(x, struct keystone_pcie, pp)
@@ -57,6 +58,8 @@ static void quirk_limit_mrrs(struct pci_dev *dev)
.class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, }, .class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, },
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2L), { PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2L),
.class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, }, .class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, },
{ PCI_DEVICE(PCI_VENDOR_ID_TI, PCIE_RC_K2G),
.class = PCI_CLASS_BRIDGE_PCI << 8, .class_mask = ~0, },
{ 0, }, { 0, },
}; };

View File

@@ -630,14 +630,8 @@ static const struct pinctrl_pin_desc lpc18xx_pins[] = {
LPC18XX_PIN(i2c0_sda, PIN_I2C0_SDA), LPC18XX_PIN(i2c0_sda, PIN_I2C0_SDA),
}; };
/** /* PIN_CONFIG_GPIO_PIN_INT: route gpio to the gpio pin interrupt controller */
* enum lpc18xx_pin_config_param - possible pin configuration parameters #define PIN_CONFIG_GPIO_PIN_INT (PIN_CONFIG_END + 1)
* @PIN_CONFIG_GPIO_PIN_INT: route gpio to the gpio pin interrupt
* controller.
*/
enum lpc18xx_pin_config_param {
PIN_CONFIG_GPIO_PIN_INT = PIN_CONFIG_END + 1,
};
static const struct pinconf_generic_params lpc18xx_params[] = { static const struct pinconf_generic_params lpc18xx_params[] = {
{"nxp,gpio-pin-interrupt", PIN_CONFIG_GPIO_PIN_INT, 0}, {"nxp,gpio-pin-interrupt", PIN_CONFIG_GPIO_PIN_INT, 0},

View File

@@ -967,15 +967,12 @@ enum zynq_io_standards {
zynq_iostd_max zynq_iostd_max
}; };
/** /*
* enum zynq_pin_config_param - possible pin configuration parameters * PIN_CONFIG_IOSTANDARD: if the pin can select an IO standard, the argument to
* @PIN_CONFIG_IOSTANDARD: if the pin can select an IO standard, the argument to
* this parameter (on a custom format) tells the driver which alternative * this parameter (on a custom format) tells the driver which alternative
* IO standard to use. * IO standard to use.
*/ */
enum zynq_pin_config_param { #define PIN_CONFIG_IOSTANDARD (PIN_CONFIG_END + 1)
PIN_CONFIG_IOSTANDARD = PIN_CONFIG_END + 1,
};
static const struct pinconf_generic_params zynq_dt_params[] = { static const struct pinconf_generic_params zynq_dt_params[] = {
{"io-standard", PIN_CONFIG_IOSTANDARD, zynq_iostd_lvcmos18}, {"io-standard", PIN_CONFIG_IOSTANDARD, zynq_iostd_lvcmos18},

View File

@@ -790,10 +790,23 @@ static int pmic_gpio_probe(struct platform_device *pdev)
return ret; return ret;
} }
ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0, npins); /*
if (ret) { * For DeviceTree-supported systems, the gpio core checks the
dev_err(dev, "failed to add pin range\n"); * pinctrl's device node for the "gpio-ranges" property.
goto err_range; * If it is present, it takes care of adding the pin ranges
* for the driver. In this case the driver can skip ahead.
*
* In order to remain compatible with older, existing DeviceTree
* files which don't set the "gpio-ranges" property or systems that
* utilize ACPI the driver has to call gpiochip_add_pin_range().
*/
if (!of_property_read_bool(dev->of_node, "gpio-ranges")) {
ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0,
npins);
if (ret) {
dev_err(dev, "failed to add pin range\n");
goto err_range;
}
} }
return 0; return 0;

View File

@@ -78,10 +78,12 @@ static bool asus_q500a_i8042_filter(unsigned char data, unsigned char str,
static struct quirk_entry quirk_asus_unknown = { static struct quirk_entry quirk_asus_unknown = {
.wapf = 0, .wapf = 0,
.wmi_backlight_set_devstate = true,
}; };
static struct quirk_entry quirk_asus_q500a = { static struct quirk_entry quirk_asus_q500a = {
.i8042_filter = asus_q500a_i8042_filter, .i8042_filter = asus_q500a_i8042_filter,
.wmi_backlight_set_devstate = true,
}; };
/* /*
@@ -92,15 +94,18 @@ static struct quirk_entry quirk_asus_q500a = {
static struct quirk_entry quirk_asus_x55u = { static struct quirk_entry quirk_asus_x55u = {
.wapf = 4, .wapf = 4,
.wmi_backlight_power = true, .wmi_backlight_power = true,
.wmi_backlight_set_devstate = true,
.no_display_toggle = true, .no_display_toggle = true,
}; };
static struct quirk_entry quirk_asus_wapf4 = { static struct quirk_entry quirk_asus_wapf4 = {
.wapf = 4, .wapf = 4,
.wmi_backlight_set_devstate = true,
}; };
static struct quirk_entry quirk_asus_x200ca = { static struct quirk_entry quirk_asus_x200ca = {
.wapf = 2, .wapf = 2,
.wmi_backlight_set_devstate = true,
}; };
static struct quirk_entry quirk_no_rfkill = { static struct quirk_entry quirk_no_rfkill = {
@@ -114,13 +119,16 @@ static struct quirk_entry quirk_no_rfkill_wapf4 = {
static struct quirk_entry quirk_asus_ux303ub = { static struct quirk_entry quirk_asus_ux303ub = {
.wmi_backlight_native = true, .wmi_backlight_native = true,
.wmi_backlight_set_devstate = true,
}; };
static struct quirk_entry quirk_asus_x550lb = { static struct quirk_entry quirk_asus_x550lb = {
.wmi_backlight_set_devstate = true,
.xusb2pr = 0x01D9, .xusb2pr = 0x01D9,
}; };
static struct quirk_entry quirk_asus_ux330uak = { static struct quirk_entry quirk_asus_forceals = {
.wmi_backlight_set_devstate = true,
.wmi_force_als_set = true, .wmi_force_als_set = true,
}; };
@@ -431,7 +439,7 @@ static const struct dmi_system_id asus_quirks[] = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "UX330UAK"), DMI_MATCH(DMI_PRODUCT_NAME, "UX330UAK"),
}, },
.driver_data = &quirk_asus_ux330uak, .driver_data = &quirk_asus_forceals,
}, },
{ {
.callback = dmi_matched, .callback = dmi_matched,
@@ -442,6 +450,15 @@ static const struct dmi_system_id asus_quirks[] = {
}, },
.driver_data = &quirk_asus_x550lb, .driver_data = &quirk_asus_x550lb,
}, },
{
.callback = dmi_matched,
.ident = "ASUSTeK COMPUTER INC. UX430UQ",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "UX430UQ"),
},
.driver_data = &quirk_asus_forceals,
},
{}, {},
}; };

View File

@@ -2154,7 +2154,7 @@ static int asus_wmi_add(struct platform_device *pdev)
err = asus_wmi_backlight_init(asus); err = asus_wmi_backlight_init(asus);
if (err && err != -ENODEV) if (err && err != -ENODEV)
goto fail_backlight; goto fail_backlight;
} else } else if (asus->driver->quirks->wmi_backlight_set_devstate)
err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL); err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL);
status = wmi_install_notify_handler(asus->driver->event_guid, status = wmi_install_notify_handler(asus->driver->event_guid,

View File

@@ -45,6 +45,7 @@ struct quirk_entry {
bool store_backlight_power; bool store_backlight_power;
bool wmi_backlight_power; bool wmi_backlight_power;
bool wmi_backlight_native; bool wmi_backlight_native;
bool wmi_backlight_set_devstate;
bool wmi_force_als_set; bool wmi_force_als_set;
int wapf; int wapf;
/* /*

View File

@@ -106,7 +106,7 @@ static int s35390a_get_reg(struct s35390a *s35390a, int reg, char *buf, int len)
*/ */
static int s35390a_reset(struct s35390a *s35390a, char *status1) static int s35390a_reset(struct s35390a *s35390a, char *status1)
{ {
char buf; u8 buf;
int ret; int ret;
unsigned initcount = 0; unsigned initcount = 0;

View File

@@ -1972,6 +1972,11 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left)
xferred -= psge->length; xferred -= psge->length;
} else { } else {
/* Partial SG entry done */ /* Partial SG entry done */
pci_dma_sync_single_for_cpu(srb->dcb->
acb->dev,
srb->sg_bus_addr,
SEGMENTX_LEN,
PCI_DMA_TODEVICE);
psge->length -= xferred; psge->length -= xferred;
psge->address += xferred; psge->address += xferred;
srb->sg_index = idx; srb->sg_index = idx;
@@ -3450,14 +3455,12 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
} }
} }
if (dir != PCI_DMA_NONE && scsi_sg_count(cmd))
pci_dma_sync_sg_for_cpu(acb->dev, scsi_sglist(cmd),
scsi_sg_count(cmd), dir);
ckc_only = 0; ckc_only = 0;
/* Check Error Conditions */ /* Check Error Conditions */
ckc_e: ckc_e:
pci_unmap_srb(acb, srb);
if (cmd->cmnd[0] == INQUIRY) { if (cmd->cmnd[0] == INQUIRY) {
unsigned char *base = NULL; unsigned char *base = NULL;
struct ScsiInqData *ptr; struct ScsiInqData *ptr;
@@ -3511,7 +3514,6 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
cmd, cmd->result); cmd, cmd->result);
srb_free_insert(acb, srb); srb_free_insert(acb, srb);
} }
pci_unmap_srb(acb, srb);
cmd->scsi_done(cmd); cmd->scsi_done(cmd);
waiting_process_next(acb); waiting_process_next(acb);

View File

@@ -3500,6 +3500,7 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb)
case START_STOP: case START_STOP:
scb->scsi_cmd->result = DID_OK << 16; scb->scsi_cmd->result = DID_OK << 16;
break;
case TEST_UNIT_READY: case TEST_UNIT_READY:
case INQUIRY: case INQUIRY:

View File

@@ -2717,9 +2717,9 @@ enum sci_status sci_controller_continue_io(struct isci_request *ireq)
* the task management request. * the task management request.
* @task_request: the handle to the task request object to start. * @task_request: the handle to the task request object to start.
*/ */
enum sci_task_status sci_controller_start_task(struct isci_host *ihost, enum sci_status sci_controller_start_task(struct isci_host *ihost,
struct isci_remote_device *idev, struct isci_remote_device *idev,
struct isci_request *ireq) struct isci_request *ireq)
{ {
enum sci_status status; enum sci_status status;
@@ -2728,7 +2728,7 @@ enum sci_task_status sci_controller_start_task(struct isci_host *ihost,
"%s: SCIC Controller starting task from invalid " "%s: SCIC Controller starting task from invalid "
"state\n", "state\n",
__func__); __func__);
return SCI_TASK_FAILURE_INVALID_STATE; return SCI_FAILURE_INVALID_STATE;
} }
status = sci_remote_device_start_task(ihost, idev, ireq); status = sci_remote_device_start_task(ihost, idev, ireq);

View File

@@ -490,7 +490,7 @@ enum sci_status sci_controller_start_io(
struct isci_remote_device *idev, struct isci_remote_device *idev,
struct isci_request *ireq); struct isci_request *ireq);
enum sci_task_status sci_controller_start_task( enum sci_status sci_controller_start_task(
struct isci_host *ihost, struct isci_host *ihost,
struct isci_remote_device *idev, struct isci_remote_device *idev,
struct isci_request *ireq); struct isci_request *ireq);

View File

@@ -1626,9 +1626,9 @@ static enum sci_status atapi_d2h_reg_frame_handler(struct isci_request *ireq,
if (status == SCI_SUCCESS) { if (status == SCI_SUCCESS) {
if (ireq->stp.rsp.status & ATA_ERR) if (ireq->stp.rsp.status & ATA_ERR)
status = SCI_IO_FAILURE_RESPONSE_VALID; status = SCI_FAILURE_IO_RESPONSE_VALID;
} else { } else {
status = SCI_IO_FAILURE_RESPONSE_VALID; status = SCI_FAILURE_IO_RESPONSE_VALID;
} }
if (status != SCI_SUCCESS) { if (status != SCI_SUCCESS) {

View File

@@ -258,7 +258,7 @@ static int isci_task_execute_tmf(struct isci_host *ihost,
struct isci_tmf *tmf, unsigned long timeout_ms) struct isci_tmf *tmf, unsigned long timeout_ms)
{ {
DECLARE_COMPLETION_ONSTACK(completion); DECLARE_COMPLETION_ONSTACK(completion);
enum sci_task_status status = SCI_TASK_FAILURE; enum sci_status status = SCI_FAILURE;
struct isci_request *ireq; struct isci_request *ireq;
int ret = TMF_RESP_FUNC_FAILED; int ret = TMF_RESP_FUNC_FAILED;
unsigned long flags; unsigned long flags;
@@ -301,7 +301,7 @@ static int isci_task_execute_tmf(struct isci_host *ihost,
/* start the TMF io. */ /* start the TMF io. */
status = sci_controller_start_task(ihost, idev, ireq); status = sci_controller_start_task(ihost, idev, ireq);
if (status != SCI_TASK_SUCCESS) { if (status != SCI_SUCCESS) {
dev_dbg(&ihost->pdev->dev, dev_dbg(&ihost->pdev->dev,
"%s: start_io failed - status = 0x%x, request = %p\n", "%s: start_io failed - status = 0x%x, request = %p\n",
__func__, __func__,

View File

@@ -798,7 +798,8 @@ static int iscsi_sw_tcp_host_get_param(struct Scsi_Host *shost,
return rc; return rc;
return iscsi_conn_get_addr_param((struct sockaddr_storage *) return iscsi_conn_get_addr_param((struct sockaddr_storage *)
&addr, param, buf); &addr,
(enum iscsi_param)param, buf);
default: default:
return iscsi_host_get_param(shost, param, buf); return iscsi_host_get_param(shost, param, buf);
} }

View File

@@ -1141,6 +1141,7 @@ stop_rr_fcf_flogi:
phba->fcf.fcf_flag &= ~FCF_DISCOVERY; phba->fcf.fcf_flag &= ~FCF_DISCOVERY;
phba->hba_flag &= ~(FCF_RR_INPROG | HBA_DEVLOSS_TMO); phba->hba_flag &= ~(FCF_RR_INPROG | HBA_DEVLOSS_TMO);
spin_unlock_irq(&phba->hbalock); spin_unlock_irq(&phba->hbalock);
phba->fcf.fcf_redisc_attempted = 0; /* reset */
goto out; goto out;
} }
if (!rc) { if (!rc) {
@@ -1155,6 +1156,7 @@ stop_rr_fcf_flogi:
phba->fcf.fcf_flag &= ~FCF_DISCOVERY; phba->fcf.fcf_flag &= ~FCF_DISCOVERY;
phba->hba_flag &= ~(FCF_RR_INPROG | HBA_DEVLOSS_TMO); phba->hba_flag &= ~(FCF_RR_INPROG | HBA_DEVLOSS_TMO);
spin_unlock_irq(&phba->hbalock); spin_unlock_irq(&phba->hbalock);
phba->fcf.fcf_redisc_attempted = 0; /* reset */
goto out; goto out;
} }
} }

View File

@@ -1969,6 +1969,26 @@ int lpfc_sli4_fcf_rr_next_proc(struct lpfc_vport *vport, uint16_t fcf_index)
"failover and change port state:x%x/x%x\n", "failover and change port state:x%x/x%x\n",
phba->pport->port_state, LPFC_VPORT_UNKNOWN); phba->pport->port_state, LPFC_VPORT_UNKNOWN);
phba->pport->port_state = LPFC_VPORT_UNKNOWN; phba->pport->port_state = LPFC_VPORT_UNKNOWN;
if (!phba->fcf.fcf_redisc_attempted) {
lpfc_unregister_fcf(phba);
rc = lpfc_sli4_redisc_fcf_table(phba);
if (!rc) {
lpfc_printf_log(phba, KERN_INFO, LOG_FIP,
"3195 Rediscover FCF table\n");
phba->fcf.fcf_redisc_attempted = 1;
lpfc_sli4_clear_fcf_rr_bmask(phba);
} else {
lpfc_printf_log(phba, KERN_WARNING, LOG_FIP,
"3196 Rediscover FCF table "
"failed. Status:x%x\n", rc);
}
} else {
lpfc_printf_log(phba, KERN_WARNING, LOG_FIP,
"3197 Already rediscover FCF table "
"attempted. No more retry\n");
}
goto stop_flogi_current_fcf; goto stop_flogi_current_fcf;
} else { } else {
lpfc_printf_log(phba, KERN_INFO, LOG_FIP | LOG_ELS, lpfc_printf_log(phba, KERN_INFO, LOG_FIP | LOG_ELS,

View File

@@ -4444,7 +4444,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba,
break; break;
} }
/* If fast FCF failover rescan event is pending, do nothing */ /* If fast FCF failover rescan event is pending, do nothing */
if (phba->fcf.fcf_flag & FCF_REDISC_EVT) { if (phba->fcf.fcf_flag & (FCF_REDISC_EVT | FCF_REDISC_PEND)) {
spin_unlock_irq(&phba->hbalock); spin_unlock_irq(&phba->hbalock);
break; break;
} }

View File

@@ -16553,15 +16553,8 @@ next_priority:
goto initial_priority; goto initial_priority;
lpfc_printf_log(phba, KERN_WARNING, LOG_FIP, lpfc_printf_log(phba, KERN_WARNING, LOG_FIP,
"2844 No roundrobin failover FCF available\n"); "2844 No roundrobin failover FCF available\n");
if (next_fcf_index >= LPFC_SLI4_FCF_TBL_INDX_MAX)
return LPFC_FCOE_FCF_NEXT_NONE; return LPFC_FCOE_FCF_NEXT_NONE;
else {
lpfc_printf_log(phba, KERN_WARNING, LOG_FIP,
"3063 Only FCF available idx %d, flag %x\n",
next_fcf_index,
phba->fcf.fcf_pri[next_fcf_index].fcf_rec.flag);
return next_fcf_index;
}
} }
if (next_fcf_index < LPFC_SLI4_FCF_TBL_INDX_MAX && if (next_fcf_index < LPFC_SLI4_FCF_TBL_INDX_MAX &&

View File

@@ -237,6 +237,7 @@ struct lpfc_fcf {
#define FCF_REDISC_EVT 0x100 /* FCF rediscovery event to worker thread */ #define FCF_REDISC_EVT 0x100 /* FCF rediscovery event to worker thread */
#define FCF_REDISC_FOV 0x200 /* Post FCF rediscovery fast failover */ #define FCF_REDISC_FOV 0x200 /* Post FCF rediscovery fast failover */
#define FCF_REDISC_PROG (FCF_REDISC_PEND | FCF_REDISC_EVT) #define FCF_REDISC_PROG (FCF_REDISC_PEND | FCF_REDISC_EVT)
uint16_t fcf_redisc_attempted;
uint32_t addr_mode; uint32_t addr_mode;
uint32_t eligible_fcf_cnt; uint32_t eligible_fcf_cnt;
struct lpfc_fcf_rec current_rec; struct lpfc_fcf_rec current_rec;

View File

@@ -3694,12 +3694,12 @@ megasas_transition_to_ready(struct megasas_instance *instance, int ocr)
/* /*
* The cur_state should not last for more than max_wait secs * The cur_state should not last for more than max_wait secs
*/ */
for (i = 0; i < (max_wait * 1000); i++) { for (i = 0; i < max_wait; i++) {
curr_abs_state = instance->instancet-> curr_abs_state = instance->instancet->
read_fw_status_reg(instance->reg_set); read_fw_status_reg(instance->reg_set);
if (abs_state == curr_abs_state) { if (abs_state == curr_abs_state) {
msleep(1); msleep(1000);
} else } else
break; break;
} }

View File

@@ -674,10 +674,6 @@ mpt3sas_config_set_manufacturing_pg11(struct MPT3SAS_ADAPTER *ioc,
r = _config_request(ioc, &mpi_request, mpi_reply, r = _config_request(ioc, &mpi_request, mpi_reply,
MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page, MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
sizeof(*config_page)); sizeof(*config_page));
mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM;
r = _config_request(ioc, &mpi_request, mpi_reply,
MPT3_CONFIG_PAGE_DEFAULT_TIMEOUT, config_page,
sizeof(*config_page));
out: out:
return r; return r;
} }

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