Skip to content

Commit

Permalink
Merge remote-tracking branch 'stable/linux-4.14.y' into rpi-4.14.y
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Mar 26, 2018
2 parents 9e22852 + de8cdc5 commit 81dda1a
Show file tree
Hide file tree
Showing 85 changed files with 585 additions and 254 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Toppoly TD028TTEC1 Panel
========================

Required properties:
- compatible: "toppoly,td028ttec1"
- compatible: "tpo,td028ttec1"

Optional properties:
- label: a symbolic name for the panel
Expand All @@ -14,7 +14,7 @@ Example
-------

lcd-panel: td028ttec1@0 {
compatible = "toppoly,td028ttec1";
compatible = "tpo,td028ttec1";
reg = <0>;
spi-max-frequency = <100000>;
spi-cpol;
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 14
SUBLEVEL = 29
SUBLEVEL = 30
EXTRAVERSION =
NAME = Petit Gorille

Expand Down
1 change: 1 addition & 0 deletions arch/alpha/kernel/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
struct pci_controller *pci_vga_hose;
static struct resource alpha_vga = {
.name = "alpha-vga+",
.flags = IORESOURCE_IO,
.start = 0x3C0,
.end = 0x3DF
};
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/aspeed-ast2500-evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
bootargs = "console=ttyS4,115200 earlyprintk";
};

memory {
memory@80000000 {
reg = <0x80000000 0x20000000>;
};
};
Expand Down
3 changes: 2 additions & 1 deletion drivers/bluetooth/btqcomsmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ static int btqcomsmd_send(struct hci_dev *hdev, struct sk_buff *skb)
break;
}

kfree_skb(skb);
if (!ret)
kfree_skb(skb);

return ret;
}
Expand Down
3 changes: 3 additions & 0 deletions drivers/bluetooth/hci_qca.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,9 @@ static int qca_setup(struct hci_uart *hu)
if (!ret) {
set_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags);
qca_debugfs_init(hdev);
} else if (ret == -ENOENT) {
/* No patch/nvm-config found, run with original fw/config */
ret = 0;
}

/* Setup bdaddr */
Expand Down
27 changes: 22 additions & 5 deletions drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ static ssize_t read_mem(struct file *file, char __user *buf,
phys_addr_t p = *ppos;
ssize_t read, sz;
void *ptr;
char *bounce;
int err;

if (p != *ppos)
return 0;
Expand All @@ -129,15 +131,22 @@ static ssize_t read_mem(struct file *file, char __user *buf,
}
#endif

bounce = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!bounce)
return -ENOMEM;

while (count > 0) {
unsigned long remaining;
int allowed;

sz = size_inside_page(p, count);

err = -EPERM;
allowed = page_is_allowed(p >> PAGE_SHIFT);
if (!allowed)
return -EPERM;
goto failed;

err = -EFAULT;
if (allowed == 2) {
/* Show zeros for restricted memory. */
remaining = clear_user(buf, sz);
Expand All @@ -149,24 +158,32 @@ static ssize_t read_mem(struct file *file, char __user *buf,
*/
ptr = xlate_dev_mem_ptr(p);
if (!ptr)
return -EFAULT;

remaining = copy_to_user(buf, ptr, sz);
goto failed;

err = probe_kernel_read(bounce, ptr, sz);
unxlate_dev_mem_ptr(p, ptr);
if (err)
goto failed;

remaining = copy_to_user(buf, bounce, sz);
}

if (remaining)
return -EFAULT;
goto failed;

buf += sz;
p += sz;
count -= sz;
read += sz;
}
kfree(bounce);

*ppos += read;
return read;

failed:
kfree(bounce);
return err;
}

static ssize_t write_mem(struct file *file, const char __user *buf,
Expand Down
24 changes: 16 additions & 8 deletions drivers/clk/at91/pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,20 @@ static int pmc_suspend(void)
return 0;
}

static bool pmc_ready(unsigned int mask)
{
unsigned int status;

regmap_read(pmcreg, AT91_PMC_SR, &status);

return ((status & mask) == mask) ? 1 : 0;
}

static void pmc_resume(void)
{
int i, ret = 0;
int i;
u32 tmp;
u32 mask = AT91_PMC_MCKRDY | AT91_PMC_LOCKA;

regmap_read(pmcreg, AT91_PMC_MCKR, &tmp);
if (pmc_cache.mckr != tmp)
Expand All @@ -134,13 +144,11 @@ static void pmc_resume(void)
AT91_PMC_PCR_CMD);
}

if (pmc_cache.uckr & AT91_PMC_UPLLEN) {
ret = regmap_read_poll_timeout(pmcreg, AT91_PMC_SR, tmp,
!(tmp & AT91_PMC_LOCKU),
10, 5000);
if (ret)
pr_crit("USB PLL didn't lock when resuming\n");
}
if (pmc_cache.uckr & AT91_PMC_UPLLEN)
mask |= AT91_PMC_LOCKU;

while (!pmc_ready(mask))
cpu_relax();
}

static struct syscore_ops pmc_syscore_ops = {
Expand Down
29 changes: 24 additions & 5 deletions drivers/clk/clk-axi-clkgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
#define MMCM_REG_FILTER1 0x4e
#define MMCM_REG_FILTER2 0x4f

#define MMCM_CLKOUT_NOCOUNT BIT(6)

#define MMCM_CLK_DIV_NOCOUNT BIT(12)

struct axi_clkgen {
void __iomem *base;
struct clk_hw clk_hw;
Expand Down Expand Up @@ -315,12 +319,27 @@ static unsigned long axi_clkgen_recalc_rate(struct clk_hw *clk_hw,
unsigned int reg;
unsigned long long tmp;

axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLKOUT0_1, &reg);
dout = (reg & 0x3f) + ((reg >> 6) & 0x3f);
axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLKOUT0_2, &reg);
if (reg & MMCM_CLKOUT_NOCOUNT) {
dout = 1;
} else {
axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLKOUT0_1, &reg);
dout = (reg & 0x3f) + ((reg >> 6) & 0x3f);
}

axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLK_DIV, &reg);
d = (reg & 0x3f) + ((reg >> 6) & 0x3f);
axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLK_FB1, &reg);
m = (reg & 0x3f) + ((reg >> 6) & 0x3f);
if (reg & MMCM_CLK_DIV_NOCOUNT)
d = 1;
else
d = (reg & 0x3f) + ((reg >> 6) & 0x3f);

axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLK_FB2, &reg);
if (reg & MMCM_CLKOUT_NOCOUNT) {
m = 1;
} else {
axi_clkgen_mmcm_read(axi_clkgen, MMCM_REG_CLK_FB1, &reg);
m = (reg & 0x3f) + ((reg >> 6) & 0x3f);
}

if (d == 0 || dout == 0)
return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/clk-si5351.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static const char * const si5351_input_names[] = {
"xtal", "clkin"
};
static const char * const si5351_pll_names[] = {
"plla", "pllb", "vxco"
"si5351_plla", "si5351_pllb", "si5351_vxco"
};
static const char * const si5351_msynth_names[] = {
"ms0", "ms1", "ms2", "ms3", "ms4", "ms5", "ms6", "ms7"
Expand Down
32 changes: 20 additions & 12 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2470,6 +2470,21 @@ static int __clk_core_init(struct clk_core *core)
rate = 0;
core->rate = core->req_rate = rate;

/*
* Enable CLK_IS_CRITICAL clocks so newly added critical clocks
* don't get accidentally disabled when walking the orphan tree and
* reparenting clocks
*/
if (core->flags & CLK_IS_CRITICAL) {
unsigned long flags;

clk_core_prepare(core);

flags = clk_enable_lock();
clk_core_enable(core);
clk_enable_unlock(flags);
}

/*
* walk the list of orphan clocks and reparent any that newly finds a
* parent.
Expand All @@ -2478,10 +2493,13 @@ static int __clk_core_init(struct clk_core *core)
struct clk_core *parent = __clk_init_parent(orphan);

/*
* we could call __clk_set_parent, but that would result in a
* redundant call to the .set_rate op, if it exists
* We need to use __clk_set_parent_before() and _after() to
* to properly migrate any prepare/enable count of the orphan
* clock. This is important for CLK_IS_CRITICAL clocks, which
* are enabled during init but might not have a parent yet.
*/
if (parent) {
/* update the clk tree topology */
__clk_set_parent_before(orphan, parent);
__clk_set_parent_after(orphan, parent, NULL);
__clk_recalc_accuracies(orphan);
Expand All @@ -2500,16 +2518,6 @@ static int __clk_core_init(struct clk_core *core)
if (core->ops->init)
core->ops->init(core->hw);

if (core->flags & CLK_IS_CRITICAL) {
unsigned long flags;

clk_core_prepare(core);

flags = clk_enable_lock();
clk_core_enable(core);
clk_enable_unlock(flags);
}

kref_init(&core->ref);
out:
clk_prepare_unlock();
Expand Down
2 changes: 1 addition & 1 deletion drivers/cpufreq/longhaul.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
if ((longhaul_version != TYPE_LONGHAUL_V1) && (scale_voltage != 0))
longhaul_setup_voltagescaling();

policy->cpuinfo.transition_latency = 200000; /* nsec */
policy->transition_delay_us = 200000; /* usec */

return cpufreq_table_validate_and_show(policy, longhaul_table);
}
Expand Down
5 changes: 3 additions & 2 deletions drivers/crypto/axis/artpec6_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/slab.h>

#include <crypto/aes.h>
#include <crypto/gcm.h>
#include <crypto/internal/aead.h>
#include <crypto/internal/hash.h>
#include <crypto/internal/skcipher.h>
Expand Down Expand Up @@ -1934,7 +1935,7 @@ static int artpec6_crypto_prepare_aead(struct aead_request *areq)

memcpy(req_ctx->hw_ctx.J0, areq->iv, crypto_aead_ivsize(cipher));
// The HW omits the initial increment of the counter field.
crypto_inc(req_ctx->hw_ctx.J0+12, 4);
memcpy(req_ctx->hw_ctx.J0 + GCM_AES_IV_SIZE, "\x00\x00\x00\x01", 4);

ret = artpec6_crypto_setup_out_descr(common, &req_ctx->hw_ctx,
sizeof(struct artpec6_crypto_aead_hw_ctx), false, false);
Expand Down Expand Up @@ -2956,7 +2957,7 @@ static struct aead_alg aead_algos[] = {
.setkey = artpec6_crypto_aead_set_key,
.encrypt = artpec6_crypto_aead_encrypt,
.decrypt = artpec6_crypto_aead_decrypt,
.ivsize = AES_BLOCK_SIZE,
.ivsize = GCM_AES_IV_SIZE,
.maxauthsize = AES_BLOCK_SIZE,

.base = {
Expand Down
10 changes: 9 additions & 1 deletion drivers/dma/ti-dma-crossbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ struct ti_am335x_xbar_map {

static inline void ti_am335x_xbar_write(void __iomem *iomem, int event, u8 val)
{
writeb_relaxed(val, iomem + event);
/*
* TPCC_EVT_MUX_60_63 register layout is different than the
* rest, in the sense, that event 63 is mapped to lowest byte
* and event 60 is mapped to highest, handle it separately.
*/
if (event >= 60 && event <= 63)
writeb_relaxed(val, iomem + (63 - event % 4));
else
writeb_relaxed(val, iomem + event);
}

static void ti_am335x_xbar_free(struct device *dev, void *route_data)
Expand Down
3 changes: 2 additions & 1 deletion drivers/dma/xilinx/zynqmp_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,8 @@ static void zynqmp_dma_chan_remove(struct zynqmp_dma_chan *chan)
if (!chan)
return;

devm_free_irq(chan->zdev->dev, chan->irq, chan);
if (chan->irq)
devm_free_irq(chan->zdev->dev, chan->irq, chan);
tasklet_kill(&chan->tasklet);
list_del(&chan->common.device_node);
clk_disable_unprepare(chan->clk_apb);
Expand Down
14 changes: 10 additions & 4 deletions drivers/gpu/drm/msm/msm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,17 @@ static struct page **get_pages(struct drm_gem_object *obj)
return p;
}

msm_obj->pages = p;

msm_obj->sgt = drm_prime_pages_to_sg(p, npages);
if (IS_ERR(msm_obj->sgt)) {
void *ptr = ERR_CAST(msm_obj->sgt);

dev_err(dev->dev, "failed to allocate sgt\n");
return ERR_CAST(msm_obj->sgt);
msm_obj->sgt = NULL;
return ptr;
}

msm_obj->pages = p;

/* For non-cached buffers, ensure the new pages are clean
* because display controller, GPU, etc. are not coherent:
*/
Expand Down Expand Up @@ -135,7 +138,10 @@ static void put_pages(struct drm_gem_object *obj)
if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED))
dma_unmap_sg(obj->dev->dev, msm_obj->sgt->sgl,
msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
sg_free_table(msm_obj->sgt);

if (msm_obj->sgt)
sg_free_table(msm_obj->sgt);

kfree(msm_obj->sgt);

if (use_pages(obj))
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,8 @@ static int td028ttec1_panel_remove(struct spi_device *spi)
}

static const struct of_device_id td028ttec1_of_match[] = {
{ .compatible = "omapdss,tpo,td028ttec1", },
/* keep to not break older DTB */
{ .compatible = "omapdss,toppoly,td028ttec1", },
{},
};
Expand All @@ -471,6 +473,7 @@ static struct spi_driver td028ttec1_spi_driver = {

module_spi_driver(td028ttec1_spi_driver);

MODULE_ALIAS("spi:tpo,td028ttec1");
MODULE_ALIAS("spi:toppoly,td028ttec1");
MODULE_AUTHOR("H. Nikolaus Schaller <hns@goldelico.com>");
MODULE_DESCRIPTION("Toppoly TD028TTEC1 panel driver");
Expand Down
Loading

0 comments on commit 81dda1a

Please sign in to comment.