Merge 12119cfa10 ("Merge tag 'vfio-v5.16-rc4' of git://github.com/awilliam/linux-vfio") into android-mainline
Steps on the way to 5.16-rc4 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ifd25f7d57a87841aab891fefb3c6d8d5eaf7d6aa
This commit is contained in:
@@ -53,11 +53,10 @@ The number of bits that the PAC occupies in a pointer is 55 minus the
|
||||
virtual address size configured by the kernel. For example, with a
|
||||
virtual address size of 48, the PAC is 7 bits wide.
|
||||
|
||||
Recent versions of GCC can compile code with APIAKey-based return
|
||||
address protection when passed the -msign-return-address option. This
|
||||
uses instructions in the HINT space (unless -march=armv8.3-a or higher
|
||||
is also passed), and such code can run on systems without the pointer
|
||||
authentication extension.
|
||||
When ARM64_PTR_AUTH_KERNEL is selected, the kernel will be compiled
|
||||
with HINT space pointer authentication instructions protecting
|
||||
function returns. Kernels built with this option will work on hardware
|
||||
with or without pointer authentication support.
|
||||
|
||||
In addition to exec(), keys can also be reinitialized to random values
|
||||
using the PR_PAC_RESET_KEYS prctl. A bitmask of PR_PAC_APIAKEY,
|
||||
|
||||
@@ -73,12 +73,12 @@ CPUFREQ_POSTCHANGE.
|
||||
The third argument is a struct cpufreq_freqs with the following
|
||||
values:
|
||||
|
||||
===== ===========================
|
||||
cpu number of the affected CPU
|
||||
====== ======================================
|
||||
policy a pointer to the struct cpufreq_policy
|
||||
old old frequency
|
||||
new new frequency
|
||||
flags flags of the cpufreq driver
|
||||
===== ===========================
|
||||
====== ======================================
|
||||
|
||||
3. CPUFreq Table Generation with Operating Performance Point (OPP)
|
||||
==================================================================
|
||||
|
||||
@@ -77,11 +77,17 @@
|
||||
.endm
|
||||
|
||||
SYM_CODE_START(ftrace_regs_caller)
|
||||
#ifdef BTI_C
|
||||
BTI_C
|
||||
#endif
|
||||
ftrace_regs_entry 1
|
||||
b ftrace_common
|
||||
SYM_CODE_END(ftrace_regs_caller)
|
||||
|
||||
SYM_CODE_START(ftrace_caller)
|
||||
#ifdef BTI_C
|
||||
BTI_C
|
||||
#endif
|
||||
ftrace_regs_entry 0
|
||||
b ftrace_common
|
||||
SYM_CODE_END(ftrace_caller)
|
||||
|
||||
@@ -147,7 +147,7 @@ int machine_kexec_post_load(struct kimage *kimage)
|
||||
if (rc)
|
||||
return rc;
|
||||
kimage->arch.ttbr1 = __pa(trans_pgd);
|
||||
kimage->arch.zero_page = __pa(empty_zero_page);
|
||||
kimage->arch.zero_page = __pa_symbol(empty_zero_page);
|
||||
|
||||
reloc_size = __relocate_new_kernel_end - __relocate_new_kernel_start;
|
||||
memcpy(reloc_code, __relocate_new_kernel_start, reloc_size);
|
||||
|
||||
@@ -403,7 +403,6 @@ CONFIG_DEVTMPFS=y
|
||||
CONFIG_CONNECTOR=y
|
||||
CONFIG_ZRAM=y
|
||||
CONFIG_BLK_DEV_LOOP=m
|
||||
CONFIG_BLK_DEV_CRYPTOLOOP=m
|
||||
CONFIG_BLK_DEV_DRBD=m
|
||||
CONFIG_BLK_DEV_NBD=m
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
@@ -476,6 +475,7 @@ CONFIG_MACVLAN=m
|
||||
CONFIG_MACVTAP=m
|
||||
CONFIG_VXLAN=m
|
||||
CONFIG_BAREUDP=m
|
||||
CONFIG_AMT=m
|
||||
CONFIG_TUN=m
|
||||
CONFIG_VETH=m
|
||||
CONFIG_VIRTIO_NET=m
|
||||
@@ -489,6 +489,7 @@ CONFIG_NLMON=m
|
||||
# CONFIG_NET_VENDOR_AMD is not set
|
||||
# CONFIG_NET_VENDOR_AQUANTIA is not set
|
||||
# CONFIG_NET_VENDOR_ARC is not set
|
||||
# CONFIG_NET_VENDOR_ASIX is not set
|
||||
# CONFIG_NET_VENDOR_ATHEROS is not set
|
||||
# CONFIG_NET_VENDOR_BROADCOM is not set
|
||||
# CONFIG_NET_VENDOR_BROCADE is not set
|
||||
@@ -571,6 +572,7 @@ CONFIG_WATCHDOG=y
|
||||
CONFIG_WATCHDOG_NOWAYOUT=y
|
||||
CONFIG_SOFT_WATCHDOG=m
|
||||
CONFIG_DIAG288_WATCHDOG=m
|
||||
# CONFIG_DRM_DEBUG_MODESET_LOCK is not set
|
||||
CONFIG_FB=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE=y
|
||||
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
|
||||
@@ -775,12 +777,14 @@ CONFIG_CRC4=m
|
||||
CONFIG_CRC7=m
|
||||
CONFIG_CRC8=m
|
||||
CONFIG_RANDOM32_SELFTEST=y
|
||||
CONFIG_XZ_DEC_MICROLZMA=y
|
||||
CONFIG_DMA_CMA=y
|
||||
CONFIG_CMA_SIZE_MBYTES=0
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_DYNAMIC_DEBUG=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_INFO_DWARF4=y
|
||||
CONFIG_DEBUG_INFO_BTF=y
|
||||
CONFIG_GDB_SCRIPTS=y
|
||||
CONFIG_HEADERS_INSTALL=y
|
||||
CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
@@ -807,6 +811,7 @@ CONFIG_DEBUG_MEMORY_INIT=y
|
||||
CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m
|
||||
CONFIG_DEBUG_PER_CPU_MAPS=y
|
||||
CONFIG_KFENCE=y
|
||||
CONFIG_KFENCE_STATIC_KEYS=y
|
||||
CONFIG_DEBUG_SHIRQ=y
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
@@ -842,6 +847,7 @@ CONFIG_FTRACE_STARTUP_TEST=y
|
||||
CONFIG_SAMPLES=y
|
||||
CONFIG_SAMPLE_TRACE_PRINTK=m
|
||||
CONFIG_SAMPLE_FTRACE_DIRECT=m
|
||||
CONFIG_SAMPLE_FTRACE_DIRECT_MULTI=m
|
||||
CONFIG_DEBUG_ENTRY=y
|
||||
CONFIG_CIO_INJECT=y
|
||||
CONFIG_KUNIT=m
|
||||
@@ -860,7 +866,7 @@ CONFIG_FAIL_FUNCTION=y
|
||||
CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
|
||||
CONFIG_LKDTM=m
|
||||
CONFIG_TEST_MIN_HEAP=y
|
||||
CONFIG_KPROBES_SANITY_TEST=y
|
||||
CONFIG_KPROBES_SANITY_TEST=m
|
||||
CONFIG_RBTREE_TEST=y
|
||||
CONFIG_INTERVAL_TREE_TEST=m
|
||||
CONFIG_PERCPU_TEST=m
|
||||
|
||||
@@ -394,7 +394,6 @@ CONFIG_DEVTMPFS=y
|
||||
CONFIG_CONNECTOR=y
|
||||
CONFIG_ZRAM=y
|
||||
CONFIG_BLK_DEV_LOOP=m
|
||||
CONFIG_BLK_DEV_CRYPTOLOOP=m
|
||||
CONFIG_BLK_DEV_DRBD=m
|
||||
CONFIG_BLK_DEV_NBD=m
|
||||
CONFIG_BLK_DEV_RAM=y
|
||||
@@ -467,6 +466,7 @@ CONFIG_MACVLAN=m
|
||||
CONFIG_MACVTAP=m
|
||||
CONFIG_VXLAN=m
|
||||
CONFIG_BAREUDP=m
|
||||
CONFIG_AMT=m
|
||||
CONFIG_TUN=m
|
||||
CONFIG_VETH=m
|
||||
CONFIG_VIRTIO_NET=m
|
||||
@@ -480,6 +480,7 @@ CONFIG_NLMON=m
|
||||
# CONFIG_NET_VENDOR_AMD is not set
|
||||
# CONFIG_NET_VENDOR_AQUANTIA is not set
|
||||
# CONFIG_NET_VENDOR_ARC is not set
|
||||
# CONFIG_NET_VENDOR_ASIX is not set
|
||||
# CONFIG_NET_VENDOR_ATHEROS is not set
|
||||
# CONFIG_NET_VENDOR_BROADCOM is not set
|
||||
# CONFIG_NET_VENDOR_BROCADE is not set
|
||||
@@ -762,12 +763,14 @@ CONFIG_PRIME_NUMBERS=m
|
||||
CONFIG_CRC4=m
|
||||
CONFIG_CRC7=m
|
||||
CONFIG_CRC8=m
|
||||
CONFIG_XZ_DEC_MICROLZMA=y
|
||||
CONFIG_DMA_CMA=y
|
||||
CONFIG_CMA_SIZE_MBYTES=0
|
||||
CONFIG_PRINTK_TIME=y
|
||||
CONFIG_DYNAMIC_DEBUG=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_INFO_DWARF4=y
|
||||
CONFIG_DEBUG_INFO_BTF=y
|
||||
CONFIG_GDB_SCRIPTS=y
|
||||
CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
CONFIG_MAGIC_SYSRQ=y
|
||||
@@ -792,9 +795,11 @@ CONFIG_HIST_TRIGGERS=y
|
||||
CONFIG_SAMPLES=y
|
||||
CONFIG_SAMPLE_TRACE_PRINTK=m
|
||||
CONFIG_SAMPLE_FTRACE_DIRECT=m
|
||||
CONFIG_SAMPLE_FTRACE_DIRECT_MULTI=m
|
||||
CONFIG_KUNIT=m
|
||||
CONFIG_KUNIT_DEBUGFS=y
|
||||
CONFIG_LKDTM=m
|
||||
CONFIG_KPROBES_SANITY_TEST=m
|
||||
CONFIG_PERCPU_TEST=m
|
||||
CONFIG_ATOMIC64_SELFTEST=y
|
||||
CONFIG_TEST_BPF=m
|
||||
|
||||
@@ -65,9 +65,11 @@ CONFIG_ZFCP=y
|
||||
# CONFIG_NETWORK_FILESYSTEMS is not set
|
||||
CONFIG_LSM="yama,loadpin,safesetid,integrity"
|
||||
# CONFIG_ZLIB_DFLTCC is not set
|
||||
CONFIG_XZ_DEC_MICROLZMA=y
|
||||
CONFIG_PRINTK_TIME=y
|
||||
# CONFIG_SYMBOLIC_ERRNAME is not set
|
||||
CONFIG_DEBUG_INFO=y
|
||||
CONFIG_DEBUG_INFO_BTF=y
|
||||
CONFIG_DEBUG_FS=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_PANIC_ON_OOPS=y
|
||||
|
||||
@@ -14,12 +14,13 @@
|
||||
|
||||
/* I/O Map */
|
||||
#define ZPCI_IOMAP_SHIFT 48
|
||||
#define ZPCI_IOMAP_ADDR_BASE 0x8000000000000000UL
|
||||
#define ZPCI_IOMAP_ADDR_SHIFT 62
|
||||
#define ZPCI_IOMAP_ADDR_BASE (1UL << ZPCI_IOMAP_ADDR_SHIFT)
|
||||
#define ZPCI_IOMAP_ADDR_OFF_MASK ((1UL << ZPCI_IOMAP_SHIFT) - 1)
|
||||
#define ZPCI_IOMAP_MAX_ENTRIES \
|
||||
((ULONG_MAX - ZPCI_IOMAP_ADDR_BASE + 1) / (1UL << ZPCI_IOMAP_SHIFT))
|
||||
(1UL << (ZPCI_IOMAP_ADDR_SHIFT - ZPCI_IOMAP_SHIFT))
|
||||
#define ZPCI_IOMAP_ADDR_IDX_MASK \
|
||||
(~ZPCI_IOMAP_ADDR_OFF_MASK - ZPCI_IOMAP_ADDR_BASE)
|
||||
((ZPCI_IOMAP_ADDR_BASE - 1) & ~ZPCI_IOMAP_ADDR_OFF_MASK)
|
||||
|
||||
struct zpci_iomap_entry {
|
||||
u32 fh;
|
||||
|
||||
@@ -173,10 +173,11 @@ static noinline int unwindme_func4(struct unwindme *u)
|
||||
}
|
||||
|
||||
/*
|
||||
* trigger specification exception
|
||||
* Trigger operation exception; use insn notation to bypass
|
||||
* llvm's integrated assembler sanity checks.
|
||||
*/
|
||||
asm volatile(
|
||||
" mvcl %%r1,%%r1\n"
|
||||
" .insn e,0x0000\n" /* illegal opcode */
|
||||
"0: nopr %%r7\n"
|
||||
EX_TABLE(0b, 0b)
|
||||
:);
|
||||
|
||||
@@ -827,7 +827,7 @@ static ssize_t ata_scsi_lpm_show(struct device *dev,
|
||||
if (ap->target_lpm_policy >= ARRAY_SIZE(ata_lpm_policy_names))
|
||||
return -EINVAL;
|
||||
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n",
|
||||
return sysfs_emit(buf, "%s\n",
|
||||
ata_lpm_policy_names[ap->target_lpm_policy]);
|
||||
}
|
||||
DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
|
||||
|
||||
@@ -55,14 +55,14 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
|
||||
/* Transfer multiple of 2 bytes */
|
||||
if (rw == READ) {
|
||||
if (swap)
|
||||
raw_insw_swapw((u16 *)data_addr, (u16 *)buf, words);
|
||||
raw_insw_swapw(data_addr, (u16 *)buf, words);
|
||||
else
|
||||
raw_insw((u16 *)data_addr, (u16 *)buf, words);
|
||||
raw_insw(data_addr, (u16 *)buf, words);
|
||||
} else {
|
||||
if (swap)
|
||||
raw_outsw_swapw((u16 *)data_addr, (u16 *)buf, words);
|
||||
raw_outsw_swapw(data_addr, (u16 *)buf, words);
|
||||
else
|
||||
raw_outsw((u16 *)data_addr, (u16 *)buf, words);
|
||||
raw_outsw(data_addr, (u16 *)buf, words);
|
||||
}
|
||||
|
||||
/* Transfer trailing byte, if any. */
|
||||
@@ -74,16 +74,16 @@ static unsigned int pata_falcon_data_xfer(struct ata_queued_cmd *qc,
|
||||
|
||||
if (rw == READ) {
|
||||
if (swap)
|
||||
raw_insw_swapw((u16 *)data_addr, (u16 *)pad, 1);
|
||||
raw_insw_swapw(data_addr, (u16 *)pad, 1);
|
||||
else
|
||||
raw_insw((u16 *)data_addr, (u16 *)pad, 1);
|
||||
raw_insw(data_addr, (u16 *)pad, 1);
|
||||
*buf = pad[0];
|
||||
} else {
|
||||
pad[0] = *buf;
|
||||
if (swap)
|
||||
raw_outsw_swapw((u16 *)data_addr, (u16 *)pad, 1);
|
||||
raw_outsw_swapw(data_addr, (u16 *)pad, 1);
|
||||
else
|
||||
raw_outsw((u16 *)data_addr, (u16 *)pad, 1);
|
||||
raw_outsw(data_addr, (u16 *)pad, 1);
|
||||
}
|
||||
words++;
|
||||
}
|
||||
|
||||
+13
-7
@@ -1394,6 +1394,14 @@ static int sata_fsl_init_controller(struct ata_host *host)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sata_fsl_host_stop(struct ata_host *host)
|
||||
{
|
||||
struct sata_fsl_host_priv *host_priv = host->private_data;
|
||||
|
||||
iounmap(host_priv->hcr_base);
|
||||
kfree(host_priv);
|
||||
}
|
||||
|
||||
/*
|
||||
* scsi mid-layer and libata interface structures
|
||||
*/
|
||||
@@ -1426,6 +1434,8 @@ static struct ata_port_operations sata_fsl_ops = {
|
||||
.port_start = sata_fsl_port_start,
|
||||
.port_stop = sata_fsl_port_stop,
|
||||
|
||||
.host_stop = sata_fsl_host_stop,
|
||||
|
||||
.pmp_attach = sata_fsl_pmp_attach,
|
||||
.pmp_detach = sata_fsl_pmp_detach,
|
||||
};
|
||||
@@ -1480,9 +1490,9 @@ static int sata_fsl_probe(struct platform_device *ofdev)
|
||||
host_priv->ssr_base = ssr_base;
|
||||
host_priv->csr_base = csr_base;
|
||||
|
||||
irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
|
||||
if (!irq) {
|
||||
dev_err(&ofdev->dev, "invalid irq from platform\n");
|
||||
irq = platform_get_irq(ofdev, 0);
|
||||
if (irq < 0) {
|
||||
retval = irq;
|
||||
goto error_exit_with_cleanup;
|
||||
}
|
||||
host_priv->irq = irq;
|
||||
@@ -1557,10 +1567,6 @@ static int sata_fsl_remove(struct platform_device *ofdev)
|
||||
|
||||
ata_host_detach(host);
|
||||
|
||||
irq_dispose_mapping(host_priv->irq);
|
||||
iounmap(host_priv->hcr_base);
|
||||
kfree(host_priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1015,10 +1015,9 @@ static struct kobj_type ktype_cpufreq = {
|
||||
.release = cpufreq_sysfs_release,
|
||||
};
|
||||
|
||||
static void add_cpu_dev_symlink(struct cpufreq_policy *policy, unsigned int cpu)
|
||||
static void add_cpu_dev_symlink(struct cpufreq_policy *policy, unsigned int cpu,
|
||||
struct device *dev)
|
||||
{
|
||||
struct device *dev = get_cpu_device(cpu);
|
||||
|
||||
if (unlikely(!dev))
|
||||
return;
|
||||
|
||||
@@ -1307,8 +1306,9 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy)
|
||||
|
||||
if (policy->max_freq_req) {
|
||||
/*
|
||||
* CPUFREQ_CREATE_POLICY notification is sent only after
|
||||
* successfully adding max_freq_req request.
|
||||
* Remove max_freq_req after sending CPUFREQ_REMOVE_POLICY
|
||||
* notification, since CPUFREQ_CREATE_POLICY notification was
|
||||
* sent after adding max_freq_req earlier.
|
||||
*/
|
||||
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
|
||||
CPUFREQ_REMOVE_POLICY, policy);
|
||||
@@ -1402,7 +1402,7 @@ static int cpufreq_online(unsigned int cpu)
|
||||
if (new_policy) {
|
||||
for_each_cpu(j, policy->related_cpus) {
|
||||
per_cpu(cpufreq_cpu_data, j) = policy;
|
||||
add_cpu_dev_symlink(policy, j);
|
||||
add_cpu_dev_symlink(policy, j, get_cpu_device(j));
|
||||
}
|
||||
|
||||
policy->min_freq_req = kzalloc(2 * sizeof(*policy->min_freq_req),
|
||||
@@ -1577,7 +1577,7 @@ static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
|
||||
/* Create sysfs link on CPU registration */
|
||||
policy = per_cpu(cpufreq_cpu_data, cpu);
|
||||
if (policy)
|
||||
add_cpu_dev_symlink(policy, cpu);
|
||||
add_cpu_dev_symlink(policy, cpu, dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -195,8 +195,9 @@ static u32 cbus_i2c_func(struct i2c_adapter *adapter)
|
||||
}
|
||||
|
||||
static const struct i2c_algorithm cbus_i2c_algo = {
|
||||
.smbus_xfer = cbus_i2c_smbus_xfer,
|
||||
.functionality = cbus_i2c_func,
|
||||
.smbus_xfer = cbus_i2c_smbus_xfer,
|
||||
.smbus_xfer_atomic = cbus_i2c_smbus_xfer,
|
||||
.functionality = cbus_i2c_func,
|
||||
};
|
||||
|
||||
static int cbus_i2c_remove(struct platform_device *pdev)
|
||||
|
||||
@@ -423,8 +423,8 @@ static void rk3x_i2c_handle_read(struct rk3x_i2c *i2c, unsigned int ipd)
|
||||
if (!(ipd & REG_INT_MBRF))
|
||||
return;
|
||||
|
||||
/* ack interrupt */
|
||||
i2c_writel(i2c, REG_INT_MBRF, REG_IPD);
|
||||
/* ack interrupt (read also produces a spurious START flag, clear it too) */
|
||||
i2c_writel(i2c, REG_INT_MBRF | REG_INT_START, REG_IPD);
|
||||
|
||||
/* Can only handle a maximum of 32 bytes at a time */
|
||||
if (len > 32)
|
||||
|
||||
@@ -1493,6 +1493,7 @@ static irqreturn_t stm32f7_i2c_isr_event(int irq, void *data)
|
||||
{
|
||||
struct stm32f7_i2c_dev *i2c_dev = data;
|
||||
struct stm32f7_i2c_msg *f7_msg = &i2c_dev->f7_msg;
|
||||
struct stm32_i2c_dma *dma = i2c_dev->dma;
|
||||
void __iomem *base = i2c_dev->base;
|
||||
u32 status, mask;
|
||||
int ret = IRQ_HANDLED;
|
||||
@@ -1518,6 +1519,10 @@ static irqreturn_t stm32f7_i2c_isr_event(int irq, void *data)
|
||||
dev_dbg(i2c_dev->dev, "<%s>: Receive NACK (addr %x)\n",
|
||||
__func__, f7_msg->addr);
|
||||
writel_relaxed(STM32F7_I2C_ICR_NACKCF, base + STM32F7_I2C_ICR);
|
||||
if (i2c_dev->use_dma) {
|
||||
stm32f7_i2c_disable_dma_req(i2c_dev);
|
||||
dmaengine_terminate_async(dma->chan_using);
|
||||
}
|
||||
f7_msg->result = -ENXIO;
|
||||
}
|
||||
|
||||
@@ -1533,7 +1538,7 @@ static irqreturn_t stm32f7_i2c_isr_event(int irq, void *data)
|
||||
/* Clear STOP flag */
|
||||
writel_relaxed(STM32F7_I2C_ICR_STOPCF, base + STM32F7_I2C_ICR);
|
||||
|
||||
if (i2c_dev->use_dma) {
|
||||
if (i2c_dev->use_dma && !f7_msg->result) {
|
||||
ret = IRQ_WAKE_THREAD;
|
||||
} else {
|
||||
i2c_dev->master_mode = false;
|
||||
@@ -1546,7 +1551,7 @@ static irqreturn_t stm32f7_i2c_isr_event(int irq, void *data)
|
||||
if (f7_msg->stop) {
|
||||
mask = STM32F7_I2C_CR2_STOP;
|
||||
stm32f7_i2c_set_bits(base + STM32F7_I2C_CR2, mask);
|
||||
} else if (i2c_dev->use_dma) {
|
||||
} else if (i2c_dev->use_dma && !f7_msg->result) {
|
||||
ret = IRQ_WAKE_THREAD;
|
||||
} else if (f7_msg->smbus) {
|
||||
stm32f7_i2c_smbus_rep_start(i2c_dev);
|
||||
@@ -1583,7 +1588,7 @@ static irqreturn_t stm32f7_i2c_isr_event_thread(int irq, void *data)
|
||||
if (!ret) {
|
||||
dev_dbg(i2c_dev->dev, "<%s>: Timed out\n", __func__);
|
||||
stm32f7_i2c_disable_dma_req(i2c_dev);
|
||||
dmaengine_terminate_all(dma->chan_using);
|
||||
dmaengine_terminate_async(dma->chan_using);
|
||||
f7_msg->result = -ETIMEDOUT;
|
||||
}
|
||||
|
||||
@@ -1660,7 +1665,7 @@ static irqreturn_t stm32f7_i2c_isr_error(int irq, void *data)
|
||||
/* Disable dma */
|
||||
if (i2c_dev->use_dma) {
|
||||
stm32f7_i2c_disable_dma_req(i2c_dev);
|
||||
dmaengine_terminate_all(dma->chan_using);
|
||||
dmaengine_terminate_async(dma->chan_using);
|
||||
}
|
||||
|
||||
i2c_dev->master_mode = false;
|
||||
@@ -1696,12 +1701,26 @@ static int stm32f7_i2c_xfer(struct i2c_adapter *i2c_adap,
|
||||
time_left = wait_for_completion_timeout(&i2c_dev->complete,
|
||||
i2c_dev->adap.timeout);
|
||||
ret = f7_msg->result;
|
||||
if (ret) {
|
||||
if (i2c_dev->use_dma)
|
||||
dmaengine_synchronize(dma->chan_using);
|
||||
|
||||
/*
|
||||
* It is possible that some unsent data have already been
|
||||
* written into TXDR. To avoid sending old data in a
|
||||
* further transfer, flush TXDR in case of any error
|
||||
*/
|
||||
writel_relaxed(STM32F7_I2C_ISR_TXE,
|
||||
i2c_dev->base + STM32F7_I2C_ISR);
|
||||
goto pm_free;
|
||||
}
|
||||
|
||||
if (!time_left) {
|
||||
dev_dbg(i2c_dev->dev, "Access to slave 0x%x timed out\n",
|
||||
i2c_dev->msg->addr);
|
||||
if (i2c_dev->use_dma)
|
||||
dmaengine_terminate_all(dma->chan_using);
|
||||
dmaengine_terminate_sync(dma->chan_using);
|
||||
stm32f7_i2c_wait_free_bus(i2c_dev);
|
||||
ret = -ETIMEDOUT;
|
||||
}
|
||||
|
||||
@@ -1744,13 +1763,25 @@ static int stm32f7_i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr,
|
||||
timeout = wait_for_completion_timeout(&i2c_dev->complete,
|
||||
i2c_dev->adap.timeout);
|
||||
ret = f7_msg->result;
|
||||
if (ret)
|
||||
if (ret) {
|
||||
if (i2c_dev->use_dma)
|
||||
dmaengine_synchronize(dma->chan_using);
|
||||
|
||||
/*
|
||||
* It is possible that some unsent data have already been
|
||||
* written into TXDR. To avoid sending old data in a
|
||||
* further transfer, flush TXDR in case of any error
|
||||
*/
|
||||
writel_relaxed(STM32F7_I2C_ISR_TXE,
|
||||
i2c_dev->base + STM32F7_I2C_ISR);
|
||||
goto pm_free;
|
||||
}
|
||||
|
||||
if (!timeout) {
|
||||
dev_dbg(dev, "Access to slave 0x%x timed out\n", f7_msg->addr);
|
||||
if (i2c_dev->use_dma)
|
||||
dmaengine_terminate_all(dma->chan_using);
|
||||
dmaengine_terminate_sync(dma->chan_using);
|
||||
stm32f7_i2c_wait_free_bus(i2c_dev);
|
||||
ret = -ETIMEDOUT;
|
||||
goto pm_free;
|
||||
}
|
||||
|
||||
@@ -463,17 +463,12 @@ int dtpm_register(const char *name, struct dtpm *dtpm, struct dtpm *parent)
|
||||
|
||||
static int __init init_dtpm(void)
|
||||
{
|
||||
struct dtpm_descr *dtpm_descr;
|
||||
|
||||
pct = powercap_register_control_type(NULL, "dtpm", NULL);
|
||||
if (IS_ERR(pct)) {
|
||||
pr_err("Failed to register control type\n");
|
||||
return PTR_ERR(pct);
|
||||
}
|
||||
|
||||
for_each_dtpm_table(dtpm_descr)
|
||||
dtpm_descr->init();
|
||||
|
||||
return 0;
|
||||
}
|
||||
late_initcall(init_dtpm);
|
||||
|
||||
@@ -98,7 +98,8 @@ static ssize_t vfio_pci_igd_rw(struct vfio_pci_core_device *vdev,
|
||||
version = cpu_to_le16(0x0201);
|
||||
|
||||
if (igd_opregion_shift_copy(buf, &off,
|
||||
&version + (pos - OPREGION_VERSION),
|
||||
(u8 *)&version +
|
||||
(pos - OPREGION_VERSION),
|
||||
&pos, &remaining, bytes))
|
||||
return -EFAULT;
|
||||
}
|
||||
@@ -121,7 +122,7 @@ static ssize_t vfio_pci_igd_rw(struct vfio_pci_core_device *vdev,
|
||||
OPREGION_SIZE : 0);
|
||||
|
||||
if (igd_opregion_shift_copy(buf, &off,
|
||||
&rvda + (pos - OPREGION_RVDA),
|
||||
(u8 *)&rvda + (pos - OPREGION_RVDA),
|
||||
&pos, &remaining, bytes))
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
+14
-14
@@ -232,7 +232,7 @@ static inline bool vfio_iommu_driver_allowed(struct vfio_container *container,
|
||||
}
|
||||
#endif /* CONFIG_VFIO_NOIOMMU */
|
||||
|
||||
/**
|
||||
/*
|
||||
* IOMMU driver registration
|
||||
*/
|
||||
int vfio_register_iommu_driver(const struct vfio_iommu_driver_ops *ops)
|
||||
@@ -285,7 +285,7 @@ static int vfio_iommu_group_notifier(struct notifier_block *nb,
|
||||
unsigned long action, void *data);
|
||||
static void vfio_group_get(struct vfio_group *group);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Container objects - containers are created when /dev/vfio/vfio is
|
||||
* opened, but their lifecycle extends until the last user is done, so
|
||||
* it's freed via kref. Must support container/group/device being
|
||||
@@ -309,7 +309,7 @@ static void vfio_container_put(struct vfio_container *container)
|
||||
kref_put(&container->kref, vfio_container_release);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Group objects - create, release, get, put, search
|
||||
*/
|
||||
static struct vfio_group *
|
||||
@@ -488,7 +488,7 @@ static struct vfio_group *vfio_group_get_from_dev(struct device *dev)
|
||||
return group;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Device objects - create, release, get, put, search
|
||||
*/
|
||||
/* Device reference always implies a group reference */
|
||||
@@ -595,7 +595,7 @@ static int vfio_dev_viable(struct device *dev, void *data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Async device support
|
||||
*/
|
||||
static int vfio_group_nb_add_dev(struct vfio_group *group, struct device *dev)
|
||||
@@ -689,7 +689,7 @@ static int vfio_iommu_group_notifier(struct notifier_block *nb,
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* VFIO driver API
|
||||
*/
|
||||
void vfio_init_group_dev(struct vfio_device *device, struct device *dev,
|
||||
@@ -831,7 +831,7 @@ int vfio_register_emulated_iommu_dev(struct vfio_device *device)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vfio_register_emulated_iommu_dev);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Get a reference to the vfio_device for a device. Even if the
|
||||
* caller thinks they own the device, they could be racing with a
|
||||
* release call path, so we can't trust drvdata for the shortcut.
|
||||
@@ -965,7 +965,7 @@ void vfio_unregister_group_dev(struct vfio_device *device)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vfio_unregister_group_dev);
|
||||
|
||||
/**
|
||||
/*
|
||||
* VFIO base fd, /dev/vfio/vfio
|
||||
*/
|
||||
static long vfio_ioctl_check_extension(struct vfio_container *container,
|
||||
@@ -1183,7 +1183,7 @@ static const struct file_operations vfio_fops = {
|
||||
.compat_ioctl = compat_ptr_ioctl,
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* VFIO Group fd, /dev/vfio/$GROUP
|
||||
*/
|
||||
static void __vfio_group_unset_container(struct vfio_group *group)
|
||||
@@ -1536,7 +1536,7 @@ static const struct file_operations vfio_group_fops = {
|
||||
.release = vfio_group_fops_release,
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* VFIO Device fd
|
||||
*/
|
||||
static int vfio_device_fops_release(struct inode *inode, struct file *filep)
|
||||
@@ -1611,7 +1611,7 @@ static const struct file_operations vfio_device_fops = {
|
||||
.mmap = vfio_device_fops_mmap,
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* External user API, exported by symbols to be linked dynamically.
|
||||
*
|
||||
* The protocol includes:
|
||||
@@ -1659,7 +1659,7 @@ struct vfio_group *vfio_group_get_external_user(struct file *filep)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vfio_group_get_external_user);
|
||||
|
||||
/**
|
||||
/*
|
||||
* External user API, exported by symbols to be linked dynamically.
|
||||
* The external user passes in a device pointer
|
||||
* to verify that:
|
||||
@@ -1725,7 +1725,7 @@ long vfio_external_check_extension(struct vfio_group *group, unsigned long arg)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vfio_external_check_extension);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Sub-module support
|
||||
*/
|
||||
/*
|
||||
@@ -2272,7 +2272,7 @@ struct iommu_domain *vfio_group_iommu_domain(struct vfio_group *group)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(vfio_group_iommu_domain);
|
||||
|
||||
/**
|
||||
/*
|
||||
* Module/class support
|
||||
*/
|
||||
static char *vfio_devnode(struct device *dev, umode_t *mode)
|
||||
|
||||
Reference in New Issue
Block a user