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 lineage-19.1
  • Loading branch information
zeelog committed May 12, 2022
2 parents fea325e + f1a1131 commit 5242e5a
Show file tree
Hide file tree
Showing 65 changed files with 384 additions and 193 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 = 312
SUBLEVEL = 313
EXTRAVERSION =
NAME = Roaring Lionus

Expand Down
10 changes: 8 additions & 2 deletions arch/arm/boot/dts/imx6qdl-apalis.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@
codec: sgtl5000@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sgtl5000>;
clocks = <&clks IMX6QDL_CLK_CKO>;
VDDA-supply = <&reg_2p5v>;
VDDIO-supply = <&reg_3p3v>;
Expand Down Expand Up @@ -550,8 +552,6 @@
MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0
MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0
MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0
/* SGTL5000 sys_mclk */
MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
>;
};

Expand Down Expand Up @@ -812,6 +812,12 @@
>;
};

pinctrl_sgtl5000: sgtl5000grp {
fsl,pins = <
MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
>;
};

pinctrl_spdif: spdifgrp {
fsl,pins = <
MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/omap3-gta04.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
aliases {
display0 = &lcd;
display1 = &tv0;
/delete-property/ mmc2;
/delete-property/ mmc3;
};

gpio-keys {
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-omap2/omap4-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,12 @@ void __init omap_gic_of_init(void)

np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
gic_dist_base_addr = of_iomap(np, 0);
of_node_put(np);
WARN_ON(!gic_dist_base_addr);

np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer");
twd_base = of_iomap(np, 0);
of_node_put(np);
WARN_ON(!twd_base);

skip_errata_init:
Expand Down
8 changes: 4 additions & 4 deletions arch/mips/include/asm/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
typedef unsigned int cycles_t;

/*
* On R4000/R4400 before version 5.0 an erratum exists such that if the
* cycle counter is read in the exact moment that it is matching the
* compare register, no interrupt will be generated.
* On R4000/R4400 an erratum exists such that if the cycle counter is
* read in the exact moment that it is matching the compare register,
* no interrupt will be generated.
*
* There is a suggested workaround and also the erratum can't strike if
* the compare interrupt isn't being used as the clock source device.
Expand All @@ -63,7 +63,7 @@ static inline int can_use_mips_counter(unsigned int prid)
if (!__builtin_constant_p(cpu_has_counter))
asm volatile("" : "=m" (cpu_data[0].options));
if (likely(cpu_has_counter &&
prid >= (PRID_IMP_R4000 | PRID_REV_ENCODE_44(5, 0))))
prid > (PRID_IMP_R4000 | PRID_REV_ENCODE_44(15, 15))))
return 1;
else
return 0;
Expand Down
11 changes: 3 additions & 8 deletions arch/mips/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,10 @@ static __init int cpu_has_mfc0_count_bug(void)
case CPU_R4400MC:
/*
* The published errata for the R4400 up to 3.0 say the CPU
* has the mfc0 from count bug.
* has the mfc0 from count bug. This seems the last version
* produced.
*/
if ((current_cpu_data.processor_id & 0xff) <= 0x30)
return 1;

/*
* we assume newer revisions are ok
*/
return 0;
return 1;
}

return 0;
Expand Down
3 changes: 1 addition & 2 deletions arch/parisc/kernel/processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,7 @@ show_cpuinfo (struct seq_file *m, void *v)
}
seq_printf(m, " (0x%02lx)\n", boot_cpu_data.pdc.capabilities);

seq_printf(m, "model\t\t: %s\n"
"model name\t: %s\n",
seq_printf(m, "model\t\t: %s - %s\n",
boot_cpu_data.pdc.sys_model_name,
cpuinfo->dev ?
cpuinfo->dev->name : "Unknown");
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/include/asm/microcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ extern void __init load_ucode_bsp(void);
extern void load_ucode_ap(void);
void reload_early_microcode(void);
extern bool get_builtin_firmware(struct cpio_data *cd, const char *name);
void microcode_bsp_resume(void);
#else
static inline void __init load_ucode_bsp(void) { }
static inline void load_ucode_ap(void) { }
static inline void reload_early_microcode(void) { }
static inline void microcode_bsp_resume(void) { }
static inline bool
get_builtin_firmware(struct cpio_data *cd, const char *name) { return false; }
#endif
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/kernel/cpu/microcode/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,9 @@ static struct subsys_interface mc_cpu_interface = {
};

/**
* mc_bp_resume - Update boot CPU microcode during resume.
* microcode_bsp_resume - Update boot CPU microcode during resume.
*/
static void mc_bp_resume(void)
void microcode_bsp_resume(void)
{
int cpu = smp_processor_id();
struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
Expand All @@ -600,7 +600,7 @@ static void mc_bp_resume(void)
}

static struct syscore_ops mc_syscore_ops = {
.resume = mc_bp_resume,
.resume = microcode_bsp_resume,
};

static int mc_cpu_online(unsigned int cpu)
Expand Down
5 changes: 5 additions & 0 deletions arch/x86/kvm/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,11 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
union cpuid10_eax eax;
union cpuid10_edx edx;

if (!static_cpu_has(X86_FEATURE_ARCH_PERFMON)) {
entry->eax = entry->ebx = entry->ecx = entry->edx = 0;
break;
}

perf_get_x86_pmu_capability(&cap);

/*
Expand Down
8 changes: 8 additions & 0 deletions arch/x86/power/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <asm/cpu.h>
#include <asm/mmu_context.h>
#include <asm/cpu_device_id.h>
#include <asm/microcode.h>

#ifdef CONFIG_X86_32
__visible unsigned long saved_context_ebx;
Expand Down Expand Up @@ -261,6 +262,13 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)
x86_platform.restore_sched_clock_state();
mtrr_bp_restore();
perf_restore_debug_store();

microcode_bsp_resume();

/*
* This needs to happen after the microcode has been updated upon resume
* because some of the MSRs are "emulated" in microcode.
*/
msr_restore_context(ctxt);
}

Expand Down
16 changes: 16 additions & 0 deletions drivers/block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ config BLK_DEV_FD
To compile this driver as a module, choose M here: the
module will be called floppy.

config BLK_DEV_FD_RAWCMD
bool "Support for raw floppy disk commands (DEPRECATED)"
depends on BLK_DEV_FD
help
If you want to use actual physical floppies and expect to do
special low-level hardware accesses to them (access and use
non-standard formats, for example), then enable this.

Note that the code enabled by this option is rarely used and
might be unstable or insecure, and distros should not enable it.

Note: FDRAWCMD is deprecated and will be removed from the kernel
in the near future.

If unsure, say N.

config AMIGA_FLOPPY
tristate "Amiga floppy support"
depends on AMIGA
Expand Down
43 changes: 32 additions & 11 deletions drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3016,6 +3016,8 @@ static const char *drive_name(int type, int drive)
return "(null)";
}

#ifdef CONFIG_BLK_DEV_FD_RAWCMD

/* raw commands */
static void raw_cmd_done(int flag)
{
Expand Down Expand Up @@ -3227,6 +3229,35 @@ static int raw_cmd_ioctl(int cmd, void __user *param)
return ret;
}

static int floppy_raw_cmd_ioctl(int type, int drive, int cmd,
void __user *param)
{
int ret;

pr_warn_once("Note: FDRAWCMD is deprecated and will be removed from the kernel in the near future.\n");

if (type)
return -EINVAL;
if (lock_fdc(drive))
return -EINTR;
set_floppy(drive);
ret = raw_cmd_ioctl(cmd, param);
if (ret == -EINTR)
return -EINTR;
process_fd_request();
return ret;
}

#else /* CONFIG_BLK_DEV_FD_RAWCMD */

static int floppy_raw_cmd_ioctl(int type, int drive, int cmd,
void __user *param)
{
return -EOPNOTSUPP;
}

#endif

static int invalidate_drive(struct block_device *bdev)
{
/* invalidate the buffer track to force a reread */
Expand Down Expand Up @@ -3414,7 +3445,6 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
{
int drive = (long)bdev->bd_disk->private_data;
int type = ITYPE(UDRS->fd_device);
int i;
int ret;
int size;
union inparam {
Expand Down Expand Up @@ -3565,16 +3595,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
outparam = UDRWE;
break;
case FDRAWCMD:
if (type)
return -EINVAL;
if (lock_fdc(drive))
return -EINTR;
set_floppy(drive);
i = raw_cmd_ioctl(cmd, (void __user *)param);
if (i == -EINTR)
return -EINTR;
process_fd_request();
return i;
return floppy_raw_cmd_ioctl(type, drive, cmd, (void __user *)param);
case FDTWADDLE:
if (lock_fdc(drive))
return -EINTR;
Expand Down
2 changes: 2 additions & 0 deletions drivers/bus/sunxi-rsb.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb,

dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev));

return rdev;

err_device_add:
put_device(&rdev->dev);

Expand Down
2 changes: 2 additions & 0 deletions drivers/clk/sunxi/clk-sun9i-mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)
spin_lock_init(&data->lock);

r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r)
return -EINVAL;
/* one clock/reset pair per word */
count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH);
data->membase = devm_ioremap_resource(&pdev->dev, r);
Expand Down
3 changes: 3 additions & 0 deletions drivers/firewire/core-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ EXPORT_SYMBOL_GPL(fw_card_release);
void fw_core_remove_card(struct fw_card *card)
{
struct fw_card_driver dummy_driver = dummy_driver_template;
unsigned long flags;

card->driver->update_phy_reg(card, 4,
PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
Expand All @@ -695,7 +696,9 @@ void fw_core_remove_card(struct fw_card *card)
dummy_driver.stop_iso = card->driver->stop_iso;
card->driver = &dummy_driver;

spin_lock_irqsave(&card->lock, flags);
fw_destroy_nodes(card);
spin_unlock_irqrestore(&card->lock, flags);

/* Wait for all users, especially device workqueue jobs, to finish. */
fw_card_put(card);
Expand Down
4 changes: 3 additions & 1 deletion drivers/firewire/core-cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,7 @@ static void outbound_phy_packet_callback(struct fw_packet *packet,
{
struct outbound_phy_packet_event *e =
container_of(packet, struct outbound_phy_packet_event, p);
struct client *e_client;

switch (status) {
/* expected: */
Expand All @@ -1512,9 +1513,10 @@ static void outbound_phy_packet_callback(struct fw_packet *packet,
}
e->phy_packet.data[0] = packet->timestamp;

e_client = e->client;
queue_event(e->client, &e->event, &e->phy_packet,
sizeof(e->phy_packet) + e->phy_packet.length, NULL, 0);
client_put(e->client);
client_put(e_client);
}

static int ioctl_send_phy_packet(struct client *client, union ioctl_arg *arg)
Expand Down
9 changes: 3 additions & 6 deletions drivers/firewire/core-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,13 @@ static void report_found_node(struct fw_card *card,
card->bm_retries = 0;
}

/* Must be called with card->lock held */
void fw_destroy_nodes(struct fw_card *card)
{
unsigned long flags;

spin_lock_irqsave(&card->lock, flags);
card->color++;
if (card->local_node != NULL)
for_each_fw_node(card, card->local_node, report_lost_node);
card->local_node = NULL;
spin_unlock_irqrestore(&card->lock, flags);
}

static void move_tree(struct fw_node *node0, struct fw_node *node1, int port)
Expand Down Expand Up @@ -522,6 +519,8 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation,
struct fw_node *local_node;
unsigned long flags;

spin_lock_irqsave(&card->lock, flags);

/*
* If the selfID buffer is not the immediate successor of the
* previously processed one, we cannot reliably compare the
Expand All @@ -533,8 +532,6 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation,
card->bm_retries = 0;
}

spin_lock_irqsave(&card->lock, flags);

card->broadcast_channel_allocated = card->broadcast_channel_auto_allocated;
card->node_id = node_id;
/*
Expand Down
Loading

0 comments on commit 5242e5a

Please sign in to comment.