Skip to content

Commit

Permalink
Merge branch 'android-4.9-q' of https://android.googlesource.com/kern…
Browse files Browse the repository at this point in the history
…el/common into live
  • Loading branch information
zeelog committed Oct 29, 2021
2 parents 7fa5016 + bcf0e3b commit 178eb40
Show file tree
Hide file tree
Showing 52 changed files with 226 additions and 160 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 4
PATCHLEVEL = 9
SUBLEVEL = 287
SUBLEVEL = 288
EXTRAVERSION =
NAME = Roaring Lionus

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/spear3xx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
};

gmac: eth@e0800000 {
compatible = "st,spear600-gmac";
compatible = "snps,dwmac-3.40a";
reg = <0xe0800000 0x8000>;
interrupts = <23 22>;
interrupt-names = "macirq", "eth_wake_irq";
Expand Down
4 changes: 2 additions & 2 deletions arch/nios2/include/asm/irqflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

static inline unsigned long arch_local_save_flags(void)
{
return RDCTL(CTL_STATUS);
return RDCTL(CTL_FSTATUS);
}

/*
Expand All @@ -31,7 +31,7 @@ static inline unsigned long arch_local_save_flags(void)
*/
static inline void arch_local_irq_restore(unsigned long flags)
{
WRCTL(CTL_STATUS, flags);
WRCTL(CTL_FSTATUS, flags);
}

static inline void arch_local_irq_disable(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/nios2/include/asm/registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#endif

/* control register numbers */
#define CTL_STATUS 0
#define CTL_FSTATUS 0
#define CTL_ESTATUS 1
#define CTL_BSTATUS 2
#define CTL_IENABLE 3
Expand Down
15 changes: 7 additions & 8 deletions arch/s390/lib/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,13 @@ EXPORT_SYMBOL(strcmp);
*/
char * strrchr(const char * s, int c)
{
size_t len = __strend(s) - s;

if (len)
do {
if (s[len] == (char) c)
return (char *) s + len;
} while (--len > 0);
return NULL;
ssize_t len = __strend(s) - s;

do {
if (s[len] == (char)c)
return (char *)s + len;
} while (--len >= 0);
return NULL;
}
EXPORT_SYMBOL(strrchr);

Expand Down
12 changes: 8 additions & 4 deletions arch/xtensa/platforms/xtfpga/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ void platform_power_off(void)

void platform_restart(void)
{
/* Flush and reset the mmu, simulate a processor reset, and
* jump to the reset vector. */
/* Try software reset first. */
WRITE_ONCE(*(u32 *)XTFPGA_SWRST_VADDR, 0xdead);

/* If software reset did not work, flush and reset the mmu,
* simulate a processor reset, and jump to the reset vector.
*/
cpu_reset();
/* control never gets here */
}
Expand Down Expand Up @@ -85,7 +89,7 @@ void __init platform_calibrate_ccount(void)

#endif

#ifdef CONFIG_OF
#ifdef CONFIG_USE_OF

static void __init xtfpga_clk_setup(struct device_node *np)
{
Expand Down Expand Up @@ -303,4 +307,4 @@ static int __init xtavnet_init(void)
*/
arch_initcall(xtavnet_init);

#endif /* CONFIG_OF */
#endif /* CONFIG_USE_OF */
6 changes: 4 additions & 2 deletions drivers/ata/pata_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ static unsigned int pdc_data_xfer_vlb(struct ata_device *dev,
iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);

if (unlikely(slop)) {
__le32 pad;
__le32 pad = 0;

if (rw == READ) {
pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
memcpy(buf + buflen - slop, &pad, slop);
Expand Down Expand Up @@ -716,7 +717,8 @@ static unsigned int vlb32_data_xfer(struct ata_device *adev, unsigned char *buf,
ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);

if (unlikely(slop)) {
__le32 pad;
__le32 pad = 0;

if (rw == WRITE) {
memcpy(&pad, buf + buflen - slop, slop);
iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);
Expand Down
4 changes: 2 additions & 2 deletions drivers/firmware/efi/cper.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

#define INDENT_SP " "

static char rcd_decode_str[CPER_REC_LEN];

/*
* CPER record ID need to be unique even after reboot, because record
* ID is used as index for ERST storage, while CPER records from
Expand Down Expand Up @@ -293,6 +291,7 @@ const char *cper_mem_err_unpack(struct trace_seq *p,
struct cper_mem_err_compact *cmem)
{
const char *ret = trace_seq_buffer_ptr(p);
char rcd_decode_str[CPER_REC_LEN];

if (cper_mem_err_location(cmem, rcd_decode_str))
trace_seq_printf(p, "%s", rcd_decode_str);
Expand All @@ -307,6 +306,7 @@ static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem,
int len)
{
struct cper_mem_err_compact cmem;
char rcd_decode_str[CPER_REC_LEN];

/* Don't trust UEFI 2.1/2.2 structure with bad validation bits */
if (len == sizeof(struct cper_sec_mem_err_old) &&
Expand Down
2 changes: 1 addition & 1 deletion drivers/firmware/efi/runtime-wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static void virt_efi_reset_system(int reset_type,
unsigned long data_size,
efi_char16_t *data)
{
if (down_interruptible(&efi_runtime_lock)) {
if (down_trylock(&efi_runtime_lock)) {
pr_warn("failed to invoke the reset_system() runtime service:\n"
"could not get exclusive access to the firmware\n");
return;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/msm/dsi/dsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)

return 0;
err:
for (; i > 0; i--)
while (--i >= 0)
clk_disable_unprepare(msm_host->bus_clks[i]);

return ret;
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/msm/edp/edp_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1090,14 +1090,15 @@ void msm_edp_ctrl_power(struct edp_ctrl *ctrl, bool on)
int msm_edp_ctrl_init(struct msm_edp *edp)
{
struct edp_ctrl *ctrl = NULL;
struct device *dev = &edp->pdev->dev;
struct device *dev;
int ret;

if (!edp) {
pr_err("%s: edp is NULL!\n", __func__);
return -EINVAL;
}

dev = &edp->pdev->dev;
ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
if (!ctrl)
return -ENOMEM;
Expand Down
6 changes: 6 additions & 0 deletions drivers/iio/adc/ti-adc128s052.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ static int adc128_probe(struct spi_device *spi)
mutex_init(&adc->lock);

ret = iio_device_register(indio_dev);
if (ret)
goto err_disable_regulator;

return 0;

err_disable_regulator:
regulator_disable(adc->reg);
return ret;
}

Expand Down
11 changes: 9 additions & 2 deletions drivers/iio/common/ssp_sensors/ssp_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static int ssp_print_mcu_debug(char *data_frame, int *data_index,
if (length > received_len - *data_index || length <= 0) {
ssp_dbg("[SSP]: MSG From MCU-invalid debug length(%d/%d)\n",
length, received_len);
return length ? length : -EPROTO;
return -EPROTO;
}

ssp_dbg("[SSP]: MSG From MCU - %s\n", &data_frame[*data_index]);
Expand Down Expand Up @@ -286,6 +286,8 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len)
for (idx = 0; idx < len;) {
switch (dataframe[idx++]) {
case SSP_MSG2AP_INST_BYPASS_DATA:
if (idx >= len)
return -EPROTO;
sd = dataframe[idx++];
if (sd < 0 || sd >= SSP_SENSOR_MAX) {
dev_err(SSP_DEV,
Expand All @@ -295,17 +297,22 @@ static int ssp_parse_dataframe(struct ssp_data *data, char *dataframe, int len)

if (indio_devs[sd]) {
spd = iio_priv(indio_devs[sd]);
if (spd->process_data)
if (spd->process_data) {
if (idx >= len)
return -EPROTO;
spd->process_data(indio_devs[sd],
&dataframe[idx],
data->timestamp);
}
} else {
dev_err(SSP_DEV, "no client for frame\n");
}

idx += ssp_offset_map[sd];
break;
case SSP_MSG2AP_INST_DEBUG_DATA:
if (idx >= len)
return -EPROTO;
sd = ssp_print_mcu_debug(dataframe, &idx, len);
if (sd) {
dev_err(SSP_DEV,
Expand Down
6 changes: 3 additions & 3 deletions drivers/iio/light/opt3001.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ static int opt3001_get_lux(struct opt3001 *opt, int *val, int *val2)
ret = wait_event_timeout(opt->result_ready_queue,
opt->result_ready,
msecs_to_jiffies(OPT3001_RESULT_READY_LONG));
if (ret == 0)
return -ETIMEDOUT;
} else {
/* Sleep for result ready time */
timeout = (opt->int_time == OPT3001_INT_TIME_SHORT) ?
Expand Down Expand Up @@ -319,9 +321,7 @@ static int opt3001_get_lux(struct opt3001 *opt, int *val, int *val2)
/* Disallow IRQ to access the device while lock is active */
opt->ok_to_ignore_lock = false;

if (ret == 0)
return -ETIMEDOUT;
else if (ret < 0)
if (ret < 0)
return ret;

if (opt->use_irq) {
Expand Down
2 changes: 2 additions & 0 deletions drivers/input/joystick/xpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ static const struct xpad_device {
{ 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 },
{ 0x24c6, 0x5d04, "Razer Sabertooth", 0, XTYPE_XBOX360 },
{ 0x24c6, 0xfafe, "Rock Candy Gamepad for Xbox 360", 0, XTYPE_XBOX360 },
{ 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 },
{ 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX },
{ 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX },
{ 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN }
Expand Down Expand Up @@ -464,6 +465,7 @@ static const struct usb_device_id xpad_table[] = {
XPAD_XBOXONE_VENDOR(0x24c6), /* PowerA Controllers */
XPAD_XBOXONE_VENDOR(0x2e24), /* Hyperkin Duke X-Box One pad */
XPAD_XBOX360_VENDOR(0x2f24), /* GameSir Controllers */
XPAD_XBOX360_VENDOR(0x3285), /* Nacon GC-100 */
{ }
};

Expand Down
5 changes: 5 additions & 0 deletions drivers/isdn/capi/kcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,11 @@ int detach_capi_ctr(struct capi_ctr *ctr)

ctr_down(ctr, CAPI_CTR_DETACHED);

if (ctr->cnr < 1 || ctr->cnr - 1 >= CAPI_MAXCONTR) {
err = -EINVAL;
goto unlock_out;
}

if (capi_controller[ctr->cnr - 1] != ctr) {
err = -EINVAL;
goto unlock_out;
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/hardware/mISDN/netjet.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,8 @@ nj_release(struct tiger_hw *card)
nj_disable_hwirq(card);
mode_tiger(&card->bc[0], ISDN_P_NONE);
mode_tiger(&card->bc[1], ISDN_P_NONE);
card->isac.release(&card->isac);
spin_unlock_irqrestore(&card->lock, flags);
card->isac.release(&card->isac);
release_region(card->base, card->base_s);
card->base_s = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/cb710/sgbuf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static inline bool needs_unaligned_copy(const void *ptr)
#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
return false;
#else
return ((ptr - NULL) & 3) != 0;
return ((uintptr_t)ptr & 3) != 0;
#endif
}

Expand Down
20 changes: 12 additions & 8 deletions drivers/net/can/rcar/rcar_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,10 +858,12 @@ static int __maybe_unused rcar_can_suspend(struct device *dev)
struct rcar_can_priv *priv = netdev_priv(ndev);
u16 ctlr;

if (netif_running(ndev)) {
netif_stop_queue(ndev);
netif_device_detach(ndev);
}
if (!netif_running(ndev))
return 0;

netif_stop_queue(ndev);
netif_device_detach(ndev);

ctlr = readw(&priv->regs->ctlr);
ctlr |= RCAR_CAN_CTLR_CANM_HALT;
writew(ctlr, &priv->regs->ctlr);
Expand All @@ -880,6 +882,9 @@ static int __maybe_unused rcar_can_resume(struct device *dev)
u16 ctlr;
int err;

if (!netif_running(ndev))
return 0;

err = clk_enable(priv->clk);
if (err) {
netdev_err(ndev, "clk_enable() failed, error %d\n", err);
Expand All @@ -893,10 +898,9 @@ static int __maybe_unused rcar_can_resume(struct device *dev)
writew(ctlr, &priv->regs->ctlr);
priv->can.state = CAN_STATE_ERROR_ACTIVE;

if (netif_running(ndev)) {
netif_device_attach(ndev);
netif_start_queue(ndev);
}
netif_device_attach(ndev);
netif_start_queue(ndev);

return 0;
}

Expand Down
9 changes: 4 additions & 5 deletions drivers/net/can/sja1000/peak_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -736,16 +736,15 @@ static void peak_pci_remove(struct pci_dev *pdev)
struct net_device *prev_dev = chan->prev_dev;

dev_info(&pdev->dev, "removing device %s\n", dev->name);
/* do that only for first channel */
if (!prev_dev && chan->pciec_card)
peak_pciec_remove(chan->pciec_card);
unregister_sja1000dev(dev);
free_sja1000dev(dev);
dev = prev_dev;

if (!dev) {
/* do that only for first channel */
if (chan->pciec_card)
peak_pciec_remove(chan->pciec_card);
if (!dev)
break;
}
priv = netdev_priv(dev);
chan = priv->priv;
}
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/can/usb/peak_usb/pcan_usb_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,11 +559,10 @@ static int pcan_usb_fd_decode_status(struct pcan_usb_fd_if *usb_if,
} else if (sm->channel_p_w_b & PUCAN_BUS_WARNING) {
new_state = CAN_STATE_ERROR_WARNING;
} else {
/* no error bit (so, no error skb, back to active state) */
dev->can.state = CAN_STATE_ERROR_ACTIVE;
/* back to (or still in) ERROR_ACTIVE state */
new_state = CAN_STATE_ERROR_ACTIVE;
pdev->bec.txerr = 0;
pdev->bec.rxerr = 0;
return 0;
}

/* state hasn't changed */
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ config JME
config KORINA
tristate "Korina (IDT RC32434) Ethernet support"
depends on MIKROTIK_RB532
select CRC32
---help---
If you have a Mikrotik RouterBoard 500 or IDT RC32434
based system say Y. Otherwise say N.
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/arc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ config ARC_EMAC_CORE
tristate
select MII
select PHYLIB
select CRC32

config ARC_EMAC
tristate "ARC EMAC support"
Expand Down
Loading

0 comments on commit 178eb40

Please sign in to comment.