mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
Merge 5.15.116 into android14-5.15-lts
Changes in 5.15.116 RDMA/bnxt_re: Fix the page_size used during the MR creation RDMA/efa: Fix unsupported page sizes in device RDMA/hns: Fix base address table allocation RDMA/hns: Modify the value of long message loopback slice dmaengine: at_xdmac: Move the free desc to the tail of the desc list dmaengine: at_xdmac: fix potential Oops in at_xdmac_prep_interleaved() RDMA/bnxt_re: Fix a possible memory leak RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx iommu/rockchip: Fix unwind goto issue iommu/amd: Don't block updates to GATag if guest mode is on dmaengine: pl330: rename _start to prevent build error riscv: Fix unused variable warning when BUILTIN_DTB is set net/mlx5: fw_tracer, Fix event handling net/mlx5e: Don't attach netdev profile while handling internal error net: mellanox: mlxbf_gige: Fix skb_panic splat under memory pressure netrom: fix info-leak in nr_write_internal() af_packet: Fix data-races of pkt_sk(sk)->num. amd-xgbe: fix the false linkup in xgbe_phy_status mtd: rawnand: ingenic: fix empty stub helper definitions RDMA/irdma: Add SW mechanism to generate completions on error RDMA/irdma: Prevent QP use after free RDMA/irdma: Fix Local Invalidate fencing af_packet: do not use READ_ONCE() in packet_bind() tcp: deny tcp_disconnect() when threads are waiting tcp: Return user_mss for TCP_MAXSEG in CLOSE/LISTEN state if user_mss set net/sched: sch_ingress: Only create under TC_H_INGRESS net/sched: sch_clsact: Only create under TC_H_CLSACT net/sched: Reserve TC_H_INGRESS (TC_H_CLSACT) for ingress (clsact) Qdiscs net/sched: Prohibit regrafting ingress or clsact Qdiscs net: sched: fix NULL pointer dereference in mq_attach net/netlink: fix NETLINK_LIST_MEMBERSHIPS length report udp6: Fix race condition in udp6_sendmsg & connect net/mlx5e: Fix error handling in mlx5e_refresh_tirs net/mlx5: Read embedded cpu after init bit cleared net/sched: flower: fix possible OOB write in fl_set_geneve_opt() net: dsa: mv88e6xxx: Increase wait after reset deactivation mtd: rawnand: marvell: ensure timing values are written mtd: rawnand: marvell: don't set the NAND frequency select rtnetlink: call validate_linkmsg in rtnl_create_link drm/amdgpu: release gpu full access after "amdgpu_device_ip_late_init" watchdog: menz069_wdt: fix watchdog initialisation ALSA: hda: Glenfly: add HD Audio PCI IDs and HDMI Codec Vendor IDs. drm/amdgpu: Use the default reset when loading or reloading the driver mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write() drm/ast: Fix ARM compatibility btrfs: abort transaction when sibling keys check fails for leaves ARM: 9295/1: unwind:fix unwind abort for uleb128 case media: rcar-vin: Select correct interrupt mode for V4L2_FIELD_ALTERNATE platform/x86: intel_scu_pcidrv: Add back PCI ID for Medfield gfs2: Don't deref jdesc in evict fbdev: imsttfb: Fix use after free bug in imsttfb_probe fbdev: modedb: Add 1920x1080 at 60 Hz video mode fbdev: stifb: Fix info entry in sti_struct on error path nbd: Fix debugfs_create_dir error checking block/rnbd: replace REQ_OP_FLUSH with REQ_OP_WRITE nvme-pci: add NVME_QUIRK_BOGUS_NID for HS-SSD-FUTURE 2048G nvme-pci: add quirk for missing secondary temperature thresholds ASoC: dwc: limit the number of overrun messages um: harddog: fix modular build xfrm: Check if_id in inbound policy/secpath match ASoC: dt-bindings: Adjust #sound-dai-cells on TI's single-DAI codecs ASoC: ssm2602: Add workaround for playback distortions media: dvb_demux: fix a bug for the continuity counter media: dvb-usb: az6027: fix three null-ptr-deref in az6027_i2c_xfer() media: dvb-usb-v2: ec168: fix null-ptr-deref in ec168_i2c_xfer() media: dvb-usb-v2: ce6230: fix null-ptr-deref in ce6230_i2c_master_xfer() media: dvb-usb-v2: rtl28xxu: fix null-ptr-deref in rtl28xxu_i2c_xfer media: dvb-usb: digitv: fix null-ptr-deref in digitv_i2c_xfer() media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address media: netup_unidvb: fix irq init by register it at the end of probe media: dvb_ca_en50221: fix a size write bug media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb() media: mn88443x: fix !CONFIG_OF error by drop of_match_ptr from ID table media: dvb-core: Fix use-after-free due on race condition at dvb_net media: dvb-core: Fix use-after-free due to race at dvb_register_device() media: dvb-core: Fix kernel WARNING for blocking operation in wait_event*() media: dvb-core: Fix use-after-free due to race condition at dvb_ca_en50221 s390/pkey: zeroize key blobs s390/topology: honour nr_cpu_ids when adding CPUs ACPI: resource: Add IRQ override quirk for LG UltraPC 17U70P wifi: rtl8xxxu: fix authentication timeout due to incorrect RCR value ARM: dts: stm32: add pin map for CAN controller on stm32f7 arm64/mm: mark private VM_FAULT_X defines as vm_fault_t arm64: vdso: Pass (void *) to virt_to_page() wifi: mac80211: simplify chanctx allocation scsi: core: Decrease scsi_device's iorequest_cnt if dispatch failed wifi: b43: fix incorrect __packed annotation netfilter: conntrack: define variables exp_nat_nla_policy and any_addr with CONFIG_NF_NAT nvme-multipath: don't call blk_mark_disk_dead in nvme_mpath_remove_disk ALSA: oss: avoid missing-prototype warnings drm/msm: Be more shouty if per-process pgtables aren't working atm: hide unused procfs functions drm/amdgpu: skip disabling fence driver src_irqs when device is unplugged nvme-pci: Add quirk for Teamgroup MP33 SSD mailbox: mailbox-test: fix a locking issue in mbox_test_message_write() media: uvcvideo: Don't expose unsupported formats to userspace iio: accel: st_accel: Fix invalid mount_matrix on devices without ACPI _ONT method iio: adc: mxs-lradc: fix the order of two cleanup operations HID: google: add jewel USB id HID: wacom: avoid integer overflow in wacom_intuos_inout() iio: imu: inv_icm42600: fix timestamp reset dt-bindings: iio: adc: renesas,rcar-gyroadc: Fix adi,ad7476 compatible value iio: light: vcnl4035: fixed chip ID check iio: adc: ad_sigma_delta: Fix IRQ issue by setting IRQ_DISABLE_UNLAZY flag iio: dac: mcp4725: Fix i2c_master_send() return value handling iio: adc: ad7192: Change "shorted" channels to differential iio: dac: build ad5758 driver when AD5758 is selected net: usb: qmi_wwan: Set DTR quirk for BroadMobi BM818 dt-bindings: usb: snps,dwc3: Fix "snps,hsphy_interface" type usb: gadget: f_fs: Add unbind event before functionfs_unbind md/raid5: fix miscalculation of 'end_sector' in raid5_read_one_chunk() misc: fastrpc: return -EPIPE to invocations on device removal misc: fastrpc: reject new invocations during device removal scsi: stex: Fix gcc 13 warnings ata: libata-scsi: Use correct device no in ata_find_dev() drm/amd/pm: reverse mclk and fclk clocks levels for vangogh drm/amd/pm: reverse mclk and fclk clocks levels for yellow carp drm/amd/pm: reverse mclk and fclk clocks levels for renoir x86/boot: Wrap literal addresses in absolute_pointer() ath6kl: Use struct_group() to avoid size-mismatched casting block/blk-iocost (gcc13): keep large values in a new enum mmc: vub300: fix invalid response handling mmc: pwrseq: sd8787: Fix WILC CHIP_EN and RESETN toggling order tty: serial: fsl_lpuart: use UARTCTRL_TXINV to send break instead of UARTCTRL_SBK btrfs: fix csum_tree_block page iteration to avoid tripping on -Werror=array-bounds powerpc/iommu: Limit number of TCEs to 512 for H_STUFF_TCE hcall iommu/amd: Fix domain flush size when syncing iotlb usb: cdns3: allocate TX FIFO size according to composite EP number usb: cdns3: fix NCM gadget RX speed 20x slow than expection at iMX8QM block: fix revalidate performance regression selinux: don't use make's grouped targets feature yet tracing/probe: trace_probe_primary_from_call(): checked list_first_entry selftests: mptcp: connect: skip if MPTCP is not supported selftests: mptcp: pm nl: skip if MPTCP is not supported selftests: mptcp: sockopt: skip if MPTCP is not supported ext4: add EA_INODE checking to ext4_iget() ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find() ext4: disallow ea_inodes with extended attributes ext4: add lockdep annotations for i_data_sem for ea_inode's fbcon: Fix null-ptr-deref in soft_cursor serial: 8250_tegra: Fix an error handling path in tegra_uart_probe() test_firmware: fix the memory leak of the allocated firmware buffer KVM: x86: Account fastpath-only VM-Exits in vCPU stats ksmbd: fix credit count leakage ksmbd: fix incorrect AllocationSize set in smb2_get_info KEYS: asymmetric: Copy sig and digest in public_key_verify_signature() regmap: Account for register length when chunking tpm, tpm_tis: Request threaded interrupt handler drm/rcar: stop using 'imply' for dependencies scsi: dpt_i2o: Remove broken pass-through ioctl (I2OUSERCMD) scsi: dpt_i2o: Do not process completions with invalid addresses drm/amdgpu/gfx10: Disable gfxoff before disabling powergating. selftests: mptcp: diag: skip if MPTCP is not supported selftests: mptcp: simult flows: skip if MPTCP is not supported selftests: mptcp: join: skip if MPTCP is not supported ext4: enable the lazy init thread when remounting read/write ARM: defconfig: drop CONFIG_DRM_RCAR_LVDS RDMA/irdma: Fix drain SQ hang with no completion RDMA/irdma: Do not generate SW completions for NOPs Linux 5.15.116 Change-Id: I9c1fcca4400982e913153ad26f22826434c3c4d8 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -86,7 +86,7 @@ patternProperties:
|
||||
of the MAX chips to the GyroADC, while MISO line of each Maxim
|
||||
ADC connects to a shared input pin of the GyroADC.
|
||||
enum:
|
||||
- adi,7476
|
||||
- adi,ad7476
|
||||
- fujitsu,mb88101a
|
||||
- maxim,max1162
|
||||
- maxim,max11100
|
||||
|
||||
@@ -52,7 +52,9 @@ properties:
|
||||
description: TDM TX current sense time slot.
|
||||
|
||||
'#sound-dai-cells':
|
||||
const: 1
|
||||
# The codec has a single DAI, the #sound-dai-cells=<1>; case is left in for backward
|
||||
# compatibility but is deprecated.
|
||||
enum: [0, 1]
|
||||
|
||||
required:
|
||||
- compatible
|
||||
@@ -69,7 +71,7 @@ examples:
|
||||
codec: codec@4c {
|
||||
compatible = "ti,tas2562";
|
||||
reg = <0x4c>;
|
||||
#sound-dai-cells = <1>;
|
||||
#sound-dai-cells = <0>;
|
||||
interrupt-parent = <&gpio1>;
|
||||
interrupts = <14>;
|
||||
shutdown-gpios = <&gpio1 15 0>;
|
||||
|
||||
@@ -46,7 +46,9 @@ properties:
|
||||
description: TDM TX voltage sense time slot.
|
||||
|
||||
'#sound-dai-cells':
|
||||
const: 1
|
||||
# The codec has a single DAI, the #sound-dai-cells=<1>; case is left in for backward
|
||||
# compatibility but is deprecated.
|
||||
enum: [0, 1]
|
||||
|
||||
required:
|
||||
- compatible
|
||||
@@ -63,7 +65,7 @@ examples:
|
||||
codec: codec@38 {
|
||||
compatible = "ti,tas2764";
|
||||
reg = <0x38>;
|
||||
#sound-dai-cells = <1>;
|
||||
#sound-dai-cells = <0>;
|
||||
interrupt-parent = <&gpio1>;
|
||||
interrupts = <14>;
|
||||
reset-gpios = <&gpio1 15 0>;
|
||||
|
||||
@@ -54,7 +54,9 @@ properties:
|
||||
- 1 # Falling edge
|
||||
|
||||
'#sound-dai-cells':
|
||||
const: 1
|
||||
# The codec has a single DAI, the #sound-dai-cells=<1>; case is left in for backward
|
||||
# compatibility but is deprecated.
|
||||
enum: [0, 1]
|
||||
|
||||
required:
|
||||
- compatible
|
||||
@@ -71,7 +73,7 @@ examples:
|
||||
codec: codec@41 {
|
||||
compatible = "ti,tas2770";
|
||||
reg = <0x41>;
|
||||
#sound-dai-cells = <1>;
|
||||
#sound-dai-cells = <0>;
|
||||
interrupt-parent = <&gpio1>;
|
||||
interrupts = <14>;
|
||||
reset-gpio = <&gpio1 15 0>;
|
||||
|
||||
@@ -245,7 +245,7 @@ properties:
|
||||
description:
|
||||
High-Speed PHY interface selection between UTMI+ and ULPI when the
|
||||
DWC_USB3_HSPHY_INTERFACE has value 3.
|
||||
$ref: /schemas/types.yaml#/definitions/uint8
|
||||
$ref: /schemas/types.yaml#/definitions/string
|
||||
enum: [utmi, ulpi]
|
||||
|
||||
snps,quirk-frame-length-adjustment:
|
||||
|
||||
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 15
|
||||
SUBLEVEL = 115
|
||||
SUBLEVEL = 116
|
||||
EXTRAVERSION =
|
||||
NAME = Trick or Treat
|
||||
|
||||
|
||||
@@ -284,6 +284,88 @@
|
||||
slew-rate = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
can1_pins_a: can1-0 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('A', 12, AF9)>; /* CAN1_TX */
|
||||
};
|
||||
pins2 {
|
||||
pinmux = <STM32_PINMUX('A', 11, AF9)>; /* CAN1_RX */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
can1_pins_b: can1-1 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('B', 9, AF9)>; /* CAN1_TX */
|
||||
};
|
||||
pins2 {
|
||||
pinmux = <STM32_PINMUX('B', 8, AF9)>; /* CAN1_RX */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
can1_pins_c: can1-2 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('D', 1, AF9)>; /* CAN1_TX */
|
||||
};
|
||||
pins2 {
|
||||
pinmux = <STM32_PINMUX('D', 0, AF9)>; /* CAN1_RX */
|
||||
bias-pull-up;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
can1_pins_d: can1-3 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('H', 13, AF9)>; /* CAN1_TX */
|
||||
};
|
||||
pins2 {
|
||||
pinmux = <STM32_PINMUX('H', 14, AF9)>; /* CAN1_RX */
|
||||
bias-pull-up;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
can2_pins_a: can2-0 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('B', 6, AF9)>; /* CAN2_TX */
|
||||
};
|
||||
pins2 {
|
||||
pinmux = <STM32_PINMUX('B', 5, AF9)>; /* CAN2_RX */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
can2_pins_b: can2-1 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('B', 13, AF9)>; /* CAN2_TX */
|
||||
};
|
||||
pins2 {
|
||||
pinmux = <STM32_PINMUX('B', 12, AF9)>; /* CAN2_RX */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
can3_pins_a: can3-0 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('A', 15, AF11)>; /* CAN3_TX */
|
||||
};
|
||||
pins2 {
|
||||
pinmux = <STM32_PINMUX('A', 8, AF11)>; /* CAN3_RX */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
can3_pins_b: can3-1 {
|
||||
pins1 {
|
||||
pinmux = <STM32_PINMUX('B', 4, AF11)>; /* CAN3_TX */
|
||||
};
|
||||
pins2 {
|
||||
pinmux = <STM32_PINMUX('B', 3, AF11)>; /* CAN3_RX */
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -696,7 +696,6 @@ CONFIG_DRM_IMX_LDB=m
|
||||
CONFIG_DRM_IMX_HDMI=m
|
||||
CONFIG_DRM_ATMEL_HLCDC=m
|
||||
CONFIG_DRM_RCAR_DU=m
|
||||
CONFIG_DRM_RCAR_LVDS=y
|
||||
CONFIG_DRM_SUN4I=m
|
||||
CONFIG_DRM_MSM=m
|
||||
CONFIG_DRM_FSL_DCU=m
|
||||
|
||||
@@ -301,6 +301,29 @@ static int unwind_exec_pop_subset_r0_to_r3(struct unwind_ctrl_block *ctrl,
|
||||
return URC_OK;
|
||||
}
|
||||
|
||||
static unsigned long unwind_decode_uleb128(struct unwind_ctrl_block *ctrl)
|
||||
{
|
||||
unsigned long bytes = 0;
|
||||
unsigned long insn;
|
||||
unsigned long result = 0;
|
||||
|
||||
/*
|
||||
* unwind_get_byte() will advance `ctrl` one instruction at a time, so
|
||||
* loop until we get an instruction byte where bit 7 is not set.
|
||||
*
|
||||
* Note: This decodes a maximum of 4 bytes to output 28 bits data where
|
||||
* max is 0xfffffff: that will cover a vsp increment of 1073742336, hence
|
||||
* it is sufficient for unwinding the stack.
|
||||
*/
|
||||
do {
|
||||
insn = unwind_get_byte(ctrl);
|
||||
result |= (insn & 0x7f) << (bytes * 7);
|
||||
bytes++;
|
||||
} while (!!(insn & 0x80) && (bytes != sizeof(result)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute the current unwind instruction.
|
||||
*/
|
||||
@@ -354,7 +377,7 @@ static int unwind_exec_insn(struct unwind_ctrl_block *ctrl)
|
||||
if (ret)
|
||||
goto error;
|
||||
} else if (insn == 0xb2) {
|
||||
unsigned long uleb128 = unwind_get_byte(ctrl);
|
||||
unsigned long uleb128 = unwind_decode_uleb128(ctrl);
|
||||
|
||||
ctrl->vrs[SP] += 0x204 + (uleb128 << 2);
|
||||
} else {
|
||||
|
||||
@@ -314,7 +314,7 @@ static int aarch32_alloc_kuser_vdso_page(void)
|
||||
|
||||
memcpy((void *)(vdso_page + 0x1000 - kuser_sz), __kuser_helper_start,
|
||||
kuser_sz);
|
||||
aarch32_vectors_page = virt_to_page(vdso_page);
|
||||
aarch32_vectors_page = virt_to_page((void *)vdso_page);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -492,8 +492,8 @@ static void do_bad_area(unsigned long far, unsigned long esr,
|
||||
}
|
||||
}
|
||||
|
||||
#define VM_FAULT_BADMAP 0x010000
|
||||
#define VM_FAULT_BADACCESS 0x020000
|
||||
#define VM_FAULT_BADMAP ((__force vm_fault_t)0x010000)
|
||||
#define VM_FAULT_BADACCESS ((__force vm_fault_t)0x020000)
|
||||
|
||||
static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr,
|
||||
unsigned int mm_flags, unsigned long vm_flags,
|
||||
|
||||
@@ -311,13 +311,22 @@ static void tce_free_pSeriesLP(unsigned long liobn, long tcenum, long tceshift,
|
||||
static void tce_freemulti_pSeriesLP(struct iommu_table *tbl, long tcenum, long npages)
|
||||
{
|
||||
u64 rc;
|
||||
long rpages = npages;
|
||||
unsigned long limit;
|
||||
|
||||
if (!firmware_has_feature(FW_FEATURE_STUFF_TCE))
|
||||
return tce_free_pSeriesLP(tbl->it_index, tcenum,
|
||||
tbl->it_page_shift, npages);
|
||||
|
||||
rc = plpar_tce_stuff((u64)tbl->it_index,
|
||||
(u64)tcenum << tbl->it_page_shift, 0, npages);
|
||||
do {
|
||||
limit = min_t(unsigned long, rpages, 512);
|
||||
|
||||
rc = plpar_tce_stuff((u64)tbl->it_index,
|
||||
(u64)tcenum << tbl->it_page_shift, 0, limit);
|
||||
|
||||
rpages -= limit;
|
||||
tcenum += limit;
|
||||
} while (rpages > 0 && !rc);
|
||||
|
||||
if (rc && printk_ratelimit()) {
|
||||
printk("tce_freemulti_pSeriesLP: plpar_tce_stuff failed\n");
|
||||
|
||||
@@ -572,9 +572,9 @@ static void __init create_kernel_page_table(pgd_t *pgdir, bool early)
|
||||
static void __init create_fdt_early_page_table(uintptr_t fix_fdt_va,
|
||||
uintptr_t dtb_pa)
|
||||
{
|
||||
#ifndef CONFIG_BUILTIN_DTB
|
||||
uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
|
||||
|
||||
#ifndef CONFIG_BUILTIN_DTB
|
||||
/* Make sure the fdt fixmap address is always aligned on PMD size */
|
||||
BUILD_BUG_ON(FIX_FDT % (PMD_SIZE / PAGE_SIZE));
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ out:
|
||||
static void cpu_thread_map(cpumask_t *dst, unsigned int cpu)
|
||||
{
|
||||
static cpumask_t mask;
|
||||
int i;
|
||||
unsigned int max_cpu;
|
||||
|
||||
cpumask_clear(&mask);
|
||||
if (!cpumask_test_cpu(cpu, &cpu_setup_mask))
|
||||
@@ -105,9 +105,10 @@ static void cpu_thread_map(cpumask_t *dst, unsigned int cpu)
|
||||
if (topology_mode != TOPOLOGY_MODE_HW)
|
||||
goto out;
|
||||
cpu -= cpu % (smp_cpu_mtid + 1);
|
||||
for (i = 0; i <= smp_cpu_mtid; i++) {
|
||||
if (cpumask_test_cpu(cpu + i, &cpu_setup_mask))
|
||||
cpumask_set_cpu(cpu + i, &mask);
|
||||
max_cpu = min(cpu + smp_cpu_mtid, nr_cpu_ids - 1);
|
||||
for (; cpu <= max_cpu; cpu++) {
|
||||
if (cpumask_test_cpu(cpu, &cpu_setup_mask))
|
||||
cpumask_set_cpu(cpu, &mask);
|
||||
}
|
||||
out:
|
||||
cpumask_copy(dst, &mask);
|
||||
@@ -124,25 +125,26 @@ static void add_cpus_to_mask(struct topology_core *tl_core,
|
||||
unsigned int core;
|
||||
|
||||
for_each_set_bit(core, &tl_core->mask, TOPOLOGY_CORE_BITS) {
|
||||
unsigned int rcore;
|
||||
int lcpu, i;
|
||||
unsigned int max_cpu, rcore;
|
||||
int cpu;
|
||||
|
||||
rcore = TOPOLOGY_CORE_BITS - 1 - core + tl_core->origin;
|
||||
lcpu = smp_find_processor_id(rcore << smp_cpu_mt_shift);
|
||||
if (lcpu < 0)
|
||||
cpu = smp_find_processor_id(rcore << smp_cpu_mt_shift);
|
||||
if (cpu < 0)
|
||||
continue;
|
||||
for (i = 0; i <= smp_cpu_mtid; i++) {
|
||||
topo = &cpu_topology[lcpu + i];
|
||||
max_cpu = min(cpu + smp_cpu_mtid, nr_cpu_ids - 1);
|
||||
for (; cpu <= max_cpu; cpu++) {
|
||||
topo = &cpu_topology[cpu];
|
||||
topo->drawer_id = drawer->id;
|
||||
topo->book_id = book->id;
|
||||
topo->socket_id = socket->id;
|
||||
topo->core_id = rcore;
|
||||
topo->thread_id = lcpu + i;
|
||||
topo->thread_id = cpu;
|
||||
topo->dedicated = tl_core->d;
|
||||
cpumask_set_cpu(lcpu + i, &drawer->mask);
|
||||
cpumask_set_cpu(lcpu + i, &book->mask);
|
||||
cpumask_set_cpu(lcpu + i, &socket->mask);
|
||||
smp_cpu_set_polarization(lcpu + i, tl_core->pp);
|
||||
cpumask_set_cpu(cpu, &drawer->mask);
|
||||
cpumask_set_cpu(cpu, &book->mask);
|
||||
cpumask_set_cpu(cpu, &socket->mask);
|
||||
smp_cpu_set_polarization(cpu, tl_core->pp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ mconsole-objs := mconsole_kern.o mconsole_user.o
|
||||
hostaudio-objs := hostaudio_kern.o
|
||||
ubd-objs := ubd_kern.o ubd_user.o
|
||||
port-objs := port_kern.o port_user.o
|
||||
harddog-objs := harddog_kern.o harddog_user.o
|
||||
harddog-objs := harddog_kern.o
|
||||
harddog-builtin-$(CONFIG_UML_WATCHDOG) := harddog_user.o harddog_user_exp.o
|
||||
rtc-objs := rtc_kern.o rtc_user.o
|
||||
|
||||
LDFLAGS_pcap.o = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a)
|
||||
@@ -60,6 +61,7 @@ obj-$(CONFIG_PTY_CHAN) += pty.o
|
||||
obj-$(CONFIG_TTY_CHAN) += tty.o
|
||||
obj-$(CONFIG_XTERM_CHAN) += xterm.o xterm_kern.o
|
||||
obj-$(CONFIG_UML_WATCHDOG) += harddog.o
|
||||
obj-y += $(harddog-builtin-y) $(harddog-builtin-m)
|
||||
obj-$(CONFIG_BLK_DEV_COW_COMMON) += cow_user.o
|
||||
obj-$(CONFIG_UML_RANDOM) += random.o
|
||||
obj-$(CONFIG_VIRTIO_UML) += virtio_uml.o
|
||||
|
||||
9
arch/um/drivers/harddog.h
Normal file
9
arch/um/drivers/harddog.h
Normal file
@@ -0,0 +1,9 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef UM_WATCHDOG_H
|
||||
#define UM_WATCHDOG_H
|
||||
|
||||
int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock);
|
||||
void stop_watchdog(int in_fd, int out_fd);
|
||||
int ping_watchdog(int fd);
|
||||
|
||||
#endif /* UM_WATCHDOG_H */
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include "mconsole.h"
|
||||
#include "harddog.h"
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
@@ -60,8 +61,6 @@ static int harddog_out_fd = -1;
|
||||
* Allow only one person to hold it open
|
||||
*/
|
||||
|
||||
extern int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock);
|
||||
|
||||
static int harddog_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
int err = -EBUSY;
|
||||
@@ -92,8 +91,6 @@ err:
|
||||
return err;
|
||||
}
|
||||
|
||||
extern void stop_watchdog(int in_fd, int out_fd);
|
||||
|
||||
static int harddog_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
/*
|
||||
@@ -112,8 +109,6 @@ static int harddog_release(struct inode *inode, struct file *file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern int ping_watchdog(int fd);
|
||||
|
||||
static ssize_t harddog_write(struct file *file, const char __user *data, size_t len,
|
||||
loff_t *ppos)
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <os.h>
|
||||
#include "harddog.h"
|
||||
|
||||
struct dog_data {
|
||||
int stdin_fd;
|
||||
|
||||
9
arch/um/drivers/harddog_user_exp.c
Normal file
9
arch/um/drivers/harddog_user_exp.c
Normal file
@@ -0,0 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <linux/export.h>
|
||||
#include "harddog.h"
|
||||
|
||||
#if IS_MODULE(CONFIG_UML_WATCHDOG)
|
||||
EXPORT_SYMBOL(start_watchdog);
|
||||
EXPORT_SYMBOL(stop_watchdog);
|
||||
EXPORT_SYMBOL(ping_watchdog);
|
||||
#endif
|
||||
@@ -9901,6 +9901,9 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
|
||||
exit_fastpath = EXIT_FASTPATH_EXIT_HANDLED;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Note, VM-Exits that go down the "slow" path are accounted below. */
|
||||
++vcpu->stat.exits;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -232,7 +232,9 @@ enum {
|
||||
|
||||
/* 1/64k is granular enough and can easily be handled w/ u32 */
|
||||
WEIGHT_ONE = 1 << 16,
|
||||
};
|
||||
|
||||
enum {
|
||||
/*
|
||||
* As vtime is used to calculate the cost of each IO, it needs to
|
||||
* be fairly high precision. For example, it should be able to
|
||||
|
||||
@@ -875,6 +875,7 @@ static bool disk_has_partitions(struct gendisk *disk)
|
||||
void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
|
||||
{
|
||||
struct request_queue *q = disk->queue;
|
||||
unsigned int old_model = q->limits.zoned;
|
||||
|
||||
switch (model) {
|
||||
case BLK_ZONED_HM:
|
||||
@@ -912,7 +913,7 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
|
||||
*/
|
||||
blk_queue_zone_write_granularity(q,
|
||||
queue_logical_block_size(q));
|
||||
} else {
|
||||
} else if (old_model != BLK_ZONED_NONE) {
|
||||
blk_queue_clear_zone_settings(q);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,9 +380,10 @@ int public_key_verify_signature(const struct public_key *pkey,
|
||||
struct crypto_wait cwait;
|
||||
struct crypto_akcipher *tfm;
|
||||
struct akcipher_request *req;
|
||||
struct scatterlist src_sg[2];
|
||||
struct scatterlist src_sg;
|
||||
char alg_name[CRYPTO_MAX_ALG_NAME];
|
||||
char *key, *ptr;
|
||||
char *buf, *ptr;
|
||||
size_t buf_len;
|
||||
int ret;
|
||||
|
||||
pr_devel("==>%s()\n", __func__);
|
||||
@@ -420,34 +421,37 @@ int public_key_verify_signature(const struct public_key *pkey,
|
||||
if (!req)
|
||||
goto error_free_tfm;
|
||||
|
||||
key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen,
|
||||
GFP_KERNEL);
|
||||
if (!key)
|
||||
buf_len = max_t(size_t, pkey->keylen + sizeof(u32) * 2 + pkey->paramlen,
|
||||
sig->s_size + sig->digest_size);
|
||||
|
||||
buf = kmalloc(buf_len, GFP_KERNEL);
|
||||
if (!buf)
|
||||
goto error_free_req;
|
||||
|
||||
memcpy(key, pkey->key, pkey->keylen);
|
||||
ptr = key + pkey->keylen;
|
||||
memcpy(buf, pkey->key, pkey->keylen);
|
||||
ptr = buf + pkey->keylen;
|
||||
ptr = pkey_pack_u32(ptr, pkey->algo);
|
||||
ptr = pkey_pack_u32(ptr, pkey->paramlen);
|
||||
memcpy(ptr, pkey->params, pkey->paramlen);
|
||||
|
||||
if (pkey->key_is_private)
|
||||
ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen);
|
||||
ret = crypto_akcipher_set_priv_key(tfm, buf, pkey->keylen);
|
||||
else
|
||||
ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen);
|
||||
ret = crypto_akcipher_set_pub_key(tfm, buf, pkey->keylen);
|
||||
if (ret)
|
||||
goto error_free_key;
|
||||
goto error_free_buf;
|
||||
|
||||
if (strcmp(pkey->pkey_algo, "sm2") == 0 && sig->data_size) {
|
||||
ret = cert_sig_digest_update(sig, tfm);
|
||||
if (ret)
|
||||
goto error_free_key;
|
||||
goto error_free_buf;
|
||||
}
|
||||
|
||||
sg_init_table(src_sg, 2);
|
||||
sg_set_buf(&src_sg[0], sig->s, sig->s_size);
|
||||
sg_set_buf(&src_sg[1], sig->digest, sig->digest_size);
|
||||
akcipher_request_set_crypt(req, src_sg, NULL, sig->s_size,
|
||||
memcpy(buf, sig->s, sig->s_size);
|
||||
memcpy(buf + sig->s_size, sig->digest, sig->digest_size);
|
||||
|
||||
sg_init_one(&src_sg, buf, sig->s_size + sig->digest_size);
|
||||
akcipher_request_set_crypt(req, &src_sg, NULL, sig->s_size,
|
||||
sig->digest_size);
|
||||
crypto_init_wait(&cwait);
|
||||
akcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG |
|
||||
@@ -455,8 +459,8 @@ int public_key_verify_signature(const struct public_key *pkey,
|
||||
crypto_req_done, &cwait);
|
||||
ret = crypto_wait_req(crypto_akcipher_verify(req), &cwait);
|
||||
|
||||
error_free_key:
|
||||
kfree(key);
|
||||
error_free_buf:
|
||||
kfree(buf);
|
||||
error_free_req:
|
||||
akcipher_request_free(req);
|
||||
error_free_tfm:
|
||||
|
||||
@@ -470,6 +470,17 @@ static const struct dmi_system_id maingear_laptop[] = {
|
||||
{ }
|
||||
};
|
||||
|
||||
static const struct dmi_system_id lg_laptop[] = {
|
||||
{
|
||||
.ident = "LG Electronics 17U70P",
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_SYS_VENDOR, "LG Electronics"),
|
||||
DMI_MATCH(DMI_BOARD_NAME, "17U70P"),
|
||||
},
|
||||
},
|
||||
{ }
|
||||
};
|
||||
|
||||
struct irq_override_cmp {
|
||||
const struct dmi_system_id *system;
|
||||
unsigned char irq;
|
||||
@@ -486,6 +497,7 @@ static const struct irq_override_cmp override_table[] = {
|
||||
{ lenovo_laptop, 10, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, true },
|
||||
{ tongfang_gm_rg, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
|
||||
{ maingear_laptop, 1, ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_LOW, 1, true },
|
||||
{ lg_laptop, 1, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW, 0, false },
|
||||
};
|
||||
|
||||
static bool acpi_dev_irq_override(u32 gsi, u8 triggering, u8 polarity,
|
||||
|
||||
@@ -2698,18 +2698,36 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct ata_device *ata_find_dev(struct ata_port *ap, int devno)
|
||||
static struct ata_device *ata_find_dev(struct ata_port *ap, unsigned int devno)
|
||||
{
|
||||
if (!sata_pmp_attached(ap)) {
|
||||
if (likely(devno >= 0 &&
|
||||
devno < ata_link_max_devices(&ap->link)))
|
||||
/*
|
||||
* For the non-PMP case, ata_link_max_devices() returns 1 (SATA case),
|
||||
* or 2 (IDE master + slave case). However, the former case includes
|
||||
* libsas hosted devices which are numbered per scsi host, leading
|
||||
* to devno potentially being larger than 0 but with each struct
|
||||
* ata_device having its own struct ata_port and struct ata_link.
|
||||
* To accommodate these, ignore devno and always use device number 0.
|
||||
*/
|
||||
if (likely(!sata_pmp_attached(ap))) {
|
||||
int link_max_devices = ata_link_max_devices(&ap->link);
|
||||
|
||||
if (link_max_devices == 1)
|
||||
return &ap->link.device[0];
|
||||
|
||||
if (devno < link_max_devices)
|
||||
return &ap->link.device[devno];
|
||||
} else {
|
||||
if (likely(devno >= 0 &&
|
||||
devno < ap->nr_pmp_links))
|
||||
return &ap->pmp_link[devno].device[0];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* For PMP-attached devices, the device number corresponds to C
|
||||
* (channel) of SCSI [H:C:I:L], indicating the port pmp link
|
||||
* for the device.
|
||||
*/
|
||||
if (devno < ap->nr_pmp_links)
|
||||
return &ap->pmp_link[devno].device[0];
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -1605,7 +1605,7 @@ static int nbd_dev_dbg_init(struct nbd_device *nbd)
|
||||
return -EIO;
|
||||
|
||||
dir = debugfs_create_dir(nbd_name(nbd), nbd_dbg_dir);
|
||||
if (!dir) {
|
||||
if (IS_ERR(dir)) {
|
||||
dev_err(nbd_to_dev(nbd), "Failed to create debugfs dir for '%s'\n",
|
||||
nbd_name(nbd));
|
||||
return -EIO;
|
||||
@@ -1631,7 +1631,7 @@ static int nbd_dbg_init(void)
|
||||
struct dentry *dbg_dir;
|
||||
|
||||
dbg_dir = debugfs_create_dir("nbd", NULL);
|
||||
if (!dbg_dir)
|
||||
if (IS_ERR(dbg_dir))
|
||||
return -EIO;
|
||||
|
||||
nbd_dbg_dir = dbg_dir;
|
||||
|
||||
@@ -241,7 +241,7 @@ static inline u32 rnbd_to_bio_flags(u32 rnbd_opf)
|
||||
bio_opf = REQ_OP_WRITE;
|
||||
break;
|
||||
case RNBD_OP_FLUSH:
|
||||
bio_opf = REQ_OP_FLUSH | REQ_PREFLUSH;
|
||||
bio_opf = REQ_OP_WRITE | REQ_PREFLUSH;
|
||||
break;
|
||||
case RNBD_OP_DISCARD:
|
||||
bio_opf = REQ_OP_DISCARD;
|
||||
|
||||
@@ -764,8 +764,11 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
|
||||
int rc;
|
||||
u32 int_status;
|
||||
|
||||
if (devm_request_irq(chip->dev.parent, irq, tis_int_handler, flags,
|
||||
dev_name(&chip->dev), chip) != 0) {
|
||||
|
||||
rc = devm_request_threaded_irq(chip->dev.parent, irq, NULL,
|
||||
tis_int_handler, IRQF_ONESHOT | flags,
|
||||
dev_name(&chip->dev), chip);
|
||||
if (rc) {
|
||||
dev_info(&chip->dev, "Unable to request irq: %d for probe\n",
|
||||
irq);
|
||||
return -1;
|
||||
|
||||
@@ -732,7 +732,8 @@ at_xdmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
|
||||
if (!desc) {
|
||||
dev_err(chan2dev(chan), "can't get descriptor\n");
|
||||
if (first)
|
||||
list_splice_init(&first->descs_list, &atchan->free_descs_list);
|
||||
list_splice_tail_init(&first->descs_list,
|
||||
&atchan->free_descs_list);
|
||||
goto spin_unlock;
|
||||
}
|
||||
|
||||
@@ -820,7 +821,8 @@ at_xdmac_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr,
|
||||
if (!desc) {
|
||||
dev_err(chan2dev(chan), "can't get descriptor\n");
|
||||
if (first)
|
||||
list_splice_init(&first->descs_list, &atchan->free_descs_list);
|
||||
list_splice_tail_init(&first->descs_list,
|
||||
&atchan->free_descs_list);
|
||||
spin_unlock_irqrestore(&atchan->lock, irqflags);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1024,6 +1026,8 @@ at_xdmac_prep_interleaved(struct dma_chan *chan,
|
||||
NULL,
|
||||
src_addr, dst_addr,
|
||||
xt, xt->sgl);
|
||||
if (!first)
|
||||
return NULL;
|
||||
|
||||
/* Length of the block is (BLEN+1) microblocks. */
|
||||
for (i = 0; i < xt->numf - 1; i++)
|
||||
@@ -1054,8 +1058,9 @@ at_xdmac_prep_interleaved(struct dma_chan *chan,
|
||||
src_addr, dst_addr,
|
||||
xt, chunk);
|
||||
if (!desc) {
|
||||
list_splice_init(&first->descs_list,
|
||||
&atchan->free_descs_list);
|
||||
if (first)
|
||||
list_splice_tail_init(&first->descs_list,
|
||||
&atchan->free_descs_list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1135,7 +1140,8 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
|
||||
if (!desc) {
|
||||
dev_err(chan2dev(chan), "can't get descriptor\n");
|
||||
if (first)
|
||||
list_splice_init(&first->descs_list, &atchan->free_descs_list);
|
||||
list_splice_tail_init(&first->descs_list,
|
||||
&atchan->free_descs_list);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1311,8 +1317,8 @@ at_xdmac_prep_dma_memset_sg(struct dma_chan *chan, struct scatterlist *sgl,
|
||||
sg_dma_len(sg),
|
||||
value);
|
||||
if (!desc && first)
|
||||
list_splice_init(&first->descs_list,
|
||||
&atchan->free_descs_list);
|
||||
list_splice_tail_init(&first->descs_list,
|
||||
&atchan->free_descs_list);
|
||||
|
||||
if (!first)
|
||||
first = desc;
|
||||
@@ -1709,7 +1715,8 @@ static void at_xdmac_tasklet(struct tasklet_struct *t)
|
||||
|
||||
spin_lock_irq(&atchan->lock);
|
||||
/* Move the xfer descriptors into the free descriptors list. */
|
||||
list_splice_init(&desc->descs_list, &atchan->free_descs_list);
|
||||
list_splice_tail_init(&desc->descs_list,
|
||||
&atchan->free_descs_list);
|
||||
at_xdmac_advance_work(atchan);
|
||||
spin_unlock_irq(&atchan->lock);
|
||||
}
|
||||
@@ -1858,7 +1865,8 @@ static int at_xdmac_device_terminate_all(struct dma_chan *chan)
|
||||
/* Cancel all pending transfers. */
|
||||
list_for_each_entry_safe(desc, _desc, &atchan->xfers_list, xfer_node) {
|
||||
list_del(&desc->xfer_node);
|
||||
list_splice_init(&desc->descs_list, &atchan->free_descs_list);
|
||||
list_splice_tail_init(&desc->descs_list,
|
||||
&atchan->free_descs_list);
|
||||
}
|
||||
|
||||
clear_bit(AT_XDMAC_CHAN_IS_PAUSED, &atchan->status);
|
||||
|
||||
@@ -1050,7 +1050,7 @@ static bool _trigger(struct pl330_thread *thrd)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool _start(struct pl330_thread *thrd)
|
||||
static bool pl330_start_thread(struct pl330_thread *thrd)
|
||||
{
|
||||
switch (_state(thrd)) {
|
||||
case PL330_STATE_FAULT_COMPLETING:
|
||||
@@ -1702,7 +1702,7 @@ static int pl330_update(struct pl330_dmac *pl330)
|
||||
thrd->req_running = -1;
|
||||
|
||||
/* Get going again ASAP */
|
||||
_start(thrd);
|
||||
pl330_start_thread(thrd);
|
||||
|
||||
/* For now, just make a list of callbacks to be done */
|
||||
list_add_tail(&descdone->rqd, &pl330->req_done);
|
||||
@@ -2089,7 +2089,7 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
} else {
|
||||
/* Make sure the PL330 Channel thread is active */
|
||||
spin_lock(&pch->thread->dmac->lock);
|
||||
_start(pch->thread);
|
||||
pl330_start_thread(pch->thread);
|
||||
spin_unlock(&pch->thread->dmac->lock);
|
||||
}
|
||||
|
||||
@@ -2107,7 +2107,7 @@ static void pl330_tasklet(struct tasklet_struct *t)
|
||||
if (power_down) {
|
||||
pch->active = true;
|
||||
spin_lock(&pch->thread->dmac->lock);
|
||||
_start(pch->thread);
|
||||
pl330_start_thread(pch->thread);
|
||||
spin_unlock(&pch->thread->dmac->lock);
|
||||
power_down = false;
|
||||
}
|
||||
|
||||
@@ -2509,8 +2509,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
|
||||
amdgpu_fru_get_product_info(adev);
|
||||
|
||||
init_failed:
|
||||
if (amdgpu_sriov_vf(adev))
|
||||
amdgpu_virt_release_full_gpu(adev, true);
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -3496,6 +3494,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
|
||||
int r, i;
|
||||
bool px = false;
|
||||
u32 max_MBps;
|
||||
int tmp;
|
||||
|
||||
adev->shutdown = false;
|
||||
adev->flags = flags;
|
||||
@@ -3695,7 +3694,13 @@ int amdgpu_device_init(struct amdgpu_device *adev,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
tmp = amdgpu_reset_method;
|
||||
/* It should do a default reset when loading or reloading the driver,
|
||||
* regardless of the module parameter reset_method.
|
||||
*/
|
||||
amdgpu_reset_method = AMD_RESET_METHOD_NONE;
|
||||
r = amdgpu_asic_reset(adev);
|
||||
amdgpu_reset_method = tmp;
|
||||
if (r) {
|
||||
dev_err(adev->dev, "asic reset on init failed\n");
|
||||
goto failed;
|
||||
@@ -3755,18 +3760,6 @@ fence_driver_init:
|
||||
|
||||
r = amdgpu_device_ip_init(adev);
|
||||
if (r) {
|
||||
/* failed in exclusive mode due to timeout */
|
||||
if (amdgpu_sriov_vf(adev) &&
|
||||
!amdgpu_sriov_runtime(adev) &&
|
||||
amdgpu_virt_mmio_blocked(adev) &&
|
||||
!amdgpu_virt_wait_reset(adev)) {
|
||||
dev_err(adev->dev, "VF exclusive mode timeout\n");
|
||||
/* Don't send request since VF is inactive. */
|
||||
adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME;
|
||||
adev->virt.ops = NULL;
|
||||
r = -EAGAIN;
|
||||
goto release_ras_con;
|
||||
}
|
||||
dev_err(adev->dev, "amdgpu_device_ip_init failed\n");
|
||||
amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_AMDGPU_INIT_FAIL, 0, 0);
|
||||
goto release_ras_con;
|
||||
@@ -3845,8 +3838,10 @@ fence_driver_init:
|
||||
msecs_to_jiffies(AMDGPU_RESUME_MS));
|
||||
}
|
||||
|
||||
if (amdgpu_sriov_vf(adev))
|
||||
if (amdgpu_sriov_vf(adev)) {
|
||||
amdgpu_virt_release_full_gpu(adev, true);
|
||||
flush_delayed_work(&adev->delayed_init_work);
|
||||
}
|
||||
|
||||
r = sysfs_create_files(&adev->dev->kobj, amdgpu_dev_attributes);
|
||||
if (r)
|
||||
@@ -3881,6 +3876,20 @@ fence_driver_init:
|
||||
return 0;
|
||||
|
||||
release_ras_con:
|
||||
if (amdgpu_sriov_vf(adev))
|
||||
amdgpu_virt_release_full_gpu(adev, true);
|
||||
|
||||
/* failed in exclusive mode due to timeout */
|
||||
if (amdgpu_sriov_vf(adev) &&
|
||||
!amdgpu_sriov_runtime(adev) &&
|
||||
amdgpu_virt_mmio_blocked(adev) &&
|
||||
!amdgpu_virt_wait_reset(adev)) {
|
||||
dev_err(adev->dev, "VF exclusive mode timeout\n");
|
||||
/* Don't send request since VF is inactive. */
|
||||
adev->virt.caps &= ~AMDGPU_SRIOV_CAPS_RUNTIME;
|
||||
adev->virt.ops = NULL;
|
||||
r = -EAGAIN;
|
||||
}
|
||||
amdgpu_release_ras_context(adev);
|
||||
|
||||
failed:
|
||||
|
||||
@@ -561,7 +561,8 @@ void amdgpu_fence_driver_hw_fini(struct amdgpu_device *adev)
|
||||
if (r)
|
||||
amdgpu_fence_driver_force_completion(ring);
|
||||
|
||||
if (ring->fence_drv.irq_src)
|
||||
if (!drm_dev_is_unplugged(adev_to_drm(adev)) &&
|
||||
ring->fence_drv.irq_src)
|
||||
amdgpu_irq_put(adev, ring->fence_drv.irq_src,
|
||||
ring->fence_drv.irq_type);
|
||||
|
||||
|
||||
@@ -8422,8 +8422,14 @@ static int gfx_v10_0_set_powergating_state(void *handle,
|
||||
break;
|
||||
case CHIP_VANGOGH:
|
||||
case CHIP_YELLOW_CARP:
|
||||
if (!enable)
|
||||
amdgpu_gfx_off_ctrl(adev, false);
|
||||
|
||||
gfx_v10_cntl_pg(adev, enable);
|
||||
amdgpu_gfx_off_ctrl(adev, enable);
|
||||
|
||||
if (enable)
|
||||
amdgpu_gfx_off_ctrl(adev, true);
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -579,7 +579,7 @@ static int vangogh_print_legacy_clk_levels(struct smu_context *smu,
|
||||
DpmClocks_t *clk_table = smu->smu_table.clocks_table;
|
||||
SmuMetrics_legacy_t metrics;
|
||||
struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);
|
||||
int i, size = 0, ret = 0;
|
||||
int i, idx, size = 0, ret = 0;
|
||||
uint32_t cur_value = 0, value = 0, count = 0;
|
||||
bool cur_value_match_level = false;
|
||||
|
||||
@@ -653,7 +653,8 @@ static int vangogh_print_legacy_clk_levels(struct smu_context *smu,
|
||||
case SMU_MCLK:
|
||||
case SMU_FCLK:
|
||||
for (i = 0; i < count; i++) {
|
||||
ret = vangogh_get_dpm_clk_limited(smu, clk_type, i, &value);
|
||||
idx = (clk_type == SMU_FCLK || clk_type == SMU_MCLK) ? (count - i - 1) : i;
|
||||
ret = vangogh_get_dpm_clk_limited(smu, clk_type, idx, &value);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!value)
|
||||
@@ -680,7 +681,7 @@ static int vangogh_print_clk_levels(struct smu_context *smu,
|
||||
DpmClocks_t *clk_table = smu->smu_table.clocks_table;
|
||||
SmuMetrics_t metrics;
|
||||
struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);
|
||||
int i, size = 0, ret = 0;
|
||||
int i, idx, size = 0, ret = 0;
|
||||
uint32_t cur_value = 0, value = 0, count = 0;
|
||||
bool cur_value_match_level = false;
|
||||
|
||||
@@ -754,7 +755,8 @@ static int vangogh_print_clk_levels(struct smu_context *smu,
|
||||
case SMU_MCLK:
|
||||
case SMU_FCLK:
|
||||
for (i = 0; i < count; i++) {
|
||||
ret = vangogh_get_dpm_clk_limited(smu, clk_type, i, &value);
|
||||
idx = (clk_type == SMU_FCLK || clk_type == SMU_MCLK) ? (count - i - 1) : i;
|
||||
ret = vangogh_get_dpm_clk_limited(smu, clk_type, idx, &value);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!value)
|
||||
|
||||
@@ -485,7 +485,7 @@ static int renoir_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)
|
||||
static int renoir_print_clk_levels(struct smu_context *smu,
|
||||
enum smu_clk_type clk_type, char *buf)
|
||||
{
|
||||
int i, size = 0, ret = 0;
|
||||
int i, idx, size = 0, ret = 0;
|
||||
uint32_t cur_value = 0, value = 0, count = 0, min = 0, max = 0;
|
||||
SmuMetrics_t metrics;
|
||||
struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);
|
||||
@@ -585,7 +585,8 @@ static int renoir_print_clk_levels(struct smu_context *smu,
|
||||
case SMU_VCLK:
|
||||
case SMU_DCLK:
|
||||
for (i = 0; i < count; i++) {
|
||||
ret = renoir_get_dpm_clk_limited(smu, clk_type, i, &value);
|
||||
idx = (clk_type == SMU_FCLK || clk_type == SMU_MCLK) ? (count - i - 1) : i;
|
||||
ret = renoir_get_dpm_clk_limited(smu, clk_type, idx, &value);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (!value)
|
||||
|
||||
@@ -1074,7 +1074,7 @@ out:
|
||||
static int yellow_carp_print_clk_levels(struct smu_context *smu,
|
||||
enum smu_clk_type clk_type, char *buf)
|
||||
{
|
||||
int i, size = 0, ret = 0;
|
||||
int i, idx, size = 0, ret = 0;
|
||||
uint32_t cur_value = 0, value = 0, count = 0;
|
||||
|
||||
smu_cmn_get_sysfs_buf(&buf, &size);
|
||||
@@ -1106,7 +1106,8 @@ static int yellow_carp_print_clk_levels(struct smu_context *smu,
|
||||
goto print_clk_out;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
ret = yellow_carp_get_dpm_freq_by_index(smu, clk_type, i, &value);
|
||||
idx = (clk_type == SMU_FCLK || clk_type == SMU_MCLK) ? (count - i - 1) : i;
|
||||
ret = yellow_carp_get_dpm_freq_by_index(smu, clk_type, idx, &value);
|
||||
if (ret)
|
||||
goto print_clk_out;
|
||||
|
||||
|
||||
@@ -423,11 +423,12 @@ struct ast_private *ast_device_create(const struct drm_driver *drv,
|
||||
return ERR_PTR(-EIO);
|
||||
|
||||
/*
|
||||
* If we don't have IO space at all, use MMIO now and
|
||||
* assume the chip has MMIO enabled by default (rev 0x20
|
||||
* and higher).
|
||||
* After AST2500, MMIO is enabled by default, and it should be adopted
|
||||
* to be compatible with Arm.
|
||||
*/
|
||||
if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) {
|
||||
if (pdev->revision >= 0x40) {
|
||||
ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
|
||||
} else if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) {
|
||||
drm_info(dev, "platform has no IO space, trying MMIO\n");
|
||||
ast->ioregs = ast->regs + AST_IO_MM_OFFSET;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,12 @@ struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent)
|
||||
/* Get the pagetable configuration from the domain */
|
||||
if (adreno_smmu->cookie)
|
||||
ttbr1_cfg = adreno_smmu->get_ttbr1_cfg(adreno_smmu->cookie);
|
||||
if (!ttbr1_cfg)
|
||||
|
||||
/*
|
||||
* If you hit this WARN_ONCE() you are probably missing an entry in
|
||||
* qcom_smmu_impl_of_match[] in arm-smmu-qcom.c
|
||||
*/
|
||||
if (WARN_ONCE(!ttbr1_cfg, "No per-process page tables"))
|
||||
return ERR_PTR(-ENODEV);
|
||||
|
||||
/*
|
||||
|
||||
@@ -4,8 +4,6 @@ config DRM_RCAR_DU
|
||||
depends on DRM && OF
|
||||
depends on ARM || ARM64
|
||||
depends on ARCH_RENESAS || COMPILE_TEST
|
||||
imply DRM_RCAR_CMM
|
||||
imply DRM_RCAR_LVDS
|
||||
select DRM_KMS_HELPER
|
||||
select DRM_KMS_CMA_HELPER
|
||||
select DRM_GEM_CMA_HELPER
|
||||
@@ -14,13 +12,17 @@ config DRM_RCAR_DU
|
||||
Choose this option if you have an R-Car chipset.
|
||||
If M is selected the module will be called rcar-du-drm.
|
||||
|
||||
config DRM_RCAR_CMM
|
||||
tristate "R-Car DU Color Management Module (CMM) Support"
|
||||
depends on DRM && OF
|
||||
config DRM_RCAR_USE_CMM
|
||||
bool "R-Car DU Color Management Module (CMM) Support"
|
||||
depends on DRM_RCAR_DU
|
||||
default DRM_RCAR_DU
|
||||
help
|
||||
Enable support for R-Car Color Management Module (CMM).
|
||||
|
||||
config DRM_RCAR_CMM
|
||||
def_tristate DRM_RCAR_DU
|
||||
depends on DRM_RCAR_USE_CMM
|
||||
|
||||
config DRM_RCAR_DW_HDMI
|
||||
tristate "R-Car Gen3 and RZ/G2 DU HDMI Encoder Support"
|
||||
depends on DRM && OF
|
||||
@@ -28,15 +30,20 @@ config DRM_RCAR_DW_HDMI
|
||||
help
|
||||
Enable support for R-Car Gen3 or RZ/G2 internal HDMI encoder.
|
||||
|
||||
config DRM_RCAR_USE_LVDS
|
||||
bool "R-Car DU LVDS Encoder Support"
|
||||
depends on DRM_BRIDGE && OF
|
||||
default DRM_RCAR_DU
|
||||
help
|
||||
Enable support for the R-Car Display Unit embedded LVDS encoders.
|
||||
|
||||
config DRM_RCAR_LVDS
|
||||
tristate "R-Car DU LVDS Encoder Support"
|
||||
depends on DRM && DRM_BRIDGE && OF
|
||||
def_tristate DRM_RCAR_DU
|
||||
depends on DRM_RCAR_USE_LVDS
|
||||
select DRM_KMS_HELPER
|
||||
select DRM_PANEL
|
||||
select OF_FLATTREE
|
||||
select OF_OVERLAY
|
||||
help
|
||||
Enable support for the R-Car Display Unit embedded LVDS encoders.
|
||||
|
||||
config DRM_RCAR_VSP
|
||||
bool "R-Car DU VSP Compositor Support" if ARM
|
||||
|
||||
@@ -589,6 +589,8 @@ static const struct hid_device_id hammer_devices[] = {
|
||||
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_EEL) },
|
||||
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
|
||||
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) },
|
||||
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
|
||||
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_JEWEL) },
|
||||
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
|
||||
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_MAGNEMITE) },
|
||||
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
|
||||
|
||||
@@ -502,6 +502,7 @@
|
||||
#define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044
|
||||
#define USB_DEVICE_ID_GOOGLE_DON 0x5050
|
||||
#define USB_DEVICE_ID_GOOGLE_EEL 0x5057
|
||||
#define USB_DEVICE_ID_GOOGLE_JEWEL 0x5061
|
||||
|
||||
#define USB_VENDOR_ID_GOTOP 0x08f2
|
||||
#define USB_DEVICE_ID_SUPER_Q2 0x007f
|
||||
|
||||
@@ -831,7 +831,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
|
||||
/* Enter report */
|
||||
if ((data[1] & 0xfc) == 0xc0) {
|
||||
/* serial number of the tool */
|
||||
wacom->serial[idx] = ((data[3] & 0x0f) << 28) +
|
||||
wacom->serial[idx] = ((__u64)(data[3] & 0x0f) << 28) +
|
||||
(data[4] << 20) + (data[5] << 12) +
|
||||
(data[6] << 4) + (data[7] >> 4);
|
||||
|
||||
|
||||
@@ -1212,12 +1212,12 @@ static int apply_acpi_orientation(struct iio_dev *indio_dev)
|
||||
|
||||
adev = ACPI_COMPANION(adata->dev);
|
||||
if (!adev)
|
||||
return 0;
|
||||
return -ENXIO;
|
||||
|
||||
/* Read _ONT data, which should be a package of 6 integers. */
|
||||
status = acpi_evaluate_object(adev->handle, "_ONT", NULL, &buffer);
|
||||
if (status == AE_NOT_FOUND) {
|
||||
return 0;
|
||||
return -ENXIO;
|
||||
} else if (ACPI_FAILURE(status)) {
|
||||
dev_warn(&indio_dev->dev, "failed to execute _ONT: %d\n",
|
||||
status);
|
||||
|
||||
@@ -835,10 +835,6 @@ static const struct iio_info ad7195_info = {
|
||||
__AD719x_CHANNEL(_si, _channel1, -1, _address, NULL, IIO_VOLTAGE, \
|
||||
BIT(IIO_CHAN_INFO_SCALE), ad7192_calibsys_ext_info)
|
||||
|
||||
#define AD719x_SHORTED_CHANNEL(_si, _channel1, _address) \
|
||||
__AD719x_CHANNEL(_si, _channel1, -1, _address, "shorted", IIO_VOLTAGE, \
|
||||
BIT(IIO_CHAN_INFO_SCALE), ad7192_calibsys_ext_info)
|
||||
|
||||
#define AD719x_TEMP_CHANNEL(_si, _address) \
|
||||
__AD719x_CHANNEL(_si, 0, -1, _address, NULL, IIO_TEMP, 0, NULL)
|
||||
|
||||
@@ -846,7 +842,7 @@ static const struct iio_chan_spec ad7192_channels[] = {
|
||||
AD719x_DIFF_CHANNEL(0, 1, 2, AD7192_CH_AIN1P_AIN2M),
|
||||
AD719x_DIFF_CHANNEL(1, 3, 4, AD7192_CH_AIN3P_AIN4M),
|
||||
AD719x_TEMP_CHANNEL(2, AD7192_CH_TEMP),
|
||||
AD719x_SHORTED_CHANNEL(3, 2, AD7192_CH_AIN2P_AIN2M),
|
||||
AD719x_DIFF_CHANNEL(3, 2, 2, AD7192_CH_AIN2P_AIN2M),
|
||||
AD719x_CHANNEL(4, 1, AD7192_CH_AIN1),
|
||||
AD719x_CHANNEL(5, 2, AD7192_CH_AIN2),
|
||||
AD719x_CHANNEL(6, 3, AD7192_CH_AIN3),
|
||||
@@ -860,7 +856,7 @@ static const struct iio_chan_spec ad7193_channels[] = {
|
||||
AD719x_DIFF_CHANNEL(2, 5, 6, AD7193_CH_AIN5P_AIN6M),
|
||||
AD719x_DIFF_CHANNEL(3, 7, 8, AD7193_CH_AIN7P_AIN8M),
|
||||
AD719x_TEMP_CHANNEL(4, AD7193_CH_TEMP),
|
||||
AD719x_SHORTED_CHANNEL(5, 2, AD7193_CH_AIN2P_AIN2M),
|
||||
AD719x_DIFF_CHANNEL(5, 2, 2, AD7193_CH_AIN2P_AIN2M),
|
||||
AD719x_CHANNEL(6, 1, AD7193_CH_AIN1),
|
||||
AD719x_CHANNEL(7, 2, AD7193_CH_AIN2),
|
||||
AD719x_CHANNEL(8, 3, AD7193_CH_AIN3),
|
||||
|
||||
@@ -490,6 +490,10 @@ static int devm_ad_sd_probe_trigger(struct device *dev, struct iio_dev *indio_de
|
||||
init_completion(&sigma_delta->completion);
|
||||
|
||||
sigma_delta->irq_dis = true;
|
||||
|
||||
/* the IRQ core clears IRQ_DISABLE_UNLAZY flag when freeing an IRQ */
|
||||
irq_set_status_flags(sigma_delta->spi->irq, IRQ_DISABLE_UNLAZY);
|
||||
|
||||
ret = devm_request_irq(dev, sigma_delta->spi->irq,
|
||||
ad_sd_data_rdy_trig_poll,
|
||||
sigma_delta->info->irq_flags | IRQF_NO_AUTOEN,
|
||||
|
||||
@@ -757,13 +757,13 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
|
||||
|
||||
ret = mxs_lradc_adc_trigger_init(iio);
|
||||
if (ret)
|
||||
goto err_trig;
|
||||
return ret;
|
||||
|
||||
ret = iio_triggered_buffer_setup(iio, &iio_pollfunc_store_time,
|
||||
&mxs_lradc_adc_trigger_handler,
|
||||
&mxs_lradc_adc_buffer_ops);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_trig;
|
||||
|
||||
adc->vref_mv = mxs_lradc_adc_vref_mv[lradc->soc];
|
||||
|
||||
@@ -801,9 +801,9 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev)
|
||||
|
||||
err_dev:
|
||||
mxs_lradc_adc_hw_stop(adc);
|
||||
mxs_lradc_adc_trigger_remove(iio);
|
||||
err_trig:
|
||||
iio_triggered_buffer_cleanup(iio);
|
||||
err_trig:
|
||||
mxs_lradc_adc_trigger_remove(iio);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -814,8 +814,8 @@ static int mxs_lradc_adc_remove(struct platform_device *pdev)
|
||||
|
||||
iio_device_unregister(iio);
|
||||
mxs_lradc_adc_hw_stop(adc);
|
||||
mxs_lradc_adc_trigger_remove(iio);
|
||||
iio_triggered_buffer_cleanup(iio);
|
||||
mxs_lradc_adc_trigger_remove(iio);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ obj-$(CONFIG_AD5592R_BASE) += ad5592r-base.o
|
||||
obj-$(CONFIG_AD5592R) += ad5592r.o
|
||||
obj-$(CONFIG_AD5593R) += ad5593r.o
|
||||
obj-$(CONFIG_AD5755) += ad5755.o
|
||||
obj-$(CONFIG_AD5755) += ad5758.o
|
||||
obj-$(CONFIG_AD5758) += ad5758.o
|
||||
obj-$(CONFIG_AD5761) += ad5761.o
|
||||
obj-$(CONFIG_AD5764) += ad5764.o
|
||||
obj-$(CONFIG_AD5766) += ad5766.o
|
||||
|
||||
@@ -47,12 +47,18 @@ static int __maybe_unused mcp4725_suspend(struct device *dev)
|
||||
struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
|
||||
to_i2c_client(dev)));
|
||||
u8 outbuf[2];
|
||||
int ret;
|
||||
|
||||
outbuf[0] = (data->powerdown_mode + 1) << 4;
|
||||
outbuf[1] = 0;
|
||||
data->powerdown = true;
|
||||
|
||||
return i2c_master_send(data->client, outbuf, 2);
|
||||
ret = i2c_master_send(data->client, outbuf, 2);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
else if (ret != 2)
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused mcp4725_resume(struct device *dev)
|
||||
@@ -60,13 +66,19 @@ static int __maybe_unused mcp4725_resume(struct device *dev)
|
||||
struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
|
||||
to_i2c_client(dev)));
|
||||
u8 outbuf[2];
|
||||
int ret;
|
||||
|
||||
/* restore previous DAC value */
|
||||
outbuf[0] = (data->dac_value >> 8) & 0xf;
|
||||
outbuf[1] = data->dac_value & 0xff;
|
||||
data->powerdown = false;
|
||||
|
||||
return i2c_master_send(data->client, outbuf, 2);
|
||||
ret = i2c_master_send(data->client, outbuf, 2);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
else if (ret != 2)
|
||||
return -EIO;
|
||||
return 0;
|
||||
}
|
||||
static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume);
|
||||
|
||||
|
||||
@@ -275,9 +275,14 @@ static int inv_icm42600_buffer_preenable(struct iio_dev *indio_dev)
|
||||
{
|
||||
struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev);
|
||||
struct device *dev = regmap_get_device(st->map);
|
||||
struct inv_icm42600_timestamp *ts = iio_priv(indio_dev);
|
||||
|
||||
pm_runtime_get_sync(dev);
|
||||
|
||||
mutex_lock(&st->lock);
|
||||
inv_icm42600_timestamp_reset(ts);
|
||||
mutex_unlock(&st->lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -375,7 +380,6 @@ static int inv_icm42600_buffer_postdisable(struct iio_dev *indio_dev)
|
||||
struct device *dev = regmap_get_device(st->map);
|
||||
unsigned int sensor;
|
||||
unsigned int *watermark;
|
||||
struct inv_icm42600_timestamp *ts;
|
||||
struct inv_icm42600_sensor_conf conf = INV_ICM42600_SENSOR_CONF_INIT;
|
||||
unsigned int sleep_temp = 0;
|
||||
unsigned int sleep_sensor = 0;
|
||||
@@ -385,11 +389,9 @@ static int inv_icm42600_buffer_postdisable(struct iio_dev *indio_dev)
|
||||
if (indio_dev == st->indio_gyro) {
|
||||
sensor = INV_ICM42600_SENSOR_GYRO;
|
||||
watermark = &st->fifo.watermark.gyro;
|
||||
ts = iio_priv(st->indio_gyro);
|
||||
} else if (indio_dev == st->indio_accel) {
|
||||
sensor = INV_ICM42600_SENSOR_ACCEL;
|
||||
watermark = &st->fifo.watermark.accel;
|
||||
ts = iio_priv(st->indio_accel);
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -417,8 +419,6 @@ static int inv_icm42600_buffer_postdisable(struct iio_dev *indio_dev)
|
||||
if (!st->fifo.on)
|
||||
ret = inv_icm42600_set_temp_conf(st, false, &sleep_temp);
|
||||
|
||||
inv_icm42600_timestamp_reset(ts);
|
||||
|
||||
out_unlock:
|
||||
mutex_unlock(&st->lock);
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* TODO: Proximity
|
||||
*/
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
@@ -42,6 +43,7 @@
|
||||
#define VCNL4035_ALS_PERS_MASK GENMASK(3, 2)
|
||||
#define VCNL4035_INT_ALS_IF_H_MASK BIT(12)
|
||||
#define VCNL4035_INT_ALS_IF_L_MASK BIT(13)
|
||||
#define VCNL4035_DEV_ID_MASK GENMASK(7, 0)
|
||||
|
||||
/* Default values */
|
||||
#define VCNL4035_MODE_ALS_ENABLE BIT(0)
|
||||
@@ -413,6 +415,7 @@ static int vcnl4035_init(struct vcnl4035_data *data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
id = FIELD_GET(VCNL4035_DEV_ID_MASK, id);
|
||||
if (id != VCNL4035_DEV_ID_VAL) {
|
||||
dev_err(&data->client->dev, "Wrong id, got %x, expected %x\n",
|
||||
id, VCNL4035_DEV_ID_VAL);
|
||||
|
||||
@@ -3235,9 +3235,7 @@ static int bnxt_re_process_raw_qp_pkt_rx(struct bnxt_re_qp *gsi_qp,
|
||||
udwr.remote_qkey = gsi_sqp->qplib_qp.qkey;
|
||||
|
||||
/* post data received in the send queue */
|
||||
rc = bnxt_re_post_send_shadow_qp(rdev, gsi_sqp, swr);
|
||||
|
||||
return 0;
|
||||
return bnxt_re_post_send_shadow_qp(rdev, gsi_sqp, swr);
|
||||
}
|
||||
|
||||
static void bnxt_re_process_res_rawqp1_wc(struct ib_wc *wc,
|
||||
|
||||
@@ -2041,6 +2041,12 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)
|
||||
u32 pg_sz_lvl;
|
||||
int rc;
|
||||
|
||||
if (!cq->dpi) {
|
||||
dev_err(&rcfw->pdev->dev,
|
||||
"FP: CREATE_CQ failed due to NULL DPI\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hwq_attr.res = res;
|
||||
hwq_attr.depth = cq->max_wqe;
|
||||
hwq_attr.stride = sizeof(struct cq_base);
|
||||
@@ -2052,11 +2058,6 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)
|
||||
|
||||
RCFW_CMD_PREP(req, CREATE_CQ, cmd_flags);
|
||||
|
||||
if (!cq->dpi) {
|
||||
dev_err(&rcfw->pdev->dev,
|
||||
"FP: CREATE_CQ failed due to NULL DPI\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
req.dpi = cpu_to_le32(cq->dpi->dpi);
|
||||
req.cq_handle = cpu_to_le64(cq->cq_handle);
|
||||
req.cq_size = cpu_to_le32(cq->hwq.max_elements);
|
||||
|
||||
@@ -215,17 +215,9 @@ int bnxt_qplib_alloc_init_hwq(struct bnxt_qplib_hwq *hwq,
|
||||
return -EINVAL;
|
||||
hwq_attr->sginfo->npages = npages;
|
||||
} else {
|
||||
unsigned long sginfo_num_pages = ib_umem_num_dma_blocks(
|
||||
hwq_attr->sginfo->umem, hwq_attr->sginfo->pgsize);
|
||||
|
||||
npages = ib_umem_num_dma_blocks(hwq_attr->sginfo->umem,
|
||||
hwq_attr->sginfo->pgsize);
|
||||
hwq->is_user = true;
|
||||
npages = sginfo_num_pages;
|
||||
npages = (npages * PAGE_SIZE) /
|
||||
BIT_ULL(hwq_attr->sginfo->pgshft);
|
||||
if ((sginfo_num_pages * PAGE_SIZE) %
|
||||
BIT_ULL(hwq_attr->sginfo->pgshft))
|
||||
if (!npages)
|
||||
npages++;
|
||||
}
|
||||
|
||||
if (npages == MAX_PBL_LVL_0_PGS) {
|
||||
|
||||
@@ -680,16 +680,15 @@ int bnxt_qplib_reg_mr(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr,
|
||||
/* Free the hwq if it already exist, must be a rereg */
|
||||
if (mr->hwq.max_elements)
|
||||
bnxt_qplib_free_hwq(res, &mr->hwq);
|
||||
/* Use system PAGE_SIZE */
|
||||
hwq_attr.res = res;
|
||||
hwq_attr.depth = pages;
|
||||
hwq_attr.stride = buf_pg_size;
|
||||
hwq_attr.stride = sizeof(dma_addr_t);
|
||||
hwq_attr.type = HWQ_TYPE_MR;
|
||||
hwq_attr.sginfo = &sginfo;
|
||||
hwq_attr.sginfo->umem = umem;
|
||||
hwq_attr.sginfo->npages = pages;
|
||||
hwq_attr.sginfo->pgsize = PAGE_SIZE;
|
||||
hwq_attr.sginfo->pgshft = PAGE_SHIFT;
|
||||
hwq_attr.sginfo->pgsize = buf_pg_size;
|
||||
hwq_attr.sginfo->pgshft = ilog2(buf_pg_size);
|
||||
rc = bnxt_qplib_alloc_init_hwq(&mr->hwq, &hwq_attr);
|
||||
if (rc) {
|
||||
dev_err(&res->pdev->dev,
|
||||
|
||||
@@ -1334,7 +1334,7 @@ static int pbl_continuous_initialize(struct efa_dev *dev,
|
||||
*/
|
||||
static int pbl_indirect_initialize(struct efa_dev *dev, struct pbl_context *pbl)
|
||||
{
|
||||
u32 size_in_pages = DIV_ROUND_UP(pbl->pbl_buf_size_in_bytes, PAGE_SIZE);
|
||||
u32 size_in_pages = DIV_ROUND_UP(pbl->pbl_buf_size_in_bytes, EFA_CHUNK_PAYLOAD_SIZE);
|
||||
struct scatterlist *sgl;
|
||||
int sg_dma_cnt, err;
|
||||
|
||||
|
||||
@@ -4393,11 +4393,9 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp,
|
||||
mtu = ib_mtu_enum_to_int(ib_mtu);
|
||||
if (WARN_ON(mtu <= 0))
|
||||
return -EINVAL;
|
||||
#define MAX_LP_MSG_LEN 16384
|
||||
/* MTU * (2 ^ LP_PKTN_INI) shouldn't be bigger than 16KB */
|
||||
lp_pktn_ini = ilog2(MAX_LP_MSG_LEN / mtu);
|
||||
if (WARN_ON(lp_pktn_ini >= 0xF))
|
||||
return -EINVAL;
|
||||
#define MIN_LP_MSG_LEN 1024
|
||||
/* mtu * (2 ^ lp_pktn_ini) should be in the range of 1024 to mtu */
|
||||
lp_pktn_ini = ilog2(max(mtu, MIN_LP_MSG_LEN) / mtu);
|
||||
|
||||
if (attr_mask & IB_QP_PATH_MTU) {
|
||||
hr_reg_write(context, QPC_MTU, ib_mtu);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <rdma/ib_umem.h>
|
||||
#include <linux/math.h>
|
||||
#include "hns_roce_device.h"
|
||||
#include "hns_roce_cmd.h"
|
||||
#include "hns_roce_hem.h"
|
||||
@@ -938,6 +939,44 @@ static int mtr_init_buf_cfg(struct hns_roce_dev *hr_dev,
|
||||
return page_cnt;
|
||||
}
|
||||
|
||||
static u64 cal_pages_per_l1ba(unsigned int ba_per_bt, unsigned int hopnum)
|
||||
{
|
||||
return int_pow(ba_per_bt, hopnum - 1);
|
||||
}
|
||||
|
||||
static unsigned int cal_best_bt_pg_sz(struct hns_roce_dev *hr_dev,
|
||||
struct hns_roce_mtr *mtr,
|
||||
unsigned int pg_shift)
|
||||
{
|
||||
unsigned long cap = hr_dev->caps.page_size_cap;
|
||||
struct hns_roce_buf_region *re;
|
||||
unsigned int pgs_per_l1ba;
|
||||
unsigned int ba_per_bt;
|
||||
unsigned int ba_num;
|
||||
int i;
|
||||
|
||||
for_each_set_bit_from(pg_shift, &cap, sizeof(cap) * BITS_PER_BYTE) {
|
||||
if (!(BIT(pg_shift) & cap))
|
||||
continue;
|
||||
|
||||
ba_per_bt = BIT(pg_shift) / BA_BYTE_LEN;
|
||||
ba_num = 0;
|
||||
for (i = 0; i < mtr->hem_cfg.region_count; i++) {
|
||||
re = &mtr->hem_cfg.region[i];
|
||||
if (re->hopnum == 0)
|
||||
continue;
|
||||
|
||||
pgs_per_l1ba = cal_pages_per_l1ba(ba_per_bt, re->hopnum);
|
||||
ba_num += DIV_ROUND_UP(re->count, pgs_per_l1ba);
|
||||
}
|
||||
|
||||
if (ba_num <= ba_per_bt)
|
||||
return pg_shift;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mtr_alloc_mtt(struct hns_roce_dev *hr_dev, struct hns_roce_mtr *mtr,
|
||||
unsigned int ba_page_shift)
|
||||
{
|
||||
@@ -946,6 +985,10 @@ static int mtr_alloc_mtt(struct hns_roce_dev *hr_dev, struct hns_roce_mtr *mtr,
|
||||
|
||||
hns_roce_hem_list_init(&mtr->hem_list);
|
||||
if (!cfg->is_direct) {
|
||||
ba_page_shift = cal_best_bt_pg_sz(hr_dev, mtr, ba_page_shift);
|
||||
if (!ba_page_shift)
|
||||
return -ERANGE;
|
||||
|
||||
ret = hns_roce_hem_list_request(hr_dev, &mtr->hem_list,
|
||||
cfg->region, cfg->region_count,
|
||||
ba_page_shift);
|
||||
|
||||
@@ -62,7 +62,7 @@ static void irdma_iwarp_ce_handler(struct irdma_sc_cq *iwcq)
|
||||
struct irdma_cq *cq = iwcq->back_cq;
|
||||
|
||||
if (!cq->user_mode)
|
||||
cq->armed = false;
|
||||
atomic_set(&cq->armed, 0);
|
||||
if (cq->ibcq.comp_handler)
|
||||
cq->ibcq.comp_handler(&cq->ibcq, cq->ibcq.cq_context);
|
||||
}
|
||||
@@ -2711,24 +2711,29 @@ void irdma_flush_wqes(struct irdma_qp *iwqp, u32 flush_mask)
|
||||
info.sq = flush_mask & IRDMA_FLUSH_SQ;
|
||||
info.rq = flush_mask & IRDMA_FLUSH_RQ;
|
||||
|
||||
if (flush_mask & IRDMA_REFLUSH) {
|
||||
if (info.sq)
|
||||
iwqp->sc_qp.flush_sq = false;
|
||||
if (info.rq)
|
||||
iwqp->sc_qp.flush_rq = false;
|
||||
}
|
||||
|
||||
/* Generate userflush errors in CQE */
|
||||
info.sq_major_code = IRDMA_FLUSH_MAJOR_ERR;
|
||||
info.sq_minor_code = FLUSH_GENERAL_ERR;
|
||||
info.rq_major_code = IRDMA_FLUSH_MAJOR_ERR;
|
||||
info.rq_minor_code = FLUSH_GENERAL_ERR;
|
||||
info.userflushcode = true;
|
||||
if (flush_code) {
|
||||
if (info.sq && iwqp->sc_qp.sq_flush_code)
|
||||
info.sq_minor_code = flush_code;
|
||||
if (info.rq && iwqp->sc_qp.rq_flush_code)
|
||||
info.rq_minor_code = flush_code;
|
||||
|
||||
if (flush_mask & IRDMA_REFLUSH) {
|
||||
if (info.sq)
|
||||
iwqp->sc_qp.flush_sq = false;
|
||||
if (info.rq)
|
||||
iwqp->sc_qp.flush_rq = false;
|
||||
} else {
|
||||
if (flush_code) {
|
||||
if (info.sq && iwqp->sc_qp.sq_flush_code)
|
||||
info.sq_minor_code = flush_code;
|
||||
if (info.rq && iwqp->sc_qp.rq_flush_code)
|
||||
info.rq_minor_code = flush_code;
|
||||
}
|
||||
if (!iwqp->user_mode)
|
||||
queue_delayed_work(iwqp->iwdev->cleanup_wq,
|
||||
&iwqp->dwork_flush,
|
||||
msecs_to_jiffies(IRDMA_FLUSH_DELAY_MS));
|
||||
}
|
||||
|
||||
/* Issue flush */
|
||||
|
||||
@@ -2558,3 +2558,153 @@ bool irdma_cq_empty(struct irdma_cq *iwcq)
|
||||
|
||||
return polarity != ukcq->polarity;
|
||||
}
|
||||
|
||||
void irdma_remove_cmpls_list(struct irdma_cq *iwcq)
|
||||
{
|
||||
struct irdma_cmpl_gen *cmpl_node;
|
||||
struct list_head *tmp_node, *list_node;
|
||||
|
||||
list_for_each_safe (list_node, tmp_node, &iwcq->cmpl_generated) {
|
||||
cmpl_node = list_entry(list_node, struct irdma_cmpl_gen, list);
|
||||
list_del(&cmpl_node->list);
|
||||
kfree(cmpl_node);
|
||||
}
|
||||
}
|
||||
|
||||
int irdma_generated_cmpls(struct irdma_cq *iwcq, struct irdma_cq_poll_info *cq_poll_info)
|
||||
{
|
||||
struct irdma_cmpl_gen *cmpl;
|
||||
|
||||
if (list_empty(&iwcq->cmpl_generated))
|
||||
return -ENOENT;
|
||||
cmpl = list_first_entry_or_null(&iwcq->cmpl_generated, struct irdma_cmpl_gen, list);
|
||||
list_del(&cmpl->list);
|
||||
memcpy(cq_poll_info, &cmpl->cpi, sizeof(*cq_poll_info));
|
||||
kfree(cmpl);
|
||||
|
||||
ibdev_dbg(iwcq->ibcq.device,
|
||||
"VERBS: %s: Poll artificially generated completion for QP 0x%X, op %u, wr_id=0x%llx\n",
|
||||
__func__, cq_poll_info->qp_id, cq_poll_info->op_type,
|
||||
cq_poll_info->wr_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* irdma_set_cpi_common_values - fill in values for polling info struct
|
||||
* @cpi: resulting structure of cq_poll_info type
|
||||
* @qp: QPair
|
||||
* @qp_num: id of the QP
|
||||
*/
|
||||
static void irdma_set_cpi_common_values(struct irdma_cq_poll_info *cpi,
|
||||
struct irdma_qp_uk *qp, u32 qp_num)
|
||||
{
|
||||
cpi->comp_status = IRDMA_COMPL_STATUS_FLUSHED;
|
||||
cpi->error = true;
|
||||
cpi->major_err = IRDMA_FLUSH_MAJOR_ERR;
|
||||
cpi->minor_err = FLUSH_GENERAL_ERR;
|
||||
cpi->qp_handle = (irdma_qp_handle)(uintptr_t)qp;
|
||||
cpi->qp_id = qp_num;
|
||||
}
|
||||
|
||||
static inline void irdma_comp_handler(struct irdma_cq *cq)
|
||||
{
|
||||
if (!cq->ibcq.comp_handler)
|
||||
return;
|
||||
if (atomic_cmpxchg(&cq->armed, 1, 0))
|
||||
cq->ibcq.comp_handler(&cq->ibcq, cq->ibcq.cq_context);
|
||||
}
|
||||
|
||||
void irdma_generate_flush_completions(struct irdma_qp *iwqp)
|
||||
{
|
||||
struct irdma_qp_uk *qp = &iwqp->sc_qp.qp_uk;
|
||||
struct irdma_ring *sq_ring = &qp->sq_ring;
|
||||
struct irdma_ring *rq_ring = &qp->rq_ring;
|
||||
struct irdma_cmpl_gen *cmpl;
|
||||
__le64 *sw_wqe;
|
||||
u64 wqe_qword;
|
||||
u32 wqe_idx;
|
||||
bool compl_generated = false;
|
||||
unsigned long flags1;
|
||||
|
||||
spin_lock_irqsave(&iwqp->iwscq->lock, flags1);
|
||||
if (irdma_cq_empty(iwqp->iwscq)) {
|
||||
unsigned long flags2;
|
||||
|
||||
spin_lock_irqsave(&iwqp->lock, flags2);
|
||||
while (IRDMA_RING_MORE_WORK(*sq_ring)) {
|
||||
cmpl = kzalloc(sizeof(*cmpl), GFP_ATOMIC);
|
||||
if (!cmpl) {
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags2);
|
||||
spin_unlock_irqrestore(&iwqp->iwscq->lock, flags1);
|
||||
return;
|
||||
}
|
||||
|
||||
wqe_idx = sq_ring->tail;
|
||||
irdma_set_cpi_common_values(&cmpl->cpi, qp, qp->qp_id);
|
||||
|
||||
cmpl->cpi.wr_id = qp->sq_wrtrk_array[wqe_idx].wrid;
|
||||
sw_wqe = qp->sq_base[wqe_idx].elem;
|
||||
get_64bit_val(sw_wqe, 24, &wqe_qword);
|
||||
cmpl->cpi.op_type = (u8)FIELD_GET(IRDMAQPSQ_OPCODE, IRDMAQPSQ_OPCODE);
|
||||
/* remove the SQ WR by moving SQ tail*/
|
||||
IRDMA_RING_SET_TAIL(*sq_ring,
|
||||
sq_ring->tail + qp->sq_wrtrk_array[sq_ring->tail].quanta);
|
||||
if (cmpl->cpi.op_type == IRDMAQP_OP_NOP) {
|
||||
kfree(cmpl);
|
||||
continue;
|
||||
}
|
||||
ibdev_dbg(iwqp->iwscq->ibcq.device,
|
||||
"DEV: %s: adding wr_id = 0x%llx SQ Completion to list qp_id=%d\n",
|
||||
__func__, cmpl->cpi.wr_id, qp->qp_id);
|
||||
list_add_tail(&cmpl->list, &iwqp->iwscq->cmpl_generated);
|
||||
compl_generated = true;
|
||||
}
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags2);
|
||||
spin_unlock_irqrestore(&iwqp->iwscq->lock, flags1);
|
||||
if (compl_generated)
|
||||
irdma_comp_handler(iwqp->iwscq);
|
||||
} else {
|
||||
spin_unlock_irqrestore(&iwqp->iwscq->lock, flags1);
|
||||
mod_delayed_work(iwqp->iwdev->cleanup_wq, &iwqp->dwork_flush,
|
||||
msecs_to_jiffies(IRDMA_FLUSH_DELAY_MS));
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&iwqp->iwrcq->lock, flags1);
|
||||
if (irdma_cq_empty(iwqp->iwrcq)) {
|
||||
unsigned long flags2;
|
||||
|
||||
spin_lock_irqsave(&iwqp->lock, flags2);
|
||||
while (IRDMA_RING_MORE_WORK(*rq_ring)) {
|
||||
cmpl = kzalloc(sizeof(*cmpl), GFP_ATOMIC);
|
||||
if (!cmpl) {
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags2);
|
||||
spin_unlock_irqrestore(&iwqp->iwrcq->lock, flags1);
|
||||
return;
|
||||
}
|
||||
|
||||
wqe_idx = rq_ring->tail;
|
||||
irdma_set_cpi_common_values(&cmpl->cpi, qp, qp->qp_id);
|
||||
|
||||
cmpl->cpi.wr_id = qp->rq_wrid_array[wqe_idx];
|
||||
cmpl->cpi.op_type = IRDMA_OP_TYPE_REC;
|
||||
/* remove the RQ WR by moving RQ tail */
|
||||
IRDMA_RING_SET_TAIL(*rq_ring, rq_ring->tail + 1);
|
||||
ibdev_dbg(iwqp->iwrcq->ibcq.device,
|
||||
"DEV: %s: adding wr_id = 0x%llx RQ Completion to list qp_id=%d, wqe_idx=%d\n",
|
||||
__func__, cmpl->cpi.wr_id, qp->qp_id,
|
||||
wqe_idx);
|
||||
list_add_tail(&cmpl->list, &iwqp->iwrcq->cmpl_generated);
|
||||
|
||||
compl_generated = true;
|
||||
}
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags2);
|
||||
spin_unlock_irqrestore(&iwqp->iwrcq->lock, flags1);
|
||||
if (compl_generated)
|
||||
irdma_comp_handler(iwqp->iwrcq);
|
||||
} else {
|
||||
spin_unlock_irqrestore(&iwqp->iwrcq->lock, flags1);
|
||||
mod_delayed_work(iwqp->iwdev->cleanup_wq, &iwqp->dwork_flush,
|
||||
msecs_to_jiffies(IRDMA_FLUSH_DELAY_MS));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,10 +506,8 @@ static int irdma_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata)
|
||||
if (iwqp->iwarp_state == IRDMA_QP_STATE_RTS)
|
||||
irdma_modify_qp_to_err(&iwqp->sc_qp);
|
||||
|
||||
irdma_qp_rem_ref(&iwqp->ibqp);
|
||||
wait_for_completion(&iwqp->free_qp);
|
||||
irdma_free_lsmm_rsrc(iwqp);
|
||||
irdma_cqp_qp_destroy_cmd(&iwdev->rf->sc_dev, &iwqp->sc_qp);
|
||||
if (!iwqp->user_mode)
|
||||
cancel_delayed_work_sync(&iwqp->dwork_flush);
|
||||
|
||||
if (!iwqp->user_mode) {
|
||||
if (iwqp->iwscq) {
|
||||
@@ -518,6 +516,12 @@ static int irdma_destroy_qp(struct ib_qp *ibqp, struct ib_udata *udata)
|
||||
irdma_clean_cqes(iwqp, iwqp->iwrcq);
|
||||
}
|
||||
}
|
||||
|
||||
irdma_qp_rem_ref(&iwqp->ibqp);
|
||||
wait_for_completion(&iwqp->free_qp);
|
||||
irdma_free_lsmm_rsrc(iwqp);
|
||||
irdma_cqp_qp_destroy_cmd(&iwdev->rf->sc_dev, &iwqp->sc_qp);
|
||||
|
||||
irdma_remove_push_mmap_entries(iwqp);
|
||||
irdma_free_qp_rsrc(iwqp);
|
||||
|
||||
@@ -761,6 +765,14 @@ static int irdma_validate_qp_attrs(struct ib_qp_init_attr *init_attr,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void irdma_flush_worker(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *dwork = to_delayed_work(work);
|
||||
struct irdma_qp *iwqp = container_of(dwork, struct irdma_qp, dwork_flush);
|
||||
|
||||
irdma_generate_flush_completions(iwqp);
|
||||
}
|
||||
|
||||
/**
|
||||
* irdma_create_qp - create qp
|
||||
* @ibqp: ptr of qp
|
||||
@@ -882,6 +894,7 @@ static int irdma_create_qp(struct ib_qp *ibqp,
|
||||
init_info.qp_uk_init_info.abi_ver = iwpd->sc_pd.abi_ver;
|
||||
irdma_setup_virt_qp(iwdev, iwqp, &init_info);
|
||||
} else {
|
||||
INIT_DELAYED_WORK(&iwqp->dwork_flush, irdma_flush_worker);
|
||||
init_info.qp_uk_init_info.abi_ver = IRDMA_ABI_VER;
|
||||
err_code = irdma_setup_kmode_qp(iwdev, iwqp, &init_info, init_attr);
|
||||
}
|
||||
@@ -1371,11 +1384,11 @@ int irdma_modify_qp_roce(struct ib_qp *ibqp, struct ib_qp_attr *attr,
|
||||
}
|
||||
if (iwqp->ibqp_state > IB_QPS_RTS &&
|
||||
!iwqp->flush_issued) {
|
||||
iwqp->flush_issued = 1;
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
irdma_flush_wqes(iwqp, IRDMA_FLUSH_SQ |
|
||||
IRDMA_FLUSH_RQ |
|
||||
IRDMA_FLUSH_WAIT);
|
||||
iwqp->flush_issued = 1;
|
||||
} else {
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
}
|
||||
@@ -1728,6 +1741,8 @@ static int irdma_destroy_cq(struct ib_cq *ib_cq, struct ib_udata *udata)
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&iwcq->lock, flags);
|
||||
if (!list_empty(&iwcq->cmpl_generated))
|
||||
irdma_remove_cmpls_list(iwcq);
|
||||
if (!list_empty(&iwcq->resize_list))
|
||||
irdma_process_resize_list(iwcq, iwdev, NULL);
|
||||
spin_unlock_irqrestore(&iwcq->lock, flags);
|
||||
@@ -1936,6 +1951,7 @@ static int irdma_create_cq(struct ib_cq *ibcq,
|
||||
cq->back_cq = iwcq;
|
||||
spin_lock_init(&iwcq->lock);
|
||||
INIT_LIST_HEAD(&iwcq->resize_list);
|
||||
INIT_LIST_HEAD(&iwcq->cmpl_generated);
|
||||
info.dev = dev;
|
||||
ukinfo->cq_size = max(entries, 4);
|
||||
ukinfo->cq_id = cq_num;
|
||||
@@ -3046,15 +3062,12 @@ static int irdma_post_send(struct ib_qp *ibqp,
|
||||
unsigned long flags;
|
||||
bool inv_stag;
|
||||
struct irdma_ah *ah;
|
||||
bool reflush = false;
|
||||
|
||||
iwqp = to_iwqp(ibqp);
|
||||
ukqp = &iwqp->sc_qp.qp_uk;
|
||||
dev = &iwqp->iwdev->rf->sc_dev;
|
||||
|
||||
spin_lock_irqsave(&iwqp->lock, flags);
|
||||
if (iwqp->flush_issued && ukqp->sq_flush_complete)
|
||||
reflush = true;
|
||||
while (ib_wr) {
|
||||
memset(&info, 0, sizeof(info));
|
||||
inv_stag = false;
|
||||
@@ -3183,6 +3196,7 @@ static int irdma_post_send(struct ib_qp *ibqp,
|
||||
break;
|
||||
case IB_WR_LOCAL_INV:
|
||||
info.op_type = IRDMA_OP_TYPE_INV_STAG;
|
||||
info.local_fence = info.read_fence;
|
||||
info.op.inv_local_stag.target_stag = ib_wr->ex.invalidate_rkey;
|
||||
ret = irdma_uk_stag_local_invalidate(ukqp, &info, true);
|
||||
if (ret)
|
||||
@@ -3227,15 +3241,14 @@ static int irdma_post_send(struct ib_qp *ibqp,
|
||||
ib_wr = ib_wr->next;
|
||||
}
|
||||
|
||||
if (!iwqp->flush_issued && iwqp->hw_iwarp_state <= IRDMA_QP_STATE_RTS) {
|
||||
irdma_uk_qp_post_wr(ukqp);
|
||||
if (!iwqp->flush_issued) {
|
||||
if (iwqp->hw_iwarp_state <= IRDMA_QP_STATE_RTS)
|
||||
irdma_uk_qp_post_wr(ukqp);
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
} else if (reflush) {
|
||||
ukqp->sq_flush_complete = false;
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
irdma_flush_wqes(iwqp, IRDMA_FLUSH_SQ | IRDMA_REFLUSH);
|
||||
} else {
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
mod_delayed_work(iwqp->iwdev->cleanup_wq, &iwqp->dwork_flush,
|
||||
msecs_to_jiffies(IRDMA_FLUSH_DELAY_MS));
|
||||
}
|
||||
if (err)
|
||||
*bad_wr = ib_wr;
|
||||
@@ -3260,14 +3273,11 @@ static int irdma_post_recv(struct ib_qp *ibqp,
|
||||
enum irdma_status_code ret = 0;
|
||||
unsigned long flags;
|
||||
int err = 0;
|
||||
bool reflush = false;
|
||||
|
||||
iwqp = to_iwqp(ibqp);
|
||||
ukqp = &iwqp->sc_qp.qp_uk;
|
||||
|
||||
spin_lock_irqsave(&iwqp->lock, flags);
|
||||
if (iwqp->flush_issued && ukqp->rq_flush_complete)
|
||||
reflush = true;
|
||||
while (ib_wr) {
|
||||
post_recv.num_sges = ib_wr->num_sge;
|
||||
post_recv.wr_id = ib_wr->wr_id;
|
||||
@@ -3288,13 +3298,10 @@ static int irdma_post_recv(struct ib_qp *ibqp,
|
||||
}
|
||||
|
||||
out:
|
||||
if (reflush) {
|
||||
ukqp->rq_flush_complete = false;
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
irdma_flush_wqes(iwqp, IRDMA_FLUSH_RQ | IRDMA_REFLUSH);
|
||||
} else {
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
}
|
||||
spin_unlock_irqrestore(&iwqp->lock, flags);
|
||||
if (iwqp->flush_issued)
|
||||
mod_delayed_work(iwqp->iwdev->cleanup_wq, &iwqp->dwork_flush,
|
||||
msecs_to_jiffies(IRDMA_FLUSH_DELAY_MS));
|
||||
|
||||
if (err)
|
||||
*bad_wr = ib_wr;
|
||||
@@ -3508,6 +3515,11 @@ static int __irdma_poll_cq(struct irdma_cq *iwcq, int num_entries, struct ib_wc
|
||||
/* check the current CQ for new cqes */
|
||||
while (npolled < num_entries) {
|
||||
ret = irdma_poll_one(ukcq, cur_cqe, entry + npolled);
|
||||
if (ret == -ENOENT) {
|
||||
ret = irdma_generated_cmpls(iwcq, cur_cqe);
|
||||
if (!ret)
|
||||
irdma_process_cqe(entry + npolled, cur_cqe);
|
||||
}
|
||||
if (!ret) {
|
||||
++npolled;
|
||||
cq_new_cqe = true;
|
||||
@@ -3589,13 +3601,13 @@ static int irdma_req_notify_cq(struct ib_cq *ibcq,
|
||||
if (iwcq->last_notify == IRDMA_CQ_COMPL_SOLICITED && notify_flags != IB_CQ_SOLICITED)
|
||||
promo_event = true;
|
||||
|
||||
if (!iwcq->armed || promo_event) {
|
||||
iwcq->armed = true;
|
||||
if (!atomic_cmpxchg(&iwcq->armed, 0, 1) || promo_event) {
|
||||
iwcq->last_notify = cq_notify;
|
||||
irdma_uk_cq_request_notification(ukcq, cq_notify);
|
||||
}
|
||||
|
||||
if ((notify_flags & IB_CQ_REPORT_MISSED_EVENTS) && !irdma_cq_empty(iwcq))
|
||||
if ((notify_flags & IB_CQ_REPORT_MISSED_EVENTS) &&
|
||||
(!irdma_cq_empty(iwcq) || !list_empty(&iwcq->cmpl_generated)))
|
||||
ret = 1;
|
||||
spin_unlock_irqrestore(&iwcq->lock, flags);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#define IRDMA_VERBS_H
|
||||
|
||||
#define IRDMA_MAX_SAVED_PHY_PGADDR 4
|
||||
#define IRDMA_FLUSH_DELAY_MS 20
|
||||
|
||||
#define IRDMA_PKEY_TBL_SZ 1
|
||||
#define IRDMA_DEFAULT_PKEY 0xFFFF
|
||||
@@ -110,7 +111,7 @@ struct irdma_cq {
|
||||
u16 cq_size;
|
||||
u16 cq_num;
|
||||
bool user_mode;
|
||||
bool armed;
|
||||
atomic_t armed;
|
||||
enum irdma_cmpl_notify last_notify;
|
||||
u32 polled_cmpls;
|
||||
u32 cq_mem_size;
|
||||
@@ -121,6 +122,12 @@ struct irdma_cq {
|
||||
struct irdma_pbl *iwpbl_shadow;
|
||||
struct list_head resize_list;
|
||||
struct irdma_cq_poll_info cur_cqe;
|
||||
struct list_head cmpl_generated;
|
||||
};
|
||||
|
||||
struct irdma_cmpl_gen {
|
||||
struct list_head list;
|
||||
struct irdma_cq_poll_info cpi;
|
||||
};
|
||||
|
||||
struct disconn_work {
|
||||
@@ -161,6 +168,7 @@ struct irdma_qp {
|
||||
refcount_t refcnt;
|
||||
struct iw_cm_id *cm_id;
|
||||
struct irdma_cm_node *cm_node;
|
||||
struct delayed_work dwork_flush;
|
||||
struct ib_mr *lsmm_mr;
|
||||
atomic_t hw_mod_qp_pend;
|
||||
enum ib_qp_state ibqp_state;
|
||||
@@ -224,4 +232,7 @@ int irdma_ib_register_device(struct irdma_device *iwdev);
|
||||
void irdma_ib_unregister_device(struct irdma_device *iwdev);
|
||||
void irdma_ib_dealloc_device(struct ib_device *ibdev);
|
||||
void irdma_ib_qp_event(struct irdma_qp *iwqp, enum irdma_qp_event_type event);
|
||||
void irdma_generate_flush_completions(struct irdma_qp *iwqp);
|
||||
void irdma_remove_cmpls_list(struct irdma_cq *iwcq);
|
||||
int irdma_generated_cmpls(struct irdma_cq *iwcq, struct irdma_cq_poll_info *cq_poll_info);
|
||||
#endif /* IRDMA_VERBS_H */
|
||||
|
||||
@@ -2222,7 +2222,7 @@ static void amd_iommu_iotlb_sync(struct iommu_domain *domain,
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&dom->lock, flags);
|
||||
domain_flush_pages(dom, gather->start, gather->end - gather->start, 1);
|
||||
domain_flush_pages(dom, gather->start, gather->end - gather->start + 1, 1);
|
||||
amd_iommu_domain_flush_complete(dom);
|
||||
spin_unlock_irqrestore(&dom->lock, flags);
|
||||
}
|
||||
@@ -3316,8 +3316,7 @@ int amd_iommu_activate_guest_mode(void *data)
|
||||
struct irte_ga *entry = (struct irte_ga *) ir_data->entry;
|
||||
u64 valid;
|
||||
|
||||
if (!AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) ||
|
||||
!entry || entry->lo.fields_vapic.guest_mode)
|
||||
if (!AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) || !entry)
|
||||
return 0;
|
||||
|
||||
valid = entry->lo.fields_vapic.valid;
|
||||
|
||||
@@ -1303,20 +1303,22 @@ static int rk_iommu_probe(struct platform_device *pdev)
|
||||
for (i = 0; i < iommu->num_irq; i++) {
|
||||
int irq = platform_get_irq(pdev, i);
|
||||
|
||||
if (irq < 0)
|
||||
return irq;
|
||||
if (irq < 0) {
|
||||
err = irq;
|
||||
goto err_pm_disable;
|
||||
}
|
||||
|
||||
err = devm_request_irq(iommu->dev, irq, rk_iommu_irq,
|
||||
IRQF_SHARED, dev_name(dev), iommu);
|
||||
if (err) {
|
||||
pm_runtime_disable(dev);
|
||||
goto err_remove_sysfs;
|
||||
}
|
||||
if (err)
|
||||
goto err_pm_disable;
|
||||
}
|
||||
|
||||
dma_set_mask_and_coherent(dev, rk_ops->dma_bit_mask);
|
||||
|
||||
return 0;
|
||||
err_pm_disable:
|
||||
pm_runtime_disable(dev);
|
||||
err_remove_sysfs:
|
||||
iommu_device_sysfs_remove(&iommu->iommu);
|
||||
err_put_group:
|
||||
|
||||
@@ -5408,7 +5408,7 @@ static int raid5_read_one_chunk(struct mddev *mddev, struct bio *raid_bio)
|
||||
|
||||
sector = raid5_compute_sector(conf, raid_bio->bi_iter.bi_sector, 0,
|
||||
&dd_idx, NULL);
|
||||
end_sector = bio_end_sector(raid_bio);
|
||||
end_sector = sector + bio_sectors(raid_bio);
|
||||
|
||||
rcu_read_lock();
|
||||
if (r5c_big_stripe_cached(conf, sector))
|
||||
|
||||
@@ -151,6 +151,12 @@ struct dvb_ca_private {
|
||||
|
||||
/* mutex serializing ioctls */
|
||||
struct mutex ioctl_mutex;
|
||||
|
||||
/* A mutex used when a device is disconnected */
|
||||
struct mutex remove_mutex;
|
||||
|
||||
/* Whether the device is disconnected */
|
||||
int exit;
|
||||
};
|
||||
|
||||
static void dvb_ca_private_free(struct dvb_ca_private *ca)
|
||||
@@ -187,7 +193,7 @@ static void dvb_ca_en50221_thread_wakeup(struct dvb_ca_private *ca);
|
||||
static int dvb_ca_en50221_read_data(struct dvb_ca_private *ca, int slot,
|
||||
u8 *ebuf, int ecount);
|
||||
static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,
|
||||
u8 *ebuf, int ecount);
|
||||
u8 *ebuf, int ecount, int size_write_flag);
|
||||
|
||||
/**
|
||||
* findstr - Safely find needle in haystack.
|
||||
@@ -370,7 +376,7 @@ static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot)
|
||||
ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_FR, HZ / 10);
|
||||
if (ret)
|
||||
return ret;
|
||||
ret = dvb_ca_en50221_write_data(ca, slot, buf, 2);
|
||||
ret = dvb_ca_en50221_write_data(ca, slot, buf, 2, CMDREG_SW);
|
||||
if (ret != 2)
|
||||
return -EIO;
|
||||
ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN);
|
||||
@@ -778,11 +784,13 @@ exit:
|
||||
* @buf: The data in this buffer is treated as a complete link-level packet to
|
||||
* be written.
|
||||
* @bytes_write: Size of ebuf.
|
||||
* @size_write_flag: A flag on Command Register which says whether the link size
|
||||
* information will be writen or not.
|
||||
*
|
||||
* return: Number of bytes written, or < 0 on error.
|
||||
*/
|
||||
static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,
|
||||
u8 *buf, int bytes_write)
|
||||
u8 *buf, int bytes_write, int size_write_flag)
|
||||
{
|
||||
struct dvb_ca_slot *sl = &ca->slot_info[slot];
|
||||
int status;
|
||||
@@ -817,7 +825,7 @@ static int dvb_ca_en50221_write_data(struct dvb_ca_private *ca, int slot,
|
||||
|
||||
/* OK, set HC bit */
|
||||
status = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND,
|
||||
IRQEN | CMDREG_HC);
|
||||
IRQEN | CMDREG_HC | size_write_flag);
|
||||
if (status)
|
||||
goto exit;
|
||||
|
||||
@@ -1508,7 +1516,7 @@ static ssize_t dvb_ca_en50221_io_write(struct file *file,
|
||||
|
||||
mutex_lock(&sl->slot_lock);
|
||||
status = dvb_ca_en50221_write_data(ca, slot, fragbuf,
|
||||
fraglen + 2);
|
||||
fraglen + 2, 0);
|
||||
mutex_unlock(&sl->slot_lock);
|
||||
if (status == (fraglen + 2)) {
|
||||
written = 1;
|
||||
@@ -1709,12 +1717,22 @@ static int dvb_ca_en50221_io_open(struct inode *inode, struct file *file)
|
||||
|
||||
dprintk("%s\n", __func__);
|
||||
|
||||
if (!try_module_get(ca->pub->owner))
|
||||
mutex_lock(&ca->remove_mutex);
|
||||
|
||||
if (ca->exit) {
|
||||
mutex_unlock(&ca->remove_mutex);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!try_module_get(ca->pub->owner)) {
|
||||
mutex_unlock(&ca->remove_mutex);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
err = dvb_generic_open(inode, file);
|
||||
if (err < 0) {
|
||||
module_put(ca->pub->owner);
|
||||
mutex_unlock(&ca->remove_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1739,6 +1757,7 @@ static int dvb_ca_en50221_io_open(struct inode *inode, struct file *file)
|
||||
|
||||
dvb_ca_private_get(ca);
|
||||
|
||||
mutex_unlock(&ca->remove_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1758,6 +1777,8 @@ static int dvb_ca_en50221_io_release(struct inode *inode, struct file *file)
|
||||
|
||||
dprintk("%s\n", __func__);
|
||||
|
||||
mutex_lock(&ca->remove_mutex);
|
||||
|
||||
/* mark the CA device as closed */
|
||||
ca->open = 0;
|
||||
dvb_ca_en50221_thread_update_delay(ca);
|
||||
@@ -1768,6 +1789,13 @@ static int dvb_ca_en50221_io_release(struct inode *inode, struct file *file)
|
||||
|
||||
dvb_ca_private_put(ca);
|
||||
|
||||
if (dvbdev->users == 1 && ca->exit == 1) {
|
||||
mutex_unlock(&ca->remove_mutex);
|
||||
wake_up(&dvbdev->wait_queue);
|
||||
} else {
|
||||
mutex_unlock(&ca->remove_mutex);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1891,6 +1919,7 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
|
||||
}
|
||||
|
||||
mutex_init(&ca->ioctl_mutex);
|
||||
mutex_init(&ca->remove_mutex);
|
||||
|
||||
if (signal_pending(current)) {
|
||||
ret = -EINTR;
|
||||
@@ -1933,6 +1962,14 @@ void dvb_ca_en50221_release(struct dvb_ca_en50221 *pubca)
|
||||
|
||||
dprintk("%s\n", __func__);
|
||||
|
||||
mutex_lock(&ca->remove_mutex);
|
||||
ca->exit = 1;
|
||||
mutex_unlock(&ca->remove_mutex);
|
||||
|
||||
if (ca->dvbdev->users < 1)
|
||||
wait_event(ca->dvbdev->wait_queue,
|
||||
ca->dvbdev->users == 1);
|
||||
|
||||
/* shutdown the thread if there was one */
|
||||
kthread_stop(ca->thread);
|
||||
|
||||
|
||||
@@ -125,12 +125,12 @@ static inline int dvb_dmx_swfilter_payload(struct dvb_demux_feed *feed,
|
||||
|
||||
cc = buf[3] & 0x0f;
|
||||
ccok = ((feed->cc + 1) & 0x0f) == cc;
|
||||
feed->cc = cc;
|
||||
if (!ccok) {
|
||||
set_buf_flags(feed, DMX_BUFFER_FLAG_DISCONTINUITY_DETECTED);
|
||||
dprintk_sect_loss("missed packet: %d instead of %d!\n",
|
||||
cc, (feed->cc + 1) & 0x0f);
|
||||
}
|
||||
feed->cc = cc;
|
||||
|
||||
if (buf[1] & 0x40) // PUSI ?
|
||||
feed->peslen = 0xfffa;
|
||||
@@ -310,7 +310,6 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
|
||||
|
||||
cc = buf[3] & 0x0f;
|
||||
ccok = ((feed->cc + 1) & 0x0f) == cc;
|
||||
feed->cc = cc;
|
||||
|
||||
if (buf[3] & 0x20) {
|
||||
/* adaption field present, check for discontinuity_indicator */
|
||||
@@ -346,6 +345,7 @@ static int dvb_dmx_swfilter_section_packet(struct dvb_demux_feed *feed,
|
||||
feed->pusi_seen = false;
|
||||
dvb_dmx_swfilter_section_new(feed);
|
||||
}
|
||||
feed->cc = cc;
|
||||
|
||||
if (buf[1] & 0x40) {
|
||||
/* PUSI=1 (is set), section boundary is here */
|
||||
|
||||
@@ -293,14 +293,22 @@ static int dvb_frontend_get_event(struct dvb_frontend *fe,
|
||||
}
|
||||
|
||||
if (events->eventw == events->eventr) {
|
||||
int ret;
|
||||
struct wait_queue_entry wait;
|
||||
int ret = 0;
|
||||
|
||||
if (flags & O_NONBLOCK)
|
||||
return -EWOULDBLOCK;
|
||||
|
||||
ret = wait_event_interruptible(events->wait_queue,
|
||||
dvb_frontend_test_event(fepriv, events));
|
||||
|
||||
init_waitqueue_entry(&wait, current);
|
||||
add_wait_queue(&events->wait_queue, &wait);
|
||||
while (!dvb_frontend_test_event(fepriv, events)) {
|
||||
wait_woken(&wait, TASK_INTERRUPTIBLE, 0);
|
||||
if (signal_pending(current)) {
|
||||
ret = -ERESTARTSYS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
remove_wait_queue(&events->wait_queue, &wait);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1564,15 +1564,43 @@ static long dvb_net_ioctl(struct file *file,
|
||||
return dvb_usercopy(file, cmd, arg, dvb_net_do_ioctl);
|
||||
}
|
||||
|
||||
static int locked_dvb_net_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct dvb_device *dvbdev = file->private_data;
|
||||
struct dvb_net *dvbnet = dvbdev->priv;
|
||||
int ret;
|
||||
|
||||
if (mutex_lock_interruptible(&dvbnet->remove_mutex))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
if (dvbnet->exit) {
|
||||
mutex_unlock(&dvbnet->remove_mutex);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = dvb_generic_open(inode, file);
|
||||
|
||||
mutex_unlock(&dvbnet->remove_mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int dvb_net_close(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct dvb_device *dvbdev = file->private_data;
|
||||
struct dvb_net *dvbnet = dvbdev->priv;
|
||||
|
||||
mutex_lock(&dvbnet->remove_mutex);
|
||||
|
||||
dvb_generic_release(inode, file);
|
||||
|
||||
if(dvbdev->users == 1 && dvbnet->exit == 1)
|
||||
if (dvbdev->users == 1 && dvbnet->exit == 1) {
|
||||
mutex_unlock(&dvbnet->remove_mutex);
|
||||
wake_up(&dvbdev->wait_queue);
|
||||
} else {
|
||||
mutex_unlock(&dvbnet->remove_mutex);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1580,7 +1608,7 @@ static int dvb_net_close(struct inode *inode, struct file *file)
|
||||
static const struct file_operations dvb_net_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.unlocked_ioctl = dvb_net_ioctl,
|
||||
.open = dvb_generic_open,
|
||||
.open = locked_dvb_net_open,
|
||||
.release = dvb_net_close,
|
||||
.llseek = noop_llseek,
|
||||
};
|
||||
@@ -1599,10 +1627,13 @@ void dvb_net_release (struct dvb_net *dvbnet)
|
||||
{
|
||||
int i;
|
||||
|
||||
mutex_lock(&dvbnet->remove_mutex);
|
||||
dvbnet->exit = 1;
|
||||
mutex_unlock(&dvbnet->remove_mutex);
|
||||
|
||||
if (dvbnet->dvbdev->users < 1)
|
||||
wait_event(dvbnet->dvbdev->wait_queue,
|
||||
dvbnet->dvbdev->users==1);
|
||||
dvbnet->dvbdev->users == 1);
|
||||
|
||||
dvb_unregister_device(dvbnet->dvbdev);
|
||||
|
||||
@@ -1621,6 +1652,7 @@ int dvb_net_init (struct dvb_adapter *adap, struct dvb_net *dvbnet,
|
||||
int i;
|
||||
|
||||
mutex_init(&dvbnet->ioctl_mutex);
|
||||
mutex_init(&dvbnet->remove_mutex);
|
||||
dvbnet->demux = dmx;
|
||||
|
||||
for (i=0; i<DVB_NET_DEVICES_MAX; i++)
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <media/tuner.h>
|
||||
|
||||
static DEFINE_MUTEX(dvbdev_mutex);
|
||||
static LIST_HEAD(dvbdevfops_list);
|
||||
static int dvbdev_debug;
|
||||
|
||||
module_param(dvbdev_debug, int, 0644);
|
||||
@@ -462,14 +463,15 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
|
||||
enum dvb_device_type type, int demux_sink_pads)
|
||||
{
|
||||
struct dvb_device *dvbdev;
|
||||
struct file_operations *dvbdevfops;
|
||||
struct file_operations *dvbdevfops = NULL;
|
||||
struct dvbdevfops_node *node = NULL, *new_node = NULL;
|
||||
struct device *clsdev;
|
||||
int minor;
|
||||
int id, ret;
|
||||
|
||||
mutex_lock(&dvbdev_register_lock);
|
||||
|
||||
if ((id = dvbdev_get_free_id (adap, type)) < 0){
|
||||
if ((id = dvbdev_get_free_id (adap, type)) < 0) {
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
*pdvbdev = NULL;
|
||||
pr_err("%s: couldn't find free device id\n", __func__);
|
||||
@@ -477,18 +479,45 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
|
||||
}
|
||||
|
||||
*pdvbdev = dvbdev = kzalloc(sizeof(*dvbdev), GFP_KERNEL);
|
||||
|
||||
if (!dvbdev){
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
dvbdevfops = kmemdup(template->fops, sizeof(*dvbdevfops), GFP_KERNEL);
|
||||
/*
|
||||
* When a device of the same type is probe()d more than once,
|
||||
* the first allocated fops are used. This prevents memory leaks
|
||||
* that can occur when the same device is probe()d repeatedly.
|
||||
*/
|
||||
list_for_each_entry(node, &dvbdevfops_list, list_head) {
|
||||
if (node->fops->owner == adap->module &&
|
||||
node->type == type &&
|
||||
node->template == template) {
|
||||
dvbdevfops = node->fops;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!dvbdevfops){
|
||||
kfree (dvbdev);
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
return -ENOMEM;
|
||||
if (dvbdevfops == NULL) {
|
||||
dvbdevfops = kmemdup(template->fops, sizeof(*dvbdevfops), GFP_KERNEL);
|
||||
if (!dvbdevfops) {
|
||||
kfree(dvbdev);
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
new_node = kzalloc(sizeof(struct dvbdevfops_node), GFP_KERNEL);
|
||||
if (!new_node) {
|
||||
kfree(dvbdevfops);
|
||||
kfree(dvbdev);
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
new_node->fops = dvbdevfops;
|
||||
new_node->type = type;
|
||||
new_node->template = template;
|
||||
list_add_tail (&new_node->list_head, &dvbdevfops_list);
|
||||
}
|
||||
|
||||
memcpy(dvbdev, template, sizeof(struct dvb_device));
|
||||
@@ -499,20 +528,20 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
|
||||
dvbdev->priv = priv;
|
||||
dvbdev->fops = dvbdevfops;
|
||||
init_waitqueue_head (&dvbdev->wait_queue);
|
||||
|
||||
dvbdevfops->owner = adap->module;
|
||||
|
||||
list_add_tail (&dvbdev->list_head, &adap->device_list);
|
||||
|
||||
down_write(&minor_rwsem);
|
||||
#ifdef CONFIG_DVB_DYNAMIC_MINORS
|
||||
for (minor = 0; minor < MAX_DVB_MINORS; minor++)
|
||||
if (dvb_minors[minor] == NULL)
|
||||
break;
|
||||
|
||||
if (minor == MAX_DVB_MINORS) {
|
||||
if (new_node) {
|
||||
list_del (&new_node->list_head);
|
||||
kfree(dvbdevfops);
|
||||
kfree(new_node);
|
||||
}
|
||||
list_del (&dvbdev->list_head);
|
||||
kfree(dvbdevfops);
|
||||
kfree(dvbdev);
|
||||
up_write(&minor_rwsem);
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
@@ -521,41 +550,47 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
|
||||
#else
|
||||
minor = nums2minor(adap->num, type, id);
|
||||
#endif
|
||||
|
||||
dvbdev->minor = minor;
|
||||
dvb_minors[minor] = dvb_device_get(dvbdev);
|
||||
up_write(&minor_rwsem);
|
||||
|
||||
ret = dvb_register_media_device(dvbdev, type, minor, demux_sink_pads);
|
||||
if (ret) {
|
||||
pr_err("%s: dvb_register_media_device failed to create the mediagraph\n",
|
||||
__func__);
|
||||
|
||||
if (new_node) {
|
||||
list_del (&new_node->list_head);
|
||||
kfree(dvbdevfops);
|
||||
kfree(new_node);
|
||||
}
|
||||
dvb_media_device_free(dvbdev);
|
||||
list_del (&dvbdev->list_head);
|
||||
kfree(dvbdevfops);
|
||||
kfree(dvbdev);
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
|
||||
clsdev = device_create(dvb_class, adap->device,
|
||||
MKDEV(DVB_MAJOR, minor),
|
||||
dvbdev, "dvb%d.%s%d", adap->num, dnames[type], id);
|
||||
if (IS_ERR(clsdev)) {
|
||||
pr_err("%s: failed to create device dvb%d.%s%d (%ld)\n",
|
||||
__func__, adap->num, dnames[type], id, PTR_ERR(clsdev));
|
||||
if (new_node) {
|
||||
list_del (&new_node->list_head);
|
||||
kfree(dvbdevfops);
|
||||
kfree(new_node);
|
||||
}
|
||||
dvb_media_device_free(dvbdev);
|
||||
list_del (&dvbdev->list_head);
|
||||
kfree(dvbdevfops);
|
||||
kfree(dvbdev);
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
return PTR_ERR(clsdev);
|
||||
}
|
||||
|
||||
dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n",
|
||||
adap->num, dnames[type], id, minor, minor);
|
||||
|
||||
mutex_unlock(&dvbdev_register_lock);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(dvb_register_device);
|
||||
@@ -584,7 +619,6 @@ static void dvb_free_device(struct kref *ref)
|
||||
{
|
||||
struct dvb_device *dvbdev = container_of(ref, struct dvb_device, ref);
|
||||
|
||||
kfree (dvbdev->fops);
|
||||
kfree (dvbdev);
|
||||
}
|
||||
|
||||
@@ -1090,9 +1124,17 @@ error:
|
||||
|
||||
static void __exit exit_dvbdev(void)
|
||||
{
|
||||
struct dvbdevfops_node *node, *next;
|
||||
|
||||
class_destroy(dvb_class);
|
||||
cdev_del(&dvb_device_cdev);
|
||||
unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);
|
||||
|
||||
list_for_each_entry_safe(node, next, &dvbdevfops_list, list_head) {
|
||||
list_del (&node->list_head);
|
||||
kfree(node->fops);
|
||||
kfree(node);
|
||||
}
|
||||
}
|
||||
|
||||
subsys_initcall(init_dvbdev);
|
||||
|
||||
@@ -800,7 +800,7 @@ MODULE_DEVICE_TABLE(i2c, mn88443x_i2c_id);
|
||||
static struct i2c_driver mn88443x_driver = {
|
||||
.driver = {
|
||||
.name = "mn88443x",
|
||||
.of_match_table = of_match_ptr(mn88443x_of_match),
|
||||
.of_match_table = mn88443x_of_match,
|
||||
},
|
||||
.probe = mn88443x_probe,
|
||||
.remove = mn88443x_remove,
|
||||
|
||||
@@ -887,12 +887,7 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
|
||||
ndev->lmmio0, (u32)pci_resource_len(pci_dev, 0),
|
||||
ndev->lmmio1, (u32)pci_resource_len(pci_dev, 1),
|
||||
pci_dev->irq);
|
||||
if (request_irq(pci_dev->irq, netup_unidvb_isr, IRQF_SHARED,
|
||||
"netup_unidvb", pci_dev) < 0) {
|
||||
dev_err(&pci_dev->dev,
|
||||
"%s(): can't get IRQ %d\n", __func__, pci_dev->irq);
|
||||
goto irq_request_err;
|
||||
}
|
||||
|
||||
ndev->dma_size = 2 * 188 *
|
||||
NETUP_DMA_BLOCKS_COUNT * NETUP_DMA_PACKETS_COUNT;
|
||||
ndev->dma_virt = dma_alloc_coherent(&pci_dev->dev,
|
||||
@@ -933,6 +928,14 @@ static int netup_unidvb_initdev(struct pci_dev *pci_dev,
|
||||
dev_err(&pci_dev->dev, "netup_unidvb: DMA setup failed\n");
|
||||
goto dma_setup_err;
|
||||
}
|
||||
|
||||
if (request_irq(pci_dev->irq, netup_unidvb_isr, IRQF_SHARED,
|
||||
"netup_unidvb", pci_dev) < 0) {
|
||||
dev_err(&pci_dev->dev,
|
||||
"%s(): can't get IRQ %d\n", __func__, pci_dev->irq);
|
||||
goto dma_setup_err;
|
||||
}
|
||||
|
||||
dev_info(&pci_dev->dev,
|
||||
"netup_unidvb: device has been initialized\n");
|
||||
return 0;
|
||||
@@ -951,8 +954,6 @@ spi_setup_err:
|
||||
dma_free_coherent(&pci_dev->dev, ndev->dma_size,
|
||||
ndev->dma_virt, ndev->dma_phys);
|
||||
dma_alloc_err:
|
||||
free_irq(pci_dev->irq, pci_dev);
|
||||
irq_request_err:
|
||||
iounmap(ndev->lmmio1);
|
||||
pci_bar1_error:
|
||||
iounmap(ndev->lmmio0);
|
||||
|
||||
@@ -644,11 +644,9 @@ static int rvin_setup(struct rvin_dev *vin)
|
||||
case V4L2_FIELD_SEQ_TB:
|
||||
case V4L2_FIELD_SEQ_BT:
|
||||
case V4L2_FIELD_NONE:
|
||||
vnmc = VNMC_IM_ODD_EVEN;
|
||||
progressive = true;
|
||||
break;
|
||||
case V4L2_FIELD_ALTERNATE:
|
||||
vnmc = VNMC_IM_ODD_EVEN;
|
||||
progressive = true;
|
||||
break;
|
||||
default:
|
||||
vnmc = VNMC_IM_ODD;
|
||||
|
||||
@@ -101,6 +101,10 @@ static int ce6230_i2c_master_xfer(struct i2c_adapter *adap,
|
||||
if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {
|
||||
if (msg[i].addr ==
|
||||
ce6230_zl10353_config.demod_address) {
|
||||
if (msg[i].len < 1) {
|
||||
i = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
req.cmd = DEMOD_READ;
|
||||
req.value = msg[i].addr >> 1;
|
||||
req.index = msg[i].buf[0];
|
||||
@@ -117,6 +121,10 @@ static int ce6230_i2c_master_xfer(struct i2c_adapter *adap,
|
||||
} else {
|
||||
if (msg[i].addr ==
|
||||
ce6230_zl10353_config.demod_address) {
|
||||
if (msg[i].len < 1) {
|
||||
i = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
req.cmd = DEMOD_WRITE;
|
||||
req.value = msg[i].addr >> 1;
|
||||
req.index = msg[i].buf[0];
|
||||
|
||||
@@ -115,6 +115,10 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
||||
while (i < num) {
|
||||
if (num > i + 1 && (msg[i+1].flags & I2C_M_RD)) {
|
||||
if (msg[i].addr == ec168_ec100_config.demod_address) {
|
||||
if (msg[i].len < 1) {
|
||||
i = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
req.cmd = READ_DEMOD;
|
||||
req.value = 0;
|
||||
req.index = 0xff00 + msg[i].buf[0]; /* reg */
|
||||
@@ -131,6 +135,10 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
||||
}
|
||||
} else {
|
||||
if (msg[i].addr == ec168_ec100_config.demod_address) {
|
||||
if (msg[i].len < 1) {
|
||||
i = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
req.cmd = WRITE_DEMOD;
|
||||
req.value = msg[i].buf[1]; /* val */
|
||||
req.index = 0xff00 + msg[i].buf[0]; /* reg */
|
||||
@@ -139,6 +147,10 @@ static int ec168_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
||||
ret = ec168_ctrl_msg(d, &req);
|
||||
i += 1;
|
||||
} else {
|
||||
if (msg[i].len < 1) {
|
||||
i = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
req.cmd = WRITE_I2C;
|
||||
req.value = msg[i].buf[0]; /* val */
|
||||
req.index = 0x0100 + msg[i].addr; /* I2C addr */
|
||||
|
||||
@@ -176,6 +176,10 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
||||
ret = -EOPNOTSUPP;
|
||||
goto err_mutex_unlock;
|
||||
} else if (msg[0].addr == 0x10) {
|
||||
if (msg[0].len < 1 || msg[1].len < 1) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto err_mutex_unlock;
|
||||
}
|
||||
/* method 1 - integrated demod */
|
||||
if (msg[0].buf[0] == 0x00) {
|
||||
/* return demod page from driver cache */
|
||||
@@ -189,6 +193,10 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
||||
ret = rtl28xxu_ctrl_msg(d, &req);
|
||||
}
|
||||
} else if (msg[0].len < 2) {
|
||||
if (msg[0].len < 1) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto err_mutex_unlock;
|
||||
}
|
||||
/* method 2 - old I2C */
|
||||
req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1);
|
||||
req.index = CMD_I2C_RD;
|
||||
@@ -217,8 +225,16 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
||||
ret = -EOPNOTSUPP;
|
||||
goto err_mutex_unlock;
|
||||
} else if (msg[0].addr == 0x10) {
|
||||
if (msg[0].len < 1) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto err_mutex_unlock;
|
||||
}
|
||||
/* method 1 - integrated demod */
|
||||
if (msg[0].buf[0] == 0x00) {
|
||||
if (msg[0].len < 2) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto err_mutex_unlock;
|
||||
}
|
||||
/* save demod page for later demod access */
|
||||
dev->page = msg[0].buf[1];
|
||||
ret = 0;
|
||||
@@ -231,6 +247,10 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
||||
ret = rtl28xxu_ctrl_msg(d, &req);
|
||||
}
|
||||
} else if ((msg[0].len < 23) && (!dev->new_i2c_write)) {
|
||||
if (msg[0].len < 1) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto err_mutex_unlock;
|
||||
}
|
||||
/* method 2 - old I2C */
|
||||
req.value = (msg[0].buf[0] << 8) | (msg[0].addr << 1);
|
||||
req.index = CMD_I2C_WR;
|
||||
|
||||
@@ -988,6 +988,10 @@ static int az6027_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int n
|
||||
/* write/read request */
|
||||
if (i + 1 < num && (msg[i + 1].flags & I2C_M_RD)) {
|
||||
req = 0xB9;
|
||||
if (msg[i].len < 1) {
|
||||
i = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
index = (((msg[i].buf[0] << 8) & 0xff00) | (msg[i].buf[1] & 0x00ff));
|
||||
value = msg[i].addr + (msg[i].len << 8);
|
||||
length = msg[i + 1].len + 6;
|
||||
@@ -1001,6 +1005,10 @@ static int az6027_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int n
|
||||
|
||||
/* demod 16bit addr */
|
||||
req = 0xBD;
|
||||
if (msg[i].len < 1) {
|
||||
i = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
index = (((msg[i].buf[0] << 8) & 0xff00) | (msg[i].buf[1] & 0x00ff));
|
||||
value = msg[i].addr + (2 << 8);
|
||||
length = msg[i].len - 2;
|
||||
@@ -1026,6 +1034,10 @@ static int az6027_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int n
|
||||
} else {
|
||||
|
||||
req = 0xBD;
|
||||
if (msg[i].len < 1) {
|
||||
i = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
index = msg[i].buf[0] & 0x00FF;
|
||||
value = msg[i].addr + (1 << 8);
|
||||
length = msg[i].len - 1;
|
||||
|
||||
@@ -63,6 +63,10 @@ static int digitv_i2c_xfer(struct i2c_adapter *adap,struct i2c_msg msg[],int num
|
||||
warn("more than 2 i2c messages at a time is not handled yet. TODO.");
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
if (msg[i].len < 1) {
|
||||
i = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
/* write/read request */
|
||||
if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {
|
||||
if (digitv_ctrl_msg(d, USB_READ_COFDM, msg[i].buf[0], NULL, 0,
|
||||
|
||||
@@ -946,7 +946,7 @@ static int su3000_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
|
||||
for (i = 0; i < 6; i++) {
|
||||
obuf[1] = 0xf0 + i;
|
||||
if (i2c_transfer(&d->i2c_adap, msg, 2) != 2)
|
||||
break;
|
||||
return -1;
|
||||
else
|
||||
mac[i] = ibuf[0];
|
||||
}
|
||||
|
||||
@@ -1544,8 +1544,7 @@ static void ttusb_dec_exit_dvb(struct ttusb_dec *dec)
|
||||
dvb_dmx_release(&dec->demux);
|
||||
if (dec->fe) {
|
||||
dvb_unregister_frontend(dec->fe);
|
||||
if (dec->fe->ops.release)
|
||||
dec->fe->ops.release(dec->fe);
|
||||
dvb_frontend_detach(dec->fe);
|
||||
}
|
||||
dvb_unregister_adapter(&dec->adapter);
|
||||
}
|
||||
|
||||
@@ -251,14 +251,17 @@ static int uvc_parse_format(struct uvc_device *dev,
|
||||
/* Find the format descriptor from its GUID. */
|
||||
fmtdesc = uvc_format_by_guid(&buffer[5]);
|
||||
|
||||
if (fmtdesc != NULL) {
|
||||
format->fcc = fmtdesc->fcc;
|
||||
} else {
|
||||
if (!fmtdesc) {
|
||||
/*
|
||||
* Unknown video formats are not fatal errors, the
|
||||
* caller will skip this descriptor.
|
||||
*/
|
||||
dev_info(&streaming->intf->dev,
|
||||
"Unknown video format %pUl\n", &buffer[5]);
|
||||
format->fcc = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
format->fcc = fmtdesc->fcc;
|
||||
format->bpp = buffer[21];
|
||||
|
||||
/* Some devices report a format that doesn't match what they
|
||||
@@ -666,7 +669,7 @@ static int uvc_parse_streaming(struct uvc_device *dev,
|
||||
interval = (u32 *)&frame[nframes];
|
||||
|
||||
streaming->format = format;
|
||||
streaming->nformats = nformats;
|
||||
streaming->nformats = 0;
|
||||
|
||||
/* Parse the format descriptors. */
|
||||
while (buflen > 2 && buffer[1] == USB_DT_CS_INTERFACE) {
|
||||
@@ -680,7 +683,10 @@ static int uvc_parse_streaming(struct uvc_device *dev,
|
||||
&interval, buffer, buflen);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
if (!ret)
|
||||
break;
|
||||
|
||||
streaming->nformats++;
|
||||
frame += format->nframes;
|
||||
format++;
|
||||
|
||||
|
||||
@@ -1677,8 +1677,10 @@ static void fastrpc_notify_users(struct fastrpc_user *user)
|
||||
struct fastrpc_invoke_ctx *ctx;
|
||||
|
||||
spin_lock(&user->lock);
|
||||
list_for_each_entry(ctx, &user->pending, node)
|
||||
list_for_each_entry(ctx, &user->pending, node) {
|
||||
ctx->retval = -EPIPE;
|
||||
complete(&ctx->work);
|
||||
}
|
||||
spin_unlock(&user->lock);
|
||||
}
|
||||
|
||||
@@ -1688,7 +1690,9 @@ static void fastrpc_rpmsg_remove(struct rpmsg_device *rpdev)
|
||||
struct fastrpc_user *user;
|
||||
unsigned long flags;
|
||||
|
||||
/* No invocations past this point */
|
||||
spin_lock_irqsave(&cctx->lock, flags);
|
||||
cctx->rpdev = NULL;
|
||||
list_for_each_entry(user, &cctx->users, user)
|
||||
fastrpc_notify_users(user);
|
||||
spin_unlock_irqrestore(&cctx->lock, flags);
|
||||
@@ -1696,7 +1700,6 @@ static void fastrpc_rpmsg_remove(struct rpmsg_device *rpdev)
|
||||
misc_deregister(&cctx->miscdev);
|
||||
of_platform_depopulate(&rpdev->dev);
|
||||
|
||||
cctx->rpdev = NULL;
|
||||
fastrpc_channel_ctx_put(cctx);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ struct mmc_pwrseq_sd8787 {
|
||||
struct mmc_pwrseq pwrseq;
|
||||
struct gpio_desc *reset_gpio;
|
||||
struct gpio_desc *pwrdn_gpio;
|
||||
u32 reset_pwrdwn_delay_ms;
|
||||
};
|
||||
|
||||
#define to_pwrseq_sd8787(p) container_of(p, struct mmc_pwrseq_sd8787, pwrseq)
|
||||
@@ -39,7 +38,7 @@ static void mmc_pwrseq_sd8787_pre_power_on(struct mmc_host *host)
|
||||
|
||||
gpiod_set_value_cansleep(pwrseq->reset_gpio, 1);
|
||||
|
||||
msleep(pwrseq->reset_pwrdwn_delay_ms);
|
||||
msleep(300);
|
||||
gpiod_set_value_cansleep(pwrseq->pwrdn_gpio, 1);
|
||||
}
|
||||
|
||||
@@ -51,17 +50,37 @@ static void mmc_pwrseq_sd8787_power_off(struct mmc_host *host)
|
||||
gpiod_set_value_cansleep(pwrseq->reset_gpio, 0);
|
||||
}
|
||||
|
||||
static void mmc_pwrseq_wilc1000_pre_power_on(struct mmc_host *host)
|
||||
{
|
||||
struct mmc_pwrseq_sd8787 *pwrseq = to_pwrseq_sd8787(host->pwrseq);
|
||||
|
||||
/* The pwrdn_gpio is really CHIP_EN, reset_gpio is RESETN */
|
||||
gpiod_set_value_cansleep(pwrseq->pwrdn_gpio, 1);
|
||||
msleep(5);
|
||||
gpiod_set_value_cansleep(pwrseq->reset_gpio, 1);
|
||||
}
|
||||
|
||||
static void mmc_pwrseq_wilc1000_power_off(struct mmc_host *host)
|
||||
{
|
||||
struct mmc_pwrseq_sd8787 *pwrseq = to_pwrseq_sd8787(host->pwrseq);
|
||||
|
||||
gpiod_set_value_cansleep(pwrseq->reset_gpio, 0);
|
||||
gpiod_set_value_cansleep(pwrseq->pwrdn_gpio, 0);
|
||||
}
|
||||
|
||||
static const struct mmc_pwrseq_ops mmc_pwrseq_sd8787_ops = {
|
||||
.pre_power_on = mmc_pwrseq_sd8787_pre_power_on,
|
||||
.power_off = mmc_pwrseq_sd8787_power_off,
|
||||
};
|
||||
|
||||
static const u32 sd8787_delay_ms = 300;
|
||||
static const u32 wilc1000_delay_ms = 5;
|
||||
static const struct mmc_pwrseq_ops mmc_pwrseq_wilc1000_ops = {
|
||||
.pre_power_on = mmc_pwrseq_wilc1000_pre_power_on,
|
||||
.power_off = mmc_pwrseq_wilc1000_power_off,
|
||||
};
|
||||
|
||||
static const struct of_device_id mmc_pwrseq_sd8787_of_match[] = {
|
||||
{ .compatible = "mmc-pwrseq-sd8787", .data = &sd8787_delay_ms },
|
||||
{ .compatible = "mmc-pwrseq-wilc1000", .data = &wilc1000_delay_ms },
|
||||
{ .compatible = "mmc-pwrseq-sd8787", .data = &mmc_pwrseq_sd8787_ops },
|
||||
{ .compatible = "mmc-pwrseq-wilc1000", .data = &mmc_pwrseq_wilc1000_ops },
|
||||
{/* sentinel */},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, mmc_pwrseq_sd8787_of_match);
|
||||
@@ -77,7 +96,6 @@ static int mmc_pwrseq_sd8787_probe(struct platform_device *pdev)
|
||||
return -ENOMEM;
|
||||
|
||||
match = of_match_node(mmc_pwrseq_sd8787_of_match, pdev->dev.of_node);
|
||||
pwrseq->reset_pwrdwn_delay_ms = *(u32 *)match->data;
|
||||
|
||||
pwrseq->pwrdn_gpio = devm_gpiod_get(dev, "powerdown", GPIOD_OUT_LOW);
|
||||
if (IS_ERR(pwrseq->pwrdn_gpio))
|
||||
@@ -88,7 +106,7 @@ static int mmc_pwrseq_sd8787_probe(struct platform_device *pdev)
|
||||
return PTR_ERR(pwrseq->reset_gpio);
|
||||
|
||||
pwrseq->pwrseq.dev = dev;
|
||||
pwrseq->pwrseq.ops = &mmc_pwrseq_sd8787_ops;
|
||||
pwrseq->pwrseq.ops = match->data;
|
||||
pwrseq->pwrseq.owner = THIS_MODULE;
|
||||
platform_set_drvdata(pdev, pwrseq);
|
||||
|
||||
|
||||
@@ -1715,6 +1715,9 @@ static void construct_request_response(struct vub300_mmc_host *vub300,
|
||||
int bytes = 3 & less_cmd;
|
||||
int words = less_cmd >> 2;
|
||||
u8 *r = vub300->resp.response.command_response;
|
||||
|
||||
if (!resp_len)
|
||||
return;
|
||||
if (bytes == 3) {
|
||||
cmd->resp[words] = (r[1 + (words << 2)] << 24)
|
||||
| (r[2 + (words << 2)] << 16)
|
||||
|
||||
@@ -36,25 +36,25 @@ int ingenic_ecc_correct(struct ingenic_ecc *ecc,
|
||||
void ingenic_ecc_release(struct ingenic_ecc *ecc);
|
||||
struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np);
|
||||
#else /* CONFIG_MTD_NAND_INGENIC_ECC */
|
||||
int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
|
||||
static inline int ingenic_ecc_calculate(struct ingenic_ecc *ecc,
|
||||
struct ingenic_ecc_params *params,
|
||||
const u8 *buf, u8 *ecc_code)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
int ingenic_ecc_correct(struct ingenic_ecc *ecc,
|
||||
static inline int ingenic_ecc_correct(struct ingenic_ecc *ecc,
|
||||
struct ingenic_ecc_params *params, u8 *buf,
|
||||
u8 *ecc_code)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
void ingenic_ecc_release(struct ingenic_ecc *ecc)
|
||||
static inline void ingenic_ecc_release(struct ingenic_ecc *ecc)
|
||||
{
|
||||
}
|
||||
|
||||
struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np)
|
||||
static inline struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *np)
|
||||
{
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
@@ -2443,6 +2443,12 @@ static int marvell_nfc_setup_interface(struct nand_chip *chip, int chipnr,
|
||||
NDTR1_WAIT_MODE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reset nfc->selected_chip so the next command will cause the timing
|
||||
* registers to be updated in marvell_nfc_select_target().
|
||||
*/
|
||||
nfc->selected_chip = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2879,10 +2885,6 @@ static int marvell_nfc_init(struct marvell_nfc *nfc)
|
||||
regmap_update_bits(sysctrl_base, GENCONF_CLK_GATING_CTRL,
|
||||
GENCONF_CLK_GATING_CTRL_ND_GATE,
|
||||
GENCONF_CLK_GATING_CTRL_ND_GATE);
|
||||
|
||||
regmap_update_bits(sysctrl_base, GENCONF_ND_CLK_CTRL,
|
||||
GENCONF_ND_CLK_CTRL_EN,
|
||||
GENCONF_ND_CLK_CTRL_EN);
|
||||
}
|
||||
|
||||
/* Configure the DMA if appropriate */
|
||||
|
||||
@@ -6432,7 +6432,7 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
|
||||
goto out;
|
||||
}
|
||||
if (chip->reset)
|
||||
usleep_range(1000, 2000);
|
||||
usleep_range(10000, 20000);
|
||||
|
||||
err = mv88e6xxx_detect(chip);
|
||||
if (err)
|
||||
|
||||
@@ -1312,7 +1312,7 @@ static enum xgbe_mode xgbe_phy_status_aneg(struct xgbe_prv_data *pdata)
|
||||
return pdata->phy_if.phy_impl.an_outcome(pdata);
|
||||
}
|
||||
|
||||
static void xgbe_phy_status_result(struct xgbe_prv_data *pdata)
|
||||
static bool xgbe_phy_status_result(struct xgbe_prv_data *pdata)
|
||||
{
|
||||
struct ethtool_link_ksettings *lks = &pdata->phy.lks;
|
||||
enum xgbe_mode mode;
|
||||
@@ -1347,8 +1347,13 @@ static void xgbe_phy_status_result(struct xgbe_prv_data *pdata)
|
||||
|
||||
pdata->phy.duplex = DUPLEX_FULL;
|
||||
|
||||
if (xgbe_set_mode(pdata, mode) && pdata->an_again)
|
||||
if (!xgbe_set_mode(pdata, mode))
|
||||
return false;
|
||||
|
||||
if (pdata->an_again)
|
||||
xgbe_phy_reconfig_aneg(pdata);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void xgbe_phy_status(struct xgbe_prv_data *pdata)
|
||||
@@ -1378,7 +1383,8 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
|
||||
return;
|
||||
}
|
||||
|
||||
xgbe_phy_status_result(pdata);
|
||||
if (xgbe_phy_status_result(pdata))
|
||||
return;
|
||||
|
||||
if (test_bit(XGBE_LINK_INIT, &pdata->dev_state))
|
||||
clear_bit(XGBE_LINK_INIT, &pdata->dev_state);
|
||||
|
||||
@@ -483,7 +483,7 @@ static void poll_trace(struct mlx5_fw_tracer *tracer,
|
||||
(u64)timestamp_low;
|
||||
break;
|
||||
default:
|
||||
if (tracer_event->event_id >= tracer->str_db.first_string_trace ||
|
||||
if (tracer_event->event_id >= tracer->str_db.first_string_trace &&
|
||||
tracer_event->event_id <= tracer->str_db.first_string_trace +
|
||||
tracer->str_db.num_string_trace) {
|
||||
tracer_event->type = TRACER_EVENT_TYPE_STRING;
|
||||
|
||||
@@ -140,10 +140,8 @@ int mlx5e_refresh_tirs(struct mlx5e_priv *priv, bool enable_uc_lb,
|
||||
|
||||
inlen = MLX5_ST_SZ_BYTES(modify_tir_in);
|
||||
in = kvzalloc(inlen, GFP_KERNEL);
|
||||
if (!in) {
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
if (!in)
|
||||
return -ENOMEM;
|
||||
|
||||
if (enable_uc_lb)
|
||||
lb_flags = MLX5_TIRC_SELF_LB_BLOCK_BLOCK_UNICAST;
|
||||
@@ -161,14 +159,13 @@ int mlx5e_refresh_tirs(struct mlx5e_priv *priv, bool enable_uc_lb,
|
||||
tirn = tir->tirn;
|
||||
err = mlx5_core_modify_tir(mdev, tirn, in);
|
||||
if (err)
|
||||
goto out;
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&mdev->mlx5e_res.hw_objs.td.list_lock);
|
||||
|
||||
out:
|
||||
kvfree(in);
|
||||
if (err)
|
||||
netdev_err(priv->netdev, "refresh tir(0x%x) failed, %d\n", tirn, err);
|
||||
mutex_unlock(&mdev->mlx5e_res.hw_objs.td.list_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -5008,8 +5008,8 @@ void mlx5e_detach_netdev(struct mlx5e_priv *priv)
|
||||
}
|
||||
|
||||
static int
|
||||
mlx5e_netdev_attach_profile(struct net_device *netdev, struct mlx5_core_dev *mdev,
|
||||
const struct mlx5e_profile *new_profile, void *new_ppriv)
|
||||
mlx5e_netdev_init_profile(struct net_device *netdev, struct mlx5_core_dev *mdev,
|
||||
const struct mlx5e_profile *new_profile, void *new_ppriv)
|
||||
{
|
||||
struct mlx5e_priv *priv = netdev_priv(netdev);
|
||||
int err;
|
||||
@@ -5025,6 +5025,25 @@ mlx5e_netdev_attach_profile(struct net_device *netdev, struct mlx5_core_dev *mde
|
||||
err = new_profile->init(priv->mdev, priv->netdev);
|
||||
if (err)
|
||||
goto priv_cleanup;
|
||||
|
||||
return 0;
|
||||
|
||||
priv_cleanup:
|
||||
mlx5e_priv_cleanup(priv);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
mlx5e_netdev_attach_profile(struct net_device *netdev, struct mlx5_core_dev *mdev,
|
||||
const struct mlx5e_profile *new_profile, void *new_ppriv)
|
||||
{
|
||||
struct mlx5e_priv *priv = netdev_priv(netdev);
|
||||
int err;
|
||||
|
||||
err = mlx5e_netdev_init_profile(netdev, mdev, new_profile, new_ppriv);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = mlx5e_attach_netdev(priv);
|
||||
if (err)
|
||||
goto profile_cleanup;
|
||||
@@ -5032,7 +5051,6 @@ mlx5e_netdev_attach_profile(struct net_device *netdev, struct mlx5_core_dev *mde
|
||||
|
||||
profile_cleanup:
|
||||
new_profile->cleanup(priv);
|
||||
priv_cleanup:
|
||||
mlx5e_priv_cleanup(priv);
|
||||
return err;
|
||||
}
|
||||
@@ -5051,6 +5069,12 @@ int mlx5e_netdev_change_profile(struct mlx5e_priv *priv,
|
||||
priv->profile->cleanup(priv);
|
||||
mlx5e_priv_cleanup(priv);
|
||||
|
||||
if (mdev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) {
|
||||
mlx5e_netdev_init_profile(netdev, mdev, new_profile, new_ppriv);
|
||||
set_bit(MLX5E_STATE_DESTROYING, &priv->state);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
err = mlx5e_netdev_attach_profile(netdev, mdev, new_profile, new_ppriv);
|
||||
if (err) { /* roll back to original profile */
|
||||
netdev_warn(netdev, "%s: new profile init failed, %d\n", __func__, err);
|
||||
@@ -5110,8 +5134,11 @@ static int mlx5e_suspend(struct auxiliary_device *adev, pm_message_t state)
|
||||
struct net_device *netdev = priv->netdev;
|
||||
struct mlx5_core_dev *mdev = priv->mdev;
|
||||
|
||||
if (!netif_device_present(netdev))
|
||||
if (!netif_device_present(netdev)) {
|
||||
if (test_bit(MLX5E_STATE_DESTROYING, &priv->state))
|
||||
mlx5e_destroy_mdev_resources(mdev);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
mlx5e_detach_netdev(priv);
|
||||
mlx5e_destroy_mdev_resources(mdev);
|
||||
|
||||
@@ -781,7 +781,6 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct pci_dev *pdev,
|
||||
}
|
||||
|
||||
mlx5_pci_vsc_init(dev);
|
||||
dev->caps.embedded_cpu = mlx5_read_embedded_cpu(dev);
|
||||
return 0;
|
||||
|
||||
err_clr_master:
|
||||
@@ -1003,6 +1002,7 @@ static int mlx5_function_setup(struct mlx5_core_dev *dev, bool boot)
|
||||
goto err_cmd_cleanup;
|
||||
}
|
||||
|
||||
dev->caps.embedded_cpu = mlx5_read_embedded_cpu(dev);
|
||||
mlx5_cmd_set_state(dev, MLX5_CMDIF_STATE_UP);
|
||||
|
||||
err = mlx5_core_enable_hca(dev, 0);
|
||||
|
||||
@@ -245,12 +245,6 @@ static bool mlxbf_gige_rx_packet(struct mlxbf_gige *priv, int *rx_pkts)
|
||||
|
||||
skb = priv->rx_skb[rx_pi_rem];
|
||||
|
||||
skb_put(skb, datalen);
|
||||
|
||||
skb->ip_summed = CHECKSUM_NONE; /* device did not checksum packet */
|
||||
|
||||
skb->protocol = eth_type_trans(skb, netdev);
|
||||
|
||||
/* Alloc another RX SKB for this same index */
|
||||
rx_skb = mlxbf_gige_alloc_skb(priv, MLXBF_GIGE_DEFAULT_BUF_SZ,
|
||||
&rx_buf_dma, DMA_FROM_DEVICE);
|
||||
@@ -259,6 +253,13 @@ static bool mlxbf_gige_rx_packet(struct mlxbf_gige *priv, int *rx_pkts)
|
||||
priv->rx_skb[rx_pi_rem] = rx_skb;
|
||||
dma_unmap_single(priv->dev, *rx_wqe_addr,
|
||||
MLXBF_GIGE_DEFAULT_BUF_SZ, DMA_FROM_DEVICE);
|
||||
|
||||
skb_put(skb, datalen);
|
||||
|
||||
skb->ip_summed = CHECKSUM_NONE; /* device did not checksum packet */
|
||||
|
||||
skb->protocol = eth_type_trans(skb, netdev);
|
||||
|
||||
*rx_wqe_addr = rx_buf_dma;
|
||||
} else if (rx_cqe & MLXBF_GIGE_RX_CQE_PKT_STATUS_MAC_ERR) {
|
||||
priv->stats.rx_mac_errors++;
|
||||
|
||||
@@ -1321,7 +1321,7 @@ static const struct usb_device_id products[] = {
|
||||
{QMI_FIXED_INTF(0x2001, 0x7e3d, 4)}, /* D-Link DWM-222 A2 */
|
||||
{QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */
|
||||
{QMI_FIXED_INTF(0x2020, 0x2033, 4)}, /* BroadMobi BM806U */
|
||||
{QMI_FIXED_INTF(0x2020, 0x2060, 4)}, /* BroadMobi BM818 */
|
||||
{QMI_QUIRK_SET_DTR(0x2020, 0x2060, 4)}, /* BroadMobi BM818 */
|
||||
{QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
|
||||
{QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
|
||||
{QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
|
||||
|
||||
@@ -153,12 +153,19 @@
|
||||
* implementations.
|
||||
*/
|
||||
struct htc_frame_hdr {
|
||||
u8 eid;
|
||||
u8 flags;
|
||||
struct_group_tagged(htc_frame_look_ahead, header,
|
||||
union {
|
||||
struct {
|
||||
u8 eid;
|
||||
u8 flags;
|
||||
|
||||
/* length of data (including trailer) that follows the header */
|
||||
__le16 payld_len;
|
||||
/* length of data (including trailer) that follows the header */
|
||||
__le16 payld_len;
|
||||
|
||||
};
|
||||
u32 word;
|
||||
};
|
||||
);
|
||||
/* end of 4-byte lookahead */
|
||||
|
||||
u8 ctrl[2];
|
||||
|
||||
@@ -2260,19 +2260,16 @@ int ath6kl_htc_rxmsg_pending_handler(struct htc_target *target,
|
||||
static struct htc_packet *htc_wait_for_ctrl_msg(struct htc_target *target)
|
||||
{
|
||||
struct htc_packet *packet = NULL;
|
||||
struct htc_frame_hdr *htc_hdr;
|
||||
u32 look_ahead;
|
||||
struct htc_frame_look_ahead look_ahead;
|
||||
|
||||
if (ath6kl_hif_poll_mboxmsg_rx(target->dev, &look_ahead,
|
||||
if (ath6kl_hif_poll_mboxmsg_rx(target->dev, &look_ahead.word,
|
||||
HTC_TARGET_RESPONSE_TIMEOUT))
|
||||
return NULL;
|
||||
|
||||
ath6kl_dbg(ATH6KL_DBG_HTC,
|
||||
"htc rx wait ctrl look_ahead 0x%X\n", look_ahead);
|
||||
"htc rx wait ctrl look_ahead 0x%X\n", look_ahead.word);
|
||||
|
||||
htc_hdr = (struct htc_frame_hdr *)&look_ahead;
|
||||
|
||||
if (htc_hdr->eid != ENDPOINT_0)
|
||||
if (look_ahead.eid != ENDPOINT_0)
|
||||
return NULL;
|
||||
|
||||
packet = htc_get_control_buf(target, false);
|
||||
@@ -2281,8 +2278,8 @@ static struct htc_packet *htc_wait_for_ctrl_msg(struct htc_target *target)
|
||||
return NULL;
|
||||
|
||||
packet->info.rx.rx_flags = 0;
|
||||
packet->info.rx.exp_hdr = look_ahead;
|
||||
packet->act_len = le16_to_cpu(htc_hdr->payld_len) + HTC_HDR_LENGTH;
|
||||
packet->info.rx.exp_hdr = look_ahead.word;
|
||||
packet->act_len = le16_to_cpu(look_ahead.payld_len) + HTC_HDR_LENGTH;
|
||||
|
||||
if (packet->act_len > packet->buf_len)
|
||||
goto fail_ctrl_rx;
|
||||
|
||||
@@ -651,7 +651,7 @@ struct b43_iv {
|
||||
union {
|
||||
__be16 d16;
|
||||
__be32 d32;
|
||||
} data __packed;
|
||||
} __packed data;
|
||||
} __packed;
|
||||
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ struct b43legacy_iv {
|
||||
union {
|
||||
__be16 d16;
|
||||
__be32 d32;
|
||||
} data __packed;
|
||||
} __packed data;
|
||||
} __packed;
|
||||
|
||||
#define B43legacy_PHYMODE(phytype) (1 << (phytype))
|
||||
|
||||
@@ -1346,6 +1346,7 @@ struct rtl8xxxu_priv {
|
||||
u32 rege9c;
|
||||
u32 regeb4;
|
||||
u32 regebc;
|
||||
u32 regrcr;
|
||||
int next_mbox;
|
||||
int nr_out_eps;
|
||||
|
||||
|
||||
@@ -4045,6 +4045,7 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
|
||||
RCR_ACCEPT_MGMT_FRAME | RCR_HTC_LOC_CTRL |
|
||||
RCR_APPEND_PHYSTAT | RCR_APPEND_ICV | RCR_APPEND_MIC;
|
||||
rtl8xxxu_write32(priv, REG_RCR, val32);
|
||||
priv->regrcr = val32;
|
||||
|
||||
/*
|
||||
* Accept all multicast
|
||||
@@ -6000,7 +6001,7 @@ static void rtl8xxxu_configure_filter(struct ieee80211_hw *hw,
|
||||
unsigned int *total_flags, u64 multicast)
|
||||
{
|
||||
struct rtl8xxxu_priv *priv = hw->priv;
|
||||
u32 rcr = rtl8xxxu_read32(priv, REG_RCR);
|
||||
u32 rcr = priv->regrcr;
|
||||
|
||||
dev_dbg(&priv->udev->dev, "%s: changed_flags %08x, total_flags %08x\n",
|
||||
__func__, changed_flags, *total_flags);
|
||||
@@ -6046,6 +6047,7 @@ static void rtl8xxxu_configure_filter(struct ieee80211_hw *hw,
|
||||
*/
|
||||
|
||||
rtl8xxxu_write32(priv, REG_RCR, rcr);
|
||||
priv->regrcr = rcr;
|
||||
|
||||
*total_flags &= (FIF_ALLMULTI | FIF_FCSFAIL | FIF_BCN_PRBRESP_PROMISC |
|
||||
FIF_CONTROL | FIF_OTHER_BSS | FIF_PSPOLL |
|
||||
|
||||
@@ -163,7 +163,9 @@ static umode_t nvme_hwmon_is_visible(const void *_data,
|
||||
case hwmon_temp_max:
|
||||
case hwmon_temp_min:
|
||||
if ((!channel && data->ctrl->wctemp) ||
|
||||
(channel && data->log->temp_sensor[channel - 1])) {
|
||||
(channel && data->log->temp_sensor[channel - 1] &&
|
||||
!(data->ctrl->quirks &
|
||||
NVME_QUIRK_NO_SECONDARY_TEMP_THRESH))) {
|
||||
if (data->ctrl->quirks &
|
||||
NVME_QUIRK_NO_TEMP_THRESH_CHANGE)
|
||||
return 0444;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user