Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Browse files Browse the repository at this point in the history
Smooth Cong Wang's bug fix into 'net-next'.  Basically put
the bulk of the tcf_block_put() logic from 'net' into
tcf_block_put_ext(), but after the offload unbind.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Nov 2, 2017
2 parents 65c959a + 3a99df9 commit ed29668
Show file tree
Hide file tree
Showing 47 changed files with 284 additions and 169 deletions.
4 changes: 1 addition & 3 deletions Documentation/ABI/testing/sysfs-devices-power
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,7 @@ Description:
device, after it has been suspended at run time, from a resume
request to the moment the device will be ready to process I/O,
in microseconds. If it is equal to 0, however, this means that
the PM QoS resume latency may be arbitrary and the special value
"n/a" means that user space cannot accept any resume latency at
all for the given device.
the PM QoS resume latency may be arbitrary.

Not all drivers support this attribute. If it isn't supported,
it is not present.
Expand Down
6 changes: 3 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6678,7 +6678,7 @@ F: include/net/ieee802154_netdev.h
F: Documentation/networking/ieee802154.txt

IFE PROTOCOL
M: Yotam Gigi <yotamg@mellanox.com>
M: Yotam Gigi <yotam.gi@gmail.com>
M: Jamal Hadi Salim <jhs@mojatatu.com>
F: net/ife
F: include/net/ife.h
Expand Down Expand Up @@ -8751,7 +8751,7 @@ Q: http://patchwork.ozlabs.org/project/netdev/list/
F: drivers/net/ethernet/mellanox/mlxsw/

MELLANOX FIRMWARE FLASH LIBRARY (mlxfw)
M: Yotam Gigi <yotamg@mellanox.com>
M: mlxsw@mellanox.com
L: netdev@vger.kernel.org
S: Supported
W: http://www.mellanox.com
Expand Down Expand Up @@ -10899,7 +10899,7 @@ S: Maintained
F: drivers/block/ps3vram.c

PSAMPLE PACKET SAMPLING SUPPORT:
M: Yotam Gigi <yotamg@mellanox.com>
M: Yotam Gigi <yotam.gi@gmail.com>
S: Maintained
F: net/psample
F: include/net/psample.h
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/crypto/chacha20-avx2-x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ENTRY(chacha20_8block_xor_avx2)

vzeroupper
# 4 * 32 byte stack, 32-byte aligned
mov %rsp, %r8
lea 8(%rsp),%r10
and $~31, %rsp
sub $0x80, %rsp

Expand Down Expand Up @@ -443,6 +443,6 @@ ENTRY(chacha20_8block_xor_avx2)
vmovdqu %ymm15,0x01e0(%rsi)

vzeroupper
mov %r8,%rsp
lea -8(%r10),%rsp
ret
ENDPROC(chacha20_8block_xor_avx2)
4 changes: 2 additions & 2 deletions arch/x86/crypto/chacha20-ssse3-x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ ENTRY(chacha20_4block_xor_ssse3)
# done with the slightly better performing SSSE3 byte shuffling,
# 7/12-bit word rotation uses traditional shift+OR.

mov %rsp,%r11
lea 8(%rsp),%r10
sub $0x80,%rsp
and $~63,%rsp

Expand Down Expand Up @@ -625,6 +625,6 @@ ENTRY(chacha20_4block_xor_ssse3)
pxor %xmm1,%xmm15
movdqu %xmm15,0xf0(%rsi)

mov %r11,%rsp
lea -8(%r10),%rsp
ret
ENDPROC(chacha20_4block_xor_ssse3)
11 changes: 10 additions & 1 deletion arch/x86/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,17 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
* make sure we exit gracefully rather than endlessly redo
* the fault. Since we never set FAULT_FLAG_RETRY_NOWAIT, if
* we get VM_FAULT_RETRY back, the mmap_sem has been unlocked.
*
* Note that handle_userfault() may also release and reacquire mmap_sem
* (and not return with VM_FAULT_RETRY), when returning to userland to
* repeat the page fault later with a VM_FAULT_NOPAGE retval
* (potentially after handling any pending signal during the return to
* userland). The return to userland is identified whenever
* FAULT_FLAG_USER|FAULT_FLAG_KILLABLE are both set in flags.
* Thus we have to be careful about not touching vma after handling the
* fault, so we read the pkey beforehand.
*/
pkey = vma_pkey(vma);
fault = handle_mm_fault(vma, address, flags);
major |= fault & VM_FAULT_MAJOR;

Expand All @@ -1467,7 +1477,6 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code,
return;
}

pkey = vma_pkey(vma);
up_read(&mm->mmap_sem);
if (unlikely(fault & VM_FAULT_ERROR)) {
mm_fault_error(regs, error_code, address, &pkey, fault);
Expand Down
3 changes: 1 addition & 2 deletions drivers/base/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,7 @@ int register_cpu(struct cpu *cpu, int num)

per_cpu(cpu_sys_devices, num) = &cpu->dev;
register_cpu_under_node(num, cpu_to_node(num));
dev_pm_qos_expose_latency_limit(&cpu->dev,
PM_QOS_RESUME_LATENCY_NO_CONSTRAINT);
dev_pm_qos_expose_latency_limit(&cpu->dev, 0);

return 0;
}
Expand Down
53 changes: 23 additions & 30 deletions drivers/base/power/domain_governor.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,23 @@
static int dev_update_qos_constraint(struct device *dev, void *data)
{
s64 *constraint_ns_p = data;
s64 constraint_ns = -1;
s32 constraint_ns = -1;

if (dev->power.subsys_data && dev->power.subsys_data->domain_data)
constraint_ns = dev_gpd_data(dev)->td.effective_constraint_ns;

if (constraint_ns < 0)
if (constraint_ns < 0) {
constraint_ns = dev_pm_qos_read_value(dev);

if (constraint_ns == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
constraint_ns *= NSEC_PER_USEC;
}
if (constraint_ns == 0)
return 0;

constraint_ns *= NSEC_PER_USEC;

if (constraint_ns < *constraint_ns_p || *constraint_ns_p < 0)
/*
* constraint_ns cannot be negative here, because the device has been
* suspended.
*/
if (constraint_ns < *constraint_ns_p || *constraint_ns_p == 0)
*constraint_ns_p = constraint_ns;

return 0;
Expand Down Expand Up @@ -60,14 +63,10 @@ static bool default_suspend_ok(struct device *dev)

spin_unlock_irqrestore(&dev->power.lock, flags);

if (constraint_ns == 0)
if (constraint_ns < 0)
return false;

if (constraint_ns == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
constraint_ns = -1;
else
constraint_ns *= NSEC_PER_USEC;

constraint_ns *= NSEC_PER_USEC;
/*
* We can walk the children without any additional locking, because
* they all have been suspended at this point and their
Expand All @@ -77,19 +76,14 @@ static bool default_suspend_ok(struct device *dev)
device_for_each_child(dev, &constraint_ns,
dev_update_qos_constraint);

if (constraint_ns < 0) {
/* The children have no constraints. */
td->effective_constraint_ns = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
td->cached_suspend_ok = true;
} else {
constraint_ns -= td->suspend_latency_ns + td->resume_latency_ns;
if (constraint_ns > 0) {
td->effective_constraint_ns = constraint_ns;
td->cached_suspend_ok = true;
} else {
td->effective_constraint_ns = 0;
}
if (constraint_ns > 0) {
constraint_ns -= td->suspend_latency_ns +
td->resume_latency_ns;
if (constraint_ns == 0)
return false;
}
td->effective_constraint_ns = constraint_ns;
td->cached_suspend_ok = constraint_ns >= 0;

/*
* The children have been suspended already, so we don't need to take
Expand Down Expand Up @@ -151,14 +145,13 @@ static bool __default_power_down_ok(struct dev_pm_domain *pd,
td = &to_gpd_data(pdd)->td;
constraint_ns = td->effective_constraint_ns;
/* default_suspend_ok() need not be called before us. */
if (constraint_ns < 0)
if (constraint_ns < 0) {
constraint_ns = dev_pm_qos_read_value(pdd->dev);

if (constraint_ns == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
constraint_ns *= NSEC_PER_USEC;
}
if (constraint_ns == 0)
continue;

constraint_ns *= NSEC_PER_USEC;

/*
* constraint_ns cannot be negative here, because the device has
* been suspended.
Expand Down
2 changes: 1 addition & 1 deletion drivers/base/power/qos.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static int dev_pm_qos_constraints_allocate(struct device *dev)
plist_head_init(&c->list);
c->target_value = PM_QOS_RESUME_LATENCY_DEFAULT_VALUE;
c->default_value = PM_QOS_RESUME_LATENCY_DEFAULT_VALUE;
c->no_constraint_value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
c->no_constraint_value = PM_QOS_RESUME_LATENCY_DEFAULT_VALUE;
c->type = PM_QOS_MIN;
c->notifiers = n;

Expand Down
2 changes: 1 addition & 1 deletion drivers/base/power/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ static int rpm_check_suspend_allowed(struct device *dev)
|| (dev->power.request_pending
&& dev->power.request == RPM_REQ_RESUME))
retval = -EAGAIN;
else if (__dev_pm_qos_read_value(dev) == 0)
else if (__dev_pm_qos_read_value(dev) < 0)
retval = -EPERM;
else if (dev->power.runtime_status == RPM_SUSPENDED)
retval = 1;
Expand Down
25 changes: 4 additions & 21 deletions drivers/base/power/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,7 @@ static ssize_t pm_qos_resume_latency_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
s32 value = dev_pm_qos_requested_resume_latency(dev);

if (value == 0)
return sprintf(buf, "n/a\n");
else if (value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
value = 0;

return sprintf(buf, "%d\n", value);
return sprintf(buf, "%d\n", dev_pm_qos_requested_resume_latency(dev));
}

static ssize_t pm_qos_resume_latency_store(struct device *dev,
Expand All @@ -235,21 +228,11 @@ static ssize_t pm_qos_resume_latency_store(struct device *dev,
s32 value;
int ret;

if (!kstrtos32(buf, 0, &value)) {
/*
* Prevent users from writing negative or "no constraint" values
* directly.
*/
if (value < 0 || value == PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
return -EINVAL;
if (kstrtos32(buf, 0, &value))
return -EINVAL;

if (value == 0)
value = PM_QOS_RESUME_LATENCY_NO_CONSTRAINT;
} else if (!strcmp(buf, "n/a") || !strcmp(buf, "n/a\n")) {
value = 0;
} else {
if (value < 0)
return -EINVAL;
}

ret = dev_pm_qos_update_request(dev->power.qos->resume_latency_req,
value);
Expand Down
12 changes: 12 additions & 0 deletions drivers/block/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,22 @@ static int virtblk_map_queues(struct blk_mq_tag_set *set)
return blk_mq_virtio_map_queues(set, vblk->vdev, 0);
}

#ifdef CONFIG_VIRTIO_BLK_SCSI
static void virtblk_initialize_rq(struct request *req)
{
struct virtblk_req *vbr = blk_mq_rq_to_pdu(req);

scsi_req_init(&vbr->sreq);
}
#endif

static const struct blk_mq_ops virtio_mq_ops = {
.queue_rq = virtio_queue_rq,
.complete = virtblk_request_done,
.init_request = virtblk_init_request,
#ifdef CONFIG_VIRTIO_BLK_SCSI
.initialize_rq_fn = virtblk_initialize_rq,
#endif
.map_queues = virtblk_map_queues,
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/cpuidle/governors/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
data->needs_update = 0;
}

if (resume_latency < latency_req &&
resume_latency != PM_QOS_RESUME_LATENCY_NO_CONSTRAINT)
/* resume_latency is 0 means no restriction */
if (resume_latency && resume_latency < latency_req)
latency_req = resume_latency;

/* Special case when user has set very strict latency requirement */
Expand Down
1 change: 1 addition & 0 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,7 @@ static int ide_cdrom_prep_fs(struct request_queue *q, struct request *rq)
unsigned long blocks = blk_rq_sectors(rq) / (hard_sect >> 9);
struct scsi_request *req = scsi_req(rq);

scsi_req_init(req);
memset(req->cmd, 0, BLK_MAX_CDB);

if (rq_data_dir(rq) == READ)
Expand Down
4 changes: 3 additions & 1 deletion drivers/infiniband/core/nldev.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ static int nldev_port_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,

err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
nldev_policy, extack);
if (err || !tb[RDMA_NLDEV_ATTR_PORT_INDEX])
if (err ||
!tb[RDMA_NLDEV_ATTR_DEV_INDEX] ||
!tb[RDMA_NLDEV_ATTR_PORT_INDEX])
return -EINVAL;

index = nla_get_u32(tb[RDMA_NLDEV_ATTR_DEV_INDEX]);
Expand Down
17 changes: 10 additions & 7 deletions drivers/mmc/host/renesas_sdhi_internal_dmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,8 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
WARN_ON(host->sg_len > 1);

/* This DMAC cannot handle if buffer is not 8-bytes alignment */
if (!IS_ALIGNED(sg->offset, 8)) {
host->force_pio = true;
renesas_sdhi_internal_dmac_enable_dma(host, false);
return;
}
if (!IS_ALIGNED(sg->offset, 8))
goto force_pio;

if (data->flags & MMC_DATA_READ) {
dtran_mode |= DTRAN_MODE_CH_NUM_CH1;
Expand All @@ -163,8 +160,8 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
}

ret = dma_map_sg(&host->pdev->dev, sg, host->sg_len, dir);
if (ret < 0)
return;
if (ret == 0)
goto force_pio;

renesas_sdhi_internal_dmac_enable_dma(host, true);

Expand All @@ -176,6 +173,12 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
dtran_mode);
renesas_sdhi_internal_dmac_dm_write(host, DM_DTRAN_ADDR,
sg->dma_address);

return;

force_pio:
host->force_pio = true;
renesas_sdhi_internal_dmac_enable_dma(host, false);
}

static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg)
Expand Down
13 changes: 13 additions & 0 deletions drivers/mmc/host/tmio_mmc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/mmc/sdio.h>
#include <linux/scatterlist.h>
#include <linux/spinlock.h>
#include <linux/swiotlb.h>
#include <linux/workqueue.h>

#include "tmio_mmc.h"
Expand Down Expand Up @@ -1215,6 +1216,18 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
mmc->max_blk_count = pdata->max_blk_count ? :
(PAGE_SIZE / mmc->max_blk_size) * mmc->max_segs;
mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
/*
* Since swiotlb has memory size limitation, this will calculate
* the maximum size locally (because we don't have any APIs for it now)
* and check the current max_req_size. And then, this will update
* the max_req_size if needed as a workaround.
*/
if (swiotlb_max_segment()) {
unsigned int max_size = (1 << IO_TLB_SHIFT) * IO_TLB_SEGSIZE;

if (mmc->max_req_size > max_size)
mmc->max_req_size = max_size;
}
mmc->max_seg_size = mmc->max_req_size;

_host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD ||
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/hisilicon/hns/hns_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -2369,8 +2369,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev)
priv->enet_ver = AE_VERSION_2;

ae_node = of_parse_phandle(dev->of_node, "ae-handle", 0);
if (IS_ERR_OR_NULL(ae_node)) {
ret = PTR_ERR(ae_node);
if (!ae_node) {
ret = -ENODEV;
dev_err(dev, "not find ae-handle\n");
goto out_read_prop_fail;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlxsw/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ mlxsw_i2c_write(struct device *dev, size_t in_mbox_size, u8 *in_mbox, int num,
write_tran.len = MLXSW_I2C_ADDR_WIDTH + chunk_size;
mlxsw_i2c_set_slave_addr(tran_buf, off);
memcpy(&tran_buf[MLXSW_I2C_ADDR_BUF_SIZE], in_mbox +
chunk_size * i, chunk_size);
MLXSW_I2C_BLK_MAX * i, chunk_size);

j = 0;
end = jiffies + timeout;
Expand Down
Loading

0 comments on commit ed29668

Please sign in to comment.