Merge 2622c805ab
("kallsyms: Make module_kallsyms_on_each_symbol generally available") into android12-5.10-lts
Steps on the way to 5.10.227 Resolves merge conflicts in: include/linux/kallsyms.h include/linux/module.h kernel/kallsyms.c Change-Id: I207acf2f76d2f2bc3be7b811edec98d988365f60 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
2a22a03cae
@ -695,27 +695,34 @@ static LIST_HEAD(acpi_battery_list);
|
||||
static LIST_HEAD(battery_hook_list);
|
||||
static DEFINE_MUTEX(hook_mutex);
|
||||
|
||||
static void __battery_hook_unregister(struct acpi_battery_hook *hook, int lock)
|
||||
static void battery_hook_unregister_unlocked(struct acpi_battery_hook *hook)
|
||||
{
|
||||
struct acpi_battery *battery;
|
||||
|
||||
/*
|
||||
* In order to remove a hook, we first need to
|
||||
* de-register all the batteries that are registered.
|
||||
*/
|
||||
if (lock)
|
||||
mutex_lock(&hook_mutex);
|
||||
list_for_each_entry(battery, &acpi_battery_list, list) {
|
||||
hook->remove_battery(battery->bat);
|
||||
}
|
||||
list_del(&hook->list);
|
||||
if (lock)
|
||||
mutex_unlock(&hook_mutex);
|
||||
list_del_init(&hook->list);
|
||||
|
||||
pr_info("extension unregistered: %s\n", hook->name);
|
||||
}
|
||||
|
||||
void battery_hook_unregister(struct acpi_battery_hook *hook)
|
||||
{
|
||||
__battery_hook_unregister(hook, 1);
|
||||
mutex_lock(&hook_mutex);
|
||||
/*
|
||||
* Ignore already unregistered battery hooks. This might happen
|
||||
* if a battery hook was previously unloaded due to an error when
|
||||
* adding a new battery.
|
||||
*/
|
||||
if (!list_empty(&hook->list))
|
||||
battery_hook_unregister_unlocked(hook);
|
||||
|
||||
mutex_unlock(&hook_mutex);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(battery_hook_unregister);
|
||||
|
||||
@ -724,7 +731,6 @@ void battery_hook_register(struct acpi_battery_hook *hook)
|
||||
struct acpi_battery *battery;
|
||||
|
||||
mutex_lock(&hook_mutex);
|
||||
INIT_LIST_HEAD(&hook->list);
|
||||
list_add(&hook->list, &battery_hook_list);
|
||||
/*
|
||||
* Now that the driver is registered, we need
|
||||
@ -741,7 +747,7 @@ void battery_hook_register(struct acpi_battery_hook *hook)
|
||||
* hooks.
|
||||
*/
|
||||
pr_err("extension failed to load: %s", hook->name);
|
||||
__battery_hook_unregister(hook, 0);
|
||||
battery_hook_unregister_unlocked(hook);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
@ -778,7 +784,7 @@ static void battery_hook_add_battery(struct acpi_battery *battery)
|
||||
*/
|
||||
pr_err("error in extension, unloading: %s",
|
||||
hook_node->name);
|
||||
__battery_hook_unregister(hook_node, 0);
|
||||
battery_hook_unregister_unlocked(hook_node);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&hook_mutex);
|
||||
@ -811,7 +817,7 @@ static void __exit battery_hook_exit(void)
|
||||
* need to remove the hooks.
|
||||
*/
|
||||
list_for_each_entry_safe(hook, ptr, &battery_hook_list, list) {
|
||||
__battery_hook_unregister(hook, 1);
|
||||
battery_hook_unregister(hook);
|
||||
}
|
||||
mutex_destroy(&hook_mutex);
|
||||
}
|
||||
|
@ -2049,25 +2049,27 @@ static int virtcons_probe(struct virtio_device *vdev)
|
||||
multiport = true;
|
||||
}
|
||||
|
||||
err = init_vqs(portdev);
|
||||
if (err < 0) {
|
||||
dev_err(&vdev->dev, "Error %d initializing vqs\n", err);
|
||||
goto free_chrdev;
|
||||
}
|
||||
|
||||
spin_lock_init(&portdev->ports_lock);
|
||||
INIT_LIST_HEAD(&portdev->ports);
|
||||
INIT_LIST_HEAD(&portdev->list);
|
||||
|
||||
virtio_device_ready(portdev->vdev);
|
||||
|
||||
INIT_WORK(&portdev->config_work, &config_work_handler);
|
||||
INIT_WORK(&portdev->control_work, &control_work_handler);
|
||||
|
||||
if (multiport) {
|
||||
spin_lock_init(&portdev->c_ivq_lock);
|
||||
spin_lock_init(&portdev->c_ovq_lock);
|
||||
}
|
||||
|
||||
err = init_vqs(portdev);
|
||||
if (err < 0) {
|
||||
dev_err(&vdev->dev, "Error %d initializing vqs\n", err);
|
||||
goto free_chrdev;
|
||||
}
|
||||
|
||||
virtio_device_ready(portdev->vdev);
|
||||
|
||||
if (multiport) {
|
||||
err = fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
|
||||
if (err < 0) {
|
||||
dev_err(&vdev->dev,
|
||||
|
@ -665,6 +665,7 @@ static struct clk_branch disp_cc_mdss_dp_link1_intf_clk = {
|
||||
.hw = &disp_cc_mdss_dp_link1_div_clk_src.clkr.hw,
|
||||
},
|
||||
.num_parents = 1,
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_branch2_ops,
|
||||
},
|
||||
},
|
||||
@ -700,6 +701,7 @@ static struct clk_branch disp_cc_mdss_dp_link_intf_clk = {
|
||||
.hw = &disp_cc_mdss_dp_link_div_clk_src.clkr.hw,
|
||||
},
|
||||
.num_parents = 1,
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_branch2_ops,
|
||||
},
|
||||
},
|
||||
@ -825,6 +827,7 @@ static struct clk_branch disp_cc_mdss_mdp_lut_clk = {
|
||||
.hw = &disp_cc_mdss_mdp_clk_src.clkr.hw,
|
||||
},
|
||||
.num_parents = 1,
|
||||
.flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_branch2_ops,
|
||||
},
|
||||
},
|
||||
|
@ -754,6 +754,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
|
||||
connector_set = NULL;
|
||||
fb = NULL;
|
||||
mode = NULL;
|
||||
num_connectors = 0;
|
||||
|
||||
DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
|
||||
|
||||
|
@ -80,8 +80,7 @@ MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
|
||||
#define GMAC0_IRQ4_8 (GMAC0_MIB_INT_BIT | GMAC0_RX_OVERRUN_INT_BIT)
|
||||
|
||||
#define GMAC_OFFLOAD_FEATURES (NETIF_F_SG | NETIF_F_IP_CSUM | \
|
||||
NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM | \
|
||||
NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
|
||||
NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM)
|
||||
|
||||
/**
|
||||
* struct gmac_queue_page - page buffer per-page info
|
||||
@ -1149,23 +1148,13 @@ static int gmac_map_tx_bufs(struct net_device *netdev, struct sk_buff *skb,
|
||||
struct gmac_txdesc *txd;
|
||||
skb_frag_t *skb_frag;
|
||||
dma_addr_t mapping;
|
||||
unsigned short mtu;
|
||||
void *buffer;
|
||||
int ret;
|
||||
|
||||
mtu = ETH_HLEN;
|
||||
mtu += netdev->mtu;
|
||||
if (skb->protocol == htons(ETH_P_8021Q))
|
||||
mtu += VLAN_HLEN;
|
||||
|
||||
/* TODO: implement proper TSO using MTU in word3 */
|
||||
word1 = skb->len;
|
||||
word3 = SOF_BIT;
|
||||
|
||||
if (word1 > mtu) {
|
||||
word1 |= TSS_MTU_ENABLE_BIT;
|
||||
word3 |= mtu;
|
||||
}
|
||||
|
||||
if (skb->len >= ETH_FRAME_LEN) {
|
||||
/* Hardware offloaded checksumming isn't working on frames
|
||||
* bigger than 1514 bytes. A hypothesis about this is that the
|
||||
|
@ -569,7 +569,34 @@ struct rtl8169_counters {
|
||||
__le64 rx_broadcast;
|
||||
__le32 rx_multicast;
|
||||
__le16 tx_aborted;
|
||||
__le16 tx_underun;
|
||||
__le16 tx_underrun;
|
||||
/* new since RTL8125 */
|
||||
__le64 tx_octets;
|
||||
__le64 rx_octets;
|
||||
__le64 rx_multicast64;
|
||||
__le64 tx_unicast64;
|
||||
__le64 tx_broadcast64;
|
||||
__le64 tx_multicast64;
|
||||
__le32 tx_pause_on;
|
||||
__le32 tx_pause_off;
|
||||
__le32 tx_pause_all;
|
||||
__le32 tx_deferred;
|
||||
__le32 tx_late_collision;
|
||||
__le32 tx_all_collision;
|
||||
__le32 tx_aborted32;
|
||||
__le32 align_errors32;
|
||||
__le32 rx_frame_too_long;
|
||||
__le32 rx_runt;
|
||||
__le32 rx_pause_on;
|
||||
__le32 rx_pause_off;
|
||||
__le32 rx_pause_all;
|
||||
__le32 rx_unknown_opcode;
|
||||
__le32 rx_mac_error;
|
||||
__le32 tx_underrun32;
|
||||
__le32 rx_mac_missed;
|
||||
__le32 rx_tcam_dropped;
|
||||
__le32 tdu;
|
||||
__le32 rdu;
|
||||
};
|
||||
|
||||
struct rtl8169_tc_offsets {
|
||||
@ -1670,7 +1697,7 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev,
|
||||
data[9] = le64_to_cpu(counters->rx_broadcast);
|
||||
data[10] = le32_to_cpu(counters->rx_multicast);
|
||||
data[11] = le16_to_cpu(counters->tx_aborted);
|
||||
data[12] = le16_to_cpu(counters->tx_underun);
|
||||
data[12] = le16_to_cpu(counters->tx_underrun);
|
||||
}
|
||||
|
||||
static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/reboot.h>
|
||||
|
||||
#include <asm/asm-offsets.h>
|
||||
#include <asm/ipl.h>
|
||||
@ -247,6 +248,28 @@ static int __init zcore_reipl_init(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int zcore_reboot_and_on_panic_handler(struct notifier_block *self,
|
||||
unsigned long event,
|
||||
void *data)
|
||||
{
|
||||
if (hsa_available)
|
||||
release_hsa();
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static struct notifier_block zcore_reboot_notifier = {
|
||||
.notifier_call = zcore_reboot_and_on_panic_handler,
|
||||
/* we need to be notified before reipl and kdump */
|
||||
.priority = INT_MAX,
|
||||
};
|
||||
|
||||
static struct notifier_block zcore_on_panic_notifier = {
|
||||
.notifier_call = zcore_reboot_and_on_panic_handler,
|
||||
/* we need to be notified before reipl and kdump */
|
||||
.priority = INT_MAX,
|
||||
};
|
||||
|
||||
static int __init zcore_init(void)
|
||||
{
|
||||
unsigned char arch;
|
||||
@ -302,28 +325,15 @@ static int __init zcore_init(void)
|
||||
goto fail;
|
||||
|
||||
zcore_dir = debugfs_create_dir("zcore" , NULL);
|
||||
if (!zcore_dir) {
|
||||
rc = -ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
zcore_reipl_file = debugfs_create_file("reipl", S_IRUSR, zcore_dir,
|
||||
NULL, &zcore_reipl_fops);
|
||||
if (!zcore_reipl_file) {
|
||||
rc = -ENOMEM;
|
||||
goto fail_dir;
|
||||
}
|
||||
zcore_hsa_file = debugfs_create_file("hsa", S_IRUSR|S_IWUSR, zcore_dir,
|
||||
NULL, &zcore_hsa_fops);
|
||||
if (!zcore_hsa_file) {
|
||||
rc = -ENOMEM;
|
||||
goto fail_reipl_file;
|
||||
}
|
||||
return 0;
|
||||
|
||||
fail_reipl_file:
|
||||
debugfs_remove(zcore_reipl_file);
|
||||
fail_dir:
|
||||
debugfs_remove(zcore_dir);
|
||||
register_reboot_notifier(&zcore_reboot_notifier);
|
||||
atomic_notifier_chain_register(&panic_notifier_list, &zcore_on_panic_notifier);
|
||||
|
||||
return 0;
|
||||
fail:
|
||||
diag308(DIAG308_REL_HSA, NULL);
|
||||
return rc;
|
||||
|
@ -919,20 +919,23 @@ vhost_scsi_get_req(struct vhost_virtqueue *vq, struct vhost_scsi_ctx *vc,
|
||||
/* virtio-scsi spec requires byte 0 of the lun to be 1 */
|
||||
vq_err(vq, "Illegal virtio-scsi lun: %u\n", *vc->lunp);
|
||||
} else {
|
||||
struct vhost_scsi_tpg **vs_tpg, *tpg;
|
||||
struct vhost_scsi_tpg **vs_tpg, *tpg = NULL;
|
||||
|
||||
vs_tpg = vhost_vq_get_backend(vq); /* validated at handler entry */
|
||||
|
||||
tpg = READ_ONCE(vs_tpg[*vc->target]);
|
||||
if (unlikely(!tpg)) {
|
||||
vq_err(vq, "Target 0x%x does not exist\n", *vc->target);
|
||||
} else {
|
||||
if (tpgp)
|
||||
*tpgp = tpg;
|
||||
ret = 0;
|
||||
if (vc->target) {
|
||||
/* validated at handler entry */
|
||||
vs_tpg = vhost_vq_get_backend(vq);
|
||||
tpg = READ_ONCE(vs_tpg[*vc->target]);
|
||||
if (unlikely(!tpg)) {
|
||||
vq_err(vq, "Target 0x%x does not exist\n", *vc->target);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (tpgp)
|
||||
*tpgp = tpg;
|
||||
ret = 0;
|
||||
}
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -3227,7 +3227,7 @@ static int ext4_split_extent_at(handle_t *handle,
|
||||
ext4_ext_mark_unwritten(ex2);
|
||||
|
||||
err = ext4_ext_insert_extent(handle, inode, ppath, &newex, flags);
|
||||
if (err != -ENOSPC && err != -EDQUOT)
|
||||
if (err != -ENOSPC && err != -EDQUOT && err != -ENOMEM)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
|
@ -164,6 +164,11 @@ static inline bool kallsyms_show_value(const struct cred *cred)
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline int kallsyms_on_each_symbol(int (*fn)(void *, const char *, struct module *,
|
||||
unsigned long), void *data)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
#endif /*CONFIG_KALLSYMS*/
|
||||
|
||||
static inline void print_ip_sym(const char *loglvl, unsigned long ip)
|
||||
|
@ -2244,6 +2244,10 @@ struct saved_cmdlines_buffer {
|
||||
};
|
||||
static struct saved_cmdlines_buffer *savedcmd;
|
||||
|
||||
/* Holds the size of a cmdline and pid element */
|
||||
#define SAVED_CMDLINE_MAP_ELEMENT_SIZE(s) \
|
||||
(TASK_COMM_LEN + sizeof((s)->map_cmdline_to_pid[0]))
|
||||
|
||||
static inline char *get_saved_cmdlines(int idx)
|
||||
{
|
||||
return &savedcmd->saved_cmdlines[idx * TASK_COMM_LEN];
|
||||
@ -2258,7 +2262,6 @@ static void free_saved_cmdlines_buffer(struct saved_cmdlines_buffer *s)
|
||||
{
|
||||
int order = get_order(sizeof(*s) + s->cmdline_num * TASK_COMM_LEN);
|
||||
|
||||
kfree(s->map_cmdline_to_pid);
|
||||
kmemleak_free(s);
|
||||
free_pages((unsigned long)s, order);
|
||||
}
|
||||
@ -2271,7 +2274,7 @@ static struct saved_cmdlines_buffer *allocate_cmdlines_buffer(unsigned int val)
|
||||
int order;
|
||||
|
||||
/* Figure out how much is needed to hold the given number of cmdlines */
|
||||
orig_size = sizeof(*s) + val * TASK_COMM_LEN;
|
||||
orig_size = sizeof(*s) + val * SAVED_CMDLINE_MAP_ELEMENT_SIZE(s);
|
||||
order = get_order(orig_size);
|
||||
size = 1 << (order + PAGE_SHIFT);
|
||||
page = alloc_pages(GFP_KERNEL, order);
|
||||
@ -2283,16 +2286,11 @@ static struct saved_cmdlines_buffer *allocate_cmdlines_buffer(unsigned int val)
|
||||
memset(s, 0, sizeof(*s));
|
||||
|
||||
/* Round up to actual allocation */
|
||||
val = (size - sizeof(*s)) / TASK_COMM_LEN;
|
||||
val = (size - sizeof(*s)) / SAVED_CMDLINE_MAP_ELEMENT_SIZE(s);
|
||||
s->cmdline_num = val;
|
||||
|
||||
s->map_cmdline_to_pid = kmalloc_array(val,
|
||||
sizeof(*s->map_cmdline_to_pid),
|
||||
GFP_KERNEL);
|
||||
if (!s->map_cmdline_to_pid) {
|
||||
free_saved_cmdlines_buffer(s);
|
||||
return NULL;
|
||||
}
|
||||
/* Place map_cmdline_to_pid array right after saved_cmdlines */
|
||||
s->map_cmdline_to_pid = (unsigned *)&s->saved_cmdlines[val * TASK_COMM_LEN];
|
||||
|
||||
s->cmdline_idx = 0;
|
||||
memset(&s->map_pid_to_cmdline, NO_CMDLINE_MAP,
|
||||
|
@ -1303,12 +1303,11 @@ static enum print_line_t trace_print_print(struct trace_iterator *iter,
|
||||
{
|
||||
struct print_entry *field;
|
||||
struct trace_seq *s = &iter->seq;
|
||||
int max = iter->ent_size - offsetof(struct print_entry, buf);
|
||||
|
||||
trace_assign_type(field, iter->ent);
|
||||
|
||||
seq_print_ip_sym(s, field->ip, flags);
|
||||
trace_seq_printf(s, ": %.*s", max, field->buf);
|
||||
trace_seq_printf(s, ": %s", field->buf);
|
||||
|
||||
return trace_handle_return(s);
|
||||
}
|
||||
@ -1317,11 +1316,10 @@ static enum print_line_t trace_print_raw(struct trace_iterator *iter, int flags,
|
||||
struct trace_event *event)
|
||||
{
|
||||
struct print_entry *field;
|
||||
int max = iter->ent_size - offsetof(struct print_entry, buf);
|
||||
|
||||
trace_assign_type(field, iter->ent);
|
||||
|
||||
trace_seq_printf(&iter->seq, "# %lx %.*s", field->ip, max, field->buf);
|
||||
trace_seq_printf(&iter->seq, "# %lx %s", field->ip, field->buf);
|
||||
|
||||
return trace_handle_return(&iter->seq);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user