Skip to content

Commit

Permalink
Merge android13-5.10-2022-09 into android13-gs-pixel-5.10-tm-qpr1
Browse files Browse the repository at this point in the history
Merge SHA:
f68d040 FROMLIST: scsi: ufs: Fix deadlocks between power management and error handler

Bug: 233569354
Bug: 233047575 (ACK)
Bug: 234475629 (ACK)
Bug: 235183128 (ACK)
Bug: 235277737 (ACK)
Bug: 239396464 (ACK)
Bug: 240498410 (ACK)
Bug: 241946090 (ACK)
Bug: 244395411 (ACK)
Bug: 244504166 (ACK)
Bug: 246990788 (ACK)
Bug: 247073231 (ACK)
Bug: 247081382 (ACK)
Bug: 247082093 (ACK)
Signed-off-by: Robin Peng <[email protected]>
Change-Id: Ifa62971bc4a49ea66c25abcfe66944b55bcffe11
  • Loading branch information
Robin Peng authored and Roger Liao committed Sep 20, 2022
2 parents f03c7b3 + f68d040 commit 07839c3
Show file tree
Hide file tree
Showing 57 changed files with 5,681 additions and 2,097 deletions.
13 changes: 7 additions & 6 deletions Documentation/sound/kernel-api/writing-an-alsa-driver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3508,14 +3508,15 @@ field must be set, though).

“IEC958 Playback Con Mask” is used to return the bit-mask for the IEC958
status bits of consumer mode. Similarly, “IEC958 Playback Pro Mask”
returns the bitmask for professional mode. They are read-only controls,
and are defined as MIXER controls (iface =
``SNDRV_CTL_ELEM_IFACE_MIXER``).
returns the bitmask for professional mode. They are read-only controls.

Meanwhile, “IEC958 Playback Default” control is defined for getting and
setting the current default IEC958 bits. Note that this one is usually
defined as a PCM control (iface = ``SNDRV_CTL_ELEM_IFACE_PCM``),
although in some places it's defined as a MIXER control.
setting the current default IEC958 bits.

Due to historical reasons, both variants of the Playback Mask and the
Playback Default controls can be implemented on either a
``SNDRV_CTL_ELEM_IFACE_PCM`` or a ``SNDRV_CTL_ELEM_IFACE_MIXER`` iface.
Drivers should expose the mask and default on the same iface though.

In addition, you can define the control switches to enable/disable or to
set the raw bit mode. The implementation will depend on the chip, but
Expand Down
6,812 changes: 5,136 additions & 1,676 deletions android/abi_gki_aarch64.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion arch/arm64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ static void do_handle_IPI(int ipinr)
break;

case IPI_CPU_STOP:
trace_android_vh_ipi_stop_rcuidle(get_irq_regs());
trace_android_vh_ipi_stop(get_irq_regs());
local_cpu_stop();
break;

Expand Down
31 changes: 19 additions & 12 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -7289,7 +7289,7 @@ int kvm_skip_emulated_instruction(struct kvm_vcpu *vcpu)
}
EXPORT_SYMBOL_GPL(kvm_skip_emulated_instruction);

static bool kvm_vcpu_check_breakpoint(struct kvm_vcpu *vcpu, int *r)
static bool kvm_vcpu_check_code_breakpoint(struct kvm_vcpu *vcpu, int *r)
{
if (unlikely(vcpu->guest_debug & KVM_GUESTDBG_USE_HW_BP) &&
(vcpu->arch.guest_debug_dr7 & DR7_BP_EN_MASK)) {
Expand Down Expand Up @@ -7358,25 +7358,23 @@ static bool is_vmware_backdoor_opcode(struct x86_emulate_ctxt *ctxt)
}

/*
* Decode to be emulated instruction. Return EMULATION_OK if success.
* Decode an instruction for emulation. The caller is responsible for handling
* code breakpoints. Note, manually detecting code breakpoints is unnecessary
* (and wrong) when emulating on an intercepted fault-like exception[*], as
* code breakpoints have higher priority and thus have already been done by
* hardware.
*
* [*] Except #MC, which is higher priority, but KVM should never emulate in
* response to a machine check.
*/
int x86_decode_emulated_instruction(struct kvm_vcpu *vcpu, int emulation_type,
void *insn, int insn_len)
{
int r = EMULATION_OK;
struct x86_emulate_ctxt *ctxt = vcpu->arch.emulate_ctxt;
int r;

init_emulate_ctxt(vcpu);

/*
* We will reenter on the same instruction since we do not set
* complete_userspace_io. This does not handle watchpoints yet,
* those would be handled in the emulate_ops.
*/
if (!(emulation_type & EMULTYPE_SKIP) &&
kvm_vcpu_check_breakpoint(vcpu, &r))
return r;

ctxt->ud = emulation_type & EMULTYPE_TRAP_UD;

r = x86_decode_insn(ctxt, insn, insn_len);
Expand Down Expand Up @@ -7411,6 +7409,15 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa,
if (!(emulation_type & EMULTYPE_NO_DECODE)) {
kvm_clear_exception_queue(vcpu);

/*
* Return immediately if RIP hits a code breakpoint, such #DBs
* are fault-like and are higher priority than any faults on
* the code fetch itself.
*/
if (!(emulation_type & EMULTYPE_SKIP) &&
kvm_vcpu_check_code_breakpoint(vcpu, &r))
return r;

r = x86_decode_emulated_instruction(vcpu, emulation_type,
insn, insn_len);
if (r != EMULATION_OK) {
Expand Down
22 changes: 22 additions & 0 deletions drivers/android/vendor_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@
*
* Copyright 2020 Google LLC
*/
#ifndef __GENKSYMS__
#include <uapi/linux/hdreg.h>
#include <net/addrconf.h>
#include <linux/fsverity.h>
#include <linux/ipc_namespace.h>
#include <linux/key-type.h>
#include <linux/mtd/mtd.h>
#include <linux/pr.h>
#include <linux/time_namespace.h>
#include <net/macsec.h>
#include <net/netfilter/nf_log.h>
#include <net/raw.h>
#include <net/smc.h>
#include <../drivers/net/wireless/intel/ipw2x00/libipw.h>
#include <../fs/mount.h>
#include <../fs/kernfs/kernfs-internal.h>
#include <../kernel/audit.h>
#include <../net/can/af_can.h>
#include <../net/tipc/bearer.h>
#include <../net/xdp/xsk_queue.h>
#include <../security/keys/internal.h>
#endif

#define CREATE_TRACE_POINTS
#include <trace/hooks/vendor_hooks.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/md/dm-verity-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv)
static struct target_type verity_target = {
.name = "verity",
.version = {1, 7, 0},
.features = DM_TARGET_IMMUTABLE,
.module = THIS_MODULE,
.ctr = verity_ctr,
.dtr = verity_dtr,
Expand Down
6 changes: 1 addition & 5 deletions drivers/scsi/ufs/ufshcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -9359,16 +9359,13 @@ static int ufshcd_wl_suspend(struct device *dev)
ktime_t start = ktime_get();

hba = shost_priv(sdev->host);
down(&hba->host_sem);

if (pm_runtime_suspended(dev))
goto out;

ret = __ufshcd_wl_suspend(hba, UFS_SYSTEM_PM);
if (ret) {
if (ret)
dev_err(&sdev->sdev_gendev, "%s failed: %d\n", __func__, ret);
up(&hba->host_sem);
}

out:
if (!ret)
Expand Down Expand Up @@ -9401,7 +9398,6 @@ static int ufshcd_wl_resume(struct device *dev)
hba->curr_dev_pwr_mode, hba->uic_link_state);
if (!ret)
hba->is_sys_suspended = false;
up(&hba->host_sem);
return ret;
}
#endif
Expand Down
31 changes: 18 additions & 13 deletions fs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,30 +1244,33 @@ unsigned int round_pipe_size(unsigned long size)

/*
* Resize the pipe ring to a number of slots.
*
* Note the pipe can be reduced in capacity, but only if the current
* occupancy doesn't exceed nr_slots; if it does, EBUSY will be
* returned instead.
*/
int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots)
{
struct pipe_buffer *bufs;
unsigned int head, tail, mask, n;

/*
* We can shrink the pipe, if arg is greater than the ring occupancy.
* Since we don't expect a lot of shrink+grow operations, just free and
* allocate again like we would do for growing. If the pipe currently
* contains more buffers than arg, then return busy.
*/
mask = pipe->ring_size - 1;
head = pipe->head;
tail = pipe->tail;
n = pipe_occupancy(pipe->head, pipe->tail);
if (nr_slots < n)
return -EBUSY;

bufs = kcalloc(nr_slots, sizeof(*bufs),
GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
if (unlikely(!bufs))
return -ENOMEM;

spin_lock_irq(&pipe->rd_wait.lock);
mask = pipe->ring_size - 1;
head = pipe->head;
tail = pipe->tail;

n = pipe_occupancy(head, tail);
if (nr_slots < n) {
spin_unlock_irq(&pipe->rd_wait.lock);
kfree(bufs);
return -EBUSY;
}

/*
* The pipe array wraps around, so just start the new one at zero
* and adjust the indices.
Expand Down Expand Up @@ -1299,6 +1302,8 @@ int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots)
pipe->tail = tail;
pipe->head = head;

spin_unlock_irq(&pipe->rd_wait.lock);

/* This might have made more room for writers */
wake_up_interruptible(&pipe->wr_wait);
return 0;
Expand Down
17 changes: 16 additions & 1 deletion include/sound/hdmi-codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ struct hdmi_codec_daifmt {
unsigned int frame_clk_inv:1;
unsigned int bit_clk_master:1;
unsigned int frame_clk_master:1;
/* bit_fmt could be standard PCM format or
* IEC958 encoded format. ALSA IEC958 plugin will pass
* IEC958_SUBFRAME format to the underneath driver.
*/
snd_pcm_format_t bit_fmt;
};

/*
Expand All @@ -60,12 +65,22 @@ struct hdmi_codec_ops {

/*
* Configures HDMI-encoder for audio stream.
* Mandatory
* Having either prepare or hw_params is mandatory.
*/
int (*hw_params)(struct device *dev, void *data,
struct hdmi_codec_daifmt *fmt,
struct hdmi_codec_params *hparms);

/*
* Configures HDMI-encoder for audio stream. Can be called
* multiple times for each setup.
*
* Having either prepare or hw_params is mandatory.
*/
int (*prepare)(struct device *dev, void *data,
struct hdmi_codec_daifmt *fmt,
struct hdmi_codec_params *hparms);

/*
* Shuts down the audio stream.
* Mandatory
Expand Down
8 changes: 8 additions & 0 deletions include/sound/pcm_iec958.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

#include <linux/types.h>

int snd_pcm_create_iec958_consumer_default(u8 *cs, size_t len);

int snd_pcm_fill_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
size_t len);

int snd_pcm_fill_iec958_consumer_hw_params(struct snd_pcm_hw_params *params,
u8 *cs, size_t len);

int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
size_t len);

Expand Down
14 changes: 1 addition & 13 deletions include/trace/hooks/binder.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,14 @@
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
#ifdef __GENKSYMS__
struct binder_alloc;
struct binder_proc;
struct binder_thread;
struct binder_transaction;
struct task_struct;
struct seq_file;
struct binder_transaction_data;
#else
/* struct binder_alloc */
#include <../drivers/android/binder_alloc.h>
/* struct binder_proc, struct binder_thread, struct binder_transaction */
#include <../drivers/android/binder_internal.h>
/* struct task_struct */
#include <linux/sched.h>
/* struct seq_file */
#include <linux/seq_file.h>
/* struct binder_transaction_data */
#include <uapi/linux/android/binder.h>
#endif /* __GENKSYMS__ */

DECLARE_HOOK(android_vh_binder_transaction_init,
TP_PROTO(struct binder_transaction *t),
TP_ARGS(t));
Expand Down
9 changes: 0 additions & 9 deletions include/trace/hooks/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,9 @@

#include <trace/hooks/vendor_hooks.h>

#ifdef __GENKSYMS__
struct blk_mq_tags;
struct blk_mq_alloc_data;
struct blk_mq_tag_set;
#else
/* struct blk_mq_tags */
#include <../block/blk-mq-tag.h>
/* struct blk_mq_alloc_data */
#include <../block/blk-mq.h>
/* struct blk_mq_tag_set */
#include <linux/blk-mq.h>
#endif /* __GENKSYMS__ */

DECLARE_HOOK(android_vh_blk_alloc_rqs,
TP_PROTO(size_t *rq_size, struct blk_mq_tag_set *set,
Expand Down
10 changes: 1 addition & 9 deletions include/trace/hooks/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@
#define _TRACE_HOOK_CGROUP_H
#include <trace/hooks/vendor_hooks.h>

#ifdef __GENKSYMS__
struct cgroup_taskset;
struct cgroup_subsys;
struct task_struct;
#else
/* Including ../kernel/cgroup/cgroup-internal.h breaks builds. */
struct cgroup_taskset;
/* struct cgroup_subsys */
#include <linux/cgroup-defs.h>
/* struct task_struct */
#include <linux/sched.h>
#endif /* __GENKSYMS__ */

DECLARE_HOOK(android_vh_cgroup_set_task,
TP_PROTO(int ret, struct task_struct *task),
TP_ARGS(ret, task));
Expand Down
7 changes: 6 additions & 1 deletion include/trace/hooks/cpufreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@

#if !defined(_TRACE_HOOK_CPUFREQ_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_CPUFREQ_H
#include <trace/hooks/vendor_hooks.h>

#ifdef __GENKSYMS__
#include <linux/cpufreq.h>
#include <trace/hooks/vendor_hooks.h>
#endif

struct cpufreq_policy;
struct task_struct;

DECLARE_HOOK(android_vh_show_max_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
Expand Down
5 changes: 0 additions & 5 deletions include/trace/hooks/cpuidle.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@

#include <trace/hooks/vendor_hooks.h>

#ifdef __GENKSYMS__
struct cpuidle_device;
#else
/* struct cpuidle_device */
#include <linux/cpuidle.h>
#endif /* __GENKSYMS__ */

DECLARE_HOOK(android_vh_cpu_idle_enter,
TP_PROTO(int *state, struct cpuidle_device *dev),
Expand Down
6 changes: 1 addition & 5 deletions include/trace/hooks/cpuidle_psci.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@
* mechanism for vendor modules to hook and extend functionality
*/

#ifdef __GENKSYMS__
struct cpuidle_device;
#else
/* struct cpuidle_device */
#include <linux/cpuidle.h>
#endif /* __GENKSYMS__ */

DECLARE_HOOK(android_vh_cpuidle_psci_enter,
TP_PROTO(struct cpuidle_device *dev, bool s2idle),
TP_ARGS(dev, s2idle));
Expand Down
8 changes: 1 addition & 7 deletions include/trace/hooks/creds.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
#ifdef __GENKSYMS__
struct cred;
struct task_struct;
#else
/* struct cred */
#include <linux/cred.h>
/* struct task_struct */
#include <linux/sched.h>
#endif /* __GENKSYMS__ */

DECLARE_HOOK(android_vh_commit_creds,
TP_PROTO(const struct task_struct *task, const struct cred *new),
TP_ARGS(task, new));
Expand Down
Loading

0 comments on commit 07839c3

Please sign in to comment.