Merge 4.19.314 into android-4.19-stable
Changes in 4.19.314
dmaengine: pl330: issue_pending waits until WFP state
dmaengine: Revert "dmaengine: pl330: issue_pending waits until WFP state"
wifi: nl80211: don't free NULL coalescing rule
drm/amdkfd: change system memory overcommit limit
drm/amdgpu: Fix leak when GPU memory allocation fails
net: slightly optimize eth_type_trans
ethernet: add a helper for assigning port addresses
ethernet: Add helper for assigning packet type when dest address does not match device address
pinctrl: core: delete incorrect free in pinctrl_enable()
power: rt9455: hide unused rt9455_boost_voltage_values
pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map()
s390/mm: Fix storage key clearing for guest huge pages
s390/mm: Fix clearing storage keys for huge pages
bna: ensure the copied buf is NUL terminated
nsh: Restore skb->{protocol,data,mac_header} for outer header in nsh_gso_segment().
net l2tp: drop flow hash on forward
net: dsa: mv88e6xxx: Add number of MACs in the ATU
net: dsa: mv88e6xxx: Fix number of databases for 88E6141 / 88E6341
net: bridge: fix multicast-to-unicast with fraglist GSO
tipc: fix a possible memleak in tipc_buf_append
scsi: lpfc: Update lpfc_ramp_down_queue_handler() logic
gfs2: Fix invalid metadata access in punch_hole
wifi: mac80211: fix ieee80211_bss_*_flags kernel-doc
net: mark racy access on sk->sk_rcvbuf
scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload
ALSA: line6: Zero-initialize message buffers
net: bcmgenet: Reset RBUF on first open
ata: sata_gemini: Check clk_enable() result
firewire: ohci: mask bus reset interrupts between ISR and bottom half
tools/power turbostat: Fix added raw MSR output
tools/power turbostat: Fix Bzy_MHz documentation typo
btrfs: make btrfs_clear_delalloc_extent() free delalloc reserve
btrfs: always clear PERTRANS metadata during commit
scsi: target: Fix SELinux error when systemd-modules loads the target module
selftests: timers: Fix valid-adjtimex signed left-shift undefined behavior
fs/9p: only translate RWX permissions for plain 9P2000
fs/9p: translate O_TRUNC into OTRUNC
9p: explicitly deny setlease attempts
gpio: wcove: Use -ENOTSUPP consistently
gpio: crystalcove: Use -ENOTSUPP consistently
fs/9p: drop inodes immediately on non-.L too
net:usb:qmi_wwan: support Rolling modules
tcp: remove redundant check on tskb
tcp: defer shutdown(SEND_SHUTDOWN) for TCP_SYN_RECV sockets
tcp: Use refcount_inc_not_zero() in tcp_twsk_unique().
Bluetooth: Fix use-after-free bugs caused by sco_sock_timeout
Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout
rtnetlink: Correct nested IFLA_VF_VLAN_LIST attribute validation
phonet: fix rtm_phonet_notify() skb allocation
net: bridge: fix corrupted ethernet header on multicast-to-unicast
ipv6: fib6_rules: avoid possible NULL dereference in fib6_rule_action()
af_unix: Do not use atomic ops for unix_sk(sk)->inflight.
af_unix: Fix garbage collector racing against connect()
firewire: nosy: ensure user_length is taken into account when fetching packet contents
usb: gadget: composite: fix OS descriptors w_value logic
usb: gadget: f_fs: Fix a race condition when processing setup packets.
tipc: fix UAF in error path
dyndbg: fix old BUG_ON in >control parser
drm/vmwgfx: Fix invalid reads in fence signaled events
net: fix out-of-bounds access in ops_init
af_unix: Suppress false-positive lockdep splat for spin_lock() in __unix_gc().
Linux 4.19.314
Change-Id: Iee5ac090f6fe369f9faa89d92ad17b66b8a41bee
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 19
|
||||
SUBLEVEL = 313
|
||||
SUBLEVEL = 314
|
||||
EXTRAVERSION =
|
||||
NAME = "People's Front"
|
||||
|
||||
|
||||
@@ -2583,7 +2583,7 @@ static int __s390_enable_skey_hugetlb(pte_t *pte, unsigned long addr,
|
||||
return 0;
|
||||
|
||||
start = pmd_val(*pmd) & HPAGE_MASK;
|
||||
end = start + HPAGE_SIZE - 1;
|
||||
end = start + HPAGE_SIZE;
|
||||
__storage_key_init_range(start, end);
|
||||
set_bit(PG_arch_1, &page->flags);
|
||||
return 0;
|
||||
|
||||
@@ -146,7 +146,7 @@ static void clear_huge_pte_skeys(struct mm_struct *mm, unsigned long rste)
|
||||
}
|
||||
|
||||
if (!test_and_set_bit(PG_arch_1, &page->flags))
|
||||
__storage_key_init_range(paddr, paddr + size - 1);
|
||||
__storage_key_init_range(paddr, paddr + size);
|
||||
}
|
||||
|
||||
void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
|
||||
|
||||
@@ -200,7 +200,10 @@ int gemini_sata_start_bridge(struct sata_gemini *sg, unsigned int bridge)
|
||||
pclk = sg->sata0_pclk;
|
||||
else
|
||||
pclk = sg->sata1_pclk;
|
||||
clk_enable(pclk);
|
||||
ret = clk_enable(pclk);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
msleep(10);
|
||||
|
||||
/* Do not keep clocking a bridge that is not online */
|
||||
|
||||
@@ -161,10 +161,12 @@ packet_buffer_get(struct client *client, char __user *data, size_t user_length)
|
||||
if (atomic_read(&buffer->size) == 0)
|
||||
return -ENODEV;
|
||||
|
||||
/* FIXME: Check length <= user_length. */
|
||||
length = buffer->head->length;
|
||||
|
||||
if (length > user_length)
|
||||
return 0;
|
||||
|
||||
end = buffer->data + buffer->capacity;
|
||||
length = buffer->head->length;
|
||||
|
||||
if (&buffer->head->data[length] < end) {
|
||||
if (copy_to_user(data, buffer->head->data, length))
|
||||
|
||||
@@ -2066,6 +2066,8 @@ static void bus_reset_work(struct work_struct *work)
|
||||
|
||||
ohci->generation = generation;
|
||||
reg_write(ohci, OHCI1394_IntEventClear, OHCI1394_busReset);
|
||||
if (param_debug & OHCI_PARAM_DEBUG_BUSRESETS)
|
||||
reg_write(ohci, OHCI1394_IntMaskSet, OHCI1394_busReset);
|
||||
|
||||
if (ohci->quirks & QUIRK_RESET_PACKET)
|
||||
ohci->request_generation = generation;
|
||||
@@ -2132,12 +2134,14 @@ static irqreturn_t irq_handler(int irq, void *data)
|
||||
return IRQ_NONE;
|
||||
|
||||
/*
|
||||
* busReset and postedWriteErr must not be cleared yet
|
||||
* busReset and postedWriteErr events must not be cleared yet
|
||||
* (OHCI 1.1 clauses 7.2.3.2 and 13.2.8.1)
|
||||
*/
|
||||
reg_write(ohci, OHCI1394_IntEventClear,
|
||||
event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
|
||||
log_irqs(ohci, event);
|
||||
if (event & OHCI1394_busReset)
|
||||
reg_write(ohci, OHCI1394_IntMaskClear, OHCI1394_busReset);
|
||||
|
||||
if (event & OHCI1394_selfIDComplete)
|
||||
queue_work(selfid_workqueue, &ohci->bus_reset_work);
|
||||
|
||||
@@ -99,7 +99,7 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
|
||||
case 0x5e:
|
||||
return GPIOPANELCTL;
|
||||
default:
|
||||
return -EOPNOTSUPP;
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ static inline unsigned int to_reg(int gpio, enum ctrl_register reg_type)
|
||||
unsigned int reg;
|
||||
|
||||
if (gpio >= WCOVE_GPIO_NUM)
|
||||
return -EOPNOTSUPP;
|
||||
return -ENOTSUPP;
|
||||
|
||||
if (reg_type == CTRL_IN)
|
||||
reg = GPIO_IN_CTRL_BASE + gpio;
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
/* Impose limit on how much memory KFD can use */
|
||||
static struct {
|
||||
uint64_t max_system_mem_limit;
|
||||
uint64_t max_userptr_mem_limit;
|
||||
uint64_t max_ttm_mem_limit;
|
||||
int64_t system_mem_used;
|
||||
int64_t userptr_mem_used;
|
||||
int64_t ttm_mem_used;
|
||||
spinlock_t mem_limit_lock;
|
||||
} kfd_mem_limit;
|
||||
|
||||
@@ -90,8 +90,8 @@ static bool check_if_add_bo_to_vm(struct amdgpu_vm *avm,
|
||||
}
|
||||
|
||||
/* Set memory usage limits. Current, limits are
|
||||
* System (kernel) memory - 3/8th System RAM
|
||||
* Userptr memory - 3/4th System RAM
|
||||
* System (TTM + userptr) memory - 3/4th System RAM
|
||||
* TTM memory - 3/8th System RAM
|
||||
*/
|
||||
void amdgpu_amdkfd_gpuvm_init_mem_limits(void)
|
||||
{
|
||||
@@ -103,48 +103,54 @@ void amdgpu_amdkfd_gpuvm_init_mem_limits(void)
|
||||
mem *= si.mem_unit;
|
||||
|
||||
spin_lock_init(&kfd_mem_limit.mem_limit_lock);
|
||||
kfd_mem_limit.max_system_mem_limit = (mem >> 1) - (mem >> 3);
|
||||
kfd_mem_limit.max_userptr_mem_limit = mem - (mem >> 2);
|
||||
pr_debug("Kernel memory limit %lluM, userptr limit %lluM\n",
|
||||
kfd_mem_limit.max_system_mem_limit = (mem >> 1) + (mem >> 2);
|
||||
kfd_mem_limit.max_ttm_mem_limit = (mem >> 1) - (mem >> 3);
|
||||
pr_debug("Kernel memory limit %lluM, TTM limit %lluM\n",
|
||||
(kfd_mem_limit.max_system_mem_limit >> 20),
|
||||
(kfd_mem_limit.max_userptr_mem_limit >> 20));
|
||||
(kfd_mem_limit.max_ttm_mem_limit >> 20));
|
||||
}
|
||||
|
||||
static int amdgpu_amdkfd_reserve_system_mem_limit(struct amdgpu_device *adev,
|
||||
uint64_t size, u32 domain)
|
||||
uint64_t size, u32 domain, bool sg)
|
||||
{
|
||||
size_t acc_size;
|
||||
size_t acc_size, system_mem_needed, ttm_mem_needed;
|
||||
int ret = 0;
|
||||
|
||||
acc_size = ttm_bo_dma_acc_size(&adev->mman.bdev, size,
|
||||
sizeof(struct amdgpu_bo));
|
||||
|
||||
spin_lock(&kfd_mem_limit.mem_limit_lock);
|
||||
|
||||
if (domain == AMDGPU_GEM_DOMAIN_GTT) {
|
||||
if (kfd_mem_limit.system_mem_used + (acc_size + size) >
|
||||
kfd_mem_limit.max_system_mem_limit) {
|
||||
ret = -ENOMEM;
|
||||
goto err_no_mem;
|
||||
}
|
||||
kfd_mem_limit.system_mem_used += (acc_size + size);
|
||||
} else if (domain == AMDGPU_GEM_DOMAIN_CPU) {
|
||||
if ((kfd_mem_limit.system_mem_used + acc_size >
|
||||
kfd_mem_limit.max_system_mem_limit) ||
|
||||
(kfd_mem_limit.userptr_mem_used + (size + acc_size) >
|
||||
kfd_mem_limit.max_userptr_mem_limit)) {
|
||||
ret = -ENOMEM;
|
||||
goto err_no_mem;
|
||||
}
|
||||
kfd_mem_limit.system_mem_used += acc_size;
|
||||
kfd_mem_limit.userptr_mem_used += size;
|
||||
/* TTM GTT memory */
|
||||
system_mem_needed = acc_size + size;
|
||||
ttm_mem_needed = acc_size + size;
|
||||
} else if (domain == AMDGPU_GEM_DOMAIN_CPU && !sg) {
|
||||
/* Userptr */
|
||||
system_mem_needed = acc_size + size;
|
||||
ttm_mem_needed = acc_size;
|
||||
} else {
|
||||
/* VRAM and SG */
|
||||
system_mem_needed = acc_size;
|
||||
ttm_mem_needed = acc_size;
|
||||
}
|
||||
err_no_mem:
|
||||
|
||||
if ((kfd_mem_limit.system_mem_used + system_mem_needed >
|
||||
kfd_mem_limit.max_system_mem_limit) ||
|
||||
(kfd_mem_limit.ttm_mem_used + ttm_mem_needed >
|
||||
kfd_mem_limit.max_ttm_mem_limit))
|
||||
ret = -ENOMEM;
|
||||
else {
|
||||
kfd_mem_limit.system_mem_used += system_mem_needed;
|
||||
kfd_mem_limit.ttm_mem_used += ttm_mem_needed;
|
||||
}
|
||||
|
||||
spin_unlock(&kfd_mem_limit.mem_limit_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void unreserve_system_mem_limit(struct amdgpu_device *adev,
|
||||
uint64_t size, u32 domain)
|
||||
uint64_t size, u32 domain, bool sg)
|
||||
{
|
||||
size_t acc_size;
|
||||
|
||||
@@ -154,14 +160,18 @@ static void unreserve_system_mem_limit(struct amdgpu_device *adev,
|
||||
spin_lock(&kfd_mem_limit.mem_limit_lock);
|
||||
if (domain == AMDGPU_GEM_DOMAIN_GTT) {
|
||||
kfd_mem_limit.system_mem_used -= (acc_size + size);
|
||||
} else if (domain == AMDGPU_GEM_DOMAIN_CPU) {
|
||||
kfd_mem_limit.ttm_mem_used -= (acc_size + size);
|
||||
} else if (domain == AMDGPU_GEM_DOMAIN_CPU && !sg) {
|
||||
kfd_mem_limit.system_mem_used -= (acc_size + size);
|
||||
kfd_mem_limit.ttm_mem_used -= acc_size;
|
||||
} else {
|
||||
kfd_mem_limit.system_mem_used -= acc_size;
|
||||
kfd_mem_limit.userptr_mem_used -= size;
|
||||
kfd_mem_limit.ttm_mem_used -= acc_size;
|
||||
}
|
||||
WARN_ONCE(kfd_mem_limit.system_mem_used < 0,
|
||||
"kfd system memory accounting unbalanced");
|
||||
WARN_ONCE(kfd_mem_limit.userptr_mem_used < 0,
|
||||
"kfd userptr memory accounting unbalanced");
|
||||
WARN_ONCE(kfd_mem_limit.ttm_mem_used < 0,
|
||||
"kfd TTM memory accounting unbalanced");
|
||||
|
||||
spin_unlock(&kfd_mem_limit.mem_limit_lock);
|
||||
}
|
||||
@@ -171,16 +181,22 @@ void amdgpu_amdkfd_unreserve_system_memory_limit(struct amdgpu_bo *bo)
|
||||
spin_lock(&kfd_mem_limit.mem_limit_lock);
|
||||
|
||||
if (bo->flags & AMDGPU_AMDKFD_USERPTR_BO) {
|
||||
kfd_mem_limit.system_mem_used -= bo->tbo.acc_size;
|
||||
kfd_mem_limit.userptr_mem_used -= amdgpu_bo_size(bo);
|
||||
kfd_mem_limit.system_mem_used -=
|
||||
(bo->tbo.acc_size + amdgpu_bo_size(bo));
|
||||
kfd_mem_limit.ttm_mem_used -= bo->tbo.acc_size;
|
||||
} else if (bo->preferred_domains == AMDGPU_GEM_DOMAIN_GTT) {
|
||||
kfd_mem_limit.system_mem_used -=
|
||||
(bo->tbo.acc_size + amdgpu_bo_size(bo));
|
||||
kfd_mem_limit.ttm_mem_used -=
|
||||
(bo->tbo.acc_size + amdgpu_bo_size(bo));
|
||||
} else {
|
||||
kfd_mem_limit.system_mem_used -= bo->tbo.acc_size;
|
||||
kfd_mem_limit.ttm_mem_used -= bo->tbo.acc_size;
|
||||
}
|
||||
WARN_ONCE(kfd_mem_limit.system_mem_used < 0,
|
||||
"kfd system memory accounting unbalanced");
|
||||
WARN_ONCE(kfd_mem_limit.userptr_mem_used < 0,
|
||||
"kfd userptr memory accounting unbalanced");
|
||||
WARN_ONCE(kfd_mem_limit.ttm_mem_used < 0,
|
||||
"kfd TTM memory accounting unbalanced");
|
||||
|
||||
spin_unlock(&kfd_mem_limit.mem_limit_lock);
|
||||
}
|
||||
@@ -1201,10 +1217,11 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
|
||||
|
||||
amdgpu_sync_create(&(*mem)->sync);
|
||||
|
||||
ret = amdgpu_amdkfd_reserve_system_mem_limit(adev, size, alloc_domain);
|
||||
ret = amdgpu_amdkfd_reserve_system_mem_limit(adev, size,
|
||||
alloc_domain, false);
|
||||
if (ret) {
|
||||
pr_debug("Insufficient system memory\n");
|
||||
goto err_reserve_system_mem;
|
||||
goto err_reserve_limit;
|
||||
}
|
||||
|
||||
pr_debug("\tcreate BO VA 0x%llx size 0x%llx domain %s\n",
|
||||
@@ -1252,10 +1269,11 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
|
||||
allocate_init_user_pages_failed:
|
||||
amdgpu_bo_unref(&bo);
|
||||
/* Don't unreserve system mem limit twice */
|
||||
goto err_reserve_system_mem;
|
||||
goto err_reserve_limit;
|
||||
err_bo_create:
|
||||
unreserve_system_mem_limit(adev, size, alloc_domain);
|
||||
err_reserve_system_mem:
|
||||
unreserve_system_mem_limit(adev, size, alloc_domain, false);
|
||||
err_reserve_limit:
|
||||
amdgpu_sync_free(&(*mem)->sync);
|
||||
mutex_destroy(&(*mem)->lock);
|
||||
kfree(*mem);
|
||||
return ret;
|
||||
|
||||
@@ -1064,7 +1064,7 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv,
|
||||
}
|
||||
|
||||
event->event.base.type = DRM_VMW_EVENT_FENCE_SIGNALED;
|
||||
event->event.base.length = sizeof(*event);
|
||||
event->event.base.length = sizeof(event->event);
|
||||
event->event.user_data = user_data;
|
||||
|
||||
ret = drm_event_reserve_init(dev, file_priv, &event->base, &event->event.base);
|
||||
|
||||
@@ -3933,6 +3933,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6097,
|
||||
.name = "Marvell 88E6085",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 10,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
@@ -3955,6 +3956,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6095,
|
||||
.name = "Marvell 88E6095/88E6095F",
|
||||
.num_databases = 256,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 11,
|
||||
.num_internal_phys = 0,
|
||||
.max_vid = 4095,
|
||||
@@ -3975,6 +3977,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6097,
|
||||
.name = "Marvell 88E6097/88E6097F",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 11,
|
||||
.num_internal_phys = 8,
|
||||
.max_vid = 4095,
|
||||
@@ -3997,6 +4000,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6165,
|
||||
.name = "Marvell 88E6123",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 1024,
|
||||
.num_ports = 3,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
@@ -4019,6 +4023,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6185,
|
||||
.name = "Marvell 88E6131",
|
||||
.num_databases = 256,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 8,
|
||||
.num_internal_phys = 0,
|
||||
.max_vid = 4095,
|
||||
@@ -4038,7 +4043,8 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6141,
|
||||
.family = MV88E6XXX_FAMILY_6341,
|
||||
.name = "Marvell 88E6141",
|
||||
.num_databases = 4096,
|
||||
.num_databases = 256,
|
||||
.num_macs = 2048,
|
||||
.num_ports = 6,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 11,
|
||||
@@ -4062,6 +4068,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6165,
|
||||
.name = "Marvell 88E6161",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 1024,
|
||||
.num_ports = 6,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
@@ -4085,6 +4092,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6165,
|
||||
.name = "Marvell 88E6165",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 6,
|
||||
.num_internal_phys = 0,
|
||||
.max_vid = 4095,
|
||||
@@ -4108,6 +4116,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6351,
|
||||
.name = "Marvell 88E6171",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
@@ -4130,6 +4139,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6352,
|
||||
.name = "Marvell 88E6172",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
@@ -4153,6 +4163,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6351,
|
||||
.name = "Marvell 88E6175",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
@@ -4175,6 +4186,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6352,
|
||||
.name = "Marvell 88E6176",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
@@ -4198,6 +4210,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6185,
|
||||
.name = "Marvell 88E6185",
|
||||
.num_databases = 256,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 10,
|
||||
.num_internal_phys = 0,
|
||||
.max_vid = 4095,
|
||||
@@ -4218,6 +4231,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6190",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.num_gpio = 16,
|
||||
@@ -4241,6 +4255,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6190X",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.num_gpio = 16,
|
||||
@@ -4264,6 +4279,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6191",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.max_vid = 8191,
|
||||
@@ -4287,6 +4303,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6352,
|
||||
.name = "Marvell 88E6240",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
@@ -4335,6 +4352,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6320,
|
||||
.name = "Marvell 88E6320",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
@@ -4359,6 +4377,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6320,
|
||||
.name = "Marvell 88E6321",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
@@ -4381,7 +4400,8 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.prod_num = MV88E6XXX_PORT_SWITCH_ID_PROD_6341,
|
||||
.family = MV88E6XXX_FAMILY_6341,
|
||||
.name = "Marvell 88E6341",
|
||||
.num_databases = 4096,
|
||||
.num_databases = 256,
|
||||
.num_macs = 2048,
|
||||
.num_internal_phys = 5,
|
||||
.num_ports = 6,
|
||||
.num_gpio = 11,
|
||||
@@ -4406,6 +4426,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6351,
|
||||
.name = "Marvell 88E6350",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
@@ -4428,6 +4449,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6351,
|
||||
.name = "Marvell 88E6351",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.max_vid = 4095,
|
||||
@@ -4450,6 +4472,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6352,
|
||||
.name = "Marvell 88E6352",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 8192,
|
||||
.num_ports = 7,
|
||||
.num_internal_phys = 5,
|
||||
.num_gpio = 15,
|
||||
@@ -4473,6 +4496,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6390",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.num_gpio = 16,
|
||||
@@ -4496,6 +4520,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
|
||||
.family = MV88E6XXX_FAMILY_6390,
|
||||
.name = "Marvell 88E6390X",
|
||||
.num_databases = 4096,
|
||||
.num_macs = 16384,
|
||||
.num_ports = 11, /* 10 + Z80 */
|
||||
.num_internal_phys = 9,
|
||||
.num_gpio = 16,
|
||||
|
||||
@@ -105,6 +105,7 @@ struct mv88e6xxx_info {
|
||||
u16 prod_num;
|
||||
const char *name;
|
||||
unsigned int num_databases;
|
||||
unsigned int num_macs;
|
||||
unsigned int num_ports;
|
||||
unsigned int num_internal_phys;
|
||||
unsigned int num_gpio;
|
||||
@@ -559,6 +560,11 @@ static inline unsigned int mv88e6xxx_num_databases(struct mv88e6xxx_chip *chip)
|
||||
return chip->info->num_databases;
|
||||
}
|
||||
|
||||
static inline unsigned int mv88e6xxx_num_macs(struct mv88e6xxx_chip *chip)
|
||||
{
|
||||
return chip->info->num_macs;
|
||||
}
|
||||
|
||||
static inline unsigned int mv88e6xxx_num_ports(struct mv88e6xxx_chip *chip)
|
||||
{
|
||||
return chip->info->num_ports;
|
||||
|
||||
@@ -2806,7 +2806,7 @@ static void bcmgenet_set_hw_addr(struct bcmgenet_priv *priv,
|
||||
}
|
||||
|
||||
/* Returns a reusable dma control register value */
|
||||
static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)
|
||||
static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv, bool flush_rx)
|
||||
{
|
||||
unsigned int i;
|
||||
u32 reg;
|
||||
@@ -2831,6 +2831,14 @@ static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv)
|
||||
udelay(10);
|
||||
bcmgenet_umac_writel(priv, 0, UMAC_TX_FLUSH);
|
||||
|
||||
if (flush_rx) {
|
||||
reg = bcmgenet_rbuf_ctrl_get(priv);
|
||||
bcmgenet_rbuf_ctrl_set(priv, reg | BIT(0));
|
||||
udelay(10);
|
||||
bcmgenet_rbuf_ctrl_set(priv, reg);
|
||||
udelay(10);
|
||||
}
|
||||
|
||||
return dma_ctrl;
|
||||
}
|
||||
|
||||
@@ -2926,8 +2934,8 @@ static int bcmgenet_open(struct net_device *dev)
|
||||
|
||||
bcmgenet_set_hw_addr(priv, dev->dev_addr);
|
||||
|
||||
/* Disable RX/TX DMA and flush TX queues */
|
||||
dma_ctrl = bcmgenet_dma_disable(priv);
|
||||
/* Disable RX/TX DMA and flush TX and RX queues */
|
||||
dma_ctrl = bcmgenet_dma_disable(priv, true);
|
||||
|
||||
/* Reinitialize TDMA and RDMA and SW housekeeping */
|
||||
ret = bcmgenet_init_dma(priv);
|
||||
@@ -3682,7 +3690,7 @@ static int bcmgenet_resume(struct device *d)
|
||||
bcmgenet_power_up(priv, GENET_POWER_WOL_MAGIC);
|
||||
|
||||
/* Disable RX/TX DMA and flush TX queues */
|
||||
dma_ctrl = bcmgenet_dma_disable(priv);
|
||||
dma_ctrl = bcmgenet_dma_disable(priv, false);
|
||||
|
||||
/* Reinitialize TDMA and RDMA and SW housekeeping */
|
||||
ret = bcmgenet_init_dma(priv);
|
||||
|
||||
@@ -320,7 +320,7 @@ bnad_debugfs_write_regrd(struct file *file, const char __user *buf,
|
||||
void *kern_buf;
|
||||
|
||||
/* Copy the user space buf */
|
||||
kern_buf = memdup_user(buf, nbytes);
|
||||
kern_buf = memdup_user_nul(buf, nbytes);
|
||||
if (IS_ERR(kern_buf))
|
||||
return PTR_ERR(kern_buf);
|
||||
|
||||
@@ -380,7 +380,7 @@ bnad_debugfs_write_regwr(struct file *file, const char __user *buf,
|
||||
void *kern_buf;
|
||||
|
||||
/* Copy the user space buf */
|
||||
kern_buf = memdup_user(buf, nbytes);
|
||||
kern_buf = memdup_user_nul(buf, nbytes);
|
||||
if (IS_ERR(kern_buf))
|
||||
return PTR_ERR(kern_buf);
|
||||
|
||||
|
||||
@@ -1383,6 +1383,7 @@ static const struct usb_device_id products[] = {
|
||||
{QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
|
||||
{QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
|
||||
{QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
|
||||
{QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */
|
||||
|
||||
/* 4. Gobi 1000 devices */
|
||||
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
|
||||
|
||||
@@ -2036,13 +2036,7 @@ int pinctrl_enable(struct pinctrl_dev *pctldev)
|
||||
|
||||
error = pinctrl_claim_hogs(pctldev);
|
||||
if (error) {
|
||||
dev_err(pctldev->dev, "could not claim hogs: %i\n",
|
||||
error);
|
||||
pinctrl_free_pindescs(pctldev, pctldev->desc->pins,
|
||||
pctldev->desc->npins);
|
||||
mutex_destroy(&pctldev->mutex);
|
||||
kfree(pctldev);
|
||||
|
||||
dev_err(pctldev->dev, "could not claim hogs: %i\n", error);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -235,14 +235,16 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev)
|
||||
for (state = 0; ; state++) {
|
||||
/* Retrieve the pinctrl-* property */
|
||||
propname = kasprintf(GFP_KERNEL, "pinctrl-%d", state);
|
||||
if (!propname)
|
||||
return -ENOMEM;
|
||||
if (!propname) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
prop = of_find_property(np, propname, &size);
|
||||
kfree(propname);
|
||||
if (!prop) {
|
||||
if (state == 0) {
|
||||
of_node_put(np);
|
||||
return -ENODEV;
|
||||
ret = -ENODEV;
|
||||
goto err;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -202,6 +202,7 @@ static const int rt9455_voreg_values[] = {
|
||||
4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_USB_PHY)
|
||||
/*
|
||||
* When the charger is in boost mode, REG02[7:2] represent boost output
|
||||
* voltage.
|
||||
@@ -217,6 +218,7 @@ static const int rt9455_boost_voltage_values[] = {
|
||||
5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000,
|
||||
5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000,
|
||||
};
|
||||
#endif
|
||||
|
||||
/* REG07[3:0] (VMREG) in uV */
|
||||
static const int rt9455_vmreg_values[] = {
|
||||
|
||||
@@ -834,7 +834,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
|
||||
|
||||
BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n");
|
||||
|
||||
spin_lock_bh(&tgt->cq_lock);
|
||||
ctx_base_ptr = tgt->ctx_base;
|
||||
tgt->ctx_base = NULL;
|
||||
|
||||
@@ -890,7 +889,6 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
|
||||
tgt->sq, tgt->sq_dma);
|
||||
tgt->sq = NULL;
|
||||
}
|
||||
spin_unlock_bh(&tgt->cq_lock);
|
||||
|
||||
if (ctx_base_ptr)
|
||||
iounmap(ctx_base_ptr);
|
||||
|
||||
@@ -989,7 +989,6 @@ struct lpfc_hba {
|
||||
unsigned long bit_flags;
|
||||
#define FABRIC_COMANDS_BLOCKED 0
|
||||
atomic_t num_rsrc_err;
|
||||
atomic_t num_cmd_success;
|
||||
unsigned long last_rsrc_error_time;
|
||||
unsigned long last_ramp_down_time;
|
||||
#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
|
||||
|
||||
@@ -303,11 +303,10 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
|
||||
struct Scsi_Host *shost;
|
||||
struct scsi_device *sdev;
|
||||
unsigned long new_queue_depth;
|
||||
unsigned long num_rsrc_err, num_cmd_success;
|
||||
unsigned long num_rsrc_err;
|
||||
int i;
|
||||
|
||||
num_rsrc_err = atomic_read(&phba->num_rsrc_err);
|
||||
num_cmd_success = atomic_read(&phba->num_cmd_success);
|
||||
|
||||
/*
|
||||
* The error and success command counters are global per
|
||||
@@ -322,20 +321,16 @@ lpfc_ramp_down_queue_handler(struct lpfc_hba *phba)
|
||||
for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
|
||||
shost = lpfc_shost_from_vport(vports[i]);
|
||||
shost_for_each_device(sdev, shost) {
|
||||
new_queue_depth =
|
||||
sdev->queue_depth * num_rsrc_err /
|
||||
(num_rsrc_err + num_cmd_success);
|
||||
if (!new_queue_depth)
|
||||
new_queue_depth = sdev->queue_depth - 1;
|
||||
if (num_rsrc_err >= sdev->queue_depth)
|
||||
new_queue_depth = 1;
|
||||
else
|
||||
new_queue_depth = sdev->queue_depth -
|
||||
new_queue_depth;
|
||||
num_rsrc_err;
|
||||
scsi_change_queue_depth(sdev, new_queue_depth);
|
||||
}
|
||||
}
|
||||
lpfc_destroy_vport_work_array(phba, vports);
|
||||
atomic_set(&phba->num_rsrc_err, 0);
|
||||
atomic_set(&phba->num_cmd_success, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3240,6 +3240,8 @@ static int __init target_core_init_configfs(void)
|
||||
{
|
||||
struct configfs_subsystem *subsys = &target_core_fabrics;
|
||||
struct t10_alua_lu_gp *lu_gp;
|
||||
struct cred *kern_cred;
|
||||
const struct cred *old_cred;
|
||||
int ret;
|
||||
|
||||
pr_debug("TARGET_CORE[0]: Loading Generic Kernel Storage"
|
||||
@@ -3316,11 +3318,21 @@ static int __init target_core_init_configfs(void)
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
/* We use the kernel credentials to access the target directory */
|
||||
kern_cred = prepare_kernel_cred(&init_task);
|
||||
if (!kern_cred) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
old_cred = override_creds(kern_cred);
|
||||
target_init_dbroot();
|
||||
revert_creds(old_cred);
|
||||
put_cred(kern_cred);
|
||||
|
||||
return 0;
|
||||
|
||||
out:
|
||||
target_xcopy_release_pt();
|
||||
configfs_unregister_subsystem(subsys);
|
||||
core_dev_release_virtual_lun0();
|
||||
rd_module_exit();
|
||||
|
||||
@@ -2027,7 +2027,7 @@ unknown:
|
||||
buf[5] = 0x01;
|
||||
switch (ctrl->bRequestType & USB_RECIP_MASK) {
|
||||
case USB_RECIP_DEVICE:
|
||||
if (w_index != 0x4 || (w_value >> 8))
|
||||
if (w_index != 0x4 || (w_value & 0xff))
|
||||
break;
|
||||
buf[6] = w_index;
|
||||
/* Number of ext compat interfaces */
|
||||
@@ -2043,9 +2043,9 @@ unknown:
|
||||
}
|
||||
break;
|
||||
case USB_RECIP_INTERFACE:
|
||||
if (w_index != 0x5 || (w_value >> 8))
|
||||
if (w_index != 0x5 || (w_value & 0xff))
|
||||
break;
|
||||
interface = w_value & 0xFF;
|
||||
interface = w_value >> 8;
|
||||
if (interface >= MAX_CONFIG_INTERFACES ||
|
||||
!os_desc_cfg->interface[interface])
|
||||
break;
|
||||
|
||||
@@ -3304,7 +3304,7 @@ static int ffs_func_setup(struct usb_function *f,
|
||||
__ffs_event_add(ffs, FUNCTIONFS_SETUP);
|
||||
spin_unlock_irqrestore(&ffs->ev.waitq.lock, flags);
|
||||
|
||||
return creq->wLength == 0 ? USB_GADGET_DELAYED_STATUS : 0;
|
||||
return ffs->ev.setup.wLength == 0 ? USB_GADGET_DELAYED_STATUS : 0;
|
||||
}
|
||||
|
||||
static bool ffs_func_req_match(struct usb_function *f,
|
||||
|
||||
@@ -691,6 +691,7 @@ const struct file_operations v9fs_file_operations = {
|
||||
.lock = v9fs_file_lock,
|
||||
.mmap = generic_file_readonly_mmap,
|
||||
.fsync = v9fs_file_fsync,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
const struct file_operations v9fs_file_operations_dotl = {
|
||||
@@ -726,4 +727,5 @@ const struct file_operations v9fs_mmap_file_operations_dotl = {
|
||||
.flock = v9fs_file_flock_dotl,
|
||||
.mmap = v9fs_mmap_file_mmap,
|
||||
.fsync = v9fs_file_fsync_dotl,
|
||||
.setlease = simple_nosetlease,
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ static int p9mode2perm(struct v9fs_session_info *v9ses,
|
||||
int res;
|
||||
int mode = stat->mode;
|
||||
|
||||
res = mode & S_IALLUGO;
|
||||
res = mode & 0777; /* S_IRWXUGO */
|
||||
if (v9fs_proto_dotu(v9ses)) {
|
||||
if ((mode & P9_DMSETUID) == P9_DMSETUID)
|
||||
res |= S_ISUID;
|
||||
@@ -192,6 +192,9 @@ int v9fs_uflags2omode(int uflags, int extended)
|
||||
break;
|
||||
}
|
||||
|
||||
if (uflags & O_TRUNC)
|
||||
ret |= P9_OTRUNC;
|
||||
|
||||
if (extended) {
|
||||
if (uflags & O_EXCL)
|
||||
ret |= P9_OEXCL;
|
||||
|
||||
@@ -346,6 +346,7 @@ static const struct super_operations v9fs_super_ops = {
|
||||
.alloc_inode = v9fs_alloc_inode,
|
||||
.destroy_inode = v9fs_destroy_inode,
|
||||
.statfs = simple_statfs,
|
||||
.drop_inode = v9fs_drop_inode,
|
||||
.evict_inode = v9fs_evict_inode,
|
||||
.show_options = v9fs_show_options,
|
||||
.umount_begin = v9fs_umount_begin,
|
||||
|
||||
@@ -1906,7 +1906,7 @@ static void btrfs_clear_bit_hook(void *private_data,
|
||||
*/
|
||||
if (*bits & EXTENT_CLEAR_META_RESV &&
|
||||
root != fs_info->tree_root)
|
||||
btrfs_delalloc_release_metadata(inode, len, false);
|
||||
btrfs_delalloc_release_metadata(inode, len, true);
|
||||
|
||||
/* For sanity tests. */
|
||||
if (btrfs_is_testing(fs_info))
|
||||
|
||||
@@ -1271,6 +1271,7 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans)
|
||||
radix_tree_tag_clear(&fs_info->fs_roots_radix,
|
||||
(unsigned long)root->root_key.objectid,
|
||||
BTRFS_ROOT_TRANS_TAG);
|
||||
btrfs_qgroup_free_meta_all_pertrans(root);
|
||||
spin_unlock(&fs_info->fs_roots_radix_lock);
|
||||
|
||||
btrfs_free_log(trans, root);
|
||||
@@ -1295,7 +1296,6 @@ static noinline int commit_fs_roots(struct btrfs_trans_handle *trans)
|
||||
if (ret2)
|
||||
return ret2;
|
||||
spin_lock(&fs_info->fs_roots_radix_lock);
|
||||
btrfs_qgroup_free_meta_all_pertrans(root);
|
||||
}
|
||||
}
|
||||
spin_unlock(&fs_info->fs_roots_radix_lock);
|
||||
|
||||
@@ -1751,7 +1751,8 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length)
|
||||
struct buffer_head *dibh, *bh;
|
||||
struct gfs2_holder rd_gh;
|
||||
unsigned int bsize_shift = sdp->sd_sb.sb_bsize_shift;
|
||||
u64 lblock = (offset + (1 << bsize_shift) - 1) >> bsize_shift;
|
||||
unsigned int bsize = 1 << bsize_shift;
|
||||
u64 lblock = (offset + bsize - 1) >> bsize_shift;
|
||||
__u16 start_list[GFS2_MAX_META_HEIGHT];
|
||||
__u16 __end_list[GFS2_MAX_META_HEIGHT], *end_list = NULL;
|
||||
unsigned int start_aligned, end_aligned;
|
||||
@@ -1762,7 +1763,7 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length)
|
||||
u64 prev_bnr = 0;
|
||||
__be64 *start, *end;
|
||||
|
||||
if (offset >= maxsize) {
|
||||
if (offset + bsize - 1 >= maxsize) {
|
||||
/*
|
||||
* The starting point lies beyond the allocated meta-data;
|
||||
* there are no blocks do deallocate.
|
||||
|
||||
@@ -522,6 +522,52 @@ static inline unsigned long compare_ether_header(const void *a, const void *b)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* eth_hw_addr_gen - Generate and assign Ethernet address to a port
|
||||
* @dev: pointer to port's net_device structure
|
||||
* @base_addr: base Ethernet address
|
||||
* @id: offset to add to the base address
|
||||
*
|
||||
* Generate a MAC address using a base address and an offset and assign it
|
||||
* to a net_device. Commonly used by switch drivers which need to compute
|
||||
* addresses for all their ports. addr_assign_type is not changed.
|
||||
*/
|
||||
static inline void eth_hw_addr_gen(struct net_device *dev, const u8 *base_addr,
|
||||
unsigned int id)
|
||||
{
|
||||
u64 u = ether_addr_to_u64(base_addr);
|
||||
u8 addr[ETH_ALEN];
|
||||
|
||||
u += id;
|
||||
u64_to_ether_addr(u, addr);
|
||||
eth_hw_addr_set(dev, addr);
|
||||
}
|
||||
|
||||
/**
|
||||
* eth_skb_pkt_type - Assign packet type if destination address does not match
|
||||
* @skb: Assigned a packet type if address does not match @dev address
|
||||
* @dev: Network device used to compare packet address against
|
||||
*
|
||||
* If the destination MAC address of the packet does not match the network
|
||||
* device address, assign an appropriate packet type.
|
||||
*/
|
||||
static inline void eth_skb_pkt_type(struct sk_buff *skb,
|
||||
const struct net_device *dev)
|
||||
{
|
||||
const struct ethhdr *eth = eth_hdr(skb);
|
||||
|
||||
if (unlikely(!ether_addr_equal_64bits(eth->h_dest, dev->dev_addr))) {
|
||||
if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) {
|
||||
if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
|
||||
skb->pkt_type = PACKET_BROADCAST;
|
||||
else
|
||||
skb->pkt_type = PACKET_MULTICAST;
|
||||
} else {
|
||||
skb->pkt_type = PACKET_OTHERHOST;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* eth_skb_pad - Pad buffer to mininum number of octets for Ethernet frame
|
||||
* @skb: Buffer to pad
|
||||
|
||||
@@ -52,7 +52,7 @@ struct unix_sock {
|
||||
struct mutex iolock, bindlock;
|
||||
struct sock *peer;
|
||||
struct list_head link;
|
||||
atomic_long_t inflight;
|
||||
unsigned long inflight;
|
||||
spinlock_t lock;
|
||||
unsigned long gc_flags;
|
||||
#define UNIX_GC_CANDIDATE 0
|
||||
@@ -72,6 +72,9 @@ enum unix_socket_lock_class {
|
||||
U_LOCK_NORMAL,
|
||||
U_LOCK_SECOND, /* for double locking, see unix_state_double_lock(). */
|
||||
U_LOCK_DIAG, /* used while dumping icons, see sk_diag_dump_icons(). */
|
||||
U_LOCK_GC_LISTENER, /* used for listening socket while determining gc
|
||||
* candidates to close a small race window.
|
||||
*/
|
||||
};
|
||||
|
||||
static inline void unix_state_lock_nested(struct sock *sk,
|
||||
|
||||
@@ -242,7 +242,11 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
|
||||
} else {
|
||||
for (end = buf; *end && !isspace(*end); end++)
|
||||
;
|
||||
BUG_ON(end == buf);
|
||||
if (end == buf) {
|
||||
pr_err("parse err after word:%d=%s\n", nwords,
|
||||
nwords ? words[nwords - 1] : "<none>");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
/* `buf' is start of word, `end' is one past its end */
|
||||
|
||||
@@ -429,6 +429,9 @@ static void l2cap_chan_timeout(struct work_struct *work)
|
||||
|
||||
BT_DBG("chan %p state %s", chan, state_to_string(chan->state));
|
||||
|
||||
if (!conn)
|
||||
return;
|
||||
|
||||
mutex_lock(&conn->chan_lock);
|
||||
/* __set_chan_timer() calls l2cap_chan_hold(chan) while scheduling
|
||||
* this work. No need to call l2cap_chan_hold(chan) here again.
|
||||
|
||||
@@ -82,6 +82,10 @@ static void sco_sock_timeout(struct work_struct *work)
|
||||
struct sock *sk;
|
||||
|
||||
sco_conn_lock(conn);
|
||||
if (!conn->hcon) {
|
||||
sco_conn_unlock(conn);
|
||||
return;
|
||||
}
|
||||
sk = conn->sk;
|
||||
if (sk)
|
||||
sock_hold(sk);
|
||||
|
||||
@@ -251,6 +251,7 @@ static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb,
|
||||
{
|
||||
struct net_device *dev = BR_INPUT_SKB_CB(skb)->brdev;
|
||||
const unsigned char *src = eth_hdr(skb)->h_source;
|
||||
struct sk_buff *nskb;
|
||||
|
||||
if (!should_deliver(p, skb))
|
||||
return;
|
||||
@@ -259,12 +260,16 @@ static void maybe_deliver_addr(struct net_bridge_port *p, struct sk_buff *skb,
|
||||
if (skb->dev == p->dev && ether_addr_equal(src, addr))
|
||||
return;
|
||||
|
||||
skb = skb_copy(skb, GFP_ATOMIC);
|
||||
if (!skb) {
|
||||
__skb_push(skb, ETH_HLEN);
|
||||
nskb = pskb_copy(skb, GFP_ATOMIC);
|
||||
__skb_pull(skb, ETH_HLEN);
|
||||
if (!nskb) {
|
||||
dev->stats.tx_dropped++;
|
||||
return;
|
||||
}
|
||||
|
||||
skb = nskb;
|
||||
__skb_pull(skb, ETH_HLEN);
|
||||
if (!is_broadcast_ether_addr(addr))
|
||||
memcpy(eth_hdr(skb)->h_dest, addr, ETH_ALEN);
|
||||
|
||||
|
||||
@@ -63,12 +63,15 @@ static unsigned int max_gen_ptrs = INITIAL_NET_GEN_PTRS;
|
||||
|
||||
static struct net_generic *net_alloc_generic(void)
|
||||
{
|
||||
unsigned int gen_ptrs = READ_ONCE(max_gen_ptrs);
|
||||
unsigned int generic_size;
|
||||
struct net_generic *ng;
|
||||
unsigned int generic_size = offsetof(struct net_generic, ptr[max_gen_ptrs]);
|
||||
|
||||
generic_size = offsetof(struct net_generic, ptr[gen_ptrs]);
|
||||
|
||||
ng = kzalloc(generic_size, GFP_KERNEL);
|
||||
if (ng)
|
||||
ng->s.len = max_gen_ptrs;
|
||||
ng->s.len = gen_ptrs;
|
||||
|
||||
return ng;
|
||||
}
|
||||
@@ -1032,7 +1035,11 @@ static int register_pernet_operations(struct list_head *list,
|
||||
if (error < 0)
|
||||
return error;
|
||||
*ops->id = error;
|
||||
max_gen_ptrs = max(max_gen_ptrs, *ops->id + 1);
|
||||
/* This does not require READ_ONCE as writers already hold
|
||||
* pernet_ops_rwsem. But WRITE_ONCE is needed to protect
|
||||
* net_alloc_generic.
|
||||
*/
|
||||
WRITE_ONCE(max_gen_ptrs, max(max_gen_ptrs, *ops->id + 1));
|
||||
}
|
||||
error = __register_pernet_operations(list, ops);
|
||||
if (error) {
|
||||
|
||||
@@ -2167,7 +2167,7 @@ static int do_setvfinfo(struct net_device *dev, struct nlattr **tb)
|
||||
|
||||
nla_for_each_nested(attr, tb[IFLA_VF_VLAN_LIST], rem) {
|
||||
if (nla_type(attr) != IFLA_VF_VLAN_INFO ||
|
||||
nla_len(attr) < NLA_HDRLEN) {
|
||||
nla_len(attr) < sizeof(struct ifla_vf_vlan_info)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
if (len >= MAX_VLAN_LIST_LEN)
|
||||
|
||||
@@ -404,7 +404,7 @@ int __sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
|
||||
unsigned long flags;
|
||||
struct sk_buff_head *list = &sk->sk_receive_queue;
|
||||
|
||||
if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) {
|
||||
if (atomic_read(&sk->sk_rmem_alloc) >= READ_ONCE(sk->sk_rcvbuf)) {
|
||||
atomic_inc(&sk->sk_drops);
|
||||
trace_sock_rcvqueue_full(sk, skb);
|
||||
return -ENOMEM;
|
||||
@@ -456,7 +456,7 @@ int __sk_receive_skb(struct sock *sk, struct sk_buff *skb,
|
||||
|
||||
skb->dev = NULL;
|
||||
|
||||
if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) {
|
||||
if (sk_rcvqueues_full(sk, READ_ONCE(sk->sk_rcvbuf))) {
|
||||
atomic_inc(&sk->sk_drops);
|
||||
goto discard_and_relse;
|
||||
}
|
||||
|
||||
@@ -165,15 +165,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
|
||||
eth = (struct ethhdr *)skb->data;
|
||||
skb_pull_inline(skb, ETH_HLEN);
|
||||
|
||||
if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) {
|
||||
if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
|
||||
skb->pkt_type = PACKET_BROADCAST;
|
||||
else
|
||||
skb->pkt_type = PACKET_MULTICAST;
|
||||
}
|
||||
else if (unlikely(!ether_addr_equal_64bits(eth->h_dest,
|
||||
dev->dev_addr)))
|
||||
skb->pkt_type = PACKET_OTHERHOST;
|
||||
eth_skb_pkt_type(skb, dev);
|
||||
|
||||
/*
|
||||
* Some variants of DSA tagging don't have an ethertype field
|
||||
|
||||
@@ -2317,7 +2317,7 @@ void tcp_shutdown(struct sock *sk, int how)
|
||||
/* If we've already sent a FIN, or it's a closed state, skip this. */
|
||||
if ((1 << sk->sk_state) &
|
||||
(TCPF_ESTABLISHED | TCPF_SYN_SENT |
|
||||
TCPF_SYN_RECV | TCPF_CLOSE_WAIT)) {
|
||||
TCPF_CLOSE_WAIT)) {
|
||||
/* Clear out any half completed packets. FIN if needed. */
|
||||
if (tcp_close_state(sk))
|
||||
tcp_send_fin(sk);
|
||||
@@ -2403,7 +2403,7 @@ void tcp_close(struct sock *sk, long timeout)
|
||||
* machine. State transitions:
|
||||
*
|
||||
* TCP_ESTABLISHED -> TCP_FIN_WAIT1
|
||||
* TCP_SYN_RECV -> TCP_FIN_WAIT1 (forget it, it's impossible)
|
||||
* TCP_SYN_RECV -> TCP_FIN_WAIT1 (it is difficult)
|
||||
* TCP_CLOSE_WAIT -> TCP_LAST_ACK
|
||||
*
|
||||
* are legal only when FIN has been sent (i.e. in window),
|
||||
|
||||
@@ -6212,6 +6212,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
|
||||
|
||||
tcp_initialize_rcv_mss(sk);
|
||||
tcp_fast_path_on(tp);
|
||||
if (sk->sk_shutdown & SEND_SHUTDOWN)
|
||||
tcp_shutdown(sk, SEND_SHUTDOWN);
|
||||
break;
|
||||
|
||||
case TCP_FIN_WAIT1: {
|
||||
|
||||
@@ -157,6 +157,12 @@ int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp)
|
||||
if (tcptw->tw_ts_recent_stamp &&
|
||||
(!twp || (reuse && time_after32(ktime_get_seconds(),
|
||||
tcptw->tw_ts_recent_stamp)))) {
|
||||
/* inet_twsk_hashdance() sets sk_refcnt after putting twsk
|
||||
* and releasing the bucket lock.
|
||||
*/
|
||||
if (unlikely(!refcount_inc_not_zero(&sktw->sk_refcnt)))
|
||||
return 0;
|
||||
|
||||
/* In case of repair and re-using TIME-WAIT sockets we still
|
||||
* want to be sure that it is safe as above but honor the
|
||||
* sequence numbers and time stamps set as part of the repair
|
||||
@@ -177,7 +183,7 @@ int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp)
|
||||
tp->rx_opt.ts_recent = tcptw->tw_ts_recent;
|
||||
tp->rx_opt.ts_recent_stamp = tcptw->tw_ts_recent_stamp;
|
||||
}
|
||||
sock_hold(sktw);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3132,7 +3132,6 @@ void tcp_send_fin(struct sock *sk)
|
||||
tskb = skb_rb_last(&sk->tcp_rtx_queue);
|
||||
|
||||
if (tskb) {
|
||||
coalesce:
|
||||
TCP_SKB_CB(tskb)->tcp_flags |= TCPHDR_FIN;
|
||||
TCP_SKB_CB(tskb)->end_seq++;
|
||||
tp->write_seq++;
|
||||
@@ -3147,12 +3146,12 @@ coalesce:
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
skb = alloc_skb_fclone(MAX_TCP_HEADER, sk->sk_allocation);
|
||||
if (unlikely(!skb)) {
|
||||
if (tskb)
|
||||
goto coalesce;
|
||||
skb = alloc_skb_fclone(MAX_TCP_HEADER,
|
||||
sk_gfp_mask(sk, GFP_ATOMIC |
|
||||
__GFP_NOWARN));
|
||||
if (unlikely(!skb))
|
||||
return;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&skb->tcp_tsorted_anchor);
|
||||
skb_reserve(skb, MAX_TCP_HEADER);
|
||||
sk_forced_mem_schedule(sk, skb->truesize);
|
||||
|
||||
@@ -232,8 +232,12 @@ static int __fib6_rule_action(struct fib_rule *rule, struct flowi *flp,
|
||||
|
||||
rt = lookup(net, table, flp6, arg->lookup_data, flags);
|
||||
if (rt != net->ipv6.ip6_null_entry) {
|
||||
struct inet6_dev *idev = ip6_dst_idev(&rt->dst);
|
||||
|
||||
if (!idev)
|
||||
goto again;
|
||||
err = fib6_rule_saddr(net, rule, flags, flp6,
|
||||
ip6_dst_idev(&rt->dst)->dev);
|
||||
idev->dev);
|
||||
|
||||
if (err == -EAGAIN)
|
||||
goto again;
|
||||
|
||||
@@ -154,6 +154,9 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
|
||||
/* checksums verified by L2TP */
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
|
||||
/* drop outer flow-hash */
|
||||
skb_clear_hash(skb);
|
||||
|
||||
skb_dst_drop(skb);
|
||||
nf_reset(skb);
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ struct ieee80211_bss {
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee80211_corrupt_data_flags - BSS data corruption flags
|
||||
* enum ieee80211_bss_corrupt_data_flags - BSS data corruption flags
|
||||
* @IEEE80211_BSS_CORRUPT_BEACON: last beacon frame received was corrupted
|
||||
* @IEEE80211_BSS_CORRUPT_PROBE_RESP: last probe response received was corrupted
|
||||
*
|
||||
@@ -126,7 +126,7 @@ enum ieee80211_bss_corrupt_data_flags {
|
||||
};
|
||||
|
||||
/**
|
||||
* enum ieee80211_valid_data_flags - BSS valid data flags
|
||||
* enum ieee80211_bss_valid_data_flags - BSS valid data flags
|
||||
* @IEEE80211_BSS_VALID_WMM: WMM/UAPSD data was gathered from non-corrupt IE
|
||||
* @IEEE80211_BSS_VALID_RATES: Supported rates were gathered from non-corrupt IE
|
||||
* @IEEE80211_BSS_VALID_ERP: ERP flag was gathered from non-corrupt IE
|
||||
|
||||
@@ -79,13 +79,15 @@ EXPORT_SYMBOL_GPL(nsh_pop);
|
||||
static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
|
||||
netdev_features_t features)
|
||||
{
|
||||
unsigned int outer_hlen, mac_len, nsh_len;
|
||||
struct sk_buff *segs = ERR_PTR(-EINVAL);
|
||||
u16 mac_offset = skb->mac_header;
|
||||
unsigned int nsh_len, mac_len;
|
||||
__be16 proto;
|
||||
__be16 outer_proto, proto;
|
||||
|
||||
skb_reset_network_header(skb);
|
||||
|
||||
outer_proto = skb->protocol;
|
||||
outer_hlen = skb_mac_header_len(skb);
|
||||
mac_len = skb->mac_len;
|
||||
|
||||
if (unlikely(!pskb_may_pull(skb, NSH_BASE_HDR_LEN)))
|
||||
@@ -115,10 +117,10 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
for (skb = segs; skb; skb = skb->next) {
|
||||
skb->protocol = htons(ETH_P_NSH);
|
||||
__skb_push(skb, nsh_len);
|
||||
skb->mac_header = mac_offset;
|
||||
skb->network_header = skb->mac_header + mac_len;
|
||||
skb->protocol = outer_proto;
|
||||
__skb_push(skb, nsh_len + outer_hlen);
|
||||
skb_reset_mac_header(skb);
|
||||
skb_set_network_header(skb, outer_hlen);
|
||||
skb->mac_len = mac_len;
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ void rtm_phonet_notify(int event, struct net_device *dev, u8 dst)
|
||||
struct sk_buff *skb;
|
||||
int err = -ENOBUFS;
|
||||
|
||||
skb = nlmsg_new(NLMSG_ALIGN(sizeof(struct ifaddrmsg)) +
|
||||
skb = nlmsg_new(NLMSG_ALIGN(sizeof(struct rtmsg)) +
|
||||
nla_total_size(1) + nla_total_size(4), GFP_KERNEL);
|
||||
if (skb == NULL)
|
||||
goto errout;
|
||||
|
||||
@@ -140,9 +140,9 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
|
||||
if (fragid == FIRST_FRAGMENT) {
|
||||
if (unlikely(head))
|
||||
goto err;
|
||||
*buf = NULL;
|
||||
if (skb_has_frag_list(frag) && __skb_linearize(frag))
|
||||
goto err;
|
||||
*buf = NULL;
|
||||
frag = skb_unshare(frag, GFP_ATOMIC);
|
||||
if (unlikely(!frag))
|
||||
goto err;
|
||||
@@ -154,6 +154,11 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
|
||||
if (!head)
|
||||
goto err;
|
||||
|
||||
/* Either the input skb ownership is transferred to headskb
|
||||
* or the input skb is freed, clear the reference to avoid
|
||||
* bad access on error path.
|
||||
*/
|
||||
*buf = NULL;
|
||||
if (skb_try_coalesce(head, frag, &headstolen, &delta)) {
|
||||
kfree_skb_partial(frag, headstolen);
|
||||
} else {
|
||||
@@ -177,7 +182,6 @@ int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf)
|
||||
*headbuf = NULL;
|
||||
return 1;
|
||||
}
|
||||
*buf = NULL;
|
||||
return 0;
|
||||
err:
|
||||
kfree_skb(*buf);
|
||||
|
||||
@@ -814,11 +814,11 @@ static struct sock *unix_create1(struct net *net, struct socket *sock, int kern)
|
||||
sk->sk_write_space = unix_write_space;
|
||||
sk->sk_max_ack_backlog = net->unx.sysctl_max_dgram_qlen;
|
||||
sk->sk_destruct = unix_sock_destructor;
|
||||
u = unix_sk(sk);
|
||||
u = unix_sk(sk);
|
||||
u->inflight = 0;
|
||||
u->path.dentry = NULL;
|
||||
u->path.mnt = NULL;
|
||||
spin_lock_init(&u->lock);
|
||||
atomic_long_set(&u->inflight, 0);
|
||||
INIT_LIST_HEAD(&u->link);
|
||||
mutex_init(&u->iolock); /* single task reading lock */
|
||||
mutex_init(&u->bindlock); /* single task binding lock */
|
||||
|
||||
@@ -171,17 +171,18 @@ static void scan_children(struct sock *x, void (*func)(struct unix_sock *),
|
||||
|
||||
static void dec_inflight(struct unix_sock *usk)
|
||||
{
|
||||
atomic_long_dec(&usk->inflight);
|
||||
usk->inflight--;
|
||||
}
|
||||
|
||||
static void inc_inflight(struct unix_sock *usk)
|
||||
{
|
||||
atomic_long_inc(&usk->inflight);
|
||||
usk->inflight++;
|
||||
}
|
||||
|
||||
static void inc_inflight_move_tail(struct unix_sock *u)
|
||||
{
|
||||
atomic_long_inc(&u->inflight);
|
||||
u->inflight++;
|
||||
|
||||
/* If this still might be part of a cycle, move it to the end
|
||||
* of the list, so that it's checked even if it was already
|
||||
* passed over
|
||||
@@ -238,20 +239,34 @@ void unix_gc(void)
|
||||
* receive queues. Other, non candidate sockets _can_ be
|
||||
* added to queue, so we must make sure only to touch
|
||||
* candidates.
|
||||
*
|
||||
* Embryos, though never candidates themselves, affect which
|
||||
* candidates are reachable by the garbage collector. Before
|
||||
* being added to a listener's queue, an embryo may already
|
||||
* receive data carrying SCM_RIGHTS, potentially making the
|
||||
* passed socket a candidate that is not yet reachable by the
|
||||
* collector. It becomes reachable once the embryo is
|
||||
* enqueued. Therefore, we must ensure that no SCM-laden
|
||||
* embryo appears in a (candidate) listener's queue between
|
||||
* consecutive scan_children() calls.
|
||||
*/
|
||||
list_for_each_entry_safe(u, next, &gc_inflight_list, link) {
|
||||
struct sock *sk = &u->sk;
|
||||
long total_refs;
|
||||
long inflight_refs;
|
||||
|
||||
total_refs = file_count(u->sk.sk_socket->file);
|
||||
inflight_refs = atomic_long_read(&u->inflight);
|
||||
total_refs = file_count(sk->sk_socket->file);
|
||||
|
||||
BUG_ON(inflight_refs < 1);
|
||||
BUG_ON(total_refs < inflight_refs);
|
||||
if (total_refs == inflight_refs) {
|
||||
BUG_ON(!u->inflight);
|
||||
BUG_ON(total_refs < u->inflight);
|
||||
if (total_refs == u->inflight) {
|
||||
list_move_tail(&u->link, &gc_candidates);
|
||||
__set_bit(UNIX_GC_CANDIDATE, &u->gc_flags);
|
||||
__set_bit(UNIX_GC_MAYBE_CYCLE, &u->gc_flags);
|
||||
|
||||
if (sk->sk_state == TCP_LISTEN) {
|
||||
unix_state_lock_nested(sk, U_LOCK_GC_LISTENER);
|
||||
unix_state_unlock(sk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +290,7 @@ void unix_gc(void)
|
||||
/* Move cursor to after the current position. */
|
||||
list_move(&cursor, &u->link);
|
||||
|
||||
if (atomic_long_read(&u->inflight) > 0) {
|
||||
if (u->inflight) {
|
||||
list_move_tail(&u->link, ¬_cycle_list);
|
||||
__clear_bit(UNIX_GC_MAYBE_CYCLE, &u->gc_flags);
|
||||
scan_children(&u->sk, inc_inflight_move_tail, NULL);
|
||||
|
||||
@@ -50,12 +50,13 @@ void unix_inflight(struct user_struct *user, struct file *fp)
|
||||
if (s) {
|
||||
struct unix_sock *u = unix_sk(s);
|
||||
|
||||
if (atomic_long_inc_return(&u->inflight) == 1) {
|
||||
if (!u->inflight) {
|
||||
BUG_ON(!list_empty(&u->link));
|
||||
list_add_tail(&u->link, &gc_inflight_list);
|
||||
} else {
|
||||
BUG_ON(list_empty(&u->link));
|
||||
}
|
||||
u->inflight++;
|
||||
/* Paired with READ_ONCE() in wait_for_unix_gc() */
|
||||
WRITE_ONCE(unix_tot_inflight, unix_tot_inflight + 1);
|
||||
}
|
||||
@@ -72,10 +73,11 @@ void unix_notinflight(struct user_struct *user, struct file *fp)
|
||||
if (s) {
|
||||
struct unix_sock *u = unix_sk(s);
|
||||
|
||||
BUG_ON(!atomic_long_read(&u->inflight));
|
||||
BUG_ON(!u->inflight);
|
||||
BUG_ON(list_empty(&u->link));
|
||||
|
||||
if (atomic_long_dec_and_test(&u->inflight))
|
||||
u->inflight--;
|
||||
if (!u->inflight)
|
||||
list_del_init(&u->link);
|
||||
/* Paired with READ_ONCE() in wait_for_unix_gc() */
|
||||
WRITE_ONCE(unix_tot_inflight, unix_tot_inflight - 1);
|
||||
|
||||
@@ -11607,6 +11607,8 @@ static int nl80211_set_coalesce(struct sk_buff *skb, struct genl_info *info)
|
||||
error:
|
||||
for (i = 0; i < new_coalesce.n_rules; i++) {
|
||||
tmp_rule = &new_coalesce.rules[i];
|
||||
if (!tmp_rule)
|
||||
continue;
|
||||
for (j = 0; j < tmp_rule->n_patterns; j++)
|
||||
kfree(tmp_rule->patterns[j].mask);
|
||||
kfree(tmp_rule->patterns);
|
||||
|
||||
@@ -216,7 +216,7 @@ int line6_send_raw_message_async(struct usb_line6 *line6, const char *buffer,
|
||||
struct urb *urb;
|
||||
|
||||
/* create message: */
|
||||
msg = kmalloc(sizeof(struct message), GFP_ATOMIC);
|
||||
msg = kzalloc(sizeof(struct message), GFP_ATOMIC);
|
||||
if (msg == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -694,7 +694,7 @@ static int line6_init_cap_control(struct usb_line6 *line6)
|
||||
int ret;
|
||||
|
||||
/* initialize USB buffers: */
|
||||
line6->buffer_listen = kmalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL);
|
||||
line6->buffer_listen = kzalloc(LINE6_BUFSIZE_LISTEN, GFP_KERNEL);
|
||||
if (!line6->buffer_listen)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -703,7 +703,7 @@ static int line6_init_cap_control(struct usb_line6 *line6)
|
||||
return -ENOMEM;
|
||||
|
||||
if (line6->properties->capabilities & LINE6_CAP_CONTROL_MIDI) {
|
||||
line6->buffer_message = kmalloc(LINE6_MIDI_MESSAGE_MAXLEN, GFP_KERNEL);
|
||||
line6->buffer_message = kzalloc(LINE6_MIDI_MESSAGE_MAXLEN, GFP_KERNEL);
|
||||
if (!line6->buffer_message)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ below the processor's base frequency.
|
||||
|
||||
Busy% = MPERF_delta/TSC_delta
|
||||
|
||||
Bzy_MHz = TSC_delta/APERF_delta/MPERF_delta/measurement_interval
|
||||
Bzy_MHz = TSC_delta*APERF_delta/MPERF_delta/measurement_interval
|
||||
|
||||
Note that these calculations depend on TSC_delta, so they
|
||||
are not reliable during intervals when TSC_MHz is not running at the base frequency.
|
||||
|
||||
@@ -1524,9 +1524,10 @@ int sum_counters(struct thread_data *t, struct core_data *c,
|
||||
average.packages.rapl_dram_perf_status += p->rapl_dram_perf_status;
|
||||
|
||||
for (i = 0, mp = sys.pp; mp; i++, mp = mp->next) {
|
||||
if (mp->format == FORMAT_RAW)
|
||||
continue;
|
||||
average.packages.counter[i] += p->counter[i];
|
||||
if ((mp->format == FORMAT_RAW) && (topo.num_packages == 0))
|
||||
average.packages.counter[i] = p->counter[i];
|
||||
else
|
||||
average.packages.counter[i] += p->counter[i];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -21,9 +21,6 @@
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
@@ -62,45 +59,47 @@ int clear_time_state(void)
|
||||
#define NUM_FREQ_OUTOFRANGE 4
|
||||
#define NUM_FREQ_INVALID 2
|
||||
|
||||
#define SHIFTED_PPM (1 << 16)
|
||||
|
||||
long valid_freq[NUM_FREQ_VALID] = {
|
||||
-499<<16,
|
||||
-450<<16,
|
||||
-400<<16,
|
||||
-350<<16,
|
||||
-300<<16,
|
||||
-250<<16,
|
||||
-200<<16,
|
||||
-150<<16,
|
||||
-100<<16,
|
||||
-75<<16,
|
||||
-50<<16,
|
||||
-25<<16,
|
||||
-10<<16,
|
||||
-5<<16,
|
||||
-1<<16,
|
||||
-499 * SHIFTED_PPM,
|
||||
-450 * SHIFTED_PPM,
|
||||
-400 * SHIFTED_PPM,
|
||||
-350 * SHIFTED_PPM,
|
||||
-300 * SHIFTED_PPM,
|
||||
-250 * SHIFTED_PPM,
|
||||
-200 * SHIFTED_PPM,
|
||||
-150 * SHIFTED_PPM,
|
||||
-100 * SHIFTED_PPM,
|
||||
-75 * SHIFTED_PPM,
|
||||
-50 * SHIFTED_PPM,
|
||||
-25 * SHIFTED_PPM,
|
||||
-10 * SHIFTED_PPM,
|
||||
-5 * SHIFTED_PPM,
|
||||
-1 * SHIFTED_PPM,
|
||||
-1000,
|
||||
1<<16,
|
||||
5<<16,
|
||||
10<<16,
|
||||
25<<16,
|
||||
50<<16,
|
||||
75<<16,
|
||||
100<<16,
|
||||
150<<16,
|
||||
200<<16,
|
||||
250<<16,
|
||||
300<<16,
|
||||
350<<16,
|
||||
400<<16,
|
||||
450<<16,
|
||||
499<<16,
|
||||
1 * SHIFTED_PPM,
|
||||
5 * SHIFTED_PPM,
|
||||
10 * SHIFTED_PPM,
|
||||
25 * SHIFTED_PPM,
|
||||
50 * SHIFTED_PPM,
|
||||
75 * SHIFTED_PPM,
|
||||
100 * SHIFTED_PPM,
|
||||
150 * SHIFTED_PPM,
|
||||
200 * SHIFTED_PPM,
|
||||
250 * SHIFTED_PPM,
|
||||
300 * SHIFTED_PPM,
|
||||
350 * SHIFTED_PPM,
|
||||
400 * SHIFTED_PPM,
|
||||
450 * SHIFTED_PPM,
|
||||
499 * SHIFTED_PPM,
|
||||
};
|
||||
|
||||
long outofrange_freq[NUM_FREQ_OUTOFRANGE] = {
|
||||
-1000<<16,
|
||||
-550<<16,
|
||||
550<<16,
|
||||
1000<<16,
|
||||
-1000 * SHIFTED_PPM,
|
||||
-550 * SHIFTED_PPM,
|
||||
550 * SHIFTED_PPM,
|
||||
1000 * SHIFTED_PPM,
|
||||
};
|
||||
|
||||
#define LONG_MAX (~0UL>>1)
|
||||
|
||||
Reference in New Issue
Block a user