Skip to content

Commit

Permalink
Merge "Merge 4.14.290 into android-4.14-stable" into android-4.14-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Treehugger Robot committed Aug 1, 2022
2 parents 803b347 + 75fb93b commit 33e4ebe
Show file tree
Hide file tree
Showing 44 changed files with 409 additions and 342 deletions.
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 = 289
SUBLEVEL = 290
EXTRAVERSION =
NAME = Petit Gorille

Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/srmcons.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ srmcons_do_receive_chars(struct tty_port *port)
} while((result.bits.status & 1) && (++loops < 10));

if (count)
tty_schedule_flip(port);
tty_flip_buffer_push(port);

return count;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ static void __cold process_random_ready_list(void)

#define warn_unseeded_randomness() \
if (IS_ENABLED(CONFIG_WARN_ALL_UNSEEDED_RANDOM) && !crng_ready()) \
pr_notice("%s called from %pS with crng_init=%d\n", \
__func__, (void *)_RET_IP_, crng_init)
printk_deferred(KERN_NOTICE "random: %s called from %pS with crng_init=%d\n", \
__func__, (void *)_RET_IP_, crng_init)


/*********************************************************************
Expand Down
28 changes: 11 additions & 17 deletions drivers/gpu/drm/tilcdc/tilcdc_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,6 @@ static bool tilcdc_crtc_mode_fixup(struct drm_crtc *crtc,
static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc,
struct drm_crtc_state *state)
{
struct drm_display_mode *mode = &state->mode;
int ret;

/* If we are not active we don't care */
if (!state->active)
return 0;
Expand All @@ -721,12 +718,6 @@ static int tilcdc_crtc_atomic_check(struct drm_crtc *crtc,
return -EINVAL;
}

ret = tilcdc_crtc_mode_valid(crtc, mode);
if (ret) {
dev_dbg(crtc->dev->dev, "Mode \"%s\" not valid", mode->name);
return -EINVAL;
}

return 0;
}

Expand All @@ -750,13 +741,6 @@ static const struct drm_crtc_funcs tilcdc_crtc_funcs = {
.disable_vblank = tilcdc_crtc_disable_vblank,
};

static const struct drm_crtc_helper_funcs tilcdc_crtc_helper_funcs = {
.mode_fixup = tilcdc_crtc_mode_fixup,
.atomic_check = tilcdc_crtc_atomic_check,
.atomic_enable = tilcdc_crtc_atomic_enable,
.atomic_disable = tilcdc_crtc_atomic_disable,
};

int tilcdc_crtc_max_width(struct drm_crtc *crtc)
{
struct drm_device *dev = crtc->dev;
Expand All @@ -771,7 +755,9 @@ int tilcdc_crtc_max_width(struct drm_crtc *crtc)
return max_width;
}

int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode)
static enum drm_mode_status
tilcdc_crtc_mode_valid(struct drm_crtc *crtc,
const struct drm_display_mode *mode)
{
struct tilcdc_drm_private *priv = crtc->dev->dev_private;
unsigned int bandwidth;
Expand Down Expand Up @@ -859,6 +845,14 @@ int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode)
return MODE_OK;
}

static const struct drm_crtc_helper_funcs tilcdc_crtc_helper_funcs = {
.mode_valid = tilcdc_crtc_mode_valid,
.mode_fixup = tilcdc_crtc_mode_fixup,
.atomic_check = tilcdc_crtc_atomic_check,
.atomic_enable = tilcdc_crtc_atomic_enable,
.atomic_disable = tilcdc_crtc_atomic_disable,
};

void tilcdc_crtc_set_panel_info(struct drm_crtc *crtc,
const struct tilcdc_panel_info *info)
{
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/tilcdc/tilcdc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ static void tilcdc_fini(struct drm_device *dev)

drm_irq_uninstall(dev);
drm_mode_config_cleanup(dev);
tilcdc_remove_external_device(dev);

if (priv->clk)
clk_put(priv->clk);
Expand Down
2 changes: 0 additions & 2 deletions drivers/gpu/drm/tilcdc/tilcdc_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ struct tilcdc_drm_private {

struct drm_encoder *external_encoder;
struct drm_connector *external_connector;
const struct drm_connector_helper_funcs *connector_funcs;

bool is_registered;
bool is_componentized;
Expand Down Expand Up @@ -173,7 +172,6 @@ void tilcdc_crtc_set_panel_info(struct drm_crtc *crtc,
const struct tilcdc_panel_info *info);
void tilcdc_crtc_set_simulate_vesa_sync(struct drm_crtc *crtc,
bool simulate_vesa_sync);
int tilcdc_crtc_mode_valid(struct drm_crtc *crtc, struct drm_display_mode *mode);
int tilcdc_crtc_max_width(struct drm_crtc *crtc);
void tilcdc_crtc_shutdown(struct drm_crtc *crtc);
int tilcdc_crtc_update_fb(struct drm_crtc *crtc,
Expand Down
96 changes: 13 additions & 83 deletions drivers/gpu/drm/tilcdc/tilcdc_external.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,64 +40,6 @@ static const struct tilcdc_panel_info panel_info_default = {
.raster_order = 0,
};

static int tilcdc_external_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct tilcdc_drm_private *priv = connector->dev->dev_private;
int ret;

ret = tilcdc_crtc_mode_valid(priv->crtc, mode);
if (ret != MODE_OK)
return ret;

BUG_ON(priv->external_connector != connector);
BUG_ON(!priv->connector_funcs);

/* If the connector has its own mode_valid call it. */
if (!IS_ERR(priv->connector_funcs) &&
priv->connector_funcs->mode_valid)
return priv->connector_funcs->mode_valid(connector, mode);

return MODE_OK;
}

static int tilcdc_add_external_connector(struct drm_device *dev,
struct drm_connector *connector)
{
struct tilcdc_drm_private *priv = dev->dev_private;
struct drm_connector_helper_funcs *connector_funcs;

/* There should never be more than one connector */
if (WARN_ON(priv->external_connector))
return -EINVAL;

priv->external_connector = connector;
connector_funcs = devm_kzalloc(dev->dev, sizeof(*connector_funcs),
GFP_KERNEL);
if (!connector_funcs)
return -ENOMEM;

/* connector->helper_private contains always struct
* connector_helper_funcs pointer. For tilcdc crtc to have a
* say if a specific mode is Ok, we need to install our own
* helper functions. In our helper functions we copy
* everything else but use our own mode_valid() (above).
*/
if (connector->helper_private) {
priv->connector_funcs = connector->helper_private;
*connector_funcs = *priv->connector_funcs;
} else {
priv->connector_funcs = ERR_PTR(-ENOENT);
}
connector_funcs->mode_valid = tilcdc_external_mode_valid;
drm_connector_helper_add(connector, connector_funcs);

dev_dbg(dev->dev, "External connector '%s' connected\n",
connector->name);

return 0;
}

static
struct drm_connector *tilcdc_encoder_find_connector(struct drm_device *ddev,
struct drm_encoder *encoder)
Expand All @@ -119,40 +61,30 @@ struct drm_connector *tilcdc_encoder_find_connector(struct drm_device *ddev,
int tilcdc_add_component_encoder(struct drm_device *ddev)
{
struct tilcdc_drm_private *priv = ddev->dev_private;
struct drm_connector *connector;
struct drm_encoder *encoder;
struct drm_encoder *encoder = NULL, *iter;

list_for_each_entry(encoder, &ddev->mode_config.encoder_list, head)
if (encoder->possible_crtcs & (1 << priv->crtc->index))
list_for_each_entry(iter, &ddev->mode_config.encoder_list, head)
if (iter->possible_crtcs & (1 << priv->crtc->index)) {
encoder = iter;
break;
}

if (!encoder) {
dev_err(ddev->dev, "%s: No suitable encoder found\n", __func__);
return -ENODEV;
}

connector = tilcdc_encoder_find_connector(ddev, encoder);
priv->external_connector =
tilcdc_encoder_find_connector(ddev, encoder);

if (!connector)
if (!priv->external_connector)
return -ENODEV;

/* Only tda998x is supported at the moment. */
tilcdc_crtc_set_simulate_vesa_sync(priv->crtc, true);
tilcdc_crtc_set_panel_info(priv->crtc, &panel_info_tda998x);

return tilcdc_add_external_connector(ddev, connector);
}

void tilcdc_remove_external_device(struct drm_device *dev)
{
struct tilcdc_drm_private *priv = dev->dev_private;

/* Restore the original helper functions, if any. */
if (IS_ERR(priv->connector_funcs))
drm_connector_helper_add(priv->external_connector, NULL);
else if (priv->connector_funcs)
drm_connector_helper_add(priv->external_connector,
priv->connector_funcs);
return 0;
}

static const struct drm_encoder_funcs tilcdc_external_encoder_funcs = {
Expand All @@ -163,7 +95,6 @@ static
int tilcdc_attach_bridge(struct drm_device *ddev, struct drm_bridge *bridge)
{
struct tilcdc_drm_private *priv = ddev->dev_private;
struct drm_connector *connector;
int ret;

priv->external_encoder->possible_crtcs = BIT(0);
Expand All @@ -176,13 +107,12 @@ int tilcdc_attach_bridge(struct drm_device *ddev, struct drm_bridge *bridge)

tilcdc_crtc_set_panel_info(priv->crtc, &panel_info_default);

connector = tilcdc_encoder_find_connector(ddev, priv->external_encoder);
if (!connector)
priv->external_connector =
tilcdc_encoder_find_connector(ddev, priv->external_encoder);
if (!priv->external_connector)
return -ENODEV;

ret = tilcdc_add_external_connector(ddev, connector);

return ret;
return 0;
}

int tilcdc_attach_external_device(struct drm_device *ddev)
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/tilcdc/tilcdc_external.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#define __TILCDC_EXTERNAL_H__

int tilcdc_add_component_encoder(struct drm_device *dev);
void tilcdc_remove_external_device(struct drm_device *dev);
int tilcdc_get_external_components(struct device *dev,
struct component_match **match);
int tilcdc_attach_external_device(struct drm_device *ddev);
Expand Down
9 changes: 0 additions & 9 deletions drivers/gpu/drm/tilcdc/tilcdc_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,6 @@ static int panel_connector_get_modes(struct drm_connector *connector)
return i;
}

static int panel_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct tilcdc_drm_private *priv = connector->dev->dev_private;
/* our only constraints are what the crtc can generate: */
return tilcdc_crtc_mode_valid(priv->crtc, mode);
}

static struct drm_encoder *panel_connector_best_encoder(
struct drm_connector *connector)
{
Expand All @@ -201,7 +193,6 @@ static const struct drm_connector_funcs panel_connector_funcs = {

static const struct drm_connector_helper_funcs panel_connector_helper_funcs = {
.get_modes = panel_connector_get_modes,
.mode_valid = panel_connector_mode_valid,
.best_encoder = panel_connector_best_encoder,
};

Expand Down
9 changes: 0 additions & 9 deletions drivers/gpu/drm/tilcdc/tilcdc_tfp410.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,6 @@ static int tfp410_connector_get_modes(struct drm_connector *connector)
return ret;
}

static int tfp410_connector_mode_valid(struct drm_connector *connector,
struct drm_display_mode *mode)
{
struct tilcdc_drm_private *priv = connector->dev->dev_private;
/* our only constraints are what the crtc can generate: */
return tilcdc_crtc_mode_valid(priv->crtc, mode);
}

static struct drm_encoder *tfp410_connector_best_encoder(
struct drm_connector *connector)
{
Expand All @@ -211,7 +203,6 @@ static const struct drm_connector_funcs tfp410_connector_funcs = {

static const struct drm_connector_helper_funcs tfp410_connector_helper_funcs = {
.get_modes = tfp410_connector_get_modes,
.mode_valid = tfp410_connector_mode_valid,
.best_encoder = tfp410_connector_best_encoder,
};

Expand Down
30 changes: 5 additions & 25 deletions drivers/i2c/busses/i2c-cadence.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ static inline bool cdns_is_holdquirk(struct cdns_i2c *id, bool hold_wrkaround)
*/
static irqreturn_t cdns_i2c_isr(int irq, void *ptr)
{
unsigned int isr_status, avail_bytes, updatetx;
unsigned int isr_status, avail_bytes;
unsigned int bytes_to_send;
bool hold_quirk;
bool updatetx;
struct cdns_i2c *id = ptr;
/* Signal completion only after everything is updated */
int done_flag = 0;
Expand All @@ -224,11 +224,7 @@ static irqreturn_t cdns_i2c_isr(int irq, void *ptr)
* Check if transfer size register needs to be updated again for a
* large data receive operation.
*/
updatetx = 0;
if (id->recv_count > id->curr_recv_count)
updatetx = 1;

hold_quirk = (id->quirks & CDNS_I2C_BROKEN_HOLD_BIT) && updatetx;
updatetx = id->recv_count > id->curr_recv_count;

/* When receiving, handle data interrupt and completion interrupt */
if (id->p_recv_buf &&
Expand All @@ -251,7 +247,7 @@ static irqreturn_t cdns_i2c_isr(int irq, void *ptr)
id->recv_count--;
id->curr_recv_count--;

if (cdns_is_holdquirk(id, hold_quirk))
if (cdns_is_holdquirk(id, updatetx))
break;
}

Expand All @@ -262,7 +258,7 @@ static irqreturn_t cdns_i2c_isr(int irq, void *ptr)
* maintain transfer size non-zero while performing a large
* receive operation.
*/
if (cdns_is_holdquirk(id, hold_quirk)) {
if (cdns_is_holdquirk(id, updatetx)) {
/* wait while fifo is full */
while (cdns_i2c_readreg(CDNS_I2C_XFER_SIZE_OFFSET) !=
(id->curr_recv_count - CDNS_I2C_FIFO_DEPTH))
Expand All @@ -284,22 +280,6 @@ static irqreturn_t cdns_i2c_isr(int irq, void *ptr)
CDNS_I2C_XFER_SIZE_OFFSET);
id->curr_recv_count = id->recv_count;
}
} else if (id->recv_count && !hold_quirk &&
!id->curr_recv_count) {

/* Set the slave address in address register*/
cdns_i2c_writereg(id->p_msg->addr & CDNS_I2C_ADDR_MASK,
CDNS_I2C_ADDR_OFFSET);

if (id->recv_count > CDNS_I2C_TRANSFER_SIZE) {
cdns_i2c_writereg(CDNS_I2C_TRANSFER_SIZE,
CDNS_I2C_XFER_SIZE_OFFSET);
id->curr_recv_count = CDNS_I2C_TRANSFER_SIZE;
} else {
cdns_i2c_writereg(id->recv_count,
CDNS_I2C_XFER_SIZE_OFFSET);
id->curr_recv_count = id->recv_count;
}
}

/* Clear hold (if not repeated start) and signal completion */
Expand Down
Loading

0 comments on commit 33e4ebe

Please sign in to comment.