mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
Merge b986ec200f ("soc: versatile: realview: fix soc_dev leak during device remove") into android14-6.1-lts
Steps on the way to 6.1.113 Change-Id: I8de726c0f7aac71a8b0b01802a95b0680ce31ecb Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -32,12 +32,12 @@
|
||||
backlight: edp-backlight {
|
||||
compatible = "pwm-backlight";
|
||||
power-supply = <&vcc_12v>;
|
||||
pwms = <&pwm0 0 740740 0>;
|
||||
pwms = <&pwm0 0 125000 0>;
|
||||
};
|
||||
|
||||
bat: battery {
|
||||
compatible = "simple-battery";
|
||||
charge-full-design-microamp-hours = <9800000>;
|
||||
charge-full-design-microamp-hours = <10000000>;
|
||||
voltage-max-design-microvolt = <4350000>;
|
||||
voltage-min-design-microvolt = <3000000>;
|
||||
};
|
||||
|
||||
@@ -1602,6 +1602,7 @@ static void pt_event_stop(struct perf_event *event, int mode)
|
||||
* see comment in intel_pt_interrupt().
|
||||
*/
|
||||
WRITE_ONCE(pt->handle_nmi, 0);
|
||||
barrier();
|
||||
|
||||
pt_config_stop(event);
|
||||
|
||||
@@ -1653,11 +1654,10 @@ static long pt_event_snapshot_aux(struct perf_event *event,
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Here, handle_nmi tells us if the tracing is on
|
||||
* There is no PT interrupt in this mode, so stop the trace and it will
|
||||
* remain stopped while the buffer is copied.
|
||||
*/
|
||||
if (READ_ONCE(pt->handle_nmi))
|
||||
pt_config_stop(event);
|
||||
|
||||
pt_config_stop(event);
|
||||
pt_read_offset(buf);
|
||||
pt_update_head(pt);
|
||||
|
||||
@@ -1669,11 +1669,10 @@ static long pt_event_snapshot_aux(struct perf_event *event,
|
||||
ret = perf_output_copy_aux(&pt->handle, handle, from, to);
|
||||
|
||||
/*
|
||||
* If the tracing was on when we turned up, restart it.
|
||||
* Compiler barrier not needed as we couldn't have been
|
||||
* preempted by anything that touches pt->handle_nmi.
|
||||
* Here, handle_nmi tells us if the tracing was on.
|
||||
* If the tracing was on, restart it.
|
||||
*/
|
||||
if (pt->handle_nmi)
|
||||
if (READ_ONCE(pt->handle_nmi))
|
||||
pt_config_start(event);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -544,8 +544,9 @@ int acpi_device_setup_files(struct acpi_device *dev)
|
||||
* If device has _STR, 'description' file is created
|
||||
*/
|
||||
if (acpi_has_method(dev->handle, "_STR")) {
|
||||
status = acpi_evaluate_object(dev->handle, "_STR",
|
||||
NULL, &buffer);
|
||||
status = acpi_evaluate_object_typed(dev->handle, "_STR",
|
||||
NULL, &buffer,
|
||||
ACPI_TYPE_BUFFER);
|
||||
if (ACPI_FAILURE(status))
|
||||
buffer.pointer = NULL;
|
||||
dev->pnp.str_obj = buffer.pointer;
|
||||
|
||||
@@ -512,6 +512,12 @@ static const struct dmi_system_id maingear_laptop[] = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "GMxXGxx"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* TongFang GMxXGxX/TUXEDO Polaris 15 Gen5 AMD */
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_NAME, "GMxXGxX"),
|
||||
},
|
||||
},
|
||||
{
|
||||
/* TongFang GMxXGxx sold as Eluktronics Inc. RP-15 */
|
||||
.matches = {
|
||||
|
||||
@@ -3380,10 +3380,12 @@ void drbd_uuid_new_current(struct drbd_device *device) __must_hold(local)
|
||||
void drbd_uuid_set_bm(struct drbd_device *device, u64 val) __must_hold(local)
|
||||
{
|
||||
unsigned long flags;
|
||||
if (device->ldev->md.uuid[UI_BITMAP] == 0 && val == 0)
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&device->ldev->md.uuid_lock, flags);
|
||||
if (device->ldev->md.uuid[UI_BITMAP] == 0 && val == 0) {
|
||||
spin_unlock_irqrestore(&device->ldev->md.uuid_lock, flags);
|
||||
return;
|
||||
}
|
||||
|
||||
if (val == 0) {
|
||||
drbd_uuid_move_history(device);
|
||||
device->ldev->md.uuid[UI_HISTORY_START] = device->ldev->md.uuid[UI_BITMAP];
|
||||
|
||||
@@ -876,7 +876,7 @@ is_valid_state(struct drbd_device *device, union drbd_state ns)
|
||||
ns.disk == D_OUTDATED)
|
||||
rv = SS_CONNECTED_OUTDATES;
|
||||
|
||||
else if ((ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) &&
|
||||
else if (nc && (ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) &&
|
||||
(nc->verify_alg[0] == 0))
|
||||
rv = SS_NO_VERIFY_ALG;
|
||||
|
||||
|
||||
@@ -95,8 +95,10 @@ static int bcm2835_rng_init(struct hwrng *rng)
|
||||
return ret;
|
||||
|
||||
ret = reset_control_reset(priv->reset);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
clk_disable_unprepare(priv->clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (priv->mask_interrupts) {
|
||||
/* mask the interrupt */
|
||||
|
||||
@@ -665,6 +665,7 @@ static int __maybe_unused cctrng_resume(struct device *dev)
|
||||
/* wait for Cryptocell reset completion */
|
||||
if (!cctrng_wait_for_reset_completion(drvdata)) {
|
||||
dev_err(dev, "Cryptocell reset not completed");
|
||||
clk_disable_unprepare(drvdata->clk);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ static int mtk_rng_probe(struct platform_device *pdev)
|
||||
dev_set_drvdata(&pdev->dev, priv);
|
||||
pm_runtime_set_autosuspend_delay(&pdev->dev, RNG_AUTOSUSPEND_TIMEOUT);
|
||||
pm_runtime_use_autosuspend(&pdev->dev);
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
devm_pm_runtime_enable(&pdev->dev);
|
||||
|
||||
dev_info(&pdev->dev, "registered RNG driver\n");
|
||||
|
||||
|
||||
@@ -1362,6 +1362,8 @@ void sev_pci_init(void)
|
||||
return;
|
||||
|
||||
err:
|
||||
sev_dev_destroy(psp_master);
|
||||
|
||||
psp_master->sev_data = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ static u64 ehl_err_addr_to_imc_addr(u64 eaddr, int mc)
|
||||
if (igen6_tom <= _4GB)
|
||||
return eaddr + igen6_tolud - _4GB;
|
||||
|
||||
if (eaddr < _4GB)
|
||||
if (eaddr >= igen6_tom)
|
||||
return eaddr + igen6_tolud - igen6_tom;
|
||||
|
||||
return eaddr;
|
||||
|
||||
@@ -115,7 +115,7 @@ void efi_retrieve_tpm2_eventlog(void)
|
||||
}
|
||||
|
||||
/* Allocate space for the logs and copy them. */
|
||||
status = efi_bs_call(allocate_pool, EFI_LOADER_DATA,
|
||||
status = efi_bs_call(allocate_pool, EFI_ACPI_RECLAIM_MEMORY,
|
||||
sizeof(*log_tbl) + log_size, (void **)&log_tbl);
|
||||
|
||||
if (status != EFI_SUCCESS) {
|
||||
|
||||
@@ -56,6 +56,9 @@ int mt7615_thermal_init(struct mt7615_dev *dev)
|
||||
|
||||
name = devm_kasprintf(&wiphy->dev, GFP_KERNEL, "mt7615_%s",
|
||||
wiphy_name(wiphy));
|
||||
if (!name)
|
||||
return -ENOMEM;
|
||||
|
||||
hwmon = devm_hwmon_device_register_with_groups(&wiphy->dev, name, dev,
|
||||
mt7615_hwmon_groups);
|
||||
if (IS_ERR(hwmon))
|
||||
|
||||
@@ -2593,12 +2593,14 @@ static void query_phy_status_page1(struct rtw_dev *rtwdev, u8 *phy_status,
|
||||
else
|
||||
rxsc = GET_PHY_STAT_P1_HT_RXSC(phy_status);
|
||||
|
||||
if (rxsc >= 9 && rxsc <= 12)
|
||||
bw = RTW_CHANNEL_WIDTH_40;
|
||||
else if (rxsc >= 13)
|
||||
bw = RTW_CHANNEL_WIDTH_80;
|
||||
else
|
||||
if (rxsc == 0)
|
||||
bw = rtwdev->hal.current_band_width;
|
||||
else if (rxsc >= 1 && rxsc <= 8)
|
||||
bw = RTW_CHANNEL_WIDTH_20;
|
||||
else if (rxsc >= 9 && rxsc <= 12)
|
||||
bw = RTW_CHANNEL_WIDTH_40;
|
||||
else
|
||||
bw = RTW_CHANNEL_WIDTH_80;
|
||||
|
||||
channel = GET_PHY_STAT_P1_CHANNEL(phy_status);
|
||||
rtw_set_rx_freq_band(pkt_stat, channel);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*
|
||||
* Author: Linus Walleij <linus.walleij@linaro.org>
|
||||
*/
|
||||
#include <linux/device.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/slab.h>
|
||||
@@ -81,6 +82,13 @@ static struct attribute *realview_attrs[] = {
|
||||
|
||||
ATTRIBUTE_GROUPS(realview);
|
||||
|
||||
static void realview_soc_socdev_release(void *data)
|
||||
{
|
||||
struct soc_device *soc_dev = data;
|
||||
|
||||
soc_device_unregister(soc_dev);
|
||||
}
|
||||
|
||||
static int realview_soc_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct regmap *syscon_regmap;
|
||||
@@ -93,7 +101,7 @@ static int realview_soc_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(syscon_regmap))
|
||||
return PTR_ERR(syscon_regmap);
|
||||
|
||||
soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
|
||||
soc_dev_attr = devm_kzalloc(&pdev->dev, sizeof(*soc_dev_attr), GFP_KERNEL);
|
||||
if (!soc_dev_attr)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -106,10 +114,14 @@ static int realview_soc_probe(struct platform_device *pdev)
|
||||
soc_dev_attr->family = "Versatile";
|
||||
soc_dev_attr->custom_attr_group = realview_groups[0];
|
||||
soc_dev = soc_device_register(soc_dev_attr);
|
||||
if (IS_ERR(soc_dev)) {
|
||||
kfree(soc_dev_attr);
|
||||
if (IS_ERR(soc_dev))
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = devm_add_action_or_reset(&pdev->dev, realview_soc_socdev_release,
|
||||
soc_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = regmap_read(syscon_regmap, REALVIEW_SYS_ID_OFFSET,
|
||||
&realview_coreid);
|
||||
if (ret)
|
||||
|
||||
@@ -534,8 +534,10 @@ put_runtime_pm:
|
||||
static void xhci_pci_remove(struct pci_dev *dev)
|
||||
{
|
||||
struct xhci_hcd *xhci;
|
||||
bool set_power_d3;
|
||||
|
||||
xhci = hcd_to_xhci(pci_get_drvdata(dev));
|
||||
set_power_d3 = xhci->quirks & XHCI_SPURIOUS_WAKEUP;
|
||||
|
||||
xhci->xhc_state |= XHCI_STATE_REMOVING;
|
||||
|
||||
@@ -548,11 +550,11 @@ static void xhci_pci_remove(struct pci_dev *dev)
|
||||
xhci->shared_hcd = NULL;
|
||||
}
|
||||
|
||||
/* Workaround for spurious wakeups at shutdown with HSW */
|
||||
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
|
||||
pci_set_power_state(dev, PCI_D3hot);
|
||||
|
||||
usb_hcd_pci_remove(dev);
|
||||
|
||||
/* Workaround for spurious wakeups at shutdown with HSW */
|
||||
if (set_power_d3)
|
||||
pci_set_power_state(dev, PCI_D3hot);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
|
||||
@@ -157,7 +157,8 @@ static unsigned long dir_block_index(unsigned int level,
|
||||
unsigned long bidx = 0;
|
||||
|
||||
for (i = 0; i < level; i++)
|
||||
bidx += dir_buckets(i, dir_level) * bucket_blocks(i);
|
||||
bidx += mul_u32_u32(dir_buckets(i, dir_level),
|
||||
bucket_blocks(i));
|
||||
bidx += idx * bucket_blocks(level);
|
||||
return bidx;
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ static unsigned int __free_extent_tree(struct f2fs_sb_info *sbi,
|
||||
static void __drop_largest_extent(struct extent_tree *et,
|
||||
pgoff_t fofs, unsigned int len)
|
||||
{
|
||||
if (fofs < et->largest.fofs + et->largest.len &&
|
||||
if (fofs < (pgoff_t)et->largest.fofs + et->largest.len &&
|
||||
fofs + len > et->largest.fofs) {
|
||||
et->largest.len = 0;
|
||||
et->largest_updated = true;
|
||||
@@ -467,7 +467,7 @@ static bool __lookup_extent_tree(struct inode *inode, pgoff_t pgofs,
|
||||
|
||||
if (type == EX_READ &&
|
||||
et->largest.fofs <= pgofs &&
|
||||
et->largest.fofs + et->largest.len > pgofs) {
|
||||
(pgoff_t)et->largest.fofs + et->largest.len > pgofs) {
|
||||
*ei = et->largest;
|
||||
ret = true;
|
||||
stat_inc_largest_node_hit(sbi);
|
||||
|
||||
@@ -2648,7 +2648,8 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi,
|
||||
|
||||
inode_lock(inode);
|
||||
|
||||
if (is_inode_flag_set(inode, FI_COMPRESS_RELEASED)) {
|
||||
if (is_inode_flag_set(inode, FI_COMPRESS_RELEASED) ||
|
||||
f2fs_is_atomic_file(inode)) {
|
||||
err = -EINVAL;
|
||||
goto unlock_out;
|
||||
}
|
||||
@@ -2671,7 +2672,7 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi,
|
||||
* block addresses are continuous.
|
||||
*/
|
||||
if (f2fs_lookup_read_extent_cache(inode, pg_start, &ei)) {
|
||||
if (ei.fofs + ei.len >= pg_end)
|
||||
if ((pgoff_t)ei.fofs + ei.len >= pg_end)
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -2877,6 +2878,11 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in,
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
if (f2fs_is_atomic_file(src) || f2fs_is_atomic_file(dst)) {
|
||||
ret = -EINVAL;
|
||||
goto out_unlock;
|
||||
}
|
||||
|
||||
ret = -EINVAL;
|
||||
if (pos_in + len > src->i_size || pos_in + len < pos_in)
|
||||
goto out_unlock;
|
||||
@@ -3248,6 +3254,11 @@ static int f2fs_ioc_set_pin_file(struct file *filp, unsigned long arg)
|
||||
|
||||
inode_lock(inode);
|
||||
|
||||
if (f2fs_is_atomic_file(inode)) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!pin) {
|
||||
clear_inode_flag(inode, FI_PIN_FILE);
|
||||
f2fs_i_gc_failures_write(inode, 0);
|
||||
|
||||
@@ -3334,9 +3334,9 @@ static inline bool sanity_check_area_boundary(struct f2fs_sb_info *sbi,
|
||||
u32 segment_count = le32_to_cpu(raw_super->segment_count);
|
||||
u32 log_blocks_per_seg = le32_to_cpu(raw_super->log_blocks_per_seg);
|
||||
u64 main_end_blkaddr = main_blkaddr +
|
||||
(segment_count_main << log_blocks_per_seg);
|
||||
((u64)segment_count_main << log_blocks_per_seg);
|
||||
u64 seg_end_blkaddr = segment0_blkaddr +
|
||||
(segment_count << log_blocks_per_seg);
|
||||
((u64)segment_count << log_blocks_per_seg);
|
||||
|
||||
if (segment0_blkaddr != cp_blkaddr) {
|
||||
f2fs_info(sbi, "Mismatch start address, segment0(%u) cp_blkaddr(%u)",
|
||||
|
||||
14
fs/fcntl.c
14
fs/fcntl.c
@@ -85,8 +85,8 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
|
||||
return error;
|
||||
}
|
||||
|
||||
static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
|
||||
int force)
|
||||
void __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
|
||||
int force)
|
||||
{
|
||||
write_lock_irq(&filp->f_owner.lock);
|
||||
if (force || !filp->f_owner.pid) {
|
||||
@@ -96,19 +96,13 @@ static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
|
||||
|
||||
if (pid) {
|
||||
const struct cred *cred = current_cred();
|
||||
security_file_set_fowner(filp);
|
||||
filp->f_owner.uid = cred->uid;
|
||||
filp->f_owner.euid = cred->euid;
|
||||
}
|
||||
}
|
||||
write_unlock_irq(&filp->f_owner.lock);
|
||||
}
|
||||
|
||||
void __f_setown(struct file *filp, struct pid *pid, enum pid_type type,
|
||||
int force)
|
||||
{
|
||||
security_file_set_fowner(filp);
|
||||
f_modown(filp, pid, type, force);
|
||||
}
|
||||
EXPORT_SYMBOL(__f_setown);
|
||||
|
||||
int f_setown(struct file *filp, unsigned long arg, int force)
|
||||
@@ -144,7 +138,7 @@ EXPORT_SYMBOL(f_setown);
|
||||
|
||||
void f_delown(struct file *filp)
|
||||
{
|
||||
f_modown(filp, NULL, PIDTYPE_TGID, 1);
|
||||
__f_setown(filp, NULL, PIDTYPE_TGID, 1);
|
||||
}
|
||||
|
||||
pid_t f_getown(struct file *filp)
|
||||
|
||||
@@ -757,6 +757,10 @@ again:
|
||||
continue;
|
||||
|
||||
spin_lock(&inode->i_lock);
|
||||
if (atomic_read(&inode->i_count)) {
|
||||
spin_unlock(&inode->i_lock);
|
||||
continue;
|
||||
}
|
||||
if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) {
|
||||
spin_unlock(&inode->i_lock);
|
||||
continue;
|
||||
|
||||
@@ -1953,6 +1953,7 @@ restart:
|
||||
set_bit(ops->owner_flag_bit, &sp->so_flags);
|
||||
nfs4_put_state_owner(sp);
|
||||
status = nfs4_recovery_handle_error(clp, status);
|
||||
nfs4_free_state_owners(&freeme);
|
||||
return (status != 0) ? status : -EAGAIN;
|
||||
}
|
||||
|
||||
|
||||
@@ -396,7 +396,8 @@ void padata_do_serial(struct padata_priv *padata)
|
||||
/* Sort in ascending order of sequence number. */
|
||||
list_for_each_prev(pos, &reorder->list) {
|
||||
cur = list_entry(pos, struct padata_priv, list);
|
||||
if (cur->seq_nr < padata->seq_nr)
|
||||
/* Compare by difference to consider integer wrap around */
|
||||
if ((signed int)(cur->seq_nr - padata->seq_nr) < 0)
|
||||
break;
|
||||
}
|
||||
list_add(&padata->list, pos);
|
||||
|
||||
@@ -141,13 +141,14 @@ static void fill_pool(void)
|
||||
* READ_ONCE()s pair with the WRITE_ONCE()s in pool_lock critical
|
||||
* sections.
|
||||
*/
|
||||
while (READ_ONCE(obj_nr_tofree) && (READ_ONCE(obj_pool_free) < obj_pool_min_free)) {
|
||||
while (READ_ONCE(obj_nr_tofree) &&
|
||||
READ_ONCE(obj_pool_free) < debug_objects_pool_min_level) {
|
||||
raw_spin_lock_irqsave(&pool_lock, flags);
|
||||
/*
|
||||
* Recheck with the lock held as the worker thread might have
|
||||
* won the race and freed the global free list already.
|
||||
*/
|
||||
while (obj_nr_tofree && (obj_pool_free < obj_pool_min_free)) {
|
||||
while (obj_nr_tofree && (obj_pool_free < debug_objects_pool_min_level)) {
|
||||
obj = hlist_entry(obj_to_free.first, typeof(*obj), node);
|
||||
hlist_del(&obj->node);
|
||||
WRITE_ONCE(obj_nr_tofree, obj_nr_tofree - 1);
|
||||
|
||||
Reference in New Issue
Block a user