Merge 4.19.316 into android-4.19-stable

Changes in 4.19.316
	x86/tsc: Trust initial offset in architectural TSC-adjust MSRs
	speakup: Fix sizeof() vs ARRAY_SIZE() bug
	ring-buffer: Fix a race between readers and resize checks
	net: smc91x: Fix m68k kernel compilation for ColdFire CPU
	nilfs2: fix unexpected freezing of nilfs_segctor_sync()
	nilfs2: fix potential hang in nilfs_detach_log_writer()
	tty: n_gsm: fix possible out-of-bounds in gsm0_receive()
	wifi: cfg80211: fix the order of arguments for trace events of the tx_rx_evt class
	net: usb: qmi_wwan: add Telit FN920C04 compositions
	drm/amd/display: Set color_mgmt_changed to true on unsuspend
	ASoC: rt5645: Fix the electric noise due to the CBJ contacts floating
	ASoC: dt-bindings: rt5645: add cbj sleeve gpio property
	ASoC: da7219-aad: fix usage of device_get_named_child_node()
	crypto: bcm - Fix pointer arithmetic
	firmware: raspberrypi: Use correct device for DMA mappings
	ecryptfs: Fix buffer size for tag 66 packet
	nilfs2: fix out-of-range warning
	parisc: add missing export of __cmpxchg_u8()
	crypto: ccp - Remove forward declaration
	crypto: ccp - drop platform ifdef checks
	s390/cio: fix tracepoint subchannel type field
	jffs2: prevent xattr node from overflowing the eraseblock
	null_blk: Fix missing mutex_destroy() at module removal
	md: fix resync softlockup when bitmap size is less than array size
	power: supply: cros_usbpd: provide ID table for avoiding fallback match
	nfsd: drop st_mutex before calling move_to_close_lru()
	wifi: ath10k: poll service ready message before failing
	x86/boot: Ignore relocations in .notes sections in walk_relocs() too
	qed: avoid truncating work queue length
	scsi: ufs: qcom: Perform read back after writing reset bit
	scsi: ufs: cleanup struct utp_task_req_desc
	scsi: ufs: add a low-level __ufshcd_issue_tm_cmd helper
	scsi: ufs: core: Perform read back after disabling interrupts
	scsi: ufs: core: Perform read back after disabling UIC_COMMAND_COMPL
	irqchip/alpine-msi: Fix off-by-one in allocation error path
	ACPI: disable -Wstringop-truncation
	scsi: libsas: Fix the failure of adding phy with zero-address to port
	scsi: hpsa: Fix allocation size for Scsi_Host private data
	x86/purgatory: Switch to the position-independent small code model
	wifi: ath10k: Fix an error code problem in ath10k_dbg_sta_write_peer_debug_trigger()
	wifi: ath10k: populate board data for WCN3990
	macintosh/via-macii: Remove BUG_ON assertions
	macintosh/via-macii, macintosh/adb-iop: Clean up whitespace
	macintosh/via-macii: Fix "BUG: sleeping function called from invalid context"
	wifi: carl9170: add a proper sanity check for endpoints
	wifi: ar5523: enable proper endpoint verification
	sh: kprobes: Merge arch_copy_kprobe() into arch_prepare_kprobe()
	Revert "sh: Handle calling csum_partial with misaligned data"
	scsi: bfa: Ensure the copied buf is NUL terminated
	scsi: qedf: Ensure the copied buf is NUL terminated
	wifi: mwl8k: initialize cmd->addr[] properly
	net: usb: sr9700: stop lying about skb->truesize
	m68k: Fix spinlock race in kernel thread creation
	m68k/mac: Use '030 reset method on SE/30
	m68k: mac: Fix reboot hang on Mac IIci
	net: ethernet: cortina: Locking fixes
	af_unix: Fix data races in unix_release_sock/unix_stream_sendmsg
	net: usb: smsc95xx: stop lying about skb->truesize
	net: openvswitch: fix overwriting ct original tuple for ICMPv6
	ipv6: sr: add missing seg6_local_exit
	ipv6: sr: fix incorrect unregister order
	ipv6: sr: fix invalid unregister error path
	drm/amd/display: Fix potential index out of bounds in color transformation function
	mtd: rawnand: hynix: fixed typo
	fbdev: shmobile: fix snprintf truncation
	drm/mediatek: Add 0 size check to mtk_drm_gem_obj
	powerpc/fsl-soc: hide unused const variable
	fbdev: sisfb: hide unused variables
	media: ngene: Add dvb_ca_en50221_init return value check
	media: radio-shark2: Avoid led_names truncations
	fbdev: sh7760fb: allow modular build
	drm/arm/malidp: fix a possible null pointer dereference
	ASoC: tracing: Export SND_SOC_DAPM_DIR_OUT to its value
	RDMA/hns: Use complete parentheses in macros
	x86/insn: Fix PUSH instruction in x86 instruction decoder opcode map
	ext4: avoid excessive credit estimate in ext4_tmpfile()
	SUNRPC: Fix gss_free_in_token_pages()
	selftests/kcmp: Make the test output consistent and clear
	selftests/kcmp: remove unused open mode
	RDMA/IPoIB: Fix format truncation compilation errors
	netrom: fix possible dead-lock in nr_rt_ioctl()
	af_packet: do not call packet_read_pending() from tpacket_destruct_skb()
	sched/topology: Don't set SD_BALANCE_WAKE on cpuset domain relax
	sched/fair: Allow disabling sched_balance_newidle with sched_relax_domain_level
	greybus: lights: check return of get_channel_from_mode
	dmaengine: idma64: Add check for dma_set_max_seg_size
	firmware: dmi-id: add a release callback function
	serial: max3100: Lock port->lock when calling uart_handle_cts_change()
	serial: max3100: Update uart_driver_registered on driver removal
	serial: max3100: Fix bitwise types
	greybus: arche-ctrl: move device table to its right location
	microblaze: Remove gcc flag for non existing early_printk.c file
	microblaze: Remove early printk call from cpuinfo-static.c
	usb: gadget: u_audio: Clear uac pointer when freed.
	stm class: Fix a double free in stm_register_device()
	ppdev: Remove usage of the deprecated ida_simple_xx() API
	ppdev: Add an error check in register_device
	extcon: max8997: select IRQ_DOMAIN instead of depending on it
	f2fs: add error prints for debugging mount failure
	f2fs: fix to release node block count in error path of f2fs_new_node_page()
	serial: sh-sci: Extract sci_dma_rx_chan_invalidate()
	serial: sh-sci: protect invalidating RXDMA on shutdown
	libsubcmd: Fix parse-options memory leak
	Input: ims-pcu - fix printf string overflow
	Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation
	drm/msm/dpu: use kms stored hw mdp block
	um: Fix return value in ubd_init()
	um: Add winch to winch_handlers before registering winch IRQ
	media: stk1160: fix bounds checking in stk1160_copy_video()
	powerpc/pseries: Add failure related checks for h_get_mpp and h_get_ppp
	um: Fix the -Wmissing-prototypes warning for __switch_mm
	media: cec: cec-adap: always cancel work in cec_transmit_msg_fh
	media: cec: cec-api: add locking in cec_release()
	null_blk: Fix the WARNING: modpost: missing MODULE_DESCRIPTION()
	x86/kconfig: Select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y
	nfc: nci: Fix uninit-value in nci_rx_work
	ipv6: sr: fix memleak in seg6_hmac_init_algo
	params: lift param_set_uint_minmax to common code
	tcp: Fix shift-out-of-bounds in dctcp_update_alpha().
	openvswitch: Set the skbuff pkt_type for proper pmtud support.
	arm64: asm-bug: Add .align 2 to the end of __BUG_ENTRY
	virtio: delete vq in vp_find_vqs_msix() when request_irq() fails
	net: fec: avoid lock evasion when reading pps_enable
	nfc: nci: Fix kcov check in nci_rx_work()
	nfc: nci: Fix handling of zero-length payload packets in nci_rx_work()
	netfilter: nfnetlink_queue: acquire rcu_read_lock() in instance_destroy_rcu()
	spi: Don't mark message DMA mapped when no transfer in it is
	nvmet: fix ns enable/disable possible hang
	net/mlx5e: Use rx_missed_errors instead of rx_dropped for reporting buffer exhaustion
	dma-buf/sw-sync: don't enable IRQ from sync_print_obj()
	enic: Validate length of nl attributes in enic_set_vf_port
	smsc95xx: remove redundant function arguments
	smsc95xx: use usbnet->driver_priv
	net: usb: smsc95xx: fix changing LED_SEL bit value updated from EEPROM
	net:fec: Add fec_enet_deinit()
	kconfig: fix comparison to constant symbols, 'm', 'n'
	ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound
	ALSA: timer: Set lower bound of start tick time
	genirq/cpuhotplug, x86/vector: Prevent vector leak during CPU offline
	SUNRPC: Fix loop termination condition in gss_free_in_token_pages()
	binder: fix max_thread type inconsistency
	mmc: core: Do not force a retune before RPMB switch
	nilfs2: fix use-after-free of timer for log writer thread
	vxlan: Fix regression when dropping packets due to invalid src addresses
	neighbour: fix unaligned access to pneigh_entry
	ata: pata_legacy: make legacy_exit() work again
	arm64: tegra: Correct Tegra132 I2C alias
	md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING
	wifi: rtl8xxxu: Fix the TX power of RTL8192CU, RTL8723AU
	arm64: dts: hi3798cv200: fix the size of GICR
	media: mxl5xx: Move xpt structures off stack
	media: v4l2-core: hold videodev_lock until dev reg, finishes
	fbdev: savage: Handle err return when savagefb_check_var failed
	netfilter: nf_tables: pass context to nft_set_destroy()
	netfilter: nftables: rename set element data activation/deactivation functions
	netfilter: nf_tables: drop map element references from preparation phase
	netfilter: nft_set_rbtree: allow loose matching of closing element in interval
	netfilter: nft_set_rbtree: Add missing expired checks
	netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
	netfilter: nft_set_rbtree: fix null deref on element insertion
	netfilter: nft_set_rbtree: fix overlap expiration walk
	netfilter: nf_tables: don't skip expired elements during walk
	netfilter: nf_tables: GC transaction API to avoid race with control plane
	netfilter: nf_tables: adapt set backend to use GC transaction API
	netfilter: nf_tables: remove busy mark and gc batch API
	netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path
	netfilter: nf_tables: GC transaction race with netns dismantle
	netfilter: nf_tables: GC transaction race with abort path
	netfilter: nf_tables: defer gc run if previous batch is still pending
	netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction
	netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention
	netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration
	netfilter: nf_tables: fix memleak when more than 255 elements expired
	netfilter: nf_tables: unregister flowtable hooks on netns exit
	netfilter: nf_tables: double hook unregistration in netns path
	netfilter: nftables: update table flags from the commit phase
	netfilter: nf_tables: fix table flag updates
	netfilter: nf_tables: disable toggling dormant table state more than once
	netfilter: nf_tables: bogus EBUSY when deleting flowtable after flush (for 4.19)
	netfilter: nft_dynset: fix timeouts later than 23 days
	netfilter: nftables: exthdr: fix 4-byte stack OOB write
	netfilter: nft_dynset: report EOPNOTSUPP on missing set feature
	netfilter: nft_dynset: relax superfluous check on set updates
	netfilter: nf_tables: mark newset as dead on transaction abort
	netfilter: nf_tables: skip dead set elements in netlink dump
	netfilter: nf_tables: validate NFPROTO_* family
	netfilter: nft_set_rbtree: skip end interval element from gc
	netfilter: nf_tables: set dormant flag on hook register failure
	netfilter: nf_tables: allow NFPROTO_INET in nft_(match/target)_validate()
	netfilter: nf_tables: do not compare internal table flags on updates
	netfilter: nf_tables: mark set as dead when unbinding anonymous set with timeout
	netfilter: nf_tables: reject new basechain after table flag update
	netfilter: nf_tables: discard table flag update with pending basechain deletion
	KVM: arm64: Allow AArch32 PSTATE.M to be restored as System mode
	crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak
	net/9p: fix uninit-value in p9_client_rpc()
	intel_th: pci: Add Meteor Lake-S CPU support
	sparc64: Fix number of online CPUs
	kdb: Fix buffer overflow during tab-complete
	kdb: Use format-strings rather than '\0' injection in kdb_read()
	kdb: Fix console handling when editing and tab-completing commands
	kdb: Merge identical case statements in kdb_read()
	kdb: Use format-specifiers rather than memset() for padding in kdb_read()
	net: fix __dst_negative_advice() race
	sparc: move struct termio to asm/termios.h
	ext4: fix mb_cache_entry's e_refcnt leak in ext4_xattr_block_cache_find()
	s390/ap: Fix crash in AP internal function modify_bitmap()
	nfs: fix undefined behavior in nfs_block_bits()
	Linux 4.19.316

Change-Id: I51ad6b82ea33614c19b33c26ae939c4a95430d4f
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2024-06-17 09:34:03 +00:00
174 changed files with 2123 additions and 1259 deletions

View File

@@ -16,6 +16,11 @@ Optional properties:
a GPIO spec for the external headphone detect pin. If jd-mode = 0, a GPIO spec for the external headphone detect pin. If jd-mode = 0,
we will get the JD status by getting the value of hp-detect-gpios. we will get the JD status by getting the value of hp-detect-gpios.
- cbj-sleeve-gpios:
a GPIO spec to control the external combo jack circuit to tie the sleeve/ring2
contacts to the ground or floating. It could avoid some electric noise from the
active speaker jacks.
- realtek,in2-differential - realtek,in2-differential
Boolean. Indicate MIC2 input are differential, rather than single-ended. Boolean. Indicate MIC2 input are differential, rather than single-ended.
@@ -64,6 +69,7 @@ codec: rt5650@1a {
compatible = "realtek,rt5650"; compatible = "realtek,rt5650";
reg = <0x1a>; reg = <0x1a>;
hp-detect-gpios = <&gpio 19 0>; hp-detect-gpios = <&gpio 19 0>;
cbj-sleeve-gpios = <&gpio 20 0>;
interrupt-parent = <&gpio>; interrupt-parent = <&gpio>;
interrupts = <7 IRQ_TYPE_EDGE_FALLING>; interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
realtek,dmic-en = "true"; realtek,dmic-en = "true";

View File

@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 4 VERSION = 4
PATCHLEVEL = 19 PATCHLEVEL = 19
SUBLEVEL = 315 SUBLEVEL = 316
EXTRAVERSION = EXTRAVERSION =
NAME = "People's Front" NAME = "People's Front"

View File

@@ -60,7 +60,7 @@
gic: interrupt-controller@f1001000 { gic: interrupt-controller@f1001000 {
compatible = "arm,gic-400"; compatible = "arm,gic-400";
reg = <0x0 0xf1001000 0x0 0x1000>, /* GICD */ reg = <0x0 0xf1001000 0x0 0x1000>, /* GICD */
<0x0 0xf1002000 0x0 0x100>; /* GICC */ <0x0 0xf1002000 0x0 0x2000>; /* GICC */
#address-cells = <0>; #address-cells = <0>;
#interrupt-cells = <3>; #interrupt-cells = <3>;
interrupt-controller; interrupt-controller;

View File

@@ -9,8 +9,8 @@
compatible = "nvidia,norrin", "nvidia,tegra132", "nvidia,tegra124"; compatible = "nvidia,norrin", "nvidia,tegra132", "nvidia,tegra124";
aliases { aliases {
rtc0 = "/i2c@7000d000/as3722@40"; rtc0 = &as3722;
rtc1 = "/rtc@7000e000"; rtc1 = &tegra_rtc;
serial0 = &uarta; serial0 = &uarta;
}; };

View File

@@ -569,7 +569,7 @@
status = "disabled"; status = "disabled";
}; };
rtc@7000e000 { tegra_rtc: rtc@7000e000 {
compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc"; compatible = "nvidia,tegra124-rtc", "nvidia,tegra20-rtc";
reg = <0x0 0x7000e000 0x0 0x100>; reg = <0x0 0x7000e000 0x0 0x100>;
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;

View File

@@ -39,6 +39,7 @@
14470: .long 14471f - 14470b; \ 14470: .long 14471f - 14470b; \
_BUGVERBOSE_LOCATION(__FILE__, __LINE__) \ _BUGVERBOSE_LOCATION(__FILE__, __LINE__) \
.short flags; \ .short flags; \
.align 2; \
.popsection; \ .popsection; \
14471: 14471:
#else #else

View File

@@ -175,6 +175,7 @@ static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
case PSR_AA32_MODE_SVC: case PSR_AA32_MODE_SVC:
case PSR_AA32_MODE_ABT: case PSR_AA32_MODE_ABT:
case PSR_AA32_MODE_UND: case PSR_AA32_MODE_UND:
case PSR_AA32_MODE_SYS:
if (!vcpu_el1_is_32bit(vcpu)) if (!vcpu_el1_is_32bit(vcpu))
return -EINVAL; return -EINVAL;
break; break;

View File

@@ -425,7 +425,9 @@ resume:
movec %a0,%dfc movec %a0,%dfc
/* restore status register */ /* restore status register */
movew %a1@(TASK_THREAD+THREAD_SR),%sr movew %a1@(TASK_THREAD+THREAD_SR),%d0
oriw #0x0700,%d0
movew %d0,%sr
rts rts

View File

@@ -462,40 +462,18 @@ void mac_poweroff(void)
void mac_reset(void) void mac_reset(void)
{ {
if (macintosh_config->adb_type == MAC_ADB_II) {
unsigned long flags;
/* need ROMBASE in booter */
/* indeed, plus need to MAP THE ROM !! */
if (mac_bi_data.rombase == 0)
mac_bi_data.rombase = 0x40800000;
/* works on some */
rom_reset = (void *) (mac_bi_data.rombase + 0xa);
if (macintosh_config->ident == MAC_MODEL_SE30) {
/*
* MSch: Machines known to crash on ROM reset ...
*/
} else {
local_irq_save(flags);
rom_reset();
local_irq_restore(flags);
}
#ifdef CONFIG_ADB_CUDA #ifdef CONFIG_ADB_CUDA
} else if (macintosh_config->adb_type == MAC_ADB_EGRET || if (macintosh_config->adb_type == MAC_ADB_EGRET ||
macintosh_config->adb_type == MAC_ADB_CUDA) { macintosh_config->adb_type == MAC_ADB_CUDA) {
cuda_restart(); cuda_restart();
} else
#endif #endif
#ifdef CONFIG_ADB_PMU #ifdef CONFIG_ADB_PMU
} else if (macintosh_config->adb_type == MAC_ADB_PB2) { if (macintosh_config->adb_type == MAC_ADB_PB2) {
pmu_restart(); pmu_restart();
} else
#endif #endif
} else if (CPU_IS_030) { if (CPU_IS_030) {
/* 030-specific reset routine. The idea is general, but the /* 030-specific reset routine. The idea is general, but the
* specific registers to reset are '030-specific. Until I * specific registers to reset are '030-specific. Until I
* have a non-030 machine, I can't test anything else. * have a non-030 machine, I can't test anything else.
@@ -543,6 +521,18 @@ void mac_reset(void)
"jmp %/a0@\n\t" /* jump to the reset vector */ "jmp %/a0@\n\t" /* jump to the reset vector */
".chip 68k" ".chip 68k"
: : "r" (offset), "a" (rombase) : "a0"); : : "r" (offset), "a" (rombase) : "a0");
} else {
/* need ROMBASE in booter */
/* indeed, plus need to MAP THE ROM !! */
if (mac_bi_data.rombase == 0)
mac_bi_data.rombase = 0x40800000;
/* works on some */
rom_reset = (void *)(mac_bi_data.rombase + 0xa);
local_irq_disable();
rom_reset();
} }
/* should never get here */ /* should never get here */

View File

@@ -7,7 +7,6 @@ ifdef CONFIG_FUNCTION_TRACER
# Do not trace early boot code and low level code # Do not trace early boot code and low level code
CFLAGS_REMOVE_timer.o = -pg CFLAGS_REMOVE_timer.o = -pg
CFLAGS_REMOVE_intc.o = -pg CFLAGS_REMOVE_intc.o = -pg
CFLAGS_REMOVE_early_printk.o = -pg
CFLAGS_REMOVE_ftrace.o = -pg CFLAGS_REMOVE_ftrace.o = -pg
CFLAGS_REMOVE_process.o = -pg CFLAGS_REMOVE_process.o = -pg
endif endif

View File

@@ -18,7 +18,7 @@ static const char family_string[] = CONFIG_XILINX_MICROBLAZE0_FAMILY;
static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER; static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER;
#define err_printk(x) \ #define err_printk(x) \
early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n"); pr_err("ERROR: Microblaze " x "-different for kernel and DTS\n");
void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu) void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu)
{ {

View File

@@ -34,6 +34,7 @@ EXPORT_SYMBOL(memset);
#include <linux/atomic.h> #include <linux/atomic.h>
EXPORT_SYMBOL(__xchg8); EXPORT_SYMBOL(__xchg8);
EXPORT_SYMBOL(__xchg32); EXPORT_SYMBOL(__xchg32);
EXPORT_SYMBOL(__cmpxchg_u8);
EXPORT_SYMBOL(__cmpxchg_u32); EXPORT_SYMBOL(__cmpxchg_u32);
EXPORT_SYMBOL(__cmpxchg_u64); EXPORT_SYMBOL(__cmpxchg_u64);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP

View File

@@ -424,7 +424,7 @@ struct hvcall_mpp_data {
unsigned long backing_mem; unsigned long backing_mem;
}; };
int h_get_mpp(struct hvcall_mpp_data *); long h_get_mpp(struct hvcall_mpp_data *mpp_data);
struct hvcall_mpp_x_data { struct hvcall_mpp_x_data {
unsigned long coalesced_bytes; unsigned long coalesced_bytes;

View File

@@ -933,10 +933,10 @@ void __trace_hcall_exit(long opcode, long retval, unsigned long *retbuf)
* h_get_mpp * h_get_mpp
* H_GET_MPP hcall returns info in 7 parms * H_GET_MPP hcall returns info in 7 parms
*/ */
int h_get_mpp(struct hvcall_mpp_data *mpp_data) long h_get_mpp(struct hvcall_mpp_data *mpp_data)
{ {
int rc; unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE]; long rc;
rc = plpar_hcall9(H_GET_MPP, retbuf); rc = plpar_hcall9(H_GET_MPP, retbuf);

View File

@@ -114,8 +114,8 @@ struct hvcall_ppp_data {
*/ */
static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data) static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data)
{ {
unsigned long rc; unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE]; long rc;
rc = plpar_hcall9(H_GET_PPP, retbuf); rc = plpar_hcall9(H_GET_PPP, retbuf);
@@ -161,7 +161,7 @@ static void parse_ppp_data(struct seq_file *m)
struct hvcall_ppp_data ppp_data; struct hvcall_ppp_data ppp_data;
struct device_node *root; struct device_node *root;
const __be32 *perf_level; const __be32 *perf_level;
int rc; long rc;
rc = h_get_ppp(&ppp_data); rc = h_get_ppp(&ppp_data);
if (rc) if (rc)

View File

@@ -578,10 +578,12 @@ static const struct fsl_msi_feature ipic_msi_feature = {
.msiir_offset = 0x38, .msiir_offset = 0x38,
}; };
#ifdef CONFIG_EPAPR_PARAVIRT
static const struct fsl_msi_feature vmpic_msi_feature = { static const struct fsl_msi_feature vmpic_msi_feature = {
.fsl_pic_ip = FSL_PIC_IP_VMPIC, .fsl_pic_ip = FSL_PIC_IP_VMPIC,
.msiir_offset = 0, .msiir_offset = 0,
}; };
#endif
static const struct of_device_id fsl_of_msi_ids[] = { static const struct of_device_id fsl_of_msi_ids[] = {
{ {

View File

@@ -47,17 +47,12 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
if (OPCODE_RTE(opcode)) if (OPCODE_RTE(opcode))
return -EFAULT; /* Bad breakpoint */ return -EFAULT; /* Bad breakpoint */
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
p->opcode = opcode; p->opcode = opcode;
return 0; return 0;
} }
void __kprobes arch_copy_kprobe(struct kprobe *p)
{
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
p->opcode = *p->addr;
}
void __kprobes arch_arm_kprobe(struct kprobe *p) void __kprobes arch_arm_kprobe(struct kprobe *p)
{ {
*p->addr = BREAKPOINT_INSTRUCTION; *p->addr = BREAKPOINT_INSTRUCTION;

View File

@@ -36,7 +36,8 @@
*/ */
/* /*
* asmlinkage __wsum csum_partial(const void *buf, int len, __wsum sum); * unsigned int csum_partial(const unsigned char *buf, int len,
* unsigned int sum);
*/ */
.text .text
@@ -48,31 +49,11 @@ ENTRY(csum_partial)
* Fortunately, it is easy to convert 2-byte alignment to 4-byte * Fortunately, it is easy to convert 2-byte alignment to 4-byte
* alignment for the unrolled loop. * alignment for the unrolled loop.
*/ */
mov r5, r1
mov r4, r0 mov r4, r0
tst #3, r0 ! Check alignment. tst #2, r0 ! Check alignment.
bt/s 2f ! Jump if alignment is ok. bt 2f ! Jump if alignment is ok.
mov r4, r7 ! Keep a copy to check for alignment
! !
tst #1, r0 ! Check alignment.
bt 21f ! Jump if alignment is boundary of 2bytes.
! buf is odd
tst r5, r5
add #-1, r5
bt 9f
mov.b @r4+, r0
extu.b r0, r0
addc r0, r6 ! t=0 from previous tst
mov r6, r0
shll8 r6
shlr16 r0
shlr8 r0
or r0, r6
mov r4, r0
tst #2, r0
bt 2f
21:
! buf is 2 byte aligned (len could be 0)
add #-2, r5 ! Alignment uses up two bytes. add #-2, r5 ! Alignment uses up two bytes.
cmp/pz r5 ! cmp/pz r5 !
bt/s 1f ! Jump if we had at least two bytes. bt/s 1f ! Jump if we had at least two bytes.
@@ -80,17 +61,16 @@ ENTRY(csum_partial)
bra 6f bra 6f
add #2, r5 ! r5 was < 2. Deal with it. add #2, r5 ! r5 was < 2. Deal with it.
1: 1:
mov r5, r1 ! Save new len for later use.
mov.w @r4+, r0 mov.w @r4+, r0
extu.w r0, r0 extu.w r0, r0
addc r0, r6 addc r0, r6
bf 2f bf 2f
add #1, r6 add #1, r6
2: 2:
! buf is 4 byte aligned (len could be 0)
mov r5, r1
mov #-5, r0 mov #-5, r0
shld r0, r1 shld r0, r5
tst r1, r1 tst r5, r5
bt/s 4f ! if it's =0, go to 4f bt/s 4f ! if it's =0, go to 4f
clrt clrt
.align 2 .align 2
@@ -112,31 +92,30 @@ ENTRY(csum_partial)
addc r0, r6 addc r0, r6
addc r2, r6 addc r2, r6
movt r0 movt r0
dt r1 dt r5
bf/s 3b bf/s 3b
cmp/eq #1, r0 cmp/eq #1, r0
! here, we know r1==0 ! here, we know r5==0
addc r1, r6 ! add carry to r6 addc r5, r6 ! add carry to r6
4: 4:
mov r5, r0 mov r1, r0
and #0x1c, r0 and #0x1c, r0
tst r0, r0 tst r0, r0
bt 6f bt/s 6f
! 4 bytes or more remaining mov r0, r5
mov r0, r1 shlr2 r5
shlr2 r1
mov #0, r2 mov #0, r2
5: 5:
addc r2, r6 addc r2, r6
mov.l @r4+, r2 mov.l @r4+, r2
movt r0 movt r0
dt r1 dt r5
bf/s 5b bf/s 5b
cmp/eq #1, r0 cmp/eq #1, r0
addc r2, r6 addc r2, r6
addc r1, r6 ! r1==0 here, so it means add carry-bit addc r5, r6 ! r5==0 here, so it means add carry-bit
6: 6:
! 3 bytes or less remaining mov r1, r5
mov #3, r0 mov #3, r0
and r0, r5 and r0, r5
tst r5, r5 tst r5, r5
@@ -162,16 +141,6 @@ ENTRY(csum_partial)
mov #0, r0 mov #0, r0
addc r0, r6 addc r0, r6
9: 9:
! Check if the buffer was misaligned, if so realign sum
mov r7, r0
tst #1, r0
bt 10f
mov r6, r0
shll8 r6
shlr16 r0
shlr8 r0
or r0, r6
10:
rts rts
mov r6, r0 mov r6, r0

View File

@@ -47,7 +47,6 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask);
int hard_smp_processor_id(void); int hard_smp_processor_id(void);
#define raw_smp_processor_id() (current_thread_info()->cpu) #define raw_smp_processor_id() (current_thread_info()->cpu)
void smp_fill_in_cpu_possible_map(void);
void smp_fill_in_sib_core_maps(void); void smp_fill_in_sib_core_maps(void);
void cpu_play_dead(void); void cpu_play_dead(void);
@@ -77,7 +76,6 @@ void __cpu_die(unsigned int cpu);
#define smp_fill_in_sib_core_maps() do { } while (0) #define smp_fill_in_sib_core_maps() do { } while (0)
#define smp_fetch_global_regs() do { } while (0) #define smp_fetch_global_regs() do { } while (0)
#define smp_fetch_global_pmu() do { } while (0) #define smp_fetch_global_pmu() do { } while (0)
#define smp_fill_in_cpu_possible_map() do { } while (0)
#define smp_init_cpu_poke() do { } while (0) #define smp_init_cpu_poke() do { } while (0)
#define scheduler_poke() do { } while (0) #define scheduler_poke() do { } while (0)

View File

@@ -13,16 +13,6 @@ typedef unsigned int tcflag_t;
typedef unsigned long tcflag_t; typedef unsigned long tcflag_t;
#endif #endif
#define NCC 8
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
#define NCCS 17 #define NCCS 17
struct termios { struct termios {
tcflag_t c_iflag; /* input mode flags */ tcflag_t c_iflag; /* input mode flags */

View File

@@ -40,5 +40,14 @@ struct winsize {
unsigned short ws_ypixel; unsigned short ws_ypixel;
}; };
#define NCC 8
struct termio {
unsigned short c_iflag; /* input mode flags */
unsigned short c_oflag; /* output mode flags */
unsigned short c_cflag; /* control mode flags */
unsigned short c_lflag; /* local mode flags */
unsigned char c_line; /* line discipline */
unsigned char c_cc[NCC]; /* control characters */
};
#endif /* _UAPI_SPARC_TERMIOS_H */ #endif /* _UAPI_SPARC_TERMIOS_H */

View File

@@ -479,7 +479,9 @@ static void *record_one_cpu(struct device_node *dp, int cpuid, int arg)
ncpus_probed++; ncpus_probed++;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
set_cpu_present(cpuid, true); set_cpu_present(cpuid, true);
set_cpu_possible(cpuid, true);
if (num_possible_cpus() < nr_cpu_ids)
set_cpu_possible(cpuid, true);
#endif #endif
return NULL; return NULL;
} }

View File

@@ -690,7 +690,6 @@ void __init setup_arch(char **cmdline_p)
paging_init(); paging_init();
init_sparc64_elf_hwcap(); init_sparc64_elf_hwcap();
smp_fill_in_cpu_possible_map();
/* /*
* Once the OF device tree and MDESC have been setup and nr_cpus has * Once the OF device tree and MDESC have been setup and nr_cpus has
* been parsed, we know the list of possible cpus. Therefore we can * been parsed, we know the list of possible cpus. Therefore we can

View File

@@ -1213,20 +1213,6 @@ void __init smp_setup_processor_id(void)
xcall_deliver_impl = hypervisor_xcall_deliver; xcall_deliver_impl = hypervisor_xcall_deliver;
} }
void __init smp_fill_in_cpu_possible_map(void)
{
int possible_cpus = num_possible_cpus();
int i;
if (possible_cpus > nr_cpu_ids)
possible_cpus = nr_cpu_ids;
for (i = 0; i < possible_cpus; i++)
set_cpu_possible(i, true);
for (; i < NR_CPUS; i++)
set_cpu_possible(i, false);
}
void smp_fill_in_sib_core_maps(void) void smp_fill_in_sib_core_maps(void)
{ {
unsigned int i; unsigned int i;

View File

@@ -683,24 +683,26 @@ void register_winch_irq(int fd, int tty_fd, int pid, struct tty_port *port,
goto cleanup; goto cleanup;
} }
*winch = ((struct winch) { .list = LIST_HEAD_INIT(winch->list), *winch = ((struct winch) { .fd = fd,
.fd = fd,
.tty_fd = tty_fd, .tty_fd = tty_fd,
.pid = pid, .pid = pid,
.port = port, .port = port,
.stack = stack }); .stack = stack });
spin_lock(&winch_handler_lock);
list_add(&winch->list, &winch_handlers);
spin_unlock(&winch_handler_lock);
if (um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt, if (um_request_irq(WINCH_IRQ, fd, IRQ_READ, winch_interrupt,
IRQF_SHARED, "winch", winch) < 0) { IRQF_SHARED, "winch", winch) < 0) {
printk(KERN_ERR "register_winch_irq - failed to register " printk(KERN_ERR "register_winch_irq - failed to register "
"IRQ\n"); "IRQ\n");
spin_lock(&winch_handler_lock);
list_del(&winch->list);
spin_unlock(&winch_handler_lock);
goto out_free; goto out_free;
} }
spin_lock(&winch_handler_lock);
list_add(&winch->list, &winch_handlers);
spin_unlock(&winch_handler_lock);
return; return;
out_free: out_free:

View File

@@ -1135,7 +1135,7 @@ static int __init ubd_init(void)
if (irq_req_buffer == NULL) { if (irq_req_buffer == NULL) {
printk(KERN_ERR "Failed to initialize ubd buffering\n"); printk(KERN_ERR "Failed to initialize ubd buffering\n");
return -1; return -ENOMEM;
} }
io_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE, io_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE,
sizeof(struct io_thread_req *), sizeof(struct io_thread_req *),
@@ -1146,7 +1146,7 @@ static int __init ubd_init(void)
if (io_req_buffer == NULL) { if (io_req_buffer == NULL) {
printk(KERN_ERR "Failed to initialize ubd buffering\n"); printk(KERN_ERR "Failed to initialize ubd buffering\n");
return -1; return -ENOMEM;
} }
platform_driver_register(&ubd_driver); platform_driver_register(&ubd_driver);
mutex_lock(&ubd_lock); mutex_lock(&ubd_lock);

View File

@@ -15,8 +15,6 @@ typedef struct mm_context {
struct page *stub_pages[2]; struct page *stub_pages[2];
} mm_context_t; } mm_context_t;
extern void __switch_mm(struct mm_id * mm_idp);
/* Avoid tangled inclusion with asm/ldt.h */ /* Avoid tangled inclusion with asm/ldt.h */
extern long init_new_ldt(struct mm_context *to_mm, struct mm_context *from_mm); extern long init_new_ldt(struct mm_context *to_mm, struct mm_context *from_mm);
extern void free_ldt(struct mm_context *mm); extern void free_ldt(struct mm_context *mm);

View File

@@ -14,4 +14,6 @@ struct mm_id {
unsigned long stack; unsigned long stack;
}; };
void __switch_mm(struct mm_id *mm_idp);
#endif #endif

View File

@@ -376,6 +376,7 @@ config UNWINDER_ORC
config UNWINDER_FRAME_POINTER config UNWINDER_FRAME_POINTER
bool "Frame pointer unwinder" bool "Frame pointer unwinder"
select ARCH_WANT_FRAME_POINTERS
select FRAME_POINTER select FRAME_POINTER
---help--- ---help---
This option enables the frame pointer unwinder for unwinding kernel This option enables the frame pointer unwinder for unwinding kernel
@@ -403,7 +404,3 @@ config UNWINDER_GUESS
overhead. overhead.
endchoice endchoice
config FRAME_POINTER
depends on !UNWINDER_ORC && !UNWINDER_GUESS
bool

View File

@@ -915,7 +915,8 @@ static void __send_cleanup_vector(struct apic_chip_data *apicd)
hlist_add_head(&apicd->clist, per_cpu_ptr(&cleanup_list, cpu)); hlist_add_head(&apicd->clist, per_cpu_ptr(&cleanup_list, cpu));
apic->send_IPI(cpu, IRQ_MOVE_CLEANUP_VECTOR); apic->send_IPI(cpu, IRQ_MOVE_CLEANUP_VECTOR);
} else { } else {
apicd->prev_vector = 0; pr_warn("IRQ %u schedule cleanup for offline CPU %u\n", apicd->irq, cpu);
free_moved_vector(apicd);
} }
raw_spin_unlock(&vector_lock); raw_spin_unlock(&vector_lock);
} }
@@ -951,6 +952,7 @@ void irq_complete_move(struct irq_cfg *cfg)
*/ */
void irq_force_complete_move(struct irq_desc *desc) void irq_force_complete_move(struct irq_desc *desc)
{ {
unsigned int cpu = smp_processor_id();
struct apic_chip_data *apicd; struct apic_chip_data *apicd;
struct irq_data *irqd; struct irq_data *irqd;
unsigned int vector; unsigned int vector;
@@ -975,10 +977,11 @@ void irq_force_complete_move(struct irq_desc *desc)
goto unlock; goto unlock;
/* /*
* If prev_vector is empty, no action required. * If prev_vector is empty or the descriptor is neither currently
* nor previously on the outgoing CPU no action required.
*/ */
vector = apicd->prev_vector; vector = apicd->prev_vector;
if (!vector) if (!vector || (apicd->cpu != cpu && apicd->prev_cpu != cpu))
goto unlock; goto unlock;
/* /*

View File

@@ -151,11 +151,9 @@ bool tsc_store_and_check_tsc_adjust(bool bootcpu)
cur->warned = false; cur->warned = false;
/* /*
* If a non-zero TSC value for socket 0 may be valid then the default * The default adjust value cannot be assumed to be zero on any socket.
* adjusted value cannot assumed to be zero either.
*/ */
if (tsc_async_resets) cur->adjusted = bootval;
cur->adjusted = bootval;
/* /*
* Check whether this CPU is the first in a package to come up. In * Check whether this CPU is the first in a package to come up. In

View File

@@ -148,7 +148,7 @@ AVXcode:
65: SEG=GS (Prefix) 65: SEG=GS (Prefix)
66: Operand-Size (Prefix) 66: Operand-Size (Prefix)
67: Address-Size (Prefix) 67: Address-Size (Prefix)
68: PUSH Iz (d64) 68: PUSH Iz
69: IMUL Gv,Ev,Iz 69: IMUL Gv,Ev,Iz
6a: PUSH Ib (d64) 6a: PUSH Ib (d64)
6b: IMUL Gv,Ev,Ib 6b: IMUL Gv,Ev,Ib

View File

@@ -30,7 +30,8 @@ KCOV_INSTRUMENT := n
# make up the standalone purgatory.ro # make up the standalone purgatory.ro
PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel
PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss -g0 PURGATORY_CFLAGS := -mcmodel=small -ffreestanding -fno-zero-initialized-in-bss -g0
PURGATORY_CFLAGS += -fpic -fvisibility=hidden
PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING
# Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That

View File

@@ -673,6 +673,15 @@ static void walk_relocs(int (*process)(struct section *sec, Elf_Rel *rel,
if (!(sec_applies->shdr.sh_flags & SHF_ALLOC)) { if (!(sec_applies->shdr.sh_flags & SHF_ALLOC)) {
continue; continue;
} }
/*
* Do not perform relocations in .notes sections; any
* values there are meant for pre-boot consumption (e.g.
* startup_xen).
*/
if (sec_applies->shdr.sh_type == SHT_NOTE)
continue;
sh_symtab = sec_symtab->symtab; sh_symtab = sec_symtab->symtab;
sym_strtab = sec_symtab->link->strtab; sym_strtab = sec_symtab->link->strtab;
for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) { for (j = 0; j < sec->shdr.sh_size/sizeof(Elf_Rel); j++) {

View File

@@ -5,6 +5,7 @@
ccflags-y := -D_LINUX -DBUILDING_ACPICA ccflags-y := -D_LINUX -DBUILDING_ACPICA
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
CFLAGS_tbfind.o += $(call cc-disable-warning, stringop-truncation)
# use acpi.o to put all files here into acpi.o modparam namespace # use acpi.o to put all files here into acpi.o modparam namespace
obj-y += acpi.o obj-y += acpi.o

View File

@@ -519,7 +519,7 @@ struct binder_proc {
struct list_head todo; struct list_head todo;
struct binder_stats stats; struct binder_stats stats;
struct list_head delivered_death; struct list_head delivered_death;
int max_threads; u32 max_threads;
int requested_threads; int requested_threads;
int requested_threads_started; int requested_threads_started;
int tmp_ref; int tmp_ref;
@@ -5017,7 +5017,7 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
goto err; goto err;
break; break;
case BINDER_SET_MAX_THREADS: { case BINDER_SET_MAX_THREADS: {
int max_threads; u32 max_threads;
if (copy_from_user(&max_threads, ubuf, if (copy_from_user(&max_threads, ubuf,
sizeof(max_threads))) { sizeof(max_threads))) {

View File

@@ -128,8 +128,6 @@ static int legacy_port[NR_HOST] = { 0x1f0, 0x170, 0x1e8, 0x168, 0x1e0, 0x160 };
static struct legacy_probe probe_list[NR_HOST]; static struct legacy_probe probe_list[NR_HOST];
static struct legacy_data legacy_data[NR_HOST]; static struct legacy_data legacy_data[NR_HOST];
static struct ata_host *legacy_host[NR_HOST]; static struct ata_host *legacy_host[NR_HOST];
static int nr_legacy_host;
static int probe_all; /* Set to check all ISA port ranges */ static int probe_all; /* Set to check all ISA port ranges */
static int ht6560a; /* HT 6560A on primary 1, second 2, both 3 */ static int ht6560a; /* HT 6560A on primary 1, second 2, both 3 */
@@ -1253,9 +1251,11 @@ static __exit void legacy_exit(void)
{ {
int i; int i;
for (i = 0; i < nr_legacy_host; i++) { for (i = 0; i < NR_HOST; i++) {
struct legacy_data *ld = &legacy_data[i]; struct legacy_data *ld = &legacy_data[i];
ata_host_detach(legacy_host[i]);
if (legacy_host[i])
ata_host_detach(legacy_host[i]);
platform_device_unregister(ld->platform_dev); platform_device_unregister(ld->platform_dev);
} }
} }

View File

@@ -1967,10 +1967,13 @@ static void __exit null_exit(void)
if (g_queue_mode == NULL_Q_MQ && shared_tags) if (g_queue_mode == NULL_Q_MQ && shared_tags)
blk_mq_free_tag_set(&tag_set); blk_mq_free_tag_set(&tag_set);
mutex_destroy(&lock);
} }
module_init(null_init); module_init(null_init);
module_exit(null_exit); module_exit(null_exit);
MODULE_AUTHOR("Jens Axboe <axboe@kernel.dk>"); MODULE_AUTHOR("Jens Axboe <axboe@kernel.dk>");
MODULE_DESCRIPTION("multi queue aware block test driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");

View File

@@ -300,28 +300,35 @@ static int register_device(int minor, struct pp_struct *pp)
if (!port) { if (!port) {
pr_warn("%s: no associated port!\n", name); pr_warn("%s: no associated port!\n", name);
rc = -ENXIO; rc = -ENXIO;
goto err; goto err_free_name;
}
index = ida_alloc(&ida_index, GFP_KERNEL);
if (index < 0) {
pr_warn("%s: failed to get index!\n", name);
rc = index;
goto err_put_port;
} }
index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL);
memset(&ppdev_cb, 0, sizeof(ppdev_cb)); memset(&ppdev_cb, 0, sizeof(ppdev_cb));
ppdev_cb.irq_func = pp_irq; ppdev_cb.irq_func = pp_irq;
ppdev_cb.flags = (pp->flags & PP_EXCL) ? PARPORT_FLAG_EXCL : 0; ppdev_cb.flags = (pp->flags & PP_EXCL) ? PARPORT_FLAG_EXCL : 0;
ppdev_cb.private = pp; ppdev_cb.private = pp;
pdev = parport_register_dev_model(port, name, &ppdev_cb, index); pdev = parport_register_dev_model(port, name, &ppdev_cb, index);
parport_put_port(port);
if (!pdev) { if (!pdev) {
pr_warn("%s: failed to register device!\n", name); pr_warn("%s: failed to register device!\n", name);
rc = -ENXIO; rc = -ENXIO;
ida_simple_remove(&ida_index, index); ida_free(&ida_index, index);
goto err; goto err_put_port;
} }
pp->pdev = pdev; pp->pdev = pdev;
pp->index = index; pp->index = index;
dev_dbg(&pdev->dev, "registered pardevice\n"); dev_dbg(&pdev->dev, "registered pardevice\n");
err: err_put_port:
parport_put_port(port);
err_free_name:
kfree(name); kfree(name);
return rc; return rc;
} }
@@ -766,7 +773,7 @@ static int pp_release(struct inode *inode, struct file *file)
if (pp->pdev) { if (pp->pdev) {
parport_unregister_device(pp->pdev); parport_unregister_device(pp->pdev);
ida_simple_remove(&ida_index, pp->index); ida_free(&ida_index, pp->index);
pp->pdev = NULL; pp->pdev = NULL;
pr_debug(CHRDEV "%x: unregistered pardevice\n", minor); pr_debug(CHRDEV "%x: unregistered pardevice\n", minor);
} }

View File

@@ -506,7 +506,7 @@ static void spu2_dump_omd(u8 *omd, u16 hash_key_len, u16 ciph_key_len,
if (hash_iv_len) { if (hash_iv_len) {
packet_log(" Hash IV Length %u bytes\n", hash_iv_len); packet_log(" Hash IV Length %u bytes\n", hash_iv_len);
packet_dump(" hash IV: ", ptr, hash_iv_len); packet_dump(" hash IV: ", ptr, hash_iv_len);
ptr += ciph_key_len; ptr += hash_iv_len;
} }
if (ciph_iv_len) { if (ciph_iv_len) {

View File

@@ -33,30 +33,47 @@ struct sp_platform {
unsigned int irq_count; unsigned int irq_count;
}; };
static const struct acpi_device_id sp_acpi_match[]; static const struct sp_dev_vdata dev_vdata[] = {
static const struct of_device_id sp_of_match[]; {
.bar = 0,
#ifdef CONFIG_CRYPTO_DEV_SP_CCP
.ccp_vdata = &ccpv3_platform,
#endif
},
};
static const struct acpi_device_id sp_acpi_match[] = {
{ "AMDI0C00", (kernel_ulong_t)&dev_vdata[0] },
{ },
};
MODULE_DEVICE_TABLE(acpi, sp_acpi_match);
static const struct of_device_id sp_of_match[] = {
{ .compatible = "amd,ccp-seattle-v1a",
.data = (const void *)&dev_vdata[0] },
{ },
};
MODULE_DEVICE_TABLE(of, sp_of_match);
static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev) static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev)
{ {
#ifdef CONFIG_OF
const struct of_device_id *match; const struct of_device_id *match;
match = of_match_node(sp_of_match, pdev->dev.of_node); match = of_match_node(sp_of_match, pdev->dev.of_node);
if (match && match->data) if (match && match->data)
return (struct sp_dev_vdata *)match->data; return (struct sp_dev_vdata *)match->data;
#endif
return NULL; return NULL;
} }
static struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev) static struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev)
{ {
#ifdef CONFIG_ACPI
const struct acpi_device_id *match; const struct acpi_device_id *match;
match = acpi_match_device(sp_acpi_match, &pdev->dev); match = acpi_match_device(sp_acpi_match, &pdev->dev);
if (match && match->driver_data) if (match && match->driver_data)
return (struct sp_dev_vdata *)match->driver_data; return (struct sp_dev_vdata *)match->driver_data;
#endif
return NULL; return NULL;
} }
@@ -201,41 +218,11 @@ static int sp_platform_resume(struct platform_device *pdev)
} }
#endif #endif
static const struct sp_dev_vdata dev_vdata[] = {
{
.bar = 0,
#ifdef CONFIG_CRYPTO_DEV_SP_CCP
.ccp_vdata = &ccpv3_platform,
#endif
},
};
#ifdef CONFIG_ACPI
static const struct acpi_device_id sp_acpi_match[] = {
{ "AMDI0C00", (kernel_ulong_t)&dev_vdata[0] },
{ },
};
MODULE_DEVICE_TABLE(acpi, sp_acpi_match);
#endif
#ifdef CONFIG_OF
static const struct of_device_id sp_of_match[] = {
{ .compatible = "amd,ccp-seattle-v1a",
.data = (const void *)&dev_vdata[0] },
{ },
};
MODULE_DEVICE_TABLE(of, sp_of_match);
#endif
static struct platform_driver sp_platform_driver = { static struct platform_driver sp_platform_driver = {
.driver = { .driver = {
.name = "ccp", .name = "ccp",
#ifdef CONFIG_ACPI
.acpi_match_table = sp_acpi_match, .acpi_match_table = sp_acpi_match,
#endif
#ifdef CONFIG_OF
.of_match_table = sp_of_match, .of_match_table = sp_of_match,
#endif
}, },
.probe = sp_platform_probe, .probe = sp_platform_probe,
.remove = sp_platform_remove, .remove = sp_platform_remove,

View File

@@ -139,8 +139,7 @@ static void adf_device_reset_worker(struct work_struct *work)
if (adf_dev_init(accel_dev) || adf_dev_start(accel_dev)) { if (adf_dev_init(accel_dev) || adf_dev_start(accel_dev)) {
/* The device hanged and we can't restart it so stop here */ /* The device hanged and we can't restart it so stop here */
dev_err(&GET_DEV(accel_dev), "Restart device failed\n"); dev_err(&GET_DEV(accel_dev), "Restart device failed\n");
if (reset_data->mode == ADF_DEV_RESET_ASYNC || if (reset_data->mode == ADF_DEV_RESET_ASYNC)
completion_done(&reset_data->compl))
kfree(reset_data); kfree(reset_data);
WARN(1, "QAT: device restart failed. Device is unusable\n"); WARN(1, "QAT: device restart failed. Device is unusable\n");
return; return;
@@ -148,16 +147,8 @@ static void adf_device_reset_worker(struct work_struct *work)
adf_dev_restarted_notify(accel_dev); adf_dev_restarted_notify(accel_dev);
clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status); clear_bit(ADF_STATUS_RESTARTING, &accel_dev->status);
/* /* The dev is back alive. Notify the caller if in sync mode */
* The dev is back alive. Notify the caller if in sync mode if (reset_data->mode == ADF_DEV_RESET_ASYNC)
*
* If device restart will take a more time than expected,
* the schedule_reset() function can timeout and exit. This can be
* detected by calling the completion_done() function. In this case
* the reset_data structure needs to be freed here.
*/
if (reset_data->mode == ADF_DEV_RESET_ASYNC ||
completion_done(&reset_data->compl))
kfree(reset_data); kfree(reset_data);
else else
complete(&reset_data->compl); complete(&reset_data->compl);
@@ -192,10 +183,10 @@ static int adf_dev_aer_schedule_reset(struct adf_accel_dev *accel_dev,
if (!timeout) { if (!timeout) {
dev_err(&GET_DEV(accel_dev), dev_err(&GET_DEV(accel_dev),
"Reset device timeout expired\n"); "Reset device timeout expired\n");
cancel_work_sync(&reset_data->reset_work);
ret = -EFAULT; ret = -EFAULT;
} else {
kfree(reset_data);
} }
kfree(reset_data);
return ret; return ret;
} }
return 0; return 0;

View File

@@ -119,12 +119,12 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
seq_printf(s, "%s: %d\n", obj->name, obj->value); seq_printf(s, "%s: %d\n", obj->name, obj->value);
spin_lock_irq(&obj->lock); spin_lock(&obj->lock); /* Caller already disabled IRQ. */
list_for_each(pos, &obj->pt_list) { list_for_each(pos, &obj->pt_list) {
struct sync_pt *pt = container_of(pos, struct sync_pt, link); struct sync_pt *pt = container_of(pos, struct sync_pt, link);
sync_print_fence(s, &pt->base, false); sync_print_fence(s, &pt->base, false);
} }
spin_unlock_irq(&obj->lock); spin_unlock(&obj->lock);
} }
static void sync_print_sync_file(struct seq_file *s, static void sync_print_sync_file(struct seq_file *s,

View File

@@ -603,7 +603,9 @@ static int idma64_probe(struct idma64_chip *chip)
idma64->dma.dev = chip->sysdev; idma64->dma.dev = chip->sysdev;
dma_set_max_seg_size(idma64->dma.dev, IDMA64C_CTLH_BLOCK_TS_MASK); ret = dma_set_max_seg_size(idma64->dma.dev, IDMA64C_CTLH_BLOCK_TS_MASK);
if (ret)
return ret;
ret = dma_async_device_register(&idma64->dma); ret = dma_async_device_register(&idma64->dma);
if (ret) if (ret)

View File

@@ -101,7 +101,8 @@ config EXTCON_MAX77843
config EXTCON_MAX8997 config EXTCON_MAX8997
tristate "Maxim MAX8997 EXTCON Support" tristate "Maxim MAX8997 EXTCON Support"
depends on MFD_MAX8997 && IRQ_DOMAIN depends on MFD_MAX8997
select IRQ_DOMAIN
help help
If you say yes here you get support for the MUIC device of If you say yes here you get support for the MUIC device of
Maxim MAX8997 PMIC. The MAX8997 MUIC is a USB port accessory Maxim MAX8997 PMIC. The MAX8997 MUIC is a USB port accessory

View File

@@ -161,9 +161,14 @@ static int dmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
return 0; return 0;
} }
static void dmi_dev_release(struct device *dev)
{
kfree(dev);
}
static struct class dmi_class = { static struct class dmi_class = {
.name = "dmi", .name = "dmi",
.dev_release = (void(*)(struct device *)) kfree, .dev_release = dmi_dev_release,
.dev_uevent = dmi_dev_uevent, .dev_uevent = dmi_dev_uevent,
}; };

View File

@@ -11,6 +11,7 @@
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/mailbox_client.h> #include <linux/mailbox_client.h>
#include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
@@ -91,8 +92,8 @@ int rpi_firmware_property_list(struct rpi_firmware *fw,
if (size & 3) if (size & 3)
return -EINVAL; return -EINVAL;
buf = dma_alloc_coherent(fw->cl.dev, PAGE_ALIGN(size), &bus_addr, buf = dma_alloc_coherent(fw->chan->mbox->dev, PAGE_ALIGN(size),
GFP_ATOMIC); &bus_addr, GFP_ATOMIC);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
@@ -120,7 +121,7 @@ int rpi_firmware_property_list(struct rpi_firmware *fw,
ret = -EINVAL; ret = -EINVAL;
} }
dma_free_coherent(fw->cl.dev, PAGE_ALIGN(size), buf, bus_addr); dma_free_coherent(fw->chan->mbox->dev, PAGE_ALIGN(size), buf, bus_addr);
return ret; return ret;
} }

View File

@@ -816,6 +816,7 @@ static int dm_resume(void *handle)
dc_stream_release(dm_new_crtc_state->stream); dc_stream_release(dm_new_crtc_state->stream);
dm_new_crtc_state->stream = NULL; dm_new_crtc_state->stream = NULL;
} }
dm_new_crtc_state->base.color_mgmt_changed = true;
} }
for_each_new_plane_in_state(dm->cached_state, plane, new_plane_state, i) { for_each_new_plane_in_state(dm->cached_state, plane, new_plane_state, i) {

View File

@@ -315,6 +315,11 @@ bool cm_helper_translate_curve_to_hw_format(
i += increment) { i += increment) {
if (j == hw_points - 1) if (j == hw_points - 1)
break; break;
if (i >= TRANSFER_FUNC_POINTS) {
DC_LOG_ERROR("Index out of bounds: i=%d, TRANSFER_FUNC_POINTS=%d\n",
i, TRANSFER_FUNC_POINTS);
return false;
}
rgb_resulted[j].red = output_tf->tf_pts.red[i]; rgb_resulted[j].red = output_tf->tf_pts.red[i];
rgb_resulted[j].green = output_tf->tf_pts.green[i]; rgb_resulted[j].green = output_tf->tf_pts.green[i];
rgb_resulted[j].blue = output_tf->tf_pts.blue[i]; rgb_resulted[j].blue = output_tf->tf_pts.blue[i];

View File

@@ -69,7 +69,10 @@ static void malidp_mw_connector_reset(struct drm_connector *connector)
__drm_atomic_helper_connector_destroy_state(connector->state); __drm_atomic_helper_connector_destroy_state(connector->state);
kfree(connector->state); kfree(connector->state);
__drm_atomic_helper_connector_reset(connector, &mw_state->base); connector->state = NULL;
if (mw_state)
__drm_atomic_helper_connector_reset(connector, &mw_state->base);
} }
static enum drm_connector_status static enum drm_connector_status

View File

@@ -26,6 +26,9 @@ static struct mtk_drm_gem_obj *mtk_drm_gem_init(struct drm_device *dev,
size = round_up(size, PAGE_SIZE); size = round_up(size, PAGE_SIZE);
if (size == 0)
return ERR_PTR(-EINVAL);
mtk_gem_obj = kzalloc(sizeof(*mtk_gem_obj), GFP_KERNEL); mtk_gem_obj = kzalloc(sizeof(*mtk_gem_obj), GFP_KERNEL);
if (!mtk_gem_obj) if (!mtk_gem_obj)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);

View File

@@ -823,7 +823,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(
{ {
struct dpu_encoder_phys *phys_enc = NULL; struct dpu_encoder_phys *phys_enc = NULL;
struct dpu_encoder_phys_cmd *cmd_enc = NULL; struct dpu_encoder_phys_cmd *cmd_enc = NULL;
struct dpu_hw_mdp *hw_mdp;
struct dpu_encoder_irq *irq; struct dpu_encoder_irq *irq;
int i, ret = 0; int i, ret = 0;
@@ -836,14 +835,7 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(
goto fail; goto fail;
} }
phys_enc = &cmd_enc->base; phys_enc = &cmd_enc->base;
phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
hw_mdp = dpu_rm_get_mdp(&p->dpu_kms->rm);
if (IS_ERR_OR_NULL(hw_mdp)) {
ret = PTR_ERR(hw_mdp);
DPU_ERROR("failed to get mdptop\n");
goto fail_mdp_init;
}
phys_enc->hw_mdptop = hw_mdp;
phys_enc->intf_idx = p->intf_idx; phys_enc->intf_idx = p->intf_idx;
dpu_encoder_phys_cmd_init_ops(&phys_enc->ops); dpu_encoder_phys_cmd_init_ops(&phys_enc->ops);
@@ -898,8 +890,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_cmd_init(
return phys_enc; return phys_enc;
fail_mdp_init:
kfree(cmd_enc);
fail: fail:
return ERR_PTR(ret); return ERR_PTR(ret);
} }

View File

@@ -829,7 +829,6 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
struct dpu_encoder_phys *phys_enc = NULL; struct dpu_encoder_phys *phys_enc = NULL;
struct dpu_encoder_phys_vid *vid_enc = NULL; struct dpu_encoder_phys_vid *vid_enc = NULL;
struct dpu_rm_hw_iter iter; struct dpu_rm_hw_iter iter;
struct dpu_hw_mdp *hw_mdp;
struct dpu_encoder_irq *irq; struct dpu_encoder_irq *irq;
int i, ret = 0; int i, ret = 0;
@@ -846,13 +845,7 @@ struct dpu_encoder_phys *dpu_encoder_phys_vid_init(
phys_enc = &vid_enc->base; phys_enc = &vid_enc->base;
hw_mdp = dpu_rm_get_mdp(&p->dpu_kms->rm); phys_enc->hw_mdptop = p->dpu_kms->hw_mdp;
if (IS_ERR_OR_NULL(hw_mdp)) {
ret = PTR_ERR(hw_mdp);
DPU_ERROR("failed to get mdptop\n");
goto fail;
}
phys_enc->hw_mdptop = hw_mdp;
phys_enc->intf_idx = p->intf_idx; phys_enc->intf_idx = p->intf_idx;
/** /**

View File

@@ -250,6 +250,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa76f), PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa76f),
.driver_data = (kernel_ulong_t)&intel_th_2x, .driver_data = (kernel_ulong_t)&intel_th_2x,
}, },
{
/* Meteor Lake-S CPU */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xae24),
.driver_data = (kernel_ulong_t)&intel_th_2x,
},
{ {
/* Raptor Lake-S */ /* Raptor Lake-S */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7a26), PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x7a26),

View File

@@ -701,8 +701,11 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data,
return -ENOMEM; return -ENOMEM;
stm->major = register_chrdev(0, stm_data->name, &stm_fops); stm->major = register_chrdev(0, stm_data->name, &stm_fops);
if (stm->major < 0) if (stm->major < 0) {
goto err_free; err = stm->major;
vfree(stm);
return err;
}
device_initialize(&stm->dev); device_initialize(&stm->dev);
stm->dev.devt = MKDEV(stm->major, 0); stm->dev.devt = MKDEV(stm->major, 0);
@@ -746,10 +749,8 @@ int stm_register_device(struct device *parent, struct stm_data *stm_data,
err_device: err_device:
unregister_chrdev(stm->major, stm_data->name); unregister_chrdev(stm->major, stm_data->name);
/* matches device_initialize() above */ /* calls stm_device_release() */
put_device(&stm->dev); put_device(&stm->dev);
err_free:
vfree(stm);
return err; return err;
} }

View File

@@ -57,16 +57,16 @@ enum {
(sizeof(struct scatterlist) + sizeof(void *))) (sizeof(struct scatterlist) + sizeof(void *)))
#define check_whether_bt_num_3(type, hop_num) \ #define check_whether_bt_num_3(type, hop_num) \
(type < HEM_TYPE_MTT && hop_num == 2) ((type) < HEM_TYPE_MTT && (hop_num) == 2)
#define check_whether_bt_num_2(type, hop_num) \ #define check_whether_bt_num_2(type, hop_num) \
((type < HEM_TYPE_MTT && hop_num == 1) || \ (((type) < HEM_TYPE_MTT && (hop_num) == 1) || \
(type >= HEM_TYPE_MTT && hop_num == 2)) ((type) >= HEM_TYPE_MTT && (hop_num) == 2))
#define check_whether_bt_num_1(type, hop_num) \ #define check_whether_bt_num_1(type, hop_num) \
((type < HEM_TYPE_MTT && hop_num == HNS_ROCE_HOP_NUM_0) || \ (((type) < HEM_TYPE_MTT && (hop_num) == HNS_ROCE_HOP_NUM_0) || \
(type >= HEM_TYPE_MTT && hop_num == 1) || \ ((type) >= HEM_TYPE_MTT && (hop_num) == 1) || \
(type >= HEM_TYPE_MTT && hop_num == HNS_ROCE_HOP_NUM_0)) ((type) >= HEM_TYPE_MTT && (hop_num) == HNS_ROCE_HOP_NUM_0))
enum { enum {
HNS_ROCE_HEM_PAGE_SHIFT = 12, HNS_ROCE_HEM_PAGE_SHIFT = 12,

View File

@@ -179,8 +179,12 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey)
ppriv = ipoib_priv(pdev); ppriv = ipoib_priv(pdev);
snprintf(intf_name, sizeof(intf_name), "%s.%04x", /* If you increase IFNAMSIZ, update snprintf below
ppriv->dev->name, pkey); * to allow longer names.
*/
BUILD_BUG_ON(IFNAMSIZ != 16);
snprintf(intf_name, sizeof(intf_name), "%.10s.%04x", ppriv->dev->name,
pkey);
priv = ipoib_intf_alloc(ppriv->ca, ppriv->port, intf_name); priv = ipoib_intf_alloc(ppriv->ca, ppriv->port, intf_name);
if (!priv) { if (!priv) {

View File

@@ -47,8 +47,8 @@ struct ims_pcu_backlight {
#define IMS_PCU_PART_NUMBER_LEN 15 #define IMS_PCU_PART_NUMBER_LEN 15
#define IMS_PCU_SERIAL_NUMBER_LEN 8 #define IMS_PCU_SERIAL_NUMBER_LEN 8
#define IMS_PCU_DOM_LEN 8 #define IMS_PCU_DOM_LEN 8
#define IMS_PCU_FW_VERSION_LEN (9 + 1) #define IMS_PCU_FW_VERSION_LEN 16
#define IMS_PCU_BL_VERSION_LEN (9 + 1) #define IMS_PCU_BL_VERSION_LEN 16
#define IMS_PCU_BL_RESET_REASON_LEN (2 + 1) #define IMS_PCU_BL_RESET_REASON_LEN (2 + 1)
#define IMS_PCU_PCU_B_DEVICE_ID 5 #define IMS_PCU_PCU_B_DEVICE_ID 5

View File

@@ -22,7 +22,8 @@
#define VIB_MAX_LEVEL_mV (3100) #define VIB_MAX_LEVEL_mV (3100)
#define VIB_MIN_LEVEL_mV (1200) #define VIB_MIN_LEVEL_mV (1200)
#define VIB_MAX_LEVELS (VIB_MAX_LEVEL_mV - VIB_MIN_LEVEL_mV) #define VIB_PER_STEP_mV (100)
#define VIB_MAX_LEVELS (VIB_MAX_LEVEL_mV - VIB_MIN_LEVEL_mV + VIB_PER_STEP_mV)
#define MAX_FF_SPEED 0xff #define MAX_FF_SPEED 0xff
@@ -126,10 +127,10 @@ static void pm8xxx_work_handler(struct work_struct *work)
vib->active = true; vib->active = true;
vib->level = ((VIB_MAX_LEVELS * vib->speed) / MAX_FF_SPEED) + vib->level = ((VIB_MAX_LEVELS * vib->speed) / MAX_FF_SPEED) +
VIB_MIN_LEVEL_mV; VIB_MIN_LEVEL_mV;
vib->level /= 100; vib->level /= VIB_PER_STEP_mV;
} else { } else {
vib->active = false; vib->active = false;
vib->level = VIB_MIN_LEVEL_mV / 100; vib->level = VIB_MIN_LEVEL_mV / VIB_PER_STEP_mV;
} }
pm8xxx_vib_set(vib, vib->active); pm8xxx_vib_set(vib, vib->active);

View File

@@ -165,7 +165,7 @@ static int alpine_msix_middle_domain_alloc(struct irq_domain *domain,
return 0; return 0;
err_sgi: err_sgi:
irq_domain_free_irqs_parent(domain, virq, i - 1); irq_domain_free_irqs_parent(domain, virq, i);
alpine_msix_free_sgi(priv, sgi, nr_irqs); alpine_msix_free_sgi(priv, sgi, nr_irqs);
return err; return err;
} }

View File

@@ -20,13 +20,13 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <asm/macintosh.h> #include <asm/macintosh.h>
#include <asm/macints.h> #include <asm/macints.h>
#include <asm/mac_iop.h> #include <asm/mac_iop.h>
#include <asm/mac_oss.h> #include <asm/mac_oss.h>
#include <asm/adb_iop.h> #include <asm/adb_iop.h>
#include <linux/adb.h> #include <linux/adb.h>
/*#define DEBUG_ADB_IOP*/ /*#define DEBUG_ADB_IOP*/
@@ -38,9 +38,9 @@ static unsigned char *reply_ptr;
#endif #endif
static enum adb_iop_state { static enum adb_iop_state {
idle, idle,
sending, sending,
awaiting_reply awaiting_reply
} adb_iop_state; } adb_iop_state;
static void adb_iop_start(void); static void adb_iop_start(void);
@@ -66,7 +66,8 @@ static void adb_iop_end_req(struct adb_request *req, int state)
{ {
req->complete = 1; req->complete = 1;
current_req = req->next; current_req = req->next;
if (req->done) (*req->done)(req); if (req->done)
(*req->done)(req);
adb_iop_state = state; adb_iop_state = state;
} }
@@ -100,7 +101,7 @@ static void adb_iop_complete(struct iop_msg *msg)
static void adb_iop_listen(struct iop_msg *msg) static void adb_iop_listen(struct iop_msg *msg)
{ {
struct adb_iopmsg *amsg = (struct adb_iopmsg *) msg->message; struct adb_iopmsg *amsg = (struct adb_iopmsg *)msg->message;
struct adb_request *req; struct adb_request *req;
unsigned long flags; unsigned long flags;
#ifdef DEBUG_ADB_IOP #ifdef DEBUG_ADB_IOP
@@ -113,9 +114,9 @@ static void adb_iop_listen(struct iop_msg *msg)
#ifdef DEBUG_ADB_IOP #ifdef DEBUG_ADB_IOP
printk("adb_iop_listen %p: rcvd packet, %d bytes: %02X %02X", req, printk("adb_iop_listen %p: rcvd packet, %d bytes: %02X %02X", req,
(uint) amsg->count + 2, (uint) amsg->flags, (uint) amsg->cmd); (uint)amsg->count + 2, (uint)amsg->flags, (uint)amsg->cmd);
for (i = 0; i < amsg->count; i++) for (i = 0; i < amsg->count; i++)
printk(" %02X", (uint) amsg->data[i]); printk(" %02X", (uint)amsg->data[i]);
printk("\n"); printk("\n");
#endif #endif
@@ -168,14 +169,15 @@ static void adb_iop_start(void)
/* get the packet to send */ /* get the packet to send */
req = current_req; req = current_req;
if (!req) return; if (!req)
return;
local_irq_save(flags); local_irq_save(flags);
#ifdef DEBUG_ADB_IOP #ifdef DEBUG_ADB_IOP
printk("adb_iop_start %p: sending packet, %d bytes:", req, req->nbytes); printk("adb_iop_start %p: sending packet, %d bytes:", req, req->nbytes);
for (i = 0 ; i < req->nbytes ; i++) for (i = 0; i < req->nbytes; i++)
printk(" %02X", (uint) req->data[i]); printk(" %02X", (uint)req->data[i]);
printk("\n"); printk("\n");
#endif #endif
@@ -196,13 +198,14 @@ static void adb_iop_start(void)
/* Now send it. The IOP manager will call adb_iop_complete */ /* Now send it. The IOP manager will call adb_iop_complete */
/* when the packet has been sent. */ /* when the packet has been sent. */
iop_send_message(ADB_IOP, ADB_CHAN, req, iop_send_message(ADB_IOP, ADB_CHAN, req, sizeof(amsg), (__u8 *)&amsg,
sizeof(amsg), (__u8 *) &amsg, adb_iop_complete); adb_iop_complete);
} }
int adb_iop_probe(void) int adb_iop_probe(void)
{ {
if (!iop_ism_present) return -ENODEV; if (!iop_ism_present)
return -ENODEV;
return 0; return 0;
} }
@@ -218,10 +221,12 @@ int adb_iop_send_request(struct adb_request *req, int sync)
int err; int err;
err = adb_iop_write(req); err = adb_iop_write(req);
if (err) return err; if (err)
return err;
if (sync) { if (sync) {
while (!req->complete) adb_iop_poll(); while (!req->complete)
adb_iop_poll();
} }
return 0; return 0;
} }
@@ -251,7 +256,9 @@ static int adb_iop_write(struct adb_request *req)
} }
local_irq_restore(flags); local_irq_restore(flags);
if (adb_iop_state == idle) adb_iop_start();
if (adb_iop_state == idle)
adb_iop_start();
return 0; return 0;
} }
@@ -263,7 +270,8 @@ int adb_iop_autopoll(int devs)
void adb_iop_poll(void) void adb_iop_poll(void)
{ {
if (adb_iop_state == idle) adb_iop_start(); if (adb_iop_state == idle)
adb_iop_start();
iop_ism_irq_poll(ADB_IOP); iop_ism_irq_poll(ADB_IOP);
} }

View File

@@ -12,7 +12,7 @@
* *
* 1999-08-02 (jmt) - Initial rewrite for Unified ADB. * 1999-08-02 (jmt) - Initial rewrite for Unified ADB.
* 2000-03-29 Tony Mantler <tonym@mac.linux-m68k.org> * 2000-03-29 Tony Mantler <tonym@mac.linux-m68k.org>
* - Big overhaul, should actually work now. * - Big overhaul, should actually work now.
* 2006-12-31 Finn Thain - Another overhaul. * 2006-12-31 Finn Thain - Another overhaul.
* *
* Suggested reading: * Suggested reading:
@@ -23,7 +23,7 @@
* Apple's "ADB Analyzer" bus sniffer is invaluable: * Apple's "ADB Analyzer" bus sniffer is invaluable:
* ftp://ftp.apple.com/developer/Tool_Chest/Devices_-_Hardware/Apple_Desktop_Bus/ * ftp://ftp.apple.com/developer/Tool_Chest/Devices_-_Hardware/Apple_Desktop_Bus/
*/ */
#include <stdarg.h> #include <stdarg.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/errno.h> #include <linux/errno.h>
@@ -77,7 +77,7 @@ static volatile unsigned char *via;
#define ST_ODD 0x20 /* ADB state: odd data byte */ #define ST_ODD 0x20 /* ADB state: odd data byte */
#define ST_IDLE 0x30 /* ADB state: idle, nothing to send */ #define ST_IDLE 0x30 /* ADB state: idle, nothing to send */
static int macii_init_via(void); static int macii_init_via(void);
static void macii_start(void); static void macii_start(void);
static irqreturn_t macii_interrupt(int irq, void *arg); static irqreturn_t macii_interrupt(int irq, void *arg);
static void macii_queue_poll(void); static void macii_queue_poll(void);
@@ -120,27 +120,11 @@ static int srq_asserted; /* have to poll for the device that asserted it */
static int command_byte; /* the most recent command byte transmitted */ static int command_byte; /* the most recent command byte transmitted */
static int autopoll_devs; /* bits set are device addresses to be polled */ static int autopoll_devs; /* bits set are device addresses to be polled */
/* Sanity check for request queue. Doesn't check for cycles. */
static int request_is_queued(struct adb_request *req) {
struct adb_request *cur;
unsigned long flags;
local_irq_save(flags);
cur = current_req;
while (cur) {
if (cur == req) {
local_irq_restore(flags);
return 1;
}
cur = cur->next;
}
local_irq_restore(flags);
return 0;
}
/* Check for MacII style ADB */ /* Check for MacII style ADB */
static int macii_probe(void) static int macii_probe(void)
{ {
if (macintosh_config->adb_type != MAC_ADB_II) return -ENODEV; if (macintosh_config->adb_type != MAC_ADB_II)
return -ENODEV;
via = via1; via = via1;
@@ -151,25 +135,22 @@ static int macii_probe(void)
/* Initialize the driver */ /* Initialize the driver */
int macii_init(void) int macii_init(void)
{ {
unsigned long flags;
int err; int err;
local_irq_save(flags);
err = macii_init_via(); err = macii_init_via();
if (err) goto out; if (err)
return err;
err = request_irq(IRQ_MAC_ADB, macii_interrupt, 0, "ADB", err = request_irq(IRQ_MAC_ADB, macii_interrupt, 0, "ADB",
macii_interrupt); macii_interrupt);
if (err) goto out; if (err)
return err;
macii_state = idle; macii_state = idle;
out: return 0;
local_irq_restore(flags);
return err;
} }
/* initialize the hardware */ /* initialize the hardware */
static int macii_init_via(void) static int macii_init_via(void)
{ {
unsigned char x; unsigned char x;
@@ -179,7 +160,7 @@ static int macii_init_via(void)
/* Set up state: idle */ /* Set up state: idle */
via[B] |= ST_IDLE; via[B] |= ST_IDLE;
last_status = via[B] & (ST_MASK|CTLR_IRQ); last_status = via[B] & (ST_MASK | CTLR_IRQ);
/* Shift register on input */ /* Shift register on input */
via[ACR] = (via[ACR] & ~SR_CTRL) | SR_EXT; via[ACR] = (via[ACR] & ~SR_CTRL) | SR_EXT;
@@ -205,7 +186,8 @@ static void macii_queue_poll(void)
int next_device; int next_device;
static struct adb_request req; static struct adb_request req;
if (!autopoll_devs) return; if (!autopoll_devs)
return;
device_mask = (1 << (((command_byte & 0xF0) >> 4) + 1)) - 1; device_mask = (1 << (((command_byte & 0xF0) >> 4) + 1)) - 1;
if (autopoll_devs & ~device_mask) if (autopoll_devs & ~device_mask)
@@ -213,10 +195,7 @@ static void macii_queue_poll(void)
else else
next_device = ffs(autopoll_devs) - 1; next_device = ffs(autopoll_devs) - 1;
BUG_ON(request_is_queued(&req)); adb_request(&req, NULL, ADBREQ_NOSEND, 1, ADB_READREG(next_device, 0));
adb_request(&req, NULL, ADBREQ_NOSEND, 1,
ADB_READREG(next_device, 0));
req.sent = 0; req.sent = 0;
req.complete = 0; req.complete = 0;
@@ -237,18 +216,13 @@ static int macii_send_request(struct adb_request *req, int sync)
int err; int err;
unsigned long flags; unsigned long flags;
BUG_ON(request_is_queued(req));
local_irq_save(flags); local_irq_save(flags);
err = macii_write(req); err = macii_write(req);
local_irq_restore(flags); local_irq_restore(flags);
if (!err && sync) { if (!err && sync)
while (!req->complete) { while (!req->complete)
macii_poll(); macii_poll();
}
BUG_ON(request_is_queued(req));
}
return err; return err;
} }
@@ -260,7 +234,7 @@ static int macii_write(struct adb_request *req)
req->complete = 1; req->complete = 1;
return -EINVAL; return -EINVAL;
} }
req->next = NULL; req->next = NULL;
req->sent = 0; req->sent = 0;
req->complete = 0; req->complete = 0;
@@ -272,7 +246,8 @@ static int macii_write(struct adb_request *req)
} else { } else {
current_req = req; current_req = req;
last_req = req; last_req = req;
if (macii_state == idle) macii_start(); if (macii_state == idle)
macii_start();
} }
return 0; return 0;
} }
@@ -287,7 +262,8 @@ static int macii_autopoll(int devs)
/* bit 1 == device 1, and so on. */ /* bit 1 == device 1, and so on. */
autopoll_devs = devs & 0xFFFE; autopoll_devs = devs & 0xFFFE;
if (!autopoll_devs) return 0; if (!autopoll_devs)
return 0;
local_irq_save(flags); local_irq_save(flags);
@@ -304,7 +280,8 @@ static int macii_autopoll(int devs)
return err; return err;
} }
static inline int need_autopoll(void) { static inline int need_autopoll(void)
{
/* Was the last command Talk Reg 0 /* Was the last command Talk Reg 0
* and is the target on the autopoll list? * and is the target on the autopoll list?
*/ */
@@ -326,9 +303,6 @@ static void macii_poll(void)
static int macii_reset_bus(void) static int macii_reset_bus(void)
{ {
static struct adb_request req; static struct adb_request req;
if (request_is_queued(&req))
return 0;
/* Command = 0, Address = ignored */ /* Command = 0, Address = ignored */
adb_request(&req, NULL, 0, 1, ADB_BUSRESET); adb_request(&req, NULL, 0, 1, ADB_BUSRESET);
@@ -346,10 +320,6 @@ static void macii_start(void)
req = current_req; req = current_req;
BUG_ON(req == NULL);
BUG_ON(macii_state != idle);
/* Now send it. Be careful though, that first byte of the request /* Now send it. Be careful though, that first byte of the request
* is actually ADB_PACKET; the real data begins at index 1! * is actually ADB_PACKET; the real data begins at index 1!
* And req->nbytes is the number of bytes of real data plus one. * And req->nbytes is the number of bytes of real data plus one.
@@ -375,7 +345,7 @@ static void macii_start(void)
* to be activity on the ADB bus. The chip will poll to achieve this. * to be activity on the ADB bus. The chip will poll to achieve this.
* *
* The basic ADB state machine was left unchanged from the original MacII code * The basic ADB state machine was left unchanged from the original MacII code
* by Alan Cox, which was based on the CUDA driver for PowerMac. * by Alan Cox, which was based on the CUDA driver for PowerMac.
* The syntax of the ADB status lines is totally different on MacII, * The syntax of the ADB status lines is totally different on MacII,
* though. MacII uses the states Command -> Even -> Odd -> Even ->...-> Idle * though. MacII uses the states Command -> Even -> Odd -> Even ->...-> Idle
* for sending and Idle -> Even -> Odd -> Even ->...-> Idle for receiving. * for sending and Idle -> Even -> Odd -> Even ->...-> Idle for receiving.
@@ -387,7 +357,6 @@ static void macii_start(void)
static irqreturn_t macii_interrupt(int irq, void *arg) static irqreturn_t macii_interrupt(int irq, void *arg)
{ {
int x; int x;
static int entered;
struct adb_request *req; struct adb_request *req;
if (!arg) { if (!arg) {
@@ -398,153 +367,150 @@ static irqreturn_t macii_interrupt(int irq, void *arg)
return IRQ_NONE; return IRQ_NONE;
} }
BUG_ON(entered++);
last_status = status; last_status = status;
status = via[B] & (ST_MASK|CTLR_IRQ); status = via[B] & (ST_MASK | CTLR_IRQ);
switch (macii_state) { switch (macii_state) {
case idle: case idle:
if (reading_reply) { if (reading_reply) {
reply_ptr = current_req->reply; reply_ptr = current_req->reply;
} else { } else {
BUG_ON(current_req != NULL); WARN_ON(current_req);
reply_ptr = reply_buf; reply_ptr = reply_buf;
} }
x = via[SR]; x = via[SR];
if ((status & CTLR_IRQ) && (x == 0xFF)) { if ((status & CTLR_IRQ) && (x == 0xFF)) {
/* Bus timeout without SRQ sequence: /* Bus timeout without SRQ sequence:
* data is "FF" while CTLR_IRQ is "H" * data is "FF" while CTLR_IRQ is "H"
*/
reply_len = 0;
srq_asserted = 0;
macii_state = read_done;
} else {
macii_state = reading;
*reply_ptr = x;
reply_len = 1;
}
/* set ADB state = even for first data byte */
via[B] = (via[B] & ~ST_MASK) | ST_EVEN;
break;
case sending:
req = current_req;
if (data_index >= req->nbytes) {
req->sent = 1;
macii_state = idle;
if (req->reply_expected) {
reading_reply = 1;
} else {
req->complete = 1;
current_req = req->next;
if (req->done) (*req->done)(req);
if (current_req)
macii_start();
else
if (need_autopoll())
macii_autopoll(autopoll_devs);
}
if (macii_state == idle) {
/* reset to shift in */
via[ACR] &= ~SR_OUT;
x = via[SR];
/* set ADB state idle - might get SRQ */
via[B] = (via[B] & ~ST_MASK) | ST_IDLE;
}
} else {
via[SR] = req->data[data_index++];
if ( (via[B] & ST_MASK) == ST_CMD ) {
/* just sent the command byte, set to EVEN */
via[B] = (via[B] & ~ST_MASK) | ST_EVEN;
} else {
/* invert state bits, toggle ODD/EVEN */
via[B] ^= ST_MASK;
}
}
break;
case reading:
x = via[SR];
BUG_ON((status & ST_MASK) == ST_CMD ||
(status & ST_MASK) == ST_IDLE);
/* Bus timeout with SRQ sequence:
* data is "XX FF" while CTLR_IRQ is "L L"
* End of packet without SRQ sequence:
* data is "XX...YY 00" while CTLR_IRQ is "L...H L"
* End of packet SRQ sequence:
* data is "XX...YY 00" while CTLR_IRQ is "L...L L"
* (where XX is the first response byte and
* YY is the last byte of valid response data.)
*/ */
reply_len = 0;
srq_asserted = 0; srq_asserted = 0;
if (!(status & CTLR_IRQ)) { macii_state = read_done;
if (x == 0xFF) { } else {
if (!(last_status & CTLR_IRQ)) { macii_state = reading;
macii_state = read_done; *reply_ptr = x;
reply_len = 0; reply_len = 1;
srq_asserted = 1; }
}
} else if (x == 0x00) {
macii_state = read_done;
if (!(last_status & CTLR_IRQ))
srq_asserted = 1;
}
}
if (macii_state == reading) { /* set ADB state = even for first data byte */
BUG_ON(reply_len > 15); via[B] = (via[B] & ~ST_MASK) | ST_EVEN;
reply_ptr++; break;
*reply_ptr = x;
reply_len++;
}
/* invert state bits, toggle ODD/EVEN */
via[B] ^= ST_MASK;
break;
case read_done:
x = via[SR];
if (reading_reply) {
reading_reply = 0;
req = current_req;
req->reply_len = reply_len;
req->complete = 1;
current_req = req->next;
if (req->done) (*req->done)(req);
} else if (reply_len && autopoll_devs)
adb_input(reply_buf, reply_len, 0);
case sending:
req = current_req;
if (data_index >= req->nbytes) {
req->sent = 1;
macii_state = idle; macii_state = idle;
/* SRQ seen before, initiate poll now */ if (req->reply_expected) {
if (srq_asserted) reading_reply = 1;
macii_queue_poll(); } else {
req->complete = 1;
current_req = req->next;
if (req->done)
(*req->done)(req);
if (current_req) if (current_req)
macii_start(); macii_start();
else else if (need_autopoll())
if (need_autopoll())
macii_autopoll(autopoll_devs); macii_autopoll(autopoll_devs);
}
if (macii_state == idle) if (macii_state == idle) {
/* reset to shift in */
via[ACR] &= ~SR_OUT;
x = via[SR];
/* set ADB state idle - might get SRQ */
via[B] = (via[B] & ~ST_MASK) | ST_IDLE; via[B] = (via[B] & ~ST_MASK) | ST_IDLE;
break; }
} else {
via[SR] = req->data[data_index++];
default: if ((via[B] & ST_MASK) == ST_CMD) {
/* just sent the command byte, set to EVEN */
via[B] = (via[B] & ~ST_MASK) | ST_EVEN;
} else {
/* invert state bits, toggle ODD/EVEN */
via[B] ^= ST_MASK;
}
}
break;
case reading:
x = via[SR];
WARN_ON((status & ST_MASK) == ST_CMD ||
(status & ST_MASK) == ST_IDLE);
/* Bus timeout with SRQ sequence:
* data is "XX FF" while CTLR_IRQ is "L L"
* End of packet without SRQ sequence:
* data is "XX...YY 00" while CTLR_IRQ is "L...H L"
* End of packet SRQ sequence:
* data is "XX...YY 00" while CTLR_IRQ is "L...L L"
* (where XX is the first response byte and
* YY is the last byte of valid response data.)
*/
srq_asserted = 0;
if (!(status & CTLR_IRQ)) {
if (x == 0xFF) {
if (!(last_status & CTLR_IRQ)) {
macii_state = read_done;
reply_len = 0;
srq_asserted = 1;
}
} else if (x == 0x00) {
macii_state = read_done;
if (!(last_status & CTLR_IRQ))
srq_asserted = 1;
}
}
if (macii_state == reading &&
reply_len < ARRAY_SIZE(reply_buf)) {
reply_ptr++;
*reply_ptr = x;
reply_len++;
}
/* invert state bits, toggle ODD/EVEN */
via[B] ^= ST_MASK;
break;
case read_done:
x = via[SR];
if (reading_reply) {
reading_reply = 0;
req = current_req;
req->reply_len = reply_len;
req->complete = 1;
current_req = req->next;
if (req->done)
(*req->done)(req);
} else if (reply_len && autopoll_devs)
adb_input(reply_buf, reply_len, 0);
macii_state = idle;
/* SRQ seen before, initiate poll now */
if (srq_asserted)
macii_queue_poll();
if (current_req)
macii_start();
else if (need_autopoll())
macii_autopoll(autopoll_devs);
if (macii_state == idle)
via[B] = (via[B] & ~ST_MASK) | ST_IDLE;
break;
default:
break; break;
} }
entered--;
return IRQ_HANDLED; return IRQ_HANDLED;
} }

View File

@@ -1358,7 +1358,7 @@ __acquires(bitmap->lock)
sector_t chunk = offset >> bitmap->chunkshift; sector_t chunk = offset >> bitmap->chunkshift;
unsigned long page = chunk >> PAGE_COUNTER_SHIFT; unsigned long page = chunk >> PAGE_COUNTER_SHIFT;
unsigned long pageoff = (chunk & PAGE_COUNTER_MASK) << COUNTER_BYTE_SHIFT; unsigned long pageoff = (chunk & PAGE_COUNTER_MASK) << COUNTER_BYTE_SHIFT;
sector_t csize; sector_t csize = ((sector_t)1) << bitmap->chunkshift;
int err; int err;
if (page >= bitmap->pages) { if (page >= bitmap->pages) {
@@ -1367,6 +1367,7 @@ __acquires(bitmap->lock)
* End-of-device while looking for a whole page or * End-of-device while looking for a whole page or
* user set a huge number to sysfs bitmap_set_bits. * user set a huge number to sysfs bitmap_set_bits.
*/ */
*blocks = csize - (offset & (csize - 1));
return NULL; return NULL;
} }
err = md_bitmap_checkpage(bitmap, page, create, 0); err = md_bitmap_checkpage(bitmap, page, create, 0);
@@ -1375,8 +1376,7 @@ __acquires(bitmap->lock)
bitmap->bp[page].map == NULL) bitmap->bp[page].map == NULL)
csize = ((sector_t)1) << (bitmap->chunkshift + csize = ((sector_t)1) << (bitmap->chunkshift +
PAGE_COUNTER_SHIFT); PAGE_COUNTER_SHIFT);
else
csize = ((sector_t)1) << bitmap->chunkshift;
*blocks = csize - (offset & (csize - 1)); *blocks = csize - (offset & (csize - 1));
if (err < 0) if (err < 0)

View File

@@ -44,7 +44,6 @@
*/ */
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/delay.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/raid/pq.h> #include <linux/raid/pq.h>
#include <linux/async_tx.h> #include <linux/async_tx.h>
@@ -6294,6 +6293,9 @@ static void raid5d(struct md_thread *thread)
int batch_size, released; int batch_size, released;
unsigned int offset; unsigned int offset;
if (test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags))
break;
released = release_stripe_list(conf, conf->temp_inactive_list); released = release_stripe_list(conf, conf->temp_inactive_list);
if (released) if (released)
clear_bit(R5_DID_ALLOC, &conf->cache_state); clear_bit(R5_DID_ALLOC, &conf->cache_state);
@@ -6330,18 +6332,7 @@ static void raid5d(struct md_thread *thread)
spin_unlock_irq(&conf->device_lock); spin_unlock_irq(&conf->device_lock);
md_check_recovery(mddev); md_check_recovery(mddev);
spin_lock_irq(&conf->device_lock); spin_lock_irq(&conf->device_lock);
/*
* Waiting on MD_SB_CHANGE_PENDING below may deadlock
* seeing md_check_recovery() is needed to clear
* the flag when using mdmon.
*/
continue;
} }
wait_event_lock_irq(mddev->sb_wait,
!test_bit(MD_SB_CHANGE_PENDING, &mddev->sb_flags),
conf->device_lock);
} }
pr_debug("%d stripes handled\n", handled); pr_debug("%d stripes handled\n", handled);

View File

@@ -863,8 +863,7 @@ int cec_transmit_msg_fh(struct cec_adapter *adap, struct cec_msg *msg,
*/ */
mutex_unlock(&adap->lock); mutex_unlock(&adap->lock);
wait_for_completion_killable(&data->c); wait_for_completion_killable(&data->c);
if (!data->completed) cancel_delayed_work_sync(&data->work);
cancel_delayed_work_sync(&data->work);
mutex_lock(&adap->lock); mutex_lock(&adap->lock);
/* Cancel the transmit if it was interrupted */ /* Cancel the transmit if it was interrupted */

View File

@@ -660,6 +660,8 @@ static int cec_release(struct inode *inode, struct file *filp)
list_del(&data->xfer_list); list_del(&data->xfer_list);
} }
mutex_unlock(&adap->lock); mutex_unlock(&adap->lock);
mutex_lock(&fh->lock);
while (!list_empty(&fh->msgs)) { while (!list_empty(&fh->msgs)) {
struct cec_msg_entry *entry = struct cec_msg_entry *entry =
list_first_entry(&fh->msgs, struct cec_msg_entry, list); list_first_entry(&fh->msgs, struct cec_msg_entry, list);
@@ -677,6 +679,7 @@ static int cec_release(struct inode *inode, struct file *filp)
kfree(entry); kfree(entry);
} }
} }
mutex_unlock(&fh->lock);
kfree(fh); kfree(fh);
cec_put_device(devnode); cec_put_device(devnode);

View File

@@ -1390,57 +1390,57 @@ static int config_ts(struct mxl *state, enum MXL_HYDRA_DEMOD_ID_E demod_id,
u32 nco_count_min = 0; u32 nco_count_min = 0;
u32 clk_type = 0; u32 clk_type = 0;
struct MXL_REG_FIELD_T xpt_sync_polarity[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_sync_polarity[MXL_HYDRA_DEMOD_MAX] = {
{0x90700010, 8, 1}, {0x90700010, 9, 1}, {0x90700010, 8, 1}, {0x90700010, 9, 1},
{0x90700010, 10, 1}, {0x90700010, 11, 1}, {0x90700010, 10, 1}, {0x90700010, 11, 1},
{0x90700010, 12, 1}, {0x90700010, 13, 1}, {0x90700010, 12, 1}, {0x90700010, 13, 1},
{0x90700010, 14, 1}, {0x90700010, 15, 1} }; {0x90700010, 14, 1}, {0x90700010, 15, 1} };
struct MXL_REG_FIELD_T xpt_clock_polarity[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_clock_polarity[MXL_HYDRA_DEMOD_MAX] = {
{0x90700010, 16, 1}, {0x90700010, 17, 1}, {0x90700010, 16, 1}, {0x90700010, 17, 1},
{0x90700010, 18, 1}, {0x90700010, 19, 1}, {0x90700010, 18, 1}, {0x90700010, 19, 1},
{0x90700010, 20, 1}, {0x90700010, 21, 1}, {0x90700010, 20, 1}, {0x90700010, 21, 1},
{0x90700010, 22, 1}, {0x90700010, 23, 1} }; {0x90700010, 22, 1}, {0x90700010, 23, 1} };
struct MXL_REG_FIELD_T xpt_valid_polarity[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_valid_polarity[MXL_HYDRA_DEMOD_MAX] = {
{0x90700014, 0, 1}, {0x90700014, 1, 1}, {0x90700014, 0, 1}, {0x90700014, 1, 1},
{0x90700014, 2, 1}, {0x90700014, 3, 1}, {0x90700014, 2, 1}, {0x90700014, 3, 1},
{0x90700014, 4, 1}, {0x90700014, 5, 1}, {0x90700014, 4, 1}, {0x90700014, 5, 1},
{0x90700014, 6, 1}, {0x90700014, 7, 1} }; {0x90700014, 6, 1}, {0x90700014, 7, 1} };
struct MXL_REG_FIELD_T xpt_ts_clock_phase[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_ts_clock_phase[MXL_HYDRA_DEMOD_MAX] = {
{0x90700018, 0, 3}, {0x90700018, 4, 3}, {0x90700018, 0, 3}, {0x90700018, 4, 3},
{0x90700018, 8, 3}, {0x90700018, 12, 3}, {0x90700018, 8, 3}, {0x90700018, 12, 3},
{0x90700018, 16, 3}, {0x90700018, 20, 3}, {0x90700018, 16, 3}, {0x90700018, 20, 3},
{0x90700018, 24, 3}, {0x90700018, 28, 3} }; {0x90700018, 24, 3}, {0x90700018, 28, 3} };
struct MXL_REG_FIELD_T xpt_lsb_first[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_lsb_first[MXL_HYDRA_DEMOD_MAX] = {
{0x9070000C, 16, 1}, {0x9070000C, 17, 1}, {0x9070000C, 16, 1}, {0x9070000C, 17, 1},
{0x9070000C, 18, 1}, {0x9070000C, 19, 1}, {0x9070000C, 18, 1}, {0x9070000C, 19, 1},
{0x9070000C, 20, 1}, {0x9070000C, 21, 1}, {0x9070000C, 20, 1}, {0x9070000C, 21, 1},
{0x9070000C, 22, 1}, {0x9070000C, 23, 1} }; {0x9070000C, 22, 1}, {0x9070000C, 23, 1} };
struct MXL_REG_FIELD_T xpt_sync_byte[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_sync_byte[MXL_HYDRA_DEMOD_MAX] = {
{0x90700010, 0, 1}, {0x90700010, 1, 1}, {0x90700010, 0, 1}, {0x90700010, 1, 1},
{0x90700010, 2, 1}, {0x90700010, 3, 1}, {0x90700010, 2, 1}, {0x90700010, 3, 1},
{0x90700010, 4, 1}, {0x90700010, 5, 1}, {0x90700010, 4, 1}, {0x90700010, 5, 1},
{0x90700010, 6, 1}, {0x90700010, 7, 1} }; {0x90700010, 6, 1}, {0x90700010, 7, 1} };
struct MXL_REG_FIELD_T xpt_enable_output[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_enable_output[MXL_HYDRA_DEMOD_MAX] = {
{0x9070000C, 0, 1}, {0x9070000C, 1, 1}, {0x9070000C, 0, 1}, {0x9070000C, 1, 1},
{0x9070000C, 2, 1}, {0x9070000C, 3, 1}, {0x9070000C, 2, 1}, {0x9070000C, 3, 1},
{0x9070000C, 4, 1}, {0x9070000C, 5, 1}, {0x9070000C, 4, 1}, {0x9070000C, 5, 1},
{0x9070000C, 6, 1}, {0x9070000C, 7, 1} }; {0x9070000C, 6, 1}, {0x9070000C, 7, 1} };
struct MXL_REG_FIELD_T xpt_err_replace_sync[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_err_replace_sync[MXL_HYDRA_DEMOD_MAX] = {
{0x9070000C, 24, 1}, {0x9070000C, 25, 1}, {0x9070000C, 24, 1}, {0x9070000C, 25, 1},
{0x9070000C, 26, 1}, {0x9070000C, 27, 1}, {0x9070000C, 26, 1}, {0x9070000C, 27, 1},
{0x9070000C, 28, 1}, {0x9070000C, 29, 1}, {0x9070000C, 28, 1}, {0x9070000C, 29, 1},
{0x9070000C, 30, 1}, {0x9070000C, 31, 1} }; {0x9070000C, 30, 1}, {0x9070000C, 31, 1} };
struct MXL_REG_FIELD_T xpt_err_replace_valid[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_err_replace_valid[MXL_HYDRA_DEMOD_MAX] = {
{0x90700014, 8, 1}, {0x90700014, 9, 1}, {0x90700014, 8, 1}, {0x90700014, 9, 1},
{0x90700014, 10, 1}, {0x90700014, 11, 1}, {0x90700014, 10, 1}, {0x90700014, 11, 1},
{0x90700014, 12, 1}, {0x90700014, 13, 1}, {0x90700014, 12, 1}, {0x90700014, 13, 1},
{0x90700014, 14, 1}, {0x90700014, 15, 1} }; {0x90700014, 14, 1}, {0x90700014, 15, 1} };
struct MXL_REG_FIELD_T xpt_continuous_clock[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_continuous_clock[MXL_HYDRA_DEMOD_MAX] = {
{0x907001D4, 0, 1}, {0x907001D4, 1, 1}, {0x907001D4, 0, 1}, {0x907001D4, 1, 1},
{0x907001D4, 2, 1}, {0x907001D4, 3, 1}, {0x907001D4, 2, 1}, {0x907001D4, 3, 1},
{0x907001D4, 4, 1}, {0x907001D4, 5, 1}, {0x907001D4, 4, 1}, {0x907001D4, 5, 1},
{0x907001D4, 6, 1}, {0x907001D4, 7, 1} }; {0x907001D4, 6, 1}, {0x907001D4, 7, 1} };
struct MXL_REG_FIELD_T xpt_nco_clock_rate[MXL_HYDRA_DEMOD_MAX] = { static const struct MXL_REG_FIELD_T xpt_nco_clock_rate[MXL_HYDRA_DEMOD_MAX] = {
{0x90700044, 16, 80}, {0x90700044, 16, 81}, {0x90700044, 16, 80}, {0x90700044, 16, 81},
{0x90700044, 16, 82}, {0x90700044, 16, 83}, {0x90700044, 16, 82}, {0x90700044, 16, 83},
{0x90700044, 16, 84}, {0x90700044, 16, 85}, {0x90700044, 16, 84}, {0x90700044, 16, 85},

View File

@@ -1505,7 +1505,9 @@ static int init_channel(struct ngene_channel *chan)
} }
if (dev->ci.en && (io & NGENE_IO_TSOUT)) { if (dev->ci.en && (io & NGENE_IO_TSOUT)) {
dvb_ca_en50221_init(adapter, dev->ci.en, 0, 1); ret = dvb_ca_en50221_init(adapter, dev->ci.en, 0, 1);
if (ret != 0)
goto err;
set_transfer(chan, 1); set_transfer(chan, 1);
chan->dev->channel[2].DataFormatFlags = DF_SWAP32; chan->dev->channel[2].DataFormatFlags = DF_SWAP32;
set_transfer(&chan->dev->channel[2], 1); set_transfer(&chan->dev->channel[2], 1);

View File

@@ -62,7 +62,7 @@ struct shark_device {
#ifdef SHARK_USE_LEDS #ifdef SHARK_USE_LEDS
struct work_struct led_work; struct work_struct led_work;
struct led_classdev leds[NO_LEDS]; struct led_classdev leds[NO_LEDS];
char led_names[NO_LEDS][32]; char led_names[NO_LEDS][64];
atomic_t brightness[NO_LEDS]; atomic_t brightness[NO_LEDS];
unsigned long brightness_new; unsigned long brightness_new;
#endif #endif

View File

@@ -109,7 +109,7 @@ void stk1160_buffer_done(struct stk1160 *dev)
static inline static inline
void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len) void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len)
{ {
int linesdone, lineoff, lencopy; int linesdone, lineoff, lencopy, offset;
int bytesperline = dev->width * 2; int bytesperline = dev->width * 2;
struct stk1160_buffer *buf = dev->isoc_ctl.buf; struct stk1160_buffer *buf = dev->isoc_ctl.buf;
u8 *dst = buf->mem; u8 *dst = buf->mem;
@@ -149,8 +149,13 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len)
* Check if we have enough space left in the buffer. * Check if we have enough space left in the buffer.
* In that case, we force loop exit after copy. * In that case, we force loop exit after copy.
*/ */
if (lencopy > buf->bytesused - buf->length) { offset = dst - (u8 *)buf->mem;
lencopy = buf->bytesused - buf->length; if (offset > buf->length) {
dev_warn_ratelimited(dev->dev, "out of bounds offset\n");
return;
}
if (lencopy > buf->length - offset) {
lencopy = buf->length - offset;
remain = lencopy; remain = lencopy;
} }
@@ -192,8 +197,13 @@ void stk1160_copy_video(struct stk1160 *dev, u8 *src, int len)
* Check if we have enough space left in the buffer. * Check if we have enough space left in the buffer.
* In that case, we force loop exit after copy. * In that case, we force loop exit after copy.
*/ */
if (lencopy > buf->bytesused - buf->length) { offset = dst - (u8 *)buf->mem;
lencopy = buf->bytesused - buf->length; if (offset > buf->length) {
dev_warn_ratelimited(dev->dev, "offset out of bounds\n");
return;
}
if (lencopy > buf->length - offset) {
lencopy = buf->length - offset;
remain = lencopy; remain = lencopy;
} }

View File

@@ -980,8 +980,10 @@ int __video_register_device(struct video_device *vdev,
vdev->dev.devt = MKDEV(VIDEO_MAJOR, vdev->minor); vdev->dev.devt = MKDEV(VIDEO_MAJOR, vdev->minor);
vdev->dev.parent = vdev->dev_parent; vdev->dev.parent = vdev->dev_parent;
dev_set_name(&vdev->dev, "%s%d", name_base, vdev->num); dev_set_name(&vdev->dev, "%s%d", name_base, vdev->num);
mutex_lock(&videodev_lock);
ret = device_register(&vdev->dev); ret = device_register(&vdev->dev);
if (ret < 0) { if (ret < 0) {
mutex_unlock(&videodev_lock);
pr_err("%s: device_register failed\n", __func__); pr_err("%s: device_register failed\n", __func__);
goto cleanup; goto cleanup;
} }
@@ -1001,6 +1003,7 @@ int __video_register_device(struct video_device *vdev,
/* Part 6: Activate this minor. The char device can now be used. */ /* Part 6: Activate this minor. The char device can now be used. */
set_bit(V4L2_FL_REGISTERED, &vdev->flags); set_bit(V4L2_FL_REGISTERED, &vdev->flags);
mutex_unlock(&videodev_lock);
return 0; return 0;

View File

@@ -69,13 +69,12 @@ void mmc_retune_enable(struct mmc_host *host)
/* /*
* Pause re-tuning for a small set of operations. The pause begins after the * Pause re-tuning for a small set of operations. The pause begins after the
* next command and after first doing re-tuning. * next command.
*/ */
void mmc_retune_pause(struct mmc_host *host) void mmc_retune_pause(struct mmc_host *host)
{ {
if (!host->retune_paused) { if (!host->retune_paused) {
host->retune_paused = 1; host->retune_paused = 1;
mmc_retune_needed(host);
mmc_retune_hold(host); mmc_retune_hold(host);
} }
} }

View File

@@ -414,7 +414,7 @@ static int hynix_nand_rr_init(struct nand_chip *chip)
if (ret) if (ret)
pr_warn("failed to initialize read-retry infrastructure"); pr_warn("failed to initialize read-retry infrastructure");
return 0; return ret;
} }
static void hynix_nand_extract_oobsize(struct nand_chip *chip, static void hynix_nand_extract_oobsize(struct nand_chip *chip,

View File

@@ -1152,18 +1152,30 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
pp->request = nla_get_u8(port[IFLA_PORT_REQUEST]); pp->request = nla_get_u8(port[IFLA_PORT_REQUEST]);
if (port[IFLA_PORT_PROFILE]) { if (port[IFLA_PORT_PROFILE]) {
if (nla_len(port[IFLA_PORT_PROFILE]) != PORT_PROFILE_MAX) {
memcpy(pp, &prev_pp, sizeof(*pp));
return -EINVAL;
}
pp->set |= ENIC_SET_NAME; pp->set |= ENIC_SET_NAME;
memcpy(pp->name, nla_data(port[IFLA_PORT_PROFILE]), memcpy(pp->name, nla_data(port[IFLA_PORT_PROFILE]),
PORT_PROFILE_MAX); PORT_PROFILE_MAX);
} }
if (port[IFLA_PORT_INSTANCE_UUID]) { if (port[IFLA_PORT_INSTANCE_UUID]) {
if (nla_len(port[IFLA_PORT_INSTANCE_UUID]) != PORT_UUID_MAX) {
memcpy(pp, &prev_pp, sizeof(*pp));
return -EINVAL;
}
pp->set |= ENIC_SET_INSTANCE; pp->set |= ENIC_SET_INSTANCE;
memcpy(pp->instance_uuid, memcpy(pp->instance_uuid,
nla_data(port[IFLA_PORT_INSTANCE_UUID]), PORT_UUID_MAX); nla_data(port[IFLA_PORT_INSTANCE_UUID]), PORT_UUID_MAX);
} }
if (port[IFLA_PORT_HOST_UUID]) { if (port[IFLA_PORT_HOST_UUID]) {
if (nla_len(port[IFLA_PORT_HOST_UUID]) != PORT_UUID_MAX) {
memcpy(pp, &prev_pp, sizeof(*pp));
return -EINVAL;
}
pp->set |= ENIC_SET_HOST; pp->set |= ENIC_SET_HOST;
memcpy(pp->host_uuid, memcpy(pp->host_uuid,
nla_data(port[IFLA_PORT_HOST_UUID]), PORT_UUID_MAX); nla_data(port[IFLA_PORT_HOST_UUID]), PORT_UUID_MAX);

View File

@@ -1116,10 +1116,13 @@ static void gmac_tx_irq_enable(struct net_device *netdev,
{ {
struct gemini_ethernet_port *port = netdev_priv(netdev); struct gemini_ethernet_port *port = netdev_priv(netdev);
struct gemini_ethernet *geth = port->geth; struct gemini_ethernet *geth = port->geth;
unsigned long flags;
u32 val, mask; u32 val, mask;
netdev_dbg(netdev, "%s device %d\n", __func__, netdev->dev_id); netdev_dbg(netdev, "%s device %d\n", __func__, netdev->dev_id);
spin_lock_irqsave(&geth->irq_lock, flags);
mask = GMAC0_IRQ0_TXQ0_INTS << (6 * netdev->dev_id + txq); mask = GMAC0_IRQ0_TXQ0_INTS << (6 * netdev->dev_id + txq);
if (en) if (en)
@@ -1128,6 +1131,8 @@ static void gmac_tx_irq_enable(struct net_device *netdev,
val = readl(geth->base + GLOBAL_INTERRUPT_ENABLE_0_REG); val = readl(geth->base + GLOBAL_INTERRUPT_ENABLE_0_REG);
val = en ? val | mask : val & ~mask; val = en ? val | mask : val & ~mask;
writel(val, geth->base + GLOBAL_INTERRUPT_ENABLE_0_REG); writel(val, geth->base + GLOBAL_INTERRUPT_ENABLE_0_REG);
spin_unlock_irqrestore(&geth->irq_lock, flags);
} }
static void gmac_tx_irq(struct net_device *netdev, unsigned int txq_num) static void gmac_tx_irq(struct net_device *netdev, unsigned int txq_num)
@@ -1436,15 +1441,19 @@ static unsigned int gmac_rx(struct net_device *netdev, unsigned int budget)
union gmac_rxdesc_3 word3; union gmac_rxdesc_3 word3;
struct page *page = NULL; struct page *page = NULL;
unsigned int page_offs; unsigned int page_offs;
unsigned long flags;
unsigned short r, w; unsigned short r, w;
union dma_rwptr rw; union dma_rwptr rw;
dma_addr_t mapping; dma_addr_t mapping;
int frag_nr = 0; int frag_nr = 0;
spin_lock_irqsave(&geth->irq_lock, flags);
rw.bits32 = readl(ptr_reg); rw.bits32 = readl(ptr_reg);
/* Reset interrupt as all packages until here are taken into account */ /* Reset interrupt as all packages until here are taken into account */
writel(DEFAULT_Q0_INT_BIT << netdev->dev_id, writel(DEFAULT_Q0_INT_BIT << netdev->dev_id,
geth->base + GLOBAL_INTERRUPT_STATUS_1_REG); geth->base + GLOBAL_INTERRUPT_STATUS_1_REG);
spin_unlock_irqrestore(&geth->irq_lock, flags);
r = rw.bits.rptr; r = rw.bits.rptr;
w = rw.bits.wptr; w = rw.bits.wptr;
@@ -1747,10 +1756,9 @@ static irqreturn_t gmac_irq(int irq, void *data)
gmac_update_hw_stats(netdev); gmac_update_hw_stats(netdev);
if (val & (GMAC0_RX_OVERRUN_INT_BIT << (netdev->dev_id * 8))) { if (val & (GMAC0_RX_OVERRUN_INT_BIT << (netdev->dev_id * 8))) {
spin_lock(&geth->irq_lock);
writel(GMAC0_RXDERR_INT_BIT << (netdev->dev_id * 8), writel(GMAC0_RXDERR_INT_BIT << (netdev->dev_id * 8),
geth->base + GLOBAL_INTERRUPT_STATUS_4_REG); geth->base + GLOBAL_INTERRUPT_STATUS_4_REG);
spin_lock(&geth->irq_lock);
u64_stats_update_begin(&port->ir_stats_syncp); u64_stats_update_begin(&port->ir_stats_syncp);
++port->stats.rx_fifo_errors; ++port->stats.rx_fifo_errors;
u64_stats_update_end(&port->ir_stats_syncp); u64_stats_update_end(&port->ir_stats_syncp);

View File

@@ -3320,6 +3320,14 @@ static int fec_enet_init(struct net_device *ndev)
return ret; return ret;
} }
static void fec_enet_deinit(struct net_device *ndev)
{
struct fec_enet_private *fep = netdev_priv(ndev);
netif_napi_del(&fep->napi);
fec_enet_free_queue(ndev);
}
#ifdef CONFIG_OF #ifdef CONFIG_OF
static int fec_reset_phy(struct platform_device *pdev) static int fec_reset_phy(struct platform_device *pdev)
{ {
@@ -3687,6 +3695,7 @@ fec_probe(struct platform_device *pdev)
fec_enet_mii_remove(fep); fec_enet_mii_remove(fep);
failed_mii_init: failed_mii_init:
failed_irq: failed_irq:
fec_enet_deinit(ndev);
failed_init: failed_init:
fec_ptp_stop(pdev); fec_ptp_stop(pdev);
failed_reset: failed_reset:
@@ -3748,6 +3757,7 @@ fec_drv_remove(struct platform_device *pdev)
pm_runtime_put_noidle(&pdev->dev); pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
fec_enet_deinit(ndev);
free_netdev(ndev); free_netdev(ndev);
return 0; return 0;
} }

View File

@@ -108,14 +108,13 @@ static int fec_ptp_enable_pps(struct fec_enet_private *fep, uint enable)
return -EINVAL; return -EINVAL;
} }
if (fep->pps_enable == enable)
return 0;
fep->pps_channel = DEFAULT_PPS_CHANNEL;
fep->reload_period = PPS_OUPUT_RELOAD_PERIOD;
spin_lock_irqsave(&fep->tmreg_lock, flags); spin_lock_irqsave(&fep->tmreg_lock, flags);
if (fep->pps_enable == enable) {
spin_unlock_irqrestore(&fep->tmreg_lock, flags);
return 0;
}
if (enable) { if (enable) {
/* clear capture or output compare interrupt status if have. /* clear capture or output compare interrupt status if have.
*/ */
@@ -446,6 +445,9 @@ static int fec_ptp_enable(struct ptp_clock_info *ptp,
int ret = 0; int ret = 0;
if (rq->type == PTP_CLK_REQ_PPS) { if (rq->type == PTP_CLK_REQ_PPS) {
fep->pps_channel = DEFAULT_PPS_CHANNEL;
fep->reload_period = PPS_OUPUT_RELOAD_PERIOD;
ret = fec_ptp_enable_pps(fep, on); ret = fec_ptp_enable_pps(fep, on);
return ret; return ret;

View File

@@ -3476,7 +3476,7 @@ mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
stats->tx_dropped = sstats->tx_queue_dropped; stats->tx_dropped = sstats->tx_queue_dropped;
} }
stats->rx_dropped = priv->stats.qcnt.rx_out_of_buffer; stats->rx_missed_errors = priv->stats.qcnt.rx_out_of_buffer;
stats->rx_length_errors = stats->rx_length_errors =
PPORT_802_3_GET(pstats, a_in_range_length_errors) + PPORT_802_3_GET(pstats, a_in_range_length_errors) +

View File

@@ -1007,7 +1007,6 @@ static void qed_slowpath_task(struct work_struct *work)
static int qed_slowpath_wq_start(struct qed_dev *cdev) static int qed_slowpath_wq_start(struct qed_dev *cdev)
{ {
struct qed_hwfn *hwfn; struct qed_hwfn *hwfn;
char name[NAME_SIZE];
int i; int i;
if (IS_VF(cdev)) if (IS_VF(cdev))
@@ -1016,11 +1015,11 @@ static int qed_slowpath_wq_start(struct qed_dev *cdev)
for_each_hwfn(cdev, i) { for_each_hwfn(cdev, i) {
hwfn = &cdev->hwfns[i]; hwfn = &cdev->hwfns[i];
snprintf(name, NAME_SIZE, "slowpath-%02x:%02x.%02x", hwfn->slowpath_wq = alloc_workqueue("slowpath-%02x:%02x.%02x",
cdev->pdev->bus->number, 0, 0, cdev->pdev->bus->number,
PCI_SLOT(cdev->pdev->devfn), hwfn->abs_pf_id); PCI_SLOT(cdev->pdev->devfn),
hwfn->abs_pf_id);
hwfn->slowpath_wq = alloc_workqueue(name, 0, 0);
if (!hwfn->slowpath_wq) { if (!hwfn->slowpath_wq) {
DP_NOTICE(hwfn, "Cannot create slowpath workqueue\n"); DP_NOTICE(hwfn, "Cannot create slowpath workqueue\n");
return -ENOMEM; return -ENOMEM;

View File

@@ -186,8 +186,8 @@ static inline void mcf_outsw(void *a, unsigned char *p, int l)
writew(*wp++, a); writew(*wp++, a);
} }
#define SMC_inw(a, r) _swapw(readw((a) + (r))) #define SMC_inw(a, r) ioread16be((a) + (r))
#define SMC_outw(lp, v, a, r) writew(_swapw(v), (a) + (r)) #define SMC_outw(lp, v, a, r) iowrite16be(v, (a) + (r))
#define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l) #define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l)
#define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l) #define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l)

View File

@@ -446,7 +446,7 @@ static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb)
memset(IPCB(skb), 0, sizeof(*IPCB(skb))); memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
err = ip_local_out(net, skb->sk, skb); err = ip_local_out(net, NULL, skb);
if (unlikely(net_xmit_eval(err))) if (unlikely(net_xmit_eval(err)))
dev->stats.tx_errors++; dev->stats.tx_errors++;
else else
@@ -501,7 +501,7 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
memset(IP6CB(skb), 0, sizeof(*IP6CB(skb))); memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
err = ip6_local_out(dev_net(dev), skb->sk, skb); err = ip6_local_out(dev_net(dev), NULL, skb);
if (unlikely(net_xmit_eval(err))) if (unlikely(net_xmit_eval(err)))
dev->stats.tx_errors++; dev->stats.tx_errors++;
else else

View File

@@ -1326,6 +1326,9 @@ static const struct usb_device_id products[] = {
{QMI_QUIRK_SET_DTR(0x1bc7, 0x1060, 2)}, /* Telit LN920 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1060, 2)}, /* Telit LN920 */
{QMI_QUIRK_SET_DTR(0x1bc7, 0x1070, 2)}, /* Telit FN990 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1070, 2)}, /* Telit FN990 */
{QMI_QUIRK_SET_DTR(0x1bc7, 0x1080, 2)}, /* Telit FE990 */ {QMI_QUIRK_SET_DTR(0x1bc7, 0x1080, 2)}, /* Telit FE990 */
{QMI_QUIRK_SET_DTR(0x1bc7, 0x10a0, 0)}, /* Telit FN920C04 */
{QMI_QUIRK_SET_DTR(0x1bc7, 0x10a4, 0)}, /* Telit FN920C04 */
{QMI_QUIRK_SET_DTR(0x1bc7, 0x10a9, 0)}, /* Telit FN920C04 */
{QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */ {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */
{QMI_FIXED_INTF(0x1bc7, 0x1101, 3)}, /* Telit ME910 dual modem */ {QMI_FIXED_INTF(0x1bc7, 0x1101, 3)}, /* Telit ME910 dual modem */
{QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */

View File

@@ -273,16 +273,18 @@ static void __smsc95xx_mdio_write(struct net_device *netdev, int phy_id,
mutex_unlock(&dev->phy_mutex); mutex_unlock(&dev->phy_mutex);
} }
static int smsc95xx_mdio_read_nopm(struct net_device *netdev, int phy_id, static int smsc95xx_mdio_read_nopm(struct usbnet *dev, int idx)
int idx)
{ {
return __smsc95xx_mdio_read(netdev, phy_id, idx, 1); struct mii_if_info *mii = &dev->mii;
return __smsc95xx_mdio_read(dev->net, mii->phy_id, idx, 1);
} }
static void smsc95xx_mdio_write_nopm(struct net_device *netdev, int phy_id, static void smsc95xx_mdio_write_nopm(struct usbnet *dev, int idx, int regval)
int idx, int regval)
{ {
__smsc95xx_mdio_write(netdev, phy_id, idx, regval, 1); struct mii_if_info *mii = &dev->mii;
__smsc95xx_mdio_write(dev->net, mii->phy_id, idx, regval, 1);
} }
static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx) static int smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
@@ -467,7 +469,7 @@ static unsigned int smsc95xx_hash(char addr[ETH_ALEN])
static void smsc95xx_set_multicast(struct net_device *netdev) static void smsc95xx_set_multicast(struct net_device *netdev)
{ {
struct usbnet *dev = netdev_priv(netdev); struct usbnet *dev = netdev_priv(netdev);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
unsigned long flags; unsigned long flags;
int ret; int ret;
@@ -562,7 +564,7 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
static int smsc95xx_link_reset(struct usbnet *dev) static int smsc95xx_link_reset(struct usbnet *dev)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
struct mii_if_info *mii = &dev->mii; struct mii_if_info *mii = &dev->mii;
struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET }; struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
unsigned long flags; unsigned long flags;
@@ -632,7 +634,7 @@ static void smsc95xx_status(struct usbnet *dev, struct urb *urb)
static void set_carrier(struct usbnet *dev, bool link) static void set_carrier(struct usbnet *dev, bool link)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
if (pdata->link_ok == link) if (pdata->link_ok == link)
return; return;
@@ -761,7 +763,7 @@ static void smsc95xx_ethtool_get_wol(struct net_device *net,
struct ethtool_wolinfo *wolinfo) struct ethtool_wolinfo *wolinfo)
{ {
struct usbnet *dev = netdev_priv(net); struct usbnet *dev = netdev_priv(net);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
wolinfo->supported = SUPPORTED_WAKE; wolinfo->supported = SUPPORTED_WAKE;
wolinfo->wolopts = pdata->wolopts; wolinfo->wolopts = pdata->wolopts;
@@ -771,7 +773,7 @@ static int smsc95xx_ethtool_set_wol(struct net_device *net,
struct ethtool_wolinfo *wolinfo) struct ethtool_wolinfo *wolinfo)
{ {
struct usbnet *dev = netdev_priv(net); struct usbnet *dev = netdev_priv(net);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
int ret; int ret;
if (wolinfo->wolopts & ~SUPPORTED_WAKE) if (wolinfo->wolopts & ~SUPPORTED_WAKE)
@@ -810,7 +812,7 @@ static int get_mdix_status(struct net_device *net)
static void set_mdix_status(struct net_device *net, __u8 mdix_ctrl) static void set_mdix_status(struct net_device *net, __u8 mdix_ctrl)
{ {
struct usbnet *dev = netdev_priv(net); struct usbnet *dev = netdev_priv(net);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
int buf; int buf;
if ((pdata->chip_id == ID_REV_CHIP_ID_9500A_) || if ((pdata->chip_id == ID_REV_CHIP_ID_9500A_) ||
@@ -859,7 +861,7 @@ static int smsc95xx_get_link_ksettings(struct net_device *net,
struct ethtool_link_ksettings *cmd) struct ethtool_link_ksettings *cmd)
{ {
struct usbnet *dev = netdev_priv(net); struct usbnet *dev = netdev_priv(net);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
int retval; int retval;
retval = usbnet_get_link_ksettings(net, cmd); retval = usbnet_get_link_ksettings(net, cmd);
@@ -874,7 +876,7 @@ static int smsc95xx_set_link_ksettings(struct net_device *net,
const struct ethtool_link_ksettings *cmd) const struct ethtool_link_ksettings *cmd)
{ {
struct usbnet *dev = netdev_priv(net); struct usbnet *dev = netdev_priv(net);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
int retval; int retval;
if (pdata->mdix_ctrl != cmd->base.eth_tp_mdix_ctrl) if (pdata->mdix_ctrl != cmd->base.eth_tp_mdix_ctrl)
@@ -956,7 +958,7 @@ static int smsc95xx_set_mac_address(struct usbnet *dev)
/* starts the TX path */ /* starts the TX path */
static int smsc95xx_start_tx_path(struct usbnet *dev) static int smsc95xx_start_tx_path(struct usbnet *dev)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
unsigned long flags; unsigned long flags;
int ret; int ret;
@@ -976,7 +978,7 @@ static int smsc95xx_start_tx_path(struct usbnet *dev)
/* Starts the Receive path */ /* Starts the Receive path */
static int smsc95xx_start_rx_path(struct usbnet *dev, int in_pm) static int smsc95xx_start_rx_path(struct usbnet *dev, int in_pm)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&pdata->mac_cr_lock, flags); spin_lock_irqsave(&pdata->mac_cr_lock, flags);
@@ -1033,8 +1035,8 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
static int smsc95xx_reset(struct usbnet *dev) static int smsc95xx_reset(struct usbnet *dev)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
u32 read_buf, write_buf, burst_cap; u32 read_buf, burst_cap;
int ret = 0, timeout; int ret = 0, timeout;
netif_dbg(dev, ifup, dev->net, "entering smsc95xx_reset\n"); netif_dbg(dev, ifup, dev->net, "entering smsc95xx_reset\n");
@@ -1176,10 +1178,13 @@ static int smsc95xx_reset(struct usbnet *dev)
return ret; return ret;
netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", read_buf); netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", read_buf);
ret = smsc95xx_read_reg(dev, LED_GPIO_CFG, &read_buf);
if (ret < 0)
return ret;
/* Configure GPIO pins as LED outputs */ /* Configure GPIO pins as LED outputs */
write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | read_buf |= LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED |
LED_GPIO_CFG_FDX_LED; LED_GPIO_CFG_FDX_LED;
ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf); ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, read_buf);
if (ret < 0) if (ret < 0)
return ret; return ret;
@@ -1261,7 +1266,7 @@ static const struct net_device_ops smsc95xx_netdev_ops = {
static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
{ {
struct smsc95xx_priv *pdata = NULL; struct smsc95xx_priv *pdata;
u32 val; u32 val;
int ret; int ret;
@@ -1273,13 +1278,12 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
return ret; return ret;
} }
dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc95xx_priv), pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
GFP_KERNEL);
pdata = (struct smsc95xx_priv *)(dev->data[0]);
if (!pdata) if (!pdata)
return -ENOMEM; return -ENOMEM;
dev->driver_priv = pdata;
spin_lock_init(&pdata->mac_cr_lock); spin_lock_init(&pdata->mac_cr_lock);
/* LAN95xx devices do not alter the computed checksum of 0 to 0xffff. /* LAN95xx devices do not alter the computed checksum of 0 to 0xffff.
@@ -1342,15 +1346,11 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf) static void smsc95xx_unbind(struct usbnet *dev, struct usb_interface *intf)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
if (pdata) { cancel_delayed_work_sync(&pdata->carrier_check);
cancel_delayed_work_sync(&pdata->carrier_check); netif_dbg(dev, ifdown, dev->net, "free pdata\n");
netif_dbg(dev, ifdown, dev->net, "free pdata\n"); kfree(pdata);
kfree(pdata);
pdata = NULL;
dev->data[0] = 0;
}
} }
static u32 smsc_crc(const u8 *buffer, size_t len, int filter) static u32 smsc_crc(const u8 *buffer, size_t len, int filter)
@@ -1361,39 +1361,37 @@ static u32 smsc_crc(const u8 *buffer, size_t len, int filter)
static int smsc95xx_enable_phy_wakeup_interrupts(struct usbnet *dev, u16 mask) static int smsc95xx_enable_phy_wakeup_interrupts(struct usbnet *dev, u16 mask)
{ {
struct mii_if_info *mii = &dev->mii;
int ret; int ret;
netdev_dbg(dev->net, "enabling PHY wakeup interrupts\n"); netdev_dbg(dev->net, "enabling PHY wakeup interrupts\n");
/* read to clear */ /* read to clear */
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_SRC); ret = smsc95xx_mdio_read_nopm(dev, PHY_INT_SRC);
if (ret < 0) if (ret < 0)
return ret; return ret;
/* enable interrupt source */ /* enable interrupt source */
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_MASK); ret = smsc95xx_mdio_read_nopm(dev, PHY_INT_MASK);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret |= mask; ret |= mask;
smsc95xx_mdio_write_nopm(dev->net, mii->phy_id, PHY_INT_MASK, ret); smsc95xx_mdio_write_nopm(dev, PHY_INT_MASK, ret);
return 0; return 0;
} }
static int smsc95xx_link_ok_nopm(struct usbnet *dev) static int smsc95xx_link_ok_nopm(struct usbnet *dev)
{ {
struct mii_if_info *mii = &dev->mii;
int ret; int ret;
/* first, a dummy read, needed to latch some MII phys */ /* first, a dummy read, needed to latch some MII phys */
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR); ret = smsc95xx_mdio_read_nopm(dev, MII_BMSR);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR); ret = smsc95xx_mdio_read_nopm(dev, MII_BMSR);
if (ret < 0) if (ret < 0)
return ret; return ret;
@@ -1402,7 +1400,7 @@ static int smsc95xx_link_ok_nopm(struct usbnet *dev)
static int smsc95xx_enter_suspend0(struct usbnet *dev) static int smsc95xx_enter_suspend0(struct usbnet *dev)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
u32 val; u32 val;
int ret; int ret;
@@ -1441,8 +1439,7 @@ static int smsc95xx_enter_suspend0(struct usbnet *dev)
static int smsc95xx_enter_suspend1(struct usbnet *dev) static int smsc95xx_enter_suspend1(struct usbnet *dev)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
struct mii_if_info *mii = &dev->mii;
u32 val; u32 val;
int ret; int ret;
@@ -1450,17 +1447,17 @@ static int smsc95xx_enter_suspend1(struct usbnet *dev)
* compatibility with non-standard link partners * compatibility with non-standard link partners
*/ */
if (pdata->features & FEATURE_PHY_NLP_CROSSOVER) if (pdata->features & FEATURE_PHY_NLP_CROSSOVER)
smsc95xx_mdio_write_nopm(dev->net, mii->phy_id, PHY_EDPD_CONFIG, smsc95xx_mdio_write_nopm(dev, PHY_EDPD_CONFIG,
PHY_EDPD_CONFIG_DEFAULT); PHY_EDPD_CONFIG_DEFAULT);
/* enable energy detect power-down mode */ /* enable energy detect power-down mode */
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_MODE_CTRL_STS); ret = smsc95xx_mdio_read_nopm(dev, PHY_MODE_CTRL_STS);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret |= MODE_CTRL_STS_EDPWRDOWN_; ret |= MODE_CTRL_STS_EDPWRDOWN_;
smsc95xx_mdio_write_nopm(dev->net, mii->phy_id, PHY_MODE_CTRL_STS, ret); smsc95xx_mdio_write_nopm(dev, PHY_MODE_CTRL_STS, ret);
/* enter SUSPEND1 mode */ /* enter SUSPEND1 mode */
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val); ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
@@ -1489,7 +1486,7 @@ static int smsc95xx_enter_suspend1(struct usbnet *dev)
static int smsc95xx_enter_suspend2(struct usbnet *dev) static int smsc95xx_enter_suspend2(struct usbnet *dev)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
u32 val; u32 val;
int ret; int ret;
@@ -1511,7 +1508,7 @@ static int smsc95xx_enter_suspend2(struct usbnet *dev)
static int smsc95xx_enter_suspend3(struct usbnet *dev) static int smsc95xx_enter_suspend3(struct usbnet *dev)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
u32 val; u32 val;
int ret; int ret;
@@ -1550,7 +1547,7 @@ static int smsc95xx_enter_suspend3(struct usbnet *dev)
static int smsc95xx_autosuspend(struct usbnet *dev, u32 link_up) static int smsc95xx_autosuspend(struct usbnet *dev, u32 link_up)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
int ret; int ret;
if (!netif_running(dev->net)) { if (!netif_running(dev->net)) {
@@ -1598,7 +1595,7 @@ static int smsc95xx_autosuspend(struct usbnet *dev, u32 link_up)
static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
{ {
struct usbnet *dev = usb_get_intfdata(intf); struct usbnet *dev = usb_get_intfdata(intf);
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
u32 val, link_up; u32 val, link_up;
int ret; int ret;
@@ -1869,7 +1866,7 @@ static int smsc95xx_resume(struct usb_interface *intf)
u32 val; u32 val;
BUG_ON(!dev); BUG_ON(!dev);
pdata = (struct smsc95xx_priv *)(dev->data[0]); pdata = dev->driver_priv;
suspend_flags = pdata->suspend_flags; suspend_flags = pdata->suspend_flags;
netdev_dbg(dev->net, "resume suspend_flags=0x%02x\n", suspend_flags); netdev_dbg(dev->net, "resume suspend_flags=0x%02x\n", suspend_flags);
@@ -1924,9 +1921,11 @@ static int smsc95xx_reset_resume(struct usb_interface *intf)
static void smsc95xx_rx_csum_offload(struct sk_buff *skb) static void smsc95xx_rx_csum_offload(struct sk_buff *skb)
{ {
skb->csum = *(u16 *)(skb_tail_pointer(skb) - 2); u16 *csum_ptr = (u16 *)(skb_tail_pointer(skb) - 2);
skb->csum = (__force __wsum)get_unaligned(csum_ptr);
skb->ip_summed = CHECKSUM_COMPLETE; skb->ip_summed = CHECKSUM_COMPLETE;
skb_trim(skb, skb->len - 2); skb_trim(skb, skb->len - 2); /* remove csum */
} }
static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
@@ -1985,25 +1984,22 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
if (dev->net->features & NETIF_F_RXCSUM) if (dev->net->features & NETIF_F_RXCSUM)
smsc95xx_rx_csum_offload(skb); smsc95xx_rx_csum_offload(skb);
skb_trim(skb, skb->len - 4); /* remove fcs */ skb_trim(skb, skb->len - 4); /* remove fcs */
skb->truesize = size + sizeof(struct sk_buff);
return 1; return 1;
} }
ax_skb = skb_clone(skb, GFP_ATOMIC); ax_skb = netdev_alloc_skb_ip_align(dev->net, size);
if (unlikely(!ax_skb)) { if (unlikely(!ax_skb)) {
netdev_warn(dev->net, "Error allocating skb\n"); netdev_warn(dev->net, "Error allocating skb\n");
return 0; return 0;
} }
ax_skb->len = size; skb_put(ax_skb, size);
ax_skb->data = packet; memcpy(ax_skb->data, packet, size);
skb_set_tail_pointer(ax_skb, size);
if (dev->net->features & NETIF_F_RXCSUM) if (dev->net->features & NETIF_F_RXCSUM)
smsc95xx_rx_csum_offload(ax_skb); smsc95xx_rx_csum_offload(ax_skb);
skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */
ax_skb->truesize = size + sizeof(struct sk_buff);
usbnet_skb_return(dev, ax_skb); usbnet_skb_return(dev, ax_skb);
} }
@@ -2081,7 +2077,7 @@ static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev,
static int smsc95xx_manage_power(struct usbnet *dev, int on) static int smsc95xx_manage_power(struct usbnet *dev, int on)
{ {
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); struct smsc95xx_priv *pdata = dev->driver_priv;
dev->intf->needs_remote_wakeup = on; dev->intf->needs_remote_wakeup = on;

View File

@@ -418,19 +418,15 @@ static int sr9700_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
skb_pull(skb, 3); skb_pull(skb, 3);
skb->len = len; skb->len = len;
skb_set_tail_pointer(skb, len); skb_set_tail_pointer(skb, len);
skb->truesize = len + sizeof(struct sk_buff);
return 2; return 2;
} }
/* skb_clone is used for address align */ sr_skb = netdev_alloc_skb_ip_align(dev->net, len);
sr_skb = skb_clone(skb, GFP_ATOMIC);
if (!sr_skb) if (!sr_skb)
return 0; return 0;
sr_skb->len = len; skb_put(sr_skb, len);
sr_skb->data = skb->data + 3; memcpy(sr_skb->data, skb->data + 3, len);
skb_set_tail_pointer(sr_skb, len);
sr_skb->truesize = len + sizeof(struct sk_buff);
usbnet_skb_return(dev, sr_skb); usbnet_skb_return(dev, sr_skb);
skb_pull(skb, len + SR_RX_OVERHEAD); skb_pull(skb, len + SR_RX_OVERHEAD);

View File

@@ -1320,10 +1320,6 @@ static bool vxlan_set_mac(struct vxlan_dev *vxlan,
if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr)) if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr))
return false; return false;
/* Ignore packets from invalid src-address */
if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
return false;
/* Get address from the outer IP header */ /* Get address from the outer IP header */
if (vxlan_get_sk_family(vs) == AF_INET) { if (vxlan_get_sk_family(vs) == AF_INET) {
saddr.sin.sin_addr.s_addr = ip_hdr(skb)->saddr; saddr.sin.sin_addr.s_addr = ip_hdr(skb)->saddr;

View File

@@ -1590,6 +1590,20 @@ static int ar5523_probe(struct usb_interface *intf,
struct ar5523 *ar; struct ar5523 *ar;
int error = -ENOMEM; int error = -ENOMEM;
static const u8 bulk_ep_addr[] = {
AR5523_CMD_TX_PIPE | USB_DIR_OUT,
AR5523_DATA_TX_PIPE | USB_DIR_OUT,
AR5523_CMD_RX_PIPE | USB_DIR_IN,
AR5523_DATA_RX_PIPE | USB_DIR_IN,
0};
if (!usb_check_bulk_endpoints(intf, bulk_ep_addr)) {
dev_err(&dev->dev,
"Could not find all expected endpoints\n");
error = -ENODEV;
goto out;
}
/* /*
* Load firmware if the device requires it. This will return * Load firmware if the device requires it. This will return
* -ENXIO on success and we'll get called back afer the usb * -ENXIO on success and we'll get called back afer the usb

View File

@@ -540,6 +540,9 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.max_spatial_stream = 4, .max_spatial_stream = 4,
.fw = { .fw = {
.dir = WCN3990_HW_1_0_FW_DIR, .dir = WCN3990_HW_1_0_FW_DIR,
.board = WCN3990_HW_1_0_BOARD_DATA_FILE,
.board_size = WCN3990_BOARD_DATA_SZ,
.board_ext_size = WCN3990_BOARD_EXT_DATA_SZ,
}, },
.sw_decrypt_mcast_mgmt = true, .sw_decrypt_mcast_mgmt = true,
.hw_ops = &wcn3990_ops, .hw_ops = &wcn3990_ops,

View File

@@ -449,7 +449,7 @@ ath10k_dbg_sta_write_peer_debug_trigger(struct file *file,
} }
out: out:
mutex_unlock(&ar->conf_mutex); mutex_unlock(&ar->conf_mutex);
return count; return ret ?: count;
} }
static const struct file_operations fops_peer_debug_trigger = { static const struct file_operations fops_peer_debug_trigger = {

View File

@@ -133,6 +133,7 @@ enum qca9377_chip_id_rev {
/* WCN3990 1.0 definitions */ /* WCN3990 1.0 definitions */
#define WCN3990_HW_1_0_DEV_VERSION ATH10K_HW_WCN3990 #define WCN3990_HW_1_0_DEV_VERSION ATH10K_HW_WCN3990
#define WCN3990_HW_1_0_FW_DIR ATH10K_FW_DIR "/WCN3990/hw1.0" #define WCN3990_HW_1_0_FW_DIR ATH10K_FW_DIR "/WCN3990/hw1.0"
#define WCN3990_HW_1_0_BOARD_DATA_FILE "board.bin"
#define ATH10K_FW_FILE_BASE "firmware" #define ATH10K_FW_FILE_BASE "firmware"
#define ATH10K_FW_API_MAX 6 #define ATH10K_FW_API_MAX 6

View File

@@ -487,4 +487,7 @@ struct host_interest {
#define QCA4019_BOARD_DATA_SZ 12064 #define QCA4019_BOARD_DATA_SZ 12064
#define QCA4019_BOARD_EXT_DATA_SZ 0 #define QCA4019_BOARD_EXT_DATA_SZ 0
#define WCN3990_BOARD_DATA_SZ 26328
#define WCN3990_BOARD_EXT_DATA_SZ 0
#endif /* __TARGADDRS_H__ */ #endif /* __TARGADDRS_H__ */

View File

@@ -1697,12 +1697,32 @@ void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
int ath10k_wmi_wait_for_service_ready(struct ath10k *ar) int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
{ {
unsigned long time_left; unsigned long time_left, i;
time_left = wait_for_completion_timeout(&ar->wmi.service_ready, time_left = wait_for_completion_timeout(&ar->wmi.service_ready,
WMI_SERVICE_READY_TIMEOUT_HZ); WMI_SERVICE_READY_TIMEOUT_HZ);
if (!time_left) if (!time_left) {
return -ETIMEDOUT; /* Sometimes the PCI HIF doesn't receive interrupt
* for the service ready message even if the buffer
* was completed. PCIe sniffer shows that it's
* because the corresponding CE ring doesn't fires
* it. Workaround here by polling CE rings once.
*/
ath10k_warn(ar, "failed to receive service ready completion, polling..\n");
for (i = 0; i < CE_COUNT; i++)
ath10k_hif_send_complete_check(ar, i, 1);
time_left = wait_for_completion_timeout(&ar->wmi.service_ready,
WMI_SERVICE_READY_TIMEOUT_HZ);
if (!time_left) {
ath10k_warn(ar, "polling timed out\n");
return -ETIMEDOUT;
}
ath10k_warn(ar, "service ready completion received, continuing normally\n");
}
return 0; return 0;
} }

View File

@@ -1069,6 +1069,38 @@ static int carl9170_usb_probe(struct usb_interface *intf,
ar->usb_ep_cmd_is_bulk = true; ar->usb_ep_cmd_is_bulk = true;
} }
/* Verify that all expected endpoints are present */
if (ar->usb_ep_cmd_is_bulk) {
u8 bulk_ep_addr[] = {
AR9170_USB_EP_RX | USB_DIR_IN,
AR9170_USB_EP_TX | USB_DIR_OUT,
AR9170_USB_EP_CMD | USB_DIR_OUT,
0};
u8 int_ep_addr[] = {
AR9170_USB_EP_IRQ | USB_DIR_IN,
0};
if (!usb_check_bulk_endpoints(intf, bulk_ep_addr) ||
!usb_check_int_endpoints(intf, int_ep_addr))
err = -ENODEV;
} else {
u8 bulk_ep_addr[] = {
AR9170_USB_EP_RX | USB_DIR_IN,
AR9170_USB_EP_TX | USB_DIR_OUT,
0};
u8 int_ep_addr[] = {
AR9170_USB_EP_IRQ | USB_DIR_IN,
AR9170_USB_EP_CMD | USB_DIR_OUT,
0};
if (!usb_check_bulk_endpoints(intf, bulk_ep_addr) ||
!usb_check_int_endpoints(intf, int_ep_addr))
err = -ENODEV;
}
if (err) {
carl9170_free(ar);
return err;
}
usb_set_intfdata(intf, ar); usb_set_intfdata(intf, ar);
SET_IEEE80211_DEV(ar->hw, &intf->dev); SET_IEEE80211_DEV(ar->hw, &intf->dev);

View File

@@ -2711,7 +2711,7 @@ __mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti,
cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST); cmd->action |= cpu_to_le16(MWL8K_ENABLE_RX_MULTICAST);
cmd->numaddr = cpu_to_le16(mc_count); cmd->numaddr = cpu_to_le16(mc_count);
netdev_hw_addr_list_for_each(ha, mc_list) { netdev_hw_addr_list_for_each(ha, mc_list) {
memcpy(cmd->addr[i], ha->addr, ETH_ALEN); memcpy(cmd->addr[i++], ha->addr, ETH_ALEN);
} }
} }

View File

@@ -36,6 +36,7 @@
#include <linux/wireless.h> #include <linux/wireless.h>
#include <linux/firmware.h> #include <linux/firmware.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/bitfield.h>
#include <net/mac80211.h> #include <net/mac80211.h>
#include "rtl8xxxu.h" #include "rtl8xxxu.h"
#include "rtl8xxxu_regs.h" #include "rtl8xxxu_regs.h"
@@ -1396,13 +1397,13 @@ rtl8xxxu_gen1_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
u8 cck[RTL8723A_MAX_RF_PATHS], ofdm[RTL8723A_MAX_RF_PATHS]; u8 cck[RTL8723A_MAX_RF_PATHS], ofdm[RTL8723A_MAX_RF_PATHS];
u8 ofdmbase[RTL8723A_MAX_RF_PATHS], mcsbase[RTL8723A_MAX_RF_PATHS]; u8 ofdmbase[RTL8723A_MAX_RF_PATHS], mcsbase[RTL8723A_MAX_RF_PATHS];
u32 val32, ofdm_a, ofdm_b, mcs_a, mcs_b; u32 val32, ofdm_a, ofdm_b, mcs_a, mcs_b;
u8 val8; u8 val8, base;
int group, i; int group, i;
group = rtl8xxxu_gen1_channel_to_group(channel); group = rtl8xxxu_gen1_channel_to_group(channel);
cck[0] = priv->cck_tx_power_index_A[group] - 1; cck[0] = priv->cck_tx_power_index_A[group];
cck[1] = priv->cck_tx_power_index_B[group] - 1; cck[1] = priv->cck_tx_power_index_B[group];
if (priv->hi_pa) { if (priv->hi_pa) {
if (cck[0] > 0x20) if (cck[0] > 0x20)
@@ -1413,10 +1414,6 @@ rtl8xxxu_gen1_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
ofdm[0] = priv->ht40_1s_tx_power_index_A[group]; ofdm[0] = priv->ht40_1s_tx_power_index_A[group];
ofdm[1] = priv->ht40_1s_tx_power_index_B[group]; ofdm[1] = priv->ht40_1s_tx_power_index_B[group];
if (ofdm[0])
ofdm[0] -= 1;
if (ofdm[1])
ofdm[1] -= 1;
ofdmbase[0] = ofdm[0] + priv->ofdm_tx_power_index_diff[group].a; ofdmbase[0] = ofdm[0] + priv->ofdm_tx_power_index_diff[group].a;
ofdmbase[1] = ofdm[1] + priv->ofdm_tx_power_index_diff[group].b; ofdmbase[1] = ofdm[1] + priv->ofdm_tx_power_index_diff[group].b;
@@ -1505,20 +1502,19 @@ rtl8xxxu_gen1_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS15_MCS12, rtl8xxxu_write32(priv, REG_TX_AGC_A_MCS15_MCS12,
mcs_a + power_base->reg_0e1c); mcs_a + power_base->reg_0e1c);
val8 = u32_get_bits(mcs_a + power_base->reg_0e1c, 0xff000000);
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (i != 2) base = i != 2 ? 8 : 6;
val8 = (mcsbase[0] > 8) ? (mcsbase[0] - 8) : 0; val8 = max_t(int, val8 - base, 0);
else
val8 = (mcsbase[0] > 6) ? (mcsbase[0] - 6) : 0;
rtl8xxxu_write8(priv, REG_OFDM0_XC_TX_IQ_IMBALANCE + i, val8); rtl8xxxu_write8(priv, REG_OFDM0_XC_TX_IQ_IMBALANCE + i, val8);
} }
rtl8xxxu_write32(priv, REG_TX_AGC_B_MCS15_MCS12, rtl8xxxu_write32(priv, REG_TX_AGC_B_MCS15_MCS12,
mcs_b + power_base->reg_0868); mcs_b + power_base->reg_0868);
val8 = u32_get_bits(mcs_b + power_base->reg_0868, 0xff000000);
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
if (i != 2) base = i != 2 ? 8 : 6;
val8 = (mcsbase[1] > 8) ? (mcsbase[1] - 8) : 0; val8 = max_t(int, val8 - base, 0);
else
val8 = (mcsbase[1] > 6) ? (mcsbase[1] - 6) : 0;
rtl8xxxu_write8(priv, REG_OFDM0_XD_TX_IQ_IMBALANCE + i, val8); rtl8xxxu_write8(priv, REG_OFDM0_XD_TX_IQ_IMBALANCE + i, val8);
} }
} }

View File

@@ -464,10 +464,18 @@ static ssize_t nvmet_ns_enable_store(struct config_item *item,
if (strtobool(page, &enable)) if (strtobool(page, &enable))
return -EINVAL; return -EINVAL;
/*
* take a global nvmet_config_sem because the disable routine has a
* window where it releases the subsys-lock, giving a chance to
* a parallel enable to concurrently execute causing the disable to
* have a misaccounting of the ns percpu_ref.
*/
down_write(&nvmet_config_sem);
if (enable) if (enable)
ret = nvmet_ns_enable(ns); ret = nvmet_ns_enable(ns);
else else
nvmet_ns_disable(ns); nvmet_ns_disable(ns);
up_write(&nvmet_config_sem);
return ret ? ret : count; return ret ? ret : count;
} }

View File

@@ -5,6 +5,7 @@
* Copyright (c) 2014 - 2018 Google, Inc * Copyright (c) 2014 - 2018 Google, Inc
*/ */
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/mfd/cros_ec.h> #include <linux/mfd/cros_ec.h>
#include <linux/mfd/cros_ec_commands.h> #include <linux/mfd/cros_ec_commands.h>
@@ -530,16 +531,22 @@ static int cros_usbpd_charger_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(cros_usbpd_charger_pm_ops, NULL, static SIMPLE_DEV_PM_OPS(cros_usbpd_charger_pm_ops, NULL,
cros_usbpd_charger_resume); cros_usbpd_charger_resume);
static const struct platform_device_id cros_usbpd_charger_id[] = {
{ DRV_NAME, 0 },
{}
};
MODULE_DEVICE_TABLE(platform, cros_usbpd_charger_id);
static struct platform_driver cros_usbpd_charger_driver = { static struct platform_driver cros_usbpd_charger_driver = {
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.pm = &cros_usbpd_charger_pm_ops, .pm = &cros_usbpd_charger_pm_ops,
}, },
.probe = cros_usbpd_charger_probe .probe = cros_usbpd_charger_probe,
.id_table = cros_usbpd_charger_id,
}; };
module_platform_driver(cros_usbpd_charger_driver); module_platform_driver(cros_usbpd_charger_driver);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("ChromeOS EC USBPD charger"); MODULE_DESCRIPTION("ChromeOS EC USBPD charger");
MODULE_ALIAS("platform:" DRV_NAME);

View File

@@ -50,7 +50,7 @@ DECLARE_EVENT_CLASS(s390_class_schib,
__entry->devno = schib->pmcw.dev; __entry->devno = schib->pmcw.dev;
__entry->schib = *schib; __entry->schib = *schib;
__entry->pmcw_ena = schib->pmcw.ena; __entry->pmcw_ena = schib->pmcw.ena;
__entry->pmcw_st = schib->pmcw.ena; __entry->pmcw_st = schib->pmcw.st;
__entry->pmcw_dnv = schib->pmcw.dnv; __entry->pmcw_dnv = schib->pmcw.dnv;
__entry->pmcw_dev = schib->pmcw.dev; __entry->pmcw_dev = schib->pmcw.dev;
__entry->pmcw_lpm = schib->pmcw.lpm; __entry->pmcw_lpm = schib->pmcw.lpm;

View File

@@ -916,7 +916,7 @@ static int hex2bitmap(const char *str, unsigned long *bitmap, int bits)
*/ */
static int modify_bitmap(const char *str, unsigned long *bitmap, int bits) static int modify_bitmap(const char *str, unsigned long *bitmap, int bits)
{ {
int a, i, z; unsigned long a, i, z;
char *np, sign; char *np, sign;
/* bits needs to be a multiple of 8 */ /* bits needs to be a multiple of 8 */

View File

@@ -258,7 +258,7 @@ bfad_debugfs_write_regrd(struct file *file, const char __user *buf,
unsigned long flags; unsigned long flags;
void *kern_buf; void *kern_buf;
kern_buf = memdup_user(buf, nbytes); kern_buf = memdup_user_nul(buf, nbytes);
if (IS_ERR(kern_buf)) if (IS_ERR(kern_buf))
return PTR_ERR(kern_buf); return PTR_ERR(kern_buf);
@@ -325,7 +325,7 @@ bfad_debugfs_write_regwr(struct file *file, const char __user *buf,
unsigned long flags; unsigned long flags;
void *kern_buf; void *kern_buf;
kern_buf = memdup_user(buf, nbytes); kern_buf = memdup_user_nul(buf, nbytes);
if (IS_ERR(kern_buf)) if (IS_ERR(kern_buf))
return PTR_ERR(kern_buf); return PTR_ERR(kern_buf);

View File

@@ -5771,7 +5771,7 @@ static int hpsa_scsi_host_alloc(struct ctlr_info *h)
{ {
struct Scsi_Host *sh; struct Scsi_Host *sh;
sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info)); sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info *));
if (sh == NULL) { if (sh == NULL) {
dev_err(&h->pdev->dev, "scsi_host_alloc failed\n"); dev_err(&h->pdev->dev, "scsi_host_alloc failed\n");
return -ENOMEM; return -ENOMEM;

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