Merge branch 'ib/5.17-cros-ec-keyb' into next

Merge changes to ChromeOS EC Keyboard driver.
This commit is contained in:
Dmitry Torokhov 2022-05-18 15:02:27 -07:00
commit 038c4bf85b
73 changed files with 405 additions and 328 deletions

View file

@ -15,14 +15,16 @@ description: |
Google's ChromeOS EC Keyboard is a simple matrix keyboard Google's ChromeOS EC Keyboard is a simple matrix keyboard
implemented on a separate EC (Embedded Controller) device. It provides implemented on a separate EC (Embedded Controller) device. It provides
a message for reading key scans from the EC. These are then converted a message for reading key scans from the EC. These are then converted
into keycodes for processing by the kernel. into keycodes for processing by the kernel. This device also supports
switches/buttons like power and volume buttons.
allOf:
- $ref: "/schemas/input/matrix-keymap.yaml#"
properties: properties:
compatible: compatible:
const: google,cros-ec-keyb oneOf:
- description: ChromeOS EC with only buttons/switches
const: google,cros-ec-keyb-switches
- description: ChromeOS EC with keyboard and possibly buttons/switches
const: google,cros-ec-keyb
google,needs-ghost-filter: google,needs-ghost-filter:
description: description:
@ -41,15 +43,31 @@ properties:
where the lower 16 bits are reserved. This property is specified only where the lower 16 bits are reserved. This property is specified only
when the keyboard has a custom design for the top row keys. when the keyboard has a custom design for the top row keys.
dependencies:
function-row-phsymap: [ 'linux,keymap' ]
google,needs-ghost-filter: [ 'linux,keymap' ]
required: required:
- compatible - compatible
if:
properties:
compatible:
contains:
const: google,cros-ec-keyb
then:
$ref: "/schemas/input/matrix-keymap.yaml#"
required:
- keypad,num-rows
- keypad,num-columns
- linux,keymap
unevaluatedProperties: false unevaluatedProperties: false
examples: examples:
- | - |
#include <dt-bindings/input/input.h> #include <dt-bindings/input/input.h>
cros-ec-keyb { keyboard-controller {
compatible = "google,cros-ec-keyb"; compatible = "google,cros-ec-keyb";
keypad,num-rows = <8>; keypad,num-rows = <8>;
keypad,num-columns = <13>; keypad,num-columns = <13>;
@ -113,3 +131,9 @@ examples:
/* UP LEFT */ /* UP LEFT */
0x070b0067 0x070c0069>; 0x070b0067 0x070c0069>;
}; };
- |
/* No matrix keyboard, just buttons/switches */
keyboard-controller {
compatible = "google,cros-ec-keyb-switches";
};
...

View file

@ -13382,6 +13382,7 @@ F: net/core/drop_monitor.c
NETWORKING DRIVERS NETWORKING DRIVERS
M: "David S. Miller" <davem@davemloft.net> M: "David S. Miller" <davem@davemloft.net>
M: Jakub Kicinski <kuba@kernel.org> M: Jakub Kicinski <kuba@kernel.org>
M: Paolo Abeni <pabeni@redhat.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
S: Maintained S: Maintained
Q: https://patchwork.kernel.org/project/netdevbpf/list/ Q: https://patchwork.kernel.org/project/netdevbpf/list/
@ -13428,6 +13429,7 @@ F: tools/testing/selftests/drivers/net/dsa/
NETWORKING [GENERAL] NETWORKING [GENERAL]
M: "David S. Miller" <davem@davemloft.net> M: "David S. Miller" <davem@davemloft.net>
M: Jakub Kicinski <kuba@kernel.org> M: Jakub Kicinski <kuba@kernel.org>
M: Paolo Abeni <pabeni@redhat.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
S: Maintained S: Maintained
Q: https://patchwork.kernel.org/project/netdevbpf/list/ Q: https://patchwork.kernel.org/project/netdevbpf/list/

View file

@ -2,7 +2,7 @@
VERSION = 5 VERSION = 5
PATCHLEVEL = 17 PATCHLEVEL = 17
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc8 EXTRAVERSION =
NAME = Superb Owl NAME = Superb Owl
# *DOCUMENTATION* # *DOCUMENTATION*

View file

@ -253,18 +253,18 @@ extirq: interrupt-controller@14 {
interrupt-controller; interrupt-controller;
reg = <0x14 4>; reg = <0x14 4>;
interrupt-map = interrupt-map =
<0 0 &gic 0 0 GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, <0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
<1 0 &gic 0 0 GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, <1 0 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
<2 0 &gic 0 0 GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, <2 0 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
<3 0 &gic 0 0 GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, <3 0 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
<4 0 &gic 0 0 GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>, <4 0 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
<5 0 &gic 0 0 GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>, <5 0 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
<6 0 &gic 0 0 GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>, <6 0 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
<7 0 &gic 0 0 GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>, <7 0 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
<8 0 &gic 0 0 GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <8 0 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
<9 0 &gic 0 0 GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, <9 0 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
<10 0 &gic 0 0 GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, <10 0 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
<11 0 &gic 0 0 GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; <11 0 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
interrupt-map-mask = <0xffffffff 0x0>; interrupt-map-mask = <0xffffffff 0x0>;
}; };
}; };

View file

@ -293,18 +293,18 @@ extirq: interrupt-controller@14 {
interrupt-controller; interrupt-controller;
reg = <0x14 4>; reg = <0x14 4>;
interrupt-map = interrupt-map =
<0 0 &gic 0 0 GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, <0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
<1 0 &gic 0 0 GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, <1 0 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
<2 0 &gic 0 0 GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, <2 0 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
<3 0 &gic 0 0 GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, <3 0 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
<4 0 &gic 0 0 GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>, <4 0 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
<5 0 &gic 0 0 GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>, <5 0 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
<6 0 &gic 0 0 GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>, <6 0 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
<7 0 &gic 0 0 GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>, <7 0 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
<8 0 &gic 0 0 GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <8 0 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
<9 0 &gic 0 0 GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, <9 0 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
<10 0 &gic 0 0 GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, <10 0 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
<11 0 &gic 0 0 GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; <11 0 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
interrupt-map-mask = <0xffffffff 0x0>; interrupt-map-mask = <0xffffffff 0x0>;
}; };
}; };

View file

@ -680,18 +680,18 @@ extirq: interrupt-controller@14 {
interrupt-controller; interrupt-controller;
reg = <0x14 4>; reg = <0x14 4>;
interrupt-map = interrupt-map =
<0 0 &gic 0 0 GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, <0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
<1 0 &gic 0 0 GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, <1 0 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>,
<2 0 &gic 0 0 GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, <2 0 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>,
<3 0 &gic 0 0 GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, <3 0 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>,
<4 0 &gic 0 0 GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>, <4 0 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>,
<5 0 &gic 0 0 GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>, <5 0 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>,
<6 0 &gic 0 0 GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>, <6 0 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>,
<7 0 &gic 0 0 GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>, <7 0 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
<8 0 &gic 0 0 GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, <8 0 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
<9 0 &gic 0 0 GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, <9 0 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
<10 0 &gic 0 0 GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, <10 0 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
<11 0 &gic 0 0 GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; <11 0 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
interrupt-map-mask = <0xffffffff 0x0>; interrupt-map-mask = <0xffffffff 0x0>;
}; };
}; };

View file

@ -56,14 +56,14 @@ enum arm64_bp_harden_el1_vectors {
DECLARE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector); DECLARE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector);
#ifndef CONFIG_UNMAP_KERNEL_AT_EL0 #ifndef CONFIG_UNMAP_KERNEL_AT_EL0
#define TRAMP_VALIAS 0 #define TRAMP_VALIAS 0ul
#endif #endif
static inline const char * static inline const char *
arm64_get_bp_hardening_vector(enum arm64_bp_harden_el1_vectors slot) arm64_get_bp_hardening_vector(enum arm64_bp_harden_el1_vectors slot)
{ {
if (arm64_kernel_unmapped_at_el0()) if (arm64_kernel_unmapped_at_el0())
return (char *)TRAMP_VALIAS + SZ_2K * slot; return (char *)(TRAMP_VALIAS + SZ_2K * slot);
WARN_ON_ONCE(slot == EL1_VECTOR_KPTI); WARN_ON_ONCE(slot == EL1_VECTOR_KPTI);

View file

@ -611,7 +611,6 @@ const struct arm64_cpu_capabilities arm64_errata[] = {
{ {
.desc = "ARM erratum 2077057", .desc = "ARM erratum 2077057",
.capability = ARM64_WORKAROUND_2077057, .capability = ARM64_WORKAROUND_2077057,
.type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM,
ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2), ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2),
}, },
#endif #endif

View file

@ -429,8 +429,23 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
FOP_END FOP_END
/* Special case for SETcc - 1 instruction per cc */ /* Special case for SETcc - 1 instruction per cc */
/*
* Depending on .config the SETcc functions look like:
*
* SETcc %al [3 bytes]
* RET [1 byte]
* INT3 [1 byte; CONFIG_SLS]
*
* Which gives possible sizes 4 or 5. When rounded up to the
* next power-of-two alignment they become 4 or 8.
*/
#define SETCC_LENGTH (4 + IS_ENABLED(CONFIG_SLS))
#define SETCC_ALIGN (4 << IS_ENABLED(CONFIG_SLS))
static_assert(SETCC_LENGTH <= SETCC_ALIGN);
#define FOP_SETCC(op) \ #define FOP_SETCC(op) \
".align 4 \n\t" \ ".align " __stringify(SETCC_ALIGN) " \n\t" \
".type " #op ", @function \n\t" \ ".type " #op ", @function \n\t" \
#op ": \n\t" \ #op ": \n\t" \
#op " %al \n\t" \ #op " %al \n\t" \
@ -1047,7 +1062,7 @@ static int em_bsr_c(struct x86_emulate_ctxt *ctxt)
static __always_inline u8 test_cc(unsigned int condition, unsigned long flags) static __always_inline u8 test_cc(unsigned int condition, unsigned long flags)
{ {
u8 rc; u8 rc;
void (*fop)(void) = (void *)em_setcc + 4 * (condition & 0xf); void (*fop)(void) = (void *)em_setcc + SETCC_ALIGN * (condition & 0xf);
flags = (flags & EFLAGS_MASK) | X86_EFLAGS_IF; flags = (flags & EFLAGS_MASK) | X86_EFLAGS_IF;
asm("push %[flags]; popf; " CALL_NOSPEC asm("push %[flags]; popf; " CALL_NOSPEC

View file

@ -50,6 +50,7 @@
#include "blk-mq-sched.h" #include "blk-mq-sched.h"
#include "blk-pm.h" #include "blk-pm.h"
#include "blk-throttle.h" #include "blk-throttle.h"
#include "blk-rq-qos.h"
struct dentry *blk_debugfs_root; struct dentry *blk_debugfs_root;
@ -314,6 +315,9 @@ void blk_cleanup_queue(struct request_queue *q)
*/ */
blk_freeze_queue(q); blk_freeze_queue(q);
/* cleanup rq qos structures for queue without disk */
rq_qos_exit(q);
blk_queue_flag_set(QUEUE_FLAG_DEAD, q); blk_queue_flag_set(QUEUE_FLAG_DEAD, q);
blk_sync_queue(q); blk_sync_queue(q);

View file

@ -1377,11 +1377,11 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp,
if (info->valid & ACPI_VALID_HID) { if (info->valid & ACPI_VALID_HID) {
acpi_add_id(pnp, info->hardware_id.string); acpi_add_id(pnp, info->hardware_id.string);
pnp->type.platform_id = 1; pnp->type.platform_id = 1;
if (info->valid & ACPI_VALID_CID) { }
cid_list = &info->compatible_id_list; if (info->valid & ACPI_VALID_CID) {
for (i = 0; i < cid_list->count; i++) cid_list = &info->compatible_id_list;
acpi_add_id(pnp, cid_list->ids[i].string); for (i = 0; i < cid_list->count; i++)
} acpi_add_id(pnp, cid_list->ids[i].string);
} }
if (info->valid & ACPI_VALID_ADR) { if (info->valid & ACPI_VALID_ADR) {
pnp->bus_address = info->address; pnp->bus_address = info->address;

View file

@ -1112,6 +1112,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags);
skb_data3 = skb->data[3]; skb_data3 = skb->data[3];
paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len, paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len,
DMA_TO_DEVICE); DMA_TO_DEVICE);
if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr))
return enq_next;
ENI_PRV_PADDR(skb) = paddr; ENI_PRV_PADDR(skb) = paddr;
/* prepare DMA queue entries */ /* prepare DMA queue entries */
j = 0; j = 0;

View file

@ -19,6 +19,11 @@
#include "counter-sysfs.h" #include "counter-sysfs.h"
static inline struct counter_device *counter_from_dev(struct device *dev)
{
return container_of(dev, struct counter_device, dev);
}
/** /**
* struct counter_attribute - Counter sysfs attribute * struct counter_attribute - Counter sysfs attribute
* @dev_attr: device attribute for sysfs * @dev_attr: device attribute for sysfs
@ -90,7 +95,7 @@ static ssize_t counter_comp_u8_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
const struct counter_attribute *const a = to_counter_attribute(attr); const struct counter_attribute *const a = to_counter_attribute(attr);
struct counter_device *const counter = dev_get_drvdata(dev); struct counter_device *const counter = counter_from_dev(dev);
int err; int err;
u8 data = 0; u8 data = 0;
@ -122,7 +127,7 @@ static ssize_t counter_comp_u8_store(struct device *dev,
const char *buf, size_t len) const char *buf, size_t len)
{ {
const struct counter_attribute *const a = to_counter_attribute(attr); const struct counter_attribute *const a = to_counter_attribute(attr);
struct counter_device *const counter = dev_get_drvdata(dev); struct counter_device *const counter = counter_from_dev(dev);
int err; int err;
bool bool_data = 0; bool bool_data = 0;
u8 data = 0; u8 data = 0;
@ -158,7 +163,7 @@ static ssize_t counter_comp_u32_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
const struct counter_attribute *const a = to_counter_attribute(attr); const struct counter_attribute *const a = to_counter_attribute(attr);
struct counter_device *const counter = dev_get_drvdata(dev); struct counter_device *const counter = counter_from_dev(dev);
const struct counter_available *const avail = a->comp.priv; const struct counter_available *const avail = a->comp.priv;
int err; int err;
u32 data = 0; u32 data = 0;
@ -221,7 +226,7 @@ static ssize_t counter_comp_u32_store(struct device *dev,
const char *buf, size_t len) const char *buf, size_t len)
{ {
const struct counter_attribute *const a = to_counter_attribute(attr); const struct counter_attribute *const a = to_counter_attribute(attr);
struct counter_device *const counter = dev_get_drvdata(dev); struct counter_device *const counter = counter_from_dev(dev);
struct counter_count *const count = a->parent; struct counter_count *const count = a->parent;
struct counter_synapse *const synapse = a->comp.priv; struct counter_synapse *const synapse = a->comp.priv;
const struct counter_available *const avail = a->comp.priv; const struct counter_available *const avail = a->comp.priv;
@ -281,7 +286,7 @@ static ssize_t counter_comp_u64_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
const struct counter_attribute *const a = to_counter_attribute(attr); const struct counter_attribute *const a = to_counter_attribute(attr);
struct counter_device *const counter = dev_get_drvdata(dev); struct counter_device *const counter = counter_from_dev(dev);
int err; int err;
u64 data = 0; u64 data = 0;
@ -309,7 +314,7 @@ static ssize_t counter_comp_u64_store(struct device *dev,
const char *buf, size_t len) const char *buf, size_t len)
{ {
const struct counter_attribute *const a = to_counter_attribute(attr); const struct counter_attribute *const a = to_counter_attribute(attr);
struct counter_device *const counter = dev_get_drvdata(dev); struct counter_device *const counter = counter_from_dev(dev);
int err; int err;
u64 data = 0; u64 data = 0;

View file

@ -8,6 +8,7 @@
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/crypto.h> #include <linux/crypto.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
@ -43,16 +44,19 @@ static int qcom_rng_read(struct qcom_rng *rng, u8 *data, unsigned int max)
{ {
unsigned int currsize = 0; unsigned int currsize = 0;
u32 val; u32 val;
int ret;
/* read random data from hardware */ /* read random data from hardware */
do { do {
val = readl_relaxed(rng->base + PRNG_STATUS); ret = readl_poll_timeout(rng->base + PRNG_STATUS, val,
if (!(val & PRNG_STATUS_DATA_AVAIL)) val & PRNG_STATUS_DATA_AVAIL,
break; 200, 10000);
if (ret)
return ret;
val = readl_relaxed(rng->base + PRNG_DATA_OUT); val = readl_relaxed(rng->base + PRNG_DATA_OUT);
if (!val) if (!val)
break; return -EINVAL;
if ((max - currsize) >= WORD_SZ) { if ((max - currsize) >= WORD_SZ) {
memcpy(data, &val, WORD_SZ); memcpy(data, &val, WORD_SZ);
@ -61,11 +65,10 @@ static int qcom_rng_read(struct qcom_rng *rng, u8 *data, unsigned int max)
} else { } else {
/* copy only remaining bytes */ /* copy only remaining bytes */
memcpy(data, &val, max - currsize); memcpy(data, &val, max - currsize);
break;
} }
} while (currsize < max); } while (currsize < max);
return currsize; return 0;
} }
static int qcom_rng_generate(struct crypto_rng *tfm, static int qcom_rng_generate(struct crypto_rng *tfm,
@ -87,7 +90,7 @@ static int qcom_rng_generate(struct crypto_rng *tfm,
mutex_unlock(&rng->lock); mutex_unlock(&rng->lock);
clk_disable_unprepare(rng->clk); clk_disable_unprepare(rng->clk);
return 0; return ret;
} }
static int qcom_rng_seed(struct crypto_rng *tfm, const u8 *seed, static int qcom_rng_seed(struct crypto_rng *tfm, const u8 *seed,

View file

@ -24,7 +24,7 @@ static bool dump_properties __initdata;
static int __init dump_properties_enable(char *arg) static int __init dump_properties_enable(char *arg)
{ {
dump_properties = true; dump_properties = true;
return 0; return 1;
} }
__setup("dump_apple_properties", dump_properties_enable); __setup("dump_apple_properties", dump_properties_enable);

View file

@ -212,7 +212,7 @@ static int __init efivar_ssdt_setup(char *str)
memcpy(efivar_ssdt, str, strlen(str)); memcpy(efivar_ssdt, str, strlen(str));
else else
pr_warn("efivar_ssdt: name too long: %s\n", str); pr_warn("efivar_ssdt: name too long: %s\n", str);
return 0; return 1;
} }
__setup("efivar_ssdt=", efivar_ssdt_setup); __setup("efivar_ssdt=", efivar_ssdt_setup);

View file

@ -1701,6 +1701,11 @@ static inline void gpiochip_irqchip_free_valid_mask(struct gpio_chip *gc)
*/ */
int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset) int gpiochip_generic_request(struct gpio_chip *gc, unsigned int offset)
{ {
#ifdef CONFIG_PINCTRL
if (list_empty(&gc->gpiodev->pin_ranges))
return 0;
#endif
return pinctrl_gpio_request(gc->gpiodev->base + offset); return pinctrl_gpio_request(gc->gpiodev->base + offset);
} }
EXPORT_SYMBOL_GPL(gpiochip_generic_request); EXPORT_SYMBOL_GPL(gpiochip_generic_request);
@ -1712,6 +1717,11 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_request);
*/ */
void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset) void gpiochip_generic_free(struct gpio_chip *gc, unsigned int offset)
{ {
#ifdef CONFIG_PINCTRL
if (list_empty(&gc->gpiodev->pin_ranges))
return;
#endif
pinctrl_gpio_free(gc->gpiodev->base + offset); pinctrl_gpio_free(gc->gpiodev->base + offset);
} }
EXPORT_SYMBOL_GPL(gpiochip_generic_free); EXPORT_SYMBOL_GPL(gpiochip_generic_free);

View file

@ -8,7 +8,6 @@ config DRM_BRIDGE
config DRM_PANEL_BRIDGE config DRM_PANEL_BRIDGE
def_bool y def_bool y
depends on DRM_BRIDGE depends on DRM_BRIDGE
depends on DRM_KMS_HELPER
select DRM_PANEL select DRM_PANEL
help help
DRM bridge wrapper of DRM panels DRM bridge wrapper of DRM panels
@ -30,6 +29,7 @@ config DRM_CDNS_DSI
config DRM_CHIPONE_ICN6211 config DRM_CHIPONE_ICN6211
tristate "Chipone ICN6211 MIPI-DSI/RGB Converter bridge" tristate "Chipone ICN6211 MIPI-DSI/RGB Converter bridge"
depends on OF depends on OF
select DRM_KMS_HELPER
select DRM_MIPI_DSI select DRM_MIPI_DSI
select DRM_PANEL_BRIDGE select DRM_PANEL_BRIDGE
help help

View file

@ -217,14 +217,6 @@ static int imx_pd_bridge_atomic_check(struct drm_bridge *bridge,
if (!imx_pd_format_supported(bus_fmt)) if (!imx_pd_format_supported(bus_fmt))
return -EINVAL; return -EINVAL;
if (bus_flags &
~(DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_DE_HIGH |
DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE |
DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE)) {
dev_warn(imxpd->dev, "invalid bus_flags (%x)\n", bus_flags);
return -EINVAL;
}
bridge_state->output_bus_cfg.flags = bus_flags; bridge_state->output_bus_cfg.flags = bus_flags;
bridge_state->input_bus_cfg.flags = bus_flags; bridge_state->input_bus_cfg.flags = bus_flags;
imx_crtc_state->bus_flags = bus_flags; imx_crtc_state->bus_flags = bus_flags;

View file

@ -404,9 +404,9 @@ mgag200_pixpll_update_g200wb(struct mgag200_pll *pixpll, const struct mgag200_pl
udelay(50); udelay(50);
/* program pixel pll register */ /* program pixel pll register */
WREG_DAC(MGA1064_PIX_PLLC_N, xpixpllcn); WREG_DAC(MGA1064_WB_PIX_PLLC_N, xpixpllcn);
WREG_DAC(MGA1064_PIX_PLLC_M, xpixpllcm); WREG_DAC(MGA1064_WB_PIX_PLLC_M, xpixpllcm);
WREG_DAC(MGA1064_PIX_PLLC_P, xpixpllcp); WREG_DAC(MGA1064_WB_PIX_PLLC_P, xpixpllcp);
udelay(50); udelay(50);

View file

@ -107,6 +107,7 @@ config DRM_PANEL_EDP
select VIDEOMODE_HELPERS select VIDEOMODE_HELPERS
select DRM_DP_AUX_BUS select DRM_DP_AUX_BUS
select DRM_DP_HELPER select DRM_DP_HELPER
select DRM_KMS_HELPER
help help
DRM panel driver for dumb eDP panels that need at most a regulator and DRM panel driver for dumb eDP panels that need at most a regulator and
a GPIO to be powered up. Optionally a backlight can be attached so a GPIO to be powered up. Optionally a backlight can be attached so

View file

@ -2017,7 +2017,7 @@ static const struct display_timing innolux_g070y2_l01_timing = {
static const struct panel_desc innolux_g070y2_l01 = { static const struct panel_desc innolux_g070y2_l01 = {
.timings = &innolux_g070y2_l01_timing, .timings = &innolux_g070y2_l01_timing,
.num_timings = 1, .num_timings = 1,
.bpc = 6, .bpc = 8,
.size = { .size = {
.width = 152, .width = 152,
.height = 91, .height = 91,

View file

@ -435,10 +435,13 @@ static __maybe_unused int cros_ec_keyb_resume(struct device *dev)
* but the ckdev->bs_idev will remain NULL when this function exits. * but the ckdev->bs_idev will remain NULL when this function exits.
* *
* @ckdev: The keyboard device * @ckdev: The keyboard device
* @expect_buttons_switches: Indicates that EC must report button and/or
* switch events
* *
* Returns 0 if no error or -error upon error. * Returns 0 if no error or -error upon error.
*/ */
static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev) static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev,
bool expect_buttons_switches)
{ {
struct cros_ec_device *ec_dev = ckdev->ec; struct cros_ec_device *ec_dev = ckdev->ec;
struct device *dev = ckdev->dev; struct device *dev = ckdev->dev;
@ -465,7 +468,7 @@ static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev)
switches = get_unaligned_le32(&event_data.switches); switches = get_unaligned_le32(&event_data.switches);
if (!buttons && !switches) if (!buttons && !switches)
return 0; return expect_buttons_switches ? -EINVAL : 0;
/* /*
* We call the non-matrix buttons/switches 'input1', if present. * We call the non-matrix buttons/switches 'input1', if present.
@ -516,7 +519,7 @@ static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev)
} }
/** /**
* cros_ec_keyb_register_bs - Register matrix keys * cros_ec_keyb_register_matrix - Register matrix keys
* *
* Handles all the bits of the keyboard driver related to matrix keys. * Handles all the bits of the keyboard driver related to matrix keys.
* *
@ -648,12 +651,12 @@ static const struct attribute_group cros_ec_keyb_attr_group = {
.attrs = cros_ec_keyb_attrs, .attrs = cros_ec_keyb_attrs,
}; };
static int cros_ec_keyb_probe(struct platform_device *pdev) static int cros_ec_keyb_probe(struct platform_device *pdev)
{ {
struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent); struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent);
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct cros_ec_keyb *ckdev; struct cros_ec_keyb *ckdev;
bool buttons_switches_only = device_get_match_data(dev);
int err; int err;
if (!dev->of_node) if (!dev->of_node)
@ -667,13 +670,16 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
ckdev->dev = dev; ckdev->dev = dev;
dev_set_drvdata(dev, ckdev); dev_set_drvdata(dev, ckdev);
err = cros_ec_keyb_register_matrix(ckdev); if (!buttons_switches_only) {
if (err) { err = cros_ec_keyb_register_matrix(ckdev);
dev_err(dev, "cannot register matrix inputs: %d\n", err); if (err) {
return err; dev_err(dev, "cannot register matrix inputs: %d\n",
err);
return err;
}
} }
err = cros_ec_keyb_register_bs(ckdev); err = cros_ec_keyb_register_bs(ckdev, buttons_switches_only);
if (err) { if (err) {
dev_err(dev, "cannot register non-matrix inputs: %d\n", err); dev_err(dev, "cannot register non-matrix inputs: %d\n", err);
return err; return err;
@ -681,7 +687,7 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
err = devm_device_add_group(dev, &cros_ec_keyb_attr_group); err = devm_device_add_group(dev, &cros_ec_keyb_attr_group);
if (err) { if (err) {
dev_err(dev, "failed to create attributes. err=%d\n", err); dev_err(dev, "failed to create attributes: %d\n", err);
return err; return err;
} }
@ -710,7 +716,8 @@ static int cros_ec_keyb_remove(struct platform_device *pdev)
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id cros_ec_keyb_of_match[] = { static const struct of_device_id cros_ec_keyb_of_match[] = {
{ .compatible = "google,cros-ec-keyb" }, { .compatible = "google,cros-ec-keyb" },
{}, { .compatible = "google,cros-ec-keyb-switches", .data = (void *)true },
{}
}; };
MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match); MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match);
#endif #endif

View file

@ -1786,15 +1786,13 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0); input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0);
/* Verify that a device really has an endpoint */ err = usb_find_common_endpoints(intf->cur_altsetting,
if (intf->cur_altsetting->desc.bNumEndpoints < 1) { NULL, NULL, &endpoint, NULL);
if (err) {
dev_err(&intf->dev, dev_err(&intf->dev,
"interface has %d endpoints, but must have minimum 1\n", "interface has no int in endpoints, but must have minimum 1\n");
intf->cur_altsetting->desc.bNumEndpoints);
err = -EINVAL;
goto fail3; goto fail3;
} }
endpoint = &intf->cur_altsetting->endpoint[0].desc;
/* Go set up our URB, which is called when the tablet receives /* Go set up our URB, which is called when the tablet receives
* input. * input.

View file

@ -135,7 +135,7 @@ struct point_coord {
struct touch_event { struct touch_event {
__le16 status; __le16 status;
u8 finger_cnt; u8 finger_mask;
u8 time_stamp; u8 time_stamp;
struct point_coord point_coord[MAX_SUPPORTED_FINGER_NUM]; struct point_coord point_coord[MAX_SUPPORTED_FINGER_NUM];
}; };
@ -322,11 +322,32 @@ static int zinitix_send_power_on_sequence(struct bt541_ts_data *bt541)
static void zinitix_report_finger(struct bt541_ts_data *bt541, int slot, static void zinitix_report_finger(struct bt541_ts_data *bt541, int slot,
const struct point_coord *p) const struct point_coord *p)
{ {
u16 x, y;
if (unlikely(!(p->sub_status &
(SUB_BIT_UP | SUB_BIT_DOWN | SUB_BIT_MOVE)))) {
dev_dbg(&bt541->client->dev, "unknown finger event %#02x\n",
p->sub_status);
return;
}
x = le16_to_cpu(p->x);
y = le16_to_cpu(p->y);
input_mt_slot(bt541->input_dev, slot); input_mt_slot(bt541->input_dev, slot);
input_mt_report_slot_state(bt541->input_dev, MT_TOOL_FINGER, true); if (input_mt_report_slot_state(bt541->input_dev, MT_TOOL_FINGER,
touchscreen_report_pos(bt541->input_dev, &bt541->prop, !(p->sub_status & SUB_BIT_UP))) {
le16_to_cpu(p->x), le16_to_cpu(p->y), true); touchscreen_report_pos(bt541->input_dev,
input_report_abs(bt541->input_dev, ABS_MT_TOUCH_MAJOR, p->width); &bt541->prop, x, y, true);
input_report_abs(bt541->input_dev,
ABS_MT_TOUCH_MAJOR, p->width);
dev_dbg(&bt541->client->dev, "finger %d %s (%u, %u)\n",
slot, p->sub_status & SUB_BIT_DOWN ? "down" : "move",
x, y);
} else {
dev_dbg(&bt541->client->dev, "finger %d up (%u, %u)\n",
slot, x, y);
}
} }
static irqreturn_t zinitix_ts_irq_handler(int irq, void *bt541_handler) static irqreturn_t zinitix_ts_irq_handler(int irq, void *bt541_handler)
@ -334,6 +355,7 @@ static irqreturn_t zinitix_ts_irq_handler(int irq, void *bt541_handler)
struct bt541_ts_data *bt541 = bt541_handler; struct bt541_ts_data *bt541 = bt541_handler;
struct i2c_client *client = bt541->client; struct i2c_client *client = bt541->client;
struct touch_event touch_event; struct touch_event touch_event;
unsigned long finger_mask;
int error; int error;
int i; int i;
@ -346,10 +368,14 @@ static irqreturn_t zinitix_ts_irq_handler(int irq, void *bt541_handler)
goto out; goto out;
} }
for (i = 0; i < MAX_SUPPORTED_FINGER_NUM; i++) finger_mask = touch_event.finger_mask;
if (touch_event.point_coord[i].sub_status & SUB_BIT_EXIST) for_each_set_bit(i, &finger_mask, MAX_SUPPORTED_FINGER_NUM) {
zinitix_report_finger(bt541, i, const struct point_coord *p = &touch_event.point_coord[i];
&touch_event.point_coord[i]);
/* Only process contacts that are actually reported */
if (p->sub_status & SUB_BIT_EXIST)
zinitix_report_finger(bt541, i, p);
}
input_mt_sync_frame(bt541->input_dev); input_mt_sync_frame(bt541->input_dev);
input_sync(bt541->input_dev); input_sync(bt541->input_dev);

View file

@ -124,12 +124,23 @@ static const struct of_device_id ksz8795_dt_ids[] = {
}; };
MODULE_DEVICE_TABLE(of, ksz8795_dt_ids); MODULE_DEVICE_TABLE(of, ksz8795_dt_ids);
static const struct spi_device_id ksz8795_spi_ids[] = {
{ "ksz8765" },
{ "ksz8794" },
{ "ksz8795" },
{ "ksz8863" },
{ "ksz8873" },
{ },
};
MODULE_DEVICE_TABLE(spi, ksz8795_spi_ids);
static struct spi_driver ksz8795_spi_driver = { static struct spi_driver ksz8795_spi_driver = {
.driver = { .driver = {
.name = "ksz8795-switch", .name = "ksz8795-switch",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = of_match_ptr(ksz8795_dt_ids), .of_match_table = of_match_ptr(ksz8795_dt_ids),
}, },
.id_table = ksz8795_spi_ids,
.probe = ksz8795_spi_probe, .probe = ksz8795_spi_probe,
.remove = ksz8795_spi_remove, .remove = ksz8795_spi_remove,
.shutdown = ksz8795_spi_shutdown, .shutdown = ksz8795_spi_shutdown,

View file

@ -98,12 +98,24 @@ static const struct of_device_id ksz9477_dt_ids[] = {
}; };
MODULE_DEVICE_TABLE(of, ksz9477_dt_ids); MODULE_DEVICE_TABLE(of, ksz9477_dt_ids);
static const struct spi_device_id ksz9477_spi_ids[] = {
{ "ksz9477" },
{ "ksz9897" },
{ "ksz9893" },
{ "ksz9563" },
{ "ksz8563" },
{ "ksz9567" },
{ },
};
MODULE_DEVICE_TABLE(spi, ksz9477_spi_ids);
static struct spi_driver ksz9477_spi_driver = { static struct spi_driver ksz9477_spi_driver = {
.driver = { .driver = {
.name = "ksz9477-switch", .name = "ksz9477-switch",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = of_match_ptr(ksz9477_dt_ids), .of_match_table = of_match_ptr(ksz9477_dt_ids),
}, },
.id_table = ksz9477_spi_ids,
.probe = ksz9477_spi_probe, .probe = ksz9477_spi_probe,
.remove = ksz9477_spi_remove, .remove = ksz9477_spi_remove,
.shutdown = ksz9477_spi_shutdown, .shutdown = ksz9477_spi_shutdown,

View file

@ -1181,8 +1181,11 @@ static int alx_change_mtu(struct net_device *netdev, int mtu)
alx->hw.mtu = mtu; alx->hw.mtu = mtu;
alx->rxbuf_size = max(max_frame, ALX_DEF_RXBUF_SIZE); alx->rxbuf_size = max(max_frame, ALX_DEF_RXBUF_SIZE);
netdev_update_features(netdev); netdev_update_features(netdev);
if (netif_running(netdev)) if (netif_running(netdev)) {
mutex_lock(&alx->mtx);
alx_reinit(alx); alx_reinit(alx);
mutex_unlock(&alx->mtx);
}
return 0; return 0;
} }

View file

@ -2533,6 +2533,4 @@ void bnx2x_register_phc(struct bnx2x *bp);
* Meant for implicit re-load flows. * Meant for implicit re-load flows.
*/ */
int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp); int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp);
int bnx2x_init_firmware(struct bnx2x *bp);
void bnx2x_release_firmware(struct bnx2x *bp);
#endif /* bnx2x.h */ #endif /* bnx2x.h */

View file

@ -2364,24 +2364,30 @@ int bnx2x_compare_fw_ver(struct bnx2x *bp, u32 load_code, bool print_err)
/* is another pf loaded on this engine? */ /* is another pf loaded on this engine? */
if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP && if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP &&
load_code != FW_MSG_CODE_DRV_LOAD_COMMON) { load_code != FW_MSG_CODE_DRV_LOAD_COMMON) {
/* build my FW version dword */ u8 loaded_fw_major, loaded_fw_minor, loaded_fw_rev, loaded_fw_eng;
u32 my_fw = (bp->fw_major) + (bp->fw_minor << 8) + u32 loaded_fw;
(bp->fw_rev << 16) + (bp->fw_eng << 24);
/* read loaded FW from chip */ /* read loaded FW from chip */
u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM); loaded_fw = REG_RD(bp, XSEM_REG_PRAM);
DP(BNX2X_MSG_SP, "loaded fw %x, my fw %x\n", loaded_fw_major = loaded_fw & 0xff;
loaded_fw, my_fw); loaded_fw_minor = (loaded_fw >> 8) & 0xff;
loaded_fw_rev = (loaded_fw >> 16) & 0xff;
loaded_fw_eng = (loaded_fw >> 24) & 0xff;
DP(BNX2X_MSG_SP, "loaded fw 0x%x major 0x%x minor 0x%x rev 0x%x eng 0x%x\n",
loaded_fw, loaded_fw_major, loaded_fw_minor, loaded_fw_rev, loaded_fw_eng);
/* abort nic load if version mismatch */ /* abort nic load if version mismatch */
if (my_fw != loaded_fw) { if (loaded_fw_major != BCM_5710_FW_MAJOR_VERSION ||
loaded_fw_minor != BCM_5710_FW_MINOR_VERSION ||
loaded_fw_eng != BCM_5710_FW_ENGINEERING_VERSION ||
loaded_fw_rev < BCM_5710_FW_REVISION_VERSION_V15) {
if (print_err) if (print_err)
BNX2X_ERR("bnx2x with FW %x was already loaded which mismatches my %x FW. Aborting\n", BNX2X_ERR("loaded FW incompatible. Aborting\n");
loaded_fw, my_fw);
else else
BNX2X_DEV_INFO("bnx2x with FW %x was already loaded which mismatches my %x FW, possibly due to MF UNDI\n", BNX2X_DEV_INFO("loaded FW incompatible, possibly due to MF UNDI\n");
loaded_fw, my_fw);
return -EBUSY; return -EBUSY;
} }
} }

View file

@ -12319,15 +12319,6 @@ static int bnx2x_init_bp(struct bnx2x *bp)
bnx2x_read_fwinfo(bp); bnx2x_read_fwinfo(bp);
if (IS_PF(bp)) {
rc = bnx2x_init_firmware(bp);
if (rc) {
bnx2x_free_mem_bp(bp);
return rc;
}
}
func = BP_FUNC(bp); func = BP_FUNC(bp);
/* need to reset chip if undi was active */ /* need to reset chip if undi was active */
@ -12340,7 +12331,6 @@ static int bnx2x_init_bp(struct bnx2x *bp)
rc = bnx2x_prev_unload(bp); rc = bnx2x_prev_unload(bp);
if (rc) { if (rc) {
bnx2x_release_firmware(bp);
bnx2x_free_mem_bp(bp); bnx2x_free_mem_bp(bp);
return rc; return rc;
} }
@ -13409,7 +13399,7 @@ do { \
(u8 *)bp->arr, len); \ (u8 *)bp->arr, len); \
} while (0) } while (0)
int bnx2x_init_firmware(struct bnx2x *bp) static int bnx2x_init_firmware(struct bnx2x *bp)
{ {
const char *fw_file_name, *fw_file_name_v15; const char *fw_file_name, *fw_file_name_v15;
struct bnx2x_fw_file_hdr *fw_hdr; struct bnx2x_fw_file_hdr *fw_hdr;
@ -13509,7 +13499,7 @@ int bnx2x_init_firmware(struct bnx2x *bp)
return rc; return rc;
} }
void bnx2x_release_firmware(struct bnx2x *bp) static void bnx2x_release_firmware(struct bnx2x *bp)
{ {
kfree(bp->init_ops_offsets); kfree(bp->init_ops_offsets);
kfree(bp->init_ops); kfree(bp->init_ops);
@ -14026,7 +14016,6 @@ static int bnx2x_init_one(struct pci_dev *pdev,
return 0; return 0;
init_one_freemem: init_one_freemem:
bnx2x_release_firmware(bp);
bnx2x_free_mem_bp(bp); bnx2x_free_mem_bp(bp);
init_one_exit: init_one_exit:

View file

@ -2287,8 +2287,10 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_rx_ring *ring,
dma_length_status = status->length_status; dma_length_status = status->length_status;
if (dev->features & NETIF_F_RXCSUM) { if (dev->features & NETIF_F_RXCSUM) {
rx_csum = (__force __be16)(status->rx_csum & 0xffff); rx_csum = (__force __be16)(status->rx_csum & 0xffff);
skb->csum = (__force __wsum)ntohs(rx_csum); if (rx_csum) {
skb->ip_summed = CHECKSUM_COMPLETE; skb->csum = (__force __wsum)ntohs(rx_csum);
skb->ip_summed = CHECKSUM_COMPLETE;
}
} }
/* DMA flags and length are still valid no matter how /* DMA flags and length are still valid no matter how

View file

@ -2541,6 +2541,13 @@ static void iavf_watchdog_task(struct work_struct *work)
queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2); queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2);
} }
/**
* iavf_disable_vf - disable VF
* @adapter: board private structure
*
* Set communication failed flag and free all resources.
* NOTE: This function is expected to be called with crit_lock being held.
**/
static void iavf_disable_vf(struct iavf_adapter *adapter) static void iavf_disable_vf(struct iavf_adapter *adapter)
{ {
struct iavf_mac_filter *f, *ftmp; struct iavf_mac_filter *f, *ftmp;
@ -2595,7 +2602,6 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
memset(adapter->vf_res, 0, IAVF_VIRTCHNL_VF_RESOURCE_SIZE); memset(adapter->vf_res, 0, IAVF_VIRTCHNL_VF_RESOURCE_SIZE);
iavf_shutdown_adminq(&adapter->hw); iavf_shutdown_adminq(&adapter->hw);
adapter->netdev->flags &= ~IFF_UP; adapter->netdev->flags &= ~IFF_UP;
mutex_unlock(&adapter->crit_lock);
adapter->flags &= ~IAVF_FLAG_RESET_PENDING; adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
iavf_change_state(adapter, __IAVF_DOWN); iavf_change_state(adapter, __IAVF_DOWN);
wake_up(&adapter->down_waitqueue); wake_up(&adapter->down_waitqueue);
@ -4614,6 +4620,13 @@ static void iavf_remove(struct pci_dev *pdev)
struct iavf_hw *hw = &adapter->hw; struct iavf_hw *hw = &adapter->hw;
int err; int err;
/* When reboot/shutdown is in progress no need to do anything
* as the adapter is already REMOVE state that was set during
* iavf_shutdown() callback.
*/
if (adapter->state == __IAVF_REMOVE)
return;
set_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section); set_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section);
/* Wait until port initialization is complete. /* Wait until port initialization is complete.
* There are flows where register/unregister netdev may race. * There are flows where register/unregister netdev may race.

View file

@ -4880,7 +4880,6 @@ static void ice_remove(struct pci_dev *pdev)
ice_devlink_unregister_params(pf); ice_devlink_unregister_params(pf);
set_bit(ICE_DOWN, pf->state); set_bit(ICE_DOWN, pf->state);
mutex_destroy(&(&pf->hw)->fdir_fltr_lock);
ice_deinit_lag(pf); ice_deinit_lag(pf);
if (test_bit(ICE_FLAG_PTP_SUPPORTED, pf->flags)) if (test_bit(ICE_FLAG_PTP_SUPPORTED, pf->flags))
ice_ptp_release(pf); ice_ptp_release(pf);
@ -4888,6 +4887,7 @@ static void ice_remove(struct pci_dev *pdev)
ice_remove_arfs(pf); ice_remove_arfs(pf);
ice_setup_mc_magic_wake(pf); ice_setup_mc_magic_wake(pf);
ice_vsi_release_all(pf); ice_vsi_release_all(pf);
mutex_destroy(&(&pf->hw)->fdir_fltr_lock);
ice_set_wake(pf); ice_set_wake(pf);
ice_free_irq_msix_misc(pf); ice_free_irq_msix_misc(pf);
ice_for_each_vsi(pf, i) { ice_for_each_vsi(pf, i) {
@ -5962,8 +5962,9 @@ ice_update_vsi_tx_ring_stats(struct ice_vsi *vsi,
u64 pkts = 0, bytes = 0; u64 pkts = 0, bytes = 0;
ring = READ_ONCE(rings[i]); ring = READ_ONCE(rings[i]);
if (ring) if (!ring)
ice_fetch_u64_stats_per_ring(&ring->syncp, ring->stats, &pkts, &bytes); continue;
ice_fetch_u64_stats_per_ring(&ring->syncp, ring->stats, &pkts, &bytes);
vsi_stats->tx_packets += pkts; vsi_stats->tx_packets += pkts;
vsi_stats->tx_bytes += bytes; vsi_stats->tx_bytes += bytes;
vsi->tx_restart += ring->tx_stats.restart_q; vsi->tx_restart += ring->tx_stats.restart_q;

View file

@ -60,6 +60,12 @@ static int ocelot_chain_to_block(int chain, bool ingress)
*/ */
static int ocelot_chain_to_lookup(int chain) static int ocelot_chain_to_lookup(int chain)
{ {
/* Backwards compatibility with older, single-chain tc-flower
* offload support in Ocelot
*/
if (chain == 0)
return 0;
return (chain / VCAP_LOOKUP) % 10; return (chain / VCAP_LOOKUP) % 10;
} }
@ -68,7 +74,15 @@ static int ocelot_chain_to_lookup(int chain)
*/ */
static int ocelot_chain_to_pag(int chain) static int ocelot_chain_to_pag(int chain)
{ {
int lookup = ocelot_chain_to_lookup(chain); int lookup;
/* Backwards compatibility with older, single-chain tc-flower
* offload support in Ocelot
*/
if (chain == 0)
return 0;
lookup = ocelot_chain_to_lookup(chain);
/* calculate PAG value as chain index relative to the first PAG */ /* calculate PAG value as chain index relative to the first PAG */
return chain - VCAP_IS2_CHAIN(lookup, 0); return chain - VCAP_IS2_CHAIN(lookup, 0);

View file

@ -1587,6 +1587,9 @@ static void netvsc_get_ethtool_stats(struct net_device *dev,
pcpu_sum = kvmalloc_array(num_possible_cpus(), pcpu_sum = kvmalloc_array(num_possible_cpus(),
sizeof(struct netvsc_ethtool_pcpu_stats), sizeof(struct netvsc_ethtool_pcpu_stats),
GFP_KERNEL); GFP_KERNEL);
if (!pcpu_sum)
return;
netvsc_get_pcpu_stats(dev, pcpu_sum); netvsc_get_pcpu_stats(dev, pcpu_sum);
for_each_present_cpu(cpu) { for_each_present_cpu(cpu) {
struct netvsc_ethtool_pcpu_stats *this_sum = &pcpu_sum[cpu]; struct netvsc_ethtool_pcpu_stats *this_sum = &pcpu_sum[cpu];

View file

@ -187,6 +187,13 @@ static const struct regmap_config mscc_miim_regmap_config = {
.reg_stride = 4, .reg_stride = 4,
}; };
static const struct regmap_config mscc_miim_phy_regmap_config = {
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
.name = "phy",
};
int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name, int mscc_miim_setup(struct device *dev, struct mii_bus **pbus, const char *name,
struct regmap *mii_regmap, int status_offset) struct regmap *mii_regmap, int status_offset)
{ {
@ -250,7 +257,7 @@ static int mscc_miim_probe(struct platform_device *pdev)
} }
phy_regmap = devm_regmap_init_mmio(&pdev->dev, phy_regs, phy_regmap = devm_regmap_init_mmio(&pdev->dev, phy_regs,
&mscc_miim_regmap_config); &mscc_miim_phy_regmap_config);
if (IS_ERR(phy_regmap)) { if (IS_ERR(phy_regmap)) {
dev_err(&pdev->dev, "Unable to create phy register regmap\n"); dev_err(&pdev->dev, "Unable to create phy register regmap\n");
return PTR_ERR(phy_regmap); return PTR_ERR(phy_regmap);

View file

@ -1687,8 +1687,8 @@ static int marvell_suspend(struct phy_device *phydev)
int err; int err;
/* Suspend the fiber mode first */ /* Suspend the fiber mode first */
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
phydev->supported)) { phydev->supported)) {
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
if (err < 0) if (err < 0)
goto error; goto error;
@ -1722,8 +1722,8 @@ static int marvell_resume(struct phy_device *phydev)
int err; int err;
/* Resume the fiber mode first */ /* Resume the fiber mode first */
if (!linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, if (linkmode_test_bit(ETHTOOL_LINK_MODE_FIBRE_BIT,
phydev->supported)) { phydev->supported)) {
err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE);
if (err < 0) if (err < 0)
goto error; goto error;

View file

@ -2685,3 +2685,6 @@ MODULE_DEVICE_TABLE(mdio, vsc85xx_tbl);
MODULE_DESCRIPTION("Microsemi VSC85xx PHY driver"); MODULE_DESCRIPTION("Microsemi VSC85xx PHY driver");
MODULE_AUTHOR("Nagaraju Lakkaraju"); MODULE_AUTHOR("Nagaraju Lakkaraju");
MODULE_LICENSE("Dual MIT/GPL"); MODULE_LICENSE("Dual MIT/GPL");
MODULE_FIRMWARE(MSCC_VSC8584_REVB_INT8051_FW);
MODULE_FIRMWARE(MSCC_VSC8574_REVB_INT8051_FW);

View file

@ -2611,36 +2611,9 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
ath10k_mac_handle_beacon(ar, skb); ath10k_mac_handle_beacon(ar, skb);
if (ieee80211_is_beacon(hdr->frame_control) || if (ieee80211_is_beacon(hdr->frame_control) ||
ieee80211_is_probe_resp(hdr->frame_control)) { ieee80211_is_probe_resp(hdr->frame_control))
struct ieee80211_mgmt *mgmt = (void *)skb->data;
enum cfg80211_bss_frame_type ftype;
u8 *ies;
int ies_ch;
status->boottime_ns = ktime_get_boottime_ns(); status->boottime_ns = ktime_get_boottime_ns();
if (!ar->scan_channel)
goto drop;
ies = mgmt->u.beacon.variable;
if (ieee80211_is_beacon(mgmt->frame_control))
ftype = CFG80211_BSS_FTYPE_BEACON;
else
ftype = CFG80211_BSS_FTYPE_PRESP;
ies_ch = cfg80211_get_ies_channel_number(mgmt->u.beacon.variable,
skb_tail_pointer(skb) - ies,
sband->band, ftype);
if (ies_ch > 0 && ies_ch != channel) {
ath10k_dbg(ar, ATH10K_DBG_MGMT,
"channel mismatched ds channel %d scan channel %d\n",
ies_ch, channel);
goto drop;
}
}
ath10k_dbg(ar, ATH10K_DBG_MGMT, ath10k_dbg(ar, ATH10K_DBG_MGMT,
"event mgmt rx skb %pK len %d ftype %02x stype %02x\n", "event mgmt rx skb %pK len %d ftype %02x stype %02x\n",
skb, skb->len, skb, skb->len,
@ -2654,10 +2627,6 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
ieee80211_rx_ni(ar->hw, skb); ieee80211_rx_ni(ar->hw, skb);
return 0; return 0;
drop:
dev_kfree_skb(skb);
return 0;
} }
static int freq_to_idx(struct ath10k *ar, int freq) static int freq_to_idx(struct ath10k *ar, int freq)

View file

@ -1233,44 +1233,6 @@ static ssize_t nvmet_subsys_attr_model_store(struct config_item *item,
} }
CONFIGFS_ATTR(nvmet_subsys_, attr_model); CONFIGFS_ATTR(nvmet_subsys_, attr_model);
static ssize_t nvmet_subsys_attr_discovery_nqn_show(struct config_item *item,
char *page)
{
return snprintf(page, PAGE_SIZE, "%s\n",
nvmet_disc_subsys->subsysnqn);
}
static ssize_t nvmet_subsys_attr_discovery_nqn_store(struct config_item *item,
const char *page, size_t count)
{
struct nvmet_subsys *subsys = to_subsys(item);
char *subsysnqn;
int len;
len = strcspn(page, "\n");
if (!len)
return -EINVAL;
subsysnqn = kmemdup_nul(page, len, GFP_KERNEL);
if (!subsysnqn)
return -ENOMEM;
/*
* The discovery NQN must be different from subsystem NQN.
*/
if (!strcmp(subsysnqn, subsys->subsysnqn)) {
kfree(subsysnqn);
return -EBUSY;
}
down_write(&nvmet_config_sem);
kfree(nvmet_disc_subsys->subsysnqn);
nvmet_disc_subsys->subsysnqn = subsysnqn;
up_write(&nvmet_config_sem);
return count;
}
CONFIGFS_ATTR(nvmet_subsys_, attr_discovery_nqn);
#ifdef CONFIG_BLK_DEV_INTEGRITY #ifdef CONFIG_BLK_DEV_INTEGRITY
static ssize_t nvmet_subsys_attr_pi_enable_show(struct config_item *item, static ssize_t nvmet_subsys_attr_pi_enable_show(struct config_item *item,
char *page) char *page)
@ -1300,7 +1262,6 @@ static struct configfs_attribute *nvmet_subsys_attrs[] = {
&nvmet_subsys_attr_attr_cntlid_min, &nvmet_subsys_attr_attr_cntlid_min,
&nvmet_subsys_attr_attr_cntlid_max, &nvmet_subsys_attr_attr_cntlid_max,
&nvmet_subsys_attr_attr_model, &nvmet_subsys_attr_attr_model,
&nvmet_subsys_attr_attr_discovery_nqn,
#ifdef CONFIG_BLK_DEV_INTEGRITY #ifdef CONFIG_BLK_DEV_INTEGRITY
&nvmet_subsys_attr_attr_pi_enable, &nvmet_subsys_attr_attr_pi_enable,
#endif #endif

View file

@ -1493,8 +1493,7 @@ static struct nvmet_subsys *nvmet_find_get_subsys(struct nvmet_port *port,
if (!port) if (!port)
return NULL; return NULL;
if (!strcmp(NVME_DISC_SUBSYS_NAME, subsysnqn) || if (!strcmp(NVME_DISC_SUBSYS_NAME, subsysnqn)) {
!strcmp(nvmet_disc_subsys->subsysnqn, subsysnqn)) {
if (!kref_get_unless_zero(&nvmet_disc_subsys->ref)) if (!kref_get_unless_zero(&nvmet_disc_subsys->ref))
return NULL; return NULL;
return nvmet_disc_subsys; return nvmet_disc_subsys;

View file

@ -986,8 +986,6 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic,
CMD_SP(sc) = NULL; CMD_SP(sc) = NULL;
CMD_FLAGS(sc) |= FNIC_IO_DONE; CMD_FLAGS(sc) |= FNIC_IO_DONE;
spin_unlock_irqrestore(io_lock, flags);
if (hdr_status != FCPIO_SUCCESS) { if (hdr_status != FCPIO_SUCCESS) {
atomic64_inc(&fnic_stats->io_stats.io_failures); atomic64_inc(&fnic_stats->io_stats.io_failures);
shost_printk(KERN_ERR, fnic->lport->host, "hdr status = %s\n", shost_printk(KERN_ERR, fnic->lport->host, "hdr status = %s\n",
@ -996,8 +994,6 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic,
fnic_release_ioreq_buf(fnic, io_req, sc); fnic_release_ioreq_buf(fnic, io_req, sc);
mempool_free(io_req, fnic->io_req_pool);
cmd_trace = ((u64)hdr_status << 56) | cmd_trace = ((u64)hdr_status << 56) |
(u64)icmnd_cmpl->scsi_status << 48 | (u64)icmnd_cmpl->scsi_status << 48 |
(u64)icmnd_cmpl->flags << 40 | (u64)sc->cmnd[0] << 32 | (u64)icmnd_cmpl->flags << 40 | (u64)sc->cmnd[0] << 32 |
@ -1021,6 +1017,12 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic,
} else } else
fnic->lport->host_stats.fcp_control_requests++; fnic->lport->host_stats.fcp_control_requests++;
/* Call SCSI completion function to complete the IO */
scsi_done(sc);
spin_unlock_irqrestore(io_lock, flags);
mempool_free(io_req, fnic->io_req_pool);
atomic64_dec(&fnic_stats->io_stats.active_ios); atomic64_dec(&fnic_stats->io_stats.active_ios);
if (atomic64_read(&fnic->io_cmpl_skip)) if (atomic64_read(&fnic->io_cmpl_skip))
atomic64_dec(&fnic->io_cmpl_skip); atomic64_dec(&fnic->io_cmpl_skip);
@ -1049,9 +1051,6 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic,
if(io_duration_time > atomic64_read(&fnic_stats->io_stats.current_max_io_time)) if(io_duration_time > atomic64_read(&fnic_stats->io_stats.current_max_io_time))
atomic64_set(&fnic_stats->io_stats.current_max_io_time, io_duration_time); atomic64_set(&fnic_stats->io_stats.current_max_io_time, io_duration_time);
} }
/* Call SCSI completion function to complete the IO */
scsi_done(sc);
} }
/* fnic_fcpio_itmf_cmpl_handler /* fnic_fcpio_itmf_cmpl_handler

View file

@ -2011,9 +2011,10 @@ mpt3sas_base_sync_reply_irqs(struct MPT3SAS_ADAPTER *ioc, u8 poll)
enable_irq(reply_q->os_irq); enable_irq(reply_q->os_irq);
} }
} }
if (poll)
_base_process_reply_queue(reply_q);
} }
if (poll)
_base_process_reply_queue(reply_q);
} }
/** /**

View file

@ -1919,6 +1919,7 @@ static int usbtmc_ioctl_request(struct usbtmc_device_data *data,
struct usbtmc_ctrlrequest request; struct usbtmc_ctrlrequest request;
u8 *buffer = NULL; u8 *buffer = NULL;
int rv; int rv;
unsigned int is_in, pipe;
unsigned long res; unsigned long res;
res = copy_from_user(&request, arg, sizeof(struct usbtmc_ctrlrequest)); res = copy_from_user(&request, arg, sizeof(struct usbtmc_ctrlrequest));
@ -1928,12 +1929,14 @@ static int usbtmc_ioctl_request(struct usbtmc_device_data *data,
if (request.req.wLength > USBTMC_BUFSIZE) if (request.req.wLength > USBTMC_BUFSIZE)
return -EMSGSIZE; return -EMSGSIZE;
is_in = request.req.bRequestType & USB_DIR_IN;
if (request.req.wLength) { if (request.req.wLength) {
buffer = kmalloc(request.req.wLength, GFP_KERNEL); buffer = kmalloc(request.req.wLength, GFP_KERNEL);
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
if ((request.req.bRequestType & USB_DIR_IN) == 0) { if (!is_in) {
/* Send control data to device */ /* Send control data to device */
res = copy_from_user(buffer, request.data, res = copy_from_user(buffer, request.data,
request.req.wLength); request.req.wLength);
@ -1944,8 +1947,12 @@ static int usbtmc_ioctl_request(struct usbtmc_device_data *data,
} }
} }
if (is_in)
pipe = usb_rcvctrlpipe(data->usb_dev, 0);
else
pipe = usb_sndctrlpipe(data->usb_dev, 0);
rv = usb_control_msg(data->usb_dev, rv = usb_control_msg(data->usb_dev,
usb_rcvctrlpipe(data->usb_dev, 0), pipe,
request.req.bRequest, request.req.bRequest,
request.req.bRequestType, request.req.bRequestType,
request.req.wValue, request.req.wValue,
@ -1957,7 +1964,7 @@ static int usbtmc_ioctl_request(struct usbtmc_device_data *data,
goto exit; goto exit;
} }
if (rv && (request.req.bRequestType & USB_DIR_IN)) { if (rv && is_in) {
/* Read control data from device */ /* Read control data from device */
res = copy_to_user(request.data, buffer, rv); res = copy_to_user(request.data, buffer, rv);
if (res) if (res)

View file

@ -640,6 +640,7 @@ static int rndis_set_response(struct rndis_params *params,
BufLength = le32_to_cpu(buf->InformationBufferLength); BufLength = le32_to_cpu(buf->InformationBufferLength);
BufOffset = le32_to_cpu(buf->InformationBufferOffset); BufOffset = le32_to_cpu(buf->InformationBufferOffset);
if ((BufLength > RNDIS_MAX_TOTAL_SIZE) || if ((BufLength > RNDIS_MAX_TOTAL_SIZE) ||
(BufOffset > RNDIS_MAX_TOTAL_SIZE) ||
(BufOffset + 8 >= RNDIS_MAX_TOTAL_SIZE)) (BufOffset + 8 >= RNDIS_MAX_TOTAL_SIZE))
return -EINVAL; return -EINVAL;

View file

@ -1436,7 +1436,6 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
usb_gadget_udc_stop(udc); usb_gadget_udc_stop(udc);
udc->driver = NULL; udc->driver = NULL;
udc->dev.driver = NULL;
udc->gadget->dev.driver = NULL; udc->gadget->dev.driver = NULL;
} }
@ -1498,7 +1497,6 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
driver->function); driver->function);
udc->driver = driver; udc->driver = driver;
udc->dev.driver = &driver->driver;
udc->gadget->dev.driver = &driver->driver; udc->gadget->dev.driver = &driver->driver;
usb_gadget_udc_set_speed(udc, driver->max_speed); usb_gadget_udc_set_speed(udc, driver->max_speed);
@ -1521,7 +1519,6 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
dev_err(&udc->dev, "failed to start %s: %d\n", dev_err(&udc->dev, "failed to start %s: %d\n",
udc->driver->function, ret); udc->driver->function, ret);
udc->driver = NULL; udc->driver = NULL;
udc->dev.driver = NULL;
udc->gadget->dev.driver = NULL; udc->gadget->dev.driver = NULL;
return ret; return ret;
} }

View file

@ -327,7 +327,6 @@ static int omap2430_probe(struct platform_device *pdev)
musb->dev.parent = &pdev->dev; musb->dev.parent = &pdev->dev;
musb->dev.dma_mask = &omap2430_dmamask; musb->dev.dma_mask = &omap2430_dmamask;
musb->dev.coherent_dma_mask = omap2430_dmamask; musb->dev.coherent_dma_mask = omap2430_dmamask;
device_set_of_node_from_dev(&musb->dev, &pdev->dev);
glue->dev = &pdev->dev; glue->dev = &pdev->dev;
glue->musb = musb; glue->musb = musb;

View file

@ -1170,7 +1170,9 @@ ssize_t vhost_chr_write_iter(struct vhost_dev *dev,
goto done; goto done;
} }
if (msg.size == 0) { if ((msg.type == VHOST_IOTLB_UPDATE ||
msg.type == VHOST_IOTLB_INVALIDATE) &&
msg.size == 0) {
ret = -EINVAL; ret = -EINVAL;
goto done; goto done;
} }

View file

@ -753,7 +753,8 @@ static int vhost_vsock_dev_release(struct inode *inode, struct file *file)
/* Iterating over all connections for all CIDs to find orphans is /* Iterating over all connections for all CIDs to find orphans is
* inefficient. Room for improvement here. */ * inefficient. Room for improvement here. */
vsock_for_each_connected_socket(vhost_vsock_reset_orphans); vsock_for_each_connected_socket(&vhost_transport.transport,
vhost_vsock_reset_orphans);
/* Don't check the owner, because we are in the release path, so we /* Don't check the owner, because we are in the release path, so we
* need to stop the vsock device in any case. * need to stop the vsock device in any case.

View file

@ -3924,7 +3924,8 @@ cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
/* only send once per connect */ /* only send once per connect */
spin_lock(&cifs_tcp_ses_lock); spin_lock(&cifs_tcp_ses_lock);
if (server->tcpStatus != CifsNeedSessSetup) { if ((server->tcpStatus != CifsNeedSessSetup) &&
(ses->status == CifsGood)) {
spin_unlock(&cifs_tcp_ses_lock); spin_unlock(&cifs_tcp_ses_lock);
return 0; return 0;
} }

View file

@ -1105,17 +1105,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
goto read_super_error; goto read_super_error;
} }
root = d_make_root(inode);
if (!root) {
status = -ENOMEM;
mlog_errno(status);
goto read_super_error;
}
sb->s_root = root;
ocfs2_complete_mount_recovery(osb);
osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL, osb->osb_dev_kset = kset_create_and_add(sb->s_id, NULL,
&ocfs2_kset->kobj); &ocfs2_kset->kobj);
if (!osb->osb_dev_kset) { if (!osb->osb_dev_kset) {
@ -1133,6 +1122,17 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
goto read_super_error; goto read_super_error;
} }
root = d_make_root(inode);
if (!root) {
status = -ENOMEM;
mlog_errno(status);
goto read_super_error;
}
sb->s_root = root;
ocfs2_complete_mount_recovery(osb);
if (ocfs2_mount_local(osb)) if (ocfs2_mount_local(osb))
snprintf(nodestr, sizeof(nodestr), "local"); snprintf(nodestr, sizeof(nodestr), "local");
else else

View file

@ -52,6 +52,7 @@ static inline bool dev_is_mac_header_xmit(const struct net_device *dev)
case ARPHRD_VOID: case ARPHRD_VOID:
case ARPHRD_NONE: case ARPHRD_NONE:
case ARPHRD_RAWIP: case ARPHRD_RAWIP:
case ARPHRD_PIMREG:
return false; return false;
default: default:
return true; return true;

View file

@ -205,7 +205,8 @@ struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr);
struct sock *vsock_find_connected_socket(struct sockaddr_vm *src, struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
struct sockaddr_vm *dst); struct sockaddr_vm *dst);
void vsock_remove_sock(struct vsock_sock *vsk); void vsock_remove_sock(struct vsock_sock *vsk);
void vsock_for_each_connected_socket(void (*fn)(struct sock *sk)); void vsock_for_each_connected_socket(struct vsock_transport *transport,
void (*fn)(struct sock *sk));
int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk); int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk);
bool vsock_find_cid(unsigned int cid); bool vsock_find_cid(unsigned int cid);

View file

@ -97,7 +97,6 @@ struct nf_conn {
unsigned long status; unsigned long status;
u16 cpu; u16 cpu;
u16 local_origin:1;
possible_net_t ct_net; possible_net_t ct_net;
#if IS_ENABLED(CONFIG_NF_NAT) #if IS_ENABLED(CONFIG_NF_NAT)

View file

@ -16,6 +16,7 @@ CONFIG_SYMBOLIC_ERRNAME=y
# #
# Compile-time checks and compiler options # Compile-time checks and compiler options
# #
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_DEBUG_SECTION_MISMATCH=y CONFIG_DEBUG_SECTION_MISMATCH=y
CONFIG_FRAME_WARN=2048 CONFIG_FRAME_WARN=2048

View file

@ -478,7 +478,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
* __read_swap_cache_async(), which has set SWAP_HAS_CACHE * __read_swap_cache_async(), which has set SWAP_HAS_CACHE
* in swap_map, but not yet added its page to swap cache. * in swap_map, but not yet added its page to swap cache.
*/ */
cond_resched(); schedule_timeout_uninterruptible(1);
} }
/* /*

View file

@ -1436,6 +1436,7 @@ static int dsa_port_parse_of(struct dsa_port *dp, struct device_node *dn)
const char *user_protocol; const char *user_protocol;
master = of_find_net_device_by_node(ethernet); master = of_find_net_device_by_node(ethernet);
of_node_put(ethernet);
if (!master) if (!master)
return -EPROBE_DEFER; return -EPROBE_DEFER;

View file

@ -812,8 +812,7 @@ int esp6_input_done2(struct sk_buff *skb, int err)
struct tcphdr *th; struct tcphdr *th;
offset = ipv6_skip_exthdr(skb, offset, &nexthdr, &frag_off); offset = ipv6_skip_exthdr(skb, offset, &nexthdr, &frag_off);
if (offset == -1) {
if (offset < 0) {
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }

View file

@ -1476,8 +1476,8 @@ static int __ip6_append_data(struct sock *sk,
sizeof(struct frag_hdr) : 0) + sizeof(struct frag_hdr) : 0) +
rt->rt6i_nfheader_len; rt->rt6i_nfheader_len;
if (mtu < fragheaderlen || if (mtu <= fragheaderlen ||
((mtu - fragheaderlen) & ~7) + fragheaderlen < sizeof(struct frag_hdr)) ((mtu - fragheaderlen) & ~7) + fragheaderlen <= sizeof(struct frag_hdr))
goto emsgsize; goto emsgsize;
maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen - maxfraglen = ((mtu - fragheaderlen) & ~7) + fragheaderlen -

View file

@ -1699,7 +1699,7 @@ static int pfkey_register(struct sock *sk, struct sk_buff *skb, const struct sad
xfrm_probe_algs(); xfrm_probe_algs();
supp_skb = compose_sadb_supported(hdr, GFP_KERNEL); supp_skb = compose_sadb_supported(hdr, GFP_KERNEL | __GFP_ZERO);
if (!supp_skb) { if (!supp_skb) {
if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC) if (hdr->sadb_msg_satype != SADB_SATYPE_UNSPEC)
pfk->registered &= ~(1<<hdr->sadb_msg_satype); pfk->registered &= ~(1<<hdr->sadb_msg_satype);

View file

@ -1748,9 +1748,6 @@ resolve_normal_ct(struct nf_conn *tmpl,
return 0; return 0;
if (IS_ERR(h)) if (IS_ERR(h))
return PTR_ERR(h); return PTR_ERR(h);
ct = nf_ct_tuplehash_to_ctrack(h);
ct->local_origin = state->hook == NF_INET_LOCAL_OUT;
} }
ct = nf_ct_tuplehash_to_ctrack(h); ct = nf_ct_tuplehash_to_ctrack(h);

View file

@ -494,38 +494,6 @@ static void nf_nat_l4proto_unique_tuple(struct nf_conntrack_tuple *tuple,
goto another_round; goto another_round;
} }
static bool tuple_force_port_remap(const struct nf_conntrack_tuple *tuple)
{
u16 sp, dp;
switch (tuple->dst.protonum) {
case IPPROTO_TCP:
sp = ntohs(tuple->src.u.tcp.port);
dp = ntohs(tuple->dst.u.tcp.port);
break;
case IPPROTO_UDP:
case IPPROTO_UDPLITE:
sp = ntohs(tuple->src.u.udp.port);
dp = ntohs(tuple->dst.u.udp.port);
break;
default:
return false;
}
/* IANA: System port range: 1-1023,
* user port range: 1024-49151,
* private port range: 49152-65535.
*
* Linux default ephemeral port range is 32768-60999.
*
* Enforce port remapping if sport is significantly lower
* than dport to prevent NAT port shadowing, i.e.
* accidental match of 'new' inbound connection vs.
* existing outbound one.
*/
return sp < 16384 && dp >= 32768;
}
/* Manipulate the tuple into the range given. For NF_INET_POST_ROUTING, /* Manipulate the tuple into the range given. For NF_INET_POST_ROUTING,
* we change the source to map into the range. For NF_INET_PRE_ROUTING * we change the source to map into the range. For NF_INET_PRE_ROUTING
* and NF_INET_LOCAL_OUT, we change the destination to map into the * and NF_INET_LOCAL_OUT, we change the destination to map into the
@ -539,17 +507,11 @@ get_unique_tuple(struct nf_conntrack_tuple *tuple,
struct nf_conn *ct, struct nf_conn *ct,
enum nf_nat_manip_type maniptype) enum nf_nat_manip_type maniptype)
{ {
bool random_port = range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL;
const struct nf_conntrack_zone *zone; const struct nf_conntrack_zone *zone;
struct net *net = nf_ct_net(ct); struct net *net = nf_ct_net(ct);
zone = nf_ct_zone(ct); zone = nf_ct_zone(ct);
if (maniptype == NF_NAT_MANIP_SRC &&
!random_port &&
!ct->local_origin)
random_port = tuple_force_port_remap(orig_tuple);
/* 1) If this srcip/proto/src-proto-part is currently mapped, /* 1) If this srcip/proto/src-proto-part is currently mapped,
* and that same mapping gives a unique tuple within the given * and that same mapping gives a unique tuple within the given
* range, use that. * range, use that.
@ -558,7 +520,8 @@ get_unique_tuple(struct nf_conntrack_tuple *tuple,
* So far, we don't do local source mappings, so multiple * So far, we don't do local source mappings, so multiple
* manips not an issue. * manips not an issue.
*/ */
if (maniptype == NF_NAT_MANIP_SRC && !random_port) { if (maniptype == NF_NAT_MANIP_SRC &&
!(range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL)) {
/* try the original tuple first */ /* try the original tuple first */
if (in_range(orig_tuple, range)) { if (in_range(orig_tuple, range)) {
if (!nf_nat_used_tuple(orig_tuple, ct)) { if (!nf_nat_used_tuple(orig_tuple, ct)) {
@ -582,7 +545,7 @@ get_unique_tuple(struct nf_conntrack_tuple *tuple,
*/ */
/* Only bother mapping if it's not already in range and unique */ /* Only bother mapping if it's not already in range and unique */
if (!random_port) { if (!(range->flags & NF_NAT_RANGE_PROTO_RANDOM_ALL)) {
if (range->flags & NF_NAT_RANGE_PROTO_SPECIFIED) { if (range->flags & NF_NAT_RANGE_PROTO_SPECIFIED) {
if (!(range->flags & NF_NAT_RANGE_PROTO_OFFSET) && if (!(range->flags & NF_NAT_RANGE_PROTO_OFFSET) &&
l4proto_in_range(tuple, maniptype, l4proto_in_range(tuple, maniptype,

View file

@ -8260,6 +8260,12 @@ void nf_tables_trans_destroy_flush_work(void)
} }
EXPORT_SYMBOL_GPL(nf_tables_trans_destroy_flush_work); EXPORT_SYMBOL_GPL(nf_tables_trans_destroy_flush_work);
static bool nft_expr_reduce(struct nft_regs_track *track,
const struct nft_expr *expr)
{
return false;
}
static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *chain) static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *chain)
{ {
const struct nft_expr *expr, *last; const struct nft_expr *expr, *last;
@ -8307,8 +8313,7 @@ static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *cha
nft_rule_for_each_expr(expr, last, rule) { nft_rule_for_each_expr(expr, last, rule) {
track.cur = expr; track.cur = expr;
if (expr->ops->reduce && if (nft_expr_reduce(&track, expr)) {
expr->ops->reduce(&track, expr)) {
expr = track.cur; expr = track.cur;
continue; continue;
} }

View file

@ -2317,8 +2317,11 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
copy_skb = skb_get(skb); copy_skb = skb_get(skb);
skb_head = skb->data; skb_head = skb->data;
} }
if (copy_skb) if (copy_skb) {
memset(&PACKET_SKB_CB(copy_skb)->sa.ll, 0,
sizeof(PACKET_SKB_CB(copy_skb)->sa.ll));
skb_set_owner_r(copy_skb, sk); skb_set_owner_r(copy_skb, sk);
}
} }
snaplen = po->rx_ring.frame_size - macoff; snaplen = po->rx_ring.frame_size - macoff;
if ((int)snaplen < 0) { if ((int)snaplen < 0) {
@ -3462,6 +3465,8 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
sock_recv_ts_and_drops(msg, sk, skb); sock_recv_ts_and_drops(msg, sk, skb);
if (msg->msg_name) { if (msg->msg_name) {
const size_t max_len = min(sizeof(skb->cb),
sizeof(struct sockaddr_storage));
int copy_len; int copy_len;
/* If the address length field is there to be filled /* If the address length field is there to be filled
@ -3484,6 +3489,10 @@ static int packet_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
msg->msg_namelen = sizeof(struct sockaddr_ll); msg->msg_namelen = sizeof(struct sockaddr_ll);
} }
} }
if (WARN_ON_ONCE(copy_len > max_len)) {
copy_len = max_len;
msg->msg_namelen = copy_len;
}
memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, copy_len); memcpy(msg->msg_name, &PACKET_SKB_CB(skb)->sa, copy_len);
} }

View file

@ -334,7 +334,8 @@ void vsock_remove_sock(struct vsock_sock *vsk)
} }
EXPORT_SYMBOL_GPL(vsock_remove_sock); EXPORT_SYMBOL_GPL(vsock_remove_sock);
void vsock_for_each_connected_socket(void (*fn)(struct sock *sk)) void vsock_for_each_connected_socket(struct vsock_transport *transport,
void (*fn)(struct sock *sk))
{ {
int i; int i;
@ -343,8 +344,12 @@ void vsock_for_each_connected_socket(void (*fn)(struct sock *sk))
for (i = 0; i < ARRAY_SIZE(vsock_connected_table); i++) { for (i = 0; i < ARRAY_SIZE(vsock_connected_table); i++) {
struct vsock_sock *vsk; struct vsock_sock *vsk;
list_for_each_entry(vsk, &vsock_connected_table[i], list_for_each_entry(vsk, &vsock_connected_table[i],
connected_table) connected_table) {
if (vsk->transport != transport)
continue;
fn(sk_vsock(vsk)); fn(sk_vsock(vsk));
}
} }
spin_unlock_bh(&vsock_table_lock); spin_unlock_bh(&vsock_table_lock);

View file

@ -24,6 +24,7 @@
static struct workqueue_struct *virtio_vsock_workqueue; static struct workqueue_struct *virtio_vsock_workqueue;
static struct virtio_vsock __rcu *the_virtio_vsock; static struct virtio_vsock __rcu *the_virtio_vsock;
static DEFINE_MUTEX(the_virtio_vsock_mutex); /* protects the_virtio_vsock */ static DEFINE_MUTEX(the_virtio_vsock_mutex); /* protects the_virtio_vsock */
static struct virtio_transport virtio_transport; /* forward declaration */
struct virtio_vsock { struct virtio_vsock {
struct virtio_device *vdev; struct virtio_device *vdev;
@ -384,7 +385,8 @@ static void virtio_vsock_event_handle(struct virtio_vsock *vsock,
switch (le32_to_cpu(event->id)) { switch (le32_to_cpu(event->id)) {
case VIRTIO_VSOCK_EVENT_TRANSPORT_RESET: case VIRTIO_VSOCK_EVENT_TRANSPORT_RESET:
virtio_vsock_update_guest_cid(vsock); virtio_vsock_update_guest_cid(vsock);
vsock_for_each_connected_socket(virtio_vsock_reset_sock); vsock_for_each_connected_socket(&virtio_transport.transport,
virtio_vsock_reset_sock);
break; break;
} }
} }
@ -662,7 +664,8 @@ static void virtio_vsock_remove(struct virtio_device *vdev)
synchronize_rcu(); synchronize_rcu();
/* Reset all connected sockets when the device disappear */ /* Reset all connected sockets when the device disappear */
vsock_for_each_connected_socket(virtio_vsock_reset_sock); vsock_for_each_connected_socket(&virtio_transport.transport,
virtio_vsock_reset_sock);
/* Stop all work handlers to make sure no one is accessing the device, /* Stop all work handlers to make sure no one is accessing the device,
* so we can safely call virtio_reset_device(). * so we can safely call virtio_reset_device().

View file

@ -75,6 +75,8 @@ static u32 vmci_transport_qp_resumed_sub_id = VMCI_INVALID_ID;
static int PROTOCOL_OVERRIDE = -1; static int PROTOCOL_OVERRIDE = -1;
static struct vsock_transport vmci_transport; /* forward declaration */
/* Helper function to convert from a VMCI error code to a VSock error code. */ /* Helper function to convert from a VMCI error code to a VSock error code. */
static s32 vmci_transport_error_to_vsock_error(s32 vmci_error) static s32 vmci_transport_error_to_vsock_error(s32 vmci_error)
@ -882,7 +884,8 @@ static void vmci_transport_qp_resumed_cb(u32 sub_id,
const struct vmci_event_data *e_data, const struct vmci_event_data *e_data,
void *client_data) void *client_data)
{ {
vsock_for_each_connected_socket(vmci_transport_handle_detach); vsock_for_each_connected_socket(&vmci_transport,
vmci_transport_handle_detach);
} }
static void vmci_transport_recv_pkt_work(struct work_struct *work) static void vmci_transport_recv_pkt_work(struct work_struct *work)

View file

@ -29,7 +29,7 @@ struct evsel *arch_evlist__leader(struct list_head *list)
__evlist__for_each_entry(list, evsel) { __evlist__for_each_entry(list, evsel) {
if (evsel->pmu_name && !strcmp(evsel->pmu_name, "cpu") && if (evsel->pmu_name && !strcmp(evsel->pmu_name, "cpu") &&
evsel->name && strstr(evsel->name, "slots")) evsel->name && strcasestr(evsel->name, "slots"))
return evsel; return evsel;
} }
return first; return first;

View file

@ -346,7 +346,7 @@ struct evlist_cpu_iterator evlist__cpu_begin(struct evlist *evlist, struct affin
{ {
struct evlist_cpu_iterator itr = { struct evlist_cpu_iterator itr = {
.container = evlist, .container = evlist,
.evsel = evlist__first(evlist), .evsel = NULL,
.cpu_map_idx = 0, .cpu_map_idx = 0,
.evlist_cpu_map_idx = 0, .evlist_cpu_map_idx = 0,
.evlist_cpu_map_nr = perf_cpu_map__nr(evlist->core.all_cpus), .evlist_cpu_map_nr = perf_cpu_map__nr(evlist->core.all_cpus),
@ -354,16 +354,22 @@ struct evlist_cpu_iterator evlist__cpu_begin(struct evlist *evlist, struct affin
.affinity = affinity, .affinity = affinity,
}; };
if (itr.affinity) { if (evlist__empty(evlist)) {
itr.cpu = perf_cpu_map__cpu(evlist->core.all_cpus, 0); /* Ensure the empty list doesn't iterate. */
affinity__set(itr.affinity, itr.cpu.cpu); itr.evlist_cpu_map_idx = itr.evlist_cpu_map_nr;
itr.cpu_map_idx = perf_cpu_map__idx(itr.evsel->core.cpus, itr.cpu); } else {
/* itr.evsel = evlist__first(evlist);
* If this CPU isn't in the evsel's cpu map then advance through if (itr.affinity) {
* the list. itr.cpu = perf_cpu_map__cpu(evlist->core.all_cpus, 0);
*/ affinity__set(itr.affinity, itr.cpu.cpu);
if (itr.cpu_map_idx == -1) itr.cpu_map_idx = perf_cpu_map__idx(itr.evsel->core.cpus, itr.cpu);
evlist_cpu_iterator__next(&itr); /*
* If this CPU isn't in the evsel's cpu map then advance
* through the list.
*/
if (itr.cpu_map_idx == -1)
evlist_cpu_iterator__next(&itr);
}
} }
return itr; return itr;
} }

View file

@ -231,7 +231,7 @@ void symbols__fixup_end(struct rb_root_cached *symbols)
prev = curr; prev = curr;
curr = rb_entry(nd, struct symbol, rb_node); curr = rb_entry(nd, struct symbol, rb_node);
if (prev->end == prev->start && prev->end != curr->start) if (prev->end == prev->start || prev->end != curr->start)
arch__symbols__fixup_end(prev, curr); arch__symbols__fixup_end(prev, curr);
} }

View file

@ -880,9 +880,8 @@ EOF
return $ksft_skip return $ksft_skip
fi fi
# test default behaviour. Packet from ns1 to ns0 is not redirected # test default behaviour. Packet from ns1 to ns0 is redirected to ns2.
# due to automatic port translation. test_port_shadow "default" "CLIENT"
test_port_shadow "default" "ROUTER"
# test packet filter based mitigation: prevent forwarding of # test packet filter based mitigation: prevent forwarding of
# packets claiming to come from the service port. # packets claiming to come from the service port.

View file

@ -1,6 +1,8 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Makefile for vm selftests # Makefile for vm selftests
LOCAL_HDRS += $(selfdir)/vm/local_config.h $(top_srcdir)/mm/gup_test.h
include local_config.mk include local_config.mk
uname_M := $(shell uname -m 2>/dev/null || echo not) uname_M := $(shell uname -m 2>/dev/null || echo not)
@ -140,10 +142,6 @@ endif
$(OUTPUT)/mlock-random-test $(OUTPUT)/memfd_secret: LDLIBS += -lcap $(OUTPUT)/mlock-random-test $(OUTPUT)/memfd_secret: LDLIBS += -lcap
$(OUTPUT)/gup_test: ../../../../mm/gup_test.h
$(OUTPUT)/hmm-tests: local_config.h
# HMM_EXTRA_LIBS may get set in local_config.mk, or it may be left empty. # HMM_EXTRA_LIBS may get set in local_config.mk, or it may be left empty.
$(OUTPUT)/hmm-tests: LDLIBS += $(HMM_EXTRA_LIBS) $(OUTPUT)/hmm-tests: LDLIBS += $(HMM_EXTRA_LIBS)